rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
tmpl.run(vars = {'config':config}) | tmpl.run(vars = { 'config':config, 'web_url':web_url }) | def admin(req): config = parse_config() req.content_type = 'html' tmpl = psp.PSP(req, filename='templates/admin.tmpl') tmpl.run(vars = {'config':config}) | e8c788619789d7d5e9dec7ac6f23771244be61b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8874/e8c788619789d7d5e9dec7ac6f23771244be61b5/index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3981,
12,
3658,
4672,
642,
273,
1109,
67,
1425,
1435,
1111,
18,
1745,
67,
723,
273,
296,
2620,
11,
10720,
273,
293,
1752,
18,
52,
3118,
12,
3658,
16,
1544,
2218,
8502,
19,
3666,
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,
3981,
12,
3658,
4672,
642,
273,
1109,
67,
1425,
1435,
1111,
18,
1745,
67,
723,
273,
296,
2620,
11,
10720,
273,
293,
1752,
18,
52,
3118,
12,
3658,
16,
1544,
2218,
8502,
19,
3666,
18,
... |
'test_reordering_jigs_or_chunks_05_thermo_lmotor_anchor_measurement_jigs_reordering_5', 'test_reordering_jigs_or_chunks_05_thermo_lmotor_anchor_measurement_jigs_reordering_3', | def lastLineOfReadings(f): lines = readlines(f) n = None for i in range(len(lines)): if lines[i].startswith("# Done:"): n = i - 1 break if n == None: return None return map(string.atof, lines[n].split()) | 0b789e7ec79dfae45d6cb15c2976c03b0322f72f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/0b789e7ec79dfae45d6cb15c2976c03b0322f72f/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31661,
951,
1994,
899,
12,
74,
4672,
2362,
273,
17546,
12,
74,
13,
290,
273,
599,
364,
277,
316,
1048,
12,
1897,
12,
3548,
3719,
30,
309,
2362,
63,
77,
8009,
17514,
1918,
2932,
7,
86... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31661,
951,
1994,
899,
12,
74,
4672,
2362,
273,
17546,
12,
74,
13,
290,
273,
599,
364,
277,
316,
1048,
12,
1897,
12,
3548,
3719,
30,
309,
2362,
63,
77,
8009,
17514,
1918,
2932,
7,
86... | |
progress_callback(os.path.join(directory, 'epydoc-help.html'), None) self._write_help(directory) | filename = os.path.join(directory, 'epydoc-help.html') if progress_callback: progress_callback(filename, None) self._write_help(filename) if self._create_frames: self._write_frames(directory, progress_callback) | def write(self, directory=None, progress_callback=None): """ Write the documentation to the given directory. | 60b4598f963657af72659f4c3492b6028c51c37e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/60b4598f963657af72659f4c3492b6028c51c37e/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
4007,
67,
3394,
33,
7036,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
4007,
67,
3394,
33,
7036,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
tags.sort(cmp=lambda x, y: cmp(x.get_name().lower(), y.get_name().lower())) | tags.sort( cmp=lambda x, y: cmp(x.get_name().lower(), y.get_name().lower())) | def refresh_tags(self): select = self.tag_tview.get_selection() t_path = None if select: t_model, t_path = select.get_selected_rows() #pylint: disable-msg=W0612 self.tag_ts.clear() alltag = self.req.get_alltag_tag() notag = self.req.get_notag_tag() if self.workview: count_all_task = len(self.req.get_active_tasks_list(workable=True)) count_no_tags = len(self.req.get_active_tasks_list(notag_only=True,\ workable=True)) else: count_all_task = len(self.req.get_tasks_list(started_only=False)) count_no_tags = len(self.req.get_tasks_list(notag_only=True,\ started_only=False)) | fac54dcba973acc5967f43b60fb540659a1a87a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/fac54dcba973acc5967f43b60fb540659a1a87a8/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
4156,
12,
2890,
4672,
2027,
273,
365,
18,
2692,
67,
88,
1945,
18,
588,
67,
10705,
1435,
268,
67,
803,
273,
599,
309,
2027,
30,
268,
67,
2284,
16,
268,
67,
803,
273,
2027,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
4156,
12,
2890,
4672,
2027,
273,
365,
18,
2692,
67,
88,
1945,
18,
588,
67,
10705,
1435,
268,
67,
803,
273,
599,
309,
2027,
30,
268,
67,
2284,
16,
268,
67,
803,
273,
2027,
... |
versions.append(re.search(r'cc_(.*)$', d).group(1)) | m = re.search(r'cc_(.*)$', d) if m: versions.append(m.group(1)) | def get_all_compiler_versions(): """Returns a sorted list of strings, like "70" or "80" or "9.0" with most recent compiler version first. """ versions=[] if is_windows: if is_win64: keyname = 'Software\\WoW6432Node\\Intel\\Compilers\\C++' else: keyname = 'Software\\Intel\\Compilers\\C++' try: k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, keyname) except WindowsError: return [] i = 0 versions = [] try: while i < 100: subkey = SCons.Util.RegEnumKey(k, i) # raises EnvironmentError # Check that this refers to an existing dir. # This is not 100% perfect but should catch common # installation issues like when the compiler was installed # and then the install directory deleted or moved (rather # than uninstalling properly), so the registry values # are still there. ok = False for try_abi in ('IA32', 'IA32e', 'IA64', 'EM64T'): try: d = get_intel_registry_value('ProductDir', subkey, try_abi) except MissingRegistryError: continue # not found in reg, keep going if os.path.exists(d): ok = True if ok: versions.append(subkey) else: try: # Registry points to nonexistent dir. Ignore this # version. value = get_intel_registry_value('ProductDir', subkey, 'IA32') except MissingRegistryError, e: # Registry key is left dangling (potentially # after uninstalling). print \ "scons: *** Ignoring the registry key for the Intel compiler version %s.\n" \ "scons: *** It seems that the compiler was uninstalled and that the registry\n" \ "scons: *** was not cleaned up properly.\n" % subkey else: print "scons: *** Ignoring "+str(value) i = i + 1 except EnvironmentError: # no more subkeys pass elif is_linux: for d in glob.glob('/opt/intel_cc_*'): # Typical dir here is /opt/intel_cc_80. versions.append(re.search(r'cc_(.*)$', d).group(1)) for d in glob.glob('/opt/intel/cc*/*'): # Typical dir here is /opt/intel/cc/9.0 for IA32, # /opt/intel/cce/9.0 for EMT64 (AMD64) versions.append(re.search(r'([0-9.]+)$', d).group(1)) versions = uniquify(versions) # remove dups versions.sort(vercmp) return versions | 28af5defad21f225553b957f547144c303cfc6a2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12817/28af5defad21f225553b957f547144c303cfc6a2/intelc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
454,
67,
9576,
67,
10169,
13332,
3536,
1356,
279,
3115,
666,
434,
2064,
16,
3007,
315,
7301,
6,
578,
315,
3672,
6,
578,
315,
29,
18,
20,
6,
598,
4486,
8399,
5274,
1177,
1122... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
454,
67,
9576,
67,
10169,
13332,
3536,
1356,
279,
3115,
666,
434,
2064,
16,
3007,
315,
7301,
6,
578,
315,
3672,
6,
578,
315,
29,
18,
20,
6,
598,
4486,
8399,
5274,
1177,
1122... |
if not self._metadata_popupated: | if not self._metadata_populated: | def maintainer(self): if not self._metadata_popupated: self.parse_metadata() return self._maintainer | d7301a0b869a76845ebfdf478ff07d95dc243e3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13693/d7301a0b869a76845ebfdf478ff07d95dc243e3a/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11566,
1521,
12,
2890,
4672,
309,
486,
365,
6315,
4165,
67,
5120,
11799,
30,
365,
18,
2670,
67,
4165,
1435,
327,
365,
6315,
81,
1598,
1521,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
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,
11566,
1521,
12,
2890,
4672,
309,
486,
365,
6315,
4165,
67,
5120,
11799,
30,
365,
18,
2670,
67,
4165,
1435,
327,
365,
6315,
81,
1598,
1521,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
sec=c.tm_sec + 1 | sec=c.tm_sec!=59 and c.tm_sec + 1 | def _info_default(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) mod = pool.get('ir.model') list=('ir.ui.view','ir.ui.menu','ir.model','ir.model.fields','ir.model.access',\ 'res.partner','res.partner.address','res.partner.category','workflow',\ 'workflow.activity','workflow.transition','ir.actions.server','ir.server.object.lines') data['form']['objects']=mod.search(cr,uid,[('model','in',list)]) cr.execute('select max(create_date) from ir_model_data') c=(cr.fetchone())[0].split('.')[0] c = time.strptime(c,"%Y-%m-%d %H:%M:%S") sec=c.tm_sec + 1 c=(c[0],c[1],c[2],c[3],c[4],sec,c[6],c[7],c[8]) data['form']['check_date']=time.strftime("%Y-%m-%d %H:%M:%S",c) return data['form'] | 5527de5e0fba0d0be2056943427a8b348a634961 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/5527de5e0fba0d0be2056943427a8b348a634961/base_module_record_objects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1376,
67,
1886,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
681,
273,
2845,
18,
588,
2668,
481,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1376,
67,
1886,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
681,
273,
2845,
18,
588,
2668,
481,
18,
... |
print item | def processDir (self, dummy, dirname, items): | 352d2c1ef9bc0cd5133b8f2c47f8949c45ba5da7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12443/352d2c1ef9bc0cd5133b8f2c47f8949c45ba5da7/faq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1621,
261,
2890,
16,
9609,
16,
4283,
16,
1516,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1621,
261,
2890,
16,
9609,
16,
4283,
16,
1516,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
def _init(self, smtpHost, smtpPort): self.smtpHost=smtpHost self.smtpPort=smtpPort def manage_makeChanges(self,title,smtpHost,smtpPort, REQUEST=None): | def _init(self, smtp_host, smtp_port): self.smtp_host=smtp_host self.smtp_port=smtp_port def manage_makeChanges(self,title,smtp_host,smtp_port, REQUEST=None): | def _init(self, smtpHost, smtpPort): self.smtpHost=smtpHost self.smtpPort=smtpPort | 461223c7f2e9e331b7ecd4fac798e4a7bbfee80f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/461223c7f2e9e331b7ecd4fac798e4a7bbfee80f/MailHost.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
12,
2890,
16,
17660,
2594,
16,
17660,
2617,
4672,
365,
18,
20278,
2594,
33,
20278,
2594,
365,
18,
20278,
2617,
33,
20278,
2617,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
12,
2890,
16,
17660,
2594,
16,
17660,
2617,
4672,
365,
18,
20278,
2594,
33,
20278,
2594,
365,
18,
20278,
2617,
33,
20278,
2617,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
def maybe_conn_error(self, predicate, fun): if predicate: try: fun() except Exception: pass | def maybe_conn_error(self, fun): try: fun() except Exception: pass | def maybe_conn_error(self, predicate, fun): if predicate: try: fun() except Exception: # TODO kombu.connection_errors pass | be010336871df201608b89bc747c4e7a978a9c44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/be010336871df201608b89bc747c4e7a978a9c44/listener.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
67,
4646,
67,
1636,
12,
2890,
16,
5641,
16,
9831,
4672,
309,
5641,
30,
775,
30,
9831,
1435,
1335,
1185,
30,
468,
2660,
417,
16659,
89,
18,
4071,
67,
4324,
1342,
2,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
67,
4646,
67,
1636,
12,
2890,
16,
5641,
16,
9831,
4672,
309,
5641,
30,
775,
30,
9831,
1435,
1335,
1185,
30,
468,
2660,
417,
16659,
89,
18,
4071,
67,
4324,
1342,
2,
-100,
-100,
... |
"""The heartbeat channel which monitors the kernel heartbeat. """ | """The heartbeat channel which monitors the kernel heartbeat.""" | def _queue_reply(self, msg): self.msg_queue.put(msg) self.add_io_state(POLLOUT) | 96d8f662e356a0dea630ccc4ea3a9846cbab19f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4219/96d8f662e356a0dea630ccc4ea3a9846cbab19f8/kernelmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4000,
67,
10629,
12,
2890,
16,
1234,
4672,
365,
18,
3576,
67,
4000,
18,
458,
12,
3576,
13,
365,
18,
1289,
67,
1594,
67,
2019,
12,
14232,
1502,
1693,
13,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4000,
67,
10629,
12,
2890,
16,
1234,
4672,
365,
18,
3576,
67,
4000,
18,
458,
12,
3576,
13,
365,
18,
1289,
67,
1594,
67,
2019,
12,
14232,
1502,
1693,
13,
2,
-100,
-100,
-100,
-10... |
'fi': u'Teemasivu', | def __init__(self): family.Family.__init__(self) self.name = 'wikipedia' | f06a3c70da8a005c1f7b367c005f6253ff07f708 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/f06a3c70da8a005c1f7b367c005f6253ff07f708/wikipedia_family.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
11999,
13744,
11,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
11999,
13744,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.terms = field.bind(self.context).vocabulary | if field.vocabulary is None: field = field.bind(context) self.terms = field.vocabulary | def __init__(self, context, request, form, field, widget): self.context = context self.request = request self.form = form self.field = field self.widget = widget self.terms = field.bind(self.context).vocabulary | b52271d326a9e3c0b546ff144ca76ae6e14039bd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9738/b52271d326a9e3c0b546ff144ca76ae6e14039bd/term.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
819,
16,
590,
16,
646,
16,
652,
16,
3604,
4672,
365,
18,
2472,
273,
819,
365,
18,
2293,
273,
590,
365,
18,
687,
273,
646,
365,
18,
1518,
273,
652,
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,
1001,
2738,
972,
12,
2890,
16,
819,
16,
590,
16,
646,
16,
652,
16,
3604,
4672,
365,
18,
2472,
273,
819,
365,
18,
2293,
273,
590,
365,
18,
687,
273,
646,
365,
18,
1518,
273,
652,
36... |
generate_html() | self.generate_html() | def run(self): while 1: g_mutex.acquire() generate_html() g_mutex.release() time.sleep(3) | 8e5e1b423b795a8573942cfd8c3b7178278fed38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/228/8e5e1b423b795a8573942cfd8c3b7178278fed38/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1323,
404,
30,
314,
67,
29946,
18,
1077,
1039,
1435,
365,
18,
7163,
67,
2620,
1435,
314,
67,
29946,
18,
9340,
1435,
813,
18,
19607,
12,
23,
13,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1323,
404,
30,
314,
67,
29946,
18,
1077,
1039,
1435,
365,
18,
7163,
67,
2620,
1435,
314,
67,
29946,
18,
9340,
1435,
813,
18,
19607,
12,
23,
13,
2,
-100,
-100,
-... |
return (self.a <= abs(self.b)) and (abs(self.b) <= self.c) | return (abs(self.b) <= self.a) and (self.a <= self.c) | def is_weakly_reduced(self): """ Checks if the form $ax^2 + bxy + cy^2$ satisfies $|b| \leq a \leq c$, i.e., is weakly reduced. | 9045d7fbba21db1a90f5ba53a408263e967bdf4d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9045d7fbba21db1a90f5ba53a408263e967bdf4d/binary_qf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
26008,
715,
67,
1118,
26372,
12,
2890,
4672,
3536,
13074,
309,
326,
646,
271,
651,
66,
22,
397,
324,
1698,
397,
6143,
66,
22,
8,
225,
17917,
271,
96,
70,
96,
521,
298,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
26008,
715,
67,
1118,
26372,
12,
2890,
4672,
3536,
13074,
309,
326,
646,
271,
651,
66,
22,
397,
324,
1698,
397,
6143,
66,
22,
8,
225,
17917,
271,
96,
70,
96,
521,
298,
85,
... |
while self.parser.openElements[:-1].name in ("tbody", "tfoot", "thead", | while self.parser.openElements[-1].name in ("tbody", "tfoot", "thead", | def clearStackToTableBodyContext(self): while self.parser.openElements[:-1].name in ("tbody", "tfoot", "thead", "html"): self.parser.openElements.pop() self.parser.parseError() | 40f9853d6b4691906618664f09607a4a6e6241d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/40f9853d6b4691906618664f09607a4a6e6241d6/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
2624,
774,
1388,
2250,
1042,
12,
2890,
4672,
1323,
365,
18,
4288,
18,
3190,
3471,
18919,
21,
8009,
529,
316,
7566,
20779,
3113,
315,
88,
10923,
3113,
315,
24604,
3113,
315,
2620,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
2624,
774,
1388,
2250,
1042,
12,
2890,
4672,
1323,
365,
18,
4288,
18,
3190,
3471,
18919,
21,
8009,
529,
316,
7566,
20779,
3113,
315,
88,
10923,
3113,
315,
24604,
3113,
315,
2620,
6... |
return prefix + html_quote(newlink) | return prefix + newlink | def checklink(match): matched = match.group(0) newlink = link = decodeEntities(match.group('href')) classification, uid, relpath, tail = self.classifyLink(link, base) | 8fe83efc66a2995a24eb6010a755333eb9134a03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10193/8fe83efc66a2995a24eb6010a755333eb9134a03/html2captioned.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1232,
12,
1916,
4672,
4847,
273,
845,
18,
1655,
12,
20,
13,
394,
1232,
273,
1692,
273,
2495,
8108,
12,
1916,
18,
1655,
2668,
7547,
26112,
13804,
16,
4555,
16,
14614,
16,
5798,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1232,
12,
1916,
4672,
4847,
273,
845,
18,
1655,
12,
20,
13,
394,
1232,
273,
1692,
273,
2495,
8108,
12,
1916,
18,
1655,
2668,
7547,
26112,
13804,
16,
4555,
16,
14614,
16,
5798,
273... |
self.assertEqual(self.execute('NOOP', 1), | self.assertEqual(self.execute('NOOP', 1).rstrip(), | def testNOOP(self): self.assertEqual(self.execute('NOOP', 0), status_messages['SUCCESS_200'] %'NOOP') self.assertEqual(self.execute('NOOP', 1), status_messages['SUCCESS_200'] %'NOOP') | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3417,
3665,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2890,
18,
8837,
2668,
3417,
3665,
2187,
374,
3631,
1267,
67,
6833,
3292,
12778,
67,
6976,
3546,
738,
11,
3417,
3665,
6134,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3417,
3665,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2890,
18,
8837,
2668,
3417,
3665,
2187,
374,
3631,
1267,
67,
6833,
3292,
12778,
67,
6976,
3546,
738,
11,
3417,
3665,
6134,
365... |
if not os.path.lexists(DV.conf_file_directory): | if not os.path.exists(DV.conf_file_directory): | def DamnUnicode(s): if type(s) is type(u''): return s if type(s) is type(''): return unicode(s,errors='ignore') try: return unicode(s) except: return s | a23aab3cca4213a18f7de633eeab28f6386139ab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/a23aab3cca4213a18f7de633eeab28f6386139ab/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
301,
82,
16532,
12,
87,
4672,
309,
618,
12,
87,
13,
353,
618,
12,
89,
6309,
4672,
327,
272,
309,
618,
12,
87,
13,
353,
618,
2668,
11,
4672,
327,
5252,
12,
87,
16,
4324,
2218,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
301,
82,
16532,
12,
87,
4672,
309,
618,
12,
87,
13,
353,
618,
12,
89,
6309,
4672,
327,
272,
309,
618,
12,
87,
13,
353,
618,
2668,
11,
4672,
327,
5252,
12,
87,
16,
4324,
2218,
... |
ev = event() w = coord() | ev = Event() w = Coord() | def debugme(): "Access to the internals for debugging." proutn("Reset levels? ") if ja(): if game.energy < game.inenrg: game.energy = game.inenrg game.shield = game.inshld game.torps = game.intorps game.lsupres = game.inlsr proutn("Reset damage? ") if ja(): for i in range(NDEVICES): if game.damage[i] > 0.0: game.damage[i] = 0.0 proutn("Toggle debug flag? ") if ja(): game.idebug = not game.idebug if game.idebug: prout("Debug output ON") else: prout("Debug output OFF") proutn("Cause selective damage? ") if ja(): for i in range(NDEVICES): proutn("Kill %s?" % device[i]) scanner.chew() key = scanner.next() if key == "IHALPHA" and scanner.sees("y"): game.damage[i] = 10.0 proutn("Examine/change events? ") if ja(): ev = event() w = coord() legends = { FSNOVA: "Supernova ", FTBEAM: "T Beam ", FSNAP: "Snapshot ", FBATTAK: "Base Attack ", FCDBAS: "Base Destroy ", FSCMOVE: "SC Move ", FSCDBAS: "SC Base Destroy ", FDSPROB: "Probe Move ", FDISTR: "Distress Call ", FENSLV: "Enslavement ", FREPRO: "Klingon Build ", } for i in range(1, NEVENTS): proutn(legends[i]) if is_scheduled(i): proutn("%.2f" % (scheduled(i)-game.state.date)) if i == FENSLV or i == FREPRO: ev = findevent(i) proutn(" in %s" % ev.quadrant) else: proutn("never") proutn("? ") scanner.chew() key = scanner.next() if key == 'n': unschedule(i) scanner.chew() elif key == "IHREAL": ev = schedule(i, scanner.real) if i == FENSLV or i == FREPRO: scanner.chew() proutn("In quadrant- ") key = scanner.next() # "IHEOL" says to leave coordinates as they are if key != "IHEOL": if key != "IHREAL": prout("Event %d canceled, no x coordinate." % (i)) unschedule(i) continue w.i = int(round(scanner.real)) key = scanner.next() if key != "IHREAL": prout("Event %d canceled, no y coordinate." % (i)) unschedule(i) continue w.j = int(round(scanner.real)) ev.quadrant = w scanner.chew() proutn("Induce supernova here? ") if ja(): game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova = True atover(True) | e571d502c19abfb5a3320300c347793da7b43d05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/e571d502c19abfb5a3320300c347793da7b43d05/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
3501,
13332,
315,
1862,
358,
326,
8216,
1031,
364,
10450,
1199,
450,
322,
82,
2932,
7013,
7575,
35,
9369,
309,
26879,
13332,
309,
7920,
18,
15358,
411,
7920,
18,
267,
275,
26876,
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,
1198,
3501,
13332,
315,
1862,
358,
326,
8216,
1031,
364,
10450,
1199,
450,
322,
82,
2932,
7013,
7575,
35,
9369,
309,
26879,
13332,
309,
7920,
18,
15358,
411,
7920,
18,
267,
275,
26876,
3... |
print "</OL>" | print "</ol>" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level): while (lineLevel > level): if (formatMode == "bullets"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "<UL>" elif (formatMode == "roman"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "<OL type=\"I\">" elif (formatMode == "numeric"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "<OL type=\"1\">" elif (formatMode == "alpha"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "<OL type=\"A\">" elif (formatMode == "indent"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "<OL>" else: sys.exit("Error! Unknown formatMode type") level = level + 1 elif (lineLevel < level): while (lineLevel < level): if (formatMode == "bullets"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "</UL>" else: if (inBodyText == 1): print"</p>" inBodyText = 0 print "</OL>" level = level - 1 else: print if (lstrip(rstrip(linein)) == "----------------------------------------"): print "<br><br><hr><br>" else: if (slides == 0): if (lineLevel == find(linein," ") +1 ) or \ (lineLevel == find(linein,":") +1 ): if (inBodyText == 0): handleBodyText(linein,lineLevel) else: print colonStrip(rstrip(lstrip(linein))), else: if (inBodyText == 1): print"</p>" inBodyText = 0 print "<LI", if (styleSheet != ""): print " class=\"L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)), else: if (lineLevel == 1): if (linein[0] == " "): if (inBodyText == 0): handleBodyText(linein,lineLevel) else: print rstrip(lstrip(linein)), else: print "<address>" print rstrip(lstrip(linein)), print "</address>\n" else: if (lineLevel == find(linein," ") +1 ) or \ (lineLevel == find(linein,":") +1 ): if (inBodyText == 0): handleBodyText(linein,lineLevel) else: print rstrip(lstrip(linein)), else: if (inBodyText == 1): print"</p>" inBodyText = 0 print "<LI", if (styleSheet != ""): print " class=\"LI.L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)), | 7af5c2bb8f0372438a2b397a27fa3bf97585fc33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6154/7af5c2bb8f0372438a2b397a27fa3bf97585fc33/otl2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1670,
12,
1369,
267,
4672,
2552,
1801,
16,
740,
2309,
16,
30119,
16,
6853,
9051,
16,
316,
2250,
1528,
16,
2154,
8229,
16,
6370,
2885,
309,
261,
80,
6406,
12,
1369,
267,
13,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1670,
12,
1369,
267,
4672,
2552,
1801,
16,
740,
2309,
16,
30119,
16,
6853,
9051,
16,
316,
2250,
1528,
16,
2154,
8229,
16,
6370,
2885,
309,
261,
80,
6406,
12,
1369,
267,
13,
422,
... |
urls.append(dict(url=url, tag=str(link), title=title)) | urls.append(dict(url=url, tag=unicode(link), title=title)) | def html2plaintext(html, body_id=None, encoding='utf-8'): ## (c) Fry-IT, www.fry-it.com, 2007 ## <peter@fry-it.com> ## download here: http://www.peterbe.com/plog/html2plaintext """ from an HTML text, convert the HTML to plain text. If @body_id is provided then this is the tag where the body (not necessarily <body>) starts. """ try: from BeautifulSoup import BeautifulSoup, SoupStrainer, Comment except: return html urls = [] if body_id is not None: strainer = SoupStrainer(id=body_id) else: strainer = SoupStrainer('body') soup = BeautifulSoup(html, parseOnlyThese=strainer, fromEncoding=encoding) for link in soup.findAll('a'): title = link.renderContents() for url in [x[1] for x in link.attrs if x[0]=='href']: urls.append(dict(url=url, tag=str(link), title=title)) html = unicode(soup) url_index = [] i = 0 for d in urls: if d['title'] == d['url'] or 'http://'+d['title'] == d['url']: html = html.replace(d['tag'], d['url']) else: i += 1 html = html.replace(d['tag'], '%s [%s]' % (d['title'], i)) url_index.append(d['url']) html = html.replace('<strong>', '*').replace('</strong>', '*') html = html.replace('<b>', '*').replace('</b>', '*') html = html.replace('<h3>', '*').replace('</h3>', '*') html = html.replace('<h2>', '**').replace('</h2>', '**') html = html.replace('<h1>', '**').replace('</h1>', '**') html = html.replace('<em>', '/').replace('</em>', '/') # the only line breaks we respect is those of ending tags and # breaks html = html.replace('\n', ' ') html = html.replace('<br>', '\n') html = html.replace('<tr>', '\n') html = html.replace('</p>', '\n\n') html = re.sub('<br\s*/>', '\n', html) html = html.replace(' ' * 2, ' ') # for all other tags we failed to clean up, just remove then and # complain about them on the stderr def desperate_fixer(g): #print >>sys.stderr, "failed to clean up %s" % str(g.group()) return ' ' html = re.sub('<.*?>', desperate_fixer, html) # lstrip all lines html = '\n'.join([x.lstrip() for x in html.splitlines()]) for i, url in enumerate(url_index): if i == 0: html += '\n\n' html += '[%s] %s\n' % (i+1, url) return html | 35fb39a353d212b29fbca953832064af202b72f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/35fb39a353d212b29fbca953832064af202b72f4/openerp_mailgate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
22,
412,
10133,
12,
2620,
16,
1417,
67,
350,
33,
7036,
16,
2688,
2218,
3158,
17,
28,
11,
4672,
7541,
261,
71,
13,
478,
1176,
17,
1285,
16,
8765,
18,
74,
1176,
17,
305,
18,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
22,
412,
10133,
12,
2620,
16,
1417,
67,
350,
33,
7036,
16,
2688,
2218,
3158,
17,
28,
11,
4672,
7541,
261,
71,
13,
478,
1176,
17,
1285,
16,
8765,
18,
74,
1176,
17,
305,
18,
83... |
searchLock.acquire() try: queue.put(None) if len(board.history) < 14: movestr = getBestOpening(board) if movestr: mvs = [parseSAN(board, movestr)] if len(board.history) >= 14 or not movestr: | if len(board.history) < 14: movestr = getBestOpening(board) if movestr: mvs = [parseSAN(board, movestr)] if len(board.history) >= 14 or not movestr: global mytime, increment, scr lsearch.skipPruneChance = skipPruneChance lsearch.searching = True if mytime == None: lsearch.endtime = sys.maxint print "Searching to depth %d without timelimit" % sd mvs, scr = alphaBeta (board, sd) else: usetime = mytime / remainingMovesA(len(board.history)) if mytime < 6*60+increment*40: usetime *= 2 usetime += increment if usetime < 0.5: usetime = 0.5 | def go (queue): """ Finds and prints the best move from the current position """ searchLock.acquire() try: queue.put(None) # TODO: Length info should be put in the book. # Btw. 10 is not enough. Try 20 if len(board.history) < 14: movestr = getBestOpening(board) if movestr: mvs = [parseSAN(board, movestr)] if len(board.history) >= 14 or not movestr: global mytime, increment, scr lsearch.skipPruneChance = skipPruneChance lsearch.searching = True if mytime == None: lsearch.endtime = sys.maxint mvs, scr = alphaBeta (board, sd) else: usetime = mytime / remainingMovesA(len(board.history)) if mytime < 6*60+increment*40: # If game is blitz, we assume 40 moves rather than 80 usetime *= 2 # The increment is a constant. We'll use this allways usetime += increment if usetime < 0.5: # We don't wan't to search for e.g. 0 secs usetime = 0.5 starttime = time() lsearch.endtime = starttime + usetime prevtime = 0 print "Time left: %3.2f seconds; Planing to thinking for %3.2f seconds" % \ (mytime, usetime) for depth in range(1, sd+1): # Heuristic time saving # Don't waste time, if the estimated isn't enough to complete next depth if usetime > prevtime*4 or usetime <= 1: lsearch.timecheck_counter = lsearch.TIMECHECK_FREQ search_result = alphaBeta(board, depth) if lsearch.searching: mvs, scr = search_result if time() > lsearch.endtime: # Endtime occured after depth break else: # Endtime occured in depth print "Endtime occoured while I was searching depth %d" % depth break prevtime = time()-starttime - prevtime else: print "I don't have enough time to go into depth %d" % depth # Not enough time for depth break else: print "I searched through depths [1, %d]" % (sd+1) mytime -= time() - starttime mytime += increment if not mvs: if not lsearch.searching: # We were interupted lsearch.movesearches = 0 lsearch.nodes = 0 searchLock.release() return #if lsearch.last == 4: # print "resign" #else: if scr == 0: print "result", reprResult[DRAW] elif scr < 0: if board.color == WHITE: print "result", reprResult[BLACKWON] else: print "result", reprResult[WHITEWON] else: if board.color == WHITE: print "result", reprResult[WHITEWON] else: print "result", reprResult[BLACKWON] print "last:", lsearch.last, scr return print "moves were:", " ".join(listToSan(board, mvs)), scr lsearch.movesearches = 0 lsearch.nodes = 0 lsearch.searching = False move = mvs[0] print "move", toSAN(board, move) board.applyMove(move) finally: searchLock.release() | 3989d5f03e9e09f795eaf02ffa22de695b21e8e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5339/3989d5f03e9e09f795eaf02ffa22de695b21e8e9/PyChess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
261,
4000,
4672,
3536,
4163,
87,
471,
14971,
326,
3796,
3635,
628,
326,
783,
1754,
3536,
1623,
2531,
18,
1077,
1039,
1435,
775,
30,
2389,
18,
458,
12,
7036,
13,
468,
2660,
30,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
261,
4000,
4672,
3536,
4163,
87,
471,
14971,
326,
3796,
3635,
628,
326,
783,
1754,
3536,
1623,
2531,
18,
1077,
1039,
1435,
775,
30,
2389,
18,
458,
12,
7036,
13,
468,
2660,
30,
11... |
return | raise SystemExit | def run (self): """Remove files.""" print UNINSTALL_WARNING response = raw_input('Continue [y/N]? ') if response.lower() != 'y': return | 81889475a41d52b6cb1972ded80f1bb6d56539d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12852/81889475a41d52b6cb1972ded80f1bb6d56539d3/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
3536,
3288,
1390,
12123,
225,
1172,
5019,
28865,
67,
9511,
766,
273,
1831,
67,
2630,
2668,
12378,
306,
93,
19,
50,
26717,
8624,
309,
766,
18,
8167,
1435,
480,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
3536,
3288,
1390,
12123,
225,
1172,
5019,
28865,
67,
9511,
766,
273,
1831,
67,
2630,
2668,
12378,
306,
93,
19,
50,
26717,
8624,
309,
766,
18,
8167,
1435,
480,
296,... |
def encode_multipart_formdata(fields, files): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF = '\r\n' L = [] for (key, value) in fields: L.append('--' + BOUNDARY) L.append('Content-Disposition: form-data; name="%s"' % key) L.append('') L.append(value) for (key, filename, value) in files: L.append('--' + BOUNDARY) L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename)) L.append('Content-Type: %s' % get_content_type(filename)) L.append('') L.append(value) L.append('--' + BOUNDARY + '--') L.append('') body = CRLF.join(L) content_type = 'multipart/form-data; boundary=%s' % BOUNDARY return content_type, body | def doTinderboxPrint(self, contents, testlongname, testname, prettyval): lines = contents.split('\n') found = False for line in lines: if "RETURN" in line : tboxPrint = 'TinderboxPrint: ' + \ '<a title="%s" href=\'http://%s/%s\'>%s:%s</a>\n' % \ (testlongname, self.server, line.split("\t")[3], testname, prettyval) print tboxPrint found = True if not found: print >> sys.stderr, "results not added, response: \n" + contents raise Exception("graph server did not add results successfully") | def encode_multipart_formdata(fields, files): """ fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return (content_type, body) ready for httplib.HTTP instance """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF = '\r\n' L = [] for (key, value) in fields: L.append('--' + BOUNDARY) L.append('Content-Disposition: form-data; name="%s"' % key) L.append('') L.append(value) for (key, filename, value) in files: L.append('--' + BOUNDARY) L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename)) L.append('Content-Type: %s' % get_content_type(filename)) L.append('') L.append(value) L.append('--' + BOUNDARY + '--') L.append('') body = CRLF.join(L) content_type = 'multipart/form-data; boundary=%s' % BOUNDARY return content_type, body | 47bd7c2e8fd58c5a552e0b183cdc52621b97f22d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6206/47bd7c2e8fd58c5a552e0b183cdc52621b97f22d/graph_server_post.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
56,
14055,
2147,
5108,
12,
2890,
16,
2939,
16,
1842,
5748,
529,
16,
1842,
529,
16,
7517,
1125,
4672,
225,
2362,
273,
2939,
18,
4939,
2668,
64,
82,
6134,
1392,
273,
1083,
364,
980,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
56,
14055,
2147,
5108,
12,
2890,
16,
2939,
16,
1842,
5748,
529,
16,
1842,
529,
16,
7517,
1125,
4672,
225,
2362,
273,
2939,
18,
4939,
2668,
64,
82,
6134,
1392,
273,
1083,
364,
980,... |
'name': fields.char('Name', size=64, required=True), | 'name': fields.char('Communication', size=64, required=True), | def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res_users_obj = self.pool.get('res.users') res_currency_obj = self.pool.get('res.currency') res = {'value': {}} obj_partner = self.pool.get('res.partner') if context is None: context = {} if not partner_id: return res account_id = False line = self.browse(cursor, user, line_id) if not line or (line and not line[0].account_id): part = obj_partner.browse(cursor, user, partner_id, context=context) if type == 'supplier': account_id = part.property_account_payable.id else: account_id = part.property_account_receivable.id res['value']['account_id'] = account_id | 02d922e3957cc2244cf163acbaedabfef204b660 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/02d922e3957cc2244cf163acbaedabfef204b660/account_bank_statement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
3347,
16,
729,
16,
980,
67,
350,
16,
19170,
67,
350,
16,
618,
16,
5462,
67,
350,
16,
819,
33,
7036,
4672,
400,
67,
5577,
67,
2603,
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,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
3347,
16,
729,
16,
980,
67,
350,
16,
19170,
67,
350,
16,
618,
16,
5462,
67,
350,
16,
819,
33,
7036,
4672,
400,
67,
5577,
67,
2603,
273,... |
set_kw(self,kw,"fruitname","seed") set_kw(self,kw,"fruitchance",fruitchance) def tick_operation(self, op): if debug_tree: print "I this big ", self.height print `self`,"Got tick operation:" opTick=Operation("tick",to=self) opTick.time.sadd=const.basic_tick*speed result = atlas.Message(opTick) fcount = self.fruits result = result + self.drop_fruit() if self.height > sizeadult : if randint(1, self.fruitchance) == 1: if debug_tree: print "I'm growing a fruit!" self.fruits = self.fruits + 1 else: if debug_tree: print "I didn't grow a fruit" if fcount != self.fruits: if fcount == 0: newmode = "normal" else: newmode = "fruit" result = result + Operation("set",Entity(self.id,fruits=self.fruits,mode=newmode),to=self) return result def drop_fruit(self): result = atlas.Message() if self.fruits > 0: rand = randint(minudrop, maxudrop) rand = min(rand,self.fruits) self.fruits = self.fruits - rand for x in range(rand): if debug_tree: print "Creating Fruit" randx = uniform ( self.location.coordinates.x - cs( x1 * self.height, x2 * self.height, xMax) , self.location.coordinates.x + cs( x2 * self.height, x1 * self.height, xMax) ) randy = uniform ( self.location.coordinates.y - cs( y1 * self.height, y2 * self.height, yMax) , self.location.coordinates.y + cs( y2 * self.height, y1 * self.height, yMax) ) randz = 0 if hasattr(self,"coords_modify"): randx,randy,randz=coords_modify(randx,randy,randz) fruit=Entity(name=self.fruitname,location=Location(self.world,Vector3D(randx,randy,randz)),parents=[self.fruitname]) result = result + Operation("create",fruit,to=self) if debug_tree: print fruit return result | def __init__(self, cppthing, **kw): self.base_init(cppthing, kw) # The default height set_kw(self,kw,"height",10) | 8913e2e109ea220f628a50f24dc1853a67e9d780 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12932/8913e2e109ea220f628a50f24dc1853a67e9d780/Tree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3283,
2397,
310,
16,
2826,
9987,
4672,
365,
18,
1969,
67,
2738,
12,
4057,
2397,
310,
16,
5323,
13,
225,
468,
1021,
805,
2072,
444,
67,
9987,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3283,
2397,
310,
16,
2826,
9987,
4672,
365,
18,
1969,
67,
2738,
12,
4057,
2397,
310,
16,
5323,
13,
225,
468,
1021,
805,
2072,
444,
67,
9987,
12,
2890,
... | |
html_post = '</pre>' | html_post += '</pre>' | def paste(environ, start_response): params = FieldStorage(fp=environ['wsgi.input'], environ=environ, keep_blank_values = True) html_pre = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | 97ad87e206fc0882ae36b8a6caf0f808acac00d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12745/97ad87e206fc0882ae36b8a6caf0f808acac00d6/paste.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19401,
12,
28684,
16,
787,
67,
2740,
4672,
859,
273,
2286,
3245,
12,
7944,
33,
28684,
3292,
28539,
18,
2630,
17337,
5473,
33,
28684,
16,
3455,
67,
12111,
67,
2372,
273,
1053,
13,
1729,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19401,
12,
28684,
16,
787,
67,
2740,
4672,
859,
273,
2286,
3245,
12,
7944,
33,
28684,
3292,
28539,
18,
2630,
17337,
5473,
33,
28684,
16,
3455,
67,
12111,
67,
2372,
273,
1053,
13,
1729,
... |
sage: show(plot(sin,-4,4), frame=True) | sage.: show(plot(sin,-4,4), frame=True) | def show(self, xmin=None, xmax=None, ymin=None, ymax=None, figsize=DEFAULT_FIGSIZE, filename=None, dpi=DEFAULT_DPI, axes=True, axes_label=None,frame=False, **args): """ Show this graphics image with the default image viewer. | c0e21f844db5dcf442dd512ff861c952b0661fb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/c0e21f844db5dcf442dd512ff861c952b0661fb2/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
14697,
33,
5280,
67,
5236,
4574,
16,
1544,
33,
7036,
16,
16361,
33,
5280,
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,
2405,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
16,
14697,
33,
5280,
67,
5236,
4574,
16,
1544,
33,
7036,
16,
16361,
33,
5280,
67,
... |
except AttributeError: pass else: raise TestFailed, 'expected AttributeError' if b.__dict__ <> None: raise TestFailed, 'expected unassigned func.__dict__ to be None' | except AttributeError: pass else: raise TestFailed, 'expected AttributeError' if b.__dict__ <> {}: raise TestFailed, 'expected unassigned func.__dict__ to be {}' | def b(): 'my docstring' pass | 19490fcd3650b91ff20afbec3aad3295d3ad9ccd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19490fcd3650b91ff20afbec3aad3295d3ad9ccd/test_funcattrs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
13332,
296,
4811,
14525,
11,
1342,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
13332,
296,
4811,
14525,
11,
1342,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
"tcidvi" : [""], "textures" : ["", ".ps", ".eps", ".pict"], | "tcidvi" : [], "textures" : [".ps", ".eps", ".pict"], | # default suffixes for each device driver (taken from the .def files) | 54d7233db590e1bdc00b147ac889a0949af5e0de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/54d7233db590e1bdc00b147ac889a0949af5e0de/graphics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
805,
18333,
364,
1517,
2346,
3419,
261,
29113,
628,
326,
263,
536,
1390,
13,
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... | [
1,
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,
468,
805,
18333,
364,
1517,
2346,
3419,
261,
29113,
628,
326,
263,
536,
1390,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif (colls or (limit.isdigit() and nb_authors > int(limit))) and interactive == "yes": | elif interactive == "yes" and ((colls and not short_coll) or (limit.isdigit() and nb_authors > int(limit))): | def format(bfo, limit, separator='; ', extension='[...]', print_links = "yes", print_affiliations='no', affiliation_prefix = ' (', affiliation_suffix = ')', print_affiliation_first='no', interactive="no", highlight="no", affiliations_separator=" ; ", name_last_first = "yes", collaboration = "yes", id_links = "no", markup = "html", link_extension = "no", ): """ Prints the list of authors of a record. @param limit the maximum number of authors to display @param separator the separator between authors. @param extension a text printed if more authors than 'limit' exist @param print_links if yes, prints the authors as HTML link to their publications @param print_affiliations if yes, make each author name followed by its affiliation @param affiliation_prefix prefix printed before each affiliation @param affiliation_suffix suffix printed after each affiliation @param print_affiliation_first if 'yes', affiliation is printed before the author @param interactive if yes, enable user to show/hide authors when there are too many (html + javascript) @param highlight highlights authors corresponding to search query if set to 'yes' @param affiliations_separator separates affiliation groups @param name_last_first if yes (default) print last, first otherwise first last @param collaboration if yes (default) uses collaboration name in place of long author list, if available @param id_links if yes (default = no) prints link based on INSPIRE IDs if available - only used if print_links = yes @param markup html (default) or latex controls small markup differences @param link_extension if 'yes' link the extension to the detailed record page """ from urllib import quote from cgi import escape import re from invenio.config import CFG_SITE_URL from invenio.bibformat_elements.bfe_server_info import format as bfe_server #regex for parsing last and first names and initials re_last_first = re.compile('^(?P<last>[^,]+)\s*,\s*(?P<first_names>[^\,]*)(?P<extension>\,?.*)$') re_initials = re.compile(r'(?P<initial>\w)(\w+|\.)\s*') re_coll = re.compile(r'\s*collaborations?', re.IGNORECASE) from invenio.bibformat_config_inspire import CFG_BIBFORMAT_INSPIRE_INST_LINK from invenio.messages import gettext_set_language _ = gettext_set_language(bfo.lang) # load the right message language authors = [] authors = bfo.fields('100__', repeatable_subfields_p=True) authors.extend(bfo.fields('700__', repeatable_subfields_p=True)) # Keep real num of authorsfix + affiliations_separator.join(author['u']) + \ nb_authors = len(authors) # Limit num of authors, so that we do not process # the authors that will not be shown. This can only # be done in non-interactive mode, as interactive mode # allows to show all of them. if limit.isdigit() and nb_authors > int(limit) \ and interactive != "yes": if bfo.field('710g'): #check for colln note authors = authors[:1] else: authors = authors[:int(limit)] # Process authors to add link, affiliation and highlight for author in authors: if author.has_key('a'): author['a'] = author['a'][0] # There should not be # repeatable subfields here. if highlight == 'yes': from invenio import bibformat_utils author['a'] = bibformat_utils.highlight(author['a'], bfo.search_pattern) #check if we need to reverse last, first #we don't try to reverse it if it isn't stored with a comma. first_last_match = re_last_first.search(author['a']) author['display'] = author['a'] if name_last_first.lower() == "no": if first_last_match: author['display'] = first_last_match.group('first_names') + \ ' ' + \ first_last_match.group('last') + \ first_last_match.group('extension') #for latex we do initials only (asn assume first last) if markup == 'latex': if first_last_match: first = re_initials.sub('\g<initial>.~', \ first_last_match.group('first_names')) author['display'] = first + \ first_last_match.group('last') + \ first_last_match.group('extension') if print_links.lower() == "yes": # if there is an ID, search using that. id_link = '' if id_links == "yes" and author.has_key('i'): author['i'] = author['i'][0] #possible to have more IDs? id_link = '<a class="authoridlink" href="' + \ CFG_SITE_URL + \ '/search?' + \ 'ln='+ bfo.lang + \ '&p=100__i' + escape(':' + author['i']) + \ '+or+700__i' + escape(':' + author['i']) +\ '">'+escape("(ID Search)") + '</a> ' author['display'] = '<a class="authorlink" href="' + \ CFG_SITE_URL + \ '/author/'+ quote(author['a']) + \ '?ln='+ bfo.lang + \ '">'+escape(author['display'])+'</a>' + \ id_link if print_affiliations == "yes": if author.has_key('e'): author['e'] = affiliation_prefix + \ affiliations_separator.join(author['e']) + \ affiliation_suffix if author.has_key('u'): author['ilink'] = ['<a class="afflink" href="' + \ CFG_BIBFORMAT_INSPIRE_INST_LINK + \ escape(string) + \ '">' + \ string.lstrip() + \ '</a>' for string in author['u']] author['u'] = affiliation_prefix + \ affiliations_separator.join(author['ilink']) + \ affiliation_suffix | c8c2cf5be797b1d4116fae289e47ed54a8b5996d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14116/c8c2cf5be797b1d4116fae289e47ed54a8b5996d/bfe_INSPIRE_authors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
70,
617,
16,
1800,
16,
4182,
2218,
31,
2265,
2710,
2218,
63,
2777,
65,
2187,
1172,
67,
7135,
273,
315,
9707,
3113,
1172,
67,
7329,
15700,
1012,
2218,
2135,
2187,
7103,
16278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
70,
617,
16,
1800,
16,
4182,
2218,
31,
2265,
2710,
2218,
63,
2777,
65,
2187,
1172,
67,
7135,
273,
315,
9707,
3113,
1172,
67,
7329,
15700,
1012,
2218,
2135,
2187,
7103,
16278,
... |
def test_samefile(self): f = open(test_support.TESTFN + "1", "wb") try: f.write("foo") f.close() | def test_samefile(self): f = open(test_support.TESTFN + "1", "wb") try: f.write("foo") f.close() self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "1" ), True ) if hasattr(os, "symlink"): os.symlink( test_support.TESTFN + "1", test_support.TESTFN + "2" ) | def test_samefile(self): f = open(test_support.TESTFN + "1", "wb") try: f.write("foo") f.close() self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "1" ), True ) # If we don't have links, assume that os.stat doesn't return resonable # inode information and thus, that samefile() doesn't work if hasattr(os, "symlink"): os.symlink( test_support.TESTFN + "1", test_support.TESTFN + "2" ) self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "2" ), True ) os.remove(test_support.TESTFN + "2") f = open(test_support.TESTFN + "2", "wb") f.write("bar") f.close() self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "2" ), False ) finally: if not f.close(): f.close() try: os.remove(test_support.TESTFN + "1") except os.error: pass try: os.remove(test_support.TESTFN + "2") except os.error: pass | 3daf60bdfe4bb713399929b64a36849597f2be05 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3daf60bdfe4bb713399929b64a36849597f2be05/test_posixpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14307,
768,
12,
2890,
4672,
284,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
397,
315,
21,
3113,
315,
9464,
7923,
775,
30,
284,
18,
2626,
2932,
11351,
7923,
284,
18,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14307,
768,
12,
2890,
4672,
284,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
397,
315,
21,
3113,
315,
9464,
7923,
775,
30,
284,
18,
2626,
2932,
11351,
7923,
284,
18,
44... |
The patches must not be applied. With -k, the patch files are preserved in the patch directory.""" | With --forget, mq will stop managing the named patches. The patches must be applied and at the base of the stack. This option is useful when the patches have been applied upstream. Otherwise, the patches must not be applied. With --keep, the patch files are preserved in the patch directory.""" | def delete(ui, repo, patch, *patches, **opts): """remove patches from queue The patches must not be applied. With -k, the patch files are preserved in the patch directory.""" q = repo.mq q.delete(repo, (patch,) + patches, keep=opts.get('keep')) q.save_dirty() return 0 | 51580bdfb468330b010bd4b9364c4461e97f7604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/51580bdfb468330b010bd4b9364c4461e97f7604/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
4881,
16,
3538,
16,
4729,
16,
380,
30278,
16,
2826,
4952,
4672,
3536,
4479,
16482,
628,
2389,
225,
3423,
1493,
1884,
588,
16,
18327,
903,
2132,
30632,
326,
4141,
16482,
18,
102... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
4881,
16,
3538,
16,
4729,
16,
380,
30278,
16,
2826,
4952,
4672,
3536,
4479,
16482,
628,
2389,
225,
3423,
1493,
1884,
588,
16,
18327,
903,
2132,
30632,
326,
4141,
16482,
18,
102... |
status(status='error') | self.status(status='error') | def __call__(self): options, args, parser = self.parse_options() self.parser = parser self.options = options import tempfile from mwlib.mwapidb import MWAPIError from mwlib.writerbase import WriterError from mwlib.status import Status | b4247c76bd1169d4393aaa2f80f31a2e1e1f2405 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/b4247c76bd1169d4393aaa2f80f31a2e1e1f2405/render.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
702,
16,
833,
16,
2082,
273,
365,
18,
2670,
67,
2116,
1435,
365,
18,
4288,
273,
2082,
365,
18,
2116,
273,
702,
225,
1930,
13275,
628,
14721,
2941,
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,
1001,
1991,
972,
12,
2890,
4672,
702,
16,
833,
16,
2082,
273,
365,
18,
2670,
67,
2116,
1435,
365,
18,
4288,
273,
2082,
365,
18,
2116,
273,
702,
225,
1930,
13275,
628,
14721,
2941,
18,
... |
subdivisions between each major tick - ``absolute`` - (default: False) if True, makes a huge ruler in the direction of an axis - ``snap`` - (default: False) if True, snaps to an implied grid | subdivisions between each major tick. - ``absolute`` - (default: ``False``) if ``True``, makes a huge ruler in the direction of an axis. - ``snap`` - (default: ``False``) if ``True``, snaps to an implied grid. | def ruler(start, end, ticks=4, sub_ticks=4, absolute=False, snap=False, **kwds): """ Draw a ruler in 3D, with major and minor ticks. INPUT: - ``start`` - the beginning of the ruler, as a list, tuple, or vector - ``end`` - the end of the ruler, as a list, tuple, or vector - ``ticks`` - (default: 4) the number of major ticks shown on the ruler - ``sub_ticks`` - (default: 4) the number of shown subdivisions between each major tick - ``absolute`` - (default: False) if True, makes a huge ruler in the direction of an axis - ``snap`` - (default: False) if True, snaps to an implied grid Type ``line3d.options`` for a dictionary of the default options for lines which are also available. EXAMPLES: A ruler:: sage: from sage.plot.plot3d.shapes2 import ruler sage: R = ruler([1,2,3],vector([2,3,4])); R A ruler with some options:: sage: R = ruler([1,2,3],vector([2,3,4]),ticks=6, sub_ticks=2, color='red'); R The keyword ``snap`` makes the ticks not necessarily coincide with the ruler:: sage: ruler([1,2,3],vector([1,2,4]),snap=True) The keyword ``absolute`` makes a huge ruler in one of the axis directions:: sage: ruler([1,2,3],vector([1,2,4]),absolute=True) TESTS:: sage: ruler([1,2,3],vector([1,3,4]),absolute=True) Traceback (most recent call last): ... ValueError: Absolute rulers only valid for axis-aligned paths """ start = vector(RDF, start) end = vector(RDF, end) dir = end - start dist = math.sqrt(dir.dot_product(dir)) dir /= dist one_tick = dist/ticks * 1.414 unit = 10 ** math.floor(math.log(dist/ticks, 10)) if unit * 5 < one_tick: unit *= 5 elif unit * 2 < one_tick: unit *= 2 if dir[0]: tick = dir.cross_product(vector(RDF, (0,0,-dist/30))) elif dir[1]: tick = dir.cross_product(vector(RDF, (0,0,dist/30))) else: tick = vector(RDF, (dist/30,0,0)) if snap: for i in range(3): start[i] = unit * math.floor(start[i]/unit + 1e-5) end[i] = unit * math.ceil(end[i]/unit - 1e-5) if absolute: if dir[0]*dir[1] or dir[1]*dir[2] or dir[0]*dir[2]: raise ValueError, "Absolute rulers only valid for axis-aligned paths" m = max(dir[0], dir[1], dir[2]) if dir[0] == m: off = start[0] elif dir[1] == m: off = start[1] else: off = start[2] first_tick = unit * math.ceil(off/unit - 1e-5) - off else: off = 0 first_tick = 0 ruler = shapes.LineSegment(start, end, **kwds) for k in range(1, int(sub_ticks * first_tick/unit)): P = start + dir*(k*unit/sub_ticks) ruler += shapes.LineSegment(P, P + tick/2, **kwds) for d in srange(first_tick, dist + unit/(sub_ticks+1), unit): P = start + dir*d ruler += shapes.LineSegment(P, P + tick, **kwds) ruler += shapes.Text(str(d+off), **kwds).translate(P - tick) if dist - d < unit: sub_ticks = int(sub_ticks * (dist - d)/unit) for k in range(1, sub_ticks): P += dir * (unit/sub_ticks) ruler += shapes.LineSegment(P, P + tick/2, **kwds) return ruler | a074a851cc2fcbb495453d24cda3b4b1c0b78eec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a074a851cc2fcbb495453d24cda3b4b1c0b78eec/shapes2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
17040,
12,
1937,
16,
679,
16,
13003,
33,
24,
16,
720,
67,
11767,
33,
24,
16,
4967,
33,
8381,
16,
10915,
33,
8381,
16,
2826,
25577,
4672,
3536,
10184,
279,
436,
17040,
316,
890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
17040,
12,
1937,
16,
679,
16,
13003,
33,
24,
16,
720,
67,
11767,
33,
24,
16,
4967,
33,
8381,
16,
10915,
33,
8381,
16,
2826,
25577,
4672,
3536,
10184,
279,
436,
17040,
316,
890,
... |
isplot = re.compile(r'^[^%]*\\(?:side|full)?plot\*?\s*\{([^\}]+)') | isplot = re.compile(r'^[^%]*\\(?:side|full)?plot\*?\s*(?:\[[htbp]+\])\{([^\}]+)') | def dummy(target=None,source=None,env=None): tex = open(str(target[0]),'w') tex.write('%% This file is automatically generated. Do not edit!\n') user = commands.getoutput('whoami') name = string.split(commands.getoutput('finger -m ' + user),'\n').pop(0) real = re.match(r'^.*:\s*(.*)$',name) if real: name = real.group(1) else: name = 'Anonymous' tex.write('\\author{%s}\n' % name) tex.write('\\title{Dummy paper}\n\n\maketitle\n') dirold = '' for src in source: fig = str(src) plt = os.path.splitext(os.path.basename(fig))[0] plt2 = string.replace(plt,'_','\_') dir = os.path.split(os.path.split(fig)[0])[0] if dir != dirold: tex.write('\n\\section{%s}\n' % dir) tex.write('\\inputdir{%s}\n\n' % dir) dirold = dir tex.write('\\plot{%s}{width=\\textwidth}{%s/%s} ' % (plt,dir,plt2)) tex.write('\\clearpage\n') tex.close() return 0 | 5381a8c7972fea209b32eb3f89086bd59daa35cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3143/5381a8c7972fea209b32eb3f89086bd59daa35cf/rsftex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9609,
12,
3299,
33,
7036,
16,
3168,
33,
7036,
16,
3074,
33,
7036,
4672,
16573,
273,
1696,
12,
701,
12,
3299,
63,
20,
65,
3631,
11,
91,
6134,
16573,
18,
2626,
2668,
11438,
1220,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9609,
12,
3299,
33,
7036,
16,
3168,
33,
7036,
16,
3074,
33,
7036,
4672,
16573,
273,
1696,
12,
701,
12,
3299,
63,
20,
65,
3631,
11,
91,
6134,
16573,
18,
2626,
2668,
11438,
1220,
585,
... |
ignore_blank_lines='-B' in diff_options, ignore_case='-i' in diff_options, ignore_space_changes='-b' in diff_options) | ignore_blank_lines='-B' in diff_options[1], ignore_case='-i' in diff_options[1], ignore_space_changes='-b' in diff_options[1]) | def render_html(self, req, repos, chgset, diff_options): """HTML version""" req.hdf['title'] = '[%s]' % chgset.rev req.hdf['changeset'] = { 'revision': chgset.rev, 'time': time.strftime('%c', time.localtime(chgset.date)), 'author': util.escape(chgset.author or 'anonymous'), 'message': wiki_to_html(chgset.message or '--', self.env, req, escape_newlines=True) } | 48c56ad401dad6fa254a7be7f860bb61cf7062f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/48c56ad401dad6fa254a7be7f860bb61cf7062f3/Changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
2620,
12,
2890,
16,
1111,
16,
13686,
16,
462,
75,
542,
16,
3122,
67,
2116,
4672,
3536,
4870,
1177,
8395,
1111,
18,
26428,
3292,
2649,
3546,
273,
21848,
87,
3864,
738,
462,
75... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
2620,
12,
2890,
16,
1111,
16,
13686,
16,
462,
75,
542,
16,
3122,
67,
2116,
4672,
3536,
4870,
1177,
8395,
1111,
18,
26428,
3292,
2649,
3546,
273,
21848,
87,
3864,
738,
462,
75... |
return 1 | return True | def allowance(self, filename): """Preconditions: - our agent applies to this entry - filename is URLdecoded""" for line in self.rulelines: _verbosedebug((filename, str(line), line.allowance)) if line.applies_to(filename): return line.allowance return 1 | 9f86ae009f1e74ee040c0d6e683bcba6894a674b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4845/9f86ae009f1e74ee040c0d6e683bcba6894a674b/robotparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1699,
1359,
12,
2890,
16,
1544,
4672,
3536,
1386,
6381,
30,
300,
3134,
4040,
10294,
358,
333,
1241,
300,
1544,
353,
1976,
26646,
8395,
364,
980,
316,
365,
18,
86,
332,
14567,
30,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1699,
1359,
12,
2890,
16,
1544,
4672,
3536,
1386,
6381,
30,
300,
3134,
4040,
10294,
358,
333,
1241,
300,
1544,
353,
1976,
26646,
8395,
364,
980,
316,
365,
18,
86,
332,
14567,
30,
389,
... |
self._addDebugInterestHistory("RESET", "", 0, 0, 0, []) | if __debug__: self._addDebugInterestHistory("RESET", "", 0, 0, 0, []) | def resetInterestStateForConnectionLoss(self): DoInterestManager._interests.clear() self._outstandingScopes = set() self._completeEventCount = ScratchPad(num=0) self._addDebugInterestHistory("RESET", "", 0, 0, 0, []) | b00eff64e06f6e95d740f7cb3c0a57b65dc26721 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/b00eff64e06f6e95d740f7cb3c0a57b65dc26721/DoInterestManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
29281,
1119,
1290,
1952,
20527,
12,
2890,
4672,
2256,
29281,
1318,
6315,
2761,
25563,
18,
8507,
1435,
365,
6315,
659,
15167,
12668,
273,
444,
1435,
365,
6315,
6226,
1133,
1380,
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,
2715,
29281,
1119,
1290,
1952,
20527,
12,
2890,
4672,
2256,
29281,
1318,
6315,
2761,
25563,
18,
8507,
1435,
365,
6315,
659,
15167,
12668,
273,
444,
1435,
365,
6315,
6226,
1133,
1380,
273,
... |
ci.append(-2.5, -2.0, 3.0) ci.append(-1.5, -2.0, 4.0) ci.append(1.5, -2.0, -3.0) ci.append(2.5, -2.0, 0.0) | ci.append((-2.5, -2.0, 3.0)) ci.append((-1.5, -2.0, 4.0)) ci.append((1.5, -2.0, -3.0)) ci.append((2.5, -2.0, 0.0)) | def make_ctlpoints(): c = [] # ci = [] ci.append(-2.5, -3.7, 1.0) ci.append(-1.5, -3.7, 3.0) ci.append(1.5, -3.7, -2.5) ci.append(2.5, -3.7, -0.75) c.append(ci) # ci = [] ci.append(-2.5, -2.0, 3.0) ci.append(-1.5, -2.0, 4.0) ci.append(1.5, -2.0, -3.0) ci.append(2.5, -2.0, 0.0) c.append(ci) # ci = [] ci.append(-2.5, 2.0, 1.0) ci.append(-1.5, 2.0, 0.0) ci.append(1.5, 2.0, -1.0) ci.append(2.5, 2.0, 2.0) c.append(ci) # ci = [] ci.append(-2.5, 2.7, 1.25) ci.append(-1.5, 2.7, 0.1) ci.append(1.5, 2.7, -0.6) ci.append(2.5, 2.7, 0.2) c.append(ci) # return c | 062c870df054eb11558984a420ed98a4052153ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/062c870df054eb11558984a420ed98a4052153ff/nurbs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
12930,
4139,
13332,
276,
273,
5378,
468,
9039,
273,
5378,
9039,
18,
6923,
19236,
22,
18,
25,
16,
225,
300,
23,
18,
27,
16,
225,
404,
18,
20,
13,
9039,
18,
6923,
19236,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
12930,
4139,
13332,
276,
273,
5378,
468,
9039,
273,
5378,
9039,
18,
6923,
19236,
22,
18,
25,
16,
225,
300,
23,
18,
27,
16,
225,
404,
18,
20,
13,
9039,
18,
6923,
19236,
21,
... |
if type == 'head': | if tag_base == 'head': | def __init__(self,cp,dir='',type='plot'): | e7dc96264f8fa6761fca7488785053e6db4d6c14 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/e7dc96264f8fa6761fca7488785053e6db4d6c14/stfu_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4057,
16,
1214,
2218,
2187,
723,
2218,
4032,
11,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4057,
16,
1214,
2218,
2187,
723,
2218,
4032,
11,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
wikipedia.output(u"Page [[%s]] not saved; sysop privileges required." % redir.title()) | wikipedia.output( u"Page [[%s]] not saved; sysop privileges required." % redir.title()) | def fix_1_double_redirect(self, redir_name): redir = wikipedia.Page(self.site, redir_name) # Show the title of the page we're working on. # Highlight the title in purple. wikipedia.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % redir.title()) newRedir = redir redirList = [] # bookkeeping to detect loops while True: redirList.append(u'%s:%s' % (newRedir.site().lang, newRedir.sectionFreeTitle())) try: targetPage = newRedir.getRedirectTarget() except wikipedia.IsNotRedirectPage: if len(redirList) == 1: wikipedia.output(u'Skipping: Page %s is not a redirect.' % redir.aslink()) break #do nothing elif len(redirList) == 2: wikipedia.output( u'Skipping: Redirect target %s is not a redirect.' % newRedir.aslink()) break # do nothing except wikipedia.SectionError: wikipedia.output( u'Warning: Redirect target section %s doesn\'t exist.' % newRedir.aslink()) except wikipedia.BadTitle, e: # str(e) is in the format 'BadTitle: [[Foo]]' wikipedia.output( u'Warning: Redirect target %s is not a valid page title.' % str(e)[10:]) #sometimes this error occures. Invalid Title starting with a '#' except wikipedia.InvalidTitle, err: wikipedia.output(u'Warning: %s' % err) break except wikipedia.NoPage: if len(redirList) == 1: wikipedia.output(u'Skipping: Page %s does not exist.' % redir.aslink()) break else: if self.always: wikipedia.output( u"Skipping: Redirect target %s doesn't exist." % newRedir.aslink()) break # skip if automatic else: wikipedia.output( u"Warning: Redirect target %s doesn't exist." % newRedir.aslink()) except wikipedia.ServerError: wikipedia.output(u'Skipping: Server Error') break else: wikipedia.output( u' Links to: %s.' % targetPage.aslink()) if targetPage.site() != self.site: wikipedia.output(u'Warning: redirect target (%s) is on a different site.' % (targetPage.aslink())) if self.always: break # skip if automatic # watch out for redirect loops if redirList.count(u'%s:%s' % (targetPage.site().lang, targetPage.sectionFreeTitle()) ) > 0: wikipedia.output( u'Warning: Redirect target %s forms a redirect loop.' % targetPage.aslink()) break ###xqt doesn't work. edits twice! try: content = targetPage.get(get_redirect=True) except wikipedia.SectionError: content = wikipedia.Page( targetPage.site(), targetPage.sectionFreeTitle() ).get(get_redirect=True) if targetPage.site().lang in sd_template \ and targetPage.site().lang in sd_tagging_sum: wikipedia.output(u"Tagging redirect for deletion") # Delete the two redirects content = wikipedia.translate(targetPage.site().lang, sd_template)+"\n"+content summ = wikipedia.translate(targetPage.site().lang, sd_tagging_sum) targetPage.put(content, summ) redir.put(content, summ) else: break # TODO Better implement loop redirect else: newRedir = targetPage continue # try: oldText = redir.get(get_redirect=True) except wikipedia.BadTitle: wikipedia.output(u"Bad Title Error") break text = self.site.redirectRegex().sub( '#%s %s' % (self.site.redirect( True ), targetPage.aslink()), oldText) if text == oldText: break summary = wikipedia.translate(self.site, msg_double) % targetPage.aslink() wikipedia.showDiff(oldText, text) if self.prompt(u'Do you want to accept the changes?'): try: redir.put(text, summary) except wikipedia.LockedPage: wikipedia.output(u'%s is locked.' % redir.title()) except wikipedia.SpamfilterError, error: wikipedia.output(u"Saving page [[%s]] prevented by spam filter: %s" % (redir.title(), error.url)) except wikipedia.PageNotSaved, error: wikipedia.output(u"Saving page [[%s]] failed: %s" % (redir.title(), error)) except wikipedia.NoUsername: wikipedia.output(u"Page [[%s]] not saved; sysop privileges required." % redir.title()) except wikipedia.Error, error: wikipedia.output(u"Unexpected error occurred trying to save [[%s]]: %s" % (redir.title(), error)) break | c499f5c4d7eb66e6b361af0a88786c3f2ea91f11 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/c499f5c4d7eb66e6b361af0a88786c3f2ea91f11/redirect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
21,
67,
9056,
67,
7590,
12,
2890,
16,
225,
283,
1214,
67,
529,
4672,
283,
1214,
273,
21137,
18,
1964,
12,
2890,
18,
4256,
16,
283,
1214,
67,
529,
13,
468,
9674,
326,
2077,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
21,
67,
9056,
67,
7590,
12,
2890,
16,
225,
283,
1214,
67,
529,
4672,
283,
1214,
273,
21137,
18,
1964,
12,
2890,
18,
4256,
16,
283,
1214,
67,
529,
13,
468,
9674,
326,
2077,
... |
if not hasattr(self, '_v_total'): self._v_total = 0 | def catalog_object(self, obj, uid): """ wrapper around catalog """ if not hasattr(self, '_v_total'): self._v_total = 0 self._v_total = (self._v_total + self._catalog.catalogObject(obj, uid, self.threshold)) if self._v_total > self.threshold: get_transaction().commit(1) self._v_total = 0 | 8f1d78c8726f1c96d9a6e93168576401ed8a01fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f1d78c8726f1c96d9a6e93168576401ed8a01fa/ZCatalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6222,
67,
1612,
12,
2890,
16,
1081,
16,
4555,
4672,
3536,
4053,
6740,
6222,
3536,
365,
6315,
90,
67,
4963,
273,
261,
2890,
6315,
90,
67,
4963,
397,
365,
6315,
7199,
18,
7199,
921,
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,
6222,
67,
1612,
12,
2890,
16,
1081,
16,
4555,
4672,
3536,
4053,
6740,
6222,
3536,
365,
6315,
90,
67,
4963,
273,
261,
2890,
6315,
90,
67,
4963,
397,
365,
6315,
7199,
18,
7199,
921,
12,
... | |
`j_1\ge|m_1|`, `j_2\ge|m_2|`, `j_3\ge|m_3|` | `j_1 \ge |m_1|`, `j_2 \ge |m_2|`, `j_3 \ge |m_3|` | def wigner_3j(j_1, j_2, j_3, m_1, m_2, m_3, prec=None): r""" Calculate the Wigner 3j symbol `Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3)`. INPUT: - ``j_1``, ``j_2``, ``j_3``, ``m_1``, ``m_2``, ``m_3`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_3j(2, 6, 4, 0, 0, 0) sqrt(5/143) sage: wigner_3j(2, 6, 4, 0, 0, 1) 0 sage: wigner_3j(0.5, 0.5, 1, 0.5, -0.5, 0) sqrt(1/6) sage: wigner_3j(40, 100, 60, -10, 60, -50) 95608/18702538494885*sqrt(21082735836735314343364163310/220491455010479533763) sage: wigner_3j(2500, 2500, 5000, 2488, 2400, -4888, prec=64) 7.60424456883448589e-12 It is an error to have arguments that are not integer or half integer values:: sage: wigner_3j(2.1, 6, 4, 0, 0, 0) Traceback (most recent call last): ... ValueError: j values must be integer or half integer sage: wigner_3j(2, 6, 4, 1, 0, -1.1) Traceback (most recent call last): ... ValueError: m values must be integer or half integer NOTES: The Wigner 3j symbol obeys the following symmetry rules: - invariant under any permutation of the columns (with the exception of a sign change where `J:=j_1+j_2+j_3`): .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =Wigner3j(j_3,j_1,j_2,m_3,m_1,m_2) =Wigner3j(j_2,j_3,j_1,m_2,m_3,m_1) =(-1)^J Wigner3j(j_3,j_2,j_1,m_3,m_2,m_1) =(-1)^J Wigner3j(j_1,j_3,j_2,m_1,m_3,m_2) =(-1)^J Wigner3j(j_2,j_1,j_3,m_2,m_1,m_3) - invariant under space inflection, i. e. .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =(-1)^J Wigner3j(j_1,j_2,j_3,-m_1,-m_2,-m_3) - symmetric with respect to the 72 additional symmetries based on the work by [Regge58] - zero for `j_1`, `j_2`, `j_3` not fulfilling triangle relation - zero for `m_1+m_2+m_3\neq 0` - zero for violating any one of the conditions `j_1\ge|m_1|`, `j_2\ge|m_2|`, `j_3\ge|m_3|` ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 3j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge58] 'Symmetry Properties of Clebsch-Gordan Coefficients', T. Regge, Nuovo Cimento, Volume 10, pp. 544 (1958) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) AUTHORS: - Jens Rasch (2009-03-24): initial version """ if int(j_1 * 2) != j_1 * 2 or int(j_2 * 2) != j_2 * 2 or \ int(j_3 * 2) != j_3 * 2: raise ValueError("j values must be integer or half integer") if int(m_1 * 2) != m_1 * 2 or int(m_2 * 2) != m_2 * 2 or \ int(m_3 * 2) != m_3 * 2: raise ValueError("m values must be integer or half integer") if (m_1 + m_2 + m_3 <> 0): return 0 prefid = Integer((-1) ** (int(j_1 - j_2 - m_3))) m_3 = -m_3 a1 = j_1 + j_2 - j_3 if (a1 < 0): return 0 a2 = j_1 - j_2 + j_3 if (a2 < 0): return 0 a3 = -j_1 + j_2 + j_3 if (a3 < 0): return 0 if (abs(m_1) > j_1) or (abs(m_2) > j_2) or (abs(m_3) > j_3): return 0 maxfact = max(j_1 + j_2 + j_3 + 1, j_1 + abs(m_1), j_2 + abs(m_2), \ j_3 + abs(m_3)) _calc_factlist(maxfact) argsqrt = Integer(_Factlist[int(j_1 + j_2 - j_3)] * \ _Factlist[int(j_1 - j_2 + j_3)] * \ _Factlist[int(-j_1 + j_2 + j_3)] * \ _Factlist[int(j_1 - m_1)] * \ _Factlist[int(j_1 + m_1)] * \ _Factlist[int(j_2 - m_2)] * \ _Factlist[int(j_2 + m_2)] * \ _Factlist[int(j_3 - m_3)] * \ _Factlist[int(j_3 + m_3)]) / \ _Factlist[int(j_1 + j_2 + j_3 + 1)] ressqrt = argsqrt.sqrt(prec) if type(ressqrt) is ComplexNumber: ressqrt = ressqrt.real() imin = max(-j_3 + j_1 + m_2, -j_3 + j_2 - m_1, 0) imax = min(j_2 + m_2, j_1 - m_1, j_1 + j_2 - j_3) sumres = 0 for ii in range(imin, imax + 1): den = _Factlist[ii] * \ _Factlist[int(ii + j_3 - j_1 - m_2)] * \ _Factlist[int(j_2 + m_2 - ii)] * \ _Factlist[int(j_1 - ii - m_1)] * \ _Factlist[int(ii + j_3 - j_2 + m_1)] * \ _Factlist[int(j_1 + j_2 - j_3 - ii)] sumres = sumres + Integer((-1) ** ii) / den res = ressqrt * sumres * prefid return res | 7df69c5c6f107763eb9f25a2174930b0961c0f48 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/7df69c5c6f107763eb9f25a2174930b0961c0f48/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
instanceCat.objectType = 'POINT' | def doOneCatalogType(self, catalogType, queryTypes, obsHistID): #nFN = self.getNextGoodFileNum() self.executionDBManager = jobDB.JobState() t0 = self.executionDBManager.getJobId() | fa2e63a27dcb0519a268db93e01ae343ce3245f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/91/fa2e63a27dcb0519a268db93e01ae343ce3245f5/jobAllocator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
3335,
9769,
559,
12,
2890,
16,
6222,
559,
16,
843,
2016,
16,
7160,
8648,
734,
4672,
468,
82,
19793,
273,
365,
18,
588,
2134,
18195,
812,
2578,
1435,
365,
18,
16414,
2290,
1318,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
3335,
9769,
559,
12,
2890,
16,
6222,
559,
16,
843,
2016,
16,
7160,
8648,
734,
4672,
468,
82,
19793,
273,
365,
18,
588,
2134,
18195,
812,
2578,
1435,
365,
18,
16414,
2290,
1318,
27... | |
return S_OK( value ) | return S_OK( value.replace( '"', "'" ) ) | def cleanValue( value ): value = value.strip() if value[0] == '"': entries = [] iPos = 1 current = "" state = "in" while iPos < len( value ): if value[ iPos ] == '"': if state == "in": entries.append( current ) current = "" state = "out" elif state == "out": current = current.strip() if current not in ( ",", ): return S_ERROR( "value seems a list but is not separated in commas" ) current = "" state = "in" else: current += value[ iPos ] iPos += 1 if state == "in": return S_ERROR( 'value is opened with " but is not closed' ) return S_OK( ", ".join ( entries ) ) else: return S_OK( value ) | e3debe1437d39b0821106c971059c340c16c7e1f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/e3debe1437d39b0821106c971059c340c16c7e1f/JDL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
620,
12,
460,
262,
30,
460,
273,
460,
18,
6406,
1435,
309,
460,
63,
20,
65,
422,
2119,
4278,
3222,
273,
5378,
277,
1616,
273,
404,
783,
273,
1408,
919,
273,
315,
267,
6,
1323,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
620,
12,
460,
262,
30,
460,
273,
460,
18,
6406,
1435,
309,
460,
63,
20,
65,
422,
2119,
4278,
3222,
273,
5378,
277,
1616,
273,
404,
783,
273,
1408,
919,
273,
315,
267,
6,
1323,
... |
def get_lastversion_of_many( klas, query, obj_id =(), | get_lastversion_of_many( klas, query, obj_id =(), | def get_lastversion_of_many( klas, query, obj_id =(), time =None, with_disabled =False, **setup_kargs): | 0fb92a565349623415ef0fae2cfa4ab7c1f0d6c3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10808/0fb92a565349623415ef0fae2cfa4ab7c1f0d6c3/timed_sa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
336,
67,
2722,
1589,
67,
792,
67,
9353,
12,
417,
9521,
16,
843,
16,
1081,
67,
350,
273,
9334,
813,
273,
7036,
16,
598,
67,
9278,
273,
8381,
16,
2826,
8401,
67,
79,
1968,
4672,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
336,
67,
2722,
1589,
67,
792,
67,
9353,
12,
417,
9521,
16,
843,
16,
1081,
67,
350,
273,
9334,
813,
273,
7036,
16,
598,
67,
9278,
273,
8381,
16,
2826,
8401,
67,
79,
1968,
4672,
2,
-100,
-... |
if self.form_result.get('result'): | if self.form_result.get('result')!='all': | def votes(self, id, format='html'): c.poll = get_entity_or_abort(model.Poll, id) require.poll.show(c.poll) decisions = democracy.Decision.for_poll(c.poll) if self.form_result.get('result'): decisions = filter(lambda d: d.result == self.form_result.get('result'), decisions) c.decisions_pager = pager.scope_decisions(decisions) if format == 'json': return render_json(c.decisions_pager) return render("/poll/votes.html") | 80b37c5a0b52af03e4b3cee25048458198c4c587 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/80b37c5a0b52af03e4b3cee25048458198c4c587/poll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19588,
12,
2890,
16,
612,
16,
740,
2218,
2620,
11,
4672,
276,
18,
13835,
273,
336,
67,
1096,
67,
280,
67,
18623,
12,
2284,
18,
19085,
16,
612,
13,
2583,
18,
13835,
18,
4500,
12,
71,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19588,
12,
2890,
16,
612,
16,
740,
2218,
2620,
11,
4672,
276,
18,
13835,
273,
336,
67,
1096,
67,
280,
67,
18623,
12,
2284,
18,
19085,
16,
612,
13,
2583,
18,
13835,
18,
4500,
12,
71,
... |
log(log.Info, "serial", "Device started, serial interface running.") | log(Log.Info, "serial", "Device started, serial interface running.") | def start(self): self._handler.start() log(log.Info, "serial", "Device started, serial interface running.") | 94e8bb1bfc2a5fb9fcdfdd72fe0ce6487e350736 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12317/94e8bb1bfc2a5fb9fcdfdd72fe0ce6487e350736/Serial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
6315,
4176,
18,
1937,
1435,
613,
12,
1330,
18,
966,
16,
315,
8818,
3113,
315,
3654,
5746,
16,
2734,
1560,
3549,
1199,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
6315,
4176,
18,
1937,
1435,
613,
12,
1330,
18,
966,
16,
315,
8818,
3113,
315,
3654,
5746,
16,
2734,
1560,
3549,
1199,
13,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
return GetData( lang, params ) def GetLinks( lang, titles, extraParams = None ): | return GetData(site, params ) def GetLinks(site, titles, extraParams = None ): | def GetInterwikies( lang, titles, extraParams = None ): """ Usage example: data = GetInterwikies('ru','user:yurik') titles may be either ane title (as a string), or a list of strings extraParams if given must be a dict() as taken by GetData() """ params = {'titles':ListToParam(titles), 'what' : 'redirects|langlinks'} params = CombineParams( params, extraParams ) return GetData( lang, params ) | 3524e338086618d1dabcda0ee7578a46a28e59e3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/3524e338086618d1dabcda0ee7578a46a28e59e3/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2465,
11999,
606,
12,
3303,
16,
14693,
16,
2870,
1370,
273,
599,
262,
30,
3536,
10858,
3454,
30,
501,
273,
968,
2465,
11999,
606,
2668,
8653,
17023,
1355,
30,
93,
1650,
79,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2465,
11999,
606,
12,
3303,
16,
14693,
16,
2870,
1370,
273,
599,
262,
30,
3536,
10858,
3454,
30,
501,
273,
968,
2465,
11999,
606,
2668,
8653,
17023,
1355,
30,
93,
1650,
79,
6134,
... |
cursor = self.db.execute("select * from runs") | cursor = self.db.db.execute("select * from runs") | def execute_magic(self, cmdline): cmd_end = cmdline.find(" ") if cmd_end == -1: cmd = cmdline[1:] args = "" else: cmd = cmdline[1:cmd_end] args = cmdline[cmd_end+1:] | c57cb376e1a7288e570db78785f22bfcb199fdcf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12871/c57cb376e1a7288e570db78785f22bfcb199fdcf/runalyzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
11179,
12,
2890,
16,
22877,
4672,
1797,
67,
409,
273,
22877,
18,
4720,
2932,
9369,
309,
1797,
67,
409,
422,
300,
21,
30,
1797,
273,
22877,
63,
21,
26894,
833,
273,
1408,
469,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
11179,
12,
2890,
16,
22877,
4672,
1797,
67,
409,
273,
22877,
18,
4720,
2932,
9369,
309,
1797,
67,
409,
422,
300,
21,
30,
1797,
273,
22877,
63,
21,
26894,
833,
273,
1408,
469,... |
items[url_unquote_plus(key)] = value | key = url_unquote_plus(key) try: key = str(key) except UnicodeError: pass items[key] = value | def unserialize(cls, string, secret_key): """Load the secure cookie from a serialized string.""" if isinstance(string, unicode): string = string.encode('utf-8', 'ignore') salt = string[:4] try: base64_hash, data = string[4:].split('?', 1) except (ValueError, IndexError): items = () else: items = {} hash = sha1(secret_key + salt) for item in data.split('&'): hash.update('|' + item) if not '=' in item: items = None break key, value = item.split('=', 1) items[url_unquote_plus(key)] = value | 84eabcaa81f60d47939ac2d43f01d01eeab598a4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14437/84eabcaa81f60d47939ac2d43f01d01eeab598a4/securecookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10954,
12,
6429,
16,
533,
16,
4001,
67,
856,
4672,
3536,
2563,
326,
8177,
3878,
628,
279,
5343,
533,
12123,
309,
1549,
12,
1080,
16,
5252,
4672,
533,
273,
533,
18,
3015,
2668,
3158,
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,
10954,
12,
6429,
16,
533,
16,
4001,
67,
856,
4672,
3536,
2563,
326,
8177,
3878,
628,
279,
5343,
533,
12123,
309,
1549,
12,
1080,
16,
5252,
4672,
533,
273,
533,
18,
3015,
2668,
3158,
17... |
if self.elementInScope("tbody", True) or \ self.elementInScope("thead", True) or \ self.elementInScope("tfoot", True): | if self.parser.elementInScope("tbody", True) or \ self.parser.elementInScope("thead", True) or \ self.parser.elementInScope("tfoot", True): | def startTagTableOther(self, name, attributes): # XXX AT Any ideas on how to share this with endTagTable? if self.elementInScope("tbody", True) or \ self.elementInScope("thead", True) or \ self.elementInScope("tfoot", True): self.clearStackToTableBodyContext() self.endTagTableRowGroup(self.parser.openElements[-1]) else: # innerHTML case self.parser.parseError() | ff3cb9ccd4f2187f0dd0c5d17a8a5955ca4fc12f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/ff3cb9ccd4f2187f0dd0c5d17a8a5955ca4fc12f/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
1388,
8290,
12,
2890,
16,
508,
16,
1677,
4672,
468,
11329,
14464,
5502,
10572,
345,
603,
3661,
358,
7433,
333,
598,
29765,
1388,
35,
309,
365,
18,
4288,
18,
2956,
382,
3876,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
1388,
8290,
12,
2890,
16,
508,
16,
1677,
4672,
468,
11329,
14464,
5502,
10572,
345,
603,
3661,
358,
7433,
333,
598,
29765,
1388,
35,
309,
365,
18,
4288,
18,
2956,
382,
3876,
... |
h = self.__get_font_height(style_name) y += h * 0.15 | def __draw_box(self, text, color, color_count, generation, top, height): | cf7685d3510e0a8311694f7721ff3f1b53e4d250 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1491/cf7685d3510e0a8311694f7721ff3f1b53e4d250/FamilyTree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9446,
67,
2147,
12,
2890,
16,
977,
16,
2036,
16,
2036,
67,
1883,
16,
9377,
16,
1760,
16,
2072,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9446,
67,
2147,
12,
2890,
16,
977,
16,
2036,
16,
2036,
67,
1883,
16,
9377,
16,
1760,
16,
2072,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
for m_unused in range(wcourse.moves): | look = wcourse.moves while look > 0: look -= 1 | def warp(wcourse, involuntary): "ove under warp drive." blooey = False; twarp = False if not involuntary: # Not WARPX entry game.ididit = False if game.damage[DWARPEN] > 10.0: scanner.chew() skip(1) prout(_("Engineer Scott- \"The warp engines are damaged, Sir.\"")) return if damaged(DWARPEN) and game.warpfac > 4.0: scanner.chew() skip(1) prout(_("Engineer Scott- \"Sorry, Captain. Until this damage")) prout(_(" is repaired, I can only give you warp 4.\"")) return # Read in course and distance if wcourse==None: try: wcourse = getcourse(isprobe=False) except TrekError: return # Make sure starship has enough energy for the trip # Note: this formula is slightly different from the C version, # and lets you skate a bit closer to the edge. if wcourse.power(game.warpfac) >= game.energy: # Insufficient power for trip game.ididit = False skip(1) prout(_("Engineering to bridge--")) if not game.shldup or 0.5*wcourse.power(game.warpfac) > game.energy: iwarp = (game.energy/(wcourse.dist+0.05)) ** 0.333333333 if iwarp <= 0: prout(_("We can't do it, Captain. We don't have enough energy.")) else: proutn(_("We don't have enough energy, but we could do it at warp %d") % iwarp) if game.shldup: prout(",") prout(_("if you'll lower the shields.")) else: prout(".") else: prout(_("We haven't the energy to go that far with the shields up.")) return # Make sure enough time is left for the trip game.optime = wcourse.time(game.warpfac) if game.optime >= 0.8*game.state.remtime: skip(1) prout(_("First Officer Spock- \"Captain, I compute that such")) proutn(_(" a trip would require approximately %2.0f") % (100.0*game.optime/game.state.remtime)) prout(_(" percent of our")) proutn(_(" remaining time. Are you sure this is wise?\" ")) if not ja(): game.ididit = False game.optime=0 return # Entry WARPX if game.warpfac > 6.0: # Decide if engine damage will occur # ESR: Seems wrong. Probability of damage goes *down* with distance? prob = wcourse.distance*(6.0-game.warpfac)**2/66.666666666 if prob > randreal(): blooey = True wcourse.distance = randreal(wcourse.distance) # Decide if time warp will occur if 0.5*wcourse.distance*math.pow(7.0,game.warpfac-10.0) > randreal(): twarp = True if game.idebug and game.warpfac==10 and not twarp: blooey = False proutn("=== Force time warp? ") if ja(): twarp = True if blooey or twarp: # If time warp or engine damage, check path # If it is obstructed, don't do warp or damage for m_unused in range(wcourse.moves): wcourse.next() w = wcourse.sector() if not w.valid_sector(): break if game.quad[w.i][w.j] != '.': blooey = False twarp = False wcourse.reset() # Activate Warp Engines and pay the cost imove(course, noattack=False) if game.alldone: return game.energy -= wcourse.power(game.warpfac) if game.energy <= 0: finish(FNRG) game.optime = wcourse.time(game.warpfac) if twarp: timwrp() if blooey: game.damage[DWARPEN] = game.damfac * randreal(1.0, 4.0) skip(1) prout(_("Engineering to bridge--")) prout(_(" Scott here. The warp engines are damaged.")) prout(_(" We'll have to reduce speed to warp 4.")) game.ididit = True return | 65ebc303124b932f39a34d20faaa702d07854b82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/65ebc303124b932f39a34d20faaa702d07854b82/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
11441,
12,
91,
5566,
16,
29876,
10032,
814,
4672,
315,
841,
3613,
341,
11441,
14316,
1199,
324,
383,
83,
402,
273,
1083,
31,
268,
905,
84,
273,
1083,
309,
486,
29876,
10032,
814,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
11441,
12,
91,
5566,
16,
29876,
10032,
814,
4672,
315,
841,
3613,
341,
11441,
14316,
1199,
324,
383,
83,
402,
273,
1083,
31,
268,
905,
84,
273,
1083,
309,
486,
29876,
10032,
814,
... |
atts['height'] = int(round(atts['height'] * (float(atts['scale']) / 100))) del atts['scale'] if not atts.has_key('alt'): atts['alt'] = atts['src'] if atts.has_key('align'): atts['align'] = self.attval(atts['align']) | atts['height'] = int(round(node['height'] * (float(node['scale']) / 100))) atts['alt'] = node.get('alt', atts['src']) if node.has_key('align'): atts['align'] = self.attval(node['align']) | def visit_image(self, node): atts = node.non_default_attributes() if atts.has_key('classes'): del atts['classes'] # prevent duplication with node attrs atts['src'] = atts['uri'] del atts['uri'] if atts.has_key('scale'): if Image and not (atts.has_key('width') and atts.has_key('height')): try: im = Image.open(str(atts['src'])) except (IOError, # Source image can't be found or opened UnicodeError): # PIL doesn't like Unicode paths. pass else: if not atts.has_key('width'): atts['width'] = im.size[0] if not atts.has_key('height'): atts['height'] = im.size[1] del im if atts.has_key('width'): atts['width'] = int(round(atts['width'] * (float(atts['scale']) / 100))) if atts.has_key('height'): atts['height'] = int(round(atts['height'] * (float(atts['scale']) / 100))) del atts['scale'] if not atts.has_key('alt'): atts['alt'] = atts['src'] if atts.has_key('align'): atts['align'] = self.attval(atts['align']) atts['class'] = 'align-%s' % atts['align'] if (isinstance(node.parent, nodes.TextElement) or (isinstance(node.parent, nodes.reference) and not isinstance(node.parent.parent, nodes.TextElement))): # Inline context or surrounded by <a>...</a>. suffix = '' else: suffix = '\n' self.body.append(self.emptytag(node, 'img', suffix, **atts)) | c07247e46b1ef1b8fc4ea67029910a77e04b2ae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/c07247e46b1ef1b8fc4ea67029910a77e04b2ae7/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
756,
18,
5836,
67,
1886,
67,
4350,
1435,
309,
15687,
18,
5332,
67,
856,
2668,
4701,
11,
4672,
1464,
15687,
3292,
4701,
3546,
540,
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,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
756,
18,
5836,
67,
1886,
67,
4350,
1435,
309,
15687,
18,
5332,
67,
856,
2668,
4701,
11,
4672,
1464,
15687,
3292,
4701,
3546,
540,
4... |
if _debug: print "\t%s: Called Camera.setAzimuth()" % rendererName | debugMsg("Called Camera.setAzimuth()") | def setAzimuth(self,azimuth): """ Set the azimuthal angle (in degrees) of the Camera | 9eafeed6682cc7693274ff2418342722b828961f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/9eafeed6682cc7693274ff2418342722b828961f/camera.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
37,
94,
15968,
12,
2890,
16,
28306,
4672,
3536,
1000,
326,
23090,
287,
5291,
261,
267,
10904,
13,
434,
326,
30355,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
37,
94,
15968,
12,
2890,
16,
28306,
4672,
3536,
1000,
326,
23090,
287,
5291,
261,
267,
10904,
13,
434,
326,
30355,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.create_boot_floppy() if self.tftp_root: self.setup_pxe_boot() | print " url: " + str(self.url) print " kernel: " + str(self.kernel) print " initrd: " + str(self.initrd) print " nfs_server: " + str(self.nfs_server) print " nfs_dir: " + str(self.nfs_dir) print " nfs_mount: " + str(self.nfs_mount) if self.unattended_file and self.floppy_img is not None: self.create_boot_floppy() if self.medium == "cdrom": if self.tftp_root: self.setup_pxe_boot() elif self.medium == "url": self.setup_url() elif self.medium == "nfs": self.setup_nfs() else: raise SetupError("Unexpected installation method %s" % self.medium) | def setup(self): print "Starting unattended install setup" | 5d9aab674ce465a9ce3a7a478b717edacff93a86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/5d9aab674ce465a9ce3a7a478b717edacff93a86/unattended.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
1172,
315,
11715,
640,
270,
8140,
3799,
3875,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
1172,
315,
11715,
640,
270,
8140,
3799,
3875,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return self.where(pred).singleordefault(default=default) | return self.where(pred).single_or_default(default=default) | def singleordefault(self, pred=None, default=None): if pred: return self.where(pred).singleordefault(default=default) else: result = no_result = object() i = iter(self) try: result = i.next() except StopIteration: return default try: i.next() raise ValueError('Sequence contains more than one item') except StopIteration: return result | f134b825431ac82f3dbba76e7a945a0e195d27cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14315/f134b825431ac82f3dbba76e7a945a0e195d27cf/pyquery.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2202,
280,
1886,
12,
2890,
16,
3479,
33,
7036,
16,
805,
33,
7036,
4672,
309,
3479,
30,
327,
365,
18,
6051,
12,
6510,
2934,
7526,
67,
280,
67,
1886,
12,
1886,
33,
1886,
13,
469,
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,
2202,
280,
1886,
12,
2890,
16,
3479,
33,
7036,
16,
805,
33,
7036,
4672,
309,
3479,
30,
327,
365,
18,
6051,
12,
6510,
2934,
7526,
67,
280,
67,
1886,
12,
1886,
33,
1886,
13,
469,
30,
... |
content=content, atom_id=atom_id, link=link, published=published, title=title, updated=updated) | content=content, atom_id=atom_id, link=link, published=published, title=title, updated=updated, text=None) | def __init__(self, author=None, category=None, content=None, atom_id=None, link=None, published=None, title=None, updated=None, color=None, access_level=None, hidden=None, timezone=None, text=None,extension_elements=None, extension_attributes=None): gdata.GDataEntry.__init__(self, author=author, category=category, content=content, atom_id=atom_id, link=link, published=published, title=title, updated=updated) | 0ba6315ab8118b874d87e51c8f024bfc6f59e8a9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6580/0ba6315ab8118b874d87e51c8f024bfc6f59e8a9/gcalendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2869,
33,
7036,
16,
3150,
33,
7036,
16,
913,
33,
7036,
16,
3179,
67,
350,
33,
7036,
16,
1692,
33,
7036,
16,
9487,
33,
7036,
16,
2077,
33,
7036,
16,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2869,
33,
7036,
16,
3150,
33,
7036,
16,
913,
33,
7036,
16,
3179,
67,
350,
33,
7036,
16,
1692,
33,
7036,
16,
9487,
33,
7036,
16,
2077,
33,
7036,
16,
3... |
for dir, file in (("bzip2","LICENSE"), ("db", "LICENSE"), ("openssl", "LICENSE"), ("tcl", "license.terms"), ("tk", "license.terms")): out.write("\nThis copy of Python includes a copy of %s, which is licensed under the following terms:\n\n" % dir) dirs = glob.glob(srcdir+"/../"+dir+"-*") | for name, pat, file in (("bzip2","bzip2-*", "LICENSE"), ("Berkeley DB", "db-*", "LICENSE"), ("openssl", "openssl-*", "LICENSE"), ("Tcl", "tcl8*", "license.terms"), ("Tk", "tk8*", "license.terms"), ("Tix", "tix-*", "license.terms")): out.write("\nThis copy of Python includes a copy of %s, which is licensed under the following terms:\n\n" % name) dirs = glob.glob(srcdir+"/../"+pat) | def generate_license(): import shutil, glob out = open("LICENSE.txt", "w") shutil.copyfileobj(open(os.path.join(srcdir, "LICENSE")), out) for dir, file in (("bzip2","LICENSE"), ("db", "LICENSE"), ("openssl", "LICENSE"), ("tcl", "license.terms"), ("tk", "license.terms")): out.write("\nThis copy of Python includes a copy of %s, which is licensed under the following terms:\n\n" % dir) dirs = glob.glob(srcdir+"/../"+dir+"-*") if not dirs: raise ValueError, "Could not find "+srcdir+"/../"+dir+"-*" if len(dirs) > 2: raise ValueError, "Multiple copies of "+dir dir = dirs[0] shutil.copyfileobj(open(os.path.join(dir, file)), out) out.close() | b8a18eaca9e2bdb278a8e45d1cb24e14198d0959 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/b8a18eaca9e2bdb278a8e45d1cb24e14198d0959/msi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
12687,
13332,
1930,
11060,
16,
4715,
596,
273,
1696,
2932,
6065,
23396,
18,
5830,
3113,
315,
91,
7923,
11060,
18,
3530,
768,
2603,
12,
3190,
12,
538,
18,
803,
18,
5701,
12,
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,
2103,
67,
12687,
13332,
1930,
11060,
16,
4715,
596,
273,
1696,
2932,
6065,
23396,
18,
5830,
3113,
315,
91,
7923,
11060,
18,
3530,
768,
2603,
12,
3190,
12,
538,
18,
803,
18,
5701,
12,
4... |
if e.number in [-600, -609] and self.AS_appdata.path: | if e.number in [-600, -609] and self.AS_appdata.constructor == 'path': | def __call__(self, *args, **kargs): keywordArgs = kargs.copy() if len(args) > 1: raise TypeError, "Command received more than one direct parameter %r." % (args,) # get user-specified timeout, if any timeout = int(keywordArgs.pop('timeout', 60)) # appscript's default is 60 sec if timeout <= 0: timeout = kAE.kNoTimeOut else: timeout *= 60 # convert to ticks # ignore application's reply? sendFlags = keywordArgs.pop('waitreply', True) and kAE.kAEWaitReply or kAE.kAENoReply atts, params = {'subj':None}, {} # add considering/ignoring attributes (note: most apps currently ignore these) ignoreOptions = keywordArgs.pop('ignore', None) if ignoreOptions is None: atts['cons'] = _defaultConsiderations # 'csig' obsoletes 'cons', but latter is retained for compatibility atts['csig'] = _defaultConsidsAndIgnores else: atts['cons'] = ignoreOptions csig = 0 for option, considerMask, ignoreMask in _ignoreEnums: csig += option in ignoreOptions and ignoreMask or considerMask atts['csig'] = _packUInt32(csig) # optionally have application supply return value as specified type if keywordArgs.has_key('resulttype'): params['rtyp'] = keywordArgs.pop('resulttype') # add direct parameter, if any if args: params['----'] = args[0] # extract Apple event's labelled parameters, if any try: for name, value in keywordArgs.items(): params[self._labelledArgTerms[name]] = value except KeyError: raise TypeError, 'Unknown keyword argument %r.' % name # apply special cases for certain commands (make, set, any command that takes target object specifier as its direct parameter); appscript provides these as a convenience to users, making its syntax more concise, OO-like and nicer to use if self._aemreference is not aem.app: if self._code == 'coresetd': # Special case: if ref.set(...) contains no 'to' argument, use direct argument for 'to' parameter and target reference for direct parameter if params.has_key('----') and not params.has_key('data'): params['data'] = params['----'] params['----'] = self._aemreference elif not params.has_key('----'): params['----'] = self._aemreference else: atts['subj'] = self._aemreference elif self._code == 'corecrel': # this next bit is a bit tricky: # - While it should be possible to pack the target reference as a subject attribute, when the target is of typeInsertionLoc, CocoaScripting stupidly tries to coerce it to typeObjectSpecifier, which causes a coercion error. # - While it should be possible to pack the target reference as the 'at' parameter, some less-well-designed applications won't accept this and require it to be supplied as a subject attribute (i.e. how AppleScript supplies it). # One option is to follow the AppleScript approach and force users to always supply subject attributes as target references and 'at' parameters as 'at' parameters, but the syntax for the latter is clumsy and not backwards-compatible with a lot of existing appscript code (since earlier versions allowed the 'at' parameter to be given as the target reference). So for now we split the difference when deciding what to do with a target reference: if it's an insertion location then pack it as the 'at' parameter (where possible), otherwise pack it as the subject attribute (and if the application doesn't like that then it's up to the client to pack it as an 'at' parameter themselves). # # if ref.make(...) contains no 'at' argument and target is an insertion reference, use target reference for 'at' parameter... if isinstance(self._aemreference, aem.types.objectspecifiers.specifier.InsertionSpecifier) and not params.has_key('insh'): params['insh'] = self._aemreference else: # ...otherwise pack the target reference as the subject attribute atts['subj'] = self._aemreference elif params.has_key('----'): # if user has already supplied a direct parameter, pack that reference as the subject attribute atts['subj'] = self._aemreference else: # pack that reference as the direct parameter params['----'] = self._aemreference # build and send the Apple event, returning its result, if any try: return self.AS_appdata.target.event(self._code, params, atts, codecs=self.AS_appdata).send(timeout, sendFlags) except aem.CommandError, e: if e.number in [-600, -609] and self.AS_appdata.path: # event was sent to a local app for which we no longer have a valid address (i.e. the application has quit since this aem.Application object was made). # - If application is running under a new process id, we just update the aem.Application object and resend the event. # - If application isn't running, then we see if the event being sent is one of those allowed to relaunch the application (i.e. 'run' or 'launch'). If it is, the aplication is relaunched, the process id updated and the event resent; if not, the error is rethrown. if not self.AS_appdata.target.isrunning(self.AS_appdata.path): if self._code == 'ascrnoop': aem.Application.launch(self.AS_appdata.path) # relaunch app in background elif self._code != 'aevtoapp': # only 'launch' and 'run' are allowed to restart a local application that's been quit raise CommandError(self, (args, kargs), e) self.AS_appdata.target.reconnect() # update aem.Application object so it has a valid address for app try: return self.AS_appdata.target.event(self._code, params, atts, codecs=self.AS_appdata).send(timeout, sendFlags) except Exception, e: pass elif e.number == -1708 and self._code == 'ascrnoop': # squelch 'not handled' error for 'launch' event return raise CommandError(self, (args, kargs), e) | 9c71f3a23beef6af1eb2fbeba91b31e651f8018b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10961/9c71f3a23beef6af1eb2fbeba91b31e651f8018b/reference.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
4932,
2615,
273,
25916,
18,
3530,
1435,
309,
562,
12,
1968,
13,
405,
404,
30,
1002,
3580,
16,
315,
2189,
5079,
1898,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1991,
972,
12,
2890,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
4932,
2615,
273,
25916,
18,
3530,
1435,
309,
562,
12,
1968,
13,
405,
404,
30,
1002,
3580,
16,
315,
2189,
5079,
1898,... |
EVT_MAIN_THREAD_CALLBACK(self, self.OnMainThreadCallbackEvent) | def _displayHook(obj): if obj is not None: print repr(obj) | 5f7a266be468cf995d0d4c94701c270068d03a56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/5f7a266be468cf995d0d4c94701c270068d03a56/Application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5417,
5394,
12,
2603,
4672,
309,
1081,
353,
486,
599,
30,
1172,
8480,
12,
2603,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
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,
5417,
5394,
12,
2603,
4672,
309,
1081,
353,
486,
599,
30,
1172,
8480,
12,
2603,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
for root, dirs, files in tools.osutil.walksymlinks(tools.config['root_path']): for fname in fnmatch.filter(files, '*.py'): fabsolutepath = join(root, fname) frelativepath = fabsolutepath[len(tools.config['root_path'])+1:] module = get_module_from_path(frelativepath) is_mod_installed = module in installed_modules if (('all' in modules) or (module in modules)) and is_mod_installed: code_string = tools.file_open(fabsolutepath, subdir='').read() iter = re.finditer( '[^a-zA-Z0-9_]_\([\s]*["\'](.+?)["\'][\s]*\)', code_string, re.M) for i in iter: push_translation(module, 'code', frelativepath, 0, encode(i.group(1))) | if tools.config['root_path'] in tools.config['addons_path'] : path_list = [tools.config['root_path']] else : path_list = [tools.config['root_path'],tools.config['addons_path']] for path in path_list: for root, dirs, files in tools.osutil.walksymlinks(path): for fname in fnmatch.filter(files, '*.py'): fabsolutepath = join(root, fname) frelativepath = fabsolutepath[len(path):] module = get_module_from_path(frelativepath) is_mod_installed = module in installed_modules if (('all' in modules) or (module in modules)) and is_mod_installed: code_string = tools.file_open(fabsolutepath, subdir='').read() iter = re.finditer('[^a-zA-Z0-9_]_\([\s]*["\'](.+?)["\'][\s]*\)', code_string, re.S) if module in installed_modules : frelativepath =str("addons"+frelativepath) for i in iter: push_translation(module, 'code', frelativepath, 0, encode(i.group(1))) | def get_module_from_path(path): relative_addons_path = tools.config['addons_path'][len(tools.config['root_path'])+1:] if path.startswith(relative_addons_path) and (os.path.dirname(path) != relative_addons_path): path = path[len(relative_addons_path)+1:] return path.split(os.path.sep)[0] return 'base' # files that are not in a module are considered as being in 'base' module | 48aadedd0ebfe61219776b556a4eeb2760623461 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/48aadedd0ebfe61219776b556a4eeb2760623461/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2978,
67,
2080,
67,
803,
12,
803,
4672,
3632,
67,
1289,
7008,
67,
803,
273,
8513,
18,
1425,
3292,
1289,
7008,
67,
803,
3546,
63,
1897,
12,
6642,
18,
1425,
3292,
3085,
67,
80... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2978,
67,
2080,
67,
803,
12,
803,
4672,
3632,
67,
1289,
7008,
67,
803,
273,
8513,
18,
1425,
3292,
1289,
7008,
67,
803,
3546,
63,
1897,
12,
6642,
18,
1425,
3292,
3085,
67,
80... |
if secondPoint and secondVolume: | if secondPoint != None and secondVolume != None: | def AddAudioFadePoints(self, firstPoint, secondPoint, firstVolume, secondVolume): """ Add the two passed points to the audioFadePoints list. If either point exists already, replace it, and resort the list by time. undo : RemoveAudioFadePoints: temp, temp2, temp3, temp4 """ #for command manager to use with undo self.temp = firstPoint self.temp2 = secondPoint self.temp3 = None self.temp4 = None if self.__fadePointsDict.has_key(firstPoint): self.temp3 = self.__fadePointsDict[firstPoint] if self.__fadePointsDict.has_key(secondPoint): self.temp4 = self.__fadePointsDict[secondPoint] if firstPoint and firstVolume: self.__fadePointsDict[firstPoint] = firstVolume if secondPoint and secondVolume: self.__fadePointsDict[secondPoint] = secondVolume self.__UpdateAudioFadePoints() | b4269afbff33b39edcd60c6fcef2af75678d467c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10033/b4269afbff33b39edcd60c6fcef2af75678d467c/Event.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
12719,
42,
2486,
5636,
12,
2890,
16,
1122,
2148,
16,
2205,
2148,
16,
1122,
4545,
16,
2205,
4545,
4672,
3536,
1436,
326,
2795,
2275,
3143,
358,
326,
7447,
42,
2486,
5636,
666,
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,
1436,
12719,
42,
2486,
5636,
12,
2890,
16,
1122,
2148,
16,
2205,
2148,
16,
1122,
4545,
16,
2205,
4545,
4672,
3536,
1436,
326,
2795,
2275,
3143,
358,
326,
7447,
42,
2486,
5636,
666,
18,
... |
render() | render(scene) | def invoke(self, context, event): scene = context.scene path = getdefaultribpath(scene) checkpaths(path) checkpaths(os.path.join(path, scene.renderman_settings.polydir)) checkpaths(os.path.join(path, scene.renderman_settings.shadowdir)) checkpaths(os.path.join(path, scene.renderman_settings.envdir)) checkpaths(os.path.join(path, scene.renderman_settings.texdir)) if self.anim: for i in range(scene.frame_start, scene.frame_end+scene.frame_step, scene.frame_step): scene.frame_current = i render() else: render() return{'FINISHED'} | 7f85553c4440f5b8b61bece99e657a34af1b0143 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14285/7f85553c4440f5b8b61bece99e657a34af1b0143/export_renderman.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
12,
2890,
16,
819,
16,
871,
4672,
9065,
273,
819,
18,
23694,
589,
273,
336,
323,
507,
332,
665,
803,
12,
23694,
13,
866,
4481,
12,
803,
13,
866,
4481,
12,
538,
18,
803,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
12,
2890,
16,
819,
16,
871,
4672,
9065,
273,
819,
18,
23694,
589,
273,
336,
323,
507,
332,
665,
803,
12,
23694,
13,
866,
4481,
12,
803,
13,
866,
4481,
12,
538,
18,
803,
18,
5... |
self.Close() | self._port_handle.Close() | def close(self): """Close port""" if self._isOpen: if self._port_handle: try: self.Close() except System.IO.Ports.InvalidOperationException: # ignore errors. can happen for unplugged USB serial devices pass self._port_handle = None self._isOpen = False | f163508a56e9c4a0cd51d4294add9531bc4f03ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10955/f163508a56e9c4a0cd51d4294add9531bc4f03ca/serialcli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
3536,
4605,
1756,
8395,
309,
365,
6315,
291,
3678,
30,
309,
365,
6315,
655,
67,
4110,
30,
775,
30,
365,
6315,
655,
67,
4110,
18,
4605,
1435,
1335,
2332,
18,
4294,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
3536,
4605,
1756,
8395,
309,
365,
6315,
291,
3678,
30,
309,
365,
6315,
655,
67,
4110,
30,
775,
30,
365,
6315,
655,
67,
4110,
18,
4605,
1435,
1335,
2332,
18,
4294,... |
event().startup() | try: event().startup() except Exception,e: pyflaglog.log(pyflaglog.ERRORS, "Error: %s" % e) | def start_workers(): if config.FLUSH: dbh = DB.DBO() print "Deleting job queue" dbh.execute("delete from jobs") if config.WORKERS == 0: return for i in range(config.WORKERS): pid = os.fork() ## Parents: if pid: children.append(pid) else: atexit.register(child_exist) ## It is an error to fork with db connections ## established... they can not be shared: if DB.db_connections > 0: ## We try to fix it by making the child get new ## handlers. Note that the child still needs to hold the ## handles or they will get closed on the parent as well ## - this seems like a hack DB.DBO.DBH_old = DB.DBO.DBH DB.DBO.DBH = Store.Store(max_size=10) DB.db_connections = 0 ## Start the logging thread for each worker: pyflaglog.start_log_thread() ## These are all the methods we support jobs = [] ## This is the last broadcast message we handled. We will ## only handle broadcasts newer than this. broadcast_id = 0 try: dbh=DB.DBO() dbh.execute("select max(id) as max from jobs") row = dbh.fetch() broadcast_id = row['max'] or 0 except: pass while 1: ## Check for new tasks: if not jobs: time.sleep(10) dbh = None try: dbh = DB.DBO() try: dbh.execute("lock tables jobs write") sql = [ "command=%r" % x for x in Registry.TASKS.class_names ] dbh.execute("select * from jobs where ((%s) and state='pending') or (state='broadcast' and id>%r) order by id limit %s", (" or ".join(sql), broadcast_id, config.JOB_QUEUE)) jobs = [ row for row in dbh ] if not jobs: continue ## Ensure the jobs are marked as processing so other jobs dont touch them: for row in jobs: if row['state'] == 'pending': dbh.execute("update jobs set state='processing' where id=%r", row['id']) elif row['state'] == 'broadcast': broadcast_id = row['id'] finally: if dbh: dbh.execute("unlock tables") except: continue ## Now do the jobs for row in jobs: try: try: task = Registry.TASKS.dispatch(row['command']) except: print "Dont know how to process job %s" % row['command'] continue try: task = task() task.run(row['arg1'], row['arg2'], row['arg3']) except Exception,e: pyflaglog.log(pyflaglog.ERRORS, "Error %s(%s,%s,%s) %s" % (task.__class__.__name__,row['arg1'], row['arg2'],row['arg3'],e)) finally: if row['state'] != 'broadcast': dbh.execute("delete from jobs where id=%r", row['id']) atexit.register(terminate_children) ## The parent now calls the startup method on each of the events: for event in Registry.EVENT_HANDLERS.classes: event().startup() ## The parent now calls the startup method on each of the events: print "Launching startup" for event in Registry.EVENT_HANDLERS.classes: event().startup() | caea32aadf0428a2bb5c9c723ec10f46011470c4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5568/caea32aadf0428a2bb5c9c723ec10f46011470c4/Farm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
15625,
13332,
309,
642,
18,
42,
31959,
30,
1319,
76,
273,
2383,
18,
2290,
51,
1435,
1172,
315,
20433,
1719,
2389,
6,
1319,
76,
18,
8837,
2932,
3733,
628,
6550,
7923,
225,
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,
787,
67,
15625,
13332,
309,
642,
18,
42,
31959,
30,
1319,
76,
273,
2383,
18,
2290,
51,
1435,
1172,
315,
20433,
1719,
2389,
6,
1319,
76,
18,
8837,
2932,
3733,
628,
6550,
7923,
225,
309,... |
writePackages({0: content}) | writePackage(content) | def writePackage(content, packageId=""): # Construct file name resolvedFilePath = self._resolveFileName(filePath, variants, settings, packageId) | 9252efc67e4f549a91130510683a48ae8b6601e8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/9252efc67e4f549a91130510683a48ae8b6601e8/CodeGenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
2261,
12,
1745,
16,
2181,
548,
1546,
6,
4672,
468,
14291,
585,
508,
4640,
5598,
273,
365,
6315,
10828,
4771,
12,
22787,
16,
12935,
16,
1947,
16,
2181,
548,
13,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
2261,
12,
1745,
16,
2181,
548,
1546,
6,
4672,
468,
14291,
585,
508,
4640,
5598,
273,
365,
6315,
10828,
4771,
12,
22787,
16,
12935,
16,
1947,
16,
2181,
548,
13,
2,
-100,
-100,
-10... |
sage: from sage.groups.perm_gps.permgroup import SymmetricGroup | sage: from sage.groups.perm_gps.permgroup_named import SymmetricGroup | def relabel(self, perm, inplace=True, quick=False): r""" Uses a dictionary or permutation to relabel the (di)graph. If perm is a dictionary, each old vertex v is a key in the dictionary, and its new label is d[v]. If perm is a list, we think of it as a map $i \mapsto perm[i]$ (only for graphs with $V = \{0,1,...,n-1\}$ ). If perm is a per mutation, the permutation is simply applied to the graph, under the assumption that $V = \{0,1,...,n-1\}$ is the vertex set, and the permutation acts on the set $\{1,2,...,n\}$, where we think of $n = 0$. INPUT: quick -- if True, simply return the enumeration of the new graph without constructing it. Requires that perm is of type list. EXAMPLES: sage: G = Graph({0:[1],1:[2],2:[]}) sage: G.am() [0 1 0] [1 0 1] [0 1 0] Relabeling using a list: sage: G.relabel([0,2,1]) sage: G.am() [0 0 1] [0 0 1] [1 1 0] Relabeling using a dictionary: sage: G.relabel({0:2,2:0}) sage: G.am() [0 1 1] [1 0 0] [1 0 0] Relabeling using a SAGE permutation: sage: from sage.groups.perm_gps.permgroup import SymmetricGroup sage: S = SymmetricGroup(3) sage: gamma = S('(3,2)') sage: G.relabel(gamma) sage: G.am() [0 0 1] [0 0 1] [1 1 0] | 64ceae3747cadb0980b0243bf4df51901a212828 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/64ceae3747cadb0980b0243bf4df51901a212828/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1279,
873,
12,
2890,
16,
4641,
16,
11783,
33,
5510,
16,
9549,
33,
8381,
4672,
436,
8395,
14854,
279,
3880,
578,
17440,
358,
1279,
873,
326,
261,
3211,
13,
4660,
18,
971,
4641,
353,
279... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1279,
873,
12,
2890,
16,
4641,
16,
11783,
33,
5510,
16,
9549,
33,
8381,
4672,
436,
8395,
14854,
279,
3880,
578,
17440,
358,
1279,
873,
326,
261,
3211,
13,
4660,
18,
971,
4641,
353,
279... |
if self.__patch_applied(name) or self.__patch_unapplied(name): | if self.patch_applied(name) or self.patch_unapplied(name): | def new_patch(self, name, message = None, can_edit = True, unapplied = False, show_patch = False, top = None, bottom = None, author_name = None, author_email = None, author_date = None, committer_name = None, committer_email = None, before_existing = False, refresh = True): """Creates a new patch """ if self.__patch_applied(name) or self.__patch_unapplied(name): raise StackException, 'Patch "%s" already exists' % name | ed0350be88dca8315cf7b32e88972306aae4f700 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12366/ed0350be88dca8315cf7b32e88972306aae4f700/stack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
2272,
12,
2890,
16,
508,
16,
883,
273,
599,
16,
848,
67,
4619,
273,
1053,
16,
640,
438,
3110,
273,
1083,
16,
2405,
67,
2272,
273,
1083,
16,
1760,
273,
599,
16,
5469,
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,
394,
67,
2272,
12,
2890,
16,
508,
16,
883,
273,
599,
16,
848,
67,
4619,
273,
1053,
16,
640,
438,
3110,
273,
1083,
16,
2405,
67,
2272,
273,
1083,
16,
1760,
273,
599,
16,
5469,
273,
... |
cr.show_page() | def render(self, cr, paperwidth, paperheight): cr.set_source_rgb(1, 1, 1) cr.paint() cr.set_source_rgb(0.0, 0.0, 0.0) | 507d3613f2a6f5db297c78cc6a85408a5dcc35cf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9326/507d3613f2a6f5db297c78cc6a85408a5dcc35cf/street_index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
4422,
16,
15181,
2819,
16,
15181,
4210,
4672,
4422,
18,
542,
67,
3168,
67,
10948,
12,
21,
16,
404,
16,
404,
13,
4422,
18,
84,
1598,
1435,
4422,
18,
542,
67,
3168,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
4422,
16,
15181,
2819,
16,
15181,
4210,
4672,
4422,
18,
542,
67,
3168,
67,
10948,
12,
21,
16,
404,
16,
404,
13,
4422,
18,
84,
1598,
1435,
4422,
18,
542,
67,
3168,... | |
finally: fileobj.close() os.unlink(name) | def test_read_dict_fields(self): fd, name = tempfile.mkstemp() fileobj = os.fdopen(fd, "w+b") try: fileobj.write("1,2,abc\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, fieldnames=["f1", "f2", "f3"]) self.assertEqual(next(reader), {"f1": '1', "f2": '2', "f3": 'abc'}) finally: fileobj.close() os.unlink(name) | 4626458cc57b73dc01edf4987bbc3fe1d4437e59 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/4626458cc57b73dc01edf4987bbc3fe1d4437e59/test_csv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
896,
67,
1576,
67,
2821,
12,
2890,
4672,
5194,
16,
508,
273,
13275,
18,
24816,
19781,
84,
1435,
17041,
273,
1140,
18,
8313,
3190,
12,
8313,
16,
315,
91,
15,
70,
7923,
775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
67,
1576,
67,
2821,
12,
2890,
4672,
5194,
16,
508,
273,
13275,
18,
24816,
19781,
84,
1435,
17041,
273,
1140,
18,
8313,
3190,
12,
8313,
16,
315,
91,
15,
70,
7923,
775,
... | |
for k in os.environ.keys(): if k == 'NO_PROXY': | for k in list(os.environ): if 'proxy' not in k.lower(): | def setUp(self): # Records changes to env vars self.env = support.EnvironmentVarGuard() # Delete all proxy related env vars for k in os.environ.keys(): if k == 'NO_PROXY': self.env.unset(k) | b702178a0c9c6c9c88fcca5c422ee8fdce800617 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/b702178a0c9c6c9c88fcca5c422ee8fdce800617/test_urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
468,
27390,
3478,
358,
1550,
4153,
365,
18,
3074,
273,
2865,
18,
5494,
1537,
16709,
1435,
468,
2504,
777,
2889,
3746,
1550,
4153,
364,
417,
316,
666,
12,
538,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
468,
27390,
3478,
358,
1550,
4153,
365,
18,
3074,
273,
2865,
18,
5494,
1537,
16709,
1435,
468,
2504,
777,
2889,
3746,
1550,
4153,
364,
417,
316,
666,
12,
538,
18,
... |
print author_id print fas.cache[author_id] print fas.cache[author_id]['email'] | def _mass_branch(self, to_branch, devel_branch, pkgs, author_name, author_id): '''Performs a mass branching. Intended to run in the background. | 7434facc4bb47994ba753df0d87e2a0817284236 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/7434facc4bb47994ba753df0d87e2a0817284236/collections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10424,
67,
7500,
12,
2890,
16,
358,
67,
7500,
16,
443,
941,
67,
7500,
16,
16922,
16,
2869,
67,
529,
16,
2869,
67,
350,
4672,
9163,
9409,
279,
8039,
3803,
310,
18,
225,
657,
8140... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10424,
67,
7500,
12,
2890,
16,
358,
67,
7500,
16,
443,
941,
67,
7500,
16,
16922,
16,
2869,
67,
529,
16,
2869,
67,
350,
4672,
9163,
9409,
279,
8039,
3803,
310,
18,
225,
657,
8140... | |
print "Tarkistuspiste 9\n"; | def formatAlnSeq(alns,names,starts,motifAln="",linelen=60): """Formats the DNA sequence alignment output""" outstr="\n".join(["Sequence %d: %s"%(seqI+1,iname) for (seqI,iname) in enumerate(names)])+"\n\n" n=len(alns[0]) poses=[xstart+1 for xstart in starts] for i in range(0,n,linelen): lines=[xaln[i:i+linelen] for xaln in alns] mline=motifAln[i:i+linelen] outstr+="\n".join(["%7d : %s"%(xpos,xline) for (xpos,xline) in zip(poses,lines)]) outstr+="\n %s\n\n"%(mline) poses=[xpos+len(xline)-xline.count("-") for (xpos,xline) in zip(poses,lines)] return outstr | bc032a4656439ef0d7cfdf470d894358c59e2762 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11674/bc032a4656439ef0d7cfdf470d894358c59e2762/Output.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
1067,
82,
6926,
12,
287,
2387,
16,
1973,
16,
17514,
16,
18313,
430,
1067,
82,
1546,
3113,
7511,
292,
275,
33,
4848,
4672,
3536,
8976,
326,
463,
11277,
3102,
8710,
876,
8395,
596,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
1067,
82,
6926,
12,
287,
2387,
16,
1973,
16,
17514,
16,
18313,
430,
1067,
82,
1546,
3113,
7511,
292,
275,
33,
4848,
4672,
3536,
8976,
326,
463,
11277,
3102,
8710,
876,
8395,
596,
... | |
headers['accept-encoding'] = 'compress, gzip' | headers['accept-encoding'] = 'deflate, gzip' | def request(self, uri, method="GET", body=None, headers=None, redirections=DEFAULT_MAX_REDIRECTS, connection_type=None): """ Performs a single HTTP request. | b00e991f840d81258afcb7e4362a7d37fbdc28a7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13138/b00e991f840d81258afcb7e4362a7d37fbdc28a7/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
2003,
16,
707,
1546,
3264,
3113,
1417,
33,
7036,
16,
1607,
33,
7036,
16,
19611,
87,
33,
5280,
67,
6694,
67,
25103,
55,
16,
1459,
67,
723,
33,
7036,
4672,
3536,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
2003,
16,
707,
1546,
3264,
3113,
1417,
33,
7036,
16,
1607,
33,
7036,
16,
19611,
87,
33,
5280,
67,
6694,
67,
25103,
55,
16,
1459,
67,
723,
33,
7036,
4672,
3536,
273... |
if method.startswith('_'): raise AttributeError(method) | def __getattr__(self, method): # Don't invoke methods that start with _ if method.startswith('_'): raise AttributeError(method) return lambda *args, **kwargs: self.callByName(method, *args, **kwargs) | b7f25cfc3b480c500d5346c9b05b39a12b699499 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/b7f25cfc3b480c500d5346c9b05b39a12b699499/proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
12,
2890,
16,
707,
4672,
468,
7615,
1404,
4356,
2590,
716,
787,
598,
389,
2463,
3195,
380,
1968,
16,
2826,
4333,
30,
365,
18,
1991,
5911,
12,
2039,
16,
380,
1968,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
12,
2890,
16,
707,
4672,
468,
7615,
1404,
4356,
2590,
716,
787,
598,
389,
2463,
3195,
380,
1968,
16,
2826,
4333,
30,
365,
18,
1991,
5911,
12,
2039,
16,
380,
1968,... | |
bot = upload.UploadRobot(metadata['url'], description=description, useFilename=title, keepFilename=True, verifyDescription=False, targetSite = wikipedia.getSite('commons', 'commons')) bot.upload_image(debug=False) | try: bot = upload.UploadRobot(metadata['url'], description=description, useFilename=title, keepFilename=True, verifyDescription=False, targetSite = wikipedia.getSite('commons', 'commons')) bot.upload_image(debug=False) except wikipedia.PageNotFound: pass | def processPhoto(photo_id): ''' Work on a single photo at http://www.navy.mil/view_single.asp?id=<photo_id> get the metadata, check for dupes, build description, upload the image ''' # Get all the metadata metadata = getMetadata(photo_id) if not metadata: #Incorrect photo_id return photo = downloadPhoto(metadata['url']) duplicates = findDuplicateImages(photo) #duplicates = False # We don't want to upload tupes if duplicates: wikipedia.output(u'Found duplicate image at %s' % duplicates.pop()) return title = buildTitle(photo_id, metadata) description = buildDescription(photo_id, metadata) #wikipedia.output(title) #wikipedia.output(description) bot = upload.UploadRobot(metadata['url'], description=description, useFilename=title, keepFilename=True, verifyDescription=False, targetSite = wikipedia.getSite('commons', 'commons')) bot.upload_image(debug=False) | a00a887bb5181eb77db0c194e5745c0cfde2fccf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7426/a00a887bb5181eb77db0c194e5745c0cfde2fccf/navy_bot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
19934,
12,
17232,
67,
350,
4672,
9163,
4147,
603,
279,
2202,
10701,
622,
1062,
2207,
5591,
18,
11589,
93,
18,
81,
330,
19,
1945,
67,
7526,
18,
28264,
35,
350,
27127,
17232,
67,
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,
1207,
19934,
12,
17232,
67,
350,
4672,
9163,
4147,
603,
279,
2202,
10701,
622,
1062,
2207,
5591,
18,
11589,
93,
18,
81,
330,
19,
1945,
67,
7526,
18,
28264,
35,
350,
27127,
17232,
67,
3... |
cmd += [ options.params ] | cmd += [options.params] | def runStartupPerfTests(options, timer, largeData=False, repeat=3, logger=log): """ Run startup time tests. >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> runStartupPerfTests(options, '/usr/bin/time') Creating repository for startup time tests /.../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/quit.py --create - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /usr/bin/time --format=%e -o test_profile/time.log .../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/end.py Startup 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> runStartupPerfTests(options, '/usr/bin/time', repeat=1) Creating repository for startup time tests /.../RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/quit.py --create - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /usr/bin/time --format=%e -o test_profile/time.log /.../RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/end.py Startup 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> runStartupPerfTests(options, '/usr/bin/time', largeData=True) Creating repository for startup time tests /.../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/quit.py --restore=test_profile/__repository__.001 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /usr/bin/time --format=%e -o test_profile/time.log .../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/end.py Startup_with_large_calendar 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> options.tbox = True >>> runStartupPerfTests(options, '/usr/bin/time') Creating repository for startup time tests /.../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/quit.py --create - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /usr/bin/time --format=%e -o test_profile/time.log .../release/RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --scriptFile=tools/QATestScripts/Performance/end.py Startup 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 <BLANKLINE> Startup [#TINDERBOX# Status = PASSED] OSAF_QA: Startup | ... | 0.00 #TINDERBOX# Testname = Startup #TINDERBOX# Status = PASSED #TINDERBOX# Time elapsed = 0.00 (seconds) - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False """ if repeat < 3: repeat = 3 # You can't get an accurate number otherwise # Create test repo if options.verbose: log('Creating repository for startup time tests') cmd = [ options.runchandler['release'], '--catch=tests', '--profileDir=%s' % options.profileDir, '--parcelPath=%s' % options.parcelPath, '--scriptFile=%s' % os.path.join('tools', 'QATestScripts', 'Performance', 'quit.py') ] if not largeData: cmd += ['--create'] timeout = 180 name = 'Startup' else: cmd += ['--restore=%s' % os.path.join(options.profileDir, '__repository__.001')] timeout = 600 name = 'Startup_with_large_calendar' if options.params: cmd += [ options.params ] if options.verbose: log(' '.join(cmd)) if options.dryrun: result = 0 else: result = build_lib.runCommand(cmd, timeout=timeout, logger=logger) if result != 0: log('***Error exit code=%d, creating %s repository' % (result, name)) failedTests.append(name) return True if options.dryrun: log('- + ' * 15) else: logger('- + ' * 15) # Time startup values = [] timeLog = os.path.join(options.profileDir, 'time.log') if not options.dryrun: if os.path.isfile(timeLog): os.remove(timeLog) cmd = [ timer, r'--format=%e', '-o', timeLog, options.runchandler['release'], '--catch=tests', '--profileDir=%s' % options.profileDir, '--parcelPath=%s' % options.parcelPath, '--scriptFile=%s' % os.path.join('tools', 'QATestScripts', 'Performance', 'end.py') ] if options.params: cmd += [ options.params ] if options.verbose: log(' '.join(cmd)) log(name.ljust(33), newline=' ') for _x in range(repeat): if options.dryrun: result = 0 else: result = build_lib.runCommand(cmd, timeout=180, logger=logger) if result == 0: if options.dryrun: line = '0.0' else: line = open(timeLog).readline()[:-1] try: value = float(line) except ValueError, e: log('| %s' % str(e)) failedTests.append(name) return True log(('%02.2f' % value).rjust(6), newline=' ') values.append(value) else: log('| failed') failedTests.append(name) return True if options.dryrun: log('- + ' * 15) else: logger('- + ' * 15) else: values.sort() value = values[repeat/2] log(' | ', newline='') log(('%02.2f' % value).rjust(6) , newline='') log(u' \u00B1 '.encode('utf8'), newline='') # Unicode PLUS-MINUS SIGN log(('%02.2f' % stddev(values)).rjust(6)) if options.tbox: revision = getattr(build_lib.loadModuleFromFile(os.path.join(options.chandlerHome, 'version.py'), 'vmodule'), 'revision', '') log('') log('%s [#TINDERBOX# Status = PASSED]' % name) log('OSAF_QA: %s | %s | %02.2f' % (name, revision, value)) log('#TINDERBOX# Testname = %s' % name) log('#TINDERBOX# Status = PASSED') log('#TINDERBOX# Time elapsed = %02.2f (seconds)' % value) if options.dryrun: log('- + ' * 15) else: logger('- + ' * 15) return False | 64e3ec7e167097dc0b4afb4eadc40bc6adec660f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/64e3ec7e167097dc0b4afb4eadc40bc6adec660f/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
22178,
22016,
14650,
12,
2116,
16,
5441,
16,
7876,
751,
33,
8381,
16,
7666,
33,
23,
16,
1194,
33,
1330,
4672,
3536,
1939,
11850,
813,
7434,
18,
225,
4080,
702,
273,
1109,
1320,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22178,
22016,
14650,
12,
2116,
16,
5441,
16,
7876,
751,
33,
8381,
16,
7666,
33,
23,
16,
1194,
33,
1330,
4672,
3536,
1939,
11850,
813,
7434,
18,
225,
4080,
702,
273,
1109,
1320,
1... |
site=site, timestamp__gt=this_month).aggregate(Max('page_count'))['page_count__max'] | site=site, completion_time__gte=this_month).aggregate(Sum('page_count'))['page_count__sum'] | def home(request): site = request.site updates = site.scheduledupdate_set.all() email_subscribers = Subscriber.via_email.filter(site=site) fax_subscribers = Subscriber.via_fax.filter(site=site) total_pages = Fax.objects.filter(site=site).aggregate(Max('page_count'))['page_count__max'] this_month = datetime(datetime.now().year, datetime.now().month, 1) pages_for_month = Fax.objects.filter( site=site, timestamp__gt=this_month).aggregate(Max('page_count'))['page_count__max'] return direct_to_template(request, template='dashboard/marketing.html', extra_context={ 'updates': updates, 'email_subscribers': email_subscribers, 'fax_subscribers': fax_subscribers, 'total_pages': total_pages, 'pages_for_month': pages_for_month }) | 6dc4f42cb179949cc59ad43b8f830b217530994c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9903/6dc4f42cb179949cc59ad43b8f830b217530994c/marketing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6382,
12,
2293,
4672,
2834,
273,
590,
18,
4256,
4533,
273,
2834,
18,
23307,
2725,
67,
542,
18,
454,
1435,
2699,
67,
1717,
17769,
273,
21339,
18,
21985,
67,
3652,
18,
2188,
12,
4256,
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,
6382,
12,
2293,
4672,
2834,
273,
590,
18,
4256,
4533,
273,
2834,
18,
23307,
2725,
67,
542,
18,
454,
1435,
2699,
67,
1717,
17769,
273,
21339,
18,
21985,
67,
3652,
18,
2188,
12,
4256,
33... |
return x.extend(y) | if type(y) == Num.ArrayType: y = y.tolist() if type(y) == types.ListType: x.extend(y) elif datalen(y) == 1: x.append(y) return list2array(x) | def _listjoin(x,y): "join two lists" "return list of dictionary items" if type(x) == Num.ArrayType: x = x.tolist() if type(x) == types.ListType: return x.extend(y) | d6ca5dfdabbb3462996f873fbd59d12889ec71a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11796/d6ca5dfdabbb3462996f873fbd59d12889ec71a0/TdlBuiltins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1098,
5701,
12,
92,
16,
93,
4672,
315,
5701,
2795,
6035,
6,
315,
2463,
666,
434,
3880,
1516,
6,
309,
618,
12,
92,
13,
422,
6805,
18,
27182,
30,
619,
273,
619,
18,
3490,
376,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1098,
5701,
12,
92,
16,
93,
4672,
315,
5701,
2795,
6035,
6,
315,
2463,
666,
434,
3880,
1516,
6,
309,
618,
12,
92,
13,
422,
6805,
18,
27182,
30,
619,
273,
619,
18,
3490,
376,
1... |
self.sections[tag] = _section(tag, title=title, secnum=secnum, pagenum=self.pagenum, level=self.level+1) | self.sections[tag] = _section(tag, title=title, secnum=secnum, pagenum=self.pagenum, level=self.level+1, open_by_default=open_by_default) | def add_section(self, tag, title=""): secnum = "%s.%d" % (self.secnum, len(self.sections.values())+1) self.sections[tag] = _section(tag, title=title, secnum=secnum, pagenum=self.pagenum, level=self.level+1) self.section_ids.append([len(self.sections.values()), tag]) return self.sections[tag] | 0a9ef6e90647a2f6188dcd1101d39b03cb8c8ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3589/0a9ef6e90647a2f6188dcd1101d39b03cb8c8ec9/cbcwebpage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3464,
12,
2890,
16,
1047,
16,
2077,
1546,
6,
4672,
1428,
2107,
273,
2213,
87,
7866,
72,
6,
738,
261,
2890,
18,
3321,
2107,
16,
562,
12,
2890,
18,
11657,
18,
2372,
10756,
15,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3464,
12,
2890,
16,
1047,
16,
2077,
1546,
6,
4672,
1428,
2107,
273,
2213,
87,
7866,
72,
6,
738,
261,
2890,
18,
3321,
2107,
16,
562,
12,
2890,
18,
11657,
18,
2372,
10756,
15,... |
"Handle a recoverable error." | "Handle a recoverable error." | def error(self, exception): | b25f73bb9f7020358cb44af43b1b0ced01f57435 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b25f73bb9f7020358cb44af43b1b0ced01f57435/handler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
555,
12,
2890,
16,
1520,
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,
555,
12,
2890,
16,
1520,
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... |
1.6278054848727066 + 0.13682754839736855*I | 1.62780548487270 + 0.136827548397368*I | def agm(self, right): """ EXAMPLES: sage: (1+I).agm(2-I) 1.6278054848727066 + 0.13682754839736855*I """ t = self.parent()(right)._pari_() return self.parent()(self._pari_().agm(t)) | 0f85c81e959512e75d1c3f66db056b379125ea81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/0f85c81e959512e75d1c3f66db056b379125ea81/complex_number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1737,
81,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
346,
81,
12,
22,
17,
45,
13,
404,
18,
26,
5324,
3672,
6564,
5193,
11035,
5324,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1737,
81,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
346,
81,
12,
22,
17,
45,
13,
404,
18,
26,
5324,
3672,
6564,
5193,
11035,
5324,
... |
print "profle edit button clicked" | print "profile edit button clicked" | def on_profile_edit_button_clicked(self, object): print "profle edit button clicked" | 116d68ae27d7171816712ce03924ad7f5b504ac7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2456/116d68ae27d7171816712ce03924ad7f5b504ac7/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
5040,
67,
4619,
67,
5391,
67,
7475,
329,
12,
2890,
16,
733,
4672,
1172,
315,
16121,
298,
3874,
3568,
17688,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
5040,
67,
4619,
67,
5391,
67,
7475,
329,
12,
2890,
16,
733,
4672,
1172,
315,
16121,
298,
3874,
3568,
17688,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
"""Implement all elements related properties and functionality. Only one instance will be availabe for the whole application.It's better to have 'class elem' as an inner class, so user will not be able to create an element him/her-self, which normally will cause trouble. By doing that, it makes our code more modular and bugs more localized, easier to test. Whenever any element color/rad changes, it will depend on the user who use the element to update its display---Huaicai 3/8/05""" | """Implement all elements related properties and functionality. Only one instance will be availabe for the whole application. It's better to have 'class elem' as an inner class, so user will not be able to create an element him/her-self, which normally will cause trouble. By doing that, it makes our code more modular and bugs more localized, easier to test. Whenever any element color/rad changes, it will depend on the user who use the element to update its display---Huaicai 3/8/05 """ | def __new__(cls, *args, **kwds): if not cls._singletons.has_key(cls): cls._singletons[cls] = object.__new__(cls) return cls._singletons[cls] | 3b028f76618d4601127f8e68774efbbf6c318379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/3b028f76618d4601127f8e68774efbbf6c318379/elements.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
380,
1968,
16,
2826,
25577,
4672,
309,
486,
2028,
6315,
24487,
87,
18,
5332,
67,
856,
12,
6429,
4672,
2028,
6315,
24487,
87,
63,
6429,
65,
273,
733,
1618... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
380,
1968,
16,
2826,
25577,
4672,
309,
486,
2028,
6315,
24487,
87,
18,
5332,
67,
856,
12,
6429,
4672,
2028,
6315,
24487,
87,
63,
6429,
65,
273,
733,
1618... |
self.setUp() self.newHand() | self.newGame() | def __init__(self): super(MahJongg, self).__init__() self.dbhandle = QSqlDatabase("QSQLITE") self.dbpath = kdecore.KGlobal.dirs().locateLocal("appdata","kmj.db") self.dbhandle.setDatabaseName(self.dbpath) dbExists = os.path.exists(self.dbpath) if not self.dbhandle.open(): logMessage(self.dbhandle.lastError().text()) sys.exit(1) if not dbExists: self.createTables() self.addTestData() self.playerwindow = None self.scoreTableWindow= None self.Players = [None, None, None, None] self.roundsFinished = 0 self.winner = None self.shiftRules = 'SWEN,SE,WE' self.setupUi() self.setupActions() self.creategui() self.setUp() self.newHand() | 3a20e4bebc90562c28295f7106cbd388d688a133 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1679/3a20e4bebc90562c28295f7106cbd388d688a133/kmj.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
49,
9795,
46,
932,
75,
16,
365,
2934,
972,
2738,
972,
1435,
365,
18,
1966,
4110,
273,
2238,
5101,
4254,
2932,
53,
3997,
5398,
7923,
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,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
49,
9795,
46,
932,
75,
16,
365,
2934,
972,
2738,
972,
1435,
365,
18,
1966,
4110,
273,
2238,
5101,
4254,
2932,
53,
3997,
5398,
7923,
365,
18,
... |
alignment = self.OPTIONAL_HEADER.FileAlignment | def parse_sections(self, offset): """Fetch the PE file sections. The sections will be readily available in the "sections" attribute. Its attributes will contain all the section information plus "data" a buffer containing the section's data. The "Characteristics" member will be processed and attributes representing the section characteristics (with the 'IMAGE_SCN_' string trimmed from the constant's names) will be added to the section instance. Refer to the SectionStructure class for additional info. """ self.sections = [] for i in xrange(self.FILE_HEADER.NumberOfSections): section = SectionStructure(self.__IMAGE_SECTION_HEADER_format__) if not section: break section_offset = offset + section.sizeof() * i section.set_file_offset(section_offset) section.__unpack__(self.__data__[section_offset:]) self.__structures__.append(section) if section.SizeOfRawData > len(self.__data__): self.__warnings.append( ('Error parsing section %d. ' % i) + 'SizeOfRawData is larger than file.') | 34820c499168b02a42d03ceff64d1c7d82d717cc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4177/34820c499168b02a42d03ceff64d1c7d82d717cc/pefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
11657,
12,
2890,
16,
1384,
4672,
3536,
5005,
326,
16628,
585,
7178,
18,
225,
1021,
7178,
903,
506,
855,
3220,
2319,
316,
326,
315,
11657,
6,
1566,
18,
29517,
1677,
903,
912,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
11657,
12,
2890,
16,
1384,
4672,
3536,
5005,
326,
16628,
585,
7178,
18,
225,
1021,
7178,
903,
506,
855,
3220,
2319,
316,
326,
315,
11657,
6,
1566,
18,
29517,
1677,
903,
912,
... | |
except: | except Exception: | def uninstall(path): """Remove the file or directory at <path>, which is relative to the install_dir. """ try: path = os.path.join(install_dir, path) if os.path.isfile(path) or os.path.islink(path): os.remove(path) elif os.path.isdir(path): shutil.rmtree(path) else: return print 'Removed', path except: print 'Could not remove', path | fb616df6d3c978a1f4269d9eda613b2b7f78a8c6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14624/fb616df6d3c978a1f4269d9eda613b2b7f78a8c6/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16577,
12,
803,
4672,
3536,
3288,
326,
585,
578,
1867,
622,
411,
803,
20401,
1492,
353,
3632,
358,
326,
3799,
67,
1214,
18,
3536,
775,
30,
589,
273,
1140,
18,
803,
18,
5701,
12,
5425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16577,
12,
803,
4672,
3536,
3288,
326,
585,
578,
1867,
622,
411,
803,
20401,
1492,
353,
3632,
358,
326,
3799,
67,
1214,
18,
3536,
775,
30,
589,
273,
1140,
18,
803,
18,
5701,
12,
5425,
... |
self._matrixIsTransposed = False | def __init__(self): self.isWireframe = False self.objectName = None self.accept("mouse1", self.grabPoint) self.accept("mouse1-up", self.releasePoint) self.accept("p", self.saveTo, ["/tmp/test.egg"]) self.accept("b", self.toggleOobe) self.accept("r", self.toggleRenderMode) self.accept("escape", self.hideTrack) self.selectedObject = None self.points = [] self.surface = None self._matrixIsTransposed = False self.tempVertexes = [] | 225697350492711b09cc292c7229559fdda28fd4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7999/225697350492711b09cc292c7229559fdda28fd4/preview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
291,
15249,
3789,
273,
1083,
365,
18,
1612,
461,
273,
599,
225,
365,
18,
9436,
2932,
11697,
21,
3113,
365,
18,
2752,
70,
2148,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
291,
15249,
3789,
273,
1083,
365,
18,
1612,
461,
273,
599,
225,
365,
18,
9436,
2932,
11697,
21,
3113,
365,
18,
2752,
70,
2148,
13,
365,
18,
... | |
if e.errno == errno.EBADF: | if err == errno.EBADF: | def remove_pending_socket(socket): with self.send_pending_lock: self.send_sockets_pending.remove(sock) | 4ed866cd9ae305434b20d68b82167e9173864337 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9986/4ed866cd9ae305434b20d68b82167e9173864337/torbel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
9561,
67,
7814,
12,
7814,
4672,
598,
365,
18,
4661,
67,
9561,
67,
739,
30,
365,
18,
4661,
67,
7814,
87,
67,
9561,
18,
4479,
12,
15031,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
9561,
67,
7814,
12,
7814,
4672,
598,
365,
18,
4661,
67,
9561,
67,
739,
30,
365,
18,
4661,
67,
7814,
87,
67,
9561,
18,
4479,
12,
15031,
13,
225,
2,
-100,
-100,
-100,
-100,
... |
if type(port) in [type(''), type(u'')]: | if type(port) in [type(''), type(u'')]: | def setPort(self, port): """Change the port. The attribute portstr is set to a string that contains the name of the port.""" was_open = self._isOpen if was_open: self.close() if port is not None: if type(port) in [type(''), type(u'')]: #strings are taken directly self.portstr = port else: self.portstr = self.makeDeviceName(port) else: self.portstr = None self._port = port if was_open: self.open() | 0a06dd5133ebccedf57bfd5cad2b2ea3aa21d306 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/0a06dd5133ebccedf57bfd5cad2b2ea3aa21d306/serialutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2617,
12,
2890,
16,
1756,
4672,
3536,
3043,
326,
1756,
18,
1021,
1566,
1756,
701,
353,
444,
358,
279,
533,
716,
1914,
326,
508,
434,
326,
1756,
12123,
225,
1703,
67,
3190,
273,
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,
444,
2617,
12,
2890,
16,
1756,
4672,
3536,
3043,
326,
1756,
18,
1021,
1566,
1756,
701,
353,
444,
358,
279,
533,
716,
1914,
326,
508,
434,
326,
1756,
12123,
225,
1703,
67,
3190,
273,
36... |
supported = ('html', 'html4css1', 'xhtml') | supported = ('odt', ) | def get_level(self): return self.level | 3d85a55e9c4b1da5e9fc79b2cd9e901ee1d0fce0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1532/3d85a55e9c4b1da5e9fc79b2cd9e901ee1d0fce0/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2815,
12,
2890,
4672,
327,
365,
18,
2815,
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,
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,
336,
67,
2815,
12,
2890,
4672,
327,
365,
18,
2815,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.last_event_y = event.y - self.get_transformed_position()[1] - self.padding scroller_position = event.y - self.get_transformed_position()[1] - self.padding | self.last_event_y = event.y - self.get_transformed_position()[1] - self.padding - self.scroller_height/2 scroller_position = event.y - self.get_transformed_position()[1] - self.padding - self.scroller_height/2 | def on_scroll_move(self, source, event): if self.h == False : if self.last_event_y is None: return clutter.grab_pointer(self.scroller) self.last_event_y = event.y - self.get_transformed_position()[1] - self.padding scroller_position = event.y - self.get_transformed_position()[1] - self.padding self.scroller_position_percent = scroller_position/(self.height - 2*self.padding - self.scroller_height) else : if self.last_event_x is None: return clutter.grab_pointer(self.scroller) self.last_event_x = event.x - self.get_transformed_position()[0] - self.padding scroller_position = event.x - self.get_transformed_position()[0] - self.padding self.scroller_position_percent = scroller_position/(self.height - 2*self.padding - self.scroller_height) self.queue_relayout() | ee7c4622a4459d4bb3b702544f874e5bacb6e698 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5279/ee7c4622a4459d4bb3b702544f874e5bacb6e698/scrollbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
12033,
67,
8501,
12,
2890,
16,
1084,
16,
871,
4672,
309,
365,
18,
76,
422,
1083,
294,
309,
365,
18,
2722,
67,
2575,
67,
93,
353,
599,
30,
327,
927,
18220,
18,
2752,
70,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
12033,
67,
8501,
12,
2890,
16,
1084,
16,
871,
4672,
309,
365,
18,
76,
422,
1083,
294,
309,
365,
18,
2722,
67,
2575,
67,
93,
353,
599,
30,
327,
927,
18220,
18,
2752,
70,
67... |
def _configure(self, event): self._W = event.width-DW def _init_options(self, mainframe): self._leftImage=PhotoImage(master=self._top, data=LEFT_GIF) self._rightImage=PhotoImage(master=self._top, data=RIGHT_GIF) | def _init_messages(self, msgsframe, ctrlframe): self._downImage = PhotoImage(master=self._root, data=DOWN_GIF) self._upImage = PhotoImage(master=self._root, data=UP_GIF) b1 = Button(ctrlframe, text="Messages", justify='center', command=self._messages_toggle, underline=0, highlightthickness=0, activebackground=BG_COLOR, border=0, relief='flat', padx=2, pady=0, **COLOR_CONFIG) b2 = Button(ctrlframe, image=self._downImage, relief='flat', border=0, command=self._messages_toggle, activebackground=BG_COLOR, **COLOR_CONFIG) self._message_button = b2 self._messages_visible = 0 b2.pack(side="left") b1.pack(side="left") f = Frame(msgsframe, background=BG_COLOR) f.pack(side='top', expand=1, fill='both') messages = Text(f, width=80, height=10, **ENTRY_CONFIG) messages['state'] = 'disabled' messages.pack(fill='both', expand=1, side='left') self._messages = messages sb = Scrollbar(f, orient='vertical', **SB_CONFIG) sb.pack(fill='y', side='right') sb['command'] = messages.yview messages['yscrollcommand'] = sb.set messages.tag_config('error', foreground=ERROR_COLOR) messages.tag_config('warning', foreground=WARNING_COLOR) messages.tag_config('guierror', foreground=GUIERROR_COLOR) messages.tag_config('message', foreground=MESSAGE_COLOR) messages.tag_config('header', foreground=HEADER_COLOR) messages.tag_config('uline', underline=1) self._in_header = 0 self._last_tag = 'error' buttons = Frame(msgsframe, background=BG_COLOR) buttons.pack(side='bottom', fill='x') self._show_errors = IntVar(self._root) self._show_errors.set(1) self._show_warnings = IntVar(self._root) self._show_warnings.set(1) self._show_messages = IntVar(self._root) self._show_messages.set(1) Checkbutton(buttons, text='Show Messages', var=self._show_messages, command=self._update_msg_tags, **SHOWMSG_CONFIG).pack(side='left') Checkbutton(buttons, text='Show Warnings', var=self._show_warnings, command=self._update_msg_tags, **SHOWWRN_CONFIG).pack(side='left') Checkbutton(buttons, text='Show Errors', var=self._show_errors, command=self._update_msg_tags, **SHOWERR_CONFIG).pack(side='left') def _update_msg_tags(self, *e): elide_errors = not self._show_errors.get() elide_warnings = not self._show_warnings.get() elide_messages = not self._show_messages.get() elide_headers = elide_errors and elide_warnings self._messages.tag_config('error', elide=elide_errors) self._messages.tag_config('guierror', elide=elide_errors) self._messages.tag_config('warning', elide=elide_warnings) self._messages.tag_config('message', elide=elide_messages) self._messages.tag_config('header', elide=elide_headers) def _init_options(self, optsframe, ctrlframe): self._leftImage=PhotoImage(master=self._root, data=LEFT_GIF) self._rightImage=PhotoImage(master=self._root, data=RIGHT_GIF) | def _configure(self, event): self._W = event.width-DW | 4cf6d74130c32443c10897614b39d1c2c512796c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/4cf6d74130c32443c10897614b39d1c2c512796c/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14895,
12,
2890,
16,
871,
4672,
365,
6315,
59,
273,
871,
18,
2819,
17,
40,
59,
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,
14895,
12,
2890,
16,
871,
4672,
365,
6315,
59,
273,
871,
18,
2819,
17,
40,
59,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
key = data_id['model'] | key = data_id.model | def _get_views(self, cr, uid, ids, field_name=None, arg=None, context={}): res = {} model_data_obj = self.pool.get('ir.model.data') view_obj = self.pool.get('ir.ui.view') report_obj = self.pool.get('ir.actions.report.xml') menu_obj = self.pool.get('ir.ui.menu') mlist = self.browse(cr, uid, ids, context=context) mnames = {} for m in mlist: mnames[m.name] = m.id res[m.id] = { 'menus_by_module':[], 'reports_by_module':[], 'views_by_module': [] } view_id = model_data_obj.search(cr,uid,[('module','in', mnames.keys()), ('model','in',('ir.ui.view','ir.actions.report.xml','ir.ui.menu'))]) for data_id in model_data_obj.browse(cr,uid,view_id,context): # We use try except, because views or menus may not exist try: key = data_id['model'] if key=='ir.ui.view': v = view_obj.browse(cr,uid,data_id.res_id) aa = v.inherit_id and '* INHERIT ' or '' res[mnames[data_id.module]]['views_by_module'].append(aa + v.name + '('+v.type+')') elif key=='ir.actions.report.xml': res[mnames[data_id.module]]['reports_by_module'].append(report_obj.browse(cr,uid,data_id.res_id).name) elif key=='ir.ui.menu': res[mnames[data_id.module]]['menus_by_module'].append(menu_obj.browse(cr,uid,data_id.res_id).complete_name) except KeyError, e: pass for key, value in res.iteritems() : for k, v in res[key].iteritems() : res[key][k] = "\n".join(sorted(v)) return res | 0c1061e4deb5a9c9963ede2ea8bc2b185ff66af8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0c1061e4deb5a9c9963ede2ea8bc2b185ff66af8/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7061,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
33,
7036,
16,
1501,
33,
7036,
16,
819,
12938,
4672,
400,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7061,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
33,
7036,
16,
1501,
33,
7036,
16,
819,
12938,
4672,
400,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
... |
this = apply(_quickfix.new_TradingSessionID, args) | this = _quickfix.new_TradingSessionID(*args) | def __init__(self, *args): this = apply(_quickfix.new_TradingSessionID, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
1609,
7459,
2157,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
1609,
7459,
2157,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
next = self.e.animation.state_next() | next_state = self.e.animation.state_next() | def _update_states(self, emissor, data): step = self.e.animation.state self["main"]["current"].show_value() self["main"]["current"].value = str(step) | c238a894a54048234d34b4e1ffb8ac53a7f03bba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12343/c238a894a54048234d34b4e1ffb8ac53a7f03bba/animations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
7992,
12,
2890,
16,
801,
1054,
280,
16,
501,
4672,
2235,
273,
365,
18,
73,
18,
30822,
18,
2019,
365,
9614,
5254,
6,
6362,
6,
2972,
6,
8009,
4500,
67,
1132,
1435,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
7992,
12,
2890,
16,
801,
1054,
280,
16,
501,
4672,
2235,
273,
365,
18,
73,
18,
30822,
18,
2019,
365,
9614,
5254,
6,
6362,
6,
2972,
6,
8009,
4500,
67,
1132,
1435,
365,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.