rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
qbk_file = xml_file.replace('.xml', '.qbk') | qbk_file = os.path.normpath(xml_file.replace('.xml', '.qbk')).replace('\\', '/') | def hash_qbk_file(self, xml_file): qbk_file = xml_file.replace('.xml', '.qbk') if(not os.path.isfile(qbk_file)): return (None, None) with open(qbk_file) as file: return (qbk_file, hashlib.sha256(file.read()).hexdigest()) | 1d0b2ce8a6ceb58e04a3ac3217343dbc78589136 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9849/1d0b2ce8a6ceb58e04a3ac3217343dbc78589136/bbook2rss.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1651,
67,
85,
24600,
67,
768,
12,
2890,
16,
2025,
67,
768,
4672,
7311,
79,
67,
768,
273,
1140,
18,
803,
18,
7959,
803,
12,
2902,
67,
768,
18,
2079,
2668,
18,
2902,
2187,
2418,
85,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1651,
67,
85,
24600,
67,
768,
12,
2890,
16,
2025,
67,
768,
4672,
7311,
79,
67,
768,
273,
1140,
18,
803,
18,
7959,
803,
12,
2902,
67,
768,
18,
2079,
2668,
18,
2902,
2187,
2418,
85,
... |
set_class('cell_display_' + id, 'cell_input') // %hide -- deal | set_class('cell_display_' + id, 'cell_input') // TODO: %hide -- deal with later | def javascript(): s = async_lib() s+= r""" | 942e9667bd499218d2d7d5fc4182b996f2ae71ba /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/942e9667bd499218d2d7d5fc4182b996f2ae71ba/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assert len(foreign_keys) == 2, '''association %(assoc_klas)s between more than 2 items cannot be DBCOOK_hidden (which one to give as other side)''' % locals() | assert len(foreign_keys) == 2, ERR_CANNOT_HIDE_ASSOC % locals() | def make( me, builder, klas, name ): 'return relation_klas, actual_relation_klas, relation_kargs' dbg = 'relation' in config.debug me.resolve( builder) assoc_klas = me.assoc_klas if dbg: print ' ' , me, klas, '.', name assert name, 'relation/association %(assoc_klas)r relates to %(klas)r but no attrname specified anywhere' % locals() | 3ec74980902c233e698220ca2698cdd77907f199 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10808/3ec74980902c233e698220ca2698cdd77907f199/relation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
12,
1791,
16,
2089,
16,
417,
9521,
16,
508,
262,
30,
296,
2463,
2533,
67,
79,
9521,
16,
3214,
67,
5488,
67,
79,
9521,
16,
2533,
67,
79,
1968,
11,
28966,
273,
296,
5488,
11,
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,
1221,
12,
1791,
16,
2089,
16,
417,
9521,
16,
508,
262,
30,
296,
2463,
2533,
67,
79,
9521,
16,
3214,
67,
5488,
67,
79,
9521,
16,
2533,
67,
79,
1968,
11,
28966,
273,
296,
5488,
11,
3... |
if len(cdirs) > 0: printError(pkg, 'shlib-policy-nonversioned-dirs', cdirs) | map(lambda dir: printError(pkg, 'shlib-policy-nonversioned-dir', dir), cdirs); | def check(self, pkg): | aa66182be6bd1109e0abad33a00a454ef740fce3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10341/aa66182be6bd1109e0abad33a00a454ef740fce3/LibraryPolicyCheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
3475,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
3475,
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... |
config_backup = path.join(config_folder, 'fusion-icon.backup.' + str(int(time()))) | config_backup = path.join(config_folder, 'fusion-icon.backup.' + str(int(time.time()))) | def reset(): #cut-and-pasted from libfusionicon to avoid a full load for --reset config_folder = environ.get('XDG_CONFIG_HOME', path.join(environ.get('HOME'), '.config')) config_file = path.join(config_folder, 'fusion-icon') print '* Configuration file (' + config_file + ') being reset' try: if path.exists(config_file): config_backup = path.join(config_folder, 'fusion-icon.backup.' + str(int(time()))) rename(config_file, config_backup) print '... backed up to:', config_backup print '* Configuration reset' sys.exit(0) except: print '* Error: configuration reset failed' | b25c7e3b0d43fb07ff8a06f4728582c383a74b82 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/909/b25c7e3b0d43fb07ff8a06f4728582c383a74b82/fusion-icon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
13332,
468,
5150,
17,
464,
17,
84,
689,
329,
628,
2561,
74,
7063,
3950,
358,
4543,
279,
1983,
1262,
364,
1493,
6208,
642,
67,
5609,
273,
5473,
18,
588,
2668,
22953,
43,
67,
7203,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
13332,
468,
5150,
17,
464,
17,
84,
689,
329,
628,
2561,
74,
7063,
3950,
358,
4543,
279,
1983,
1262,
364,
1493,
6208,
642,
67,
5609,
273,
5473,
18,
588,
2668,
22953,
43,
67,
7203,... |
Form.form({key: value}) | Form.form(self, {key: value}) | def __setitem__(self, key, value): Form.form({key: value}) | 648433547532ba92666e9ff79202cc76954e1c68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/648433547532ba92666e9ff79202cc76954e1c68/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
498,
16,
460,
4672,
2748,
18,
687,
12590,
856,
30,
460,
6792,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
498,
16,
460,
4672,
2748,
18,
687,
12590,
856,
30,
460,
6792,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
label = self._make_label(type, selected_tabs) | label = self._make_label(tab_type, selected_tabs) | def __init__(self, type, selected_tabs): Display.__init__(self) self.type = type self.child_count = self.folder_count = self.folder_child_count = 0 if type == 'feed': tab_list = app.tab_list_manager.feed_list else: tab_list = app.tab_list_manager.playlist_list for tab in selected_tabs: if tab.is_folder: self.folder_count += 1 self.folder_child_count += tab_list.get_child_count(tab.id) else: self.child_count += 1 vbox = widgetset.VBox(spacing=20) label = self._make_label(type, selected_tabs) label.set_size(2) label.set_color((0.3, 0.3, 0.3)) vbox.pack_start(widgetutil.align_center(label)) vbox.pack_start(widgetutil.align_center( self._make_buttons())) self.widget = widgetutil.align_middle(vbox) | 8b9a3f4dfba5989d296d22657facbc6d61718af5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/8b9a3f4dfba5989d296d22657facbc6d61718af5/displays.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
16,
3170,
67,
16056,
4672,
9311,
16186,
2738,
972,
12,
2890,
13,
365,
18,
723,
273,
618,
365,
18,
3624,
67,
1883,
273,
365,
18,
5609,
67,
1883,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
16,
3170,
67,
16056,
4672,
9311,
16186,
2738,
972,
12,
2890,
13,
365,
18,
723,
273,
618,
365,
18,
3624,
67,
1883,
273,
365,
18,
5609,
67,
1883,
27... |
self.ar_thread.cond.acquire() self.ar_thread.cond.notify() self.ar_thread.cond.release() | if self.ar_thread != None: self.ar_thread.cond.acquire() self.ar_thread.cond.notify() self.ar_thread.cond.release() | def close_app(self, widget, data=None): self.status = -1 # set status flag to -1 self.ar_thread.cond.acquire() self.ar_thread.cond.notify() # notify ar_thread to quit self.ar_thread.cond.release() gtk.main_quit() return False | 7ca5bf4d6c44ec5b6107c020fd97a675b97f5d31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4851/7ca5bf4d6c44ec5b6107c020fd97a675b97f5d31/casnet-gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
2910,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
365,
18,
2327,
273,
300,
21,
9079,
468,
444,
1267,
2982,
358,
300,
21,
365,
18,
297,
67,
5930,
18,
10013,
18,
1077,
1039,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
2910,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
365,
18,
2327,
273,
300,
21,
9079,
468,
444,
1267,
2982,
358,
300,
21,
365,
18,
297,
67,
5930,
18,
10013,
18,
1077,
1039,... |
(?: (?: (?://?)? | ( ( (//?)? | def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages. | 039645ec5706bfe06b64e66663e62db9bc1abf30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/039645ec5706bfe06b64e66663e62db9bc1abf30/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
-100,
-100,
-100,
-100,
-100,... |
try: from subprocess import check_call except ImportError: import subprocess def check_call(*popenargs, **kwargs): retcode = subprocess.call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] raise Exception("Command '%s' returned non-zero exit status %i" % (cmd, retcode)) | def get_DEFAULT_tag(index): if index in DEFAULTS: return DEFAULTS[index] else: return DEFAULTS['REV'] | ad812a58237e82f8d39e5502f59f50cc3b3f3cb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11044/ad812a58237e82f8d39e5502f59f50cc3b3f3cb9/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5280,
67,
2692,
12,
1615,
4672,
309,
770,
316,
3331,
55,
30,
327,
3331,
55,
63,
1615,
65,
469,
30,
327,
3331,
55,
3292,
862,
58,
3546,
225,
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,
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,
336,
67,
5280,
67,
2692,
12,
1615,
4672,
309,
770,
316,
3331,
55,
30,
327,
3331,
55,
63,
1615,
65,
469,
30,
327,
3331,
55,
3292,
862,
58,
3546,
225,
2,
-100,
-100,
-100,
-100,
-100,
... | |
adjust+= 1 return op1, op2, adjust if len(op1.int) > len(op2.int) + 1: diff = len(op1.int) - len(op2.int) - 1 op2.int.extend([0]*diff) op2.exp -= diff adjust -= diff if len(op1.int) == len(op2.int)+1 and op1.int > op2.int: op2.int.append(0) | adjust += 1 while op1.int >= (10 * op2.int): op2.int *= 10 | def _adjust_coefficients(op1, op2): """Adjust op1, op2 so that op2.int+[0] > op1.int >= op2.int. Returns the adjusted op1, op2 as well as the change in op1.exp-op2.exp. Used on _WorkRep instances during division. """ adjust = 0 #If op1 is smaller, get it to same size if len(op2.int) > len(op1.int): diff = len(op2.int) - len(op1.int) op1.int.extend([0]*diff) op1.exp -= diff adjust = diff #Same length, wrong order if len(op1.int) == len(op2.int) and op1.int < op2.int: op1.int.append(0) op1.exp -= 1 adjust+= 1 return op1, op2, adjust if len(op1.int) > len(op2.int) + 1: diff = len(op1.int) - len(op2.int) - 1 op2.int.extend([0]*diff) op2.exp -= diff adjust -= diff if len(op1.int) == len(op2.int)+1 and op1.int > op2.int: op2.int.append(0) op2.exp -= 1 adjust -= 1 return op1, op2, adjust | 636a6b100fe6083388bc5315758326078abe65b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/636a6b100fe6083388bc5315758326078abe65b4/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
13362,
67,
8075,
12344,
12,
556,
21,
16,
1061,
22,
4672,
3536,
10952,
1061,
21,
16,
1061,
22,
1427,
716,
1061,
22,
18,
474,
15,
63,
20,
65,
405,
1061,
21,
18,
474,
1545,
1061,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13362,
67,
8075,
12344,
12,
556,
21,
16,
1061,
22,
4672,
3536,
10952,
1061,
21,
16,
1061,
22,
1427,
716,
1061,
22,
18,
474,
15,
63,
20,
65,
405,
1061,
21,
18,
474,
1545,
1061,
... |
if self.scroller_position >= box_height-scroller_width +margin : self.scroller_position = box_height-scroller_width +margin | if self.scroller_position >= box_height-scroller_width : self.scroller_position = box_height-scroller_width scroll_position_percent=(self.scroller_position)/(box_height-scroller_width) | def do_allocate(self, box, flags): box_width = box.x2 - box.x1 box_height = box.y2 - box.y1 margin = box_width/8 scroller_width = box_width - 2*margin bar_width = box_width/4 bar_height = box_height - 2*margin - scroller_width bar_box = clutter.ActorBox() bar_box.x1 = box_width/2 -bar_width/2 bar_box.y1 = margin + scroller_width/2 bar_box.x2 = bar_box.x1 + bar_width bar_box.y2 = bar_box.y1 + bar_height self.scrollbar_background.allocate(bar_box, flags) scroller_box=clutter.ActorBox() scroller_box.x1 = margin scroller_box.x2 = scroller_box.x1 + scroller_width if self.scroller_position >= box_height-scroller_width +margin : self.scroller_position = box_height-scroller_width +margin if self.scroller_position <= scroller_width/2 : self.scroller_position = scroller_width/2 scroller_box.y1 = self.scroller_position - scroller_width/2 + margin scroller_box.y2 = scroller_box.y1 + scroller_width self.scroller.allocate(scroller_box,flags) scroll_position_percent=(self.scroller_position-scroller_width/2)/(box_height-scroller_width -margin) self.emit("scroll_position",scroll_position_percent) clutter.Actor.do_allocate(self, box, flags) | cd06c85963fa1a4bc894d0804dc749d386be269a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5279/cd06c85963fa1a4bc894d0804dc749d386be269a/scrollbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
16247,
12,
2890,
16,
3919,
16,
2943,
4672,
3919,
67,
2819,
273,
3919,
18,
92,
22,
300,
3919,
18,
92,
21,
3919,
67,
4210,
273,
3919,
18,
93,
22,
300,
3919,
18,
93,
21,
7333... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
16247,
12,
2890,
16,
3919,
16,
2943,
4672,
3919,
67,
2819,
273,
3919,
18,
92,
22,
300,
3919,
18,
92,
21,
3919,
67,
4210,
273,
3919,
18,
93,
22,
300,
3919,
18,
93,
21,
7333... |
if max-min<3.2: | if 0.<max-min<3.2: | def checkCMOR(fout,file,table,noerror=cmor.CMOR_CRITICAL,variable=None,from_bounds=None,other_tables=None,dodrs=True): req_glbl_att = ['title','Conventions','source','experiment','source','institution','project_id','table_id','realization',] opt_glbl_att = ['cmor_version','history','references','comment','parent_experiment'] nerr=0 nwarn=0 ncheck=0 IPCC_std_vars=[] IPCC_std_axes=[] tables=[table,] if other_tables is not None: for t in other_tables: if not t in tables and t is not None: tables.append(t) etables = [] for tbl in tables: manageLog(fout,VERBOSE, 'Reading table:',tbl) e=readTable(tbl) etables.append(e) Vars=e['variable'] Axes=e['axis'] extra_req = e['general'].get('required_global_attributes','').split() for ex in extra_req: if not ex in req_glbl_att: req_glbl_att.append(ex) for v in Vars.keys(): IPCC_std_vars.append(Vars[v].get('out_name',v)) for a in Axes.keys(): onm = Axes[a].get('out_name',a) if not onm in IPCC_std_axes: IPCC_std_axes.append(onm) ## if IPCC_std_axes[-1]=='lev' : ## IPCC_std_axes.pop(-1) ## IPCC_std_axes.append('eta') ## Axes[a]['out_name']='eta' ver = e['general'].get('cmor_version',2.0) ver = '%g' % float(ver) spver = ver.split('.') major = int(spver[0]) if major>1: req_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','creation_date','frequency','modeling_realm'] else: opt_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','forcing','creation_date','frequency','modeling_realm'] if isinstance(file,str): fnm=file file=cdms2.open(file) elif isinstance(file,cdms2.dataset.CdmsFile): fnm=str(file).split('file')[1].split(',')[0].strip()[1:-1] else: nerr+=manageLog(fout, noerror, 'You must pass a file name or cdms2 file object') if fnm.split("_")[-1]=="clim.nc": is_clim = True else: is_clim = False pthroot, shrt_fnm = os.path.split(fnm) if variable is None: manageLog(fout,VERBOSE, 'Checking file argument',IPCC_std_axes) manageLog(fout,VERBOSE, 'Checking path structure for path:',pthroot) manageLog(fout,VERBOSE, 'Checking file structure for file:',fnm) print >> fout, 'Checking the file starts with variable name' ok = False for v in IPCC_std_vars: n = len(v) if shrt_fnm[:n] == v and shrt_fnm[n]=='_': ok = True break if not ok: nerr+=manageLog(fout, noerror, ''+shrt_fnm+' does not start with standard %s variable name followed by _' % file.project_id) vf=v #Check the variable is actually in the file if not v in file.variables.keys(): nerr+=manageLog(fout,noerror,"Your file name says it contains variable",v,"but it is not in your file, your file contains:",file.variables.keys()) if hasattr(file,'cmor_version'): up = False rew = False ver = getattr(file,'cmor_version') if isinstance(ver,numpy.ndarray): ver = '%g' % float(ver[0]) spver = ver.split('.') fmajor = int(spver[0]) if len(spver)>1 : minor = int(spver[1]) if len(spver)>2: patch = int(spver[2]) else: patch = 0 else: minor=0 patch=0 if fmajor>cmor.CMOR_VERSION_MAJOR: up = True elif fmajor<cmor.CMOR_VERSION_MAJOR: rew=True else: # Major matches if minor>cmor.CMOR_VERSION_MINOR: up = True elif minor<cmor.CMOR_VERSION_MINOR: rew = True else: # minor matches if patch>cmor.CMOR_VERSION_PATCH: up = True elif patch<cmor.CMOR_VERSION_PATCH: rew = True ncheck+=1 if up: if fmajor==cmor.CMOR_VERSION_MAJOR: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should upgrade your cmor" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) else: nerr+=manageLog(fout,noerror,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you need to upgrade cmor to check these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ncheck+=1 if rew: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should consider rewriting these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ## 32bit systems only if os.uname()[-1].find("64")==-1: sz=os.path.getsize(fnm) manageLog(fout,VERBOSE, 'Checking file size (32bit systems only):',sz) if sz>2**31: if major>1: ncheck+=1 nwarn+=1 ec =cmor.CMOR_WARNING else: ec=noerror manageLog(fout,ec, 'File size too large',sz,' (>2Gb)!') #nerr+=manageLog(fout, noerror, 'file size too large (>2Gb)!') manageLog(fout,VERBOSE, 'Checking that file contains required global attributes') for att in req_glbl_att: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) if not hasattr(file,att) and not att in shrt_vals: i = req_glbl_att.index(att) if i==0 or req_glbl_att[i-1] not in shrt_vals: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) else: pr = req_gbl_att[i-1] expt = getattr(file,"experiment","") shrt = shrt_vals[long_vals.index(expt)] if shrt == pr: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) fval=getattr(file,att,'') if att=='experiment_id': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att=='experiment': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in long_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment file attribute must be one of : %s, you have: %s' % (str(long_vals), fval) ) elif att=='parent_experiment_id': if fval == getattr(file,"experiment_id",""): nerr+=manageLog(fout,noerror,"parent_experiment_id and experiment_id cannot be the same you have %s for both" % fval) ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) shrt_vals.append("N/A") for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'parent_experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att == 'forcing': sp = fval.split(',') forcings=e['general'].get("forcings") for vl in sp: if not vl.strip() in forcings: nerr+=manageLog(fout,noerror,"file attribute forcing must be a comma separated list with values in: %s, yours is: %s (offending value: %s)" % (forcings,fval,vl.strip())) elif att == 'frequency': if not fval in ['yr','mon','day','6hr','3hr','subhr','fx','monClim']: nerr+=manageLog(fout,noerror, 'frequency must be one of:','yr','mon','day','6hr','3hr','subhr','fx','monClim') elif att in ['realization']: if isinstance(fval,numpy.ndarray): if len(fval)>1: nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') fval=fval[0] if not isinstance(fval,(int,numpy.int,numpy.int32)): nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') elif att in ['table_id']: manageLog(fout,VERBOSE, '\ttable_id is: ', fval) elif att == "creation_date": # checks that it matches: YYYY-MM-DDTHH:MM:SSZ fmt = "%Y-%m-%dT%H:%M:%SZ" try: t =time.strptime(fval,fmt) except: nerr+=manageLog(fout, noerror, 'Creation Date must be in format: %s yours is: %s' % (fmt,fval)) elif att == "branch_time": try: myval=float(fval) except: nerr+=manageLog(fout, noerror, 'branch_time must be convertible to float, you have %s' % (fval)) if getattr(file,"parent_experiment_id","").strip()=="N/A": if float(fval)!=0.: nerr+=manageLog(fout, noerror, 'if global attribute parent_experiment_id is N/A then branch_time must be 0., you have %s' % (fval)) elif att == "project_id": if e['general'].get("project_id") != fval: nerr+=manageLog(fout, noerror, 'project_id must be %s' % (e['general'].get("project_id"))) else: val=e['general'].get(att,None) if isinstance(fval,str) : fval=fval.strip().lower() if isinstance(val,str) : val=val.strip().lower() if val is not None: if isinstance(fval,str): res=fval.find(val) if res==-1: res=False else: res=True else: res=fval==val manageLog(fout,VERBOSE, '**************',att,val,fval) if not res: nerr+=manageLog(fout, noerror, 'attribute '+att+' must be set to: -'+val+'- +'+fval+'+ '+str(res)) for att in opt_glbl_att: ncheck+=1 if not hasattr(file,att): nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tIt is often helpful to define the global attribute: ',att) for att in file.attributes.keys(): ncheck+=1 if not att in req_glbl_att and not att in opt_glbl_att: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tYou have global attribute: %s which is neither required nor optional ' % att) if major>=2: # more file structure there tbl_id = getattr(file,'table_id').split()[1] tbl_date= getattr(file,'table_id').split('(')[1].split(')')[0].strip() ttbl_id = e['general'].get("table_id").split()[1] ttbl_date = e['general'].get("table_date").strip() if tbl_date!=ttbl_date: nwarn+=1 ncheck+=1 manageLog(fout,cmor.CMOR_WARNING,"File says table date was %s, but your table is dated from: %s" %( tbl_date,ttbl_date)) if tbl_id!=ttbl_id: nerr+=manageLog(fout, noerror, 'your file indicates a table id of %s while your table id is %s' % (tbl_id,ttbl_id)) sp = shrt_fnm.split(v)[1].split("_") t = file[v].getTime() if t is not None: n=6 t=t.clone() else: n=4 if is_clim: n+=1 expt = getattr(file,"experiment","") try: shrt = shrt_vals[long_vals.index(expt)] except: #Ok we must be in one of the XXXX or DDHH cases... for i in range(len(long_vals)): if long_vals[i][:-4]==expt[:-4]: shrt=shrt_vals[i][:-4]+expt[-4:] break if long_vals[i][:-10]==expt[:-10]: shrt=shrt_vals[i][:-10]+expt[-10:] break if shrt=="": n-=1 spoffset=-1 else: spoffset=0 print len(sp) if len(sp)<n: nerr+=manageLog(fout, noerror, 'your file name does not seem to match the profile: varid_tableid_modelid_exptid_rid[iid][pid][_startdate-enddate][_suffix][_clim].nc') if sp[1]!=tbl_id: nerr+=manageLog(fout, noerror, 'your file name indicates a table id of %s while your table id should be %s' % (sp[1],tbl_id)) if sp[2]!=getattr(file,'model_id'): fmodid = hyphenize(getattr(file,'model_id')) if sp[2]!=fmodid: nerr+=manageLog(fout, noerror, 'your file name indicates model_id is: %s but your file says it is: %s' % (sp[2],getattr(file,'model_id'))) if shrt!="": if shrt!=sp[3]: nerr+=manageLog(fout, noerror, 'your file name indicates exp_id is: %s but your file says it should be: %s' % (sp[3],shrt)) real = sp[4+spoffset] rsp=real.split("p") if hasattr(file,"physics_version"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate physics_version but your file says it should be: %s' % (file.physics_version)) elif int(rsp[0].split('i')[0][1:])!=int(file.physics_version): nerr+=manageLog(fout, noerror, 'your file name indicates physics_version is: %s but your file says it should be: %s' % (rsp[1],file.physics_version)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates physics_version to be %s but your file says it has not physics: %s' % (rsp[1])) real=rsp[0] rsp=real.split("i") if hasattr(file,"initialization_method"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate initialization_method but your file says it should be: %s' % (file.initialization_method)) elif int(rsp[1])!=int(file.initialization_method): nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method is: %s but your file says it should be: %s' % (rsp[1],file.initialization_method)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method to be %s but your file says it has not initialization_method: %s' % (rsp[1])) real=rsp[0] if int(real[1:])!=int(getattr(file,'realization')): nerr+=manageLog(fout, noerror, 'your file name indicates realization is: %s but your file says it is: %i' % (sp[3][3:],int(getattr(file,'realization')))) ## skip the following if it has no time if t is not None: # here we check the clim b4 going further checking into date clim_att = getattr(t,'climatology',None) if clim_att is None: has_clim = False else: has_clim = True if is_clim!=has_clim: if is_clim: nerr+=manageLog(fout, noerror, 'your file name indicates climatology, but the time axis does not have the climatology attribute') else: nerr+=manageLog(fout, noerror, 'your file name does not indicates climatology (_clim.nc), but the time axis has the climatology attribute') if is_clim: tmp = file(t.climatology,slice(0,1)) ft0 = tmp[0][0] tmp = file(t.climatology,slice(-1,None)) ft1 = tmp[-1][1] else: ft0=t[0] ft1=t[-1] ft0= cdtime.reltime(ft0,t.units).tocomp(t.getCalendar()) ft1= cdtime.reltime(ft1,t.units).tocomp(t.getCalendar()) dates = sp[5+spoffset].split("-") # now determines the frequency units = t.units.split("since")[0].strip() interval = float(e['general'].get("approx_interval")) interval = genutil.udunits(interval,units).to("s").value # determine what the frequency drname should be if (interval<2500.) : frequency = "subhr" elif (interval<15000.): frequency = "3hr" elif (interval<30000.): frequency = "6hr" elif (interval<100000.): frequency = "day" elif (interval<3.E6): frequency = "mon" else: frequency = "yr" if (interval == 0.): strcpy(tmp,"fx") #Now checks the frequecny attribute matches the one we just decided if file.frequency[-4:]=='Clim': frequency=frequency+"Clim" if file.frequency!=frequency: nerr+=manageLog(fout, noerror, 'your file indicates a frequency of "%s" but the approximate_interval suggests it should be: "%s"' % (file.frequency,frequency)) try: yr0=int(dates[0][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section start date iun your file',dates[0][:4]) frequency = 'yr' if interval<29.E6: frequency='mon' if len(dates[0])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m0 = int(dates[0][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section start date iun your file',dates[0][4:6]) else: m0=ft0.month if interval < 2E6: frequency='mon' if len(dates[0])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d0 = int(dates[0][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the day section start date iun your file',dates[0][6:8]) else: d0=ft0.day if interval < 86000: if len(dates[0])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours') try: h0 = int(dates[0][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section start date iun your file',dates[0][8:10]) else: h0= ft0.hour if interval < 3000: if len(dates[0])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: mn0 = int(dates[0][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the miuntes section start date iun your file',dates[0][10:12]) else: mn0=ft0.minute if interval < 50: if len(dates[0])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s0 = int(dates[0][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section start date iun your file',dates[0][12:14]) else: s0=ft0.second t0 = cdtime.comptime(yr0,m0,d0,h0,mn0,s0) try: yr1=int(dates[1][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section end date iun your file',dates[1][:4]) if interval<29.E6: if len(dates[1])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m1 = int(dates[1][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section end date iun your file',dates[1][4:6]) else: m1=ft1.month if interval < 2.E6: if len(dates[1])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d1 = int(dates[1][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the days section end date iun your file',dates[1][6:8]) else: d1=ft1.day if interval < 90000: if len(dates[1])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours') try: h1 = int(dates[1][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section end date iun your file',dates[1][8:10]) else: h1=ft1.hour if interval < 4000: if len(dates[1])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: mn1 = int(dates[1][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the minutes section end date iun your file',dates[1][10:12]) else: mn1=ft1.minute if interval < 100: if len(dates[1])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s1 = int(dates[1][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section end date iun your file',dates[1][12:14]) else: s1=ft1.second t1 = cdtime.comptime(yr1,m1,d1,h1,mn1,s1) if (ft0.year!=t0.year) or (ft0.month!=t0.month) or (ft0.day!=t0.day): nerr+=manageLog(fout, noerror, 'your file name indicates a start time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t0.year,t0.month,t0.day,ft0.year,ft0.month,ft0.day)) if (ft1.year!=t1.year) or (ft1.month!=t1.month) or (ft1.day!=t1.day): nerr+=manageLog(fout, noerror, 'your file name indicates an end time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t1.year,t1.month,t1.day,ft1.year,ft1.month,ft1.day)) manageLog(fout,VERBOSE, 'Checking that file contains only 1 variable') vars=file.listvariable() ## removes dims and other complementary vars # First bounds ## manageLog(fout,VERBOSE, vars) vars2=file.listvariable() vars3=[] vars4=[] for v in vars2: ## manageLog(fout,VERBOSE, v) V=file[v] b=getattr(V,'bounds',None) if b is not None: vars.pop(vars.index(b)) b=getattr(V,'ancillary_variables',None) if b is not None: for sp in b.split(): if sp.trip() in vars: vars.pop(sp.strip()) for ax in V.getAxisList(): b=getattr(ax,'bounds',None) if b is not None: if b in vars: vars.pop(vars.index(b)) Ab=file[b] # recovers associated bounds with axis f=getattr(Ab,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(True) f=getattr(ax,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(False) coords=getattr(V,'coordinates',None) if coords is not None: coords = coords.split() for c in coords: if c in vars: vars.pop(vars.index(c)) if hasattr(V,"grid_mapping"): if V.grid_mapping in vars: vars.pop(vars.index(V.grid_mapping)) manageLog(fout,VERBOSE, "Grid_mapping attribute found, we cannot check these files yet") ncheck+=1 nwarn+=1 return nwarn,ncheck,nerr t = V.getTime() if t is not None and hasattr(t,"climatology"): c = t.climatology if c in vars: vars.pop(vars.index(c)) if len(vars)!=1: nerr+=manageLog(fout, noerror, 'file must contain only 1 variable, you have: '+str(len(vars))+':'+str(vars)) var=vars[0] if major>=2 and dodrs: #Now checks for the DRS file structure prj_id = file.project_id.strip().replace(" ","_") prod = file.product inst = file.institute_id if inst == 'not specified' : inst = "INSTITUTE_ID" mod = file.model_id exp = file.experiment_id #by pass no sht for now... noff=0 fq = file.frequency realm = file.modeling_realm r = str(int(file.realization)) if hasattr(file,"initialization_method"): r+="i"+str(int(file.initialization_method)) if hasattr(file,"physics_version"): r+="p"+str(int(file.physics_version)) path = os.path.dirname(fnm).split("/") nerr += drs_check_pos(1,path,fout,noerror,'r%s' % r, 'realization') nerr += drs_check_pos(2,path,fout,noerror,var, 'variable') nerr += drs_check_pos(3,path,fout,noerror,realm, 'modeling realm') nerr += drs_check_pos(4,path,fout,noerror,fq, 'frequency') if exp == file.experiment: noff=1 else: nerr += drs_check_pos(5,path,fout,noerror,exp, 'experiment id') nerr += drs_check_pos(6-noff,path,fout,noerror,hyphenize(mod), 'model id') nerr += drs_check_pos(7-noff,path,fout,noerror,inst, 'insitution id') nerr += drs_check_pos(8-noff,path,fout,noerror,prod, 'product') nerr += drs_check_pos(9-noff,path,fout,noerror,prj_id, 'project id') fb=False if variable is not None: var=variable fb=from_bounds manageLog(fout,VERBOSE, 'Ok user asked to check the following variable:',variable,'with from bounds =',fb) manageLog(fout,VERBOSE, 'Checking variable name is %s compliant' % file.project_id) if not var in IPCC_std_vars: if var in Vars.keys(): nerr+=manageLog(fout, noerror, var+' is not valid, did you mean :'+Vars[var]['out_name']+' ?') else: nerr+=manageLog(fout, noerror, 'Variable name :'+var+' is not %s compliant' % file.project_id) if variable is None: manageLog(fout,VERBOSE, 'Checking that variable name in file matches file indications') if not var == vf: nerr+=manageLog(fout, noerror, 'File indicates it stores variable:'+vf+' but actually '+var+' is stored in it') V=file[var] axes=V.getAxisList() hasLat=0 hasLon=0 hasTime=0 hasLevel=0 ax_dict_name=[] for ax in axes: manageLog(fout,VERBOSE, 'Checking axis name is valid for:',ax.id,'on var:',V.id) if not ax.id in IPCC_std_axes: if ax.id in Axes.keys(): if major <2: ncheck+=1 nwarn+=1 nerr+=manageLog(fout,cmor.CMOR_WARNING, '\t\t'+ax.id+' is not preferred. We suggest you rename it:'+Axes[ax.id]['out_name']) else: manageLog(fout,noerror, '\t\tAxis name '+ax.id+' is not valid. We require you rename it:'+Axes[ax.id]['out_name']) elif (fb == False) or (fb == True and V.rank()!=2): nerr+=manageLog(fout, noerror, 'axis id: '+ax.id+' is not a valid IPCC name') if ax.isLatitude(): hasLat=1 if ax.isLongitude(): hasLon=1 if ax.isTime(): hasTime=1 if ax.isLevel(): hasLevel=1 old_ordering=0 o=V.getOrder(ids=1) if old_ordering: manageLog(fout,VERBOSE, 'Checking dimensions order') if hasTime: manageLog(fout,VERBOSE, '\tChecking time position') if o[0]=='t': o=o[1:] else: nerr+=manageLog(fout, noerror, 'time must be first dimension your ordering is:'+o) manageLog(fout,VERBOSE, '\tChecking none tzxy dims position') sp=o.split('(') if len(sp)>1: if o[0]!='(': nerr+=manageLog(fout, noerror, 'none zyx dimensions must come right after time dimension, you have:'+o) o=o.split(')')[-1] manageLog(fout,VERBOSE, '\tChecking level position') if hasLevel: if o[0]=='z': o=o[1:] else: nerr+=manageLog(fout, noerror, 'level must be ordered after time your order is:'+o) manageLog(fout,VERBOSE, '\tChecking latitude position') if hasLat: if o[0]=='y': o=o[1:] else: nerr+=manageLog(fout, noerror, 'latitude must be ordered after time and level your order is:'+o) manageLog(fout,VERBOSE, '\tChecking longitude position') if hasLon: if o[0]=='x': o=o[1:] else: nerr+=manageLog(fout, noerror, 'longitude must be ordered after time, level and latitude your order is:'+o) g=None if hasLat and hasLon: manageLog(fout,VERBOSE, 'Checking grid') g=V.getGrid() if not isinstance(g,cdms2.grid.AbstractRectGrid): nerr+=manageLog(fout, noerror, 'lat/lon variable ('+var+') must have Rectilinear grids') axes_nmes=Vars[var].get('dimensions',None) if axes_nmes is not None: manageLog(fout,VERBOSE, 'Checking rest of things on axes') axes_nmes=axes_nmes[::-1] axes_nmes_for_ordering=Vars[var]['dimensions'][::-1] coord=getattr(V,'coordinates',None) for nm in axes_nmes: req_Att=['standard_name','units'] anm = nm if nm in [ 'alevel','olevel','zlevel']: gnm=nm manageLog(fout,VERBOSE, '\tChecking special case %s, i.e' % (nm),'') tmpax=V.getLevel() print>>fout, tmpax.id,tmpax.standard_name for x in Axes.keys(): tmp=Axes[x].get('standard_name',None) if tmp is not None: tmp=tmp.strip() if tmp is not None and tmp==tmpax.standard_name: nm=x Nm=Axes[x]['out_name'] anm=x req_Att.append('formula') req_Att.append('formula_terms') if getattr(tmpax,"formula","")==Axes[x]['formula']: break axes_nmes_for_ordering[axes_nmes_for_ordering.index(gnm)]=nm elif not nm in V.getAxisIds(): try: Nm=Axes[nm]['out_name'] except: nerr+=manageLog(fout, noerror, 'with axis: '+nm+' not found for variable: '+var, noerror) else: Nm=nm if major>1: if Axes[anm].get("must_have_bounds","no")=="yes": req_Att.append("bounds") if Axes[anm].get("axis",None) is not None: req_Att.append("axis") else: req_Att.append("bounds") if nm == 'time' and is_clim: req_Att.pop(req_Att.index("bounds")) manageLog(fout,VERBOSE, '\tChecking',Nm) axindx=V.getAxisIndex(Nm) val=Axes[nm].get('value',None) if val is not None: #singleton dimension ? manageLog(fout,VERBOSE, '\t\tSingleton dimension') if val is None: nerr+=manageLog(fout, noerror, 'cannot retrieve needed axis:'+Nm) else: val=float(val) if axindx!=-1: nerr+=manageLog(fout, noerror, 'singleton dimension '+Nm+' must be defined via coordinates attributes on variable '+var+' not as an axis') else: manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute exists on '+var) aval=getattr(V,'coordinates',None) if aval is None: nerr+=manageLog(fout, noerror, 'singleton dimension must be defined via coordinates attribute') manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute matches for '+var) if not Nm in aval.split(): nerr+=manageLog(fout, noerror, 'coordinates atrtribute on '+var+' should be '+Nm+' it is '+aval) ax=file[Nm] mn,mx=Axes[nm].get('valid_min',None), Axes[nm].get('valid_max',None) manageLog(fout,VERBOSE, '\t\tChecks for value') if ax != val: manageLog(fout,VERBOSE, '\t\t\tNot matching, checking if valid range is defined in table') if mn is None and mx is None: nerr+=manageLog(fout, noerror, 'singleton dimension value for '+Nm+' must be '+str(val)) manageLog(fout,VERBOSE, '\t\t\tChecking if value is within range defined in table') if mn is not None: if mx is not None: if not( float(mn)<ax<float(mx)): nerr+=manageLog(fout, noerror, 'invalid value for singleton dimension '+Nm+': '+str(ax)+' must be between '+mn+' and '+mx) elif ax<float(mn): nerr+=manageLog(fout, noerror, 'invalid min for singleton dimension '+Nm+': '+str(ax)+' must be greater than '+mn) elif ax>float(mx): nerr+=manageLog(fout, noerror, 'invalid max for singleton dimension '+Nm+': '+str(ax)+' must be less than '+mx) manageLog(fout,VERBOSE, '\t\tChecking for bounds information') b=getattr(ax,'bounds',None) bv=Axes[nm].get('bounds_values',None) if bv is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in table, checking vs file') bv=bv.split() bv=float(bv[0]),float(bv[1]) if b is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in file, checking if matches') abv=file[b] ncheck+=1 if abv[0]!=bv[0] or abv[1]!=bv[1]: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tbounds_value for singleton dimension '+Nm+': '+str(abv)+' do not match requested bounds:'+str(bv)) else: nerr+=manageLog(fout, noerror, 'singleton dimension: '+Nm+' bounds required') else: ncheck+=1 if b is not None: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tSingleton dimension: '+Nm+' bounds should not be included') axes_nmes_for_ordering.pop(0) continue # singleton dimension checked no need to continue further if axindx==-1: nerr+=manageLog(fout, noerror, 'Variable '+var+' should have an axis called '+Axes[Nm]) ax=V.getAxis(axindx) manageLog(fout,VERBOSE, '\t\tChecking that dimension order is positioned:',axes_nmes_for_ordering.index(nm)+1,axes_nmes) if axindx!=axes_nmes_for_ordering.index(nm): nerr+=manageLog(fout, noerror, 'in ordering for dimension '+nm+' position is: '+str(axindx)+' but it should be: '+str(axes_nmes_for_ordering.index(nm))) if ('cell_bounds' in Axes[nm].get('ignored',[])) or ('cell_bounds' in Axes[nm].get('forbidden',[])) or ('cell_bounds' in Axes[nm].get('optional',[])): req_Att.pop(req_Att.index('bounds')) if 'units' in Axes[nm].get('ignored',[]) or 'units' in Axes[nm].get('optional',[]): try: req_Att.pop(req_Att.index('units')) except: pass ## Ok here we're trying to do the region thing, i.e coordinate attribute exist docoord=False if coord is not None: for c in coord.split(): nax=file[c] if ax.id in nax.getAxisIds(): oldax=ax ax=nax docoord=True manageLog(fout,VERBOSE, '\t\tChecking if required attributes are set:','') for r in req_Att: manageLog(fout,VERBOSE, r,'') val=getattr(ax,r,None) if val is None: print >>fout nerr+=manageLog(fout, noerror, 'attribute '+r+' is required for axis '+ax.id) if r!='units': good_val=Axes[nm].get(r,None) if good_val is not None: if val!=good_val: nerr+=manageLog(fout, noerror, 'axis attribute '+r+' should be: '+str(good_val)+' but is:'+str(val)) if r=='formula_terms': print 'Formula:',Axes[anm]['formula'],val print >>fout if not 'units' in Axes[nm].get('ignored',[]): if not 'units' in Axes[nm].get('optional',[]) or ('units' in Axes[nm].get('optional',[]) and hasattr(ax,'units')): if not ax.isTime(): manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major<2: u1=genutil.udunits(1,ax.units) try: u2=u1.to(Axes[nm]['units']) if u2.value!=1: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) except: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) else: if ax.units != Axes[nm]['units']: nerr+=manageLog(fout, noerror, 'units: '+ax.units+' are not the required units:'+Axes[nm]['units']) else: manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major>1: if ax.units.lower().find("days since")==-1: nerr+=manageLog(fout,noerror,'Time units must be in "days since", you have:',ax.units) bnds = ax.getBounds() if bnds is not None: for i in range(len(ax)): if ax[i]!=(bnds[i][0]+bnds[i][1])/2.: nerr+=manageLog(fout,noerror,"Time values are not average of time bounds") try: u=cdtime.reltime(1,ax.units) except: nerr+=manageLog(fout, noerror, 'invalid time units:'+ax.units+', should be in the form: "'+Axes[nm]['units']+'"') try: c=ax.calendar except: c='none' if not c in ["gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard"]: nerr+=manageLog(fout,noerror,"calendar must be one of [","gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard ] yours is",c) if c=='365_day': c=cdtime.NoLeapCalendar else: c=ax.getCalendar() manageLog(fout,VERBOSE, '\t\tView First and Last times:\t',ax.asComponentTime(c)[0],'\t',ax.asComponentTime(c)[-1]) tmpbnds=ax.getBounds() if tmpbnds is not None: manageLog(fout,VERBOSE, '\t\tView Bounds for first time:\t',cdtime.reltime(tmpbnds[0,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[0,1],ax.units).tocomp(c)) manageLog(fout,VERBOSE, '\t\tView Bounds for last time:\t',cdtime.reltime(tmpbnds[-1,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[-1,1],ax.units).tocomp(c)) else: manageLog(fout,VERBOSE,'\t\tNo Bounds for time') tp=Axes[nm].get('type','double') manageLog(fout,VERBOSE, '\t\tChecking axis is type',tp) if tp == 'double' : tp='d' elif tp == 'real' : tp='f' elif tp == 'character' : tp='c' elif tp == 'integer' : tp='l' else: nerr+=manageLog(fout, noerror, 'encountered unknown type:'+tp) if ax.typecode()!=tp: nerr+=manageLog(fout, noerror, 'required typecode for '+Nm+' should be '+tp+' not '+ax.typecode()) if ax.isLongitude(): manageLog(fout,VERBOSE, '\t\tChecking for axis attribute') a=getattr(ax,'axis',None) if a is None: nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute') if a!='X': nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute set to X not: '+a) manageLog(fout,VERBOSE, '\t\tChecking name') if not ax.id in ['lon','longitude']: nerr+=manageLog(fout, noerror, 'longitude axis name must be longitude or lon (prefered) not: '+ax.id) | 147b07ceb0a19eed8a8cc3b164ebeadbb3bc2349 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9170/147b07ceb0a19eed8a8cc3b164ebeadbb3bc2349/check_CMOR_compliant.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
9611,
916,
12,
617,
322,
16,
768,
16,
2121,
16,
2135,
1636,
33,
7670,
280,
18,
9611,
916,
67,
5093,
21377,
16,
6105,
33,
7036,
16,
2080,
67,
10576,
33,
7036,
16,
3011,
67,
9373,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
9611,
916,
12,
617,
322,
16,
768,
16,
2121,
16,
2135,
1636,
33,
7670,
280,
18,
9611,
916,
67,
5093,
21377,
16,
6105,
33,
7036,
16,
2080,
67,
10576,
33,
7036,
16,
3011,
67,
9373,... |
cats = pl.categories(withSortKeys = True) | cats = pl.categories() | def include(pl,checklinks=True,realinclude=True,linkterm=None): cl = checklinks if realinclude: try: text = pl.get() except wikipedia.NoPage: pass except wikipedia.IsRedirectPage: cl = True pass else: cats = pl.categories() if not workingcat in cats: cats = pl.categories(withSortKeys = True) for c in cats: if rawtoclean(c) in parentcats: cats.remove(c) if linkterm: pl.put(wikipedia.replaceCategoryLinks(text, cats + [wikipedia.Page(mysite,"%s|%s"%(workingcat.title(),linkterm))])) else: pl.put(wikipedia.replaceCategoryLinks(text, cats + [workingcat])) if cl: if checkforward: try: pl.get() except wikipedia.IsRedirectPage: pl2 = wikipedia.Page(mysite,pl.getRedirectTarget()) if needcheck(pl2): tocheck.append(pl2) checked[pl2]=pl2 except wikipedia.Error: pass else: for page2 in pl.linkedPages(): if needcheck(page2): tocheck.append(page2) checked[page2] = page2 if checkbackward: for refPage in pl.getReferences(): if needcheck(refPage): tocheck.append(refPage) checked[refPage] = refPage | 43ce29dfe9b2db05801502d948ed17e57be4c813 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/43ce29dfe9b2db05801502d948ed17e57be4c813/makecat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2341,
12,
412,
16,
1893,
7135,
33,
5510,
16,
7688,
6702,
33,
5510,
16,
1232,
6408,
33,
7036,
4672,
927,
273,
866,
7135,
309,
2863,
6702,
30,
775,
30,
977,
273,
886,
18,
588,
1435,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2341,
12,
412,
16,
1893,
7135,
33,
5510,
16,
7688,
6702,
33,
5510,
16,
1232,
6408,
33,
7036,
4672,
927,
273,
866,
7135,
309,
2863,
6702,
30,
775,
30,
977,
273,
886,
18,
588,
1435,
13... |
for catchRegex in TTP: resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('sysop-total', catchRegex) for catchRegex in TSP: resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('autoconfirmed-total', catchRegex) | if TTP: for catchRegex in TTP: resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('sysop-total', catchRegex) if TSP: for catchRegex in TSP: resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('autoconfirmed-total', catchRegex) | def understandBlock(text, TTP, TSP, TSMP, TTMP): """ Understand if the page is blocked and if it has the right template """ for catchRegex in TTP: # TTP = templateTotalProtection resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('sysop-total', catchRegex) for catchRegex in TSP: resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('autoconfirmed-total', catchRegex) if TSMP != None and TTMP != None and TTP != TTMP and TSP != TSMP: for catchRegex in TSMP: resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('sysop-move', catchRegex) for catchRegex in TTMP: resultCatch = re.findall(catchRegex, text) if resultCatch != []: return ('autoconfirmed-move', catchRegex) return ('editable', r'\A\n') | ae6c84af95a6fa171d8165b5c53d229fbd062411 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/ae6c84af95a6fa171d8165b5c53d229fbd062411/blockpageschecker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22413,
1768,
12,
955,
16,
399,
11130,
16,
399,
3118,
16,
15508,
4566,
16,
19912,
4566,
4672,
3536,
21140,
10145,
309,
326,
1363,
353,
14547,
471,
309,
518,
711,
326,
2145,
1542,
3536,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22413,
1768,
12,
955,
16,
399,
11130,
16,
399,
3118,
16,
15508,
4566,
16,
19912,
4566,
4672,
3536,
21140,
10145,
309,
326,
1363,
353,
14547,
471,
309,
518,
711,
326,
2145,
1542,
3536,
36... |
'api_sig=ffde3c04d60f752ad5a1547dd9d8b4d6' | 'api_sig=afbeaf8496a1c68b7cbe294d67e75ddb', 'format=rest' | def testUnicodeArgs(self): '''Tests whether Unicode arguments are properly handled. Tests using sets, since the order of the URL-encoded arguments can't be ensured. ''' # Plain ASCII should work f.photos_setMeta(monkey='lord') sent = set(self.fake_url_lib.data.split('&')) expected = set(['api_key=123key', 'monkey=lord', 'method=flickr.photos.setMeta', 'api_sig=fc6e5f9532f3c3e4c8bfd86cf93884a0' ]) self.assertEquals(expected, sent) # Unicode should work too f.photos_setMeta(title='monkeylord', description=EURO_UNICODE+U_UML_UNICODE) sent = set(self.fake_url_lib.data.split('&')) expected = set(['api_key=123key', 'title=monkeylord', 'description=%E2%82%AC%C3%BC', 'method=flickr.photos.setMeta', 'api_sig=ffde3c04d60f752ad5a1547dd9d8b4d6' ]) self.assertEquals(expected, sent) | 4a535f5bd7a9ee399bb3f0481ecc58d3391ddf1f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/501/4a535f5bd7a9ee399bb3f0481ecc58d3391ddf1f/test_flicrkapi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
16532,
2615,
12,
2890,
4672,
9163,
14650,
2856,
9633,
1775,
854,
8214,
7681,
18,
225,
7766,
87,
1450,
1678,
16,
3241,
326,
1353,
434,
326,
1976,
17,
10787,
1775,
848,
1404,
506,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
16532,
2615,
12,
2890,
4672,
9163,
14650,
2856,
9633,
1775,
854,
8214,
7681,
18,
225,
7766,
87,
1450,
1678,
16,
3241,
326,
1353,
434,
326,
1976,
17,
10787,
1775,
848,
1404,
506,
33... |
tree.show() | def test_fixLists(): raw = r""" | 7c30e5bfe77d7b2fbfab8af657c4a06236fdcc32 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/7c30e5bfe77d7b2fbfab8af657c4a06236fdcc32/test_treecleaner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
904,
7432,
13332,
1831,
273,
436,
8395,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
904,
7432,
13332,
1831,
273,
436,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
global _lock if (not _lock) and thread: _lock = threading.RLock() | def _acquireLock(): """ Acquire the module-level lock for serializing access to shared data. This should be released with _releaseLock(). """ global _lock if (not _lock) and thread: _lock = threading.RLock() if _lock: _lock.acquire() | 01801d1f088ca95c06a976dcd822d390d74b47d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/01801d1f088ca95c06a976dcd822d390d74b47d2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1077,
1039,
2531,
13332,
3536,
28822,
326,
1605,
17,
2815,
2176,
364,
2734,
6894,
2006,
358,
5116,
501,
18,
225,
1220,
1410,
506,
15976,
598,
389,
9340,
2531,
7675,
3536,
309,
389,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1077,
1039,
2531,
13332,
3536,
28822,
326,
1605,
17,
2815,
2176,
364,
2734,
6894,
2006,
358,
5116,
501,
18,
225,
1220,
1410,
506,
15976,
598,
389,
9340,
2531,
7675,
3536,
309,
389,
... | |
if not line: self.cmd_missing_arg() return | def ftp_USER(self, line): if not line: self.cmd_missing_arg() return # warning: we always treat anonymous user as lower-case string. if line.lower() == "anonymous": self.username = "anonymous" else: self.username = line self.respond('331 Username ok, send password.') | 3b393a7e366f846f71a2da059e75a45c755e9f2d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/3b393a7e366f846f71a2da059e75a45c755e9f2d/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
4714,
12,
2890,
16,
980,
4672,
468,
3436,
30,
732,
3712,
10116,
13236,
729,
487,
2612,
17,
3593,
533,
18,
309,
980,
18,
8167,
1435,
422,
315,
19070,
6877,
365,
18,
5053,
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,
13487,
67,
4714,
12,
2890,
16,
980,
4672,
468,
3436,
30,
732,
3712,
10116,
13236,
729,
487,
2612,
17,
3593,
533,
18,
309,
980,
18,
8167,
1435,
422,
315,
19070,
6877,
365,
18,
5053,
273... | |
state = self.calc.GetElectronicStates().GetState(band=n, spin=s, | state = self.calc.GetElectronicStates().GetState(band=band, spin=spin, | def get_pseudo_wave_function(self, band=0, kpt=0, spin=0, pad=True): kpt_c = self.get_bz_k_points()[kpt] state = self.calc.GetElectronicStates().GetState(band=n, spin=s, kptindex=kpt) | 5e1ea5f16dbdcd5d92cd2a36cbf99b0beb517150 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5735/5e1ea5f16dbdcd5d92cd2a36cbf99b0beb517150/dacapo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26023,
67,
17838,
67,
915,
12,
2890,
16,
8937,
33,
20,
16,
417,
337,
33,
20,
16,
12490,
33,
20,
16,
4627,
33,
5510,
4672,
417,
337,
67,
71,
273,
365,
18,
588,
67,
25292,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26023,
67,
17838,
67,
915,
12,
2890,
16,
8937,
33,
20,
16,
417,
337,
33,
20,
16,
12490,
33,
20,
16,
4627,
33,
5510,
4672,
417,
337,
67,
71,
273,
365,
18,
588,
67,
25292,
... |
context.set_antialias(cairo.ANTIALIAS_SUBPIXEL) | context.set_antialias(cairo.ANTIALIAS_NONE) | def DrawLine(self): """ Uses Cairo to draw the timeline onto a canvas in memory. Must be called initially and to redraw the timeline after moving the project start. Parameters: allocation -- the gtk.gdk.Rectangle allocated to the widget. """ allocArea = self.get_allocation() #rect = gtk.gdk.Rectangle(allocArea.x - allocArea.width, allocArea.y, # allocArea.width*3, allocArea.height) # TODO: temporary rect initialization rect = allocArea #Check if our area to cache is outside the allocated area #if rect.x < 0: # rect.x = 0 #if rect.x + rect.width > allocArea.width: # rect.width = allocArea.width - rect.x self.source = cairo.ImageSurface(cairo.FORMAT_ARGB32, rect.width, rect.height) context = cairo.Context(self.source) context.set_line_width(2) context.set_antialias(cairo.ANTIALIAS_SUBPIXEL) | 5cc149d3d51fa4d1a69f25540ea3bacb3678b657 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10033/5cc149d3d51fa4d1a69f25540ea3bacb3678b657/TimeLine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
1670,
12,
2890,
4672,
3536,
14854,
385,
10658,
303,
358,
3724,
326,
18316,
10170,
279,
5953,
316,
3778,
18,
6753,
506,
2566,
22458,
471,
358,
16540,
326,
18316,
1839,
12499,
326,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
1670,
12,
2890,
4672,
3536,
14854,
385,
10658,
303,
358,
3724,
326,
18316,
10170,
279,
5953,
316,
3778,
18,
6753,
506,
2566,
22458,
471,
358,
16540,
326,
18316,
1839,
12499,
326,
19... |
toks = string.split (l) if len(toks) < 1: | toks = string.split (ell) if len (toks) < 1: | def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bbox, '') ls = ls[1:] commands = [] while ls[0] <> '*U\n': l = ls[0] ls = ls[1:] toks = string.split (l) if len(toks) < 1: continue cmd= toks[-1] args = map (lambda m, s=inv_scale : s * string.atof(m), toks[:-1]) if round_to_int: args = zip_to_pairs (map (round, args)) else : args = zip_to_pairs (args) commands.append ((cmd,args)) expand = { 'l': 'rlineto', 'm': 'rmoveto', 'c': 'rrcurveto', 'f': 'closepath' , } cx = 0 cy = size_y - off_y -1 # t1asm seems to fuck up when using sbw. Oh well. t1_outline = ' %d %d hsbw\n' % (- off_x, tfm_wid) bbox = (10000,10000,-10000,-10000) for (c,args) in commands: na = [] for a in args: (nx, ny) = a if c == 'l' or c == 'c': bbox = update_bbox_with_point (bbox, a) na.append( (nx -cx, ny -cy) ) (cx, cy) = (nx, ny) a = na c = expand[c] if round_to_int: a = map (lambda x: '%d' % int (round (x)), unzip_pairs (a)) else : a = map (lambda x: '%d %d div' % (int (round (x * potrace_scale/inv_scale)), int( round (potrace_scale/inv_scale))), unzip_pairs (a)) t1_outline = t1_outline + ' %s %s\n' % (string.join (a),c) t1_outline = t1_outline + ' endchar ' t1_outline = '{\n %s } |- \n' % t1_outline return (bbox, t1_outline) | d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3656,
5129,
67,
803,
67,
869,
67,
723,
21,
67,
4473,
261,
270,
67,
768,
16,
9389,
67,
9597,
16,
3253,
81,
67,
30902,
4672,
2198,
67,
5864,
273,
4336,
18,
20,
19,
4527,
82,
1480,
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,
3656,
5129,
67,
803,
67,
869,
67,
723,
21,
67,
4473,
261,
270,
67,
768,
16,
9389,
67,
9597,
16,
3253,
81,
67,
30902,
4672,
2198,
67,
5864,
273,
4336,
18,
20,
19,
4527,
82,
1480,
22... |
"Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.stats.active + 1, | "Running task %d of %d (ID: %s, %s)" % (self.stats.completed + self.stats.active + self.stats.failed + 1, | def fork_off_task(self, fn, task, taskname): sys.stdout.flush() sys.stderr.flush() try: pipein, pipeout = os.pipe() pid = os.fork() except OSError as e: bb.msg.fatal(bb.msg.domain.RunQueue, "fork failed: %d (%s)" % (e.errno, e.strerror)) if pid == 0: os.close(pipein) # Save out the PID so that the event can include it the # events bb.event.worker_pid = os.getpid() bb.event.worker_pipe = pipeout | 2d263840b03cfaa93ea8b8bd036273838b7f6a5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/2d263840b03cfaa93ea8b8bd036273838b7f6a5f/runqueue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12515,
67,
3674,
67,
4146,
12,
2890,
16,
2295,
16,
1562,
16,
1562,
529,
4672,
2589,
18,
10283,
18,
11330,
1435,
2589,
18,
11241,
18,
11330,
1435,
775,
30,
6010,
267,
16,
6010,
659,
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,
12515,
67,
3674,
67,
4146,
12,
2890,
16,
2295,
16,
1562,
16,
1562,
529,
4672,
2589,
18,
10283,
18,
11330,
1435,
2589,
18,
11241,
18,
11330,
1435,
775,
30,
6010,
267,
16,
6010,
659,
273... |
filename = "%s/:info" % self.path | filename = "%s/:info" % self.repopath | def read_info(self): '''read in :info metadata''' filename = "%s/:info" % self.path for line in open(filename).readlines(): match = self.info.match(line) if not match: continue else: mgd = match.groupdict() if mgd['owner']: self.metadata['owner'] = mgd['owner'] elif mgd['group']: self.metadata['group'] = mgd['group'] elif mgd['encoding']: self.metadata['encoding'] = mgd['encoding'] elif mgd['perms']: self.metadata['perms'] = mgd['perms'] if len(self.metadata['perms']) == 3: self.metadata['perms'] = "0%s" % (self.metadata['perms']) elif mgd['paranoid']: self.paranoid = True | b9ac6e48c38beb674c18eae33c5b8a6f2eb39f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/b9ac6e48c38beb674c18eae33c5b8a6f2eb39f33/Cfg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
1376,
12,
2890,
4672,
9163,
896,
316,
294,
1376,
1982,
26418,
1544,
273,
2213,
87,
16880,
1376,
6,
738,
365,
18,
266,
5120,
421,
364,
980,
316,
1696,
12,
3459,
2934,
896,
3548... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
1376,
12,
2890,
4672,
9163,
896,
316,
294,
1376,
1982,
26418,
1544,
273,
2213,
87,
16880,
1376,
6,
738,
365,
18,
266,
5120,
421,
364,
980,
316,
1696,
12,
3459,
2934,
896,
3548... |
self.lebgth = 0 | self.length = 0 | def play(self, command, player): """ called before playing is started to add some stuff to the command line """ self.item = player.item self.player = player self.osd_visible = False self.bmovl = None | 224aed80ae56218d1563db9ee9c95e4c9a06fc80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/224aed80ae56218d1563db9ee9c95e4c9a06fc80/bmovl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
1296,
16,
7291,
4672,
3536,
2566,
1865,
23982,
353,
5746,
358,
527,
2690,
10769,
358,
326,
1296,
980,
3536,
365,
18,
1726,
3639,
273,
7291,
18,
1726,
365,
18,
14872,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
1296,
16,
7291,
4672,
3536,
2566,
1865,
23982,
353,
5746,
358,
527,
2690,
10769,
358,
326,
1296,
980,
3536,
365,
18,
1726,
3639,
273,
7291,
18,
1726,
365,
18,
14872,
... |
[Ideal (z^3 + 2, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field] | [Ideal (z^2 + 1, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field, Ideal (z^3 + 2, -z^2 + y) of Multivariate Polynomial Ring in x, y, z over Rational Field] | def minimal_associated_primes(self): r""" OUTPUT: list -- a list of prime ideals | 1ee1abc70a100f764ad4f5df8e753e9d7f114607 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/1ee1abc70a100f764ad4f5df8e753e9d7f114607/multi_polynomial_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16745,
67,
28441,
67,
683,
4485,
12,
2890,
4672,
436,
8395,
11550,
30,
666,
1493,
279,
666,
434,
17014,
10572,
1031,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
16745,
67,
28441,
67,
683,
4485,
12,
2890,
4672,
436,
8395,
11550,
30,
666,
1493,
279,
666,
434,
17014,
10572,
1031,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return StringIO(msgbuf) | if buf == '': break msgbuf.append(buf) return StringIO("".join(msgbuf)) | def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket. | a3a06fe59aaff7c172e572bd38a98391355a3102 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a3a06fe59aaff7c172e572bd38a98391355a3102/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
768,
12,
2890,
16,
1965,
16,
1681,
1467,
33,
7036,
4672,
3536,
990,
279,
7471,
585,
17,
5625,
733,
598,
501,
628,
2987,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
768,
12,
2890,
16,
1965,
16,
1681,
1467,
33,
7036,
4672,
3536,
990,
279,
7471,
585,
17,
5625,
733,
598,
501,
628,
2987,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED: self.minimized = True else: self.minimized = False | self.minimized = bool(event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED) if gpodder.interface == gpodder.MAEMO: self.minimized = bool(event.new_window_state & gtk.gdk.WINDOW_STATE_WITHDRAWN) | def window_state_event(self, widget, event): if event.new_window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN: self.fullscreen = True else: self.fullscreen = False old_minimized = self.minimized | 99c4c54fc9be0d66ea93c316f177c89522ec2f76 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12778/99c4c54fc9be0d66ea93c316f177c89522ec2f76/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2742,
67,
2019,
67,
2575,
12,
2890,
16,
3604,
16,
871,
4672,
309,
871,
18,
2704,
67,
5668,
67,
2019,
473,
22718,
18,
75,
2883,
18,
23407,
67,
7998,
67,
18111,
27908,
30,
365,
18,
285... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2742,
67,
2019,
67,
2575,
12,
2890,
16,
3604,
16,
871,
4672,
309,
871,
18,
2704,
67,
5668,
67,
2019,
473,
22718,
18,
75,
2883,
18,
23407,
67,
7998,
67,
18111,
27908,
30,
365,
18,
285... |
Returns the partiton obtained by removing a box at the end of row i. | Returns the partition obtained by removing a box at the end of row i. | def remove_box(self, i, j = None): """ Returns the partiton obtained by removing a box at the end of row i. | d2bea0c9898d10512ce54569c87e5b09be4cdba6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d2bea0c9898d10512ce54569c87e5b09be4cdba6/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
2147,
12,
2890,
16,
277,
16,
525,
273,
599,
4672,
3536,
2860,
326,
1087,
26949,
12700,
635,
9427,
279,
3919,
622,
326,
679,
434,
1027,
277,
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,
1206,
67,
2147,
12,
2890,
16,
277,
16,
525,
273,
599,
4672,
3536,
2860,
326,
1087,
26949,
12700,
635,
9427,
279,
3919,
622,
326,
679,
434,
1027,
277,
18,
2,
-100,
-100,
-100,
-100,
-10... |
warnings.warn("The behavior of min when axis==None will change! Now we return the min over the last dimensions. It will change to the min over all dimensions as numpy. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the futur behavior set axis to range(nb dim), but this don't support the grad. To have the grad, you must flatten the tensor before calling min().") | warnings.warn("The behavior of min when axis is None will change! Now we return the min over the last dimensions. It will change to the min over all dimensions as numpy. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the future behavior, set axis to range(x.ndim), but this does not support the grad. To be able to get the grad, you must flatten the tensor before calling min().") | def min(x, axis='DEFAULT'): if x.type.ndim == 1 and axis in ('DEFAULT', None): # The old and new behavior are not different. axis = 0 elif axis=='DEFAULT': axis = x.type.ndim - 1 warnings.warn("The default axis of min will change! Now we return the min over the last dimensions. It will change to be the same as numpy: the min over all dimensions. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the futur behavior set axis to range(nb dim), but this don't support the grad. To have the grad, you must flatten the tensor before calling min().") elif axis is None: axis = x.type.ndim - 1 warnings.warn("The behavior of min when axis==None will change! Now we return the min over the last dimensions. It will change to the min over all dimensions as numpy. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the futur behavior set axis to range(nb dim), but this don't support the grad. To have the grad, you must flatten the tensor before calling min().") str_x_type = str(x.dtype) if str_x_type.startswith('float') or str_x_type.startswith('int'): return -max(-x, axis=axis) else: #Be careful about unsigned integers, complex raise NotImplementedError() | fe22e38c8a2e5489ad97ff7bb3b53aebeb78dfb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/fe22e38c8a2e5489ad97ff7bb3b53aebeb78dfb3/basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
92,
16,
2654,
2218,
5280,
11,
4672,
309,
619,
18,
723,
18,
82,
3509,
422,
404,
471,
2654,
316,
7707,
5280,
2187,
599,
4672,
468,
1021,
1592,
471,
394,
6885,
854,
486,
3775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
92,
16,
2654,
2218,
5280,
11,
4672,
309,
619,
18,
723,
18,
82,
3509,
422,
404,
471,
2654,
316,
7707,
5280,
2187,
599,
4672,
468,
1021,
1592,
471,
394,
6885,
854,
486,
3775,
... |
self._decode_tell_cookie(cookie) | self._unpack_cookie(cookie) | def seek(self, cookie, whence=0): if not self._seekable: raise IOError("underlying stream is not seekable") if whence == 1: # seek relative to current position if cookie != 0: raise IOError("can't do nonzero cur-relative seeks") # Seeking to the current position should attempt to # sync the underlying buffer with the current position. whence = 0 cookie = self.tell() if whence == 2: # seek relative to end of file if cookie != 0: raise IOError("can't do nonzero end-relative seeks") self.flush() position = self.buffer.seek(0, 2) self._decoded_text = "" self._snapshot = None if self._decoder: self._decoder.reset() return position if whence != 0: raise ValueError("invalid whence (%r, should be 0, 1 or 2)" % (whence,)) if cookie < 0: raise ValueError("negative seek position %r" % (cookie,)) self.flush() | 420084188486cbed54ef83ecc334c8781c1f1af3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/420084188486cbed54ef83ecc334c8781c1f1af3/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
12,
2890,
16,
3878,
16,
23692,
33,
20,
4672,
309,
486,
365,
6315,
16508,
429,
30,
1002,
8340,
2932,
9341,
6291,
1407,
353,
486,
6520,
429,
7923,
309,
23692,
422,
404,
30,
468,
65... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
12,
2890,
16,
3878,
16,
23692,
33,
20,
4672,
309,
486,
365,
6315,
16508,
429,
30,
1002,
8340,
2932,
9341,
6291,
1407,
353,
486,
6520,
429,
7923,
309,
23692,
422,
404,
30,
468,
65... |
cooker.buildProvider( name ) | cooker.buildProvider( name, data.getVar("BUILD_ALL_DEPS", cooker.configuration.data, True) ) | def build( self, params, cmd = "build" ): """Build a providee""" globexpr = params[0] self._checkParsed() names = globfilter( cooker.status.pkg_pn.keys(), globexpr ) if len( names ) == 0: names = [ globexpr ] print "SHELL: Building %s" % ' '.join( names ) | adcdf5bf528dc39bc7115cac5d2ec6f0c9c763aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2672/adcdf5bf528dc39bc7115cac5d2ec6f0c9c763aa/shell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
365,
16,
859,
16,
1797,
273,
315,
3510,
6,
262,
30,
3536,
3116,
279,
5615,
73,
8395,
4715,
8638,
273,
859,
63,
20,
65,
365,
6315,
1893,
11257,
1435,
1257,
273,
4715,
2188,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
365,
16,
859,
16,
1797,
273,
315,
3510,
6,
262,
30,
3536,
3116,
279,
5615,
73,
8395,
4715,
8638,
273,
859,
63,
20,
65,
365,
6315,
1893,
11257,
1435,
1257,
273,
4715,
2188,
... |
listLabel = _("Override Delev/Relev Tags") | listLabel = _("Override Delev/Relev Tags") | def OnTweakChoice(self,event): """Handle choice menu selection.""" tweakIndex = self.rightClickTweakIndex self.tweaks[tweakIndex].chosen = event.GetId() self.gList.SetString(tweakIndex,self.tweaks[tweakIndex].getListLabel()) | 3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
56,
26008,
10538,
12,
2890,
16,
2575,
4672,
3536,
3259,
6023,
3824,
4421,
12123,
21279,
1016,
273,
365,
18,
4083,
6563,
56,
26008,
1016,
365,
18,
88,
26008,
87,
63,
88,
26008,
1016... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
56,
26008,
10538,
12,
2890,
16,
2575,
4672,
3536,
3259,
6023,
3824,
4421,
12123,
21279,
1016,
273,
365,
18,
4083,
6563,
56,
26008,
1016,
365,
18,
88,
26008,
87,
63,
88,
26008,
1016... |
urwid.Text("---", align="center"), | urwid.Text("---", align="center"), | def display_var(prefix, label, value, id_path=None, attr_prefix=None): if id_path is None: id_path = label | e032f4d4e7d00a05fe0f27b0ce4695345bb987e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12738/e032f4d4e7d00a05fe0f27b0ce4695345bb987e0/debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
1401,
12,
3239,
16,
1433,
16,
460,
16,
612,
67,
803,
33,
7036,
16,
1604,
67,
3239,
33,
7036,
4672,
309,
612,
67,
803,
353,
599,
30,
612,
67,
803,
273,
1433,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2562,
67,
1401,
12,
3239,
16,
1433,
16,
460,
16,
612,
67,
803,
33,
7036,
16,
1604,
67,
3239,
33,
7036,
4672,
309,
612,
67,
803,
353,
599,
30,
612,
67,
803,
273,
1433,
2,
-100,
-100... |
We now illustrates that the enumeration is done lazily, by depth first search:: | We now illustrate that the enumeration is done lazily, by depth first search:: | sage: def succ(l): | aae1e83e9fdb4c91d34c9e6f83a1e7edb7b8e60b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/aae1e83e9fdb4c91d34c9e6f83a1e7edb7b8e60b/backtrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
272,
410,
30,
1652,
21043,
12,
80,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
272,
410,
30,
1652,
21043,
12,
80,
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,
... |
pnode=pnode, snode=snode) | pnode=pnode, snode=snode, hvparams=[{'kernel_path': kernelpath}, {'root_path': rootpath}, {'serial_console':serialconsole}, {'boot_order':bootorder}, {'cdrom_image_path':imagepath},]) | def create(request, cluster_slug=None): """ Create a new instance Store in DB and Create on given cluster """ user = request.user if not(user.is_superuser or user.perms_on_any(Cluster, ['admin', 'create_vm'])): return HttpResponseForbidden() if cluster_slug is not None: cluster = get_object_or_404(Cluster, slug=cluster_slug) else: cluster = None if request.method == 'POST': form = NewVirtualMachineForm(user, None, request.POST) if form.is_valid(): data = form.cleaned_data cluster = data['cluster'] hostname = data['hostname'] owner = data['owner'] vcpus = data['vcpus'] disk_size = data['disk_size'] ram = data['ram'] disk_template = data['disk_template'] os = data['os'] nictype = data['nictype'] nicmode = data['nic'] pnode = data['pnode'] if disk_template == 'drdb': snode = data['snode'] else: snode = None try: jobid = cluster.rapi.CreateInstance('create', hostname, disk_template, [{"size": disk_size, }],[{nictype: nicmode, }], memory=ram, os=os, vcpus=2, pnode=pnode, snode=snode) vm = VirtualMachine(cluster=cluster, owner=owner, hostname=hostname, disk_size=disk_size, ram=ram, virtual_cpus=vcpus) vm.save() # grant admin permissions to the owner data['grantee'].grant('admin', vm) return HttpResponseRedirect( \ reverse('instance-detail', args=[cluster.slug, vm.hostname])) except GanetiApiError as e: msg = 'Error creating virtual machine on this cluster: %s' % e form._errors["cluster"] = form.error_class([msg]) elif request.method == 'GET': form = NewVirtualMachineForm(user, cluster) return render_to_response('virtual_machine/create.html', { 'form': form, 'user': request.user, }, context_instance=RequestContext(request), ) | 583702ea10c147ed8b5c6e709e75e2e42d0275ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/583702ea10c147ed8b5c6e709e75e2e42d0275ee/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2293,
16,
2855,
67,
6436,
33,
7036,
4672,
3536,
1788,
279,
394,
791,
4994,
316,
2383,
471,
1788,
603,
864,
2855,
3536,
729,
273,
590,
18,
1355,
309,
486,
12,
1355,
18,
291,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2293,
16,
2855,
67,
6436,
33,
7036,
4672,
3536,
1788,
279,
394,
791,
4994,
316,
2383,
471,
1788,
603,
864,
2855,
3536,
729,
273,
590,
18,
1355,
309,
486,
12,
1355,
18,
291,
... |
left join (select items.item_id as item_id, %s as bucket, sum(out_operationplan.quantity) as planned from out_operationplan, dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where out_operationplan.enddate = d.day and out_operationplan.demand_id = inp.name and inp.item_id = items.item_id and out_operationplan.enddate >= '%s' and out_operationplan.enddate < '%s' group by items.item_id, bucket) data2 on combi.item_id = data2.item_id and combi.bucket = data2.bucket | left join ( select inp.item_id as item_id, out_operationplan.enddate as date, out_operationplan.quantity as quantity from out_operationplan inner join demand as inp on out_operationplan.demand_id = inp.name ) as pln on items.item_id = pln.item_id and d.startdate <= pln.date and d.enddate > pln.date | def demandquery(item, bucket, startdate, enddate, offset=0, limit=None): if item: filterstring = 'where item_id = %s' else: filterstring = '' if limit: if offset == 0: limitstring = 'limit %d' % int(limit) else: limitstring = 'limit %d offset %d' % (int(limit),int(offset)) else: limitstring = '' cursor = connection.cursor() query = ''' select combi.item_id, combi.bucket, coalesce(data.demand,0), coalesce(data2.planned,0) from (select item_id, d.bucket as bucket, d.start as start from (select distinct item_id from demand %s order by item_id %s) as items cross join (select %s as bucket, min(day) as start from dates where day >= '%s' and day < '%s' group by bucket) d ) as combi -- Planned quantity left join (select items.item_id as item_id, %s as bucket, sum(out_operationplan.quantity) as planned from out_operationplan, dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where out_operationplan.enddate = d.day and out_operationplan.demand_id = inp.name and inp.item_id = items.item_id and out_operationplan.enddate >= '%s' and out_operationplan.enddate < '%s' group by items.item_id, bucket) data2 on combi.item_id = data2.item_id and combi.bucket = data2.bucket -- Requested quantity left join (select items.item_id as item_id, %s as bucket, sum(inp.quantity) as demand from dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where date(inp.due) = d.day and inp.due >= '%s' and inp.due < '%s' and inp.item_id = items.item_id group by items.item_id, bucket) data on combi.item_id = data.item_id and combi.bucket = data.bucket -- Sort the result order by combi.item_id, combi.start ''' % (filterstring, limitstring,bucket,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate) if item: cursor.execute(query, (item,item,item)) else: cursor.execute(query) resultset = [] previtem = None rowset = [] for row in cursor.fetchall(): if row[0] != previtem: if previtem: resultset.append(rowset) rowset = [] previtem = row[0] backlog = 0 # @todo Setting the backlog to 0 is not correct: it may be non-zero from the plan before the start date backlog += row[2] - row[3] rowset.append( { 'item': row[0], 'bucket': row[1], 'requested': row[2], 'supplied': row[3], 'backlog': backlog, } ) if previtem: resultset.append(rowset) return resultset | 776cd72ff4cb8fa56a39290bfbe91a5586a0ae6d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8604/776cd72ff4cb8fa56a39290bfbe91a5586a0ae6d/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23653,
2271,
12,
1726,
16,
2783,
16,
787,
712,
16,
679,
712,
16,
1384,
33,
20,
16,
1800,
33,
7036,
4672,
309,
761,
30,
1034,
1080,
273,
296,
6051,
761,
67,
350,
273,
738,
87,
11,
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,
23653,
2271,
12,
1726,
16,
2783,
16,
787,
712,
16,
679,
712,
16,
1384,
33,
20,
16,
1800,
33,
7036,
4672,
309,
761,
30,
1034,
1080,
273,
296,
6051,
761,
67,
350,
273,
738,
87,
11,
4... |
new_mosaic = indxr.get_indexer_mosaic() * 2 indxr.set_indexer_mosaic(new_mosaic) | def _integrate_prepare(self): '''Prepare for integration - note that if there is a reason why this is needed to be run again, set self._intgr_prepare_done as False.''' | 03dcc9d97ebf051784cdaa2bd1b118c8d7d64ec5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3290/03dcc9d97ebf051784cdaa2bd1b118c8d7d64ec5/Mosflm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14970,
5141,
67,
9366,
12,
2890,
4672,
9163,
7543,
364,
12040,
300,
4721,
716,
309,
1915,
353,
279,
3971,
11598,
333,
353,
3577,
358,
506,
1086,
3382,
16,
444,
365,
6315,
474,
3197,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14970,
5141,
67,
9366,
12,
2890,
4672,
9163,
7543,
364,
12040,
300,
4721,
716,
309,
1915,
353,
279,
3971,
11598,
333,
353,
3577,
358,
506,
1086,
3382,
16,
444,
365,
6315,
474,
3197,... | |
def tmpl_create_adminactivities_menu(self, req, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats, activities): | def tmpl_create_adminactivities_menu(self, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats, activities): | def tmpl_create_adminactivities_menu(self, req, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats, activities): """ Returns the main navigation menu with actions based on user's priviledges | f242cf6fed6017cc7e4d09c9612700e9a1e787fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/f242cf6fed6017cc7e4d09c9612700e9a1e787fe/websession_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
2640,
67,
3666,
24745,
67,
5414,
12,
2890,
16,
7211,
16,
3170,
16,
880,
67,
28596,
16,
13051,
16,
2718,
16,
4879,
387,
16,
8884,
1340,
16,
3981,
16,
999,
70,
835,
2413,
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,
10720,
67,
2640,
67,
3666,
24745,
67,
5414,
12,
2890,
16,
7211,
16,
3170,
16,
880,
67,
28596,
16,
13051,
16,
2718,
16,
4879,
387,
16,
8884,
1340,
16,
3981,
16,
999,
70,
835,
2413,
16... |
'simple' : lambda v: dh_noConv( v, u'%dth century' ), | 'simple' : lambda v: multi( v, [ (lambda x: dh_noConv( x, u'%dst century' ), lambda x: x == 1 or (x > 20 and x%10 == 1)), (lambda x: dh_noConv( x, u'%dnd century' ), lambda x: x == 2 or (x > 20 and x%10 == 2)), (lambda x: dh_noConv( x, u'%drd century' ), lambda x: x == 3 or (x > 20 and x%10 == 3)), (lambda x: dh_noConv( x, u'%dth century' ), lambda x: True)]), | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalToDigits) # Convert return dh_noConv( tmp, u'%d' ) else: raise ValueError("string contains regular digits") | eca5b286217783206ef7fe36053a5ca8845bdaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/eca5b286217783206ef7fe36053a5ca8845bdaef/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11007,
67,
21112,
5593,
5072,
12,
460,
262,
30,
309,
618,
12,
1132,
13,
353,
509,
30,
468,
6240,
392,
3571,
460,
1368,
279,
25774,
646,
18,
327,
5252,
12,
1132,
2934,
13929,
24899,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11007,
67,
21112,
5593,
5072,
12,
460,
262,
30,
309,
618,
12,
1132,
13,
353,
509,
30,
468,
6240,
392,
3571,
460,
1368,
279,
25774,
646,
18,
327,
5252,
12,
1132,
2934,
13929,
24899,
211... |
if instance is not None: | if instance._get_pk_val() is None: return getattr(instance, "__%s_save_defered_tags" % self.name, "") elif instance is not None: | def __get__(self, instance, owner=None): """ Tag getter. Returns an instance's tags if accessed on an instance, and all of a model's tags if called on a class. That is, this model:: | 91bb4f7abfb9bbcc538cd88e93eef86afb398f18 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3660/91bb4f7abfb9bbcc538cd88e93eef86afb398f18/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
972,
12,
2890,
16,
791,
16,
3410,
33,
7036,
4672,
3536,
4034,
7060,
18,
2860,
392,
791,
1807,
2342,
309,
15539,
603,
392,
791,
16,
471,
777,
434,
279,
938,
1807,
2342,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
972,
12,
2890,
16,
791,
16,
3410,
33,
7036,
4672,
3536,
4034,
7060,
18,
2860,
392,
791,
1807,
2342,
309,
15539,
603,
392,
791,
16,
471,
777,
434,
279,
938,
1807,
2342,
309,
... |
raise my_error, 'Protocol type not supported' | raise my_error, 'Protocol type %d not supported' % type | def socket(family, type, *which): if family <> AF_INET: raise my_error, 'Protocol family not supported' if type == SOCK_DGRAM: return _udpsocket() elif type == SOCK_STREAM: return _tcpsocket() raise my_error, 'Protocol type not supported' | cd259d0b401f8cdd859bd55167610230d9a44f5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cd259d0b401f8cdd859bd55167610230d9a44f5d/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2987,
12,
9309,
16,
618,
16,
380,
12784,
4672,
309,
6755,
2813,
10888,
67,
18819,
30,
1002,
3399,
67,
1636,
16,
296,
5752,
6755,
486,
3260,
11,
309,
618,
422,
20834,
67,
40,
15370,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2987,
12,
9309,
16,
618,
16,
380,
12784,
4672,
309,
6755,
2813,
10888,
67,
18819,
30,
1002,
3399,
67,
1636,
16,
296,
5752,
6755,
486,
3260,
11,
309,
618,
422,
20834,
67,
40,
15370,
30,... |
'repeat_status':'norepeat' | 'repeat_status': repeat_status or 'norepeat' | def _synch_events(self, cr, uid, data, context={}): | 61f4b759540e3a7de55c6eb8ad3c05e50078812f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/61f4b759540e3a7de55c6eb8ad3c05e50078812f/synchronize_events.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
87,
2515,
67,
5989,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
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,... | [
1,
1,
1,
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,
389,
87,
2515,
67,
5989,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
thumbList+="%s," % thumboffset | thumbList.append(str(thumboffset)) | def createVideoChapters(itemnum, numofchapters, lengthofvideo, getthumbnails): """Returns numofchapters chapter marks even spaced through a certain time period""" # if there are user defined thumb images already available use them infoDOM = xml.dom.minidom.parse(os.path.join(getItemTempPath(itemnum),"info.xml")) thumblistNode = infoDOM.getElementsByTagName("thumblist") if thumblistNode.length > 0: thumblist = getText(thumblistNode[0]) write("Using user defined thumb images - %s" % thumblist) return thumblist # no user defined thumbs so create them segment=int(lengthofvideo / numofchapters) write( "Video length is %s seconds. Each chapter will be %s seconds" % (lengthofvideo,segment)) chapters="" thumbList="" starttime=0 count=1 while count<=numofchapters: chapters+=time.strftime("%H:%M:%S",time.gmtime(starttime)) if starttime==0: if thumboffset < segment: thumbList+="%s," % thumboffset else: thumbList+="%s," % starttime else: thumbList+="%s," % starttime if numofchapters>1: chapters+="," starttime+=segment count+=1 if getthumbnails==True: extractVideoFrames( os.path.join(getItemTempPath(itemnum),"stream.mv2"), os.path.join(getItemTempPath(itemnum),"chapter-%1.jpg"), thumbList) return chapters | 63d3cc2b92e2603f06c88c580763487dd17aad9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13713/63d3cc2b92e2603f06c88c580763487dd17aad9e/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
10083,
782,
1657,
414,
12,
1726,
2107,
16,
818,
792,
343,
1657,
414,
16,
769,
792,
9115,
16,
336,
14904,
87,
4672,
3536,
1356,
818,
792,
343,
1657,
414,
23580,
13999,
5456,
3476,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
10083,
782,
1657,
414,
12,
1726,
2107,
16,
818,
792,
343,
1657,
414,
16,
769,
792,
9115,
16,
336,
14904,
87,
4672,
3536,
1356,
818,
792,
343,
1657,
414,
23580,
13999,
5456,
3476,
... |
p2cread, p2cwrite = CreatePipe(None, 0) | p2cread, p2cwrite = _subprocess.CreatePipe(None, 0) | def _get_handles(self, stdin, stdout, stderr): """Construct and return tuple with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin is None and stdout is None and stderr is None: return (None, None, None, None, None, None) | bfcbec5091d1f60c18c1f9c12171de7a06cc742c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/bfcbec5091d1f60c18c1f9c12171de7a06cc742c/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... |
"""Returns a tuple containing the schemes names.""" | """Return a tuple containing the schemes names.""" | def get_scheme_names(): """Returns a tuple containing the schemes names.""" schemes = list(_INSTALL_SCHEMES.keys()) schemes.sort() return tuple(schemes) | a0d9a87632f213784c78109445042bbefc7884e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/a0d9a87632f213784c78109445042bbefc7884e1/sysconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9068,
67,
1973,
13332,
3536,
990,
279,
3193,
4191,
326,
20436,
1257,
12123,
20436,
273,
666,
24899,
28865,
67,
22870,
55,
18,
2452,
10756,
20436,
18,
3804,
1435,
327,
3193,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9068,
67,
1973,
13332,
3536,
990,
279,
3193,
4191,
326,
20436,
1257,
12123,
20436,
273,
666,
24899,
28865,
67,
22870,
55,
18,
2452,
10756,
20436,
18,
3804,
1435,
327,
3193,
12,
... |
if not Screen.Standby.inStandby: | if not Screens.Standby.inStandby: | def activate(self): next_state = self.state + 1 self.log(5, "activating state %d" % next_state) if next_state == self.StatePrepared: if self.tryPrepare(): self.log(6, "prepare ok, waiting for begin") # fine. it worked, resources are allocated. self.next_activation = self.begin self.backoff = 0 return True self.log(7, "prepare failed") if self.first_try_prepare: self.first_try_prepare = False if not config.recording.asktozap.value: self.log(8, "asking user to zap away") Notifications.AddNotificationWithCallback(self.failureCB, MessageBox, _("A timer failed to record!\nDisable TV and try again?\n"), timeout=20) else: # zap without asking self.log(9, "zap without asking") Notifications.AddNotification(MessageBox, _("In order to record a timer, the TV was switched to the recording service!\n"), type=MessageBox.TYPE_INFO, timeout=20) self.failureCB(True) | d3fd31aeea4a8272671fbe0ccc92c117c48ae5e8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/d3fd31aeea4a8272671fbe0ccc92c117c48ae5e8/RecordTimer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10235,
12,
2890,
4672,
1024,
67,
2019,
273,
365,
18,
2019,
397,
404,
365,
18,
1330,
12,
25,
16,
315,
11422,
1776,
919,
738,
72,
6,
738,
1024,
67,
2019,
13,
225,
309,
1024,
67,
2019,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10235,
12,
2890,
4672,
1024,
67,
2019,
273,
365,
18,
2019,
397,
404,
365,
18,
1330,
12,
25,
16,
315,
11422,
1776,
919,
738,
72,
6,
738,
1024,
67,
2019,
13,
225,
309,
1024,
67,
2019,
... |
print " near end revealCreatures", self | def revealCreatures(self, cnl): """cnl is a list of creature names""" print "revealCreatures for", self, cnl if ((not cnl) or (superset(getCreatureNames(self.getCertainCreatures()), cnl) and (self.allDescendentsCertain()))): print "no new information, exiting" return | d3360650260167e99d819d46c099993d6e0f1f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3755/d3360650260167e99d819d46c099993d6e0f1f9e/predictsplits.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
24293,
1996,
2790,
12,
2890,
16,
6227,
80,
4672,
3536,
10305,
80,
353,
279,
666,
434,
1519,
1231,
1257,
8395,
1172,
315,
266,
24293,
1996,
2790,
364,
3113,
365,
16,
6227,
80,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
24293,
1996,
2790,
12,
2890,
16,
6227,
80,
4672,
3536,
10305,
80,
353,
279,
666,
434,
1519,
1231,
1257,
8395,
1172,
315,
266,
24293,
1996,
2790,
364,
3113,
365,
16,
6227,
80,
309,
... | |
ext_deps = ['Boost']), | ext_deps = ['Boost', 'fftw']), | def _get_internal_lib(env, name): """ Maps internal library name with the information needed to build it """ vehicle_int_deps = ['core', 'pattern','math','logging'] if env.HasFeature('drivers'): vehicle_int_deps.extend(['imu', 'carnetix', 'sensor', 'thruster']) # This delays creation of these until after the module is loaded so the # classes can be at the bottom of the file global INTERNAL_LIBS if INTERNAL_LIBS is None: INTERNAL_LIBS = { 'vision' : InternalLibrary('vision', int_deps = ['pattern', 'core', 'math'], ext_deps = ['OpenCV', 'Boost.Thread', 'Boost.Regex','FANN', 'libdc1394', 'fftw']), 'pattern' : InternalLibrary('pattern', int_deps = [], ext_deps = ['Boost', 'Boost.Thread']), 'core' : InternalLibrary('core', int_deps = [], ext_deps = ['Boost.Thread', 'Boost.Python', 'Boost.Signals', 'Boost.Filesystem', 'Boost.DateTime', 'Boost.System', 'log4cpp']), 'carnetix' : InternalLibrary('carnetix', int_deps = [], ext_deps = ['USB']), 'imu' : InternalLibrary('imu', int_deps = [], ext_deps = []), 'sensor' : InternalLibrary('sensor', int_deps = [], ext_deps = []), 'thruster' : InternalLibrary('thruster', int_deps = [], ext_deps = []), 'bfin_spartan' : InternalLibrary('bfin_spartan', int_deps = [], ext_deps = []), 'math' : InternalLibrary('math', int_deps = [], ext_deps = []), 'sonar' : InternalLibrary('sonar', int_deps = ['math', 'bfin_spartan'], ext_deps = ['Boost']), 'network' : InternalLibrary('network', int_deps = ['core', 'control'], ext_deps = []), 'control' : InternalLibrary('control', int_deps = ['math', 'core', 'vehicle'], ext_deps = []), 'vehicle' : InternalLibrary('vehicle', int_deps = vehicle_int_deps, ext_deps = []), 'logging' : InternalLibrary('logging', int_deps = ['core'], ext_deps = ['Boost.Serialization']), } if INTERNAL_LIBS.has_key(name): return INTERNAL_LIBS[name] else: print 'Could not find internal library named: "%s"' % name print 'Please update "_get_instal_lib" in "buildfiles/libs.py"' sys.exit(1) | dd484d158ee8753175ec6d0beef2791fdd8fa424 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10608/dd484d158ee8753175ec6d0beef2791fdd8fa424/libs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7236,
67,
2941,
12,
3074,
16,
508,
4672,
3536,
19837,
2713,
5313,
508,
598,
326,
1779,
3577,
358,
1361,
518,
3536,
24815,
67,
474,
67,
14877,
273,
10228,
3644,
2187,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7236,
67,
2941,
12,
3074,
16,
508,
4672,
3536,
19837,
2713,
5313,
508,
598,
326,
1779,
3577,
358,
1361,
518,
3536,
24815,
67,
474,
67,
14877,
273,
10228,
3644,
2187,
296,
... |
path = os.path.join(options.results_directory, 'LayoutTests') if os.path.exists(path): shutil.rmtree(path) | meter.update("Clobbering old results in %s" % options.results_directory) layout_tests_dir = path_utils.layout_tests_dir() possible_dirs = os.listdir(layout_tests_dir) for dirname in possible_dirs: if os.path.isdir(os.path.join(layout_tests_dir, dirname)): shutil.rmtree(os.path.join(options.results_directory, dirname), ignore_errors=True) | def main(options, args): """Run the tests. Will call sys.exit when complete. Args: options: a dictionary of command line options args: a list of sub directories or files to test """ if options.sources: options.verbose = True # Set up our logging format. meter = metered_stream.MeteredStream(options.verbose, sys.stderr) log_fmt = '%(message)s' log_datefmt = '%y%m%d %H:%M:%S' log_level = logging.INFO if options.verbose: log_fmt = ('%(asctime)s %(filename)s:%(lineno)-4d %(levelname)s ' '%(message)s') log_level = logging.DEBUG logging.basicConfig(level=log_level, format=log_fmt, datefmt=log_datefmt, stream=meter) if not options.target: if options.debug: options.target = "Debug" else: options.target = "Release" port_obj = port.get(options.platform, options) if not options.use_apache: options.use_apache = sys.platform in ('darwin', 'linux2') if options.results_directory.startswith("/"): # Assume it's an absolute path and normalize. options.results_directory = port_obj.get_absolute_path( options.results_directory) else: # If it's a relative path, make the output directory relative to # Debug or Release. options.results_directory = port_obj.results_directory() if options.clobber_old_results: # Just clobber the actual test results directories since the other # files in the results directory are explicitly used for cross-run # tracking. path = os.path.join(options.results_directory, 'LayoutTests') if os.path.exists(path): shutil.rmtree(path) if not options.num_test_shells: # TODO(ojan): Investigate perf/flakiness impact of using numcores + 1. options.num_test_shells = port_obj.num_cores() write = create_logging_writer(options, 'config') write("Running %s test_shells in parallel" % options.num_test_shells) if not options.time_out_ms: if options.target == "Debug": options.time_out_ms = str(2 * TestRunner.DEFAULT_TEST_TIMEOUT_MS) else: options.time_out_ms = str(TestRunner.DEFAULT_TEST_TIMEOUT_MS) options.slow_time_out_ms = str(5 * int(options.time_out_ms)) write("Regular timeout: %s, slow test timeout: %s" % (options.time_out_ms, options.slow_time_out_ms)) # Include all tests if none are specified. new_args = [] for arg in args: if arg and arg != '': new_args.append(arg) paths = new_args if not paths: paths = [] if options.test_list: paths += read_test_files(options.test_list) # Create the output directory if it doesn't already exist. port_obj.maybe_make_directory(options.results_directory) meter.update("Gathering files ...") test_runner = TestRunner(port_obj, options, meter) test_runner.gather_file_paths(paths) if options.lint_test_files: # Creating the expecations for each platform/target pair does all the # test list parsing and ensures it's correct syntax (e.g. no dupes). for platform in port_obj.test_platform_names(): test_runner.parse_expectations(platform, is_debug_mode=True) test_runner.parse_expectations(platform, is_debug_mode=False) print ("If there are no fail messages, errors or exceptions, then the " "lint succeeded.") sys.exit(0) write = create_logging_writer(options, "config") write("Using port '%s'" % port_obj.name()) write("Placing test results in %s" % options.results_directory) if options.new_baseline: write("Placing new baselines in %s" % port_obj.baseline_path()) write("Using %s build" % options.target) if options.no_pixel_tests: write("Not running pixel tests") write("") meter.update("Parsing expectations ...") test_runner.parse_expectations(port_obj.test_platform_name(), options.target == 'Debug') meter.update("Checking build ...") if not port_obj.check_build(test_runner.needs_http()): sys.exit(1) meter.update("Starting helper ...") port_obj.start_helper() # Check that the system dependencies (themes, fonts, ...) are correct. if not options.nocheck_sys_deps: meter.update("Checking system dependencies ...") if not port_obj.check_sys_deps(test_runner.needs_http()): sys.exit(1) meter.update("Preparing tests ...") write = create_logging_writer(options, "expected") result_summary = test_runner.prepare_lists_and_print_output(write) port_obj.setup_test_run() test_runner.add_test_type(text_diff.TestTextDiff) if not options.no_pixel_tests: test_runner.add_test_type(image_diff.ImageDiff) if options.fuzzy_pixel_tests: test_runner.add_test_type(fuzzy_image_diff.FuzzyImageDiff) has_new_failures = test_runner.run(result_summary) port_obj.stop_helper() _log.debug("Exit status: %d" % has_new_failures) sys.exit(has_new_failures) | 6fb7798d58291b1bd5c86c237139611669096757 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/6fb7798d58291b1bd5c86c237139611669096757/run_webkit_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
3536,
1997,
326,
7434,
18,
225,
9980,
745,
2589,
18,
8593,
1347,
3912,
18,
225,
6634,
30,
702,
30,
279,
3880,
434,
1296,
980,
702,
833,
30,
279,
666,
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,
2774,
12,
2116,
16,
833,
4672,
3536,
1997,
326,
7434,
18,
225,
9980,
745,
2589,
18,
8593,
1347,
3912,
18,
225,
6634,
30,
702,
30,
279,
3880,
434,
1296,
980,
702,
833,
30,
279,
666,
4... |
self.hboxlayout36.addWidget(self.min_options_label_4) | self.hboxlayout34.addWidget(self.min_options_label_4) | def setupUi(self, UserPrefsDialog): UserPrefsDialog.setObjectName("UserPrefsDialog") UserPrefsDialog.resize(QtCore.QSize(QtCore.QRect(0,0,917,661).size()).expandedTo(UserPrefsDialog.minimumSizeHint())) | 752b48c67dcf97437d2cb83fa267b09487665da0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/752b48c67dcf97437d2cb83fa267b09487665da0/UserPrefsDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
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,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
18,... |
argv = argv or list(sys.argv[1:]) | if argv is not None: argv = argv else: argv = list(sys.argv[1:]) | def main(argv=None, **kwargs): """Shell interface to :mod:`migrate.versioning.api`. kwargs are default options that can be overriden with passing --some_option as command line option :param disable_logging: Let migrate configure logging :type disable_logging: bool """ argv = argv or list(sys.argv[1:]) commands = list(api.__all__) commands.sort() usage = """%%prog COMMAND ... Available commands: %s Enter "%%prog help COMMAND" for information on a particular command. """ % '\n\t'.join(["%s - %s" % (command.ljust(28), api.command_desc.get(command)) for command in commands]) parser = PassiveOptionParser(usage=usage) parser.add_option("-d", "--debug", action="store_true", dest="debug", default=False, help="Shortcut to turn on DEBUG mode for logging") parser.add_option("-q", "--disable_logging", action="store_true", dest="disable_logging", default=False, help="Use this option to disable logging configuration") help_commands = ['help', '-h', '--help'] HELP = False try: command = argv.pop(0) if command in help_commands: HELP = True command = argv.pop(0) except IndexError: parser.print_help() return command_func = getattr(api, command, None) if command_func is None or command.startswith('_'): parser.error("Invalid command %s" % command) parser.set_usage(inspect.getdoc(command_func)) f_args, f_varargs, f_kwargs, f_defaults = inspect.getargspec(command_func) for arg in f_args: parser.add_option( "--%s" % arg, dest=arg, action='store', type="string") # display help of the current command if HELP: parser.print_help() return options, args = parser.parse_args(argv) # override kwargs with anonymous parameters override_kwargs = dict() for arg in list(args): if arg.startswith('--'): args.remove(arg) if '=' in arg: opt, value = arg[2:].split('=', 1) else: opt = arg[2:] value = True override_kwargs[opt] = value # override kwargs with options if user is overwriting for key, value in options.__dict__.iteritems(): if value is not None: override_kwargs[key] = value # arguments that function accepts without passed kwargs f_required = list(f_args) candidates = dict(kwargs) candidates.update(override_kwargs) for key, value in candidates.iteritems(): if key in f_args: f_required.remove(key) # map function arguments to parsed arguments for arg in args: try: kw = f_required.pop(0) except IndexError: parser.error("Too many arguments for command %s: %s" % (command, arg)) kwargs[kw] = arg # apply overrides kwargs.update(override_kwargs) # configure options for key, value in options.__dict__.iteritems(): kwargs.setdefault(key, value) # configure logging if not asbool(kwargs.pop('disable_logging', False)): # filter to log =< INFO into stdout and rest to stderr class SingleLevelFilter(logging.Filter): def __init__(self, min=None, max=None): self.min = min or 0 self.max = max or 100 def filter(self, record): return self.min <= record.levelno <= self.max logger = logging.getLogger() h1 = logging.StreamHandler(sys.stdout) f1 = SingleLevelFilter(max=logging.INFO) h1.addFilter(f1) h2 = logging.StreamHandler(sys.stderr) f2 = SingleLevelFilter(min=logging.WARN) h2.addFilter(f2) logger.addHandler(h1) logger.addHandler(h2) if options.debug: logger.setLevel(logging.DEBUG) else: logger.setLevel(logging.INFO) log = logging.getLogger(__name__) # check if all args are given try: num_defaults = len(f_defaults) except TypeError: num_defaults = 0 f_args_default = f_args[len(f_args) - num_defaults:] required = list(set(f_required) - set(f_args_default)) if required: parser.error("Not enough arguments for command %s: %s not specified" \ % (command, ', '.join(required))) # handle command try: ret = command_func(**kwargs) if ret is not None: log.info(ret) except (exceptions.UsageError, exceptions.KnownError), e: parser.error(e.args[0]) | dac9e2d252a5e307485393124d5674df055ab574 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9035/dac9e2d252a5e307485393124d5674df055ab574/shell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
7036,
16,
2826,
4333,
4672,
3536,
13220,
1560,
358,
294,
1711,
28288,
22083,
18,
1589,
310,
18,
2425,
8338,
225,
1205,
854,
805,
702,
716,
848,
506,
31736,
598,
9588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
7036,
16,
2826,
4333,
4672,
3536,
13220,
1560,
358,
294,
1711,
28288,
22083,
18,
1589,
310,
18,
2425,
8338,
225,
1205,
854,
805,
702,
716,
848,
506,
31736,
598,
9588... |
assert os.path.isfile(self.path_utility) | assert op.isfile(self.path_utility) | def process_args(self, pre_processed_args): command_line = pre_processed_args.command_line for path in pre_processed_args.repository_paths: self.add_repository(path=path) module_names = [] for module_name in command_line.args: if (len(module_name) == 0): continue # ignore arguments like "" if (module_name == ".."): raise Sorry('Invalid module name: ".."') if (module_name == "."): module_name = "libtbx" if (module_name in self.command_line_redirections): del self.command_line_redirections[module_name] elif (module_name.count("=") == 1 and self.find_dist_path(module_name, optional=True) is None): module_name, redirection = module_name.split("=") dist_path = self.abs_path_clean(os.path.expandvars(redirection)) if (not os.path.isdir(dist_path)): raise Sorry( 'Invalid command line redirection:\n' ' module name = "%s"\n' ' redirection = "%s"\n' ' resulting target = "%s"' % ( module_name, redirection, dist_path)) self.command_line_redirections[module_name] = dist_path module_names.append(module_name) if (pre_processed_args.warm_start): if (not command_line.options.only): for module in self.module_list: module_names.append(module.name) else: self.build_options = build_options( compiler=command_line.options.compiler, mode=command_line.options.build, warning_level=command_line.options.warning_level, static_libraries=command_line.options.static_libraries, static_exe=command_line.options.static_exe, scan_boost=command_line.options.scan_boost, write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h, boost_python_no_py_signatures =command_line.options.boost_python_no_py_signatures, boost_python_bool_int_strict =command_line.options.boost_python_bool_int_strict, enable_boost_threads=command_line.options.enable_boost_threads, enable_openmp_if_possible =command_line.options.enable_openmp_if_possible, precompile_headers=command_line.options.precompile_headers, use_environment_flags=command_line.options.use_environment_flags, force_32bit=command_line.options.force_32bit, msvc_arch_flag=command_line.options.msvc_arch_flag) self.build_options.get_flags_from_environment() if (command_line.options.command_version_suffix is not None): self.command_version_suffix = \ command_line.options.command_version_suffix self.write_command_version_suffix() if (command_line.options.build_boost_python_extensions is not None): self.build_options.build_boost_python_extensions \ = command_line.options.build_boost_python_extensions self.reset_module_registry() module_names.append("libtbx") module_names.reverse() for module_name in module_names: self.process_module( dependent_module=None, module_name=module_name, optional=False) self.scons_dist_path = self.find_dist_path("scons", optional=True) self.path_utility = self.under_dist( "libtbx", "command_line/path_utility.py") assert os.path.isfile(self.path_utility) | 621ff93ea6f104ac4c6d943d7e9d6c18b1468502 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/621ff93ea6f104ac4c6d943d7e9d6c18b1468502/env_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1968,
12,
2890,
16,
675,
67,
11005,
67,
1968,
4672,
1296,
67,
1369,
273,
675,
67,
11005,
67,
1968,
18,
3076,
67,
1369,
364,
589,
316,
675,
67,
11005,
67,
1968,
18,
9071,
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,
1207,
67,
1968,
12,
2890,
16,
675,
67,
11005,
67,
1968,
4672,
1296,
67,
1369,
273,
675,
67,
11005,
67,
1968,
18,
3076,
67,
1369,
364,
589,
316,
675,
67,
11005,
67,
1968,
18,
9071,
67... |
request.disableHttpCaching(level=2) request.emit_http_headers() | def sendEditor(self, **kw): """ Send the editor form page. | af0865b22217e68c1647659108bb5fe788965aa5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/af0865b22217e68c1647659108bb5fe788965aa5/PageEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
6946,
12,
2890,
16,
2826,
9987,
4672,
3536,
2479,
326,
4858,
646,
1363,
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,
... | [
1,
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,
1366,
6946,
12,
2890,
16,
2826,
9987,
4672,
3536,
2479,
326,
4858,
646,
1363,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
c = self.tk.call(self._w, 'info', 'children', entry) return self.tk.splitlist(c) | c = self.tk.call(self._w, 'info', 'children', entry) return self.tk.splitlist(c) | def info_children(self, entry=None): | 86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
67,
5906,
12,
2890,
16,
1241,
33,
7036,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
67,
5906,
12,
2890,
16,
1241,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print " set turnout IT:xPA:xAPBSC:"+fmtMsg.getSource()+" to", value | print " set turnout IT:xAP:xAPBSC:"+fmtMsg.getSource()+" to", value | def processTurnout(self, fmtMsg, message) : pair = fmtMsg.getNameValuePair("output.state","Name") if (pair == None) : print "No Name" name = None else : name = pair.getValue() print " Name:", name pair = fmtMsg.getNameValuePair("output.state","Location") if (pair == None) : print "No Location" location = None else : location = pair.getValue() print " Location: ", location pair = fmtMsg.getNameValuePair("output.state","State") if (pair == None) : print "No State, ending" return state = pair.getValue().upper() print " State: ", state # now create a Turnout and set value = CLOSED if (state == "ON") : value = THROWN turnout = turnouts.getTurnout("IT:xPA:xAPBSC:"+fmtMsg.getSource()) if (turnout == None) : print " create turnout IT:xPA:xAPBSC:"+fmtMsg.getSource() turnout = turnouts.provideTurnout("IT:xPA:xAPBSC:"+fmtMsg.getSource()) if (name != None) : turnout.setUserName(name) turnout.setCommandedState(value) print " set turnout IT:xPA:xAPBSC:"+fmtMsg.getSource()+" to", value return | e66707072f64fc5d902edd5fc95c50f3a22429c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2146/e66707072f64fc5d902edd5fc95c50f3a22429c3/xAPadapter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
15858,
659,
12,
2890,
16,
1325,
3332,
16,
883,
13,
294,
3082,
273,
1325,
3332,
18,
17994,
20337,
2932,
2844,
18,
2019,
15937,
461,
7923,
309,
261,
6017,
422,
599,
13,
294,
1172,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15858,
659,
12,
2890,
16,
1325,
3332,
16,
883,
13,
294,
3082,
273,
1325,
3332,
18,
17994,
20337,
2932,
2844,
18,
2019,
15937,
461,
7923,
309,
261,
6017,
422,
599,
13,
294,
1172,
... |
sym_dest.symlink(sym_source.path) sym_dest.setdata() assert sym_dest.issym() orig_umask = os.umask(077) if sym_dest.getperms() == 0700: self.symlink_perms = 1 else: self.symlink_perms = 0 os.umask(orig_umask) sym_dest.delete() | try: sym_dest.symlink(sym_source.path) except (OSError): self.symlink_perms = 0 else: sym_dest.setdata() assert sym_dest.issym() orig_umask = os.umask(077) if sym_dest.getperms() == 0700: self.symlink_perms = 1 else: self.symlink_perms = 0 os.umask(orig_umask) sym_dest.delete() | def set_symlink_perms(self, dir_rp): """Test if symlink permissions are affected by umask""" sym_source = dir_rp.append("symlinked_file1") sym_source.touch() sym_dest = dir_rp.append("symlinked_file2") sym_dest.symlink(sym_source.path) sym_dest.setdata() assert sym_dest.issym() orig_umask = os.umask(077) if sym_dest.getperms() == 0700: self.symlink_perms = 1 else: self.symlink_perms = 0 os.umask(orig_umask) sym_dest.delete() sym_source.delete() | 9f0fcbbfd8870dad13c0557ad1619ae7be406e9c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8033/9f0fcbbfd8870dad13c0557ad1619ae7be406e9c/fs_abilities.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
21278,
67,
15969,
12,
2890,
16,
1577,
67,
13832,
4672,
3536,
4709,
309,
10563,
4371,
854,
9844,
635,
22691,
8395,
5382,
67,
3168,
273,
1577,
67,
13832,
18,
6923,
2932,
21278,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
21278,
67,
15969,
12,
2890,
16,
1577,
67,
13832,
4672,
3536,
4709,
309,
10563,
4371,
854,
9844,
635,
22691,
8395,
5382,
67,
3168,
273,
1577,
67,
13832,
18,
6923,
2932,
21278,
32... |
js_is_ok=False | js_is_ok = False | def findMatchedJobs(self, constraint): """ _findMatchedJobs_ | 13e1427903eb8f858c07db082bf2a1862b744b31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8887/13e1427903eb8f858c07db082bf2a1862b744b31/LCGAdvanced.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
15400,
7276,
12,
2890,
16,
4954,
4672,
3536,
389,
4720,
15400,
7276,
67,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
1104,
15400,
7276,
12,
2890,
16,
4954,
4672,
3536,
389,
4720,
15400,
7276,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def __init__( self, user_proxy = '' ): | def __init__( self, **args): | def __init__( self, user_proxy = '' ): | 64820295d33af32bc53aa56cb208ebf1f01c95c0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/64820295d33af32bc53aa56cb208ebf1f01c95c0/SchedulerLsf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
729,
67,
5656,
273,
875,
262,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
729,
67,
5656,
273,
875,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if isinstance(n,Network) and not n.__class__.__name__=='CCMModelNetwork': | if n.__class__.__name__=='NetworkImpl': | def initialize(self,network): for n in network.nodes: if isinstance(n,Network) and not n.__class__.__name__=='CCMModelNetwork': self.initialize(n) else: self.nodes.append(n) | f53a78e2b2c975d8de1412b1a1d0c9eb33e46d68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9336/f53a78e2b2c975d8de1412b1a1d0c9eb33e46d68/simulator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
5185,
4672,
364,
290,
316,
2483,
18,
4690,
30,
309,
290,
16186,
1106,
972,
16186,
529,
972,
18920,
3906,
2828,
4278,
225,
365,
18,
11160,
12,
82,
13,
469,
30,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
5185,
4672,
364,
290,
316,
2483,
18,
4690,
30,
309,
290,
16186,
1106,
972,
16186,
529,
972,
18920,
3906,
2828,
4278,
225,
365,
18,
11160,
12,
82,
13,
469,
30,
365,
... |
self.busy = False self._event = threading.Event() self._event.wait() self.run() | self.busy = False if self._event is None: self._event = threading.Event() else: self._event.clear() self._event.wait() | def run(self): self.busy = True while len(self.pool._tasks) > 0: try: task = self.pool._tasks.pop() task() except IndexError: # Just in case another thread grabbed the task 1st. pass | c49e14e0b461499b6f283382c59e811178f741a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5028/c49e14e0b461499b6f283382c59e811178f741a6/thread_pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
9274,
93,
273,
1053,
1323,
562,
12,
2890,
18,
6011,
6315,
9416,
13,
405,
374,
30,
775,
30,
1562,
273,
365,
18,
6011,
6315,
9416,
18,
5120,
1435,
1562,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
12,
2890,
4672,
365,
18,
9274,
93,
273,
1053,
1323,
562,
12,
2890,
18,
6011,
6315,
9416,
13,
405,
374,
30,
775,
30,
1562,
273,
365,
18,
6011,
6315,
9416,
18,
5120,
1435,
1562,
... |
if isinstance(d, tuple([list,tuple])): | if isinstance(d, tuple([list, tuple])): | def state_array(self, d=None): """ Convert the parameter to a state array. | e506ccc2459e6e3948659b0d1b28d9d6b70342e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e506ccc2459e6e3948659b0d1b28d9d6b70342e4/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
919,
67,
1126,
12,
2890,
16,
302,
33,
7036,
4672,
3536,
4037,
326,
1569,
358,
279,
919,
526,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
919,
67,
1126,
12,
2890,
16,
302,
33,
7036,
4672,
3536,
4037,
326,
1569,
358,
279,
919,
526,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
result = self.getUserGroupIds( userName, userGroup, False ) | result = self.getUserGroupIds( userName, userGroup ) | def retrieveVarPerms( self, userName, userGroup, ownerName, ownerGroup, profileName, varName, connObj = False ): result = self.getUserGroupIds( userName, userGroup, False ) if not result[ 'OK' ]: return result userIds = result[ 'Value' ] | 32f511a0ee97cfef6eadebaeecf554691d9cab23 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/32f511a0ee97cfef6eadebaeecf554691d9cab23/UserProfileDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4614,
1537,
27256,
12,
365,
16,
12065,
16,
26205,
16,
3410,
461,
16,
3410,
1114,
16,
3042,
461,
16,
13722,
16,
1487,
2675,
273,
1083,
262,
30,
563,
273,
365,
18,
588,
21255,
2673,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4614,
1537,
27256,
12,
365,
16,
12065,
16,
26205,
16,
3410,
461,
16,
3410,
1114,
16,
3042,
461,
16,
13722,
16,
1487,
2675,
273,
1083,
262,
30,
563,
273,
365,
18,
588,
21255,
2673,
12,
... |
minlocator = TimeSeries_DateLocator(self.freqstr, dynamic_mode=True, | minlocator = TimeSeries_DateLocator(self.freq, dynamic_mode=True, | def format_dateaxis(self,maj_spacing=None, min_spacing=None, strformat="%Y", rotate=True): """Pretty-formats the date axis (x-axis). | 4112b0479c1d88be72e39db02bd49cdabdc15a77 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/4112b0479c1d88be72e39db02bd49cdabdc15a77/mpl_timeseries_pgm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
712,
4890,
12,
2890,
16,
12585,
67,
14080,
33,
7036,
16,
1131,
67,
14080,
33,
7036,
16,
609,
2139,
11613,
61,
3113,
8534,
33,
5510,
4672,
3536,
20491,
17,
11962,
326,
1509,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
712,
4890,
12,
2890,
16,
12585,
67,
14080,
33,
7036,
16,
1131,
67,
14080,
33,
7036,
16,
609,
2139,
11613,
61,
3113,
8534,
33,
5510,
4672,
3536,
20491,
17,
11962,
326,
1509,
26... |
tmpDQSeg=self.resultList | def fetchInformation(self,triggerTime=None,window=300,version=99): """ This method is responsible for queries to the data server. The results of the query become an internal list that can be converted into an HTML table. The arguments allow you to query with trigger time of interest and to change the window with each call if desired. The version argument will fetch segments with that version or higher. """ if triggerTime==int(-1): os.stdout.write("Specify trigger time please.\n") return else: self.triggerTime = int(triggerTime) try: connection=None serverURL=self.serverURL.strip("ldbd://") connection=segmentdb_utils.setup_database(serverURL) except Exception, errMsg: sys.stderr.write("Error connection to %s\n"\ %(serverURL)) sys.stderr.write("Error Message :\t %s\n"%(str(errMsg))) self.resultList=list() return try: engine=query_engine.LdbdQueryEngine(connection) gpsEnd=int(triggerTime)+int(window) gpsStart=int(triggerTime)-int(window) sqlString=self.dqvQuery%(version,gpsEnd,gpsStart) queryResult=engine.query(sqlString) self.resultList=queryResult except Exception, errMsg: sys.stderr.write("Query failed %s \n"%(self.serverURL)) sys.stdout.write("Error fetching query results at %s.\n"%(triggerTime)) sys.stderr.write("Error message seen: %s\n"%(str(errMsg))) sys.stderr.write("Query Tried: \n %s \n"%(sqlString)) return engine.close() #Coalesce the segments for each DQ flag #Reparse the information tmpDQSeg=self.resultList newDQSeg=list() if tmpDQSeg.__len__() > 0: #Obtain list of all flags uniqSegmentName=list() for ifo,name,version,start,end in tmpDQSeg: if not uniqSegmentName.__contains__((ifo,name,version)): uniqSegmentName.append((ifo,name,version)) #Save textKey for all uniq segments combos for uifo,uname,uversion in uniqSegmentName: segmentIntervals=list() #Extra segments based on uniq textKey for ifo,name,version,start,end in tmpDQSeg: if (uifo,uname,uversion)==(ifo,name,version): segmentIntervals.append((start,end)) segmentIntervals.sort() #Coalesce those segments newStyle=bool(True) if newStyle: newSegmentIntervals=self.__merge__(segmentIntervals) else: newSegmentIntervals=segmentIntervals #Write them to the object which we will return for newStart,newStop in newSegmentIntervals: newDQSeg.append([uifo,uname,uversion,newStart,newStop]) del segmentIntervals #Save the final result self.resultList=newDQSeg.sort() | 3684fe51b66eea122e194da773554d201e0ff5c9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/3684fe51b66eea122e194da773554d201e0ff5c9/fu_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
5369,
12,
2890,
16,
10668,
950,
33,
7036,
16,
5668,
33,
19249,
16,
1589,
33,
2733,
4672,
3536,
1220,
707,
353,
14549,
364,
6218,
358,
326,
501,
1438,
18,
225,
1021,
1686,
434,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
5369,
12,
2890,
16,
10668,
950,
33,
7036,
16,
5668,
33,
19249,
16,
1589,
33,
2733,
4672,
3536,
1220,
707,
353,
14549,
364,
6218,
358,
326,
501,
1438,
18,
225,
1021,
1686,
434,
32... | |
log.debug("guess: %s"%path) | def guess(self, path): log.debug("guess: %s"%path) if path and path in self.path_vcs_map: log.debug("Cached Answer:%s"%self.path_vcs_map[path]) return self.path_vcs_map[path] | d40ad4963e564851e8471c100e250a8f22162c3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/d40ad4963e564851e8471c100e250a8f22162c3c/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
12,
2890,
16,
589,
4672,
309,
589,
471,
589,
316,
365,
18,
803,
67,
18982,
67,
1458,
30,
613,
18,
4148,
2932,
9839,
21019,
5319,
87,
28385,
2890,
18,
803,
67,
18982,
67,
1458,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
12,
2890,
16,
589,
4672,
309,
589,
471,
589,
316,
365,
18,
803,
67,
18982,
67,
1458,
30,
613,
18,
4148,
2932,
9839,
21019,
5319,
87,
28385,
2890,
18,
803,
67,
18982,
67,
1458,
... | |
class GetGLcharHandler(GLcharHandler): """Handler for glGetAttibLoc, glGetUniformLoc.""" def __init__(self): GLcharHandler.__init__(self) def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name) def WriteImmediateServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): %s\n\n" % func.name) def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() all_but_last_arg = func.GetOriginalArgs() for arg in all_but_last_arg: arg.WriteGetCode(file) file.Write(" uint32 name_size = c.data_size;\n") file.Write(" const char* name = GetSharedMemoryAs<%s>(\n" % last_arg.type) file.Write(" c.%s_shm_id, c.%s_shm_offset, name_size);\n" % (last_arg.name, last_arg.name)) file.Write(" GLint* location = GetSharedMemoryAs<GLint*>(\n") file.Write( " c.location_shm_id, c.location_shm_offset, sizeof(*location));\n") file.Write(" // TODO(gman): Validate location.\n") func.WriteHandlerValidation(file) arg_string = ", ".join(["%s" % arg.name for arg in all_but_last_arg]) file.Write(" String name_str(name, name_size);\n") file.Write(" *location = %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteImmediateServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() all_but_last_arg = func.GetOriginalArgs()[:-1] for arg in all_but_last_arg: arg.WriteGetCode(file) file.Write(" uint32 name_size = c.data_size;\n") file.Write( " const char* name = GetImmediateDataAs<const char*>(\n") file.Write(" c, name_size, immediate_data_size);\n") file.Write(" GLint* location = GetSharedMemoryAs<GLint*>(\n") file.Write( " c.location_shm_id, c.location_shm_offset, sizeof(*location));\n") file.Write(" // TODO(gman): Validate location.\n") func.WriteHandlerValidation(file) arg_string = ", ".join(["%s" % arg.name for arg in all_but_last_arg]) file.Write(" String name_str(name, name_size);\n") file.Write(" *location = %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" // TODO(gman): This needs to change to use SendString.\n") file.Write(" GLint* result = shared_memory_.GetAddressAs<GLint*>(0);\n") file.Write(" DCHECK(false); // pass in shared memory\n") file.Write(" helper_->%sImmediate(%s);\n" % (func.name, func.MakeOriginalArgString(""))) file.Write(" int32 token = helper_->InsertToken();\n") file.Write(" helper_->WaitForToken(token);\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") def WriteImmediateCmdComputeSize(self, func, file): """Overrriden from TypeHandler.""" file.Write(" static uint32 ComputeDataSize(const char* s) {\n") file.Write(" return strlen(s);\n") file.Write(" }\n") file.Write("\n") file.Write(" static uint32 ComputeSize(const char* s) {\n") file.Write(" return static_cast<uint32>(\n") file.Write(" sizeof(ValueType) + ComputeDataSize(s)); // NOLINT\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdSetHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void SetHeader(const char* s) {\n") file.Write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(s));\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdInit(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void Init(%s) {\n" % func.MakeTypedInitString("_")) file.Write(" SetHeader(_name);\n") args = func.GetInitArgs() for arg in args: file.Write(" %s = _%s;\n" % (arg.name, arg.name)) file.Write(" data_size = ComputeDataSize(_name);\n") file.Write(" memcpy(ImmediateDataAddress(this), _name, data_size);\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdSet(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void* Set(void* cmd%s) {\n" % func.MakeTypedInitString("_", True)) file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" % func.MakeInitString("_")) file.Write(" const uint32 size = ComputeSize(_name);\n") file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>(" "cmd, size);\n") file.Write(" }\n") file.Write("\n") def WriteImmediateCmdHelper(self, func, file): """Overrriden from TypeHandler.""" file.Write(" void %s(%s) {\n" % (func.name, func.MakeTypedCmdArgString(""))) file.Write(" const uint32 size = gles2::%s::ComputeSize(name);\n" % func.name) file.Write(" gles2::%s& c = GetImmediateCmdSpaceTotalSize<gles2::%s>(" "size);\n" % (func.name, func.name)) file.Write(" c.Init(%s);\n" % func.MakeCmdArgString("")) file.Write(" }\n\n") def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" int8 buf[256] = { 0, };\n") file.Write(" %s& cmd = *static_cast<%s*>(static_cast<void*>(&buf));\n" % (func.name, func.name)) file.Write(" static const char* const test_str = \"test string\";\n") file.Write(" void* next_cmd = cmd.Set(\n") file.Write(" &cmd") all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: file.Write(",\n static_cast<%s>(%d)" % (arg.type, value)) value += 1 file.Write(",\n test_str);\n") value = 11 file.Write(" EXPECT_EQ(%s::kCmdId ^ cmd.header.command);\n" % func.name) file.Write(" EXPECT_EQ(sizeof(cmd)\n") file.Write(" RoundSizeToMultipleOfEntries(strlen(test_str)),\n") file.Write(" cmd.header.size * 4u);\n") file.Write(" EXPECT_EQ(static_cast<char*>(next_cmd),\n") file.Write(" reinterpret_cast<char*>(&cmd) + sizeof(cmd));\n"); for arg in all_but_last_arg: file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % (arg.type, value, arg.name)) value += 1 file.Write(" // TODO(gman): check that string got copied.\n") file.Write("}\n") file.Write("\n") | def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" init_code = [] check_code = [] all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: init_code.append(" static_cast<%s>(%d)," % (arg.type, value)) value += 1 value = 11 for arg in all_but_last_arg: check_code.append(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);" % (arg.type, value, arg.name)) value += 1 code = """ | a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
1208,
67,
710,
273,
5378,
866,
67,
710,
273,
5378,
777,
67,
12885,
67,
2722,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
1208,
67,
710,
273,
5378,
866,
67,
710,
273,
5378,
777,
67,
12885,
67,
2722,
... | |
pat = self.wordsep_simple_re chunks = re.compile(pat, flags).split(text) | if self.break_on_hyphens: pat = self.wordsep_re else: pat = self.wordsep_simple_re chunks = pat.split(text) | def _split(self, text): """_split(text : string) -> [string] | 5664215008b618184b54dc8e529a6bad829e0cf7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/5664215008b618184b54dc8e529a6bad829e0cf7/textwrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
12,
2890,
16,
977,
4672,
3536,
67,
4939,
12,
955,
294,
533,
13,
317,
306,
1080,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
12,
2890,
16,
977,
4672,
3536,
67,
4939,
12,
955,
294,
533,
13,
317,
306,
1080,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print('port=%d\n' % server.getPort()) | print('port=%d' % server.getPort()) server.start() server.wait_ready() printf('\n') | def main(): try: server = GDAL_ThreadedHttpServer(GDAL_Handler) print('port=%d\n' % server.getPort()) sys.stdout.flush() server.run_server(60) except: print('port=0\n') sys.stdout.flush() | bc24d5b8548ad547bddde898bc78b21b8b55abad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10289/bc24d5b8548ad547bddde898bc78b21b8b55abad/webserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
775,
30,
1438,
273,
30176,
1013,
67,
1315,
20528,
2940,
2081,
12,
27338,
1013,
67,
1503,
13,
1172,
2668,
655,
5095,
72,
11,
738,
1438,
18,
588,
2617,
10756,
1438,
18,
1937,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
775,
30,
1438,
273,
30176,
1013,
67,
1315,
20528,
2940,
2081,
12,
27338,
1013,
67,
1503,
13,
1172,
2668,
655,
5095,
72,
11,
738,
1438,
18,
588,
2617,
10756,
1438,
18,
1937,
... |
octets.extend((0,) * (d - len(octets) + 1)) | octets.extend([0] * (d - len(octets) + 1)) | def prettyIn(self, bits): if type(bits) == types.StringType: return bits # raw bitstring octets = [] for bit in bits: # tuple of named bits v = self.__namedValues.getValue(bit) if v is None: raise error.ProtocolError( 'Unknown named bit %s' % bit ) d, m = divmod(v, 8) if d >= len(octets): octets.extend((0,) * (d - len(octets) + 1)) octets[d] = octets[d] | 0x01 << (7-m) return string.join(map(lambda x: chr(x), octets)) | 0b9e3121d898ebd3af99eb063d37b5e6e8e1ef94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/587/0b9e3121d898ebd3af99eb063d37b5e6e8e1ef94/rfc1902.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7517,
382,
12,
2890,
16,
4125,
4672,
309,
618,
12,
6789,
13,
422,
1953,
18,
780,
559,
30,
327,
4125,
468,
1831,
2831,
1080,
25497,
273,
5378,
364,
2831,
316,
4125,
30,
468,
3193,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7517,
382,
12,
2890,
16,
4125,
4672,
309,
618,
12,
6789,
13,
422,
1953,
18,
780,
559,
30,
327,
4125,
468,
1831,
2831,
1080,
25497,
273,
5378,
364,
2831,
316,
4125,
30,
468,
3193,
434,
... |
self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() | if self.dim() == 0: self._points = self._vertices else: self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() | def points(self): r""" Return all lattice points of this polytope as columns of a matrix. EXAMPLES: The lattice points of the 3-dimensional octahedron and its polar cube:: sage: o = lattice_polytope.octahedron(3) sage: o.points() [ 1 0 0 -1 0 0 0] [ 0 1 0 0 -1 0 0] [ 0 0 1 0 0 -1 0] sage: cube = o.polar() sage: cube.points() [-1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 1 1] [-1 -1 1 1 -1 -1 1 1 -1 0 0 0 1 -1 -1 -1 0 0 0 1 1 1 -1 0 0 0 1] [ 1 1 1 1 -1 -1 -1 -1 0 -1 0 1 0 -1 0 1 -1 0 1 -1 0 1 0 -1 0 1 0] Lattice points of a 2-dimensional diamond in a 3-dimensional space:: sage: m = matrix(ZZ, [[1, 0, -1, 0], ... [0, 1, 0, -1], ... [0, 0, 0, 0]]) ... sage: p = LatticePolytope(m) sage: p.points() [ 1 0 -1 0 0] [ 0 1 0 -1 0] [ 0 0 0 0 0] """ if not hasattr(self, "_points"): self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() return self._points | 1e32c87292a64b8e757d598e6aedb433fe42c99d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1e32c87292a64b8e757d598e6aedb433fe42c99d/lattice_polytope.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3143,
12,
2890,
4672,
436,
8395,
2000,
777,
16690,
3143,
434,
333,
7573,
869,
347,
487,
2168,
434,
279,
3148,
18,
225,
5675,
8900,
11386,
30,
1021,
16690,
3143,
434,
326,
890,
17,
31236,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3143,
12,
2890,
4672,
436,
8395,
2000,
777,
16690,
3143,
434,
333,
7573,
869,
347,
487,
2168,
434,
279,
3148,
18,
225,
5675,
8900,
11386,
30,
1021,
16690,
3143,
434,
326,
890,
17,
31236,... |
def show(obj, property=None, frame=0): | def show(obj, property=None, frame=0, window_id=None): """Show obj in the default AtomEye view""" | def show(obj, property=None, frame=0): global view if view is None: if views.keys(): view = views[views.keys()[0]] view.show(obj, property, frame) else: view = AtomEyeView(obj, property=property, frame=frame) else: view.show(obj, property, frame) return view | bf5003eb8d198661fa67a10984ec3567869ae6e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8914/bf5003eb8d198661fa67a10984ec3567869ae6e7/atomeye.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2603,
16,
1272,
33,
7036,
16,
2623,
33,
20,
16,
2742,
67,
350,
33,
7036,
4672,
3536,
5706,
1081,
316,
326,
805,
7149,
41,
20513,
1476,
8395,
2552,
1476,
225,
309,
1476,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2603,
16,
1272,
33,
7036,
16,
2623,
33,
20,
16,
2742,
67,
350,
33,
7036,
4672,
3536,
5706,
1081,
316,
326,
805,
7149,
41,
20513,
1476,
8395,
2552,
1476,
225,
309,
1476,
353,
... |
6.2239725530250970363983975962696997888173850098274602272589e-73 + (-3.5271062035449946049211903242820246129524508593200000161038e-73)*z + 0.75931650028842677023019260789472201907809751649492435158581*z^2 + O(z^3) | 6.2239725530250970363983975962696997888173850098274602272589e-73 + (-3.527106203544994604921190324282024612952450859320...e-73)*z + 0.75931650028842677023019260789472201907809751649492435158581*z^2 + O(z^3) | def taylor_series(self, a=0, k=6, var='z'): """ Return the first k terms of the Taylor series expansion of the $L$-series about $a$. | 3337d32ebf42911e81f26dab45c63b92ac275938 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3337d32ebf42911e81f26dab45c63b92ac275938/dokchitser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
528,
80,
280,
67,
10222,
12,
2890,
16,
279,
33,
20,
16,
417,
33,
26,
16,
569,
2218,
94,
11,
4672,
3536,
2000,
326,
1122,
417,
6548,
434,
326,
399,
528,
80,
280,
4166,
17965,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
528,
80,
280,
67,
10222,
12,
2890,
16,
279,
33,
20,
16,
417,
33,
26,
16,
569,
2218,
94,
11,
4672,
3536,
2000,
326,
1122,
417,
6548,
434,
326,
399,
528,
80,
280,
4166,
17965,
4... |
return [o for o in field[0]['options'] if o != ''] | return [o for o in field[0]['options'] if o] | def get_groups(self, by='component'): cursor = self.db.cursor () groups = [] if by in ['status', 'resolution', 'severity', 'priority']: cursor.execute("SELECT name FROM enum WHERE type = %s " "AND name != '' ORDER BY value", by) elif by in ['component', 'milestone', 'version']: cursor.execute("SELECT name FROM %s " "WHERE name != '' ORDER BY name" % by) elif by == 'owner': cursor.execute("SELECT DISTINCT owner AS name FROM ticket " "ORDER BY owner") elif by not in Ticket.std_fields: fields = get_custom_fields(self.env) field = [f for f in fields if f['name'] == by] if not field: return [] return [o for o in field[0]['options'] if o != ''] while 1: row = cursor.fetchone() if not row: break groups.append(row['name']) return groups | d95d4c5c2c377d42ef48039a5a4aebe475bde190 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/d95d4c5c2c377d42ef48039a5a4aebe475bde190/Milestone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4650,
12,
2890,
16,
635,
2218,
4652,
11,
4672,
3347,
273,
365,
18,
1966,
18,
9216,
1832,
3252,
273,
5378,
309,
635,
316,
10228,
2327,
2187,
296,
19182,
2187,
296,
27341,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4650,
12,
2890,
16,
635,
2218,
4652,
11,
4672,
3347,
273,
365,
18,
1966,
18,
9216,
1832,
3252,
273,
5378,
309,
635,
316,
10228,
2327,
2187,
296,
19182,
2187,
296,
27341,
2187,
... |
align_view='7', **kw) 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 )[0] | align_view='7', **kw) 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 )[0] | def localBlast( self, seqFile, db, method='blastp', resultOut=None, e=0.01, **kw ): """ Performa a local blast search (requires that the blast binaries and databases are installed localy). Uses Bio.Blast.NCBIStandalone.blastall (Biopython) for the search. @param seqFile: file name with search sequence in FASTA format @type seqFile: str @param db: database(s) to search, e.g. ['swissprot', 'pdb'] @type db: [str] @param method: search program to use, e.g. 'blastp', 'fasta' (default: blastp) @type method: str @param e: expectation value cutoff @type e: float @param resultOut: save blast output to this new file @type resultOut: str @param kw: optional keywords:: --- Scoring --- matrix Matrix to use (default BLOSUM62). gap_open Gap open penalty (default 0). gap_extend Gap extension penalty (default 0). | 192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/192f7ffa922aed1ead1fed83d7e0b2a4faaea9b9/SequenceSearcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
38,
2722,
12,
365,
16,
3833,
812,
16,
1319,
16,
707,
2218,
30901,
84,
2187,
563,
1182,
33,
7036,
16,
425,
33,
20,
18,
1611,
16,
2826,
9987,
262,
30,
3536,
11217,
69,
279,
1191,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
38,
2722,
12,
365,
16,
3833,
812,
16,
1319,
16,
707,
2218,
30901,
84,
2187,
563,
1182,
33,
7036,
16,
425,
33,
20,
18,
1611,
16,
2826,
9987,
262,
30,
3536,
11217,
69,
279,
1191,... |
def __init__(self, options, source=None, source_path=None, autoclose=1): | def __init__(self, settings, source=None, source_path=None, autoclose=1): | def __init__(self, options, source=None, source_path=None, autoclose=1): """ :Parameters: - `source`: either a file-like object (which is read directly), or `None` (which implies `sys.stdin` if no `source_path` given). - `source_path`: a path to a file, which is opened and then read. - `autoclose`: close automatically after read (boolean); always false if `sys.stdin` is the source. """ Input.__init__(self, options, source, source_path) self.autoclose = autoclose if source is None: if source_path: self.source = open(source_path) else: self.source = sys.stdin self.autoclose = None if not source_path: try: self.source_path = self.source.name except AttributeError: pass | bda0a7626f6d6ffe7d244d26e918cae5fbe214e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/bda0a7626f6d6ffe7d244d26e918cae5fbe214e1/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1947,
16,
1084,
33,
7036,
16,
1084,
67,
803,
33,
7036,
16,
23173,
2061,
33,
21,
4672,
3536,
294,
2402,
30,
300,
1375,
3168,
68,
30,
3344,
279,
585,
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,
1001,
2738,
972,
12,
2890,
16,
1947,
16,
1084,
33,
7036,
16,
1084,
67,
803,
33,
7036,
16,
23173,
2061,
33,
21,
4672,
3536,
294,
2402,
30,
300,
1375,
3168,
68,
30,
3344,
279,
585,
17,... |
self.assert_(isinstance(an_entry, gspreadsheet.GSpreadsheetsList)) new_feed = gspreadsheet.GSpreadsheetsListFeedFromString(str(self.feed)) | self.assert_(isinstance(an_entry, gspreadsheet.SpreadsheetsList)) new_feed = gspreadsheet.SpreadsheetsListFeedFromString(str(self.feed)) | def testToAndFromString(self): self.assert_(len(self.feed.entry) == 2) for an_entry in self.feed.entry: self.assert_(isinstance(an_entry, gspreadsheet.GSpreadsheetsList)) new_feed = gspreadsheet.GSpreadsheetsListFeedFromString(str(self.feed)) for an_entry in new_feed.entry: self.assert_(isinstance(an_entry, gspreadsheet.GSpreadsheetsList)) | 50afc41651ef00ab4626fbe905c8ac1304fb3b37 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6580/50afc41651ef00ab4626fbe905c8ac1304fb3b37/gspreadsheet_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
774,
1876,
9193,
12,
2890,
4672,
365,
18,
11231,
67,
12,
1897,
12,
2890,
18,
7848,
18,
4099,
13,
422,
576,
13,
364,
392,
67,
4099,
316,
365,
18,
7848,
18,
4099,
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,
1842,
774,
1876,
9193,
12,
2890,
4672,
365,
18,
11231,
67,
12,
1897,
12,
2890,
18,
7848,
18,
4099,
13,
422,
576,
13,
364,
392,
67,
4099,
316,
365,
18,
7848,
18,
4099,
30,
365,
18,
... |
if archive is not None: do_implicit_deletion(con, dbi.archiveId(), h.recordOaiIds) | if archiveid is not None: do_implicit_deletion(con, archiveid, h.recordOaiIds) | def harvest(url, con, full=False, stream_filter=None, static=False): try: dbi = DBI(con) if static: h = SrHarvester(url, dbi, full, stream_filter) else: h = Harvester(url, dbi, full, stream_filter) cur = con.cursor() if h.harvest(): h.log("harvest successful") mark_success(con, dbi.archiveId()) if static: archiveid = dbi.archiveId() if archive is not None: do_implicit_deletion(con, dbi.archiveId(), h.recordOaiIds) else: h.log("harvest failed") # dbi can provide archive id only when it has successfully # processed identify response archiveid = dbi.archiveId() if archiveid is None: cur.execute("select Archive_ID from OLAC_ARCHIVE where BaseURL=%s", url) if cur.rowcount > 0: archiveid = cur.fetchone()[0] if archiveid: set_hfc(con, archiveid) cur.close() dbi.commit() rc, nrc, urc, drc, irc = dbi.counts() h.log("processed %d records (this may include retries)" % rc) h.log("new records: %d" % nrc) h.log("updated records: %d" % urc) h.log("deleted records: %d" % drc) h.log("ignored records: %d" % irc) except: msg = traceback.format_exc() msg = "\nUnexpected error in the harvester code:\n\n%s\n\n" % msg try: h.log(msg) except: print msg | cd5792907cd63ca711e5a8e190321b1103a5b242 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8937/cd5792907cd63ca711e5a8e190321b1103a5b242/harvester.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17895,
26923,
12,
718,
16,
356,
16,
1983,
33,
8381,
16,
1407,
67,
2188,
33,
7036,
16,
760,
33,
8381,
4672,
775,
30,
1319,
77,
273,
2383,
45,
12,
591,
13,
309,
760,
30,
366,
273,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17895,
26923,
12,
718,
16,
356,
16,
1983,
33,
8381,
16,
1407,
67,
2188,
33,
7036,
16,
760,
33,
8381,
4672,
775,
30,
1319,
77,
273,
2383,
45,
12,
591,
13,
309,
760,
30,
366,
273,
34... |
gLogger.info( 'Reading %s MySQL Password from local configuration' % mysqlUser ) | gLogger.notice( 'Reading %s MySQL Password from local configuration' % mysqlUser ) | def loadDiracCfg( verbose = False ): """ Read again defaults from dirac.cfg """ global localCfg, cfgFile, setup, instance, logLevel, linkedRootPath, host global basePath, instancePath, runitDir, startDir global db, mysqlDir, mysqlDbDir, mysqlLogDir, mysqlMyOrg, mysqlMyCnf, mysqlStartupScript global mysqlRootPwd, mysqlUser, mysqlPassword, mysqlHost, mysqlMode, mysqlSmallMem, mysqlLargeMem from DIRAC.Core.Utilities.Network import getFQDN localCfg = CFG() cfgFile = os.path.join( rootPath, 'etc', 'dirac.cfg' ) try: localCfg.loadFromFile( cfgFile ) except: gLogger.always( "Can't load ", cfgFile ) gLogger.always( "Might be OK if setting up the site" ) setup = localCfg.getOption( cfgPath( 'DIRAC', 'Setup' ), '' ) instance = localCfg.getOption( cfgInstallPath( 'InstanceName' ), setup ) logLevel = localCfg.getOption( cfgInstallPath( 'LogLevel' ), 'INFO' ) linkedRootPath = localCfg.getOption( cfgInstallPath( 'RootPath' ), rootPath ) useVersionsDir = localCfg.getOption( cfgInstallPath( 'UseVersionsDir' ), False ) host = localCfg.getOption( cfgInstallPath( 'Host' ), getFQDN() ) basePath = os.path.dirname( rootPath ) instancePath = localCfg.getOption( cfgInstallPath( 'InstancePath' ), rootPath ) if useVersionsDir: # This option takes precedence instancePath = os.path.dirname( os.path.dirname( rootPath ) ) linkedRootPath = os.path.join( instancePath, 'pro' ) if verbose: gLogger.info( 'Using Instance Base Dir at', instancePath ) runitDir = os.path.join( instancePath, 'runit' ) runitDir = localCfg.getOption( cfgInstallPath( 'RunitDir' ), runitDir ) if verbose: gLogger.info( 'Using Runit Dir at', runitDir ) startDir = os.path.join( instancePath, 'startup' ) startDir = localCfg.getOption( cfgInstallPath( 'StartupDir' ), startDir ) if verbose: gLogger.info( 'Using Startup Dir at', startDir ) # Now some MySQL default values db = {} mysqlDir = os.path.join( instancePath, 'mysql' ) mysqlDir = localCfg.getOption( cfgInstallPath( 'MySQLDir' ), mysqlDir ) if verbose: gLogger.info( 'Using MySQL Dir at', mysqlDir ) mysqlDbDir = os.path.join( mysqlDir, 'db' ) mysqlLogDir = os.path.join( mysqlDir, 'log' ) mysqlMyOrg = os.path.join( rootPath, 'mysql', 'etc', 'my.cnf' ) mysqlMyCnf = os.path.join( mysqlDir, '.my.cnf' ) mysqlStartupScript = os.path.join( rootPath, 'mysql', 'share', 'mysql', 'mysql.server' ) mysqlRootPwd = localCfg.getOption( cfgInstallPath( 'Database', 'RootPwd' ), mysqlRootPwd ) if verbose and mysqlRootPwd: gLogger.info( 'Reading Root MySQL Password from local configuration' ) mysqlUser = localCfg.getOption( cfgInstallPath( 'Database', 'User' ), '' ) if verbose and mysqlUser: gLogger.info( 'Reading MySQL User from local configuration' ) else: mysqlUser = 'Dirac' mysqlPassword = localCfg.getOption( cfgInstallPath( 'Database', 'Password' ), mysqlPassword ) if verbose and mysqlPassword: gLogger.info( 'Reading %s MySQL Password from local configuration' % mysqlUser ) mysqlHost = localCfg.getOption( cfgInstallPath( 'Database', 'Host' ), '' ) if verbose and mysqlHost: gLogger.info( 'Using MySQL Host from local configuration', mysqlHost ) else: # if it is not defined use the same as for dirac services mysqlHost = host mysqlMode = localCfg.getOption( cfgInstallPath( 'Database', 'MySQLMode' ), '' ) if verbose and mysqlMode: gLogger.info( 'Configuring MySQL server as %s' % mysqlMode ) mysqlSmallMem = localCfg.getOption( cfgInstallPath( 'Database', 'MySQLSmallMem' ), False ) if verbose and mysqlSmallMem: gLogger.info( 'Configuring MySQL server for Low Memory uasge' ) mysqlLargeMem = localCfg.getOption( cfgInstallPath( 'Database', 'MySQLLargeMem' ), False ) if verbose and mysqlLargeMem: gLogger.info( 'Configuring MySQL server for Large Memory uasge' ) | 89d9ce231fa255a4c9a5e26b5771a50afe099f2c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/89d9ce231fa255a4c9a5e26b5771a50afe099f2c/InstallTools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
14521,
8836,
8198,
12,
3988,
273,
1083,
262,
30,
3536,
2720,
3382,
3467,
628,
4314,
8836,
18,
7066,
3536,
2552,
1191,
8198,
16,
2776,
812,
16,
3875,
16,
791,
16,
16752,
16,
8459,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14521,
8836,
8198,
12,
3988,
273,
1083,
262,
30,
3536,
2720,
3382,
3467,
628,
4314,
8836,
18,
7066,
3536,
2552,
1191,
8198,
16,
2776,
812,
16,
3875,
16,
791,
16,
16752,
16,
8459,
... |
sage: for i in range(10): G.add_vertex(name=i) | sage: G.add_vertices(range(10)) Graph on 10 vertices | def add_cycle(self, vertices): """ Adds a cycle to the graph with the given vertices. If the vertices are already present, only the edges are added. | 83b209455c18f02969e2eb638936d98e1292aba4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/83b209455c18f02969e2eb638936d98e1292aba4/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
13946,
12,
2890,
16,
6928,
4672,
3536,
15605,
279,
8589,
358,
326,
2667,
598,
326,
864,
6928,
18,
971,
326,
6928,
854,
1818,
3430,
16,
1338,
326,
5231,
854,
3096,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
13946,
12,
2890,
16,
6928,
4672,
3536,
15605,
279,
8589,
358,
326,
2667,
598,
326,
864,
6928,
18,
971,
326,
6928,
854,
1818,
3430,
16,
1338,
326,
5231,
854,
3096,
18,
2,
-100,... |
data = pybufr.pack_record(record) | data = bufr.pack_record(record) | def netcdf_datatype(type_name): """ converts numpy datatype to NetCDF datatype all floats are converted to doubles all integers are converted to 4 byte int all chars are converted to NetCDF byte-type """ if 'float' in type_name: return 'd' if 'int' in type_name: return 'i' if 'long' in type_name: return 'i' if 'string' in type_name: return 'b' raise BUFR2NetCDFError("Cannot convert %s to NetCDF compatible type" % type_name) | 21fcc10f97a0964bc23934db1eadb04361c1db2e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5638/21fcc10f97a0964bc23934db1eadb04361c1db2e/bufr2netcdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2901,
24799,
67,
21540,
12,
723,
67,
529,
4672,
3536,
7759,
3972,
11172,
358,
8503,
39,
4577,
11172,
225,
777,
19172,
854,
5970,
358,
31446,
777,
12321,
854,
5970,
358,
1059,
1160,
509,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2901,
24799,
67,
21540,
12,
723,
67,
529,
4672,
3536,
7759,
3972,
11172,
358,
8503,
39,
4577,
11172,
225,
777,
19172,
854,
5970,
358,
31446,
777,
12321,
854,
5970,
358,
1059,
1160,
509,
... |
def checkout(ctxt, url, path=None, revision=None, dir_='.', verbose=False, shared_path=None, | def checkout(ctxt, url, path=None, revision=None, dir_='.', verbose='false', shared_path=None, | def checkout(ctxt, url, path=None, revision=None, dir_='.', verbose=False, shared_path=None, username=None, password=None): """Perform a checkout from a Subversion repository. :param ctxt: the build context :type ctxt: `Context` :param url: the URL of the repository :param path: the path inside the repository :param revision: the revision to check out :param dir\_: the name of a local subdirectory to check out into :param verbose: whether to log the list of checked out files :param shared_path: a shared directory to do the checkout in, before copying to dir\_ :param username: a username of the repository :param password: a password of the repository """ args = ['checkout'] if revision: args += ['-r', revision] if path: final_url = posixpath.join(url, path.lstrip('/')) else: final_url = url if username: args += ['--username', username] if password: args += ['--password', password] args += [final_url, dir_] cofilter = None if not verbose: cre = re.compile(r'^[AU]\s.*$') cofilter = lambda s: cre.sub('', s) if shared_path is not None: # run checkout on shared_path, then copy shared_path = ctxt.resolve(shared_path) checkout(ctxt, url, path, revision, dir_=shared_path, verbose=verbose) try: copytree(shared_path, ctxt.resolve(dir_)) except Exception, e: ctxt.log('error copying shared tree (%s)' % e) from bitten.build import shtools returncode = shtools.execute(ctxt, file_='svn', args=args, filter_=cofilter) if returncode != 0: ctxt.error('svn checkout failed (%s)' % returncode) | a0584770e60fc9970c52d2237f81acd7689940dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4547/a0584770e60fc9970c52d2237f81acd7689940dc/svntools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13926,
12,
20364,
16,
880,
16,
589,
33,
7036,
16,
6350,
33,
7036,
16,
1577,
67,
2218,
1093,
16,
3988,
2218,
5743,
2187,
5116,
67,
803,
33,
7036,
16,
2718,
33,
7036,
16,
2201,
33,
703... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13926,
12,
20364,
16,
880,
16,
589,
33,
7036,
16,
6350,
33,
7036,
16,
1577,
67,
2218,
1093,
16,
3988,
2218,
5743,
2187,
5116,
67,
803,
33,
7036,
16,
2718,
33,
7036,
16,
2201,
33,
703... |
try: 1 in a check(0, "in base_set did not raise error") except TypeError: pass | self.assert_('' in '') self.assert_('' in 'abc') | def check(ok, *args): if not ok: raise TestFailed, " ".join(map(str, args)) | 5af2f7454daec9b8526ce5437783137f17a0bce3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/5af2f7454daec9b8526ce5437783137f17a0bce3/test_contains.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
601,
16,
380,
1968,
4672,
309,
486,
1529,
30,
1002,
7766,
2925,
16,
315,
3552,
5701,
12,
1458,
12,
701,
16,
833,
3719,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
601,
16,
380,
1968,
4672,
309,
486,
1529,
30,
1002,
7766,
2925,
16,
315,
3552,
5701,
12,
1458,
12,
701,
16,
833,
3719,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
im_b = int((t_a - phi_start) / phi_width) im_c = int((t_a - phi_start) / phi_width) | im_b = int((t_b - phi_start) / phi_width) im_c = int((t_c - phi_start) / phi_width) | def _intelligent_refine_select_images(self): '''Select a sensible number of wedges at sensible places for refining the unit cell.''' | 6b9b944a8196eb8595181b9d39285ec94dd9ee31 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/6b9b944a8196eb8595181b9d39285ec94dd9ee31/Mosflm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
474,
1165,
360,
319,
67,
1734,
558,
67,
4025,
67,
7369,
12,
2890,
4672,
9163,
3391,
279,
15390,
1523,
1300,
434,
341,
8746,
622,
15390,
1523,
12576,
364,
25994,
310,
326,
2836,
2484... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
474,
1165,
360,
319,
67,
1734,
558,
67,
4025,
67,
7369,
12,
2890,
4672,
9163,
3391,
279,
15390,
1523,
1300,
434,
341,
8746,
622,
15390,
1523,
12576,
364,
25994,
310,
326,
2836,
2484... |
def test_deny_all(self): | def test_deny_mode(self): | def test_deny_all(self): """ Test the deny all mode """ aclf = ACLFile() aclf.write('acl allow guest@QPID all all\n') aclf.write('acl allow bob@QPID create queue\n') aclf.write('acl deny all all') aclf.close() self.reload_acl() session = self.get_session('bob','bob') try: session.queue_declare(queue="deny_queue") except qpid.session.SessionException, e: if (530 == e.args[0].error_code): self.fail("ACL should allow queue create request"); self.fail("Error during queue create request"); try: session.exchange_bind(exchange="amq.direct", queue="deny_queue", binding_key="routing_key") self.fail("ACL should deny queue bind request"); except qpid.session.SessionException, e: self.assertEqual(530,e.args[0].error_code) | 8deee3fee6e04aee030aa54666955757b6b127dd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/198/8deee3fee6e04aee030aa54666955757b6b127dd/acl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13002,
93,
67,
3188,
12,
2890,
4672,
3536,
7766,
326,
17096,
777,
1965,
3536,
7895,
74,
273,
10098,
812,
1435,
7895,
74,
18,
2626,
2668,
10150,
1699,
13051,
36,
53,
16522,
777,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13002,
93,
67,
3188,
12,
2890,
4672,
3536,
7766,
326,
17096,
777,
1965,
3536,
7895,
74,
273,
10098,
812,
1435,
7895,
74,
18,
2626,
2668,
10150,
1699,
13051,
36,
53,
16522,
777,... |
setattr(MinMapper, "map_" + calibType, lambda self, dataId: | setattr(LsstSimMapper, "map_" + calibType, lambda self, dataId: | def _calibMapper(self, datasetType, dataId): pathId = self._mapActualToPath(self._mapIdToActual(dataId)) path = os.path.join(self.calibRoot, getattr(self, datasetType + 'Template') % pathId) return ButlerLocation( "lsst.afw.image.ExposureU", "ExposureU", "FitsStorage", path, dataId) | 7cfb6f2fed45e7b28644b361bb2f65785fada366 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6517/7cfb6f2fed45e7b28644b361bb2f65785fada366/lsstSimMapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
771,
495,
4597,
12,
2890,
16,
3709,
559,
16,
501,
548,
4672,
589,
548,
273,
365,
6315,
1458,
11266,
774,
743,
12,
2890,
6315,
1458,
28803,
11266,
12,
892,
548,
3719,
589,
273,
114... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
771,
495,
4597,
12,
2890,
16,
3709,
559,
16,
501,
548,
4672,
589,
548,
273,
365,
6315,
1458,
11266,
774,
743,
12,
2890,
6315,
1458,
28803,
11266,
12,
892,
548,
3719,
589,
273,
114... |
action = 'txt2tags -q -H -t html -i $SOURCE -o $TARGET' | action = '$T2TBHTML $SOURCE $TARGET' | def generate(env): """Add Builders and construction variables for t2tbhtml to an Environment.""" env['BUILDERS']['T2TBHTML'] = SCons.Builder.Builder(\ action = 'txt2tags -q -H -t html -i $SOURCE -o $TARGET' , suffix = '.bhtml' , src_suffix = '.t2t' , source_scanner = SCons.Tool.SourceFileScanner) T2tbhtmlSourceScanner = SCons.Scanner.Base(name = "t2tbhtmlSourceScanner", function = t2tbhtmlSourceScanner, skeys = ['.t2t'], recursive = True) SCons.Tool.SourceFileScanner.add_scanner('.t2t', T2tbhtmlSourceScanner) | 563d70bb425e3f370465b03e4bdf0502e8d008c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1497/563d70bb425e3f370465b03e4bdf0502e8d008c2/t2tbhtml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
3074,
4672,
3536,
986,
3998,
414,
471,
16171,
3152,
364,
268,
22,
18587,
2620,
358,
392,
7518,
12123,
1550,
3292,
3000,
2627,
4179,
55,
21712,
56,
22,
25730,
4870,
3546,
273,
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,
2103,
12,
3074,
4672,
3536,
986,
3998,
414,
471,
16171,
3152,
364,
268,
22,
18587,
2620,
358,
392,
7518,
12123,
1550,
3292,
3000,
2627,
4179,
55,
21712,
56,
22,
25730,
4870,
3546,
273,
2... |
while os.path.exists(self.__dir): self.__dir += "_" self.__filename += '_' | def __init__(self, name, notebook, id, system=None, passcode = ''): name = ' '.join(name.split()) self.__id = id self.__system = system self.__next_id = (_notebook.MAX_WORKSHEETS) * id self.__name = name self.__notebook = notebook self.__passcode = crypt.crypt(passcode, self.salt()) self.__passcrypt= True dir = list(name) for i in range(len(dir)): if not dir[i].isalnum() and dir[i] != '_': dir[i]='_' dir = ''.join(dir) self.__filename = dir self.__dir = '%s/%s'%(notebook.worksheet_directory(), dir) while os.path.exists(self.__dir): self.__dir += "_" self.__filename += '_' self.__comp_is_running = False if not os.path.exists(self.__dir): os.makedirs(self.__dir) self.__queue = [] self.__cells = [ ] for i in range(INITIAL_NUM_CELLS): self.append_new_cell() | 921d1dc99c4a69f5973861ceba99fe2ac0425296 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/921d1dc99c4a69f5973861ceba99fe2ac0425296/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
14718,
16,
612,
16,
2619,
33,
7036,
16,
1342,
710,
273,
875,
4672,
508,
273,
296,
2418,
5701,
12,
529,
18,
4939,
10756,
365,
16186,
350,
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,
508,
16,
14718,
16,
612,
16,
2619,
33,
7036,
16,
1342,
710,
273,
875,
4672,
508,
273,
296,
2418,
5701,
12,
529,
18,
4939,
10756,
365,
16186,
350,
273,
... | |
for builder in build.DatabaseBuilder.getTableBuilderClasses(): | for builder in build.DatabaseBuilder.getTableBuilderClasses( resolveConflicts=False): | def getBuilderConfigSettings(cls): """ Gets the builder settings from the section C{Builder} from cjklib.conf. | 4747db6023179c61c567587cfd021e166a0fb2fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/4747db6023179c61c567587cfd021e166a0fb2fb/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23314,
809,
2628,
12,
6429,
4672,
3536,
11881,
326,
2089,
1947,
628,
326,
2442,
385,
95,
1263,
97,
628,
18896,
79,
2941,
18,
3923,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23314,
809,
2628,
12,
6429,
4672,
3536,
11881,
326,
2089,
1947,
628,
326,
2442,
385,
95,
1263,
97,
628,
18896,
79,
2941,
18,
3923,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def addScriptCode(hf): global data t0 = (data.start - data.tSuspended) * 1000 tMax = (data.end - data.tSuspended) * 1000 | def addScriptCode(hf, testruns): t0 = (testruns[0].start - testruns[-1].tSuspended) * 1000 tMax = (testruns[-1].end - testruns[-1].tSuspended) * 1000 | def addScriptCode(hf): global data t0 = (data.start - data.tSuspended) * 1000 tMax = (data.end - data.tSuspended) * 1000 # create an array in javascript memory with the device details detail = ' var bounds = [%f,%f];\n' % (t0, tMax) detail += ' var d = [];\n' dfmt = ' d["%s"] = { n:"%s", p:"%s", c:[%s] };\n'; for p in data.dmesg: list = data.dmesg[p]['list'] for d in list: parent = data.deviceParentID(d, p) idlist = data.deviceChildrenIDs(d, p) idstr = "" for i in idlist: if(idstr == ""): idstr += '"'+i+'"' else: idstr += ', '+'"'+i+'"' detail += dfmt % (list[d]['id'], d, parent, idstr) # add the code which will manipulate the data in the browser script_code = \ '<script type="text/javascript">\n'+detail+\ ' var filter = [];\n'\ ' var table = [];\n'\ ' function deviceParent(devid) {\n'\ ' var devlist = [];\n'\ ' if(filter.indexOf(devid) < 0) filter[filter.length] = devid;\n'\ ' if(d[devid].p in d)\n'\ ' devlist = deviceParent(d[devid].p);\n'\ ' else if(d[devid].p != "")\n'\ ' devlist = [d[devid].p];\n'\ ' devlist[devlist.length] = d[devid].n;\n'\ ' return devlist;\n'\ ' }\n'\ ' function deviceChildren(devid, column, row) {\n'\ ' if(!(devid in d)) return;\n'\ ' if(filter.indexOf(devid) < 0) filter[filter.length] = devid;\n'\ ' var cell = {name: d[devid].n, span: 1};\n'\ ' var span = 0;\n'\ ' if(column >= table.length) table[column] = [];\n'\ ' table[column][row] = cell;\n'\ ' for(var i = 0; i < d[devid].c.length; i++) {\n'\ ' var cid = d[devid].c[i];\n'\ ' span += deviceChildren(cid, column+1, row+span);\n'\ ' }\n'\ ' if(span == 0) span = 1;\n'\ ' table[column][row].span = span;\n'\ ' return span;\n'\ ' }\n'\ ' function deviceTree(devid, resume) {\n'\ ' var html = "<table border=1>";\n'\ ' filter = [];\n'\ ' table = [];\n'\ ' plist = deviceParent(devid);\n'\ ' var devidx = plist.length - 1;\n'\ ' for(var i = 0; i < devidx; i++)\n'\ ' table[i] = [{name: plist[i], span: 1}];\n'\ ' deviceChildren(devid, devidx, 0);\n'\ ' for(var i = 0; i < devidx; i++)\n'\ ' table[i][0].span = table[devidx][0].span;\n'\ ' for(var row = 0; row < table[0][0].span; row++) {\n'\ ' html += "<tr>";\n'\ ' for(var col = 0; col < table.length; col++)\n'\ ' if(row in table[col]) {\n'\ ' var cell = table[col][row];\n'\ ' var args = "";\n'\ ' if(cell.span > 1)\n'\ ' args += " rowspan="+cell.span;\n'\ ' if((col == devidx) && (row == 0))\n'\ ' args += " class=tdhl";\n'\ ' if(resume)\n'\ ' html += "<td"+args+">"+cell.name+" →</td>";\n'\ ' else\n'\ ' html += "<td"+args+">← "+cell.name+"</td>";\n'\ ' }\n'\ ' html += "</tr>";\n'\ ' }\n'\ ' html += "</table>";\n'\ ' return html;\n'\ ' }\n'\ ' function zoomTimeline() {\n'\ ' var timescale = document.getElementById("timescale");\n'\ ' var dmesg = document.getElementById("dmesg");\n'\ ' var zoombox = document.getElementById("dmesgzoombox");\n'\ ' var val = parseFloat(dmesg.style.width);\n'\ ' var newval = 100;\n'\ ' var sh = window.outerWidth / 2;\n'\ ' if(this.id == "zoomin") {\n'\ ' newval = val * 1.2;\n'\ ' if(newval > 40000) newval = 40000;\n'\ ' dmesg.style.width = newval+"%";\n'\ ' zoombox.scrollLeft = ((zoombox.scrollLeft + sh) * newval / val) - sh;\n'\ ' } else if (this.id == "zoomout") {\n'\ ' newval = val / 1.2;\n'\ ' if(newval < 100) newval = 100;\n'\ ' dmesg.style.width = newval+"%";\n'\ ' zoombox.scrollLeft = ((zoombox.scrollLeft + sh) * newval / val) - sh;\n'\ ' } else {\n'\ ' zoombox.scrollLeft = 0;\n'\ ' dmesg.style.width = "100%";\n'\ ' }\n'\ ' var html = "";\n'\ ' var t0 = bounds[0];\n'\ ' var tMax = bounds[1];\n'\ ' var tTotal = tMax - t0;\n'\ ' var wTotal = tTotal * 100.0 / newval;\n'\ ' for(var tS = 1000; (wTotal / tS) < 3; tS /= 10);\n'\ ' if(tS < 1) tS = 1;\n'\ ' for(var s = ((t0 / tS)|0) * tS; s < tMax; s += tS) {\n'\ ' var pos = (tMax - s) * 100.0 / tTotal;\n'\ ' var name = (s == 0)?"S/R":(s+"ms");\n'\ ' html += \"<div class=\\\"t\\\" style=\\\"right:\"+pos+\"%\\\">\"+name+\"</div>\";\n'\ ' }\n'\ ' timescale.innerHTML = html;\n'\ ' }\n'\ ' function deviceDetail() {\n'\ ' var devtitle = document.getElementById("devicedetail");\n'\ ' devtitle.innerHTML = "<h1>"+this.title+"</h1>";\n'\ ' var devtree = document.getElementById("devicetree");\n'\ ' devtree.innerHTML = deviceTree(this.id, (this.title.indexOf("resume") >= 0));\n'\ ' var cglist = document.getElementById("callgraphs");\n'\ ' if(!cglist) return;\n'\ ' var cg = cglist.getElementsByClassName("atop");\n'\ ' for (var i = 0; i < cg.length; i++) {\n'\ ' if(filter.indexOf(cg[i].id) >= 0) {\n'\ ' cg[i].style.display = "block";\n'\ ' } else {\n'\ ' cg[i].style.display = "none";\n'\ ' }\n'\ ' }\n'\ ' }\n'\ ' window.addEventListener("load", function () {\n'\ ' var dmesg = document.getElementById("dmesg");\n'\ ' dmesg.style.width = "100%"\n'\ ' document.getElementById("zoomin").onclick = zoomTimeline;\n'\ ' document.getElementById("zoomout").onclick = zoomTimeline;\n'\ ' document.getElementById("zoomdef").onclick = zoomTimeline;\n'\ ' var dev = dmesg.getElementsByClassName("thread");\n'\ ' for (var i = 0; i < dev.length; i++) {\n'\ ' dev[i].onclick = deviceDetail;\n'\ ' }\n'\ ' zoomTimeline();\n'\ ' });\n'\ '</script>\n' hf.write(script_code); | 0c52bda8f6c5785b5982bc3636b627b4ccd59c3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/0c52bda8f6c5785b5982bc3636b627b4ccd59c3f/analyze_suspend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4202,
1652,
527,
3651,
1085,
12,
76,
74,
16,
268,
281,
313,
27595,
4672,
268,
20,
273,
261,
1078,
313,
27595,
63,
20,
8009,
1937,
300,
268,
281,
313,
27595,
18919,
21,
8009,
88,
55,
22942,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4202,
1652,
527,
3651,
1085,
12,
76,
74,
16,
268,
281,
313,
27595,
4672,
268,
20,
273,
261,
1078,
313,
27595,
63,
20,
8009,
1937,
300,
268,
281,
313,
27595,
18919,
21,
8009,
88,
55,
22942,
... |
txt = data.getSubmodel("text").getData(request) | txt = data.getSubmodel(request, "text").getData(request) | def setUp(self, request, node, data): # TODO: we ought to support Deferreds here for both text and href! if isinstance(data, StringType): node.tagName = self.tagName node.attributes["href"] = data else: data = self.model txt = data.getSubmodel("text").getData(request) if not isinstance(txt, Node): txt = document.createTextNode(txt) lnk = data.getSubmodel("href").getData(request) self['href'] = lnk node.tagName = self.tagName domhelpers.clearNode(node) node.appendChild(txt) | 740e188dd7e11854cac9139d2df53a72e09bb9b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/740e188dd7e11854cac9139d2df53a72e09bb9b9/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
16,
590,
16,
756,
16,
501,
4672,
468,
2660,
30,
732,
320,
9540,
358,
2865,
12816,
87,
2674,
364,
3937,
977,
471,
3897,
5,
309,
1549,
12,
892,
16,
31570,
4672,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
16,
590,
16,
756,
16,
501,
4672,
468,
2660,
30,
732,
320,
9540,
358,
2865,
12816,
87,
2674,
364,
3937,
977,
471,
3897,
5,
309,
1549,
12,
892,
16,
31570,
4672,
756,
1... |
item.itemID = self.nextItemID self.nextItemID += 1 | if(type(item) == types.InstanceType): item.itemID = self.nextItemID self.nextItemID += 1 | def addItem(self, item, refresh=1): """ Add this string and extraArg to the list """ item.itemID = self.nextItemID self.nextItemID += 1 self['items'].append(item) if type(item) != type(''): item.reparentTo(self.itemFrame) if refresh: self.refresh() return item.itemID # to pass to scrollToItemID | 35e5cf63d372cad59fceef8c1b53a0dcaf914440 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/35e5cf63d372cad59fceef8c1b53a0dcaf914440/DirectScrolledList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15009,
12,
2890,
16,
761,
16,
4460,
33,
21,
4672,
3536,
1436,
333,
533,
471,
2870,
4117,
358,
326,
666,
3536,
309,
12,
723,
12,
1726,
13,
422,
1953,
18,
29123,
4672,
225,
761,
18,
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,
15009,
12,
2890,
16,
761,
16,
4460,
33,
21,
4672,
3536,
1436,
333,
533,
471,
2870,
4117,
358,
326,
666,
3536,
309,
12,
723,
12,
1726,
13,
422,
1953,
18,
29123,
4672,
225,
761,
18,
17... |
raise ScriptError("Bugzilla login failed: %s" % match.group(1)) | raise BugzillaError("Bugzilla login failed: %s" % match.group(1)) | def authenticate(self): if self.authenticated: return | b812388ad43770bdc11aad77ad4b3c6d9b6fd413 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/b812388ad43770bdc11aad77ad4b3c6d9b6fd413/bugzilla.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8929,
12,
2890,
4672,
309,
365,
18,
14454,
30,
327,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8929,
12,
2890,
4672,
309,
365,
18,
14454,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print urllib.urlencode(params) | def translate(self, text, fromLang, toLang, fromLanguage, toLanguage): if fromLang not in self.supportedTranslations or toLang not in self.supportedTranslations: return | 3b6d9bf45a866f4fb628256cd08ee4ac0886f076 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10749/3b6d9bf45a866f4fb628256cd08ee4ac0886f076/weblookup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
2890,
16,
977,
16,
628,
7275,
16,
358,
7275,
16,
628,
3779,
16,
358,
3779,
4672,
309,
628,
7275,
486,
316,
365,
18,
4127,
12297,
578,
358,
7275,
486,
316,
365,
18,
4127,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4204,
12,
2890,
16,
977,
16,
628,
7275,
16,
358,
7275,
16,
628,
3779,
16,
358,
3779,
4672,
309,
628,
7275,
486,
316,
365,
18,
4127,
12297,
578,
358,
7275,
486,
316,
365,
18,
4127,
12... | |
desktop=self.get_desktop_patch() | desktop=self.get_desktop_path() | def cdrom_usb(self, *args): data=args[0] if isinstance(data, tuple): data=args[0][0] print_debug("cdrom_usb() data=%s" %data) if data.has_key('DEVPATH'): device="/dev/"+data["DEVPATH"].split('/')[2] else: device=data['DEVNAME'] action=data['ACTION'] devid=device.split('/')[2] remote_mnt="/mnt/%s" %(devid) | e2bce3306ef91cc5eba2901c38c01381e77b7750 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13520/e2bce3306ef91cc5eba2901c38c01381e77b7750/tcos-devices-ng.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7976,
520,
67,
25525,
12,
2890,
16,
380,
1968,
4672,
501,
33,
1968,
63,
20,
65,
309,
1549,
12,
892,
16,
3193,
4672,
501,
33,
1968,
63,
20,
6362,
20,
65,
225,
1172,
67,
4148,
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,
7976,
520,
67,
25525,
12,
2890,
16,
380,
1968,
4672,
501,
33,
1968,
63,
20,
65,
309,
1549,
12,
892,
16,
3193,
4672,
501,
33,
1968,
63,
20,
6362,
20,
65,
225,
1172,
67,
4148,
2932,
... |
class UnknownTestModule(py.test.collect.Module): | class RunningModule(OpErrorModule): def run(self): return [] class UnknownTestModule(OpErrorModule): | def run(self): outputpath = self.fspath.dirpath('output', self.name) if not outputpath.check(): py.test.fail("expected outputfile at %s" %(outputpath,)) if self.parent.testdecl.modified: fspath = pypydir.join('lib', 'test2', self.fspath.basename) else: fspath = self.fspath # unmodified regrtest space = getmyspace() try: oldsysout = sys.stdout sys.stdout = capturesysout = py.std.cStringIO.StringIO() try: print self.fspath.purebasename run_file(str(fspath), space=space) finally: sys.stdout = oldsysout except OperationError, e: raise self.Failed( excinfo=pytestsupport.AppExceptionInfo(space, e)) else: # we want to compare outputs result = capturesysout.getvalue() expected = outputpath.read(mode='r') if result != expected: reportdiff(expected, result) py.test.fail("output check failed: %s" % (self.fspath.basename,)) | 5e13baa0cc8c6f264d8b49b286eeec1f1972c9e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/5e13baa0cc8c6f264d8b49b286eeec1f1972c9e8/conftest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
876,
803,
273,
365,
18,
2556,
803,
18,
1214,
803,
2668,
2844,
2187,
365,
18,
529,
13,
309,
486,
876,
803,
18,
1893,
13332,
2395,
18,
3813,
18,
6870,
2932,
3825,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
876,
803,
273,
365,
18,
2556,
803,
18,
1214,
803,
2668,
2844,
2187,
365,
18,
529,
13,
309,
486,
876,
803,
18,
1893,
13332,
2395,
18,
3813,
18,
6870,
2932,
3825,
... |
"""Finds the primary and pyname at offset See notes about `get_pyname_at`. """ | """Find the primary and pyname at offset""" | def get_primary_and_pyname_at(pymodule, offset): """Finds the primary and pyname at offset See notes about `get_pyname_at`. """ pyname_finder = ScopeNameFinder(pymodule) return pyname_finder.get_primary_and_pyname_at(offset) | 40aeb93a1b8374662d216abe6e8c99bbdc54bcba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8286/40aeb93a1b8374662d216abe6e8c99bbdc54bcba/evaluate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8258,
67,
464,
67,
2074,
529,
67,
270,
12,
2074,
2978,
16,
1384,
4672,
3536,
3125,
326,
3354,
471,
2395,
529,
622,
1384,
8395,
2395,
529,
67,
15356,
273,
5468,
461,
8441,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8258,
67,
464,
67,
2074,
529,
67,
270,
12,
2074,
2978,
16,
1384,
4672,
3536,
3125,
326,
3354,
471,
2395,
529,
622,
1384,
8395,
2395,
529,
67,
15356,
273,
5468,
461,
8441,
12,
... |
if result[ 'requireProxyUpload' ]: gProxyManager.uploadProxy() | def deleteJob(self,jobID): """ Delete job(s) from the WMS Job database. jobID can be an integer representing a single DIRAC job ID or a list of IDs """ jobManager = RPCClient('WorkloadManagement/JobManager',useCertificates=False) result = jobManager.deleteJob(jobID) if result[ 'requireProxyUpload' ]: gProxyManager.uploadProxy() return result | 277e600acb2dbd2501a193f8332d9a280860adee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/277e600acb2dbd2501a193f8332d9a280860adee/WMSClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
2278,
12,
2890,
16,
4688,
734,
4672,
3536,
2504,
1719,
12,
87,
13,
628,
326,
678,
3537,
3956,
2063,
18,
28913,
848,
506,
392,
3571,
5123,
279,
2202,
18544,
2226,
1719,
1599,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
2278,
12,
2890,
16,
4688,
734,
4672,
3536,
2504,
1719,
12,
87,
13,
628,
326,
678,
3537,
3956,
2063,
18,
28913,
848,
506,
392,
3571,
5123,
279,
2202,
18544,
2226,
1719,
1599,
578,
... | |
self._precompute(2) def _repr_(self): return "a(n)^2 is a triangular number: a(n) = 6*a(n-1) - a(n-2) with a(0)=0, a(1)=1" def _precompute(self, how_many=50): try: f = self._f except AttributeError: self._f = recur_gen2(0,1,6,-1) f = self._f self._b += [f.next() for i in range(how_many)] def _eval(self, n): if len(self._b) <= n: self._precompute(n - len(self._b) + 1) return self._b[n] def list(self, n): self._eval(n) return self._b[:n] class A015521(SloaneSequence): r""" Linear 2nd order recurrence, $a(0)=0$, $a(1)=1$ and $a(n) = 3 a(n-1) + 4 a(n-2)$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A015521; a Linear 2nd order recurrence, a(n) = 3 a(n-1) + 4 a(n-2). sage: a(0) 0 sage: a(1) 1 sage: a(8) 13107 sage: a(41) 967140655691703339764941 sage: a.list(12) [0, 1, 3, 13, 51, 205, 819, 3277, 13107, 52429, 209715, 838861] AUTHOR: -- Jaap Spies (2007-01-19) """ def __init__(self): SloaneSequence.__init__(self, offset=0) self._b = [] | self._params = (0,1,6,5) | def __init__(self): SloaneSequence.__init__(self, offset=0) self._b = [] self._precompute(2) # force precomputation | d2510d4232e17c9cea8d1a0271c6be68a81d317b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/d2510d4232e17c9cea8d1a0271c6be68a81d317b/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
348,
383,
8806,
4021,
16186,
2738,
972,
12,
2890,
16,
1384,
33,
20,
13,
365,
6315,
70,
273,
5378,
365,
6315,
1484,
9200,
12,
22,
13,
225,
468,
2944,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
348,
383,
8806,
4021,
16186,
2738,
972,
12,
2890,
16,
1384,
33,
20,
13,
365,
6315,
70,
273,
5378,
365,
6315,
1484,
9200,
12,
22,
13,
225,
468,
2944,
... |
print label | def _make_unwrap_frame_class(self, cache={}): try: key = tuple(self.unwrap_spec) frame_cls, box_cls, run_args = cache[key] assert run_args == self.run_args,"unexpected: same spec, different run_args" return frame_cls, box_cls except KeyError: label = '_'.join([getattr(el, '__name__', el) for el in self.unwrap_spec]) print label setfastscope = self.setfastscope if not setfastscope: setfastscope = ["pass"] setfastscope = ["def setfastscope_UWS_%s(self, scope_w):" % label, #"print 'ENTER',self.code.func.__name__", #"print scope_w" ] + setfastscope setfastscope = '\n '.join(setfastscope) # Python 2.2 SyntaxError without newline: Bug #501622 setfastscope += '\n' d = {} exec compile(setfastscope, '', 'exec') in self.miniglobals, d d['setfastscope'] = d['setfastscope_UWS_%s' % label] del d['setfastscope_UWS_%s' % label] | f2d4cf14b38ea0eef4ce44a3e2578631ede1f683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/f2d4cf14b38ea0eef4ce44a3e2578631ede1f683/gateway.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
318,
4113,
67,
3789,
67,
1106,
12,
2890,
16,
1247,
12938,
4672,
775,
30,
498,
273,
3193,
12,
2890,
18,
318,
4113,
67,
2793,
13,
2623,
67,
6429,
16,
3919,
67,
6429,
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,
389,
6540,
67,
318,
4113,
67,
3789,
67,
1106,
12,
2890,
16,
1247,
12938,
4672,
775,
30,
498,
273,
3193,
12,
2890,
18,
318,
4113,
67,
2793,
13,
2623,
67,
6429,
16,
3919,
67,
6429,
16,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.