rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
def __init__(self, use_labels=False, for_update=False, limit=None, offset=None, order_by=None, group_by=None, bind=None, | def __init__(self, use_labels=False, for_update=False, limit=None, offset=None, order_by=None, group_by=None, bind=None, | def _generative(fn, *args, **kw): """Mark a method as generative.""" self = args[0]._generate() fn(self, *args[1:], **kw) return self | 0dbbd6fe669afed79be8f639455e324ab9b817ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1074/0dbbd6fe669afed79be8f639455e324ab9b817ca/expression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3441,
1535,
12,
4293,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
3882,
279,
707,
487,
1215,
1535,
12123,
225,
365,
273,
833,
63,
20,
65,
6315,
7163,
1435,
2295,
12,
2890,
16,
380,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3441,
1535,
12,
4293,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
3882,
279,
707,
487,
1215,
1535,
12123,
225,
365,
273,
833,
63,
20,
65,
6315,
7163,
1435,
2295,
12,
2890,
16,
380,... |
and that's done so that MmpFiles are easier to clone. | and that's done so that an entry in MmpFile.lines can be a pointer into the MmpFile.atoms list. When a file is cloned, we clone the atoms but keep the same lines. | def str(self): return self._str | 7077800692ccb733243ea7f8f6e6b4bbea94ae06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/7077800692ccb733243ea7f8f6e6b4bbea94ae06/MmpFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
12,
2890,
4672,
327,
365,
6315,
701,
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,
609,
12,
2890,
4672,
327,
365,
6315,
701,
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,... |
ret = '' | ret = [] | def wrap_row(row, max_col): """Wrap a single row""" spaces = _beginning_space_re.match(row).group() row = row[len(spaces):] return wrap(row, initial_indent=spaces, subsequent_indent=spaces, width=max_col) | e1b9f10e6303507873c2ddab5bfad28d8760042a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1780/e1b9f10e6303507873c2ddab5bfad28d8760042a/textutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
67,
492,
12,
492,
16,
943,
67,
1293,
4672,
3536,
2964,
279,
2202,
1027,
8395,
7292,
273,
389,
10086,
2093,
67,
2981,
67,
266,
18,
1916,
12,
492,
2934,
1655,
1435,
1027,
273,
1027... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
67,
492,
12,
492,
16,
943,
67,
1293,
4672,
3536,
2964,
279,
2202,
1027,
8395,
7292,
273,
389,
10086,
2093,
67,
2981,
67,
266,
18,
1916,
12,
492,
2934,
1655,
1435,
1027,
273,
1027... |
original_files = dict() | plates = set() original_files = set() | def get_analysis_ctx(self, plate_id): """Retrieves a plate analysis context for a given plate.""" original_files = dict() original_file_image_map = dict() images = self.find_images_for_plate(plate_id) for i, image in enumerate(images): for annotation_link in image.copyAnnotationLinks(): annotation = annotation_link.child if isinstance(annotation, FileAnnotationI): f = annotation.file original_files[f.id.val] = f original_file_image_map[f.id.val] = image for klass in self.implementations: if klass.is_this_type(original_files): return klass(images, original_files, original_file_image_map, plate_id, self.service_factory) raise MeasurementError( "Unable to find suitable analysis context for plate: %d" % \ plate_id) | c2875f08f9c0a7a72bd09d2cdf7315ef90a84053 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/c2875f08f9c0a7a72bd09d2cdf7315ef90a84053/populate_roi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12746,
67,
5900,
12,
2890,
16,
21972,
67,
350,
4672,
3536,
6960,
279,
21972,
6285,
819,
364,
279,
864,
21972,
12123,
377,
886,
815,
273,
444,
1435,
2282,
67,
2354,
273,
444,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12746,
67,
5900,
12,
2890,
16,
21972,
67,
350,
4672,
3536,
6960,
279,
21972,
6285,
819,
364,
279,
864,
21972,
12123,
377,
886,
815,
273,
444,
1435,
2282,
67,
2354,
273,
444,
1... |
self.buff.delete_selection(True,True) | self.buff.delete_selection(False,True) | def copy_clipboard(self,widget,param=None): selec = gtk.clipboard_get(gdk.SELECTION_PRIMARY) clip = gtk.clipboard_get(gdk.SELECTION_CLIPBOARD) text = selec.wait_for_text() if text: #we replace the arrow by the original "-" newtext = text.replace(self.bullet1, "-") clip.set_text(newtext) if param == "cut" : self.buff.delete_selection(True,True) self.stop_emission("cut_clipboard") else : self.stop_emission("copy_clipboard") | 05e1703097b75522bc656454958c77910f5b566b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/05e1703097b75522bc656454958c77910f5b566b/taskview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
14161,
3752,
12,
2890,
16,
6587,
16,
891,
33,
7036,
4672,
357,
557,
273,
22718,
18,
14161,
3752,
67,
588,
12,
75,
2883,
18,
1090,
15445,
67,
18864,
13,
6807,
273,
22718,
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,
1610,
67,
14161,
3752,
12,
2890,
16,
6587,
16,
891,
33,
7036,
4672,
357,
557,
273,
22718,
18,
14161,
3752,
67,
588,
12,
75,
2883,
18,
1090,
15445,
67,
18864,
13,
6807,
273,
22718,
18,
... |
redirect(url) | redirect(url, **kwds) | def default(self, *args, **kwds): identity = request.environ.get('repoze.who.identity') if identity: csrf = identity.get('_csrf_token') if csrf: kwds['_csrf_token'] = csrf | 0ebabdf2fee62deeb3ba63418f6fbd22f93c08dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12732/0ebabdf2fee62deeb3ba63418f6fbd22f93c08dd/root.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
4215,
273,
590,
18,
28684,
18,
588,
2668,
7422,
8489,
18,
3350,
83,
18,
10781,
6134,
309,
4215,
30,
19483,
273,
4215,
18,
588,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
4215,
273,
590,
18,
28684,
18,
588,
2668,
7422,
8489,
18,
3350,
83,
18,
10781,
6134,
309,
4215,
30,
19483,
273,
4215,
18,
588,
2668... |
return not abs(cmp(a, b)) | return not abs(cmp(a, b, sh, st)) | def _cmp(a, b): try: return not abs(cmp(a, b)) except os.error: return 2 | edf7c5c55a72ebb48bb7b26ec2d74e111df0efde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/edf7c5c55a72ebb48bb7b26ec2d74e111df0efde/filecmp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9625,
12,
69,
16,
324,
4672,
775,
30,
327,
486,
2417,
12,
9625,
12,
69,
16,
324,
16,
699,
16,
384,
3719,
1335,
1140,
18,
1636,
30,
327,
576,
282,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
9625,
12,
69,
16,
324,
4672,
775,
30,
327,
486,
2417,
12,
9625,
12,
69,
16,
324,
16,
699,
16,
384,
3719,
1335,
1140,
18,
1636,
30,
327,
576,
282,
2,
-100,
-100,
-100,
-100,
-1... |
output = self.get_memdump(address, move_idx) | output = self._get_memdump(address, move_idx) | def dump(self, address = None, move_idx = 0): if not address: address = self.first if self.dumpmode == Constants.REGISTERS: output = self.get_registers() self.memory.set_label("".join(output)) return if not address: print "ERROR: address needed" return if self.dumpmode == Constants.MEMDUMP: output = self.get_memdump(address, move_idx) elif self.dumpmode == Constants.DISASM: output = self.get_disasm(address, move_idx) else: print "ERROR: unknown dumpmode:", self.dumpmode return self.memory.set_label("".join(output)) if move_idx: self.reset_entry() | 5c46ebd953f1a4b6b2f257db33484ce37c6b09af /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8501/5c46ebd953f1a4b6b2f257db33484ce37c6b09af/debugui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
12,
2890,
16,
1758,
273,
599,
16,
3635,
67,
3465,
273,
374,
4672,
309,
486,
1758,
30,
1758,
273,
365,
18,
3645,
225,
309,
365,
18,
8481,
3188,
422,
5245,
18,
5937,
5511,
11367,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
12,
2890,
16,
1758,
273,
599,
16,
3635,
67,
3465,
273,
374,
4672,
309,
486,
1758,
30,
1758,
273,
365,
18,
3645,
225,
309,
365,
18,
8481,
3188,
422,
5245,
18,
5937,
5511,
11367,
... |
self.server_version = "MoinMoin %s %s" % (version.revision, server.__class__.__name__) | self.server_version = "MoinMoin %s %s %s" % (version.release, version.revision, server.__class__.__name__) | def __init__(self, request, client_address, server): self.server_version = "MoinMoin %s %s" % (version.revision, server.__class__.__name__) self.expires = 0 SimpleHTTPServer.SimpleHTTPRequestHandler.__init__(self, request, client_address, server) | 26f3531207d84eeb4b7b224411292aadd8ee62f2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/26f3531207d84eeb4b7b224411292aadd8ee62f2/STANDALONE.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
590,
16,
1004,
67,
2867,
16,
1438,
4672,
365,
18,
3567,
67,
1589,
273,
315,
49,
885,
49,
885,
738,
87,
738,
87,
738,
87,
6,
738,
261,
1589,
18,
9340,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
590,
16,
1004,
67,
2867,
16,
1438,
4672,
365,
18,
3567,
67,
1589,
273,
315,
49,
885,
49,
885,
738,
87,
738,
87,
738,
87,
6,
738,
261,
1589,
18,
9340,... |
data['form']['fiscalyear'] = 0 else : data['form']['fiscalyear'] = 1 | def _check_state(self, cr, uid, data, context): if data['form']['state'] == 'bydate': _check_date(self, cr, uid, data, context) data['form']['fiscalyear'] = 0 else : data['form']['fiscalyear'] = 1 return data['form'] | 946f31968454eadcca1fa3482d8ab81791e3a932 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/946f31968454eadcca1fa3482d8ab81791e3a932/wizard_general_ledger_report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
2019,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
225,
309,
501,
3292,
687,
21712,
2019,
3546,
422,
296,
1637,
712,
4278,
389,
1893,
67,
712,
12,
2890,
16,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
2019,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
225,
309,
501,
3292,
687,
21712,
2019,
3546,
422,
296,
1637,
712,
4278,
389,
1893,
67,
712,
12,
2890,
16,
4... | |
return self.__galois_closure | return self.__galois_closure.change_names(names) | def galois_closure(self, names=None): """ Return number field $K$ that is the Galois closure of self, i.e., is generated by all roots of the defining polynomial of self | 05f3a2a8ba9f83942ded7f49b8c102545c57b7b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/05f3a2a8ba9f83942ded7f49b8c102545c57b7b9/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24902,
19606,
67,
20823,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
1300,
652,
271,
47,
8,
716,
353,
326,
611,
287,
19606,
7213,
434,
365,
16,
277,
18,
73,
12990,
353,
4374,
635,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24902,
19606,
67,
20823,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
1300,
652,
271,
47,
8,
716,
353,
326,
611,
287,
19606,
7213,
434,
365,
16,
277,
18,
73,
12990,
353,
4374,
635,
... |
print "lax" | def dns(self, name, qtype): """DNS query. | ffcadf6c0131fd60d268d697495b8448103ab4a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/139/ffcadf6c0131fd60d268d697495b8448103ab4a2/spf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6605,
12,
2890,
16,
508,
16,
28056,
4672,
3536,
11602,
843,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6605,
12,
2890,
16,
508,
16,
28056,
4672,
3536,
11602,
843,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
svncmd = "svn co %s://%s/%s" % (proto, svnroot, module) | svncmd = "svn co -r {%s} %s://%s/%s" % (date, proto, svnroot, module) | def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls | 631a03d613a25dddb82f650b98474c19f1461e56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2672/631a03d613a25dddb82f650b98474c19f1461e56/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
12,
2890,
16,
302,
16,
6903,
273,
5378,
4672,
3536,
5005,
6903,
8395,
309,
486,
6903,
30,
6903,
273,
365,
18,
10518,
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,
1960,
12,
2890,
16,
302,
16,
6903,
273,
5378,
4672,
3536,
5005,
6903,
8395,
309,
486,
6903,
30,
6903,
273,
365,
18,
10518,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));%(gl_error_test)s | def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """ | f451d00ddca4eb2ccab5024f40dfe34ce5145e95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/f451d00ddca4eb2ccab5024f40dfe34ce5145e95/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
2802,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
923,
67,
3813,
273,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
2598,
1179,
2802,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
923,
67,
3813,
273,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
x = complex(x, 0) | x = _to_complex(x) | def sqrt(x): """sqrt(x) Return the square root of x.""" x = complex(x, 0) if x.real == 0. and x.imag == 0.: real, imag = 0, 0 else: s = math.sqrt(0.5*(math.fabs(x.real) + math.hypot(x.real,x.imag))) d = 0.5*x.imag/s if x.real > 0.: real = s imag = d elif x.imag >= 0.: real = d imag = s else: real = -d imag = -s return complex(real, imag) | d265b40c2f1e228c0cbd532ea68ae4f9079e1876 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/d265b40c2f1e228c0cbd532ea68ae4f9079e1876/cmath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5700,
12,
92,
4672,
3536,
24492,
12,
92,
13,
225,
2000,
326,
8576,
1365,
434,
619,
12123,
225,
619,
273,
389,
869,
67,
14259,
12,
92,
13,
309,
619,
18,
7688,
422,
374,
18,
471,
619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5700,
12,
92,
4672,
3536,
24492,
12,
92,
13,
225,
2000,
326,
8576,
1365,
434,
619,
12123,
225,
619,
273,
389,
869,
67,
14259,
12,
92,
13,
309,
619,
18,
7688,
422,
374,
18,
471,
619,
... |
u = u''.join(map(chr, list(range(0,0xd800)) + list(range(0xe000,0x10000)))) | u = ''.join(map(chr, list(range(0,0xd800)) + list(range(0xe000,0x10000)))) | def test_codecs(self): # Encoding self.assertEqual('hello'.encode('ascii'), b'hello') self.assertEqual('hello'.encode('utf-7'), b'hello') self.assertEqual('hello'.encode('utf-8'), b'hello') self.assertEqual('hello'.encode('utf8'), b'hello') self.assertEqual('hello'.encode('utf-16-le'), b'h\000e\000l\000l\000o\000') self.assertEqual('hello'.encode('utf-16-be'), b'\000h\000e\000l\000l\000o') self.assertEqual('hello'.encode('latin-1'), b'hello') | 86a62bddd779a230edc636200e3a16808e32d28d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/86a62bddd779a230edc636200e3a16808e32d28d/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
710,
2143,
12,
2890,
4672,
468,
13400,
365,
18,
11231,
5812,
2668,
23711,
10332,
3015,
2668,
9184,
19899,
324,
11,
23711,
6134,
365,
18,
11231,
5812,
2668,
23711,
10332,
3015,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
710,
2143,
12,
2890,
4672,
468,
13400,
365,
18,
11231,
5812,
2668,
23711,
10332,
3015,
2668,
9184,
19899,
324,
11,
23711,
6134,
365,
18,
11231,
5812,
2668,
23711,
10332,
3015,
26... |
def VisualizeNet(net,xy,figsize=(6,6),coloredNodes=True,equalsize=False,labels={},fontsize=7,showAllNodes=True,nodeColor=None,nodeSize=1.0,nodeColors={},bgcolor='white',maxwidth=2.0,minwidth=0.2,uselabels='none',edgeColorMap='winter',weightLimits=None,setNodeColorsByProperty=None,nodeColorMap='winter',nodePropertyLimits=None,nodeLabel_xOffset=None,coloredvertices=None,vcolor=None,vsize=None): | def VisualizeNet(net,xy,figsize=(6,6),coloredNodes=True,equalsize=False,labels={},fontsize=7,showAllNodes=True,nodeColor=None,nodeSize=1.0,nodeColors={},bgcolor='white',maxwidth=2.0,minwidth=0.2,uselabels='none',edgeColorMap='winter',weightLimits=None,setNodeColorsByProperty=None,nodeColorMap='winter',nodePropertyLimits=None,nodeLabel_xOffset=None,coloredvertices=None,vcolor=None,vsize=None,frame=False): | def VisualizeNet(net,xy,figsize=(6,6),coloredNodes=True,equalsize=False,labels={},fontsize=7,showAllNodes=True,nodeColor=None,nodeSize=1.0,nodeColors={},bgcolor='white',maxwidth=2.0,minwidth=0.2,uselabels='none',edgeColorMap='winter',weightLimits=None,setNodeColorsByProperty=None,nodeColorMap='winter',nodePropertyLimits=None,nodeLabel_xOffset=None,coloredvertices=None,vcolor=None,vsize=None): ''' Visualizes a network. Inputs: net = network to be visualized (of type SymmNet() ). xy = coordinates (usually originating from visuals.Himmeli, e.g. h=visuals.Himmeli(net,...,...) followed by xy=h.getCoordinates() figsize=(x,y) (default (6,6)) Size of the figure produced by VisualizeNet coloredNodes = (True/False), nodeColors = dictionary of node colors by node index, and nodeColor = an RGB color tuple with three values between 0 and 1 setNodeColorByProperty nodeColorMap nodePropertyLimits If 'setNodeColorsByProperty' is specified, any node not appearing in the dictionary 'nodeColors' will be colored according to the given property (using'nodeColorMap' and 'nodePropertyLimits'). Option 'nodeColors' overrides the 'setNodeColorsByProperty' option. If coloredNodes='False', nodes are plotted white. If coloredNodes='True' (default), a) if dictionary 'nodeColors' is given, it is used. If it does not contain a color for every node, the rest are colored 1) according to property 'setNodeColorsByProperty', if it is given, or else 2) by 'nodeColor' if it is given, or 3) white if neither of the above is given. b) if dictionary 'nodeColors' is not given, but 'nodeColor' is given, all nodes are colored with 'nodeColor'. c) if neither 'setNodeColorsByProperty' nor dictionary 'nodeColors' or 'nodeColor' is given, nodes are colored by strength using the colormap 'nodeColorMap' (by default 'winter'). equalsize = (True/False) True: all nodes are of same size, input as nodeSize, default 1.0. False: sizes are based on node strength. showAllNodes = (True/False) something of a quick hack; if True, displays disconnected components and nodes which have no edges left after e.g. thresholding bgcolor = [r g b], r/g/b between 0.0 and 1.0. Background color, default is black. maxwidth = max width of edges as plotted, default 2.0 minwidth = min width of edges as plotted, default 0.2 uselabels = ('none','all') Determines if node labels are shown. 'none' shows none, 'all' shows all. Note: any labels input in dict labels ({nodename:labelstring}) are always shown; use this dict to show labels next to your chosen nodes of interest. fontsize=size Sets font size for labels. Default is 7. edgeColorMap=myMap allows the user to set color scheme for edges. Edges are always colored according to edge weights, which are first normalized to the range (0,1) and then transformed to colors using edgeColorMap. There are 150 colormaps available in pylab; for a full listing, please see help(pylab.cm) (and look for DATA). Or try, for example, edgeColorMap='orange' or edgeColorMap='primary', two colormaps of our own that are not available in pylab. weightLimits=(0,5) The tuple (minWeight, maxWeight) provides the minimum and maximum value for weights. If none are given, (nearly) the true min and max weights in the network will be used. The weightLimits are used for setting edge colors and width. They enable the user to plot several networks (which may have different min and max weights) such that a certain color and width always correspond to a certain edge weight. Thus, the color and width in the visualization can be used to infer edge weight. If the network turns out to contain weights above the given maxWeight (below minWeight) these will be rounded downwards (upwards) to the given limit. It is more reasonable however for the user to provide limits that can accommodate all weights, this is just a necessary precaution for the case where the given limits are too tight. nodeLabel_xOffset (if none is given, nodeSize/40 will be used) amount for moving node labels the right so that the text does not fall on the nodes Usage examples: m=pynet.SymmNet() m[0][1]=1.0 m[1][2]=3.5 m[0][2]=5.0 Here are the coordinates, a dictionary that contains 2-tuples xy={} xy[0]=(0,0) xy[1]=(4,0) xy[2]=(2,3) f=FigureCanvasBase(visuals.VisualizeNet(m,xy)) f.print_eps("tmp.eps",dpi=80.0) f=FigureCanvasBase(visuals.VisualizeNet(m,xy,edgeColorMap='orange')) f.print_eps("tmp2.eps",dpi=80.0) f=FigureCanvasBase(visuals.VisualizeNet(m,xy,edgeColorMap='orange',equalsize=True,nodeSize=16)) f.print_eps("tmp3.eps",dpi=80.0) (General questions: Is there a neater way to output the figures than using FigureCanvasBase? How can I have a look at the figures from within python, without saving them to .eps files?) ''' #warn about obsolete input arguments if coloredvertices!=None or vcolor!=None or vsize!=None: warnings.warn("\n\n The options \n \t coloredvertices, vcolor, and vsize \n are now obsolete. Please use instead \n \t coloredNodes, nodeColor, and nodeSize.\n") if coloredvertices!=None: coloredNodes=coloredvertices if vcolor!=None and nodeColor==None: nodeColor=vcolor if vsize!=None: nodeSize=vsize # the following is for the EDEN software, where "nets" or nets # derived from matrices can have edge distances instead of weights if hasattr(net,'matrixtype'): if net.matrixtype==0: net=transforms.dist_to_weights(net) thisfigure=Figure(figsize=figsize,dpi=100,facecolor=bgcolor) axes=thisfigure.add_subplot(111) axes.set_axis_bgcolor(bgcolor) # sets the color for node labels fontcolor='w' if bgcolor=='white': fontcolor='k' # first draw all edges edges=list(net.edges) wlist=[] for edge in edges: wlist.append(edge[2]) wmin=min(wlist) wmax=max(wlist) # If weightLimits were not given, use (almost) the true min # and max weights in the network. Note: using a value slightly # below wmin, because otherwise when normalizing the weights, # the minimum weights would be transformed to zero and the # edges not visible at all. - Riitta if weightLimits==None: if wmin==0: weightLimits=(wmin,wmax) else: weightLimits=(wmin-0.00001,wmax) myEdgeColorMap=setColorMap(edgeColorMap) for edge in edges: width=setEdgeWidth(edge[2],weightLimits,minwidth,maxwidth) colour=setColor(edge[2],weightLimits,myEdgeColorMap) xcoords=[xy[edge[0]][0],xy[edge[1]][0]] ycoords=[xy[edge[0]][1],xy[edge[1]][1]] plot_edge(axes,xcoords,ycoords,width=width,colour=colour) # then draw nodes, depending on given options # showAllNodes displays also nodes who do not have any edges # left after e.g. thresholding nodelist=[] if showAllNodes: for node in xy.keys(): nodelist.append(node) else: for node in net: nodelist.append(node) minnode=2.0 maxnode=6.0 strengths=netext.strengths(net) maxs=max(strengths.values()) mins=min(strengths.values()) if not(equalsize): A=(maxnode-minnode)/(maxs-mins) B=maxnode-A*maxs myNodeColorMap=setColorMap(nodeColorMap) # If nodePropertyLimits were not given, use the true min and # max property values in the network. Note: unlike with # weights, there is no problem with zero values, as the nodes # will be plotted in any case. if nodePropertyLimits==None: nodePropertyLimits=(wmin,wmax) for node in nodelist: # first define size if equalsize: nodesize=nodeSize if (nodesize<1.0): # hack: Himmeli wants size <1.0 nodesize=nodesize*maxnode # if Himmeli-type size used, scale up else: if node in net: nodesize=A*strengths[node]+B else: nodesize=minnode if node in net: nodestrength=strengths[node] else: nodestrength=mins # this is for nodes which appear in MST coords (i.e. have zero links) # and are thus not included in net, but should yet be displayed when # visualizing a thresholded network # then determine color if coloredNodes: if setNodeColorsByProperty!=None: # if setNodeColorsByProperty is given, use it initially value=net.nodeProperty[setNodeColorsByProperty][node] color=setColor(value,nodePropertyLimits,myNodeColorMap) if len(nodeColors)>0: # if dict nodeColors is given, it overrides setNodeColorsByProperty if not nodeColors.get(node): # if node is not contained in dict nodeColors if setNodeColorsByProperty==None: # use setNodeColorsByProperty if it was given, but otherwise... if nodeColor!='None': color=nodeColor # ...use nodeColor if given, ... else: color=(1,1,1) # ...and finally white if not else: # if node IS contained in dict nodeColors, use nodeColors[node] ctemp=nodeColors[node] if len(ctemp)==6: # recognize as Himmeli-type string ('999999') rc=float(ctemp[0:2])/99.0 gc=float(ctemp[2:4])/99.0 bc=float(ctemp[4:6])/99.0 # this is a stupid hack; sometimes rounding errors result # in rc=1.0 + epsilon and matplotlib complains... if (rc<0.0): rc=0.0 elif rc>1.0: rc=1.0 if (bc<0.0): bc=0.0 elif bc>1.0: bc=1.0 if (gc<0.0): gc=0.0 elif gc>1.0: gc=1.0 color=(rc,gc,bc) else: color=nodeColors[node] #otherwise assume it is an RGB tuple elif setNodeColorsByProperty==None and nodeColor!=None: # if neither setNodeColorsByProperty or dict nodeColors is given, but nodeColor is, use nodeColor if len(nodeColor)==6: rc=float(nodeColor[0:2])/99.0 gc=float(nodeColor[2:4])/99.0 bc=float(nodeColor[4:6])/99.0 if (rc<0.0): rc=0.0 elif rc>1.0: rc=1.0 if (bc<0.0): bc=0.0 elif bc>1.0: bc=1.0 if (gc<0.0): gc=0.0 elif gc>1.0: gc=1.0 color=(rc,gc,bc) else: color=nodeColor elif setNodeColorsByProperty==None: color=setColor(nodestrength,(mins,maxs),myNodeColorMap) # set color by node strength else: color=(1.0,1.0,1.0) # if coloredNodes=False, use white if nodeLabel_xOffset==None: nodeLabel_xOffset=float(nodesize)/40 # move node labels slightly to the right so that they don't coincide on the nodes plot_node(axes,x=xy[node][0],y=xy[node][1],color=color,size=nodesize) if uselabels=='all': axes.annotate(str(node),(xy[node][0]+nodeLabel_xOffset,xy[node][1]),color=fontcolor,size=fontsize) elif node in labels: axes.annotate(labels[node],(xy[node][0]+nodeLabel_xOffset,xy[node][1]),color=fontcolor,size=fontsize) setp(axes,'xticks','','xticklabels','','yticks','','yticklabels','') xylist=xy.values() xlist=[] ylist=[] for elem in xylist: xlist.append(elem[0]) ylist.append(elem[1]) minx=min(xlist) maxx=max(xlist) miny=min(ylist) maxy=max(ylist) xdelta=0.05*(maxx-minx) ydelta=0.05*(maxy-miny) setp(axes,'xlim',(minx-xdelta,maxx+xdelta),'ylim',(miny-ydelta,maxy+ydelta)) return thisfigure | e2a5ba16264791a796bf2a99777d60f296ff926b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/768/e2a5ba16264791a796bf2a99777d60f296ff926b/visuals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26832,
554,
7308,
12,
2758,
16,
1698,
16,
470,
1467,
28657,
26,
16,
26,
3631,
1293,
7653,
3205,
33,
5510,
16,
14963,
554,
33,
8381,
16,
5336,
28793,
23055,
33,
27,
16,
4500,
1595,
3205... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26832,
554,
7308,
12,
2758,
16,
1698,
16,
470,
1467,
28657,
26,
16,
26,
3631,
1293,
7653,
3205,
33,
5510,
16,
14963,
554,
33,
8381,
16,
5336,
28793,
23055,
33,
27,
16,
4500,
1595,
3205... |
self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | pass | def __init__(self, about=None, meta=None, label=None, id=None, otu=None, root=False, valueOf_=None, mixedclass_=None, content_=None): super(AbstractNode, self).__init__(about, meta, label, id, otu, valueOf_, mixedclass_, content_, ) self.root = _cast(bool, root) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | 9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
15835,
89,
33,
7036,
16,
1365,
33,
8381,
16,
4323,
67,
33,
7036,
16,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
15835,
89,
33,
7036,
16,
1365,
33,
8381,
16,
4323,
67,
33,
7036,
16,
7... |
libxml2mod.xmlNodeSetContent(self._o, content.encode('utf-8')) | if isinstance(content, unicode): content = content.encode('utf-8') if not isinstance(content, str): content = str(content) content = content.replace('&', '&') libxml2mod.xmlNodeSetContent(self._o, content) def set_content_raw(self, content): if isinstance(content, unicode): content = content.encode('utf-8') if not isinstance(content, str): content = str(content) libxml2mod.xmlNodeSetContent(self._o, content) | def set_content(self, content): libxml2mod.xmlNodeSetContent(self._o, content.encode('utf-8')) | b95aaa3d7451653f605a91dba89ad50ac653fa96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/b95aaa3d7451653f605a91dba89ad50ac653fa96/libxml2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1745,
12,
2890,
16,
913,
4672,
16394,
22,
1711,
18,
2902,
907,
694,
1350,
12,
2890,
6315,
83,
16,
913,
18,
3015,
2668,
3158,
17,
28,
26112,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1745,
12,
2890,
16,
913,
4672,
16394,
22,
1711,
18,
2902,
907,
694,
1350,
12,
2890,
6315,
83,
16,
913,
18,
3015,
2668,
3158,
17,
28,
26112,
2,
-100,
-100,
-100,
-100,
-100,
... |
var_file = open("c:\\arquivo.txt","w") var_file.write(filename) var_file.close() | def SetFileName(self, filename): """ Set file name to be parsed given its filename (this should include the full path of the file of interest). | a524aa3ab9b219463cef30ae88f5e327d14fb394 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/a524aa3ab9b219463cef30ae88f5e327d14fb394/dicom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
4771,
12,
2890,
16,
1544,
4672,
3536,
1000,
585,
508,
358,
506,
2707,
864,
2097,
1544,
261,
2211,
1410,
2341,
326,
1983,
589,
434,
326,
585,
434,
16513,
2934,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
4771,
12,
2890,
16,
1544,
4672,
3536,
1000,
585,
508,
358,
506,
2707,
864,
2097,
1544,
261,
2211,
1410,
2341,
326,
1983,
589,
434,
326,
585,
434,
16513,
2934,
2,
-100,
-100,
-100,
... | |
def resolveEntity(self, publicId, systemId): return _StringIO() | def resolveEntity(self, publicId, systemId): return _StringIO() | 99200d105c483d0627b0c87195d2d3372fe4ba91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/99200d105c483d0627b0c87195d2d3372fe4ba91/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
1943,
12,
2890,
16,
1071,
548,
16,
30083,
4672,
327,
389,
780,
4294,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
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,
2245,
1943,
12,
2890,
16,
1071,
548,
16,
30083,
4672,
327,
389,
780,
4294,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
elif issubclass(node.__class__, NamedNode): | elif issubclass(node.__class__, PandaNode): | def pickGeom(self, targetNodePath = render, fIntersectUnpickable = 0, fIgnoreCamera = 0): self.collideWithGeom() self.pick(targetNodePath, direct.dr.mouseX, direct.dr.mouseY) # Init self.cqIndex self.cqIndex = -1 # Pick out the closest object that isn't a widget for i in range(0,self.numEntries): entry = self.cq.getEntry(i) node = entry.getIntoNode() nodePath = targetNodePath.findPathTo(node) # Don't pick hidden nodes if nodePath.isHidden(): pass if fIgnoreCamera and (direct.camera in nodePath.getAncestry()): # This avoids things parented to a camera. Good idea? pass # Can pick unpickable, use the first visible node elif fIntersectUnpickable: self.cqIndex = i break # Is it a named node?, If so, see if it has a name elif issubclass(node.__class__, NamedNode): name = node.getName() if name in self.unpickable: pass else: self.cqIndex = i break # Not hidden and not one of the widgets, use it else: self.cqIndex = i break # Did we hit an object? if(self.cqIndex >= 0): # Yes! # Find hit point in parent's space entry = self.cq.getEntry(self.cqIndex) hitPt = self.parentToHitPt(entry) hitPtDist = Vec3(hitPt - ZERO_POINT).length() return (node, hitPt, hitPtDist) else: return (None, ZERO_POINT, 0) | b756033864faa6d281b5913f01f2a11cc2f1b488 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/b756033864faa6d281b5913f01f2a11cc2f1b488/DirectSelection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
16972,
12,
2890,
16,
25804,
743,
273,
1743,
16,
284,
22541,
984,
11503,
429,
273,
374,
16,
284,
3777,
16521,
273,
374,
4672,
365,
18,
1293,
8130,
1190,
16972,
1435,
365,
18,
11503,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
16972,
12,
2890,
16,
25804,
743,
273,
1743,
16,
284,
22541,
984,
11503,
429,
273,
374,
16,
284,
3777,
16521,
273,
374,
4672,
365,
18,
1293,
8130,
1190,
16972,
1435,
365,
18,
11503,... |
?halt !halt ok | :: ?halt !halt ok | def request_halt(self, sock, msg): """Halt the device server. | ab282993ac578e7aa2abdda84a0df7c8ef725877 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10400/ab282993ac578e7aa2abdda84a0df7c8ef725877/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
67,
76,
2390,
12,
2890,
16,
7313,
16,
1234,
4672,
3536,
27034,
326,
2346,
1438,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
67,
76,
2390,
12,
2890,
16,
7313,
16,
1234,
4672,
3536,
27034,
326,
2346,
1438,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
</tr> | </tr> | def tmpl_display_inbox(self, messages, infos=[], warnings=[], nb_messages=0, no_quota=0, ln=cdslang): """ Displays a list of messages, with the appropriate links and buttons @param messages: a list of tuples: [(message_id, user_from_id, user_from_nickname, subject, sent_date, status=] @param infos: a list of informations to print on top of page @param warnings: a list of warnings to display @param nb_messages: number of messages user has @param no_quota: 1 if user has no quota (admin) or 0 else. @param ln: language of the page. @return the list in HTML format """ _ = gettext_set_language(ln) dummy = 0 inbox = self.tmpl_warning(warnings, ln) inbox += self.tmpl_infobox(infos, ln) if not(no_quota): inbox += self.tmpl_quota(nb_messages, ln) inbox += """ | f4a9e182650614f9c75111360ff7aaa98e5eeb52 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/f4a9e182650614f9c75111360ff7aaa98e5eeb52/webmessage_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
5417,
67,
267,
2147,
12,
2890,
16,
2743,
16,
10626,
22850,
6487,
5599,
22850,
6487,
4264,
67,
6833,
33,
20,
16,
1158,
67,
23205,
33,
20,
16,
7211,
33,
4315,
2069,
539,
4672,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
5417,
67,
267,
2147,
12,
2890,
16,
2743,
16,
10626,
22850,
6487,
5599,
22850,
6487,
4264,
67,
6833,
33,
20,
16,
1158,
67,
23205,
33,
20,
16,
7211,
33,
4315,
2069,
539,
4672,... |
`block`. Also keep track of optional intermdediate blank lines and the | `block`. Also keep track of optional intermediate blank lines and the | def nested_list_parse(self, block, input_offset, node, initial_state, blank_finish, blank_finish_state=None, extra_settings={}, match_titles=0, state_machine_class=None, state_machine_kwargs=None): """ Create a new StateMachine rooted at `node` and run it over the input `block`. Also keep track of optional intermdediate blank lines and the required final one. """ if state_machine_class is None: state_machine_class = self.nested_sm if state_machine_kwargs is None: state_machine_kwargs = self.nested_sm_kwargs.copy() state_machine_kwargs['initial_state'] = initial_state state_machine = state_machine_class(debug=self.debug, **state_machine_kwargs) if blank_finish_state is None: blank_finish_state = initial_state state_machine.states[blank_finish_state].blank_finish = blank_finish for key, value in extra_settings.items(): setattr(state_machine.states[initial_state], key, value) state_machine.run(block, input_offset, memo=self.memo, node=node, match_titles=match_titles) blank_finish = state_machine.states[blank_finish_state].blank_finish state_machine.unlink() return state_machine.abs_line_offset(), blank_finish | 08ce6022d694d4343d1c34186b8db1b4b1c4bb84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/08ce6022d694d4343d1c34186b8db1b4b1c4bb84/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4764,
67,
1098,
67,
2670,
12,
2890,
16,
1203,
16,
810,
67,
3348,
16,
756,
16,
2172,
67,
2019,
16,
7052,
67,
13749,
16,
7052,
67,
13749,
67,
2019,
33,
7036,
16,
2870,
67,
4272,
28793,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4764,
67,
1098,
67,
2670,
12,
2890,
16,
1203,
16,
810,
67,
3348,
16,
756,
16,
2172,
67,
2019,
16,
7052,
67,
13749,
16,
7052,
67,
13749,
67,
2019,
33,
7036,
16,
2870,
67,
4272,
28793,... |
listenerNode = self.listenerNode) | listenerNode = self.listenerNode, cutoff = self.cutOff) | def privInitialize(self, t): # If it's within a 10th of a second of the start, # start at the beginning t1 = t + self.startTime if (t1 < 0.1): t1 = 0.0 if (t1 < self.soundDuration) and not (self._seamlessLoop and self._soundPlaying): base.sfxPlayer.playSfx( self.sound, self.fLoop, 1, self.volume, t1, self.node, listenerNode = self.listenerNode) self._soundPlaying = True self.state = CInterval.SStarted self.currT = t | 8fbc2ee8fdf4dd14d977ddb478e5553bbbf464be /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7242/8fbc2ee8fdf4dd14d977ddb478e5553bbbf464be/SoundInterval.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6015,
7520,
12,
2890,
16,
268,
4672,
468,
971,
518,
1807,
3470,
279,
1728,
451,
434,
279,
2205,
434,
326,
787,
16,
468,
787,
622,
326,
8435,
268,
21,
273,
268,
397,
365,
18,
1937,
95... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6015,
7520,
12,
2890,
16,
268,
4672,
468,
971,
518,
1807,
3470,
279,
1728,
451,
434,
279,
2205,
434,
326,
787,
16,
468,
787,
622,
326,
8435,
268,
21,
273,
268,
397,
365,
18,
1937,
95... |
return render_moin_markup(t.encode('utf-8')) | return page.tounicode(render_moin_markup(t.encode('utf-8')),'utf-8') | def format(self,page,t): # zwiki now stores text as unicode but this version of moin # uses utf-8 (it says here) return render_moin_markup(t.encode('utf-8')) | a145ce3a64e710ba5aab435a6e245b5c469db5ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5225/a145ce3a64e710ba5aab435a6e245b5c469db5ac/moin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
2433,
16,
88,
4672,
468,
998,
13044,
2037,
9064,
977,
487,
5252,
1496,
333,
1177,
434,
312,
885,
468,
4692,
7718,
17,
28,
261,
305,
20185,
2674,
13,
327,
1743,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
2433,
16,
88,
4672,
468,
998,
13044,
2037,
9064,
977,
487,
5252,
1496,
333,
1177,
434,
312,
885,
468,
4692,
7718,
17,
28,
261,
305,
20185,
2674,
13,
327,
1743,
67,
... |
vars += dgen.projects[projName].packages[tags].vars | distHost = context.value('distHost') vars += dgen.projects[projName].packages[distHost].vars | def closure(self, dgen): '''Find out all dependencies from a root set of projects as defined by the dependency generator *dgen*.''' while dgen.more(): self.parse(dgen) vars = [] reps, packages, fetches = dgen.topological() projs = reps + packages projs.reverse() for projName in projs: if projName in dgen.projects: if projName in dgen.repositories: vars += dgen.projects[projName].repository.vars elif projName in dgen.patches: vars += dgen.projects[projName].patch.vars elif projName in dgen.packages: vars += dgen.projects[projName].packages[tags].vars # Configure environment variables required by a project # and that need to be present in ws.mk configVar(vars) return reps, packages, fetches | a0c6ec96af52deadeb9f1a0b39bbd056a6c1deff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1360/a0c6ec96af52deadeb9f1a0b39bbd056a6c1deff/dws.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7213,
12,
2890,
16,
302,
4507,
4672,
9163,
3125,
596,
777,
5030,
628,
279,
1365,
444,
434,
10137,
487,
2553,
635,
326,
4904,
4456,
380,
72,
4507,
14,
1093,
6309,
1323,
302,
4507,
18,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7213,
12,
2890,
16,
302,
4507,
4672,
9163,
3125,
596,
777,
5030,
628,
279,
1365,
444,
434,
10137,
487,
2553,
635,
326,
4904,
4456,
380,
72,
4507,
14,
1093,
6309,
1323,
302,
4507,
18,
1... |
ctypes.wintypes.LPVOID | LPVOID | def _errcheck_dword(value,func,args): if value == 0xFFFFFFFF: raise ctypes.WinError() return args | b48424cc33bd65f08cb7677556bae8ea3bd3ba34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/b48424cc33bd65f08cb7677556bae8ea3bd3ba34/watch_win32.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
370,
1893,
67,
72,
1095,
12,
1132,
16,
644,
16,
1968,
4672,
309,
460,
422,
374,
28949,
30,
1002,
6983,
18,
18049,
668,
1435,
327,
833,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
370,
1893,
67,
72,
1095,
12,
1132,
16,
644,
16,
1968,
4672,
309,
460,
422,
374,
28949,
30,
1002,
6983,
18,
18049,
668,
1435,
327,
833,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
else: debug("executeCommand: Running '%s'" % command) | else: debug("executeCommand: Running '%s' on %s" % (command, transport.get_host_keys().keys()[0])) | def executeCommand(transport, command, sudo=False, run_as='root', password=None): """Executes the given command via the specified Paramiko transport object. Will execute as sudo if passed the necessary variables (sudo=True, password, run_as). Returns stdout (after command execution)""" if sudo: stdout, stderr = sudoExecute(transport=transport, command=command, password=password, run_as=run_as) else: debug("executeCommand: Running '%s'" % command) stdin, stdout, stderr = transport.exec_command(command) command_output = stdout.readlines() return command_output | 6f69307ce1383825280bcd450de5b2253a841bcf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11566/6f69307ce1383825280bcd450de5b2253a841bcf/sshpt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21120,
12,
13049,
16,
1296,
16,
14669,
33,
8381,
16,
1086,
67,
345,
2218,
3085,
2187,
2201,
33,
7036,
4672,
3536,
9763,
326,
864,
1296,
3970,
326,
1269,
3014,
27113,
4736,
733,
18,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21120,
12,
13049,
16,
1296,
16,
14669,
33,
8381,
16,
1086,
67,
345,
2218,
3085,
2187,
2201,
33,
7036,
4672,
3536,
9763,
326,
864,
1296,
3970,
326,
1269,
3014,
27113,
4736,
733,
18,
225,
... |
result.append(GenomeNode(gtlib.gt_genome_node_ref(a.get(i)))) | result.append(FeatureNode(gtlib.gt_genome_node_ref(a.get(i)))) | def get_features_for_seqid(self, seqid): rval = gtlib.gt_feature_index_get_features_for_seqid(self.fi, seqid) if rval: a = Array(rval) result = [] for i in range(a.size()): result.append(GenomeNode(gtlib.gt_genome_node_ref(a.get(i)))) return result else: return None | c6994328b257198b8cbf9589c655448b71bf0759 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8905/c6994328b257198b8cbf9589c655448b71bf0759/feature_index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7139,
67,
1884,
67,
5436,
350,
12,
2890,
16,
31583,
4672,
14267,
273,
9879,
2941,
18,
4521,
67,
7238,
67,
1615,
67,
588,
67,
7139,
67,
1884,
67,
5436,
350,
12,
2890,
18,
220... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7139,
67,
1884,
67,
5436,
350,
12,
2890,
16,
31583,
4672,
14267,
273,
9879,
2941,
18,
4521,
67,
7238,
67,
1615,
67,
588,
67,
7139,
67,
1884,
67,
5436,
350,
12,
2890,
18,
220... |
print args.file | def set_and_save(self, option, value): """ set the value in the configuration then save it to the file """ RawConfigParser.set(self, self.defsection, option, value) self.save() | 0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9814/0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
464,
67,
5688,
12,
2890,
16,
1456,
16,
460,
4672,
3536,
444,
326,
460,
316,
326,
1664,
1508,
1923,
518,
358,
326,
585,
3536,
6576,
809,
2678,
18,
542,
12,
2890,
16,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
464,
67,
5688,
12,
2890,
16,
1456,
16,
460,
4672,
3536,
444,
326,
460,
316,
326,
1664,
1508,
1923,
518,
358,
326,
585,
3536,
6576,
809,
2678,
18,
542,
12,
2890,
16,
365,
18,... | |
while args: args = args[:-1] arglists_to_try.append(( args, kws )) else: assert 0, "nim - use maxargs, kws_ok to figure out arglists_to_try" | def fbmethod_0args(self, *args, **kws): "fake bound method with 0 args" ###@@@ no, any number of args - redoc ###@@@ slotboundmethod = self.slotboundmethod #e we'll replace these prints with our own begin/end code that's standard for slots; # or we might call methods passed to us, or of known names on an obj passed to us; # or we might call a func passed to us, passing it a callback to us which does the slot call. if kws: print "unexpected but maybe ok: some keywords were passed to a slot method:",slotboundmethod,kws ###@@@ if DEBUG_PRINT_UNDO: print "(#e begin) calling wrapped version (with %d args) of" % len(args), slotboundmethod mc = self.begin() try: if DISABLE_SLOT_ARGCOUNT_RETRY: # do our best to call this slotmethod, with given args only res = slotboundmethod(*args, **kws) else: # do our best to call this slotmethod, with given args, # or if that fails, with reduced args. # THIS CASE WILL BE REMOVED SOON [bruce 071004] try: res = slotboundmethod(*args, **kws) except TypeError: # it might be that we're passing too many args. Try to find out and fix. First, for debugging, print more info. if DEBUG_FEWER_ARGS_RETRY: print "args for %r from typeerror: args %r, kws %r" % (slotboundmethod, args, kws) success, maxargs, kws_ok = args_info(slotboundmethod) if not success: # We have no official info about required args -- just see if it helps to reduce the ones we tried. # Note that there is no guarantee that the original TypeError was caused by an excessive arglist; # if it was caused by some other bug, these repeated calls could worsen that bug. # (So taking advantage of an args_info success return is preferred, once that's implemented.) arglists_to_try = [] # will hold pairs of (args, kws) to try calling it with. if kws: # first zap all the keywords (note: as far as I know, none are ever passed in the first place) kws = {} arglists_to_try.append(( args, kws )) while args: # then zap the args, one at a time, from the end args = args[:-1] arglists_to_try.append(( args, kws )) else: assert 0, "nim - use maxargs, kws_ok to figure out arglists_to_try" worked = False from debug import print_compact_traceback for args, kws in arglists_to_try: try: res = slotboundmethod(*args, **kws) worked = True if DEBUG_FEWER_ARGS_RETRY: print " retry with fewer args (%d) worked" % len(args) break # if no exceptions except TypeError: # guessing it's still an arg problem if DEBUG_FEWER_ARGS_RETRY: print_compact_traceback("assuming this is a slot argcount problem: ") print "args for %r from typeerror, RETRY: args %r, kws %r" % (slotboundmethod, args, kws) continue # other exceptions are treated as errors, below if not worked: # TODO (maybe): retry with first arglist? more likely to be the real error... print "will try to reraise the last TypeError" # always print this, since we're about to print a traceback raise assert 0, "tried to reraise the last TypeError" pass pass pass except: self.error() self.end(mc) if DEBUG_PRINT_UNDO: print "(#e end) it had an exception" print "bug: exception in %r%r (noticed in its undo wrapper); reraising it:" % (slotboundmethod, args) raise #k ok? optimal?? else: self.end(mc) if DEBUG_PRINT_UNDO: print "(#e end) it worked" ## it returned", res # Note that slot retvals are probably ignored, except when they're called directly # (not via connections), but we don't intercept direct calls anyway. # So don't bother printing them for now. return res pass | aedf05b9ed0e7a1c49be3b6dcec0f67383272675 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/aedf05b9ed0e7a1c49be3b6dcec0f67383272675/undo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12754,
2039,
67,
20,
1968,
12,
2890,
16,
380,
1968,
16,
2826,
79,
4749,
4672,
315,
28395,
2489,
707,
598,
374,
833,
6,
11849,
30989,
36,
1158,
16,
1281,
1300,
434,
833,
300,
1755,
504,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12754,
2039,
67,
20,
1968,
12,
2890,
16,
380,
1968,
16,
2826,
79,
4749,
4672,
315,
28395,
2489,
707,
598,
374,
833,
6,
11849,
30989,
36,
1158,
16,
1281,
1300,
434,
833,
300,
1755,
504,... | |
self.stylesheets.append(r'\usepackage{%s}' % base) | self.stylesheet.append(r'\usepackage{%s}' % base) | def __init__(self, document): nodes.NodeVisitor.__init__(self, document) self.settings = settings = document.settings self.latex_encoding = self.to_latex_encoding(settings.output_encoding) self.use_latex_toc = settings.use_latex_toc self.use_latex_docinfo = settings.use_latex_docinfo self.use_latex_footnotes = settings.use_latex_footnotes self._use_latex_citations = settings.use_latex_citations self.embed_stylesheet = settings.embed_stylesheet self._reference_label = settings.reference_label self.hyperlink_color = settings.hyperlink_color self.compound_enumerators = settings.compound_enumerators self.font_encoding = settings.font_encoding self.section_prefix_for_enumerators = ( settings.section_prefix_for_enumerators) self.section_enumerator_separator = ( settings.section_enumerator_separator.replace('_', '\\_')) if self.hyperlink_color == '0': self.hyperlink_color = 'black' self.colorlinks = 'false' else: self.colorlinks = 'true' if self.settings.literal_block_env != '': self.settings.use_verbatim_when_possible = True if self.settings.use_bibtex: self.bibtex = self.settings.use_bibtex.split(',',1) # TODO avoid errors on not declared citations. else: self.bibtex = None # language: labels, bibliographic_fields, and author_separators. # to allow writing labes for specific languages. self.language = languages.get_language(settings.language_code) self.babel = Babel(settings.language_code) self.author_separator = self.language.author_separators[0] self.d_options = self.settings.documentoptions if self.babel.get_language(): self.d_options += ',%s' % self.babel.get_language() self.latex_equivalents[u'\u00A0'] = self.babel.nobr | c864668986577697fde0269ca08cae63c3e4ea04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8194/c864668986577697fde0269ca08cae63c3e4ea04/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
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,
1001,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
273,
... |
tmploc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher,self.isbn, verbose=self.verbose, lang=lang) tmpnoloc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all') | tmploc = ThreadwithResults(get_social_metadata, self.title, self.book_author, self.publisher,self.isbn, verbose=self.verbose, lang=lang) tmpnoloc = ThreadwithResults(get_social_metadata, self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all') | def fetch(self): if not self.isbn: return try: lang = get_lang() lang = lang[:2] if re.match(r'(fr.*|de.*)', lang) else 'all' if lang == 'all': self.results = get_social_metadata(self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all')[0] else: tmploc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher,self.isbn, verbose=self.verbose, lang=lang) tmpnoloc = ThreadwithResults(AmazonError, self.verbose, get_social_metadata, self.title, self.book_author, self.publisher, self.isbn, verbose=self.verbose, lang='all') tmploc.start() tmpnoloc.start() tmploc.join() tmpnoloc.join() tmploc= tmploc.get_result() if tmploc is not None: tmploc = tmploc[0] tmpnoloc= tmpnoloc.get_result() if tmpnoloc is not None: tmpnoloc = tmpnoloc[0] print tmpnoloc if tmploc is not None and tmpnoloc is not None: if tmploc.rating is None: tmploc.rating = tmpnoloc.rating if tmploc.comments is not None: tmploc.comments = tmpnoloc.comments if tmploc.tags is None: tmploc.tags = tmpnoloc.tags self.results = tmploc except Exception, e: self.exception = e self.tb = traceback.format_exc() | 5c89b576e31b85e17cf14e85a72b1b876f87579c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/5c89b576e31b85e17cf14e85a72b1b876f87579c/amazonbis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
4672,
309,
486,
365,
18,
291,
13392,
30,
327,
775,
30,
3303,
273,
336,
67,
4936,
1435,
3303,
273,
3303,
10531,
22,
65,
309,
283,
18,
1916,
12,
86,
11,
12,
4840,
4509,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
4672,
309,
486,
365,
18,
291,
13392,
30,
327,
775,
30,
3303,
273,
336,
67,
4936,
1435,
3303,
273,
3303,
10531,
22,
65,
309,
283,
18,
1916,
12,
86,
11,
12,
4840,
4509,... |
ret = self._mc.dll.find_colored_area(self._cli, byref(x), byref(y), col, *box, min_a) else: ret = self._mc.dll.find_colored_area_tolerance(self._cli, byref(x), byref(y), col, *box, min_a, tol) | pass else: pass | def find_area(self, col, box, min_a, tol = 0): """ Finds a colored area in box with min area min_a with a specific tolerance. Yields a tuple of x, y values of found area. """ x, y = (c_int(-1), c_int(-1)) if tol is 0: ret = self._mc.dll.find_colored_area(self._cli, byref(x), byref(y), col, *box, min_a) else: ret = self._mc.dll.find_colored_area_tolerance(self._cli, byref(x), byref(y), col, *box, min_a, tol) if ret is RESULT_OK: return (x, y) elif ret is RESULT_ERROR: raise ColorException(self._mc.get_last_error()) return None | 285be4b6ed2296c5697f6d74f1ee5a84d9bca8ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13557/285be4b6ed2296c5697f6d74f1ee5a84d9bca8ca/color.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
5036,
12,
2890,
16,
645,
16,
3919,
16,
1131,
67,
69,
16,
6085,
273,
374,
4672,
3536,
4163,
87,
279,
19757,
5091,
316,
3919,
598,
1131,
5091,
1131,
67,
69,
598,
279,
2923,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5036,
12,
2890,
16,
645,
16,
3919,
16,
1131,
67,
69,
16,
6085,
273,
374,
4672,
3536,
4163,
87,
279,
19757,
5091,
316,
3919,
598,
1131,
5091,
1131,
67,
69,
598,
279,
2923,
1... |
i = 0 | i = 0 | def pie(self, explode=None, colors=None, autopct=None, pctdistance=0.6, shadow=False ): start = time.time() labels = self.pdata.getLabels(use_plotdata=True) #labels.reverse() values = [l[1] for l in labels] x = numpy.array(values, numpy.float64) self.legendData = labels | 423d7ba6a07ac9928874a4f9fd7da58c86c8cfcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/423d7ba6a07ac9928874a4f9fd7da58c86c8cfcf/PieGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
1385,
12,
2890,
16,
3172,
33,
7036,
16,
5740,
33,
7036,
16,
2059,
556,
299,
33,
7036,
16,
19857,
8969,
33,
20,
18,
26,
16,
10510,
33,
8381,
262,
30,
225,
787,
273,
813,
18,
95... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
1385,
12,
2890,
16,
3172,
33,
7036,
16,
5740,
33,
7036,
16,
2059,
556,
299,
33,
7036,
16,
19857,
8969,
33,
20,
18,
26,
16,
10510,
33,
8381,
262,
30,
225,
787,
273,
813,
18,
95... |
sclient.password = md5.new(data[0]).hexdigest() self.console.storage.query(QueryBuilder(self.console.storage.db).UpdateQuery( { 'password' : sclient.password }, 'clients', { 'id' : sclient.id } )) return | sclient.password = md5.new(data[0]).hexdigest() self.console.storage.query(QueryBuilder(self.console.storage.db).UpdateQuery( { 'password' : sclient.password }, 'clients', { 'id' : sclient.id } )) return | def cmd_setpassword(self, data, client, cmd=None): """\ <password> [<name>] - set a password for a client """ data = string.split(data) if len(data) > 1: sclient = self._adminPlugin.findClientPrompt(data[1], client) if not sclient: return if client.maxLevel <= sclient.maxLevel and client.maxLevel < 100: client.message('You can only change passwords of yourself or lower level players.') return else: sclient = client | ca632c1ba40101368b0df23291b023db8b2e8f1f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12909/ca632c1ba40101368b0df23291b023db8b2e8f1f/login.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
542,
3664,
12,
2890,
16,
501,
16,
1004,
16,
1797,
33,
7036,
4672,
3536,
64,
411,
3664,
34,
306,
32,
529,
34,
65,
202,
17,
444,
279,
2201,
364,
279,
1004,
3536,
501,
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,
1797,
67,
542,
3664,
12,
2890,
16,
501,
16,
1004,
16,
1797,
33,
7036,
4672,
3536,
64,
411,
3664,
34,
306,
32,
529,
34,
65,
202,
17,
444,
279,
2201,
364,
279,
1004,
3536,
501,
273,
... |
newnode = node.cloneNode(1) | if first: newnode = node first = False else: newnode = node.cloneNode(1) | def _parse_text(self, cursor, user, node, localcontext, context, node_context): if node.parentNode.tagName == 'text:text-input': localcontext['RepeatIn'] = lambda lst, name, parents=False: \ self.repeat_in(lst, name, parents=parents, tnode=node, node_context=node_context) localcontext['setTag'] = lambda oldtag, newtag, attrs=None: \ self.set_tag(oldtag, newtag, attrs=attrs, tnode=node) localcontext['removeParentNode'] = lambda tag='p': \ self.remove_parent_node(tag, tnode=node) localcontext['setLang'] = lambda lang: \ self.set_lang(lang, localcontext) localcontext['formatLang'] = lambda value, digits=2, date=False: \ self.format_lang(value, digits=digits, date=date, localcontext=localcontext) localcontext['time'] = time res = eval(node.nodeValue, localcontext) if hasattr(res, '__str__'): res = res.__str__() if isinstance(res, basestring): if '\n' in res: parent = node.parentNode.parentNode for val in res.decode('utf-8').split('\n'): newnode = node.cloneNode(1) newnode.nodeValue = val node.parentNode.parentNode.appendChild(newnode) newnode = node.parentNode.cloneNode(1) newnode.nodeType = newnode.ELEMENT_NODE newnode.tagName = 'text:line-break' newnode.firstChild.nodeValue = '' newnode.removeAttribute('text:description') node.parentNode.parentNode.appendChild(newnode) parent.removeChild(parent.firstChild) parent.removeChild(parent.lastChild) else: node.nodeValue = res.decode('utf-8') node.parentNode.parentNode.replaceChild(node, node.parentNode) return res if 'language' in localcontext: lang = localcontext['language'] text = node.nodeValue if lang and text and not text.isspace(): translation_obj = self.pool.get('ir.translation') new_text = translation_obj._get_source(cursor, self._name, 'rml', lang, text) if new_text: node.nodeValue = new_text return None | 18ff80db73c539bd9af18b69ce5e5bd1a9316af1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/18ff80db73c539bd9af18b69ce5e5bd1a9316af1/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
955,
12,
2890,
16,
3347,
16,
729,
16,
756,
16,
1191,
2472,
16,
819,
16,
756,
67,
2472,
4672,
309,
756,
18,
2938,
907,
18,
2692,
461,
422,
296,
955,
30,
955,
17,
2630... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
955,
12,
2890,
16,
3347,
16,
729,
16,
756,
16,
1191,
2472,
16,
819,
16,
756,
67,
2472,
4672,
309,
756,
18,
2938,
907,
18,
2692,
461,
422,
296,
955,
30,
955,
17,
2630... |
basename = basename + "." + options_file | basename = basename + "." + tmp | def compare(name1,name2,decode): if (decode): print "converting mp3 to wav for comparison..." # XXX shouldn't we use lame1 instead of a hardcoded lame? os.system("lame --quiet --mp3input --decode " + name1) os.system("lame --quiet --mp3input --decode " + name2) name1 = name1 + ".wav" name2 = name2 + ".wav" rcode = 0 diff,size=fdiff(name1,name2) if (diff==0): print "output identical: diff=%i total=%i" % (diff,size) rcode = 1 elif (diff>0): print "output different: diff=%i total=%i %2.0f%%" % \ (diff,size,100*float(diff)/size) else: print "Error comparing files:" print "File 1: " + name1 print "File 2: " + name2 return rcode | 2fded12fbc1529a66c986430c6935ff5b70cd7a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1520/2fded12fbc1529a66c986430c6935ff5b70cd7a7/lametest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
12,
529,
21,
16,
529,
22,
16,
3922,
4672,
309,
261,
3922,
4672,
1172,
315,
6283,
310,
6749,
23,
358,
19342,
364,
5826,
7070,
468,
11329,
12044,
1404,
732,
999,
328,
339,
21,
3560... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
12,
529,
21,
16,
529,
22,
16,
3922,
4672,
309,
261,
3922,
4672,
1172,
315,
6283,
310,
6749,
23,
358,
19342,
364,
5826,
7070,
468,
11329,
12044,
1404,
732,
999,
328,
339,
21,
3560... |
lower = fromchar(player, LOWERREQS) + fromitem(item, LOWERREQS) lower /= 100.0 | lower = fromitem(item, LOWERREQS) / 100.0 | def onWearItem(player, wearer, item, layer): lower = fromchar(player, LOWERREQS) + fromitem(item, LOWERREQS) lower /= 100.0 req_str = fromitem(item, REQSTR) if lower: req_str = int(ceil(req_str) * (1.0 - lower)) req_dex = fromitem(item, REQDEX) if lower: req_dex = int(ceil(req_dex) * (1.0 - lower)) req_int = fromitem(item, REQINT) if lower: req_int = int(ceil(req_int) * (1.0 - lower)) if wearer.strength < req_str: if player != wearer: player.socket.sysmessage('This person can\'t wear that item, seems not strong enough.') else: player.socket.clilocmessage(500213) return 1 if wearer.dexterity < req_dex: if player != wearer: player.socket.sysmessage('This person can\'t wear that item, seems not agile enough.') else: player.socket.clilocmessage(502077) return 1 if wearer.intelligence < req_int: if player != wearer: player.socket.sysmessage('This person can\'t wear that item, seems not smart enough.') else: player.socket.sysmessage('You are not ingellgent enough to equip this item.') return 1 # Reject equipping an item with durability 1 or less # if it's an armor, shield or weapon armor = itemcheck(item, ITEM_ARMOR) weapon = itemcheck(item, ITEM_WEAPON) shield = itemcheck(item, ITEM_SHIELD) if (armor or weapon or shield) and item.health < 1: player.socket.sysmessage('You need to repair this before using it again.') return 1 return 0 | 768966737612f42a199c2f6cffe24c72d0fb439e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/768966737612f42a199c2f6cffe24c72d0fb439e/equipment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
59,
2091,
1180,
12,
14872,
16,
732,
14500,
16,
761,
16,
3018,
4672,
2612,
273,
628,
1726,
12,
1726,
16,
29819,
20373,
55,
13,
342,
2130,
18,
20,
225,
1111,
67,
701,
273,
628,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
59,
2091,
1180,
12,
14872,
16,
732,
14500,
16,
761,
16,
3018,
4672,
2612,
273,
628,
1726,
12,
1726,
16,
29819,
20373,
55,
13,
342,
2130,
18,
20,
225,
1111,
67,
701,
273,
628,
17... |
approx_grad = False, | approx_grad=0, | def fmin_l_bfgs_b(func, x0, fprime=None, args=(), approx_grad = False, bounds=None, m=10, factr=1e7, pgtol=1e-5, epsilon=1e-8, iprint=-1, maxfun=15000): """ Minimize a function func using the L-BFGS-B algorithm. Arguments: func -- function to minimize. Called as func(x, *args) x0 -- initial guess to minimum fprime -- gradient of func. If None, then func returns the function value and the gradient ( f, g = func(x, *args) ), unless approx_grad is True then func returns only f. Called as fprime(x, *args) args -- arguments to pass to function approx_grad -- if true, approximate the gradient numerically and func returns only function value. bounds -- a list of (min, max) pairs for each element in x, defining the bounds on that parameter. Use None for one of min or max when there is no bound in that direction m -- the maximum number of variable metric corrections used to define the limited memory matrix. (the limited memory BFGS method does not store the full hessian but uses this many terms in an approximation to it). factr -- The iteration stops when (f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= factr*epsmch where epsmch is the machine precision, which is automatically generated by the code. Typical values for factr: 1e12 for low accuracy; 1e7 for moderate accuracy; 10.0 for extremely high accuracy. pgtol -- The iteration will stop when max{|proj g_i | i = 1, ..., n} <= pgtol where pg_i is the ith component of the projected gradient. epsilon -- step size used when approx_grad is true, for numerically calculating the gradient iprint -- controls the frequency of output. <0 means no output. maxfun -- maximum number of function evaluations. Returns: x, f, d = fmin_lbfgs_b(func, x0, ...) x -- position of the minimum f -- value of func at the minimum d -- dictionary of information from routine d['warnflag'] is 0 if converged, 1 if too many function evaluations, 2 if stopped for another reason, given in d['task'] d['grad'] is the gradient at the minimum (should be 0 ish) d['funcalls'] is the number of function calls made. License of L-BFGS-B (Fortran code) ================================== The version included here (in fortran code) is 2.1 (released in 1997). It was written by Ciyou Zhu, Richard Byrd, and Jorge Nocedal <nocedal@ece.nwu.edu>. It carries the following condition for use: This software is freely available, but we expect that all publications describing work using this software , or all commercial products using it, quote at least one of the references given below. References * R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for Bound Constrained Optimization, (1995), SIAM Journal on Scientific and Statistical Computing , 16, 5, pp. 1190-1208. * C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778: L-BFGS-B, FORTRAN routines for large scale bound constrained optimization (1997), ACM Transactions on Mathematical Software, Vol 23, Num. 4, pp. 550 - 560. """ n = len(x0) if bounds is None: bounds = [(None,None)] * n if len(bounds) != n: raise ValueError('length of x0 != length of bounds') if approx_grad: def func_and_grad(x): f = func(x, *args) g = approx_fprime(x, func, epsilon, *args) return f, g elif fprime is None: def func_and_grad(x): f, g = func(x, *args) return f, g else: def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g nbd = NA.zeros((n,), NA.Int32) low_bnd = NA.zeros((n,), NA.Float) upper_bnd = NA.zeros((n,), NA.Float) bounds_map = {(None, None): 0, (1, None) : 1, (1, 1) : 2, (None, 1) : 3} for i in range(0, n): l,u = bounds[i] if l is not None: low_bnd[i] = l l = 1 if u is not None: upper_bnd[i] = u u = 1 nbd[i] = bounds_map[l, u] x = NA.array(x0) f = NA.array(0.0, NA.Float64) g = NA.zeros((n,), NA.Float64) wa = NA.zeros((2*m*n+4*n + 12*m**2 + 12*m,), NA.Float64) iwa = NA.zeros((3*n,), NA.Int32) task = NA.zeros((60,), NA.Character) csave = NA.zeros((60,), NA.Character) lsave = NA.zeros((4,), NA.Int32) isave = NA.zeros((44,), NA.Int32) dsave = NA.zeros((29,), NA.Float64) task[:] = 'START' n_function_evals = 0 while 1: | e8cf5e3ae8a7210059a0ad2e7db3c2e41cef4ca9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/e8cf5e3ae8a7210059a0ad2e7db3c2e41cef4ca9/lbfgsb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
67,
80,
67,
17156,
564,
67,
70,
12,
644,
16,
619,
20,
16,
284,
16382,
33,
7036,
16,
833,
33,
9334,
10818,
67,
9974,
33,
20,
16,
4972,
33,
7036,
16,
312,
33,
2163,
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,
284,
1154,
67,
80,
67,
17156,
564,
67,
70,
12,
644,
16,
619,
20,
16,
284,
16382,
33,
7036,
16,
833,
33,
9334,
10818,
67,
9974,
33,
20,
16,
4972,
33,
7036,
16,
312,
33,
2163,
16,
... |
cls.ignored_modes = set() | cls.skipped_modes = set() | def findActiveModes(cls, plugins): cls.current_modes = [] for plugin in plugins: cls.dprint("checking plugin %s" % str(plugin.__class__.__mro__)) cls.current_modes.extend(plugin.getMajorModes()) cls.dprint("Currently active major modes: %s" % str(cls.current_modes)) cls.ignored_modes = set() | 6df6f0a55fd53267d755f04592490b67376c4b96 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/6df6f0a55fd53267d755f04592490b67376c4b96/major.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3896,
18868,
12,
6429,
16,
4799,
4672,
2028,
18,
2972,
67,
19282,
273,
5378,
364,
1909,
316,
4799,
30,
2028,
18,
72,
1188,
2932,
24609,
1909,
738,
87,
6,
738,
609,
12,
4094,
1618... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3896,
18868,
12,
6429,
16,
4799,
4672,
2028,
18,
2972,
67,
19282,
273,
5378,
364,
1909,
316,
4799,
30,
2028,
18,
72,
1188,
2932,
24609,
1909,
738,
87,
6,
738,
609,
12,
4094,
1618... |
if bounds == None: | if bounds is None: | def degree_constrained_subgraph(self, bounds=None): r""" Returns a degree-constrained subgraph. | e91915d7c49acd9aea6587e56f68782e7ff51d0f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/e91915d7c49acd9aea6587e56f68782e7ff51d0f/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10782,
67,
591,
31142,
67,
1717,
4660,
12,
2890,
16,
4972,
33,
7036,
4672,
436,
8395,
2860,
279,
10782,
17,
591,
31142,
21469,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
10782,
67,
591,
31142,
67,
1717,
4660,
12,
2890,
16,
4972,
33,
7036,
4672,
436,
8395,
2860,
279,
10782,
17,
591,
31142,
21469,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"""Returns the mmCIFData object with the given name. Returns None | """Returns the mmCIFData object with the given name. Returns None | def get_data(self, name): """Returns the mmCIFData object with the given name. Returns None if no such object exists. """ try: return self[name] except KeyError: return None except IndexError: return None | 7875e677f8aac91050c2770247e9ca6fcb234e85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10674/7875e677f8aac91050c2770247e9ca6fcb234e85/mmCIF.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
892,
12,
2890,
16,
508,
4672,
3536,
1356,
326,
9740,
39,
5501,
751,
733,
598,
326,
864,
508,
18,
2860,
599,
309,
1158,
4123,
733,
1704,
18,
3536,
775,
30,
327,
365,
63,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
892,
12,
2890,
16,
508,
4672,
3536,
1356,
326,
9740,
39,
5501,
751,
733,
598,
326,
864,
508,
18,
2860,
599,
309,
1158,
4123,
733,
1704,
18,
3536,
775,
30,
327,
365,
63,
529,... |
return | return False | def Run(self): # start by loading the input source code f = open(self.InputName, 'r') InputCodeRaw = f.read() f.close() # do first pass parsing to remove any comments and handle line continuations self.InputCode = Parser.RemoveCommentsContinueLines(InputCodeRaw) # the second pass extracts the defined procedures and removes linefeeds to make streams of instructions (self.MainCode, self.Procedures) = Parser.ExtractProcedures(self.InputCode) if self.MainCode == None or self.Procedures == None: return # the next step is to parse instructions for the main code and the subroutines self.MainInstructions = self.ParseInstructions(self.MainCode, None) if self.MainInstructions is None: return for proc in self.Procedures: proc.Instructions = self.ParseInstructions(proc.CodeText, proc) if proc.Instructions is None: return # create local/global variables from MAKE, LOCALMAKE, and FOR instructions self.GlobalVariables = [] if not self.RecurseAllInstructions(self.CreateVarFromInstruct): return # check for instruction arguments using un-defined variables if not self.RecurseAllInstructions(self.CheckVariables): return # check all the user-defined Procedures to find those which return no value, and set their return type to NOTHING for proc in self.Procedures: bReturnsValue = False for instruct in proc.Instructions: if not self.RecurseInstruction(self.NoOutputInstruction, instruct, proc): bReturnsValue = True break if not bReturnsValue: proc.ReturnType = ParamType.NOTHING # now, the main "fix-up" loop where we iteratively discover the types of all variables, procedure arguments, etc while True: # loop until we don't fix up anything else nFixups = 0 for instruct in self.MainInstructions: newfix = self.FixupRecurse(instruct, None) if newfix == None: return nFixups += newfix for proc in self.Procedures: for instruct in proc.Instructions: newfix = self.FixupRecurse(instruct, proc) if newfix == None: return nFixups += newfix if nFixups == 0: break # look for unused procedures and remove them pUnusedProcs = self.Procedures[:] # make a copy of the list so we dont trash self.Procedures if not self.RecurseAllInstructions(self.RemoveCalledProcedures, pUnusedProcs): return for proc in pUnusedProcs: self.Procedures.remove(proc) # look for unused global variables and remove them as well (they may have been used only in a deleted procedure) pUnusedGlobals = self.GlobalVariables[:] # make a copy of the list so we don't trash self.GlobalVariables if not self.RecurseAllInstructions(self.RemoveUsedGlobals, pUnusedGlobals): return for var in pUnusedGlobals: self.GlobalVariables.remove(var) # verify that the ParamTypes of all global and local variables are defined for var in self.GlobalVariables: if var.Type == ParamType.UNKNOWN: print "Logical error: Type of global variable named '%s' cannot be determined." % var.Name return for proc in self.Procedures: for var in proc.LocalVariables: if var.Type == ParamType.UNKNOWN: print "Logical error: Type of local variable named '%s' in procedure '%s' cannot be determined." % (var.Name, proc.Name) return # verify that Return value for each Procedure is defined for proc in self.Procedures: if proc.ReturnType == ParamType.UNKNOWN: print "Logical error: Type of return value from procedure '%s' cannot be determined." % proc.Name return # verify that the Procedure pointers and ParamType of all Arguments in each instruction are defined if not self.RecurseAllInstructions(self.FinalInstructionCheck): return # at this point, the "front end" of the compiler is done and only the back-end work remains writer = CppWriter() # start by creating C++-friendly names for all of the procedures and variables for var in self.GlobalVariables: var.CppName = "g_%s" % CppWriter.GetValidCppName(var.Name) for proc in self.Procedures: proc.CppName = "_%s" % CppWriter.GetValidCppName(proc.Name) for var in proc.LocalVariables: var.CppName = "l_%s" % CppWriter.GetValidCppName(var.Name) # Initialize to default the state variables which have an impact on the resulting C++ code writer.InitDefaultState() # Then go through every instruction in the program and modify these state variables according to the Logo code if not self.RecurseAllInstructions(writer.SetStateFromInstruction): return # Now start the output of C++ code by writing global variable definitions GlobalInitCode = writer.WriteGlobals(self.GlobalVariables) if GlobalInitCode is None: return # Next, write the function definitions for the user-defined Logo procedures for proc in self.Procedures: writer.OutputText += "static " if not writer.WriteFunctionPrototype(proc): return writer.OutputText += ";\n" if len(self.Procedures) > 0: writer.OutputText += "\n" # write out the main function writer.OutputText += "void tt_LogoMain(void)\n{\n" if GlobalInitCode != "": writer.OutputText += " " * writer.IndentSize + "// initialize global variables\n" writer.OutputText += GlobalInitCode writer.InitProcedure() for instruct in self.MainInstructions: if not writer.WriteInstruction(instruct, 1, True): return writer.OutputText += "}\n\n" # write out all the procedures for proc in self.Procedures: # start with the function definition and opening brace if not writer.WriteFunctionPrototype(proc): return writer.OutputText += "\n{\n" # then definitions and initialization of local variables LocalInitCode = "" LocalVars = 0 for var in proc.LocalVariables: if var in proc.InputVariables: continue LocalVars += 1 Code = writer.WriteVariableDefinition(var, 1) if Code is None: return None LocalInitCode += Code if LocalVars > 0: writer.OutputText += "\n" if LocalInitCode != "": writer.OutputText += LocalInitCode + "\n" # lastly, write out all the instructions writer.InitProcedure() for instruct in proc.Instructions: if not writer.WriteInstruction(instruct, 1, True): return writer.OutputText += "}\n\n" # Compilation done! Write the logo source code and save the output text into the destination file writer.OutputText += "/***** The LOGO source code from which this file was compiled is given here *****/\n" for line in InputCodeRaw.split('\n'): writer.OutputText += "// %s\n" % line f = open(self.OutputName, 'w') f.write(writer.OutputText) f.close() | 63be8217f0baee05e6984420f8605f5d97c13115 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2419/63be8217f0baee05e6984420f8605f5d97c13115/turboturtle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
12,
2890,
4672,
468,
787,
635,
7153,
326,
810,
1084,
981,
284,
273,
1696,
12,
2890,
18,
1210,
461,
16,
296,
86,
6134,
2741,
1085,
4809,
273,
284,
18,
896,
1435,
284,
18,
4412,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
12,
2890,
4672,
468,
787,
635,
7153,
326,
810,
1084,
981,
284,
273,
1696,
12,
2890,
18,
1210,
461,
16,
296,
86,
6134,
2741,
1085,
4809,
273,
284,
18,
896,
1435,
284,
18,
4412,
... |
'except': 'except', | 'except': 'try', | def writedocs(dir, pkgpath='', done=None): """Write out HTML documentation for all modules in a directory tree.""" if done is None: done = {} for importer, modname, ispkg in pkgutil.walk_packages([dir], pkgpath): writedoc(modname) return | 5c669db194e6fd1d9eae11b4c0ba268faeeb460d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/5c669db194e6fd1d9eae11b4c0ba268faeeb460d/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
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,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
273,... |
sage: sage.symbolic.units.unitdocs('earth') Traceback (most recent call last): ... ValueError: No documentation exists for the unit earth. | sage: sage.symbolic.units.unitdocs('earth') Traceback (most recent call last): ... ValueError: No documentation exists for the unit earth. | def unitdocs(unit): """ Returns docstring for the given unit. INPUT: - ``unit`` OUTPUT: - ``string`` EXAMPLES:: sage: sage.symbolic.units.unitdocs('meter') 'SI base unit of length.\nDefined to be the distance light travels in vacuum in 1/299792458 of a second.' sage: sage.symbolic.units.unitdocs('amu') 'Abbreviation for atomic mass unit.\nApproximately equal to 1.660538782*10^-27 kilograms.' Units not in the list unit_docs will raise a ValueError:: sage: sage.symbolic.units.unitdocs('earth') Traceback (most recent call last): ... ValueError: No documentation exists for the unit earth. """ if is_unit(unit): return unit_docs[unit_to_type[str(unit)]+"_docs"][str(unit)] else: raise ValueError, "No documentation exists for the unit %s."%unit | d9145e61c2e167a847618a21778e0e532a04af5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d9145e61c2e167a847618a21778e0e532a04af5d/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2836,
8532,
12,
4873,
4672,
3536,
2860,
14525,
364,
326,
864,
2836,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
12176,
1080,
10335,
225,
5675,
8900,
11386,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2836,
8532,
12,
4873,
4672,
3536,
2860,
14525,
364,
326,
864,
2836,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
12176,
1080,
10335,
225,
5675,
8900,
11386,
... |
print "cannot unlink J", jsonpath, os.listdir(os.path.split(jsonpath)[0]) | self.logger.warning("cannot unlink Json", jsonpath, os.listdir(os.path.split(jsonpath)[0])) | def copyFrom(self, uuid, jsonpath, dumppath, webheadHostName, timestamp, createLinks = False, removeOld = False): """ Copy the two crash files from the given path to our current storage location in nameBranch If createLinks, use webheadHostName and timestamp to insert links to and from the dateBranch If removeOld, after the files are copied, attempt to unlink the originals raises OSError if the paths are unreadable or if removeOld is true and either file cannot be unlinked | 836caa118f674b92367f57359d24c234bab29b77 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12383/836caa118f674b92367f57359d24c234bab29b77/JsonDumpStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25189,
12,
2890,
16,
3822,
16,
1163,
803,
16,
4657,
803,
16,
3311,
1978,
20946,
16,
2858,
16,
752,
7100,
273,
1083,
16,
1206,
7617,
273,
1083,
4672,
3536,
5631,
326,
2795,
17053,
1390,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25189,
12,
2890,
16,
3822,
16,
1163,
803,
16,
4657,
803,
16,
3311,
1978,
20946,
16,
2858,
16,
752,
7100,
273,
1083,
16,
1206,
7617,
273,
1083,
4672,
3536,
5631,
326,
2795,
17053,
1390,
... |
for v in self.tts.GetVoices(): if value==v.Id: | v=self.tts.GetVoices() for i in range(len(v)): if value==v[i].Id: | def _set_voice(self,value): for v in self.tts.GetVoices(): if value==v.Id: break else: # Voice not found. return self._initTts() self.tts.voice=v | 0da2339cdc018b049c45cf1bb74253b04733fc51 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/0da2339cdc018b049c45cf1bb74253b04733fc51/sapi5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
25993,
12,
2890,
16,
1132,
4672,
331,
33,
2890,
18,
748,
87,
18,
967,
58,
17725,
1435,
364,
277,
316,
1048,
12,
1897,
12,
90,
3719,
30,
309,
460,
631,
90,
63,
77,
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,
389,
542,
67,
25993,
12,
2890,
16,
1132,
4672,
331,
33,
2890,
18,
748,
87,
18,
967,
58,
17725,
1435,
364,
277,
316,
1048,
12,
1897,
12,
90,
3719,
30,
309,
460,
631,
90,
63,
77,
800... |
'state': lambda *a: 'uninstalled', 'demo': lambda *a: False, 'license': lambda *a: 'AGPL-3', | 'state': 'uninstalled', 'demo': False, 'license': 'AGPL-3', | def _get_views(self, cr, uid, ids, field_name=None, arg=None, context={}): res = {} model_data_obj = self.pool.get('ir.model.data') view_obj = self.pool.get('ir.ui.view') report_obj = self.pool.get('ir.actions.report.xml') menu_obj = self.pool.get('ir.ui.menu') mlist = self.browse(cr, uid, ids, context=context) mnames = {} for m in mlist: mnames[m.name] = m.id res[m.id] = { 'menus_by_module':[], 'reports_by_module':[], 'views_by_module': [] } view_id = model_data_obj.search(cr,uid,[('module','in', mnames.keys()), ('model','in',('ir.ui.view','ir.actions.report.xml','ir.ui.menu'))]) for data_id in model_data_obj.browse(cr,uid,view_id,context): # We use try except, because views or menus may not exist try: key = data_id['model'] if key=='ir.ui.view': v = view_obj.browse(cr,uid,data_id.res_id) aa = v.inherit_id and '* INHERIT ' or '' res[mnames[data_id.module]]['views_by_module'].append(aa + v.name + '('+v.type+')') elif key=='ir.actions.report.xml': res[mnames[data_id.module]]['reports_by_module'].append(report_obj.browse(cr,uid,data_id.res_id).name) elif key=='ir.ui.menu': res[mnames[data_id.module]]['menus_by_module'].append(menu_obj.browse(cr,uid,data_id.res_id).complete_name) except KeyError, e: pass for key, value in res.iteritems() : for k, v in res[key].iteritems() : res[key][k] = "\n".join(sorted(v)) return res | 0c1061e4deb5a9c9963ede2ea8bc2b185ff66af8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0c1061e4deb5a9c9963ede2ea8bc2b185ff66af8/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7061,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
33,
7036,
16,
1501,
33,
7036,
16,
819,
12938,
4672,
400,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7061,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
33,
7036,
16,
1501,
33,
7036,
16,
819,
12938,
4672,
400,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
... |
pstr = '(' for param in fdoc.parameters(): pstr += param.name()+', ' if fdoc.vararg(): pstr += '*'+fdoc.vararg().name()+', ' if fdoc.kwarg(): pstr += '**'+fdoc.kwarg().name()+', ' if pstr == '(': pstr = '()' else: pstr = pstr[:-2]+')' | def _func_summary(self, functions, sortorder, cls, heading='Function Summary'): """ @return: The HTML code for a function summary table. This is used by L{_module_to_html} to list the functions in a module; and by L{_class_to_html} to list member functions. @rtype: C{string} """ functions = self._sort(functions, sortorder) if len(functions) == 0: return '' str = self._table_header(heading, 'summary') for link in functions: func = link.target() fname = link.name() if func.is_method(): container = func.cls() inherit = (container != cls.uid()) else: inherit = 0 try: container = func.module() except TypeError: container = None | df1dbf79e952253da7996bd14b09a2b1a365bab5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/df1dbf79e952253da7996bd14b09a2b1a365bab5/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
7687,
12,
2890,
16,
4186,
16,
1524,
1019,
16,
2028,
16,
11053,
2218,
2083,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
445,
4916,
1014,
18,
225,
1220... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
644,
67,
7687,
12,
2890,
16,
4186,
16,
1524,
1019,
16,
2028,
16,
11053,
2218,
2083,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
445,
4916,
1014,
18,
225,
1220... | |
logmgr = LogManager() | logmgr = LogManager(mode="w") | def test_kv_with_no_charge(): from random import seed seed(0) from pyrticle.units import SIUnitsWithNaturalConstants units = SIUnitsWithNaturalConstants() # discretization setup ---------------------------------------------------- from hedge.mesh import make_cylinder_mesh from hedge.backends import guess_run_context rcon = guess_run_context([]) tube_length = 100*units.MM mesh = make_cylinder_mesh(radius=25*units.MM, height=tube_length, periodic=True) discr = rcon.make_discretization(mesh, order=3) dt = discr.dt_factor(units.VACUUM_LIGHT_SPEED()) / 2 final_time = 1*units.M/units.VACUUM_LIGHT_SPEED() nsteps = int(final_time/dt)+1 dt = final_time/nsteps # particles setup --------------------------------------------------------- from pyrticle.cloud import PicMethod from pyrticle.deposition.shape import ShapeFunctionDepositor from pyrticle.pusher import MonomialParticlePusher method = PicMethod(discr, units, ShapeFunctionDepositor(), MonomialParticlePusher(), 3, 3) nparticles = 10000 cloud_charge = 1e-9 * units.C electrons_per_particle = cloud_charge/nparticles/units.EL_CHARGE el_energy = 5.2e6 * units.EV gamma = el_energy/units.EL_REST_ENERGY() beta = (1-1/gamma**2)**0.5 from pyrticle.distribution import KVZIntervalBeam beam = KVZIntervalBeam(units, total_charge=0, p_charge=0, p_mass=electrons_per_particle*units.EL_MASS, radii=2*[2.5*units.MM], emittances=2*[5 * units.MM * units.MRAD], z_length=5*units.MM, z_pos=10*units.MM, beta=beta) state = method.make_state() method.add_particles(state, beam.generate_particles(), nparticles) # diagnostics setup ------------------------------------------------------- from pytools.log import LogManager from pyrticle.log import add_beam_quantities, StateObserver observer = StateObserver(method, None) logmgr = LogManager() add_beam_quantities(logmgr, observer, axis=0, beam_axis=2) from pyrticle.distribution import KVPredictedRadius logmgr.add_quantity(KVPredictedRadius(dt, beam_v=beta*units.VACUUM_LIGHT_SPEED(), predictor=beam.get_rms_predictor(axis=0), suffix="x_rms")) logmgr.add_quantity(KVPredictedRadius(dt, beam_v=beta*units.VACUUM_LIGHT_SPEED(), predictor=beam.get_total_predictor(axis=0), suffix="x_total")) # timestep loop ----------------------------------------------------------- vel = method.velocities(state) from hedge.tools import join_fields def rhs(t, y): return join_fields([ vel, 0*vel, 0, # drecon ]) from hedge.timestep import RK4TimeStepper stepper = RK4TimeStepper() t = 0 from pyrticle.cloud import TimesteppablePicState ts_state = TimesteppablePicState(method, state) for step in xrange(nsteps): observer.set_fields_and_state(None, ts_state.state) logmgr.tick() ts_state = stepper(ts_state, t, dt, rhs) method.upkeep(ts_state.state) t += dt logmgr.tick() _, _, err_table = logmgr.get_expr_dataset("(rx_rms-rx_rms_theory)/rx_rms_theory") rel_max_rms_error = max(err for step, err in err_table) assert rel_max_rms_error < 0.01 | dd98169b5f0dd033027c2f9e4890ba462bb27813 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12869/dd98169b5f0dd033027c2f9e4890ba462bb27813/test_pyrticle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
18152,
67,
1918,
67,
2135,
67,
16385,
13332,
628,
2744,
1930,
5009,
5009,
12,
20,
13,
225,
628,
2395,
3797,
3711,
18,
7705,
1930,
5705,
7537,
1190,
23779,
3766,
2918,
4971,
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,
1842,
67,
18152,
67,
1918,
67,
2135,
67,
16385,
13332,
628,
2744,
1930,
5009,
5009,
12,
20,
13,
225,
628,
2395,
3797,
3711,
18,
7705,
1930,
5705,
7537,
1190,
23779,
3766,
2918,
4971,
273... |
level=level+1 if level > 3: output('<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) | if level > 3: output('<TD COLSPAN="%s"></TD>' % level) elif level > 1: output('<TD></TD>' * level) | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0, args=None): have_arg=args.has_key try: items=self.tpValues() except: items=None if not items and have_arg('leaves'): items=1 tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url treeData['tree-level']=level treeData['tree-item-expanded']=0 try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<TR>\n') # Add +/- icon if items: if level: if level > 3: output( '<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') output('<TD WIDTH="16" VALIGN="TOP">') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: treeData['tree-item-expanded']=1 del substate[exp-1] output('<A HREF="%s?tree-state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?tree-state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] output('</TD>\n') else: level=level+1 if level > 3: output('<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') # add item text dataspan=colspan-level output('<TD COLSPAN="%s" VALIGN="TOP">' % dataspan) output(section(self, md)) output('</TD>\n</TR>\n') if exp: level=level+1 if level > 2: h='<TD COLSPAN="%s"></TD>' % (level-1) elif level > 1: h='<TD></TD>' * (level-1) else: h='' if have_arg('header'): if md.has_key(args['header']): output(md.getitem(args['header'],0)( self, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD COLSPAN="%s" VALIGN="TOP">' % (h, dataspan-1)), standard_html_footer='</TD></TR>', )) if items==1: # leaves treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) output(md.getitem(args['leaves'],0)( self,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD COLSPAN="%s" VALIGN="TOP">' % (h, dataspan-1)), standard_html_footer='</TD></TR>', )) md._pop(1) elif have_arg('expand'): treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) output(md.getitem(args['expand'],0)(self,md)) md._pop(1) else: __traceback_info__=sub, args, state, substate for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level, args) if not sub[1]: del sub[1] if have_arg('footer'): if md.has_key(args['footer']): output(md.getitem(args['footer'],0)( self, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD COLSPAN="%s" VALIGN="TOP">' % (h, dataspan-1)), standard_html_footer='</TD></TR>', )) return data | 6a917295872f9cc820012565113f67e4d3b2f012 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6a917295872f9cc820012565113f67e4d3b2f012/TreeTag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8071,
3420,
7775,
12,
2890,
16,
1365,
67,
718,
16,
880,
16,
919,
16,
720,
2019,
16,
501,
16,
20856,
16,
2442,
16,
3481,
16,
2151,
751,
16,
1801,
33,
20,
16,
833,
33,
7036,
4672,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8071,
3420,
7775,
12,
2890,
16,
1365,
67,
718,
16,
880,
16,
919,
16,
720,
2019,
16,
501,
16,
20856,
16,
2442,
16,
3481,
16,
2151,
751,
16,
1801,
33,
20,
16,
833,
33,
7036,
4672,
22... |
assert [User(id=8), User(id=9)] == create_session().query(User).limit(2).offset(1).all() assert [User(id=8), User(id=9)] == list(create_session().query(User)[1:3]) assert User(id=8) == create_session().query(User)[1] assert [] == create_session().query(User)[3:3] assert [] == create_session().query(User)[0:0] | assert [User(id=8), User(id=9)] == create_session().query(User).order_by(User.id).limit(2).offset(1).all() assert [User(id=8), User(id=9)] == list(create_session().query(User).order_by(User.id)[1:3]) assert User(id=8) == create_session().query(User).order_by(User.id)[1] assert [] == create_session().query(User).order_by(User.id)[3:3] assert [] == create_session().query(User).order_by(User.id)[0:0] | def test_limit(self): assert [User(id=8), User(id=9)] == create_session().query(User).limit(2).offset(1).all() | 1227a7674f915cc2080104fa769e3e71254316b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1074/1227a7674f915cc2080104fa769e3e71254316b9/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3595,
12,
2890,
4672,
1815,
306,
1299,
12,
350,
33,
28,
3631,
2177,
12,
350,
33,
29,
25887,
422,
752,
67,
3184,
7675,
2271,
12,
1299,
2934,
3595,
12,
22,
2934,
3348,
12,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3595,
12,
2890,
4672,
1815,
306,
1299,
12,
350,
33,
28,
3631,
2177,
12,
350,
33,
29,
25887,
422,
752,
67,
3184,
7675,
2271,
12,
1299,
2934,
3595,
12,
22,
2934,
3348,
12,
21... |
blend = color1.Blend | blend = color1.RGB().Blend | def Sample(self, num): colors = self.colors max = num - 1.0 pos1, color1 = colors[0] pos2, color2 = colors[1] diff = float(pos2 - pos1) cur = 1 result = [] blend = color1.Blend for i in range(num): frac = i / max while frac > pos2: pos1 = pos2; color1 = color2 cur = cur + 1 pos2, color2 = colors[cur] diff = float(pos2 - pos1) blend = color1.Blend frac = (frac - pos1) / diff result.append(blend(color2, 1 - frac, frac)) return result | 630846a1d7dfdff72a1cc9f915f9c37c8c9e7a1a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3123/630846a1d7dfdff72a1cc9f915f9c37c8c9e7a1a/gradient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11474,
12,
2890,
16,
818,
4672,
5740,
273,
365,
18,
9724,
943,
273,
818,
300,
404,
18,
20,
949,
21,
16,
2036,
21,
273,
5740,
63,
20,
65,
949,
22,
16,
2036,
22,
273,
5740,
63,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11474,
12,
2890,
16,
818,
4672,
5740,
273,
365,
18,
9724,
943,
273,
818,
300,
404,
18,
20,
949,
21,
16,
2036,
21,
273,
5740,
63,
20,
65,
949,
22,
16,
2036,
22,
273,
5740,
63,
21,
... |
'message': message | 'message': message, 'files': files, | def _get_changes(env, db, repos, revs, full=None, req=None): changes = {} for rev in filter(lambda x: x in revs, revs): changeset = repos.get_changeset(rev) if changeset.message: message = util.wiki_escape_newline(changeset.message) # FIXME (#48) if not full: message = util.shorten_line(message) message = wiki_to_oneliner(message, env, db) else: message = wiki_to_html(message, req.hdf, env, db) else: message = '--' changes[rev] = { 'date_seconds': changeset.date, 'date': time.strftime('%x %X', time.localtime(changeset.date)), 'age': util.pretty_timedelta(changeset.date), 'author': changeset.author or 'anonymous', 'message': message } return changes | 157d852e334a1bd7594d87e0a099c7a011249e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/157d852e334a1bd7594d87e0a099c7a011249e6e/Browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
6329,
12,
3074,
16,
1319,
16,
13686,
16,
5588,
87,
16,
1983,
33,
7036,
16,
1111,
33,
7036,
4672,
3478,
273,
2618,
364,
5588,
316,
1034,
12,
14661,
619,
30,
619,
316,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6329,
12,
3074,
16,
1319,
16,
13686,
16,
5588,
87,
16,
1983,
33,
7036,
16,
1111,
33,
7036,
4672,
3478,
273,
2618,
364,
5588,
316,
1034,
12,
14661,
619,
30,
619,
316,
55... |
if debugmode and len(files["source"]) > 0: debug("- %2d hunks for %s" % (len(files["hunks"][nextfileno-1]), files["source"][nextfileno-1])) if filenames: if line.startswith("--- "): if nextfileno in files["source"]: warning("skipping invalid patch for %s" % files["source"][nextfileno]) del files["source"][nextfileno] re_filename = "^--- ([^\t]+)" match = re.match(re_filename, line) if not match: warning("skipping invalid filename at line %d" % lineno) | if hunkbody: if re.match(r"^[- \+\\]", line): if line.endswith("\r\n"): self.hunkends[nextfileno-1]["crlf"] += 1 elif line.endswith("\n"): self.hunkends[nextfileno-1]["lf"] += 1 elif line.endswith("\r"): self.hunkends[nextfileno-1]["cr"] += 1 if line.startswith("-"): hunkactual["linessrc"] += 1 elif line.startswith("+"): hunkactual["linestgt"] += 1 elif not line.startswith("\\"): hunkactual["linessrc"] += 1 hunkactual["linestgt"] += 1 hunkinfo.text.append(line) else: warning("invalid hunk no.%d at %d for target file %s" % (nexthunkno, lineno+1, self.target[nextfileno-1])) self.hunks[nextfileno-1].append(hunkinfo.copy()) self.hunks[nextfileno-1][nexthunkno-1]["invalid"] = True hunkbody = False hunkskip = True if hunkactual["linessrc"] > hunkinfo.linessrc or hunkactual["linestgt"] > hunkinfo.linestgt: warning("extra hunk no.%d lines at %d for target %s" % (nexthunkno, lineno+1, self.target[nextfileno-1])) self.hunks[nextfileno-1].append(hunkinfo.copy()) self.hunks[nextfileno-1][nexthunkno-1]["invalid"] = True hunkbody = False hunkskip = True elif hunkinfo.linessrc == hunkactual["linessrc"] and hunkinfo.linestgt == hunkactual["linestgt"]: self.hunks[nextfileno-1].append(hunkinfo.copy()) hunkbody = False hunkskip = True ends = self.hunkends[nextfileno-1] if ((ends["cr"]!=0) + (ends["crlf"]!=0) + (ends["lf"]!=0)) > 1: warning("inconsistent line ends in patch hunks for %s" % self.source[nextfileno-1]) if debugmode: debuglines = dict(ends) debuglines.update(file=self.target[nextfileno-1], hunk=nexthunkno) debug("crlf: %(crlf)d lf: %(lf)d cr: %(cr)d\t - file: %(file)s hunk: %(hunk)d" % debuglines) if hunkskip: match = re.match("^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))?", line) if match: hunkskip = False hunkhead = True elif line.startswith("--- "): hunkskip = False filenames = True if debugmode and len(self.source) > 0: debug("- %2d hunks for %s" % (len(self.hunks[nextfileno-1]), self.source[nextfileno-1])) if filenames: if line.startswith("--- "): if nextfileno in self.source: warning("skipping invalid patch for %s" % self.source[nextfileno]) del self.source[nextfileno] re_filename = "^--- ([^\t]+)" match = re.match(re_filename, line) if not match: warning("skipping invalid filename at line %d" % lineno) filenames = False header = True else: self.source.append(match.group(1)) elif not line.startswith("+++ "): if nextfileno in self.source: warning("skipping invalid patch with no target for %s" % self.source[nextfileno]) del self.source[nextfileno] else: warning("skipping invalid target patch") | def patch_from_file(filename): """ read and parse unified diff file into python structure - dict table where entries are columns and each row corresponds to one source file { source, # list of source filenames target, # list of target filenames (not used) hunks, # list of lists of hunks hunkends, # file endings statistics in hunks } this structure is essentialy a table with a row for every source file """ files = dict(source=[], target=[], hunks=[], hunkends=[]) # define possible file regions that will direct the parser flow header = False # comments before the patch body filenames = False # lines starting with --- and +++ hunkhead = False # @@ -R +R @@ sequence hunkbody = False # hunkskip = False # skipping invalid hunk mode header = True lineends = dict(lf=0, crlf=0, cr=0) nextfileno = 0 nexthunkno = 0 #: even if index starts with 0 user messages number hunks from 1 # hunkinfo holds parsed values, hunkactual - calculated hunkinfo = HunkInfo() hunkactual = dict(linessrc=None, linestgt=None) info("reading patch %s" % filename) fp = open(filename, "rb") for lineno, line in enumerate(fp): # analyze state if header and line.startswith("--- "): header = False # switch to filenames state filenames = True #: skip hunkskip and hunkbody code until you read definition of hunkhead if hunkbody: # process line first if re.match(r"^[- \+\\]", line): # gather stats about line endings if line.endswith("\r\n"): files["hunkends"][nextfileno-1]["crlf"] += 1 elif line.endswith("\n"): files["hunkends"][nextfileno-1]["lf"] += 1 elif line.endswith("\r"): files["hunkends"][nextfileno-1]["cr"] += 1 if line.startswith("-"): hunkactual["linessrc"] += 1 elif line.startswith("+"): hunkactual["linestgt"] += 1 elif not line.startswith("\\"): hunkactual["linessrc"] += 1 hunkactual["linestgt"] += 1 hunkinfo.text.append(line) # todo: handle \ No newline cases else: warning("invalid hunk no.%d at %d for target file %s" % (nexthunkno, lineno+1, files["target"][nextfileno-1])) # add hunk status node files["hunks"][nextfileno-1].append(hunkinfo.copy()) files["hunks"][nextfileno-1][nexthunkno-1]["invalid"] = True # switch to hunkskip state hunkbody = False hunkskip = True # check exit conditions if hunkactual["linessrc"] > hunkinfo.linessrc or hunkactual["linestgt"] > hunkinfo.linestgt: warning("extra hunk no.%d lines at %d for target %s" % (nexthunkno, lineno+1, files["target"][nextfileno-1])) # add hunk status node files["hunks"][nextfileno-1].append(hunkinfo.copy()) files["hunks"][nextfileno-1][nexthunkno-1]["invalid"] = True # switch to hunkskip state hunkbody = False hunkskip = True elif hunkinfo.linessrc == hunkactual["linessrc"] and hunkinfo.linestgt == hunkactual["linestgt"]: files["hunks"][nextfileno-1].append(hunkinfo.copy()) # switch to hunkskip state hunkbody = False hunkskip = True # detect mixed window/unix line ends ends = files["hunkends"][nextfileno-1] if ((ends["cr"]!=0) + (ends["crlf"]!=0) + (ends["lf"]!=0)) > 1: warning("inconsistent line ends in patch hunks for %s" % files["source"][nextfileno-1]) if debugmode: debuglines = dict(ends) debuglines.update(file=files["target"][nextfileno-1], hunk=nexthunkno) debug("crlf: %(crlf)d lf: %(lf)d cr: %(cr)d\t - file: %(file)s hunk: %(hunk)d" % debuglines) if hunkskip: match = re.match("^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))?", line) if match: # switch to hunkhead state hunkskip = False hunkhead = True elif line.startswith("--- "): # switch to filenames state hunkskip = False filenames = True if debugmode and len(files["source"]) > 0: debug("- %2d hunks for %s" % (len(files["hunks"][nextfileno-1]), files["source"][nextfileno-1])) if filenames: if line.startswith("--- "): if nextfileno in files["source"]: warning("skipping invalid patch for %s" % files["source"][nextfileno]) del files["source"][nextfileno] # double source filename line is encountered # attempt to restart from this second line re_filename = "^--- ([^\t]+)" match = re.match(re_filename, line) if not match: warning("skipping invalid filename at line %d" % lineno) # switch back to header state filenames = False header = True else: files["source"].append(match.group(1)) elif not line.startswith("+++ "): if nextfileno in files["source"]: warning("skipping invalid patch with no target for %s" % files["source"][nextfileno]) del files["source"][nextfileno] else: # this should be unreachable warning("skipping invalid target patch") filenames = False header = True else: if nextfileno in files["target"]: warning("skipping invalid patch - double target at line %d" % lineno) del files["source"][nextfileno] del files["target"][nextfileno] nextfileno -= 1 # double target filename line is encountered # switch back to header state filenames = False header = True else: re_filename = "^\+\+\+ ([^\t]+)" match = re.match(re_filename, line) if not match: warning("skipping invalid patch - no target filename at line %d" % lineno) # switch back to header state filenames = False header = True else: files["target"].append(match.group(1)) nextfileno += 1 # switch to hunkhead state filenames = False hunkhead = True nexthunkno = 0 files["hunks"].append([]) files["hunkends"].append(lineends.copy()) continue if hunkhead: match = re.match("^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))?", line) if not match: if nextfileno-1 not in files["hunks"]: warning("skipping invalid patch with no hunks for file %s" % files["target"][nextfileno-1]) # switch to header state hunkhead = False header = True continue else: # switch to header state hunkhead = False header = True else: hunkinfo.startsrc = int(match.group(1)) hunkinfo.linessrc = int(match.group(3) if match.group(3) else 1) hunkinfo.starttgt = int(match.group(4)) hunkinfo.linestgt = int(match.group(6) if match.group(6) else 1) hunkinfo.invalid = False hunkinfo.text = [] hunkactual["linessrc"] = hunkactual["linestgt"] = 0 # switch to hunkbody state hunkhead = False hunkbody = True nexthunkno += 1 continue else: if not hunkskip: warning("patch file incomplete - %s" % filename) # sys.exit(?) else: # duplicated message when an eof is reached if debugmode and len(files["source"]) > 0: debug("- %2d hunks for %s" % (len(files["hunks"][nextfileno-1]), files["source"][nextfileno-1])) info("total files: %d total hunks: %d" % (len(files["source"]), sum(len(hset) for hset in files["hunks"]))) fp.close() return files | ad21009e42fd33446415789f26b7f1947800b96b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4098/ad21009e42fd33446415789f26b7f1947800b96b/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4729,
67,
2080,
67,
768,
12,
3459,
4672,
3536,
855,
471,
1109,
27136,
3122,
585,
1368,
5790,
3695,
300,
2065,
1014,
1625,
3222,
854,
2168,
471,
1517,
1027,
13955,
358,
1245,
1084,
585,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4729,
67,
2080,
67,
768,
12,
3459,
4672,
3536,
855,
471,
1109,
27136,
3122,
585,
1368,
5790,
3695,
300,
2065,
1014,
1625,
3222,
854,
2168,
471,
1517,
1027,
13955,
358,
1245,
1084,
585,
2... |
return self.valueToIECValue() | return self.valueToIECValue() | def getDisplayValue(self): | 43e4ab46eed5e41d2af40091522912ba9175fcc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/43e4ab46eed5e41d2af40091522912ba9175fcc3/PropertyEditors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13854,
620,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13854,
620,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
155,(3-4) : 251-263, 2008. | 155 (2008) 251-263. | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | 2eab66e63556bda27359db7a54db5c47986fb336 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2eab66e63556bda27359db7a54db5c47986fb336/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13162,
67,
354,
89,
21832,
67,
4660,
12,
2890,
16,
290,
4672,
436,
8395,
2860,
326,
13162,
534,
8377,
21832,
2667,
434,
1353,
1375,
82,
68,
434,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13162,
67,
354,
89,
21832,
67,
4660,
12,
2890,
16,
290,
4672,
436,
8395,
2860,
326,
13162,
534,
8377,
21832,
2667,
434,
1353,
1375,
82,
68,
434,
365,
18,
2,
-100,
-100,
-100,
-100,
-10... |
elif (J[0].parent()).is_abelian() and F == ZZ or (F.is_field() and F.base_ring()==QQ): | elif not(J[0] in ZZ) and G.is_abelian() and F == ZZ or (F.is_field() and F.base_ring()==QQ): if is_PermutationGroupElement(J[0]): n = G.order() a = list(factor(n)) invs = [x[0]**x[1] for x in a] G = AbelianGroup(len(a),invs) | def dft(self, chi = lambda x: x): """ Implements a discrete Fourier transform "over QQ" using exact N-th roots of unity. | b5d444db2992a10837c0e2ccaebfd79325c6361e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/b5d444db2992a10837c0e2ccaebfd79325c6361e/dft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
1222,
12,
2890,
16,
17198,
273,
3195,
619,
30,
619,
4672,
3536,
29704,
279,
20035,
478,
24775,
2510,
315,
1643,
2238,
53,
6,
1450,
5565,
423,
17,
451,
12876,
434,
640,
560,
18,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
302,
1222,
12,
2890,
16,
17198,
273,
3195,
619,
30,
619,
4672,
3536,
29704,
279,
20035,
478,
24775,
2510,
315,
1643,
2238,
53,
6,
1450,
5565,
423,
17,
451,
12876,
434,
640,
560,
18,
2,... |
v_option = "%s|%s" % (o['id'], o['name']) | vocab = "%s|%s" % (o['id'], o['name']) | def apply(self, pfg, initial_finish=True): """ Apply changes to the underlying PloneFormGen form based on the submitted values. """ data = self.getContent() existing_ids = pfg.objectIds() recipients = data['recipients'] required_recipients = [] optional_recipients = [] annotation = IAnnotations(pfg).setdefault(ANNOTATION_KEY, PersistentDict()) | 389d73dca84f3f4e4edaee1b7dd676fb70c26b88 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10584/389d73dca84f3f4e4edaee1b7dd676fb70c26b88/recipients_step.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
16,
293,
2137,
16,
2172,
67,
13749,
33,
5510,
4672,
3536,
5534,
3478,
358,
326,
6808,
3008,
476,
1204,
7642,
646,
2511,
603,
326,
9638,
924,
18,
3536,
501,
273,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
16,
293,
2137,
16,
2172,
67,
13749,
33,
5510,
4672,
3536,
5534,
3478,
358,
326,
6808,
3008,
476,
1204,
7642,
646,
2511,
603,
326,
9638,
924,
18,
3536,
501,
273,
365,
18... |
if gcc_version is None or gcc_version < 43000: return | if gcc_version is None or gcc_version < 40300: return | def __init__(self, env_base, env_etc): self.is_working = False self.command_line_option = libtbx.select_matching( key=env_etc.compiler, choices=[ ('^win32_cl$' , '/openmp'), ('^win32_icc$', '/Qopenmp'), ('^unix_icc$' , '-openmp'), ('gcc' , '-fopenmp'), ]) if self.command_line_option is None: return env = env_base.Copy(LIBPATH=[], LIBS=[], CPPDEFINES=[], CPPPATH=[], CXXFLAGS=self.command_line_option, LINKFLAGS=self.command_line_option) conf = env.Configure() flag, output = conf.TryRun(self.test_code, extension='.cpp') conf.Finish() if not(flag and output.strip() == "e=2.71828, pi=3.14159"): return if sys.platform == 'linux2': # C.f. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28482 gcc_version = get_gcc_version() if gcc_version is None or gcc_version < 43000: return self.is_working = True | 4f2194f106560a5be0ae51577101ac1ec155a634 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/696/4f2194f106560a5be0ae51577101ac1ec155a634/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1550,
67,
1969,
16,
1550,
67,
14175,
4672,
365,
18,
291,
67,
20478,
273,
1083,
365,
18,
3076,
67,
1369,
67,
3482,
273,
2561,
18587,
92,
18,
4025,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1550,
67,
1969,
16,
1550,
67,
14175,
4672,
365,
18,
291,
67,
20478,
273,
1083,
365,
18,
3076,
67,
1369,
67,
3482,
273,
2561,
18587,
92,
18,
4025,
67,
1... |
print "$Id:$" | print "$Id: plotsnrchisq_pipe.py,v 1.22 2007/06/11 14:46:22 channa Exp $" | def plotsnrchisq(gpsTime,frameFile,outputPath,inspProcParams,tableFileName,imgFile,page): rsqThreshold = 0; for row in inspProcParams: if row.param == "--channel-name": chanStringBase = row.value ifoName = str(row.value).split(":",1) if row.param == "--segment-length": segLen = eval(row.value) if row.param == "--sample-rate": sampleRate = eval(row.value) if row.param == "--segment-overlap": segOverlap = eval(row.value) if (row.param == "--chisq-delta"): chisqDelta = eval(row.value) if row.param =="--chisq-bins": chisqBins = eval(row.value) if row.param == "--snr-threshold": snrThreshold = eval(row.value) if row.param == "--chisq-threshold": chisqThreshold = eval(row.value) if row.param == "--rsq-veto-threshold": rsqThreshold = eval(row.value) if row.param == "--trig-start-time": trigStart = eval(row.value) if row.param == "--gps-start-time": gpsStart = eval(row.value) if row.param == "--low-frequency-cutoff": flow = eval(row.value) if row.param == "--dynamic-range-exponent": dynRange = eval(row.value) segLenSec = segLen / sampleRate segOverlapSec = segOverlap / sampleRate if (trigStart): trigPosition = int((trigStart - gpsStart - segOverlapSec ) / (segLenSec -segOverlapSec)) else: trigPosition = 0 gpsPosition = int((eval(gpsTime) - gpsStart - segOverlapSec/2. ) / (segLenSec -segOverlapSec)) if (trigPosition < 0): trigPosition = 0 position = gpsPosition - trigPosition chanNumber = str(position) chanNamePSD = chanStringBase + "_PSD" # now, read the data !! # The window width should be an input argument maybe ? duration = 2.0 chanNums = range(16) print chanNums # figure out what the hell is in this file for chan in chanNums: chanNameSnr = chanStringBase + "_SNRSQ_" + str(chan) try: squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) except: break if position == 1: chan -= 1 if position == 0: chan -= 2 chanNameSnr = chanStringBase + "_SNRSQ_" + str(chan) chanNameChisq = chanStringBase + "_CHISQ_" + str(chan) squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) squareChisq_tuple = Fr.frgetvect(frameFile,chanNameChisq,-1,segLenSec,0) PSD_tuple = Fr.frgetvect(frameFile,chanNamePSD,-1,segLenSec*8,0) #print PSD_tuple snr_position = eval(gpsTime) - (gpsStart + gpsPosition* (segLenSec - segOverlapSec) ) chisq_position = snr_position # compute the snr vector snr_vector = sqrt(squareSnr_tuple[0]) # print squareSnr_tuple snr_time = array(range(0, segLen)) * squareSnr_tuple[3][0] - snr_position | 86d5e9a91584989d75281800f3eff14e2619b6b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/86d5e9a91584989d75281800f3eff14e2619b6b8/plotsnrchisq_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
2844,
743,
16,
267,
1752,
15417,
1370,
16,
2121,
4771,
16,
6081,
812,
16,
2433,
4672,
225,
3597,
85,
7614,
273,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
2844,
743,
16,
267,
1752,
15417,
1370,
16,
2121,
4771,
16,
6081,
812,
16,
2433,
4672,
225,
3597,
85,
7614,
273,
37... |
self.MAILBOX=os.environ['MAIL'] self.CLOCKFONT='skins/fonts/Trebuchet_MS.ttf' | if 'MAIL' in os.environ: self.MAILBOX = os.environ['MAIL'] else: self.MAILBOX = '' self.CLOCKFONT = 'skins/fonts/Trebuchet_MS.ttf' | def __init__(self): self.idlecount = 0 self.clock_surface = osd.getsurface(525, 25, 225, 50) self.mail_surface = osd.getsurface(25,25,225,50) self.MAILBOX='/var/mail/aubin' if not os.path.isfile(self.MAILBOX): # XXX Try the mail environment; this might not work if the user runs this # as root, if he starts with 'sudo' it will though. self.MAILBOX=os.environ['MAIL'] self.CLOCKFONT='skins/fonts/Trebuchet_MS.ttf' if not os.path.isfile(self.CLOCKFONT): # XXX Get this from the skin, but for now this will allow it to work self.CLOCKFONT=config.OSD_DEFAULT_FONTNAME self.NO_MAILIMAGE='skins/images/status/newmail_dimmed.png' self.MAILIMAGE='skins/images/status/newmail_active.png' self.TVLOCKED='skins/images/status/television_active.png' self.TVFREE='skins/images/status/television_inactive.png' self.METARCODE='CYYZ' self.WEATHERCACHE = '/var/cache/freevo/weather' self.interval = 300 self.tvlockfile = '/var/cache/freevo/record' | a7f5819728908b475ae0679a84f8b51820dd2789 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/a7f5819728908b475ae0679a84f8b51820dd2789/idle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
20390,
1883,
273,
374,
365,
18,
18517,
67,
18266,
273,
1140,
72,
18,
588,
18266,
12,
25,
2947,
16,
6969,
16,
28298,
16,
6437,
13,
365,
18,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
20390,
1883,
273,
374,
365,
18,
18517,
67,
18266,
273,
1140,
72,
18,
588,
18266,
12,
25,
2947,
16,
6969,
16,
28298,
16,
6437,
13,
365,
18,
4... |
params = lib.Interpolation.interpolate(params1, params2, n - 1) | params = lib.Interpolation.linearInterpolation(params1, params2, n - 1) | def interpolateIntensitiesBetween(self, timepoint1, timepoint2): """ Created: 09.12.2004, KP Description: Interpolates intensity transfer functions for timepoints between timepoint1 and timepoint2 """ if timepoint1 > timepoint2: timepoint2, timepoint1 = timepoint1, timepoint2 n = timepoint2 - timepoint1 itf1 = self.settings.getCounted("IntensityTransferFunctions", timepoint1) itf2 = self.settings.getCounted("IntensityTransferFunctions", timepoint2) params1 = lib.ImageOperations.getAsParameterList(itf1) params2 = lib.ImageOperations.getAsParameterList(itf2) # There are n-1 timepoints between the specified timepoints params = lib.Interpolation.interpolate(params1, params2, n - 1) print "params1=", params1 print "params2=", params2 print "Interpolated %d new paramlists" % len(params) for i in range(n - 1): print "Setting new parameters for timepoint ", timepoint1 + i + 1 iTF = self.settings.getCounted("IntensityTransferFunctions", timepoint1 + i + 1) lib.ImageOperations.setFromParameterList(iTF, params[i]) self.settings.setCounted("IntensityTransferFunctions", timepoint1 + i + 1, iTF) | 7abaefc135906c1ecba6fae5a5725f66f5c1b092 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/7abaefc135906c1ecba6fae5a5725f66f5c1b092/AdjustDataUnit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13156,
1702,
21970,
11831,
12,
2890,
16,
813,
1153,
21,
16,
813,
1153,
22,
4672,
3536,
12953,
30,
21058,
18,
2138,
18,
6976,
24,
16,
1475,
52,
6507,
30,
24301,
815,
16551,
7412,
4186,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13156,
1702,
21970,
11831,
12,
2890,
16,
813,
1153,
21,
16,
813,
1153,
22,
4672,
3536,
12953,
30,
21058,
18,
2138,
18,
6976,
24,
16,
1475,
52,
6507,
30,
24301,
815,
16551,
7412,
4186,
... |
FL_Coord, STRING], | FL_Coord, STRING], | def fl_add_thumbwheel(type, x, y, w, h, label): """ fl_add_thumbwheel(type, x, y, w, h, label) -> object """ retval = _fl_add_thumbwheel(type, x, y, w, h, label) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
67,
21639,
21344,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
1289,
67,
21639,
21344,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
67,
21639,
21344,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
1289,
67,
21639,
21344,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
... |
self.client.server_content(data) | if data: self.client.server_content(data) | def process_content (self): """process server data: filter it and write it to client""" data = self.read(self.bytes_remaining) wc.log.debug(wc.LOG_PROXY, "%s process %d bytes", self, len(data)) if self.bytes_remaining is not None: # If we do know how many bytes we're dealing with, # we'll close the connection when we're done self.bytes_remaining -= len(data) wc.log.debug(wc.LOG_PROXY, "%s %d bytes remaining", self, self.bytes_remaining) is_closed = False for decoder in self.decoders: data = decoder.decode(data) wc.log.debug(wc.LOG_PROXY, "%s have run decoder %s", self, decoder) if not is_closed and decoder.closed: is_closed = True try: data = wc.filter.applyfilters(FilterLevels, data, "filter", self.attrs) except wc.filter.FilterWait, msg: wc.log.debug(wc.LOG_PROXY, "%s FilterWait %s", self, msg) except wc.filter.FilterRating, msg: wc.log.debug(wc.LOG_PROXY, "%s FilterRating from content %s", self, msg) self._show_rating_deny(str(msg)) return except wc.filter.FilterProxyError, e: self.client.error(e.status, e.msg, txt=e.text) self.handle_error("filter proxy error") return underflow = self.bytes_remaining is not None and \ self.bytes_remaining < 0 if underflow: wc.log.warn(wc.LOG_PROXY, _("server received %d bytes more than content-length"), (-self.bytes_remaining)) if data and self.statuscode != 407: if self.defer_data: self.defer_data = False self.client.server_response(self, self.response, self.statuscode, self.headers) if not self.client: return self.client.server_content(data) if is_closed or self.bytes_remaining == 0: # either we ran out of bytes, or the decoder says we're done self.state = 'recycle' | 62269c4d81468ab25aef7067fb2e3ec8bbd33133 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/62269c4d81468ab25aef7067fb2e3ec8bbd33133/HttpServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1745,
261,
2890,
4672,
3536,
2567,
1438,
501,
30,
1034,
518,
471,
1045,
518,
358,
1004,
8395,
501,
273,
365,
18,
896,
12,
2890,
18,
3890,
67,
17956,
13,
14310,
18,
1330,
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,
1207,
67,
1745,
261,
2890,
4672,
3536,
2567,
1438,
501,
30,
1034,
518,
471,
1045,
518,
358,
1004,
8395,
501,
273,
365,
18,
896,
12,
2890,
18,
3890,
67,
17956,
13,
14310,
18,
1330,
18,
... |
"""Called when the incoming data stream matches the \r\n terminator """ | r"""Called when the incoming data stream matches the \r\n terminator.""" | def found_terminator(self): """Called when the incoming data stream matches the \r\n terminator """ line = ''.join(self.in_buffer).strip() self.in_buffer = [] self.in_buffer_len = 0 | e1763c9db15d5d6d781646fb0678f3c70d95867a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/e1763c9db15d5d6d781646fb0678f3c70d95867a/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1392,
67,
9505,
639,
12,
2890,
4672,
436,
8395,
8185,
1347,
326,
6935,
501,
1407,
1885,
326,
521,
86,
64,
82,
24965,
12123,
980,
273,
875,
18,
5701,
12,
2890,
18,
267,
67,
4106,
2934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1392,
67,
9505,
639,
12,
2890,
4672,
436,
8395,
8185,
1347,
326,
6935,
501,
1407,
1885,
326,
521,
86,
64,
82,
24965,
12123,
980,
273,
875,
18,
5701,
12,
2890,
18,
267,
67,
4106,
2934,
... |
results = self.__copyFileHandle(results,resultOut ) err = self.__copyFileHandle(err, self.outFolder+self.F_BLAST_ERROR) if self.verbose: self.log.writeln('Raw blast output copied to: ' + resultOut ) p = NCBIXML.BlastParser() parsed = p.parse( results )[-1] | results = self.__copyFileHandle(results,resultOut ) err = self.__copyFileHandle(err, self.outFolder+self.F_BLAST_ERROR) if self.verbose: self.log.writeln('Raw blast output copied to: ' + resultOut ) p = NCBIXML.BlastParser() parsed = p.parse( results )[-1] | (def 9). | 192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9/SequenceSearcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
261,
536,
2468,
2934,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
261,
536,
2468,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if hasattr(self.aq_base,'manage_FTPget'): | if hasattr(self.aq_base,'manage_FTPget') and \ hasattr(self.manage_FTPget, '__roles__'): | def manage_FTPstat(self,REQUEST): "psuedo stat, used by FTP for directory listings" from AccessControl.User import nobody mode=0100000 # check read permissions if hasattr(self.aq_base,'manage_FTPget'): if REQUEST['AUTHENTICATED_USER'].allowed(self.manage_FTPget, self.manage_FTPget.__roles__): mode=mode | 0440 if nobody.allowed(self.manage_FTPget, self.manage_FTPget.__roles__): mode=mode | 0004 # check write permissions if hasattr(self.aq_base,'PUT'): if REQUEST['AUTHENTICATED_USER'].allowed(self.PUT, self.PUT.__roles__): mode=mode | 0220 if nobody.allowed(self.PUT, self.PUT.__roles__): mode=mode | 0002 # get size if hasattr(self,'manage_FTPget'): size=len(self.manage_FTPget()) else: size=0 # get modification time mtime=self.bobobase_modification_time().timeTime() return marshal.dumps((mode,0,0,1,0,0,size,mtime,mtime,mtime)) | d6407826189bc19856c4e91520f58e265eda47d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d6407826189bc19856c4e91520f58e265eda47d4/SimpleItem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
17104,
5642,
12,
2890,
16,
5519,
4672,
315,
1121,
5957,
83,
610,
16,
1399,
635,
19324,
364,
1867,
666,
899,
6,
628,
24349,
18,
1299,
1930,
290,
947,
973,
1965,
33,
1611,
117... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
17104,
5642,
12,
2890,
16,
5519,
4672,
315,
1121,
5957,
83,
610,
16,
1399,
635,
19324,
364,
1867,
666,
899,
6,
628,
24349,
18,
1299,
1930,
290,
947,
973,
1965,
33,
1611,
117... |
if self.sess: | if not self.sess: | def open(self): sess = netsnmp_session() lib.snmp_sess_init(byref(sess)) for attr, value in self.kw.items(): setattr(sess, attr, value) sess.callback = _callback sess.callback_magic = id(self) sess = lib.snmp_open(byref(sess)) self.sess = sess # cast(sess, POINTER(netsnmp_session)) if self.sess: raise SnmpError('snmp_open') sessionMap[sess.contents.sessid] = self | 3172fda32ba56f5d603f80b37cbd52903b621e7d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9117/3172fda32ba56f5d603f80b37cbd52903b621e7d/netsnmp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
8451,
273,
21954,
82,
1291,
67,
3184,
1435,
2561,
18,
26527,
67,
23828,
67,
2738,
12,
1637,
1734,
12,
23828,
3719,
364,
1604,
16,
460,
316,
365,
18,
9987,
18,
331... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
8451,
273,
21954,
82,
1291,
67,
3184,
1435,
2561,
18,
26527,
67,
23828,
67,
2738,
12,
1637,
1734,
12,
23828,
3719,
364,
1604,
16,
460,
316,
365,
18,
9987,
18,
331... |
Waits until the |function| evalues to True or until |timeout| secs, whichever occurs earlier. | Waits until the |function| evalues to |expect_retval| or until |timeout| secs, whichever occurs earlier. | def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]): """Poll on a condition until timeout. | a9373e05f607d2a25b2a2861419b2a2e487dbda9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/a9373e05f607d2a25b2a2861419b2a2e487dbda9/pyauto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5838,
9716,
12,
2890,
16,
445,
16,
2021,
29711,
21,
16,
3300,
67,
19607,
33,
20,
18,
2947,
16,
833,
33,
8526,
4672,
3536,
19085,
603,
279,
2269,
3180,
2021,
18,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5838,
9716,
12,
2890,
16,
445,
16,
2021,
29711,
21,
16,
3300,
67,
19607,
33,
20,
18,
2947,
16,
833,
33,
8526,
4672,
3536,
19085,
603,
279,
2269,
3180,
2021,
18,
2,
-100,
-100,
-100,
... |
res[int(prop.res_id.split(',')[1])] = prop.value or '' | res[int(prop.res_id.id)] = prop.value or '' | def _fnct_read(self, obj, cr, uid, ids, prop, val, context=None): if not context: context = {} property = obj.pool.get('ir.property') definition_id = self._field_get(cr, uid, obj._name, prop) | 7e24e7da3a66a14dcd7366b28c8b34c8e5e163cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/7e24e7da3a66a14dcd7366b28c8b34c8e5e163cc/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4293,
299,
67,
896,
12,
2890,
16,
1081,
16,
4422,
16,
4555,
16,
3258,
16,
2270,
16,
1244,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
1272,
273,
1081,
18,
6011,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4293,
299,
67,
896,
12,
2890,
16,
1081,
16,
4422,
16,
4555,
16,
3258,
16,
2270,
16,
1244,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
1272,
273,
1081,
18,
6011,
... |
tarinfo.prefix = buf[345:500] | prefix = buf[345:500].rstrip(NUL) if prefix and not tarinfo.issparse(): tarinfo.name = prefix + "/" + tarinfo.name | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise ValueError("empty header") | 3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
4385,
12,
6429,
16,
1681,
4672,
3536,
7249,
279,
20334,
966,
733,
628,
279,
13908,
1160,
533,
1613,
18,
3536,
309,
562,
12,
4385,
13,
480,
14073,
4574,
30,
1002,
2068,
2932,
23558,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
4385,
12,
6429,
16,
1681,
4672,
3536,
7249,
279,
20334,
966,
733,
628,
279,
13908,
1160,
533,
1613,
18,
3536,
309,
562,
12,
4385,
13,
480,
14073,
4574,
30,
1002,
2068,
2932,
23558,
... |
return self._dry_run(context, variables, arguments) return self._variable_resolving_run(context, variables, arguments) def _dry_run(self, context, variables, arguments): args = self.arguments.resolve_arguments_for_dry_run(arguments) self._execute(context, variables, args) | return self._dry_run(context, variables, args_spec, argument_values) return self._variable_resolving_run(context, variables, args_spec, argument_values) def _dry_run(self, context, variables, args_spec, argument_values): resolved_arguments = args_spec.resolve_arguments_for_dry_run(argument_values) self._execute(context, variables, args_spec, resolved_arguments) | def _run(self, context, arguments): variables = context.get_current_vars() if context.dry_run: return self._dry_run(context, variables, arguments) return self._variable_resolving_run(context, variables, arguments) | a8ee089c12c7dcfad3ce27221bd7e8c0d51bef97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/a8ee089c12c7dcfad3ce27221bd7e8c0d51bef97/userkeyword.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
12,
2890,
16,
819,
16,
1775,
4672,
3152,
273,
819,
18,
588,
67,
2972,
67,
4699,
1435,
309,
819,
18,
25011,
67,
2681,
30,
327,
365,
6315,
25011,
67,
2681,
12,
2472,
16,
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,
389,
2681,
12,
2890,
16,
819,
16,
1775,
4672,
3152,
273,
819,
18,
588,
67,
2972,
67,
4699,
1435,
309,
819,
18,
25011,
67,
2681,
30,
327,
365,
6315,
25011,
67,
2681,
12,
2472,
16,
315... |
if not hasBlock: | if not elseCode.startswith("{"): | def __if(node): result = "if(%s)" % compress(node.condition) # Micro optimization: Omit block curly braces when it only contains one child thenPart, hasBlock = block_unwrap(node.thenPart) result += thenPart elsePart = getattr(node, "elsePart", None) if elsePart: # if-blocks without braces require a semicolon here if not (hasBlock or result.endswith(";")): result += ";" result += "else" # Micro optimization: Omit curly braces when block contains only one child elseCode, hasBlock = block_unwrap(elsePart) # Micro optimization: Don't need a space when the child is a block if not hasBlock: result += " " result += elseCode if not hasBlock and not elseCode.endswith(";"): result += ";" return result | aa08ce4c8b8d7e115947659d1485252ed4883126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/aa08ce4c8b8d7e115947659d1485252ed4883126/Compressor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
430,
12,
2159,
4672,
563,
273,
315,
430,
9275,
87,
2225,
738,
8099,
12,
2159,
18,
4175,
13,
225,
468,
18284,
14850,
30,
531,
1938,
1203,
29270,
26852,
1347,
518,
1338,
1914,
1245,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
430,
12,
2159,
4672,
563,
273,
315,
430,
9275,
87,
2225,
738,
8099,
12,
2159,
18,
4175,
13,
225,
468,
18284,
14850,
30,
531,
1938,
1203,
29270,
26852,
1347,
518,
1338,
1914,
1245,
... |
self.body.append(graph.to_html(self._directory) | self.body.append(graph.to_html(self._directory)) | def visit_dotgraph(self, node): if self._directory is None: raise SkipNode() # [xx] warning? # Generate the graph. graph = node.graph(self._docindex, self._context, self._linker) if graph is None: raise SkipNode() # Write the graph. self.body.append(graph.to_html(self._directory) raise SkipNode() | cd24b55e757f3e49f877ce8dee5a18a4e8ea14fe /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3512/cd24b55e757f3e49f877ce8dee5a18a4e8ea14fe/restructuredtext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
9811,
4660,
12,
2890,
16,
756,
4672,
309,
365,
6315,
5149,
353,
599,
30,
1002,
6611,
907,
1435,
468,
306,
5279,
65,
3436,
35,
225,
468,
6654,
326,
2667,
18,
2667,
273,
756,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9811,
4660,
12,
2890,
16,
756,
4672,
309,
365,
6315,
5149,
353,
599,
30,
1002,
6611,
907,
1435,
468,
306,
5279,
65,
3436,
35,
225,
468,
6654,
326,
2667,
18,
2667,
273,
756,
... |
self.indexer.prune(set(self.env.all_files) - set(filenames)) | self.indexer.prune([fn[:-4] for fn in set(self.env.all_files) - set(filenames)]) | def load_indexer(self, filenames): try: with open(path.join(self.outdir, 'searchindex.json'), 'r') as f: self.indexer.load(f, 'json') except (IOError, OSError): pass # delete all entries for files that will be rebuilt self.indexer.prune(set(self.env.all_files) - set(filenames)) | a0df38ef4a24a8c1bfd0c2c87e68dd85ccd66d5e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5532/a0df38ef4a24a8c1bfd0c2c87e68dd85ccd66d5e/builder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
24541,
12,
2890,
16,
9066,
4672,
775,
30,
598,
1696,
12,
803,
18,
5701,
12,
2890,
18,
659,
1214,
16,
296,
3072,
1615,
18,
1977,
19899,
296,
86,
6134,
487,
284,
30,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
24541,
12,
2890,
16,
9066,
4672,
775,
30,
598,
1696,
12,
803,
18,
5701,
12,
2890,
18,
659,
1214,
16,
296,
3072,
1615,
18,
1977,
19899,
296,
86,
6134,
487,
284,
30,
365,
18,... |
if not id and query: id = vfolder_add(name, query, parent) else: raise KeyError | if not id: if query: id = vfolder_add(name, query, parent) else: raise KeyError | def __init__(self, id=None, name=None, query=None, parent=None): if (not id and not query and not name): raise RuntimeError("Can't create a VFolder instance without at least one of id, name and query") if name and not id: id = vfolder_find(name) if not id and query: id = vfolder_add(name, query, parent) else: raise KeyError if id and query: self.id = id self.name = name self.query = query self.parent = parent elif id: self.id = id i = vfolder_get(id) if not i: raise KeyError (self.name, self.query, self.parent) = i else: self.id = None self.name = None self.query = query self.parent = None | a8d4603e5ac3e4a7dff8615777c91b1b45d2f710 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3083/a8d4603e5ac3e4a7dff8615777c91b1b45d2f710/vfolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
612,
33,
7036,
16,
508,
33,
7036,
16,
843,
33,
7036,
16,
982,
33,
7036,
4672,
309,
261,
902,
612,
471,
486,
843,
471,
486,
508,
4672,
1002,
7265,
2932,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
612,
33,
7036,
16,
508,
33,
7036,
16,
843,
33,
7036,
16,
982,
33,
7036,
4672,
309,
261,
902,
612,
471,
486,
843,
471,
486,
508,
4672,
1002,
7265,
2932,... |
return new Node(t, WITH) | return Node(t, WITH) | def WITH__build(t): return new Node(t, WITH) | c7acf93c85d2480e1e64e292c2f42ae1721eefbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/c7acf93c85d2480e1e64e292c2f42ae1721eefbe/Builder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13601,
972,
3510,
12,
88,
4672,
327,
394,
2029,
12,
88,
16,
13601,
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,
... | [
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,
13601,
972,
3510,
12,
88,
4672,
327,
394,
2029,
12,
88,
16,
13601,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
csv_file = gzip.open(config.export_file_prefix + ".csv.gz", "w") | csv_file = gzip.open(fn, "w") | def export_csv(self): """ Export current router cache in CSV format. See data-spec for more information on export formats. """ try: if config.export_gzip: csv_file = gzip.open(config.export_file_prefix + ".csv.gz", "w") else: csv_file = open(config.export_file_prefix + ".csv", "w") out = csv.writer(csv_file, dialect = csv.excel) | c608f50e5b380c33c22e562337c8f2b8f23b399a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9986/c608f50e5b380c33c22e562337c8f2b8f23b399a/controller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
6715,
12,
2890,
4672,
3536,
11054,
783,
4633,
1247,
316,
10381,
740,
18,
225,
2164,
501,
17,
2793,
364,
1898,
1779,
603,
3359,
6449,
18,
3536,
775,
30,
309,
642,
18,
6530,
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,
3359,
67,
6715,
12,
2890,
4672,
3536,
11054,
783,
4633,
1247,
316,
10381,
740,
18,
225,
2164,
501,
17,
2793,
364,
1898,
1779,
603,
3359,
6449,
18,
3536,
775,
30,
309,
642,
18,
6530,
67... |
self._getOb(id).manage_upload(file) | if file: self._getOb(id).manage_upload(file) | def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) self=self.this() # First, we create the image without data: self._setObject(id, Image(id,title,'',content_type, precondition)) # Now we "upload" the data. By doing this in two steps, we # can use a database trick to make the upload more efficient. self._getOb(id).manage_upload(file) if content_type: self._getOb(id).content_type=content_type if REQUEST is not None: try: url=self.DestinationURL() except: url=REQUEST['URL1'] REQUEST.RESPONSE.redirect('%s/manage_main' % url) return id | 5cccb2a2b43b994691261e44e9d663e082e10070 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5cccb2a2b43b994691261e44e9d663e082e10070/Image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
2040,
12,
2890,
16,
612,
16,
585,
16,
2077,
2218,
2187,
24148,
2218,
2187,
913,
67,
723,
2218,
2187,
12492,
33,
7036,
4672,
3536,
1436,
279,
394,
3421,
733,
18,
225,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
2040,
12,
2890,
16,
612,
16,
585,
16,
2077,
2218,
2187,
24148,
2218,
2187,
913,
67,
723,
2218,
2187,
12492,
33,
7036,
4672,
3536,
1436,
279,
394,
3421,
733,
18,
225,
1... |
print star + "Listing supported packages installed" print "Package\t\tIcon file\t\tMenu category" | def main(): """ This program is used to generate the menu in enlightenment for the pentoo livecd Future version _might_ support other VM like gnome or others but kde :-) """ if options.listsupported: listdb() return 0 if options.simulate: print star + bold("Starting simulation") pkginstalled = [] pkginstalled = listpackages(PORTDIR) notthere = [] if not options.simulate: try: copy_menu_struct() except: return -1 for y in range(db.__len__()): if pkginstalled.__contains__(db[y][0]): if options.listonly: print star + "Listing supported packages installed" print "Package\t\tIcon file\t\tMenu category" print db[y][0] + "\t" + db[y][1] + "\t\t" + db[y][2] + "\t" else: # calls makemenuentry file.eap, menu category for single_entry in db[y][1].split(" "): try: make_menu_entry(single_entry,db[y][2]) except: print >> sys.stderr, "Can't find " + single_entry + " in " + EAPDIR return -1 else: notthere.append(db[y][0]) clean_menu() settermenv() if options.verbose: # Final move, show the unfound icons in the db print warn + red("Missing applications :") print star + green("The following applications are available but not installed") for i in range(notthere.__len__()): print arrow + notthere[i] | 50ea1417b5c2733c223e237ce02de92305036820 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7161/50ea1417b5c2733c223e237ce02de92305036820/genmenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
1220,
5402,
353,
1399,
358,
2103,
326,
3824,
316,
570,
5099,
275,
475,
364,
326,
293,
319,
5161,
328,
427,
557,
72,
9108,
1177,
389,
81,
750,
67,
2865,
1308,
8251,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
1220,
5402,
353,
1399,
358,
2103,
326,
3824,
316,
570,
5099,
275,
475,
364,
326,
293,
319,
5161,
328,
427,
557,
72,
9108,
1177,
389,
81,
750,
67,
2865,
1308,
8251,
3... | |
(x(t),y(t)) such that y(t)^2 = f(x(t)) and t | (x(t),y(t)) such that y(t)^2 = f(x(t)), where t | def local_coord(self, P, prec = 20, name = 't'): """ If P is not infinity, calls the appropriate local_coordinates function. | b4e1545eaa37e1811f989723319008a1806539dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b4e1545eaa37e1811f989723319008a1806539dc/hyperelliptic_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
5732,
12,
2890,
16,
453,
16,
13382,
273,
4200,
16,
508,
273,
296,
88,
11,
4672,
3536,
971,
453,
353,
486,
27272,
16,
4097,
326,
5505,
1191,
67,
16941,
8227,
445,
18,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1191,
67,
5732,
12,
2890,
16,
453,
16,
13382,
273,
4200,
16,
508,
273,
296,
88,
11,
4672,
3536,
971,
453,
353,
486,
27272,
16,
4097,
326,
5505,
1191,
67,
16941,
8227,
445,
18,
2,
-10... |
def __getattr__ (self, attr): return getattr (self.socket, attr) | def __getattr__(self, attr): return getattr(self.socket, attr) | def __getattr__ (self, attr): return getattr (self.socket, attr) | 52c4de7c23c31563e4f0316b68865e17bb8c0f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/52c4de7c23c31563e4f0316b68865e17bb8c0f33/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
261,
2890,
16,
1604,
4672,
327,
3869,
261,
2890,
18,
7814,
16,
1604,
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,
1001,
588,
1747,
972,
261,
2890,
16,
1604,
4672,
327,
3869,
261,
2890,
18,
7814,
16,
1604,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'K-cores in graph theory were introduced by Seidman in 1983 and by Bollobas in 1984 as a method of (destructively) simplifying graph topology to aid in analysis and visualization. They have been more recently defined as the following by Batagelj et al: given a graph G with vertices set V and edges set E, the k-core is computed by pruning all the vertices (with their respective edges) with degree less than k. That means that if a vertex u has degree d_u, and it has n neighbors with degree less than k, then the degree of u becomes d_u - n, and it will be also pruned if k d_u - n. This operation can be useful to filter or to study some properties of the graphs. For instance, when you compute the 2-core of graph G, you are cutting all the vertices which are in a tree part of graph. (A tree is a graph with no loops),' [1]. | K-cores in graph theory were introduced by Seidman in 1983 and by Bollobas in 1984 as a method of (destructively) simplifying graph topology to aid in analysis and visualization. They have been more recently defined as the following by Batagelj et al: given a graph `G` with vertices set `V` and edges set `E`, the `k`-core is computed by pruning all the vertices (with their respective edges) with degree less than `k`. That means that if a vertex `u` has degree `d_u`, and it has `n` neighbors with degree less than `k`, then the degree of `u` becomes `d_u - n`, and it will be also pruned if `k > d_u - n`. This operation can be useful to filter or to study some properties of the graphs. For instance, when you compute the 2-core of graph G, you are cutting all the vertices which are in a tree part of graph. (A tree is a graph with no loops). [WPkcore]_ [PSW1996]_ defines a `k`-core as the largest subgraph with minimum degree at least `k`. This implementation is based on the NetworkX implementation of the algorithm described in [BZ]_. | def cores(self, with_labels=False): """ Returns the core number for each vertex in an ordered list. 'K-cores in graph theory were introduced by Seidman in 1983 and by Bollobas in 1984 as a method of (destructively) simplifying graph topology to aid in analysis and visualization. They have been more recently defined as the following by Batagelj et al: given a graph G with vertices set V and edges set E, the k-core is computed by pruning all the vertices (with their respective edges) with degree less than k. That means that if a vertex u has degree d_u, and it has n neighbors with degree less than k, then the degree of u becomes d_u - n, and it will be also pruned if k d_u - n. This operation can be useful to filter or to study some properties of the graphs. For instance, when you compute the 2-core of graph G, you are cutting all the vertices which are in a tree part of graph. (A tree is a graph with no loops),' [1]. INPUT: - ``with_labels`` - default False returns list as described above. True returns dict keyed by vertex labels. REFERENCE: | db10d8e792525f4a9dfaadba9e49063c73bf5b3d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/db10d8e792525f4a9dfaadba9e49063c73bf5b3d/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15355,
12,
2890,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
2922,
1300,
364,
1517,
5253,
316,
392,
5901,
666,
18,
225,
1475,
17,
12906,
316,
2667,
326,
630,
4591,
26339,
635,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15355,
12,
2890,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
2922,
1300,
364,
1517,
5253,
316,
392,
5901,
666,
18,
225,
1475,
17,
12906,
316,
2667,
326,
630,
4591,
26339,
635,
... |
def test_floppy_organics_C6H14a(self): StructureTest(dir="floppy_organics", test="C6H14a") | def test_floppy_organics_C6H14a(self): StructureTest(dir="floppy_organics", test="C6H14a") | 1b04cff6e27f660e98e628b425c09e2c157b0350 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/1b04cff6e27f660e98e628b425c09e2c157b0350/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
74,
16884,
2074,
67,
22543,
2102,
67,
39,
26,
44,
3461,
69,
12,
2890,
4672,
13348,
4709,
12,
1214,
1546,
74,
16884,
2074,
67,
22543,
2102,
3113,
1842,
1546,
39,
26,
44,
3461,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
74,
16884,
2074,
67,
22543,
2102,
67,
39,
26,
44,
3461,
69,
12,
2890,
4672,
13348,
4709,
12,
1214,
1546,
74,
16884,
2074,
67,
22543,
2102,
3113,
1842,
1546,
39,
26,
44,
3461,... | |
activePlugins = self.Context.Plugins['core'].Display['active_plugins'].Value | activePlugins = self.Context.Plugins['core'].Screen['active_plugins'].Value | def UpdateDisabledPluginsList(self): activePlugins = self.Context.Plugins['core'].Display['active_plugins'].Value | b34fd8218099ae90a4f058bc3f0e701df5d7c343 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7183/b34fd8218099ae90a4f058bc3f0e701df5d7c343/Pages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
8853,
9461,
682,
12,
2890,
4672,
2695,
9461,
273,
365,
18,
1042,
18,
9461,
3292,
3644,
29489,
4236,
3292,
3535,
67,
8057,
29489,
620,
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,
0,
0,
0,
0,
0,
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,
2315,
8853,
9461,
682,
12,
2890,
4672,
2695,
9461,
273,
365,
18,
1042,
18,
9461,
3292,
3644,
29489,
4236,
3292,
3535,
67,
8057,
29489,
620,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.assertEqual(os.path.realpath(os.path.join(base, 'site4')), | self.assertEqual(os.path.join(base, 'site4'), | def test_inherit_multiple(self): base = os.path.dirname(self.filename) relsite1 = os.path.join('sub1', 'trac-site1.ini') site1 = os.path.join(base, relsite1) relsite2 = os.path.join('sub2', 'trac-site2.ini') site2 = os.path.join(base, relsite2) os.mkdir(os.path.dirname(site1)) create_file(site1, '[a]\noption1 = x\n' '[c]\noption = 1\npath1 = site1\n') try: os.mkdir(os.path.dirname(site2)) create_file(site2, '[b]\noption2 = y\n' '[c]\noption = 2\npath2 = site2\n') try: self._write(['[inherit]', 'file = %s, %s' % (relsite1, relsite2)]) config = self._read() self.assertEqual('x', config.get('a', 'option1')) self.assertEqual('y', config.get('b', 'option2')) self.assertEqual('1', config.get('c', 'option')) self.assertEqual(os.path.realpath(os.path.join(base, 'site1')), config.getpath('c', 'path1')) self.assertEqual(os.path.realpath(os.path.join(base, 'site2')), config.getpath('c', 'path2')) self.assertEqual('', config.getpath('c', 'path3')) self.assertEqual(os.path.realpath(os.path.join(base, 'site4')), config.getpath('c', 'path4', 'site4')) finally: os.remove(site2) os.rmdir(os.path.dirname(site2)) finally: os.remove(site1) os.rmdir(os.path.dirname(site1)) | 6c101510b9f590ed577fd60e4f78a52e24b77bd8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/6c101510b9f590ed577fd60e4f78a52e24b77bd8/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6018,
67,
9622,
12,
2890,
4672,
1026,
273,
1140,
18,
803,
18,
12287,
12,
2890,
18,
3459,
13,
1279,
4256,
21,
273,
1140,
18,
803,
18,
5701,
2668,
1717,
21,
2187,
296,
313,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6018,
67,
9622,
12,
2890,
4672,
1026,
273,
1140,
18,
803,
18,
12287,
12,
2890,
18,
3459,
13,
1279,
4256,
21,
273,
1140,
18,
803,
18,
5701,
2668,
1717,
21,
2187,
296,
313,
1... |
self["ButtonYellow_Check"].setPixmapNum(0) self["ButtonGreen_Check"].setPixmapNum(1) | self["key_yellow"].setText("") self["key_green"].setText("") | def KeyGreenRestart(self): self.nextstep = 0 self.layoutFinished() self["Adapter"].setText(("")) self["Network"].setText(("")) self["Dhcp"].setText(("")) self["IP"].setText(("")) self["DNS"].setText(("")) self["AdapterInfo_Text"].setForegroundColorNum(0) self["NetworkInfo_Text"].setForegroundColorNum(0) self["DhcpInfo_Text"].setForegroundColorNum(0) self["IPInfo_Text"].setForegroundColorNum(0) self["DNSInfo_Text"].setForegroundColorNum(0) self["shortcutsgreen_restart"].setEnabled(False) self["shortcutsgreen"].setEnabled(False) self["shortcutsyellow"].setEnabled(True) self["updown_actions"].setEnabled(False) self["ButtonYellow_Check"].setPixmapNum(0) self["ButtonGreen_Check"].setPixmapNum(1) self.steptimer = True self.nextStepTimer.start(1000) | 18dcac668d46858377cc8c1ac55fc72fa62ecc0e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/18dcac668d46858377cc8c1ac55fc72fa62ecc0e/NetworkSetup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1929,
21453,
15057,
12,
2890,
4672,
365,
18,
4285,
4119,
273,
374,
365,
18,
6741,
10577,
1435,
365,
9614,
4216,
6,
8009,
542,
1528,
12,
2932,
6,
3719,
365,
9614,
3906,
6,
8009,
542,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1929,
21453,
15057,
12,
2890,
4672,
365,
18,
4285,
4119,
273,
374,
365,
18,
6741,
10577,
1435,
365,
9614,
4216,
6,
8009,
542,
1528,
12,
2932,
6,
3719,
365,
9614,
3906,
6,
8009,
542,
15... |
u"""this does not function perfectly with percent=1 aka also doing percent encoding. trailing ; get converted to %3B. perhaps they should be? but not likely. can specify your own percent quote dict (key, value) pairs are of (search, replace) ordering with percentQuoteDict. | u"""this does not function perfectly with percent=1 aka also doing percent encoding. trailing ; get converted to %3B. perhaps they should be? but not likely. can specify your own percent quote dict (key, value) pairs are of (search, replace) ordering with percentQuoteDict. | def xmlEscape( sStr, percent=1, pd=percentQuoteDict ): u"""this does not function perfectly with percent=1 aka also doing percent encoding. trailing ; get converted to %3B. perhaps they should be? but not likely. can specify your own percent quote dict (key, value) pairs are of (search, replace) ordering with percentQuoteDict. """ for i,j in (("&","&"),(">",">"),("<","<")): sStr=sStr.replace(i,j) if percent: # sStr = unicodeC(percentQuote(sStr, pd=pd)) for search in pd: sStr = sStr.replace(search, pd[search]) return sStr | 633e00b171a777d923e4aead2f2717108d53a3b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/633e00b171a777d923e4aead2f2717108d53a3b9/rssdler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2025,
8448,
12,
272,
1585,
16,
5551,
33,
21,
16,
4863,
33,
8849,
10257,
5014,
262,
30,
582,
8395,
2211,
1552,
486,
445,
24746,
715,
598,
5551,
33,
21,
28105,
2546,
9957,
5551,
2688,
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,
2025,
8448,
12,
272,
1585,
16,
5551,
33,
21,
16,
4863,
33,
8849,
10257,
5014,
262,
30,
582,
8395,
2211,
1552,
486,
445,
24746,
715,
598,
5551,
33,
21,
28105,
2546,
9957,
5551,
2688,
18... |
dep = package_relation_list() | dep = PackageRelation() | def process_relation(self, key, e, in_e, vars): in_dep = in_e[key] dep = package_relation_list() for in_groups in in_dep: groups = package_relation_group() for in_item in in_groups: item = package_relation() item.name = self.substitute(in_item.name, vars) if in_item.version is not None: item.version = self.substitute(in_item.version, vars) item.arches = in_item.arches groups.append(item) dep.append(groups) e[key] = dep | 136c33d961d0ff02562a22ebb9d444eca0f3f543 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5794/136c33d961d0ff02562a22ebb9d444eca0f3f543/gencontrol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
5488,
12,
2890,
16,
498,
16,
425,
16,
316,
67,
73,
16,
4153,
4672,
316,
67,
15037,
273,
316,
67,
73,
63,
856,
65,
5993,
273,
7508,
3963,
1435,
364,
316,
67,
4650,
316,
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,
1207,
67,
5488,
12,
2890,
16,
498,
16,
425,
16,
316,
67,
73,
16,
4153,
4672,
316,
67,
15037,
273,
316,
67,
73,
63,
856,
65,
5993,
273,
7508,
3963,
1435,
364,
316,
67,
4650,
316,
31... |
""" Return the line number of s[index]. Lines are assumed to be separated by the ASCII character '\\n'. | r""" Return the line number of s[index] or zero on errors. Lines are assumed to be separated by the ASCII character '\n'. | def get_line_number (s, index): """ Return the line number of s[index]. Lines are assumed to be separated by the ASCII character '\\n'. """ i = 0 if index < 0: index = 0 line = 1 while i < index: if s[i] == '\n': line += 1 i += 1 return line | 6a7182b694d0cd19ace64929bd8408e6fb5ec8b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/6a7182b694d0cd19ace64929bd8408e6fb5ec8b3/strformat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1369,
67,
2696,
261,
87,
16,
770,
4672,
436,
8395,
2000,
326,
980,
1300,
434,
272,
63,
1615,
65,
578,
3634,
603,
1334,
18,
29682,
854,
12034,
358,
506,
8936,
635,
326,
11768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1369,
67,
2696,
261,
87,
16,
770,
4672,
436,
8395,
2000,
326,
980,
1300,
434,
272,
63,
1615,
65,
578,
3634,
603,
1334,
18,
29682,
854,
12034,
358,
506,
8936,
635,
326,
11768,
... |
if chal.has_key('realm'): | if chal.has_key('realm'): | def SASLHandler(self,conn,challenge): if challenge.getNamespace()<>NS_SASL: return if challenge.getName()=='failure': self.startsasl='failure' try: reason=challenge.getChildren()[0] except: reason=challenge self._owner.DEBUG(DBG_SASL,'Failed SASL authentification: %s'%reason,'error') return elif challenge.getName()=='success': self.startsasl='success' self._owner.DEBUG(DBG_SASL,'Successfully authenticated with remote server.','ok') self._owner.Dispatcher.PlugOut() dispatcher.Dispatcher().PlugIn(self._owner) self._owner.send_header() self._owner.User=self.username return | ed9bbc187c416413336b1cec5d7c6ab176ee8864 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/ed9bbc187c416413336b1cec5d7c6ab176ee8864/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24380,
48,
1503,
12,
2890,
16,
4646,
16,
25092,
4672,
309,
12948,
18,
588,
3402,
1435,
29667,
3156,
67,
55,
3033,
48,
30,
327,
309,
12948,
18,
17994,
1435,
18920,
12251,
4278,
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,
24380,
48,
1503,
12,
2890,
16,
4646,
16,
25092,
4672,
309,
12948,
18,
588,
3402,
1435,
29667,
3156,
67,
55,
3033,
48,
30,
327,
309,
12948,
18,
17994,
1435,
18920,
12251,
4278,
365,
18,
... |
elif f[-8:] == "-install": | elif f[-8:] == "_install": | def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts." | fe355e3419b1de3e7c340e9bd73c29f27f0a21b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/fe355e3419b1de3e7c340e9bd73c29f27f0a21b1/buildpkg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
3805,
12,
2890,
4672,
315,
986,
678,
16312,
19,
1994,
4667,
19,
13211,
1390,
16,
263,
80,
17995,
9907,
471,
8873,
1199,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
1289,
3805,
12,
2890,
4672,
315,
986,
678,
16312,
19,
1994,
4667,
19,
13211,
1390,
16,
263,
80,
17995,
9907,
471,
8873,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
regVOs = GetListOfAllRegisteredVO(when,datetime.date.today()) | regVOs = GetListOfRegisteredVO('Active',when,datetime.date.today()) | def NonReportingSites( when = datetime.date.today(), output = "text", header = True): print "This report indicates which sites Gratia has heard from or have known activity\nsince %s (midnight UTC)\n" % ( DateToString(when,False) ) allSites = GetListOfOSGSites(); regVOs = GetListOfAllRegisteredVO(when,datetime.date.today()) exceptionSites = ['AGLT2_CE_2','BNL-LCG2', 'BNL_LOCAL', 'BNL_OSG', 'BNL_PANDA', 'GLOW-CMS', 'UCSDT2-B', 'Purdue-Lear' ] allSites = [name for name in allSites if name not in exceptionSites] reportingVOs = GetLastReportingVOs(when) reportingSitesDate = GetSiteLastReportingDate(when,True) stoppedSitesDate = GetSiteLastReportingDate(when,False) activitySitesDate = GetSiteLastActivity(when); reportingSites = [] stoppedSites = [] dates = {} for data in reportingSitesDate: (name,lastreport) = data.split("\t") reportingSites.append(name) dates[name] = lastreport for data in stoppedSitesDate: (name,lastreport) = data.split("\t") dates[name] = lastreport stoppedSites.append(name); stoppedSites = [name for name in stoppedSites if name in allSites] missingSites = [name for name in allSites if name not in reportingSites and name not in stoppedSites] extraSites = [name for name in reportingSites if name not in allSites] knownExtras = [name for name in extraSites if name in exceptionSites] extraSites = [name for name in extraSites if name not in exceptionSites] #print allSites #print reportingSites #print missingSites #print extraSites print "As of "+DateToString(datetime.date.today(),False) +", there are "+prettyInt(len(allSites))+" registered OSG sites" n = len(reportingSites) ne = len(knownExtras); print prettyInt(n)+" sites reported (including "+prettyInt(ne)+" sanctioned non registered sites)\n" n = len(reportingSites)-len(extraSites)-len(knownExtras) print prettyInt(n)+" registered sites reported ("+niceNum(n*100/len(allSites),1)+"% of OSG Sites)" n = len(stoppedSites) print prettyInt(n)+" registered sites have stopped reporting ("+niceNum(n*100/len(allSites),1)+"% of OSG Sites)" n = len(missingSites); print prettyInt(n)+" registered sites have never reported ("+niceNum(n*100/len(allSites),1)+"% of OSG Sites)" print n = len(extraSites); print prettyInt(n)+" non-sanctioned non-registered sites reported (might indicate a discrepancy between OIM and Gratia)" n = len(knownExtras); print prettyInt(n)+" sanctioned non-registered sites reported" #print "\nThe reporting sites are:\n"+prettyList(reportingSites) #print "\nThe registered sites are:\n"+prettyList(allSites) print "\nThe sanctioned non registered sites are: \n"+prettyList(knownExtras) print "\nThe non registered sites are: \n"+prettyList(extraSites) expectedNoActivity = ['sdss'] emptyVO = [name for name in regVOs if name not in reportingVOs and name not in expectedNoActivity] nonregVO = [name for name in reportingVOs if name not in regVOs] print "\nThe registered VOs with no recent activity are:\n"+prettyList(emptyVO) print "\nThe following VOs are expected to have no activity:\n"+prettyList([name for name in expectedNoActivity if name not in reportingVOs]) print "\nThe non-registered VOs with recent activity are:\n"+prettyList(nonregVO) print "\nThe non reporting sites are: " # \n"+prettyList(missingSites) for name in missingSites: if len(name)>15: delim = "\t" else: delim = "\t\t" if not dates.has_key(name): print name+" :"+delim+"never reported or inactive" for data in stoppedSitesDate: (name,lastreport) = data.split("\t") if name in allSites: if len(name)>15: delim = "\t" else: delim = "\t\t" print name+":"+delim+lastreport print "\nThe sites with no (known) recent activity:" for data in activitySitesDate: (name,lastreport) = data.split("\t") if name in allSites: if len(name)>=14: delim = "\t" if len(name)>=7: delim = "\t\t" else: delim = "\t\t\t" print name+":"+delim+lastreport return missingSites | 33a4ca44cb79fb58546a509056a7bff882a73c25 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/33a4ca44cb79fb58546a509056a7bff882a73c25/AccountingReports.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3858,
29285,
17055,
12,
1347,
273,
3314,
18,
712,
18,
30064,
9334,
876,
273,
315,
955,
3113,
1446,
273,
1053,
4672,
225,
1172,
315,
2503,
2605,
8527,
1492,
9180,
611,
17048,
1155,
711,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3858,
29285,
17055,
12,
1347,
273,
3314,
18,
712,
18,
30064,
9334,
876,
273,
315,
955,
3113,
1446,
273,
1053,
4672,
225,
1172,
315,
2503,
2605,
8527,
1492,
9180,
611,
17048,
1155,
711,
3... |
def if_platform_tagged(platform, tag, closure, c2=None): | def if_platform_tagged(platform, tag, snippet_if, snippet_else=None): | def if_platform_tagged(platform, tag, closure, c2=None): r = "" r += "[+ IF " + tag + " defined +]" r += "[+ FOR " + tag + " +][+ CASE " + tag + " +]" for group in RMAP[platform]: r += "[+ = \"" + group + "\" +]" + closure() r += "[+ ESAC +][+ ENDFOR +]" if c2 == None: r += "[+ ENDIF +]" return r r += "[+ ELSE +]" + c2() + "[+ ENDIF +]" return r | c8d22d34fb910911782f3cb62d58a3495edc8286 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9475/c8d22d34fb910911782f3cb62d58a3495edc8286/gentpl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1652,
309,
67,
9898,
67,
23023,
12,
9898,
16,
1047,
16,
13016,
67,
430,
16,
13016,
67,
12107,
33,
7036,
4672,
436,
273,
1408,
436,
1011,
5158,
15,
11083,
315,
397,
1047,
397,
315,
2553,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1652,
309,
67,
9898,
67,
23023,
12,
9898,
16,
1047,
16,
13016,
67,
430,
16,
13016,
67,
12107,
33,
7036,
4672,
436,
273,
1408,
436,
1011,
5158,
15,
11083,
315,
397,
1047,
397,
315,
2553,... |
functions.sort() | funclist = functions.items() funclist.sort() | def printIFaceTableCXXFile(f,out): constants = [] functions = [] for name in f.order: features = f.features[name] if features["Category"] != "Deprecated": if features["FeatureType"] == "val": if not (Contains(name, "SCE_") or Contains(name, "SCLEX_")): constants.append( (name, features["Value"]) ) elif features["FeatureType"] in ["fun","get","set"]: functions.append((name, features)) out.write("\nstatic IFaceConstant ifaceConstants[] = {") if constants: constants.sort() first = 1 for name, value in constants: if first: first = 0 else: out.write(",") out.write('\n\t{"%s",%s}' % (name, value)) out.write("\n};\n") else: out.write('{"",0}};\n') # Write an array of function descriptions. This can be # used as a sort of compiled typelib. out.write("\nstatic IFaceFunction ifaceFunctions[] = {") if functions: functions.sort() first = 1 for name, features in functions: if first: first = 0 else: out.write(",") paramTypes = [ features["Param1Type"] or "void", features["Param2Type"] or "void" ] # Fix-up: if a param is an int named length, change to iface_type_length. if features["Param1Type"] == "int" and features["Param1Name"] == "length": paramTypes[0] = "length" if features["Param2Type"] == "int" and features["Param2Name"] == "length": paramTypes[1] = "length" out.write('\n\t{"%s", %s, iface_%s, {iface_%s, iface_%s}}' % ( name, features["Value"], features["ReturnType"] or "void", paramTypes[0], paramTypes[1] )) out.write("\n};\n") else: out.write('{""}};\n') out.write("\nenum {\n") out.write("\tifaceFunctionCount = %d,\n" % len(functions)) out.write("\tifaceConstantCount = %d\n" % len(constants)) out.write("};\n\n") | 114db92c80378b4eaad3f91ec47fb94c1731131a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5233/114db92c80378b4eaad3f91ec47fb94c1731131a/IFaceTableGen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
5501,
623,
1388,
39,
5619,
812,
12,
74,
16,
659,
4672,
6810,
273,
5378,
4186,
273,
5378,
225,
364,
508,
316,
284,
18,
1019,
30,
4467,
273,
284,
18,
7139,
63,
529,
65,
309,
4467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
5501,
623,
1388,
39,
5619,
812,
12,
74,
16,
659,
4672,
6810,
273,
5378,
4186,
273,
5378,
225,
364,
508,
316,
284,
18,
1019,
30,
4467,
273,
284,
18,
7139,
63,
529,
65,
309,
4467... |
self.reference.suffixed_name( name, function.name ) or | self.reference.suffixed_name( name, function.name ) or | def find_python_functions( self ): """Find our functions, aliases and the like in python module""" # TODO this is a very inefficient scan... source = self.get_module() for name,function in sorted(self.functions.items()): if hasattr( source, function.name ): function.python[name] = PyFunction( root_function = function, py_function = getattr( source,name ), alias = name, ) for name in sorted(dir(source)): if ( self.reference.suffixed_name( name, function.name ) or self.reference.suffixed_name( function.name, name ) ): if not self.has_function( name ): function.python[name] = PyFunction( root_function = function, py_function = getattr( source,name ), alias = name, ) self.py_functions[name] = function if not self.reference.functions.has_key( name ): self.reference.functions[ name ] = function | 5e441a6d3c8bf4a1d1361e5553c2257c04555ada /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1545/5e441a6d3c8bf4a1d1361e5553c2257c04555ada/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
8103,
67,
10722,
12,
365,
262,
30,
3536,
3125,
3134,
4186,
16,
6900,
471,
326,
3007,
316,
5790,
1605,
8395,
468,
2660,
333,
353,
279,
8572,
316,
25403,
4135,
2777,
1084,
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,
1104,
67,
8103,
67,
10722,
12,
365,
262,
30,
3536,
3125,
3134,
4186,
16,
6900,
471,
326,
3007,
316,
5790,
1605,
8395,
468,
2660,
333,
353,
279,
8572,
316,
25403,
4135,
2777,
1084,
273,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.