rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
'meta': u'Template', | def __init__(self): family.Family.__init__(self) self.name = 'uncyclopedia' | 5291e54d99c50e05679c62b06fbab03ab3f57e0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/5291e54d99c50e05679c62b06fbab03ab3f57e0d/uncyclopedia_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,
551,
93,
7550,
1845,
1155,
11,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
551,
93,
7550,
1845,
1155,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
info('creating LATEST-IS-%s' % VERSION) os.symlink('%s.tar.gz' % basename, 'LATEST-IS-%s' % VERSION) | info('creating LATEST-IS-%s' % __version__) os.symlink('%s.tar.gz' % basename, 'LATEST-IS-%s' % __version__) | def run(self): basename = 'gaupol-%s' % VERSION temp_dir = tempfile.gettempdir() test_dir = os.path.join(temp_dir, basename) # Remove build and test directories. for dir in ('build', 'dist', 'locale', test_dir): info('removing %s' % dir) for root, dirs, files in os.walk(dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if os.path.isdir(dir): os.rmdir(dir) # Remove build files. for name in ('installed-files.log', 'MANIFEST'): if os.path.isfile(name): info('removing %s' % name) os.remove(name) # Compile all translations. os.system('./trantool -m all') # Create tarballs. sdist.run(self) tarballs = os.listdir(self.dist_dir) # Compare tarball contents with working copy. for tarball in tarballs: tarball_path = os.path.join(self.dist_dir, tarball) if not tarfile.is_tarfile(tarball_path): continue tar_file = tarfile.open(tarball_path, 'r') for member in tar_file.getmembers(): tar_file.extract(member, temp_dir) info('comparing tarball (tmp) with working copy (.)') os.system('diff -r -x *.pyc -x .svn . %s' % test_dir) # Stop and ask if all necessary files are included. response = raw_input('Are all files in the tarball [Y/n]? ') if response.lower() == 'n': info('aborted') return break # Change to directory "dist/x.y". os.chdir(self.dist_dir) | 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,
12,
2890,
4672,
225,
4882,
273,
296,
15833,
416,
355,
6456,
87,
11,
738,
8456,
1906,
67,
1214,
273,
13275,
18,
588,
5814,
1214,
1435,
1842,
67,
1214,
273,
1140,
18,
803,
18,
5701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
225,
4882,
273,
296,
15833,
416,
355,
6456,
87,
11,
738,
8456,
1906,
67,
1214,
273,
13275,
18,
588,
5814,
1214,
1435,
1842,
67,
1214,
273,
1140,
18,
803,
18,
5701... |
if self._variation_cache: | if hasattr(self, '_variation_cache'): | def get_product_from_options(self, options): """ Accepts an iterable of either Option object or str(Option) objects Returns the product that matches or None """ options = self._ensure_option_set(options) pv = None if self._variation_cache: optkeys = tuple(options) pv = self._variation_cache.get(optkeys, None) else: for member in self.productvariation_set.all(): if member.option_values == options: pv = member break if pv: return pv.product return None | 8d7a693baf89a532c6890434e7031f9f13752d2c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/171/8d7a693baf89a532c6890434e7031f9f13752d2c/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5896,
67,
2080,
67,
2116,
12,
2890,
16,
702,
4672,
3536,
27158,
392,
6087,
434,
3344,
2698,
733,
578,
609,
12,
1895,
13,
2184,
2860,
326,
3017,
716,
1885,
578,
599,
3536,
702,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5896,
67,
2080,
67,
2116,
12,
2890,
16,
702,
4672,
3536,
27158,
392,
6087,
434,
3344,
2698,
733,
578,
609,
12,
1895,
13,
2184,
2860,
326,
3017,
716,
1885,
578,
599,
3536,
702,... |
if len(result['Value']) > 0: resultDict.update(result['Value']) return S_OK(resultDict) def getJobAttribute(self,jobID,attribute): | if len( result['Value'] ) > 0: resultDict.update( result['Value'] ) return S_OK( resultDict ) def getJobAttribute( self, jobID, attribute ): | def getJobInfo( self, jobID, parameters=[] ): """ Get parameters for job specified by jobID. Parameters can be either job attributes ( fields in the Jobs table ) or those stored in the JobParameters table. The return value is a dictionary of the structure: Dict[Name] = Value """ | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13024,
966,
12,
365,
16,
28913,
16,
1472,
33,
8526,
262,
30,
3536,
968,
1472,
364,
1719,
1269,
635,
28913,
18,
7012,
848,
506,
3344,
1719,
1677,
261,
1466,
316,
326,
26909,
1014,
262,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13024,
966,
12,
365,
16,
28913,
16,
1472,
33,
8526,
262,
30,
3536,
968,
1472,
364,
1719,
1269,
635,
28913,
18,
7012,
848,
506,
3344,
1719,
1677,
261,
1466,
316,
326,
26909,
1014,
262,
... |
print "setting", location request.session['geolocation:updated'] = datetime.now() | request.session['geolocation:updated'] = datetime.utcnow() | def set_location(cls, request, name, location, accuracy, method): if isinstance(location, list): location = tuple(location) | 5ebc06816a116a52f76ef9d344b2fdd46759b516 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/5ebc06816a116a52f76ef9d344b2fdd46759b516/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3562,
12,
6429,
16,
590,
16,
508,
16,
2117,
16,
15343,
16,
707,
4672,
309,
1549,
12,
3562,
16,
666,
4672,
2117,
273,
3193,
12,
3562,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3562,
12,
6429,
16,
590,
16,
508,
16,
2117,
16,
15343,
16,
707,
4672,
309,
1549,
12,
3562,
16,
666,
4672,
2117,
273,
3193,
12,
3562,
13,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
ylist[0] = model.x.copy() | ylist[0] = N.append(model.x.copy(),model.w.copy()) | def __init__(self): self.parameters = None self.model = None self.t_sim_start = None self.t_sim_end = None self.t_sim_duration = None | 26b0aa38aeeb109238a70ccc5a2a24aa83f45669 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/26b0aa38aeeb109238a70ccc5a2a24aa83f45669/sundials.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
3977,
273,
599,
365,
18,
2284,
273,
599,
365,
18,
88,
67,
9812,
67,
1937,
273,
599,
365,
18,
88,
67,
9812,
67,
409,
273,
599,
365,
18,
88,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
3977,
273,
599,
365,
18,
2284,
273,
599,
365,
18,
88,
67,
9812,
67,
1937,
273,
599,
365,
18,
88,
67,
9812,
67,
409,
273,
599,
365,
18,
88,... |
return self.get_basename()+'_'+self.stage+'.sh' | return self.get_basename()+'.sh' | def get_shname(self): """ Returns the name of the sh file """ return self.get_basename()+'_'+self.stage+'.sh' | 43dcab37fc92bcd058f9d34fa6dd08eb7fbb8898 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/43dcab37fc92bcd058f9d34fa6dd08eb7fbb8898/pylal_exttrig_llutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
674,
529,
12,
2890,
4672,
3536,
2860,
326,
508,
434,
326,
699,
585,
3536,
327,
365,
18,
588,
67,
13909,
1435,
6797,
4623,
15,
2890,
18,
12869,
6797,
18,
674,
11,
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,
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,
674,
529,
12,
2890,
4672,
3536,
2860,
326,
508,
434,
326,
699,
585,
3536,
327,
365,
18,
588,
67,
13909,
1435,
6797,
4623,
15,
2890,
18,
12869,
6797,
18,
674,
11,
2,
-100,
-1... |
Set the end time in a row in a process table to the current time. | Identical to the set_process_end_time() function in glue.ligolw.utils.process except uses LAL to convert UTC to GPS time to get the leap seconds correct. | def set_process_end_time(process): """ Set the end time in a row in a process table to the current time. """ process.end_time = XLALUTCToGPS(time.gmtime()).seconds return process | e2a092cec7533600caf3420a51c7a0d5c17de455 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/e2a092cec7533600caf3420a51c7a0d5c17de455/llwapp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2567,
67,
409,
67,
957,
12,
2567,
4672,
3536,
13128,
1706,
358,
326,
444,
67,
2567,
67,
409,
67,
957,
1435,
445,
316,
17960,
18,
80,
360,
355,
91,
18,
5471,
18,
2567,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2567,
67,
409,
67,
957,
12,
2567,
4672,
3536,
13128,
1706,
358,
326,
444,
67,
2567,
67,
409,
67,
957,
1435,
445,
316,
17960,
18,
80,
360,
355,
91,
18,
5471,
18,
2567,
1335,
... |
out,err,res = executil.execWithCaptureErrorStatus("/sbin/cman_tool",args) | out,err,res = executil.execWithCaptureErrorStatus("/usr/sbin/cman_tool",args) | def isClusterQuorate(self): if self.isRHEL4(): args = list() args.append("/sbin/magma_tool") args.append("quorum") cmdstr = ' '.join(args) try: out,err,res = executil.execWithCaptureErrorStatus("/sbin/magma_tool",args) except RuntimeError, e: return False | 1065bb253fe7c9c4739c6f1418df4f6d4f998a85 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3879/1065bb253fe7c9c4739c6f1418df4f6d4f998a85/CommandHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
3629,
928,
280,
340,
12,
2890,
4672,
309,
365,
18,
291,
54,
20264,
24,
13332,
833,
273,
666,
1435,
833,
18,
6923,
2932,
19,
87,
4757,
19,
4527,
2540,
67,
6738,
7923,
833,
18,
69... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
3629,
928,
280,
340,
12,
2890,
4672,
309,
365,
18,
291,
54,
20264,
24,
13332,
833,
273,
666,
1435,
833,
18,
6923,
2932,
19,
87,
4757,
19,
4527,
2540,
67,
6738,
7923,
833,
18,
69... |
for name, exc in failures: | for name, _, exc in failures: | def run_tests(tm): classes = [obj for name, obj in inspect.getmembers(tm) if isinstance(obj, type)] tm.raises = raises tm.skip = skip successes = [] failures = [] skipped = [] for klass in classes: tests = [(name, meth) for name, meth in inspect.getmembers(klass()) if not name.startswith('_')] for name, meth in tests: if name == 'setup_class': continue try: meth() except Skip: skipped.append(name) except Exception, e: failures.append((name, e)) else: successes.append(name) if successes: print "Successes :" print '', '\n '.join(successes) print if failures: print "Failures :" for name, exc in failures: print '', name, "failed because", str(exc) print if skipped: print "Skipped" print '', '\n '.join(skipped) | 48a0f245c877112163faca4b3cb4ae682e985dd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/48a0f245c877112163faca4b3cb4ae682e985dd3/_test_logic_build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
16925,
4672,
3318,
273,
306,
2603,
364,
508,
16,
1081,
316,
5334,
18,
588,
7640,
12,
16925,
13,
309,
1549,
12,
2603,
16,
618,
25887,
225,
6118,
18,
354,
6141,
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,
1086,
67,
16341,
12,
16925,
4672,
3318,
273,
306,
2603,
364,
508,
16,
1081,
316,
5334,
18,
588,
7640,
12,
16925,
13,
309,
1549,
12,
2603,
16,
618,
25887,
225,
6118,
18,
354,
6141,
273,... |
lfcu = getLFCurl(dsn,lfn) | def check_dq2_file_avaiability(self,dsn,lfn,jobid): # Check if a file is available on NorduGrid | 846134a85a4f612381877f1bf6c0b871a6ff92c1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1488/846134a85a4f612381877f1bf6c0b871a6ff92c1/NG.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
72,
85,
22,
67,
768,
67,
1629,
21280,
12,
2890,
16,
26055,
16,
80,
4293,
16,
4688,
350,
4672,
468,
2073,
309,
279,
585,
353,
2319,
603,
423,
517,
89,
6313,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
72,
85,
22,
67,
768,
67,
1629,
21280,
12,
2890,
16,
26055,
16,
80,
4293,
16,
4688,
350,
4672,
468,
2073,
309,
279,
585,
353,
2319,
603,
423,
517,
89,
6313,
2,
-100,
-100,
... | |
'Tsting counting number of male' | 'Testing counting number of male' | def testNumOfMale(self): 'Tsting counting number of male' pop = population(subPop=[200, 800]) for i in range(100): pop.individual(i,0).setSex(Male) pop.individual(i,1).setSex(Male) for i in range(100,200): pop.individual(i,0).setSex(Female) for i in range(100,800): pop.individual(i,1).setSex(Female) Stat(pop, numOfMale=1) self.assertEqual(pop.dvars().numOfMale, 200) self.assertEqual(pop.dvars().numOfFemale, 800) self.assertEqual(pop.dvars(0).numOfMale, 100) self.assertEqual(pop.dvars(0).numOfFemale, 100) self.assertEqual(pop.dvars(1).numOfMale, 100) self.assertEqual(pop.dvars(1).numOfFemale, 700) | b6008f11a8360d847f0ee1141c803ba514cfa6ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/b6008f11a8360d847f0ee1141c803ba514cfa6ff/test_08_opStat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2578,
951,
49,
5349,
12,
2890,
4672,
296,
22218,
22075,
1300,
434,
312,
5349,
11,
1843,
273,
11209,
12,
1717,
7049,
22850,
6976,
16,
1725,
713,
5717,
364,
277,
316,
1048,
12,
6625,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2578,
951,
49,
5349,
12,
2890,
4672,
296,
22218,
22075,
1300,
434,
312,
5349,
11,
1843,
273,
11209,
12,
1717,
7049,
22850,
6976,
16,
1725,
713,
5717,
364,
277,
316,
1048,
12,
6625,... |
""" flimage_alloc() -> image """ | """ flimage_alloc() -> pImage """ | def flimage_alloc(): """ flimage_alloc() -> image """ retval = _flimage_alloc() return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
9853,
13332,
3536,
1183,
2730,
67,
9853,
1435,
317,
293,
2040,
3536,
225,
5221,
273,
389,
2242,
2730,
67,
9853,
1435,
327,
5221,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
9853,
13332,
3536,
1183,
2730,
67,
9853,
1435,
317,
293,
2040,
3536,
225,
5221,
273,
389,
2242,
2730,
67,
9853,
1435,
327,
5221,
282,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
instancesdata = client.QueryInstances([], ["name"], True) instanceslist = [row[0] for row in instancesdata] | def GET(self): """Returns a list of all available instances. | 9031ee8eef9887bfe9a5a331e1eb42c1600a63aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/9031ee8eef9887bfe9a5a331e1eb42c1600a63aa/rlib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4978,
12,
2890,
4672,
3536,
1356,
279,
666,
434,
777,
2319,
3884,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
4978,
12,
2890,
4672,
3536,
1356,
279,
666,
434,
777,
2319,
3884,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
parameters= {} if classadJob.lookupAttribute("Parameters"): parameters= classadJob.getDictionaryFromSubJDL("Parameters") res = self.setJobParameters(jobID, parameters.items()) | parameters = {} if classadJob.lookupAttribute( "Parameters" ): parameters = classadJob.getDictionaryFromSubJDL( "Parameters" ) res = self.setJobParameters( jobID, parameters.items() ) | def __setInitialJobParameters( self, classadJob, jobID): """ Set initial job parameters as was defined in the Classad """ | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
4435,
2278,
2402,
12,
365,
16,
667,
361,
2278,
16,
28913,
4672,
3536,
1000,
2172,
1719,
1472,
487,
1703,
2553,
316,
326,
1659,
361,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
4435,
2278,
2402,
12,
365,
16,
667,
361,
2278,
16,
28913,
4672,
3536,
1000,
2172,
1719,
1472,
487,
1703,
2553,
316,
326,
1659,
361,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
hatari = Hatari(args[1:]) | hatari = Hatari(args) | def __init__(self): args, self.file, self.exit = self.parse_args(sys.argv) hatari = Hatari(args[1:]) self.tokens = Tokens(hatari) self.command = CommandInput(self.tokens.get_tokens()) | fe2cf0da11f536e2624ab378ee0fbfc716e6d6f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8501/fe2cf0da11f536e2624ab378ee0fbfc716e6d6f2/hatari-console.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
833,
16,
365,
18,
768,
16,
365,
18,
8593,
273,
365,
18,
2670,
67,
1968,
12,
9499,
18,
19485,
13,
366,
8761,
77,
273,
670,
8761,
77,
12,
1968,
13,
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,
4672,
833,
16,
365,
18,
768,
16,
365,
18,
8593,
273,
365,
18,
2670,
67,
1968,
12,
9499,
18,
19485,
13,
366,
8761,
77,
273,
670,
8761,
77,
12,
1968,
13,
3... |
except DistutilsExecError, msg: | except DistutilsExecError as msg: | def create_static_lib(self, objects, output_libname, output_dir=None, debug=0, target_lang=None): | 4fca9553791a03c69c398ad5bd01c118b49b73e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/4fca9553791a03c69c398ad5bd01c118b49b73e3/msvc9compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3845,
67,
2941,
12,
2890,
16,
2184,
16,
876,
67,
2941,
529,
16,
876,
67,
1214,
33,
7036,
16,
1198,
33,
20,
16,
1018,
67,
4936,
33,
7036,
4672,
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,
752,
67,
3845,
67,
2941,
12,
2890,
16,
2184,
16,
876,
67,
2941,
529,
16,
876,
67,
1214,
33,
7036,
16,
1198,
33,
20,
16,
1018,
67,
4936,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-... |
format = self.conn.getFileFormt(f[1].upper()) | try: format = self.conn.getFileFormt(f[1].upper()) except: format = self.conn.getFileFormt("application/octet-stream") | def createDatasetFileAnnotation(self, newFile): if newFile.content_type.startswith("image"): f = newFile.content_type.split("/") format = self.conn.getFileFormt(f[1].upper()) else: format = self.conn.getFileFormt(newFile.content_type) oFile = OriginalFileI() oFile.setName(rstring(str(newFile.name))); oFile.setPath(rstring(str(newFile.name))); oFile.setSize(rlong(long(newFile.size))); oFile.setSha1(rstring("pending")); oFile.setFormat(format); of = self.conn.saveAndReturnObject(oFile); self.conn.saveFile(newFile, of.id) fa = FileAnnotationI() fa.setFile(of._obj) l_ia = DatasetAnnotationLinkI() l_ia.setParent(self.dataset._obj) l_ia.setChild(fa) self.conn.saveObject(l_ia) | 304c1c03a7cc8ac4b587149f1894565a404d4518 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/304c1c03a7cc8ac4b587149f1894565a404d4518/container.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
10656,
812,
3257,
12,
2890,
16,
20592,
4672,
309,
20592,
18,
1745,
67,
723,
18,
17514,
1918,
2932,
2730,
6,
4672,
284,
273,
20592,
18,
1745,
67,
723,
18,
4939,
2932,
4898,
13,
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,
752,
10656,
812,
3257,
12,
2890,
16,
20592,
4672,
309,
20592,
18,
1745,
67,
723,
18,
17514,
1918,
2932,
2730,
6,
4672,
284,
273,
20592,
18,
1745,
67,
723,
18,
4939,
2932,
4898,
13,
775... |
el1 = etree.SubElement(self.automatic_styles, | el1 = SubElement(self.automatic_styles, | def generate_figure(self, node, source, destination): caption = None for node1 in node.parent.children: if node1.tagname == 'caption': caption = node1.astext() self.image_count += 1 style_name = 'rstframestyle%d' % self.image_count if 'scale' in node.attributes: try: scale = int(node.attributes['scale']) if scale < 1 or scale > 100: raise ValueError scale = scale * 0.01 except ValueError, e: print 'Error: Invalid scale for image: "%s"' % ( node.attributes['scale'], ) else: scale = 1.0 width = None if 'width' in node.attributes: try: width = int(node.attributes['width']) width = width * (35.278 / 1000.0) width *= scale #attrib['svg:width'] = '%.2fcm' % (width, ) except ValueError, e: print 'Error: Invalid width for image: "%s"' % ( node.attributes['width'], ) height = None if 'height' in node.attributes: try: height = int(node.attributes['height']) height = height * (35.278 / 1000.0) height *= scale #attrib['svg:height'] = '%.2fcm' % (height, ) except ValueError, e: print 'Error: Invalid height for image: "%s"' % ( node.attributes['height'], ) # Add the styles attrib = { 'style:name': style_name, 'style:family': 'graphic', 'style:parent-style-name': 'Frame', } el1 = etree.SubElement(self.automatic_styles, 'style:style', attrib=attrib) halign = 'center' valign = 'top' if 'align' in node.attributes: align = node.attributes['align'].split() for val in align: if val in ('left', 'center', 'right'): halign = val elif val in ('top', 'middle', 'bottom'): valign = val attrib = { 'fo:margin-left': '0cm', 'fo:margin-right': '0cm', 'fo:margin-top': '0cm', 'fo:margin-bottom': '0cm', 'style:wrap': 'dynamic', 'style:number-wrapped-paragraphs': 'no-limit', 'style:vertical-pos': valign, 'style:vertical-rel': 'paragraph', 'style:horizontal-pos': halign, 'style:horizontal-rel': 'paragraph', 'fo:padding': '0cm', 'fo:border': 'none', } el2 = etree.SubElement(el1, 'style:graphic-properties', attrib=attrib) # Add the content attrib = {'text:style-name': 'rststyle-textbody'} el1 = etree.SubElement(self.current_element, 'text:p', attrib=attrib) attrib = { 'draw:style-name': style_name, 'draw:name': 'Frame1', 'text:anchor-type': 'paragraph', 'draw:z-index': '1', } if width is not None: attrib['svg:width'] = '%.2fcm' % (width, ) el1 = etree.SubElement(el1, 'draw:frame', attrib=attrib) attrib = {} if height is not None: attrib['fo:min-height'] = '%.2fcm' % (height, ) el1 = etree.SubElement(el1, 'draw:text-box', attrib=attrib) attrib = {'text:style-name': 'rststyle-caption', } el1 = etree.SubElement(el1, 'text:p', attrib=attrib) # Add the image (frame) inside the figure/caption frame. #ipshell('At visit_image #1') el2 = self.generate_image(node, source, destination, el1) if caption: el2.tail = caption | 277ba1af817dc725b8179dbbf649a815fdff5939 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/277ba1af817dc725b8179dbbf649a815fdff5939/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... |
wx.PostEvent(mainFrame, ExternalCommandEvent(wx.ID_EXIT)) | wx.GetApp().ExitMainLoop() | def restart(): globalVars.restart=True wx.PostEvent(mainFrame, ExternalCommandEvent(wx.ID_EXIT)) | e529c4a26c93266b4105df29328c8ffce559205d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9340/e529c4a26c93266b4105df29328c8ffce559205d/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7870,
13332,
2552,
5555,
18,
19164,
33,
5510,
7075,
18,
967,
3371,
7675,
6767,
6376,
6452,
1435,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
7870,
13332,
2552,
5555,
18,
19164,
33,
5510,
7075,
18,
967,
3371,
7675,
6767,
6376,
6452,
1435,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return unpack('>h',self._ttf_data[self._pos-2:self._pos])[0] | try: return unpack('>h',self._ttf_data[self._pos-2:self._pos])[0] except structError, error: raise TTFError, error | def read_short(self): "Reads a signed short" self._pos += 2 return unpack('>h',self._ttf_data[self._pos-2:self._pos])[0] | 2e9257ab9f776c93d11b4ff49df6c9861d612891 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3878/2e9257ab9f776c93d11b4ff49df6c9861d612891/ttfonts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
6620,
12,
2890,
4672,
315,
7483,
279,
6726,
3025,
6,
365,
6315,
917,
1011,
576,
327,
6167,
2668,
34,
76,
2187,
2890,
6315,
748,
74,
67,
892,
63,
2890,
6315,
917,
17,
22,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
6620,
12,
2890,
4672,
315,
7483,
279,
6726,
3025,
6,
365,
6315,
917,
1011,
576,
327,
6167,
2668,
34,
76,
2187,
2890,
6315,
748,
74,
67,
892,
63,
2890,
6315,
917,
17,
22,
30,... |
self.pid = os.fork() | gc_was_enabled = gc.isenabled() gc.disable() try: self.pid = os.fork() except: if gc_was_enabled: gc.enable() raise | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (POSIX version)""" | 5d2ea350e68b755dcbb1828b1521197b50c4a8f2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/5d2ea350e68b755dcbb1828b1521197b50c4a8f2/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... |
test_support.unlink(test_support.TESTFN) | def setUp(self): """Setup of a temp file to use for testing""" self.text = "test_urllib: %s\n" % self.__class__.__name__ test_support.unlink(test_support.TESTFN) FILE = file(test_support.TESTFN, 'wb') try: FILE.write(self.text) finally: FILE.close() self.pathname = test_support.TESTFN self.returned_obj = urllib.urlopen("file:%s" % self.pathname) | 9aba6d6905bcf3f3009f71cfa70525eb8b0ad3dc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/9aba6d6905bcf3f3009f71cfa70525eb8b0ad3dc/test_urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
3536,
7365,
434,
279,
1906,
585,
358,
999,
364,
7769,
8395,
365,
18,
955,
273,
315,
3813,
67,
718,
2941,
30,
738,
87,
64,
82,
6,
738,
365,
16186,
1106,
972,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
3536,
7365,
434,
279,
1906,
585,
358,
999,
364,
7769,
8395,
365,
18,
955,
273,
315,
3813,
67,
718,
2941,
30,
738,
87,
64,
82,
6,
738,
365,
16186,
1106,
972,
16... | |
note("applied inventory delta ...") | note("applying inventory delta ...") | def post_process_files(self): """Save the revision.""" if self.verbose: note("applied inventory delta ...") for entry in self.inv_delta: note(" %r" % (entry,)) self.inventory.apply_delta(self.inv_delta) self.cache_mgr.inventories[self.command.ref] = self.inventory if self.verbose: note("creating inventory ...") for entry in self.inventory: note(" %r" % (entry,)) | b5f8fae83e6efdbfa9ab887eec72707bb079dd2b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8703/b5f8fae83e6efdbfa9ab887eec72707bb079dd2b/generic_processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
2567,
67,
2354,
12,
2890,
4672,
3536,
4755,
326,
6350,
12123,
309,
365,
18,
11369,
30,
4721,
2932,
9010,
310,
13086,
3622,
1372,
7923,
364,
1241,
316,
365,
18,
5768,
67,
9878,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
2567,
67,
2354,
12,
2890,
4672,
3536,
4755,
326,
6350,
12123,
309,
365,
18,
11369,
30,
4721,
2932,
9010,
310,
13086,
3622,
1372,
7923,
364,
1241,
316,
365,
18,
5768,
67,
9878,
... |
txt = new_doc.createTextNode('/') col.appendChild(txt) node_line.appendChild(col) | col.text = '/' node_line.append(col) | def _append_node(name, text): n = new_doc.createElement(name) t = new_doc.createTextNode(text) n.appendChild(t) config.appendChild(n) | 32aa89f603ce93d4388ce6f049f482862969ced9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/32aa89f603ce93d4388ce6f049f482862969ced9/custom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
394,
67,
2434,
18,
2640,
1046,
12,
529,
13,
268,
273,
394,
67,
2434,
18,
2640,
17299,
12,
955,
13,
290,
18,
6923,
1763,
12,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
394,
67,
2434,
18,
2640,
1046,
12,
529,
13,
268,
273,
394,
67,
2434,
18,
2640,
17299,
12,
955,
13,
290,
18,
6923,
1763,
12,
8... |
cestring = "CE: %s, GOCDB Name: %s"%(ce,nameBDII) | cestring = "CE: %s, GOCDB Name: %s"%(ce,nameBDII) | def _lookForCE(self): sites = gConfig.getSections('/Resources/Sites/LCG')['Value'] | e7fe144bdf9e77019e8be7de0be022052acb42ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/e7fe144bdf9e77019e8be7de0be022052acb42ca/CE2CSAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7330,
1290,
1441,
12,
2890,
4672,
225,
9180,
273,
314,
809,
18,
588,
15965,
2668,
19,
3805,
19,
17055,
19,
13394,
43,
6134,
3292,
620,
3546,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
7330,
1290,
1441,
12,
2890,
4672,
225,
9180,
273,
314,
809,
18,
588,
15965,
2668,
19,
3805,
19,
17055,
19,
13394,
43,
6134,
3292,
620,
3546,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
[('xmax', 3.0), ('xmin', -1.0), ('ymax', 10.0), ('ymin', 1.0)] """ try: return dict(self._minmax_data) except AttributeError: self._minmax_data = self._get_minmax_data() return dict(self._minmax_data) def _get_minmax_data(self): """ Actually compute the minmax data from the graphics that make up this image. EXAMPLES: sage: g = line([(-1,1), (3,2)]) sage: list(sorted(g._get_minmax_data().items())) [('xmax', 3.0), ('xmin', -1.0), ('ymax', 2.0), ('ymin', 1.0)] Note that changing ymax doesn't change the output of _get_minmax_data: sage: g.ymax(10) sage: list(sorted(g.get_minmax_data().items())) [('xmax', 3.0), ('xmin', -1.0), ('ymax', 10.0), ('ymin', 1.0)] sage: list(sorted(g._get_minmax_data().items())) | def get_minmax_data(self): """ Return a dictionary whose keys give the xmin, xmax, ymin, and ymax data for this graphic. | e6943e8553d1dd6ca0e171babad6dbe3ff4864a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/e6943e8553d1dd6ca0e171babad6dbe3ff4864a0/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1154,
1896,
67,
892,
12,
2890,
4672,
3536,
2000,
279,
3880,
8272,
1311,
8492,
326,
13777,
16,
14016,
16,
15763,
16,
471,
15275,
501,
364,
333,
19548,
18,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1154,
1896,
67,
892,
12,
2890,
4672,
3536,
2000,
279,
3880,
8272,
1311,
8492,
326,
13777,
16,
14016,
16,
15763,
16,
471,
15275,
501,
364,
333,
19548,
18,
2,
-100,
-100,
-100,
... | |
for contName in self._leakDetector.getContainerNameByIdGen(id): | for contName in self._leakDetector.getContainerNameByIdGen(objId): | def run(self): try: self._leakDetector._index2containerId2len[self._index] = {} ids = self._leakDetector.getContainerIds() # record the current len of each container for id in ids: yield None try: for result in self._leakDetector.getContainerByIdGen(id): yield None container = result except Exception, e: # this container no longer exists if self.notify.getDebug(): for contName in self._leakDetector.getContainerNameByIdGen(id): yield None self.notify.debug( '%s no longer exists; caught exception in getContainerById (%s)' % ( contName, e)) self._leakDetector.removeContainerById(id) continue if container is None: # this container no longer exists if self.notify.getDebug(): for contName in self._leakDetector.getContainerNameByIdGen(id): yield None self.notify.debug('%s no longer exists; getContainerById returned None' % contName) self._leakDetector.removeContainerById(id) continue try: cLen = len(container) except Exception, e: # this container no longer exists if self.notify.getDebug(): for contName in self._leakDetector.getContainerNameByIdGen(id): yield None self.notify.debug( '%s is no longer a container, it is now %s (%s)' % (contName, safeRepr(container), e)) self._leakDetector.removeContainerById(id) continue self._leakDetector._index2containerId2len[self._index][id] = cLen # compare the current len of each container to past lens if self._index > 0: idx2id2len = self._leakDetector._index2containerId2len for id in idx2id2len[self._index]: yield None if id in idx2id2len[self._index-1]: diff = idx2id2len[self._index][id] - idx2id2len[self._index-1][id] if diff > 0: if diff > idx2id2len[self._index-1][id]: minutes = (self._leakDetector._index2delay[self._index] - self._leakDetector._index2delay[self._index-1]) / 60. name = self._leakDetector.getContainerNameById(id) if idx2id2len[self._index-1][id] != 0: percent = 100. * (float(diff) / float(idx2id2len[self._index-1][id])) try: for container in self._leakDetector.getContainerByIdGen(id): yield None except: # TODO self.notify.debug('caught exception in getContainerByIdGen (1)') else: self.notify.warning( '%s (%s) grew %.2f%% in %.2f minutes (%s items at last measurement, current contents: %s)' % ( name, itype(container), percent, minutes, idx2id2len[self._index][id], fastRepr(container, maxLen=CheckContainers.ReprItems))) yield None if (self._index > 2 and id in idx2id2len[self._index-2] and id in idx2id2len[self._index-3]): diff2 = idx2id2len[self._index-1][id] - idx2id2len[self._index-2][id] diff3 = idx2id2len[self._index-2][id] - idx2id2len[self._index-3][id] if self._index <= 4: if diff > 0 and diff2 > 0 and diff3 > 0: name = self._leakDetector.getContainerNameById(id) try: for container in self._leakDetector.getContainerByIdGen(id): yield None except: # TODO self.notify.debug('caught exception in getContainerByIdGen (2)') else: msg = ('%s (%s) consistently increased in size over the last ' '3 periods (%s items at last measurement, current contents: %s)' % (name, itype(container), idx2id2len[self._index][id], fastRepr(container, maxLen=CheckContainers.ReprItems))) self.notify.warning(msg) yield None elif (id in idx2id2len[self._index-4] and id in idx2id2len[self._index-5]): # if size has consistently increased over the last 5 checks, # send out a warning diff4 = idx2id2len[self._index-3][id] - idx2id2len[self._index-4][id] diff5 = idx2id2len[self._index-4][id] - idx2id2len[self._index-5][id] if diff > 0 and diff2 > 0 and diff3 > 0 and diff4 > 0 and diff5 > 0: name = self._leakDetector.getContainerNameById(id) try: for container in self._leakDetector.getContainerByIdGen(id): yield None except: # TODO self.notify.debug('caught exception in getContainerByIdGen (3)') else: msg = ('%s (%s) consistently increased in size over the last ' '5 periods (%s items at last measurement, current contents: %s)' % (name, itype(container), idx2id2len[self._index][id], fastRepr(container, maxLen=CheckContainers.ReprItems))) self.notify.warning(msg) self.notify.info('sending notification...') yield None messenger.send(self._leakDetector.getLeakEvent(), [container, name]) except Exception, e: print 'CheckContainers job caught exception: %s' % e if __dev__: #raise e pass yield Job.Done | 2144050758ff193ad2f7bd973df523fae0d7fd5c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/2144050758ff193ad2f7bd973df523fae0d7fd5c/ContainerLeakDetector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
775,
30,
365,
6315,
298,
581,
12594,
6315,
1615,
22,
3782,
548,
22,
1897,
63,
2890,
6315,
1615,
65,
273,
2618,
3258,
273,
365,
6315,
298,
581,
12594,
18,
588,
217... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
775,
30,
365,
6315,
298,
581,
12594,
6315,
1615,
22,
3782,
548,
22,
1897,
63,
2890,
6315,
1615,
65,
273,
2618,
3258,
273,
365,
6315,
298,
581,
12594,
18,
588,
217... |
trans.account LIKE balance.account '''+_concat+''' :const('%') \ | trans.account LIKE balance.account '''+_startswith_sfx + ''' \ | def test4_balance_trans_via_prev_balance_date_subselect( self): '''sum balances of transactions per account/date-range; prev.balance.date as startdate testing: source,target-not-replaceable, and, <=, subselect update balance set total = (select sum(trans.money) where trans.account like balance.account+'%' AND trans.date <= balance.finaldate AND trans.date > (SELECT MAX(finaldate) FROM balance as b WHERE b.finaldate < balance.finaldate) ) where srctrans.account like balance.account+'%' AND srctrans.date <= balance.finaldate AND srctrans.date > (SELECT MAX(finaldate) FROM balance as b WHERE b.finaldate < balance.finaldate) #the subselect is to get previous_balance.finaldate. Needs fix if no previous_balance! ''' trans =Table( 'trans', self.m, Column( 'date', Date), Column( 'account', Text), Column( 'money', Numeric) ) balance=Table( 'balance', self.m, Column( 'finaldate', Date), Column( 'account', Text), Column( 'total', Numeric) ) b = balance.alias('b') sprev = select( [ func.max( b.c.finaldate)], b.c.finaldate < balance.c.finaldate ) #correlate is non-generative in 0.3 (ret None) but generative in 0.4 sprev = sprev.correlate( balance) or sprev sprev = sprev.as_scalar() #??? 0.3? | 4ae45b8f5d96b6b965ed9ce92451eedbb0d0f4ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10808/4ae45b8f5d96b6b965ed9ce92451eedbb0d0f4ef/convertertest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
24,
67,
12296,
67,
2338,
67,
21985,
67,
10001,
67,
12296,
67,
712,
67,
1717,
4025,
12,
365,
4672,
9163,
1364,
324,
26488,
434,
8938,
1534,
2236,
19,
712,
17,
3676,
31,
2807,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
24,
67,
12296,
67,
2338,
67,
21985,
67,
10001,
67,
12296,
67,
712,
67,
1717,
4025,
12,
365,
4672,
9163,
1364,
324,
26488,
434,
8938,
1534,
2236,
19,
712,
17,
3676,
31,
2807,
18,
... |
cmd += ["--log-to-stderr=no"] | cmd += ["--log-to-stderr=no"] if log_level != None: cmd += ["--log-enable=%s" % log_level] | def __init__(self, test, args=[], name=None, expect=EXPECT_RUNNING, port=0): """Start a broker daemon. name determines the data-dir and log file names.""" | 5ea15473e66289f047f411629184767faf3802a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/197/5ea15473e66289f047f411629184767faf3802a3/brokertest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1842,
16,
833,
22850,
6487,
508,
33,
7036,
16,
4489,
33,
2294,
1423,
1268,
67,
29358,
16,
1756,
33,
20,
4672,
3536,
1685,
279,
8625,
8131,
18,
508,
12949... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1842,
16,
833,
22850,
6487,
508,
33,
7036,
16,
4489,
33,
2294,
1423,
1268,
67,
29358,
16,
1756,
33,
20,
4672,
3536,
1685,
279,
8625,
8131,
18,
508,
12949... |
ticket['keywords'] = string.join(keywords) | ticket['keywords'] = string.join(keywords) | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % \ (_db, _host, _user, ("*" * len(_password))) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "\nCleaning all tickets..." c = trac.db().cursor() c.execute("DELETE FROM ticket_change") trac.db().commit() c.execute("DELETE FROM ticket") trac.db().commit() c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") # Straight from the Python documentation. for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_dir): os.mkdir(attachments_dir) trac.db().commit() print "All tickets cleaned..." print "\n0. Filtering products..." mysql_cur.execute("SELECT name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = products print " Using products", " ".join(PRODUCTS) print "\n1. Import severities..." trac.setSeverityList(SEVERITIES) print "\n2. Import components..." if not COMPONENTS_FROM_PRODUCTS: if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'name') else: sql = """SELECT program AS product, value AS comp, initialowner AS owner FROM components""" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) lines = mysql_cur.fetchall() all_components = {} # product -> components all_owners = {} # product, component -> owner for line in lines: product = line['product'] comp = line['comp'] owner = line['owner'] all_components.setdefault(product, []).append(comp) all_owners[(product, comp)] = owner component_list = [] for product, components in all_components.items(): # find best default owner default = None for comp in DEFAULT_COMPONENTS: if comp in components: default = comp break if default is None: default = components[0] owner = all_owners[(product, default)] owner_name = trac.getLoginName(mysql_cur, owner) component_list.append({'product': product, 'owner': owner_name}) trac.setComponentList(component_list, 'product') print "\n3. Import priorities..." trac.setPriorityList(PRIORITIES) print "\n4. Import versions..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCTROW versions.value AS value FROM products, versions""" sql += " WHERE" + makeWhereClause('products.name', PRODUCTS) else: sql = "SELECT DISTINCTROW value FROM versions" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) milestones = mysql_cur.fetchall() trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.id" sql += " ORDER BY b.bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print "\n7. Import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'].lower() ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) cc_list = [cc for cc in cc_list if '@' in cc and cc not in IGNORE_CC] ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time = desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] keywords = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == "resolution" or field_name == "bug_status": removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == "resolution": resolution = added.lower() add_keywords = [] remove_keywords = [] # convert bugzilla field names... if field_name == "bug_severity": field_name = "severity" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" if removed in STATUS_KEYWORDS: remove_keywords.append(STATUS_KEYWORDS[removed]) if added in STATUS_KEYWORDS: add_keywords.append(STATUS_KEYWORDS[added]) added = statusXlator[added] removed = statusXlator[removed] elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(removed, removed) if kw: remove_keywords.append(kw) if MAP_ALL_KEYWORDS or added in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(added, added) if kw: add_keywords.append(kw) if field_name == "component": # just keep the keyword change added = removed = "" elif field_name == "target_milestone": field_name = "milestone" if added in IGNORE_MILESTONES: added = "" if removed in IGNORE_MILESTONES: removed = "" ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if add_keywords or remove_keywords: # ensure removed ones are in old old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] # remove from new keywords = [kw for kw in keywords if kw not in remove_keywords] # add to new keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChangeKw['field'] = "keywords" ticketChangeKw['oldvalue'] = ' '.join(old_keywords) ticketChangeKw['newvalue'] = ' '.join(keywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # Skip changes that have no effect (think translation!). if added == removed: continue # Bugzilla splits large summary changes into two records. for oldChange in ticketChanges: if (field_name == "summary" and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break # cc sometime appear in different activities with same time if (field_name == "cc" \ and oldChange['time'] == ticketChange['time']): oldChange['newvalue'] += ", " + ticketChange['newvalue'] break else: ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # For some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. Let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == "closed": ticket['resolution'] = resolution bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] if kw not in keywords: keywords.append(kw) product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: keywords.append(kw) component = bug['component'] if (COMPONENTS_FROM_PRODUCTS and \ (MAP_ALL_KEYWORDS or component in KEYWORDS_MAPPING)): kw = KEYWORDS_MAPPING.get(component, component) if kw and kw not in keywords: keywords.append(kw) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) trac.addAttachment(author, a) print "\n8. Importing users and passwords..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['login_name'] htpasswd.write(login + ":" + user['cryptpassword'] + "\n") htpasswd.close() print " Bugzilla users converted to htpasswd format, see 'htpasswd'." print "\nAll tickets converted." | 96cc24322ea11500094f96e7b8dc5b0c7e85d253 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/96cc24322ea11500094f96e7b8dc5b0c7e85d253/bugzilla2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... |
gLogger.showHeaders( False ) | def initialize( script = False, ignoreErrors = False, initializeMonitor = False, enableCommandLine = False ): global localCfg, scriptName gLogger.showHeaders( False ) userDisabled = not localCfg.isCSEnabled() if not userDisabled: localCfg.disableCS() if not enableCommandLine: localCfg.disableParsingCommandLine() if script: scriptName = script scriptSection = localCfg.setConfigurationForScript( scriptName ) if not ignoreErrors: localCfg.addMandatoryEntry( "/DIRAC/Setup" ) resultDict = localCfg.loadUserData() if not ignoreErrors and not resultDict[ 'OK' ]: gLogger.error( "There were errors when loading configuration", resultDict[ 'Message' ] ) sys.exit( 1 ) if not userDisabled: localCfg.enableCS() if initializeMonitor: gMonitor.setComponentType( gMonitor.COMPONENT_SCRIPT ) gMonitor.setComponentName( scriptName ) gMonitor.setComponentLocation( "script" ) gMonitor.initialize() else: gMonitor.disable() | fc626a042268cdfe20e7173ae3c292e2e47637a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/fc626a042268cdfe20e7173ae3c292e2e47637a8/Script.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2728,
273,
1083,
16,
2305,
4229,
273,
1083,
16,
4046,
7187,
273,
1083,
16,
4237,
21391,
273,
1083,
262,
30,
2552,
1191,
8198,
16,
31008,
225,
729,
8853,
273,
486,
1191,
8198,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2728,
273,
1083,
16,
2305,
4229,
273,
1083,
16,
4046,
7187,
273,
1083,
16,
4237,
21391,
273,
1083,
262,
30,
2552,
1191,
8198,
16,
31008,
225,
729,
8853,
273,
486,
1191,
8198,
... | |
return self.__executeSingleReplicaStorageElementOperation(storageElementName,lfn,'isFile') else: return self.__executeReplicaStorageElementOperation(storageElementName,lfn,'isFile') def getReplicaSize(self,lfn,storageElementName,singleFile=False): | return self.__executeSingleReplicaStorageElementOperation( storageElementName, lfn, 'isFile' ) else: return self.__executeReplicaStorageElementOperation( storageElementName, lfn, 'isFile' ) def getReplicaSize( self, lfn, storageElementName, singleFile=False ): | def getReplicaIsFile(self,lfn,storageElementName,singleFile=False): """ Determine whether the supplied lfns are files at the supplied StorageElement | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
6996,
2520,
812,
12,
2890,
16,
80,
4293,
16,
5697,
30584,
16,
7526,
812,
33,
8381,
4672,
3536,
10229,
2856,
326,
4580,
18594,
2387,
854,
1390,
622,
326,
4580,
5235,
1046,
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,
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,
5561,
6996,
2520,
812,
12,
2890,
16,
80,
4293,
16,
5697,
30584,
16,
7526,
812,
33,
8381,
4672,
3536,
10229,
2856,
326,
4580,
18594,
2387,
854,
1390,
622,
326,
4580,
5235,
1046,
2,
-100,
... |
If k is None, use Jon Bober's highly | If k is None, use Jonathan Bober's highly | def number_of_partitions(n,k=None, algorithm='default'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'default') 'default' -- If k is not None, then use Gap (very slow). If k is None, use Jon Bober's highly optimized implementation (this is the fastest code in the world for this problem). 'bober' -- use Jonathon Bober's implementation 'gap' -- use GAP (VERY *slow*) 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5, algorithm='gap') 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bober') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 sage: number_of_partitions(100000) 27493510569775696512677516320986352688173429315980054758203125984302147328114964173055050741660736621590157844774296248940493063070200461792764493033510116079342457190155718943509725312466108452006369558934464248716828789832182345009262853831404597021307130674510624419227311238999702284408609370935531629697851569569892196108480158600569421098519 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 TESTS: sage: n = 500 + randint(0,500) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1500 + randint(0,1500) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000 + randint(0,1000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 100000000 + randint(0,100000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 True sage: n = 1000000000 + randint(0,1000000000) sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 # takes a long time True Another consistency test for n up to 500: sage: len([n for n in [1..500] if number_of_partitions(n) != number_of_partitions(n,algorithm='pari')]) 0 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) if algorithm == 'default': if k is None: algorithm = 'bober' else: algorithm = 'gap' if algorithm == 'gap': if k is None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) if k is not None: raise ValueError, "only the GAP algorithm works if k is specified." if algorithm == 'bober': return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm | a57d04ef0a1b3f5dc69cd60b0a05307ccdf3fa9c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/a57d04ef0a1b3f5dc69cd60b0a05307ccdf3fa9c/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1886,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1886,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,
... |
if level: if isinstance(level, types.ListType) or \ isinstance(level, types.TupleType): levels = level else: levels = [ level ] for level in levels: self._checkLogLevel(level) else: levels = [ i for i in xrange(self.FATAL, self.DEBUG10+1) ] | """ Add log target for domain and level. Level can be a single level or an array of levels. Use level ALL to set for all levels. If no format is specified, the default format will be used. """ levels = self._getLevels(level) | def addLogging(self, domain, target, level=ALL, format=None): if level: if isinstance(level, types.ListType) or \ isinstance(level, types.TupleType): levels = level else: levels = [ level ] for level in levels: self._checkLogLevel(level) else: levels = [ i for i in xrange(self.FATAL, self.DEBUG10+1) ] for level in levels: self._logging.setdefault(level, [ ]).append((domain, target, format)) | 3d7d63966162f8881fad278dc8cc728a7e5a1f77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/3d7d63966162f8881fad278dc8cc728a7e5a1f77/logger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
7735,
12,
2890,
16,
2461,
16,
1018,
16,
1801,
33,
4685,
16,
740,
33,
7036,
4672,
3536,
1436,
613,
1018,
364,
2461,
471,
1801,
18,
4557,
848,
506,
279,
2202,
1801,
578,
392,
526,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7735,
12,
2890,
16,
2461,
16,
1018,
16,
1801,
33,
4685,
16,
740,
33,
7036,
4672,
3536,
1436,
613,
1018,
364,
2461,
471,
1801,
18,
4557,
848,
506,
279,
2202,
1801,
578,
392,
526,
... |
if self.display_type: if num_play_items != self['num_%s_items' % display_type]: self['num_%s_items' % display_type] = num_play_items else: if num_play_items != self['num_all_items']: self['num_all_items'] = num_play_items | if num_play_items != self['num_%s_items' % name]: self['num_%s_items' % name] = num_play_items | def create_metainfo(self): """ create some metainfo for the directory """ timestamp = os.stat(self.dir)[stat.ST_MTIME] num_timestamp = self.info['num_timestamp'] | 6398e3de15a76a5b24fc7e42e85eaa712e2240ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/6398e3de15a76a5b24fc7e42e85eaa712e2240ea/directory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
10578,
28935,
12,
2890,
4672,
3536,
752,
2690,
5100,
28935,
364,
326,
1867,
3536,
2858,
377,
273,
1140,
18,
5642,
12,
2890,
18,
1214,
25146,
5642,
18,
882,
67,
49,
4684,
65,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
10578,
28935,
12,
2890,
4672,
3536,
752,
2690,
5100,
28935,
364,
326,
1867,
3536,
2858,
377,
273,
1140,
18,
5642,
12,
2890,
18,
1214,
25146,
5642,
18,
882,
67,
49,
4684,
65,
8... |
10*19^-3 + 9*19^-2 + 9*19^-1 + 9 + 9*19 + O(19^2) | 9 + 9*19 + O(19^2) | def __floordiv__(self, right): """ If a,b are p-adic integers, then floordiv (//) satisfies the following equation: a%b + b*(a//b) == a | 90740f5e28765780338de01e862b154ee58eb069 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/90740f5e28765780338de01e862b154ee58eb069/padic_ring_capped_relative_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
74,
383,
517,
427,
972,
12,
2890,
16,
2145,
4672,
3536,
971,
279,
16,
70,
854,
293,
17,
20333,
12321,
16,
1508,
20802,
517,
427,
261,
759,
13,
17917,
326,
3751,
15778,
30,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
74,
383,
517,
427,
972,
12,
2890,
16,
2145,
4672,
3536,
971,
279,
16,
70,
854,
293,
17,
20333,
12321,
16,
1508,
20802,
517,
427,
261,
759,
13,
17917,
326,
3751,
15778,
30,
279,
... |
data = list(csv.reader(input, quotechar='"', delimiter=',')) | reader = csv.reader(input, quotechar='"', delimiter=',') fields = reader.next() | def convert_csv_import(cr, module, fname, csvcontent, idref={}, mode='init'): if mode != 'init': return model = ('.'.join(fname.split('.')[:-1]).split('-'))[0] #model = fname.split('.')[0].replace('_', '.') #remove folder path from model head, model = os.path.split(model) pool = pooler.get_pool(cr.dbname) | 619372b7f29df31e5b50052165eb1934d6b3dfb5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/619372b7f29df31e5b50052165eb1934d6b3dfb5/convert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
6715,
67,
5666,
12,
3353,
16,
1605,
16,
5299,
16,
6101,
1745,
16,
612,
1734,
28793,
1965,
2218,
2738,
11,
4672,
309,
1965,
480,
296,
2738,
4278,
327,
938,
273,
7707,
1093,
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,
1765,
67,
6715,
67,
5666,
12,
3353,
16,
1605,
16,
5299,
16,
6101,
1745,
16,
612,
1734,
28793,
1965,
2218,
2738,
11,
4672,
309,
1965,
480,
296,
2738,
4278,
327,
938,
273,
7707,
1093,
18... |
if key in self.strongTroves: | if weakRef and key in self.weakTroves: del self.weakTroves[key] elif not weakRef and key in self.strongTroves: | def delTrove(self, name, version, flavor, missingOkay): | e61801f00d1b0eac9a62f13fcbff8b887ecff201 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/e61801f00d1b0eac9a62f13fcbff8b887ecff201/trove.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
56,
303,
537,
12,
2890,
16,
508,
16,
1177,
16,
19496,
16,
3315,
8809,
528,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
56,
303,
537,
12,
2890,
16,
508,
16,
1177,
16,
19496,
16,
3315,
8809,
528,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
deps, _ = self.getCombinedDeps(classId, variants, buildType) | deps, cached = self.getCombinedDeps(classId, variants, buildType) if self._console.getLevel() is "info": self._console.dot("%s" % "." if cached else "*") | def sortClassesRecurser(classId, available, variants, result, path): if classId in result: return | 8e95d952ae4c4cd9b205bfa28bbd240c02bb392c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/8e95d952ae4c4cd9b205bfa28bbd240c02bb392c/DependencyLoader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
4818,
426,
1397,
550,
12,
1106,
548,
16,
2319,
16,
12935,
16,
563,
16,
589,
4672,
309,
31181,
316,
563,
30,
327,
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,
1524,
4818,
426,
1397,
550,
12,
1106,
548,
16,
2319,
16,
12935,
16,
563,
16,
589,
4672,
309,
31181,
316,
563,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
def my_scroller_go_300_900(bt, sc, *args, **kwargs): | def my_scroller_go_300_900(bt, sc): | def my_scroller_go_300_900(bt, sc, *args, **kwargs): sc.region_bring_in(300, 900, 318, 318) | ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
67,
1017,
1539,
67,
3240,
67,
19249,
67,
29,
713,
12,
23602,
16,
888,
4672,
888,
18,
6858,
67,
2848,
310,
67,
267,
12,
19249,
16,
2468,
713,
16,
890,
2643,
16,
890,
2643,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3399,
67,
1017,
1539,
67,
3240,
67,
19249,
67,
29,
713,
12,
23602,
16,
888,
4672,
888,
18,
6858,
67,
2848,
310,
67,
267,
12,
19249,
16,
2468,
713,
16,
890,
2643,
16,
890,
2643,
13,
... |
filetool.directory("./provider/data/resource") filetool.directory("./provider/resource") | approot = context.jobconf.get("provider/app-root", "./provider") filetool.directory(approot+"/data/resource") filetool.directory(approot+"/resource") | def copyResource(res): filetool.directory("provider/resource/"+os.path.dirname(res)) shutil.copy("source/resource/"+res, "provider/resource/"+res) return | 35504987738e3e8f7d4a869e1d00ed7a02125938 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/35504987738e3e8f7d4a869e1d00ed7a02125938/CodeProvider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
1420,
12,
455,
4672,
661,
278,
1371,
18,
5149,
2932,
6778,
19,
3146,
4898,
15,
538,
18,
803,
18,
12287,
12,
455,
3719,
11060,
18,
3530,
2932,
3168,
19,
3146,
4898,
15,
455,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
1420,
12,
455,
4672,
661,
278,
1371,
18,
5149,
2932,
6778,
19,
3146,
4898,
15,
538,
18,
803,
18,
12287,
12,
455,
3719,
11060,
18,
3530,
2932,
3168,
19,
3146,
4898,
15,
455,
16,
... |
hour * self.hourHeight - (hText/2)) | hour * self.hourHeight - (hText/2)) | def DrawBackground(self, dc): styles = self.parent self._doDrawingCalculations() | 590a7421d4a56497721ad83a36a6f3eb4226407e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/590a7421d4a56497721ad83a36a6f3eb4226407e/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
8199,
12,
2890,
16,
6744,
4672,
5687,
273,
365,
18,
2938,
365,
6315,
2896,
26885,
4844,
1012,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
10184,
8199,
12,
2890,
16,
6744,
4672,
5687,
273,
365,
18,
2938,
365,
6315,
2896,
26885,
4844,
1012,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"test_set_size(%) : "+format_value("%-8.4f",flags_pc), | "test_set_size : "+format_value("%-8.4f",flags_pc), | def show_data(fmodel, n_outl, test_flag_value, f_obs_labels): info = fmodel.info() flags_pc = \ fmodel.r_free_flags.data().count(True)*1./fmodel.r_free_flags.data().size() print " Data:" try: f_obs_labels = f_obs_labels[:f_obs_labels.index(",")] except ValueError: pass result = " \n ".join([ "data_label : %s"%f_obs_labels, "high_resolution : "+format_value("%-5.2f",info.d_min), "low_resolution : "+format_value("%-6.2f",info.d_max), "completeness_in_range : "+format_value("%-6.2f",info.completeness_in_range), "wilson_b : "+format_value("%-6.1f",fmodel.wilson_b()), "number_of_reflections : "+format_value("%-8d", info.number_of_reflections), "test_set_size(%) : "+format_value("%-8.4f",flags_pc), "test_flag_value : "+format_value("%-d", test_flag_value), "number_of_Fobs_outliers : "+format_value("%-8d", n_outl), "anomalous_flag : "+format_value("%-6s", fmodel.f_obs.anomalous_flag())]) print " ", result | c3b0cf38bc2af221930da7f62cdd3a8938d72a2b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/696/c3b0cf38bc2af221930da7f62cdd3a8938d72a2b/model_vs_data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
892,
12,
74,
2284,
16,
290,
67,
659,
80,
16,
1842,
67,
6420,
67,
1132,
16,
284,
67,
10992,
67,
5336,
4672,
1123,
273,
284,
2284,
18,
1376,
1435,
2943,
67,
2436,
273,
521,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
892,
12,
74,
2284,
16,
290,
67,
659,
80,
16,
1842,
67,
6420,
67,
1132,
16,
284,
67,
10992,
67,
5336,
4672,
1123,
273,
284,
2284,
18,
1376,
1435,
2943,
67,
2436,
273,
521,
... |
def _find_exe(exe): for v in get_devstudio_versions(): for p in get_msvc_paths('path',v): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn try: for p in string.split(os.environ['Path'],';'): fn=os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn except: pass return exe def _find_SET(n): for v in get_devstudio_versions(): p = get_msvc_paths(n,v) if p: return p return [] def _do_SET(n): p = _find_SET(n) | def find_exe (exe, version_number): """Try to find an MSVC executable program 'exe' (from version 'version_number' of MSVC) in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'.""" for p in get_msvc_paths ('path', version_number): fn = os.path.join (os.path.abspath(p), exe) if os.path.isfile(fn): return fn for p in string.split (os.environ['Path'],';'): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn return exe def _find_SET(name,version_number): """looks up in the registry and returns a list of values suitable for use in a SET command eg SET name=value. Normally the value will be a ';' separated list similar to a path list. name is the name of an MSVC path and version_number is a version_number of an MSVC installation.""" return get_msvc_paths(name, version_number) def _do_SET(name, version_number): """sets os.environ[name] to an MSVC path type value obtained from _find_SET. This is equivalent to a SET command prior to execution of spawned commands.""" p=_find_SET(name, version_number) | def _find_exe(exe): for v in get_devstudio_versions(): for p in get_msvc_paths('path',v): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn #didn't find it; try existing path try: for p in string.split(os.environ['Path'],';'): fn=os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn # XXX BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD BAD !!!!!!!!!!!!!!!! except: # XXX WHAT'S BEING CAUGHT HERE?!?!? pass return exe #last desperate hope | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
14880,
12,
14880,
4672,
364,
331,
316,
336,
67,
5206,
334,
4484,
67,
10169,
13332,
364,
293,
316,
336,
67,
959,
4227,
67,
4481,
2668,
803,
2187,
90,
4672,
2295,
273,
114... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
14880,
12,
14880,
4672,
364,
331,
316,
336,
67,
5206,
334,
4484,
67,
10169,
13332,
364,
293,
316,
336,
67,
959,
4227,
67,
4481,
2668,
803,
2187,
90,
4672,
2295,
273,
114... |
str.__init__(self, value) | def __init__(self, value): str.__init__(self, value) self._position=-1 | 88ed467bd9e9e76a40c98ed4b8c2127b780e0a2d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4487/88ed467bd9e9e76a40c98ed4b8c2127b780e0a2d/inputstream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
460,
4672,
365,
6315,
3276,
29711,
21,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
460,
4672,
365,
6315,
3276,
29711,
21,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
cCSP.csplog().setLogCategory(cCSP.CSP_ALL) cCSP.csplog().setLogPriority(SimData.LOG_ALERT) | cCSP.csplog().setCategories(cCSP.CSP_ALL) cCSP.csplog().setPriority(SimData.LOG_ERROR) | def compileData(args): datapath = cCSP.getDataPath() cachepath = cCSP.getCachePath() dar = os.path.join(cachepath, "sim.dar") XML = os.path.join(datapath, "XML") cCSP.csplog().setLogCategory(cCSP.CSP_ALL) cCSP.csplog().setLogPriority(SimData.LOG_ALERT) #print "compile %s %s" % (XML, dar) try: from CSP.SimData.Compile import Compiler, CompilerUsageError except Exception, e: print print "ERROR: unable to load the SimData data compiler module." print print str(e) print sys.exit(1) compiler = Compiler() try: compiler.parse([""] + args + [XML, dar]) except CompilerUsageError, e: if e.getMessage(): print e printUsage() print compiler.printUsage() print sys.exit(1) try: compiler.compileAll() except RuntimeError, e: print 'Aborting' sys.exit(1) print | 3c6140f19b6bc70aeaf66bb7568cd2139834f97a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14747/3c6140f19b6bc70aeaf66bb7568cd2139834f97a/CSPSim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
751,
12,
1968,
4672,
27807,
273,
276,
28594,
18,
588,
751,
743,
1435,
1247,
803,
273,
276,
28594,
18,
588,
1649,
743,
1435,
302,
297,
273,
1140,
18,
803,
18,
5701,
12,
2493,
803,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
751,
12,
1968,
4672,
27807,
273,
276,
28594,
18,
588,
751,
743,
1435,
1247,
803,
273,
276,
28594,
18,
588,
1649,
743,
1435,
302,
297,
273,
1140,
18,
803,
18,
5701,
12,
2493,
803,... |
def parse(stream_or_string, parser=None, bufsize=default_bufsize): if type(stream_or_string) is type(""): | def parse(stream_or_string, parser=None, bufsize=None): if bufsize is None: bufsize = default_bufsize if type(stream_or_string) in [type(""), type(u"")]: | def parse(stream_or_string, parser=None, bufsize=default_bufsize): if type(stream_or_string) is type(""): stream = open(stream_or_string) else: stream = stream_or_string if not parser: parser = xml.sax.make_parser() return DOMEventStream(stream, parser, bufsize) | 500fca110f005eb10fd581019263b28b27fed1ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/500fca110f005eb10fd581019263b28b27fed1ca/pulldom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
3256,
67,
280,
67,
1080,
16,
2082,
33,
7036,
16,
1681,
1467,
33,
7036,
4672,
309,
1681,
1467,
353,
599,
30,
1681,
1467,
273,
805,
67,
4385,
1467,
309,
618,
12,
3256,
67,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
3256,
67,
280,
67,
1080,
16,
2082,
33,
7036,
16,
1681,
1467,
33,
7036,
4672,
309,
1681,
1467,
353,
599,
30,
1681,
1467,
273,
805,
67,
4385,
1467,
309,
618,
12,
3256,
67,
28... |
return | return OK | def effecttimer( time, args ): char = args[0] effecttype = args[1] bonus = args[2] if effecttype == 6 or effecttype == 7: if not char.hastag( 'agility_effect' ): return OOPS char.dexterity = char.dexterity - bonus char.maxstamina = char.maxstamina - bonus if char.stamina > char.maxstamina: char.stamina = char.maxstamina char.deltag( 'agility_effect' ) char.updatestamina() char.updatestats() return elif effecttype == 8 or effecttype == 9: if not char.hastag( 'strength_effect' ): return OOPS char.strength = char.strength - bonus if char.hitpoints > char.maxhitpoints: char.hitpoints = char.maxhitpoints char.deltag( 'strength_effect' ) char.updatehealth() char.updatestats() return elif effecttype == 20 or effecttype == 21: if not char.hastag( 'intelligence_effect' ): return OOPS char.intelligence = char.intelligence - bonus char.maxmana = char.maxmana - bonus if char.mana > char.maxmana: char.mana = char.maxmana char.deltag( 'intelligence_effect' ) char.updatemana() char.updatestats() return | 1dbb4f996db2ee1cdf189b46c7eeed3786d7b16c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/1dbb4f996db2ee1cdf189b46c7eeed3786d7b16c/potions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5426,
12542,
12,
813,
16,
833,
262,
30,
1149,
273,
833,
63,
20,
65,
5426,
723,
273,
833,
63,
21,
65,
324,
22889,
273,
833,
63,
22,
65,
225,
309,
5426,
723,
422,
1666,
578,
5426,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5426,
12542,
12,
813,
16,
833,
262,
30,
1149,
273,
833,
63,
20,
65,
5426,
723,
273,
833,
63,
21,
65,
324,
22889,
273,
833,
63,
22,
65,
225,
309,
5426,
723,
422,
1666,
578,
5426,
72... |
def repaint_rect(self, screen_rect): """repaints the given area | def repaint_rect(self, screen_rect): """repaint the given area | def repaint_rect(self, screen_rect): """repaints the given area LayeredDirty.repaint_rect(screen_rect): return None | d9760f3e4782abb02dd98080337626eefdad67ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/d9760f3e4782abb02dd98080337626eefdad67ee/sprite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24962,
67,
2607,
12,
2890,
16,
5518,
67,
2607,
4672,
3536,
14462,
1598,
326,
864,
5091,
225,
12112,
329,
10785,
18,
14462,
1598,
67,
2607,
12,
9252,
67,
2607,
4672,
327,
599,
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,
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,
24962,
67,
2607,
12,
2890,
16,
5518,
67,
2607,
4672,
3536,
14462,
1598,
326,
864,
5091,
225,
12112,
329,
10785,
18,
14462,
1598,
67,
2607,
12,
9252,
67,
2607,
4672,
327,
599,
2,
-100,
... |
end = self.txt.GetLastPosition() textstring = self.txt.GetRange(0, end).lower() start = self.txt.GetSelection()[1] | end = editor.GetLastPosition() textstring = editor.GetRange(0, end).lower() start = editor.GetSelection()[1] | def OnFind(self, event): self.nb.SetSelection(1) end = self.txt.GetLastPosition() textstring = self.txt.GetRange(0, end).lower() start = self.txt.GetSelection()[1] findstring = self.finddata.GetFindString().lower() loc = textstring.find(findstring, start) if loc == -1 and start != 0: # string not found, start at beginning start = 0 loc = textstring.find(findstring, start) if loc == -1: dlg = wx.MessageDialog(self, 'Find String Not Found', 'Find String Not Found in Demo File', wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() if self.finddlg: if loc == -1: self.finddlg.SetFocus() return else: self.finddlg.Destroy() self.txt.ShowPosition(loc) self.txt.SetSelection(loc, loc + len(findstring)) | 08ecc92023f15aaa5695a616f9712c980650c7c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/08ecc92023f15aaa5695a616f9712c980650c7c7/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
3125,
12,
2890,
16,
871,
4672,
365,
18,
6423,
18,
694,
6233,
12,
21,
13,
679,
273,
4858,
18,
967,
3024,
2555,
1435,
977,
1080,
273,
4858,
18,
967,
2655,
12,
20,
16,
679,
2934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
3125,
12,
2890,
16,
871,
4672,
365,
18,
6423,
18,
694,
6233,
12,
21,
13,
679,
273,
4858,
18,
967,
3024,
2555,
1435,
977,
1080,
273,
4858,
18,
967,
2655,
12,
20,
16,
679,
2934,
... |
extra_compile_args=(('-W -Wall -Wimplicit -Wuninitialized ' '-Wshadow -Wpointer-arith -Wcast-align ' '-Waggregate-return -Wstrict-prototypes ' '-Wnested-externs -Werror').split() + ['-Wp,-U_FORTIFY_SOURCE']) | extra_compile_args=python_cflags_env.split() | def GetIncludes(flags): """Parse a flags string for includes of the form -I<DIR>. Args: flags: a string in shell syntax denoting compiler options Returns: a list of <DIR>s of the includes Raises: ValueError: In the doctests below, note that a single quoted backslash takes four backslashes to represent if it is inside a single quoted string inside this present triple-quoted string. >>> GetIncludes('-I x -X -I"y" -Y') ['x', 'y'] >>> GetIncludes('-Ix -Dfoo -Iy') ['x', 'y'] >>> GetIncludes(r'-Ix -I"y\\z" -I"y\\\\z" -Y') ['x', 'y\\\\z', 'y\\\\z'] >>> GetIncludes('-DX -Iquote Y') Traceback (most recent call last): ... ValueError: These options are not allowed: -Iquote, -Isystem, -I-. >>> GetIncludes('-DX -I x -I') Traceback (most recent call last): ... ValueError: Argument expected after '-I'. """ flags = shlex.split(flags) if set(OPTIONS_NOT_ALLOWED) & set(flags): raise ValueError('These options are not allowed: %s.' % ', '.join(OPTIONS_NOT_ALLOWED)) # Fish out the directories of '-I' options. i = 0 inc_dirs = [] while i < len(flags): if flags[i].startswith('-I'): inc_dir = flags[i][len('-I'):] if inc_dir: # "-Idir" inc_dirs.append(inc_dir) i += 1 continue else: # "-I dir" if i == len(flags) - 1: raise ValueError("Argument expected after '-I'.") inc_dirs.append(flags[i+1]) i += 2 else: i += 1 return inc_dirs | d9b120480f63897605d614bd03e7ea585a199071 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4521/d9b120480f63897605d614bd03e7ea585a199071/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
16815,
12,
7133,
4672,
3536,
3201,
279,
2943,
533,
364,
6104,
434,
326,
646,
300,
45,
32,
4537,
18652,
225,
6634,
30,
2943,
30,
279,
533,
316,
5972,
6279,
5545,
17128,
5274,
702,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16815,
12,
7133,
4672,
3536,
3201,
279,
2943,
533,
364,
6104,
434,
326,
646,
300,
45,
32,
4537,
18652,
225,
6634,
30,
2943,
30,
279,
533,
316,
5972,
6279,
5545,
17128,
5274,
702,
... |
targetpath = os.path.dirname(os.path.join(sys.prefix, "share", filepath)) | targetpath = os.path.dirname(os.path.join("share", filepath)) | def copy_tree(*args, **kwargs): outputs = copy_tree_orig(*args, **kwargs) for i in range(len(outputs)): if outputs[i].endswith("bin/smart.py"): outputs[i] = outputs[i][:-3] return outputs | ad92506f689b1b5fc46376b4379d236563bd17e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/ad92506f689b1b5fc46376b4379d236563bd17e1/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
3413,
30857,
1968,
16,
2826,
4333,
4672,
6729,
273,
1610,
67,
3413,
67,
4949,
30857,
1968,
16,
2826,
4333,
13,
364,
277,
316,
1048,
12,
1897,
12,
12295,
3719,
30,
309,
6729,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
3413,
30857,
1968,
16,
2826,
4333,
4672,
6729,
273,
1610,
67,
3413,
67,
4949,
30857,
1968,
16,
2826,
4333,
13,
364,
277,
316,
1048,
12,
1897,
12,
12295,
3719,
30,
309,
6729,
... |
"sink_2", self.outside_videoscale.get_static_pad("sink") | "sink_2", self.outside_videoscale.sink_pads().next() | def __init__(self, colorspace, width, height): gst.Bin.__init__(self) self.caps = self.make_caps(colorspace, width, height) self.videomixer = gst.element_factory_make("videomixer", "videomixer") self.add(self.videomixer) self.inside_videoscale = gst.element_factory_make( "videoscale", "inside_videoscale" ) self.add(self.inside_videoscale) self.outside_videoscale = gst.element_factory_make( "videoscale", "outside_videoscale" ) self.add(self.outside_videoscale) self.inside_videorate = gst.element_factory_make( "videorate", "inside_videorate" ) self.add(self.inside_videorate) self.outside_videorate = gst.element_factory_make( "videorate", "outside_videorate" ) self.add(self.outside_videorate) self.inside_capsfilter = gst.element_factory_make( "capsfilter", "inside_capsfilter" ) self.add(self.inside_capsfilter) self.outside_capsfilter = gst.element_factory_make( "capsfilter", "outsidecapsfilter" ) self.add(self.outside_capsfilter) self.inside_capsfilter.set_property("caps", self.caps['inside']) self.outside_capsfilter.set_property("caps", self.caps['outside']) self.inside_csp = gst.element_factory_make( "ffmpegcolorspace", "inside_csp" ) self.add(self.inside_csp) self.outside_csp = gst.element_factory_make( "ffmpegcolorspace", "outside_csp" ) self.add(self.outside_csp) self.csp = gst.element_factory_make("ffmpegcolorspace", "pip_csp") self.add(self.csp) | 25fa8d62942cc5799bc956afc7f91370abdda435 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7705/25fa8d62942cc5799bc956afc7f91370abdda435/videomixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5740,
909,
16,
1835,
16,
2072,
4672,
314,
334,
18,
9913,
16186,
2738,
972,
12,
2890,
13,
365,
18,
22984,
273,
365,
18,
6540,
67,
22984,
12,
9724,
909,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5740,
909,
16,
1835,
16,
2072,
4672,
314,
334,
18,
9913,
16186,
2738,
972,
12,
2890,
13,
365,
18,
22984,
273,
365,
18,
6540,
67,
22984,
12,
9724,
909,
... |
buf += struct.pack("%ds" % BLOCKSIZE, "".join(parts)) | buf += "".join(parts).ljust(BLOCKSIZE, NUL) | def tobuf(self, posix=False): """Return a tar header as a string of 512 byte blocks. """ buf = "" type = self.type prefix = "" | 4fcc8ae57771eea1ab268e59b461f71bd653ca48 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/4fcc8ae57771eea1ab268e59b461f71bd653ca48/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
487,
279,
533,
434,
13908,
1160,
4398,
18,
3536,
1681,
273,
1408,
618,
273,
365,
18,
723,
1633,
273,
1408,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
16,
16366,
33,
8381,
4672,
3536,
990,
279,
8232,
1446,
487,
279,
533,
434,
13908,
1160,
4398,
18,
3536,
1681,
273,
1408,
618,
273,
365,
18,
723,
1633,
273,
1408,
2... |
print 'execfile', `base_py` | def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir class_tcl = os.path.join(home, '.%s.tcl' % className) class_py = os.path.join(home, '.%s.py' % className) base_tcl = os.path.join(home, '.%s.tcl' % baseName) base_py = os.path.join(home, '.%s.py' % baseName) dir = {'self': self} exec 'from Tkinter import *' in dir if os.path.isfile(class_tcl): print 'source', `class_tcl` self.tk.call('source', class_tcl) if os.path.isfile(class_py): print 'execfile', `class_py` execfile(class_py, dir) if os.path.isfile(base_tcl): print 'source', `base_tcl` self.tk.call('source', base_tcl) if os.path.isfile(base_py): print 'execfile', `base_py` execfile(base_py, dir) | 0eeeda212ad5efb21a284a930583043fde4d6a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/0eeeda212ad5efb21a284a930583043fde4d6a11/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
5040,
12,
2890,
16,
16162,
16,
2658,
4672,
3536,
3061,
445,
18,
2597,
6838,
10250,
1985,
18,
88,
830,
471,
7383,
1985,
18,
88,
830,
1368,
326,
399,
830,
5294,
11599,
471,
4097,
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,
855,
5040,
12,
2890,
16,
16162,
16,
2658,
4672,
3536,
3061,
445,
18,
2597,
6838,
10250,
1985,
18,
88,
830,
471,
7383,
1985,
18,
88,
830,
1368,
326,
399,
830,
5294,
11599,
471,
4097,
11... | |
if self.config.sticky_date: | if self.revision and self.revision.isdigit(): cmd.extend(['-r', '%s' % self.revision]) elif self.config.sticky_date: | def _checkout(self, buildscript, copydir=None): cmd = ['svn', 'checkout', self.module] | b0626bd61c53fef2877e998199c92d6a8776bd40 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4596/b0626bd61c53fef2877e998199c92d6a8776bd40/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
17300,
12,
2890,
16,
1361,
4263,
16,
1610,
1214,
33,
7036,
4672,
1797,
273,
10228,
31505,
2187,
296,
17300,
2187,
365,
18,
2978,
65,
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,
17300,
12,
2890,
16,
1361,
4263,
16,
1610,
1214,
33,
7036,
4672,
1797,
273,
10228,
31505,
2187,
296,
17300,
2187,
365,
18,
2978,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if node.symbol not in dispatch_table: | func = dispatch_table.get(node.symbol, None) if func is None: | def dispatch(self, node): if isinstance(node, Nonterminal): if node.symbol not in dispatch_table: if __general_nonterminal_visit: return __general_nonterminal_visit(self, node) else: return dispatch_table[node.symbol](self, node) elif isinstance(node, Symbol): if node.symbol not in dispatch_table: if __general_symbol_visit: return __general_symbol_visit(self, node) else: return dispatch_table[node.symbol](self, node) if __general_visit: return __general_visit(self, node) raise VisitError(node) | 4854f3840749b007991aabfab299eb1acf367452 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/4854f3840749b007991aabfab299eb1acf367452/tree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
12,
2890,
16,
756,
4672,
309,
1549,
12,
2159,
16,
3858,
15979,
4672,
1326,
273,
3435,
67,
2121,
18,
588,
12,
2159,
18,
7175,
16,
599,
13,
309,
1326,
353,
599,
30,
309,
1001,
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,
3435,
12,
2890,
16,
756,
4672,
309,
1549,
12,
2159,
16,
3858,
15979,
4672,
1326,
273,
3435,
67,
2121,
18,
588,
12,
2159,
18,
7175,
16,
599,
13,
309,
1326,
353,
599,
30,
309,
1001,
12... |
HTTPSConnection.putrequest(self, method, url, skip_host, skip_accept_encoding) | HTTPSConnection.putrequest(self, method, rest, skip_host, skip_accept_encoding) | def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): #putrequest is called before connect, so can interpret url and get #real host/port to be used to make CONNECT request to proxy proto, rest = urllib.splittype(url) if proto is None: raise ValueError, "unknown URL type: %s" % url #get host host, rest = urllib.splithost(rest) #try to get port host, port = urllib.splitport(host) #if port is not defined try to get from proto if port is None: try: port = self._ports[proto] except KeyError: raise ValueError, "unknown protocol for: %s" % url self._real_host = host self._real_port = port HTTPSConnection.putrequest(self, method, url, skip_host, skip_accept_encoding) | 1b6979c352ba0975bf8b2be22017cf9b73bb9c88 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10522/1b6979c352ba0975bf8b2be22017cf9b73bb9c88/httpslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
2293,
12,
2890,
16,
707,
16,
880,
16,
2488,
67,
2564,
33,
20,
16,
2488,
67,
9436,
67,
5999,
33,
20,
4672,
468,
458,
2293,
353,
2566,
1865,
3077,
16,
1427,
848,
10634,
880,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
2293,
12,
2890,
16,
707,
16,
880,
16,
2488,
67,
2564,
33,
20,
16,
2488,
67,
9436,
67,
5999,
33,
20,
4672,
468,
458,
2293,
353,
2566,
1865,
3077,
16,
1427,
848,
10634,
880,
471,... |
os.chmod(self.floppy_img, 0755) | os.chmod(self.floppy, 0755) | def create_boot_floppy(self): """ Prepares a boot floppy by creating a floppy image file, mounting it and copying an answer file (kickstarts for RH based distros, answer files for windows) to it. After that the image is umounted. """ print "Creating boot floppy" | d245408f9a2fd5877bf4770afc7b97ad08147815 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/d245408f9a2fd5877bf4770afc7b97ad08147815/unattended.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
7137,
67,
74,
16884,
2074,
12,
2890,
4672,
3536,
2962,
84,
4807,
279,
4835,
284,
16884,
2074,
635,
4979,
279,
284,
16884,
2074,
1316,
585,
16,
5344,
310,
518,
471,
8933,
392,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
7137,
67,
74,
16884,
2074,
12,
2890,
4672,
3536,
2962,
84,
4807,
279,
4835,
284,
16884,
2074,
635,
4979,
279,
284,
16884,
2074,
1316,
585,
16,
5344,
310,
518,
471,
8933,
392,
... |
elif algorithm == 'bober': | if not k is None: raise ValueError, "only the GAP algorithm works if k is specified." if algorithm == 'default' and k is None: return partitions_ext.number_of_partitions(n) elif algorithm == 'bober' and k is None: | def number_of_partitions(n,k=None, algorithm='bober'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'bober') 'bober' -- use Jonathon Bober's implementation (*very* fast, but new and not well tested yet). 'gap' -- use GAP (VERY *slow*) 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5, algorithm='gap') 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bober') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) if algorithm == 'gap': if k==None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) elif algorithm == 'bober': return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': if not k is None: raise ValueError, "cannot specify second argument k if the algorithm is PARI" return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm | 8a5d6da61789d8ca741f4ba72dacb9a127d70350 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/8a5d6da61789d8ca741f4ba72dacb9a127d70350/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1075,
744,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1075,
744,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
... |
msg = self.format(record) | msg = self.format(record) + '\000' | def emit(self, record): """ Emit a record. | 89d8f82d01b7d0191c07d5553979ffe53d55cf6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/89d8f82d01b7d0191c07d5553979ffe53d55cf6e/handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3626,
12,
2890,
16,
1409,
4672,
3536,
16008,
279,
1409,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3626,
12,
2890,
16,
1409,
4672,
3536,
16008,
279,
1409,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
"\nInput:", str(test['input']), "\nExpected:", str(output), "\nreceived:", str(tokens)]) tokens = normalizeTokens(tokens) | "\nInput:", test['input'], "\nExpected:", unicode(output), "\nreceived:", unicode(tokens)]) | def runTokenizerTest(self, test): #XXX - move this out into the setup function #concatenate all consecutive character tokens into a single token output = concatenateCharacterTokens(test['output']) if 'lastStartTag' not in test: test['lastStartTag'] = None parser = TokenizerTestParser(test['contentModelFlag'], test['lastStartTag']) tokens = parser.parse(test['input']) tokens = concatenateCharacterTokens(tokens) errorMsg = "\n".join(["\n\nContent Model Flag:", test['contentModelFlag'] , "\nInput:", str(test['input']), "\nExpected:", str(output), "\nreceived:", str(tokens)]) tokens = normalizeTokens(tokens) ignoreErrorOrder = test.get('ignoreErrorOrder', False) self.assertEquals(tokensMatch(tokens, output, ignoreErrorOrder), True, errorMsg) | 1dcada439e24d6ac44770791accd5c073c1cf2bc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4487/1dcada439e24d6ac44770791accd5c073c1cf2bc/test_tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
10524,
4709,
12,
2890,
16,
1842,
4672,
468,
15639,
300,
3635,
333,
596,
1368,
326,
3875,
445,
468,
16426,
275,
340,
777,
18221,
3351,
2430,
1368,
279,
2202,
1147,
876,
273,
11361,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10524,
4709,
12,
2890,
16,
1842,
4672,
468,
15639,
300,
3635,
333,
596,
1368,
326,
3875,
445,
468,
16426,
275,
340,
777,
18221,
3351,
2430,
1368,
279,
2202,
1147,
876,
273,
11361,
... |
creationflags |= CREATE_NEW_CONSOLE | creationflags |= _subprocess.CREATE_NEW_CONSOLE | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)""" | 7d139c76c8e23ecba07fdb99f6a8ba8c60fd6097 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/7d139c76c8e23ecba07fdb99f6a8ba8c60fd6097/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... |
self.__innerobj__ = innerclass() self.UnitClass = innerclass.UnitClass | innerobj = innerclass() self.__innerobj__ = innerobj self.UnitClass = innerobj.UnitClass | def __init__(self, project=None, pofilename=None, generatestats=True): if pofilename: innerclass = factory.getclass(pofilename) self.__innerobj__ = innerclass() self.UnitClass = innerclass.UnitClass self.pofilename = pofilename if project is None: from Pootle import projects self.project = projects.DummyProject(None) self.checker = None self.filename = self.pofilename else: self.project = project self.checker = self.project.checker self.filename = os.path.join(self.project.podir, self.pofilename) self.lockedfile = LockedFile(self.filename) # we delay parsing until it is required self.pomtime = None self.assigns = pootleassigns(self) | f385cdb203c278adf8713f2b0a4de3b271e9ccfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11388/f385cdb203c278adf8713f2b0a4de3b271e9ccfb/pootlefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1984,
33,
7036,
16,
293,
792,
2550,
33,
7036,
16,
1215,
270,
395,
2323,
33,
5510,
4672,
309,
293,
792,
2550,
30,
3443,
1106,
273,
3272,
18,
588,
1106,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1984,
33,
7036,
16,
293,
792,
2550,
33,
7036,
16,
1215,
270,
395,
2323,
33,
5510,
4672,
309,
293,
792,
2550,
30,
3443,
1106,
273,
3272,
18,
588,
1106,
... |
self_repr = '<__repr__ (self) failed for object at %0x>' % id(self) self.log_info ( | self_repr = '<__repr__(self) failed for object at %0x>' % id(self) self.log_info( | def handle_error (self): nil, t, v, tbinfo = compact_traceback() | 79991224d1b5f3a4ab074ddac83ef59addf853be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/79991224d1b5f3a4ab074ddac83ef59addf853be/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1636,
261,
2890,
4672,
515,
16,
268,
16,
331,
16,
8739,
1376,
273,
6739,
67,
21696,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1636,
261,
2890,
4672,
515,
16,
268,
16,
331,
16,
8739,
1376,
273,
6739,
67,
21696,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if not os.path.isdir(os.path.join(directory, 'private/')): if os.path.exists(os.path.join(directory, 'private/')): raise ValueError('%r is not a directory' % os.path.join(directory, 'private/')) os.mkdir(os.path.join(directory, 'private/')) self._show_private = 1 self._cssfile = '../epydoc.css' self._write_docs(os.path.join(directory, 'private/'), progress_callback) self._show_private = 0 self._cssfile = 'epydoc.css' | if self._create_private_docs: if not os.path.isdir(os.path.join(directory, 'private/')): if os.path.exists(os.path.join(directory, 'private/')): raise OSError('%r is not a directory' % os.path.join(directory, 'private/')) os.mkdir(os.path.join(directory, 'private/')) if not os.path.isdir(os.path.join(directory, 'public/')): if os.path.exists(os.path.join(directory, 'public/')): raise OSError('%r is not a directory' % os.path.join(directory, 'public/')) os.mkdir(os.path.join(directory, 'public/')) if self._create_private_docs: self._show_private = 0 self._write(os.path.join(directory, 'public/'), progress_callback) self._epytext_cache = {} self._show_private = 1 self._write(os.path.join(directory, 'private/'), progress_callback) else: self._show_private = 0 self._write(directory, progress_callback) def _write(self, directory, progress_callback): """ A helper for L{write} that writes all documentation to a given directory. This is typically called once for the public API documentation, and once for the private API documentation. """ | 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,
-... |
cT = matrixmultiply( matrixmultiply(transpose(evec_L), T_orig), evec_L) | cT = matrixmultiply(matrixmultiply(RL, T0), RLt) | def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction T',S',L': T,L,S tensors in origonal coordinate system with the origin shifted to the center of reaction. """ ## LSMALL is the smallest magnitude of L before it is considered 0.0 LSMALL = 1e-6 rdict = {} ## set the L tensor eigenvalues and eigenvectors (eval_L, evec_L) = eigenvectors(L_orig) rdict["L1_eigen_val"] = eval_L[0] rdict["L2_eigen_val"] = eval_L[1] rdict["L3_eigen_val"] = eval_L[2] rdict["L1_eigen_vec"] = evec_L[0] rdict["L2_eigen_vec"] = evec_L[1] rdict["L3_eigen_vec"] = evec_L[2] ## transpose the original the evec_L so it can be used ## to rotate the other tensors evec_L = transpose(evec_L) ## carrot-L tensor (tensor WRT principal axes of L) cL = zeros([3,3], Float) cL[0,0] = eval_L[0] cL[1,1] = eval_L[1] cL[2,2] = eval_L[2] rdict["L^"] = cL ## carrot-T tensor (T tensor WRT principal axes of L) cT = matrixmultiply( matrixmultiply(transpose(evec_L), T_orig), evec_L) rdict["T^"] = cT ## carrot-S tensor (S tensor WRT principal axes of L) cS = matrixmultiply( matrixmultiply(transpose(evec_L), S_orig), evec_L) ## correct for left-handed libration eigenvectors det = determinant(evec_L) if int(det) != 1: cS = -cS rdict["S^"] = cS ## ^rho: the origin-shift vector in the coordinate system of L cL1122 = cL[1,1] + cL[2,2] cL2200 = cL[2,2] + cL[0,0] cL0011 = cL[0,0] + cL[1,1] if cL1122>LSMALL: crho0 = (cS[1,2]-cS[2,1]) / cL1122 else: crho0 = 0.0 if cL2200>LSMALL: crho1 = (cS[2,0]-cS[0,2]) / cL2200 else: crho1 = 0.0 if cL0011>LSMALL: crho2 = (cS[0,1]-cS[1,0]) / cL0011 else: crho2 = 0.0 crho = array([crho0, crho1, crho2], Float) rdict["RHO^"] = crho ## rho: the origin-shift vector in orthogonal coordinates rho = matrixmultiply(evec_L, crho) rdict["RHO"] = rho rdict["COR"] = origin + rho.copy() ## set up the origin shift matrix PRHO WRT orthogonal axes PRHO = array([ [ 0.0, rho[2], -rho[1]], [-rho[2], 0.0, rho[0]], [ rho[1], -rho[0], 0.0] ], Float) ## set up the origin shift matrix cPRHO WRT libration axes cPRHO = array([ [ 0.0, crho[2], -crho[1]], [-crho[2], 0.0, crho[0]], [ crho[1], -crho[0], 0.0] ], Float) ## calculate tranpose of cPRHO, ans cS cSt = transpose(cS) cPRHOt = transpose(cPRHO) ## calculate S'^ = S^ + L^*pRHOt cSp = cS + matrixmultiply(cL, cPRHOt) rdict["S'^"] = cSp ## L'^ = L^ = cL rdict["L'^"] = cL ## calculate T'^ = cT + cPRHO*S^ + cSt*cPRHOt + cPRHO*cL*cPRHOt * cTp = cT + \ matrixmultiply(cPRHO, cS) + \ matrixmultiply(cSt, cPRHOt) + \ matrixmultiply(matrixmultiply(cPRHO, cL), cPRHOt) rdict["T'^"] = cTp ## transpose of PRHO and S PRHOt = transpose(PRHO) St = transpose(S_orig) ## calculate S' = S + L*PRHOt Sp = S_orig + matrixmultiply(L_orig, PRHOt) rdict["S'"] = Sp ## calculate T' = T + PRHO*S + St*PRHOT + PRHO*L*PRHOt Tp = T_orig + \ matrixmultiply(PRHO, S_orig) + \ matrixmultiply(St, PRHOt) + \ matrixmultiply(matrixmultiply(PRHO, L_orig), PRHOt) rdict["T'"] = Tp ## L' is just L rdict["L'"] = L_orig.copy() ## now calculate the TLS motion description using 3 non ## intersecting screw axes, with one ## libration axis 1 shift in the L coordinate system if cL[0,0]>LSMALL: cL1rho = array([0.0, -cSp[0,2]/cL[0,0], cSp[0,1]/cL[0,0]], Float) else: cL1rho = zeros(3, Float) ## libration axis 2 shift in the L coordinate system if cL[1,1]>LSMALL: cL2rho = array([cSp[1,2]/cL[1,1], 0.0, -cSp[1,0]/cL[1,1]], Float) else: cL2rho = zeros(3, Float) ## libration axis 2 shift in the L coordinate system if cL[2,2]>LSMALL: cL3rho = array([-cSp[2,1]/cL[2,2], cSp[2,0]/cL[2,2], 0.0], Float) else: cL3rho = zeros(3, Float) ## libration axes shifts in the origional orthogonal ## coordinate system rdict["L1_rho"] = matrixmultiply(evec_L, cL1rho) rdict["L2_rho"] = matrixmultiply(evec_L, cL2rho) rdict["L3_rho"] = matrixmultiply(evec_L, cL3rho) ## calculate screw pitches (A*R / R*R) = (A/R) if cL[0,0]>LSMALL: rdict["L1_pitch"] = cS[0,0]/cL[0,0] else: rdict["L1_pitch"] = 0.0 if cL[1,1]>LSMALL: rdict["L2_pitch"] = cS[1,1]/cL[1,1] else: rdict["L2_pitch"] = 0.0 if cL[2,2]>LSMALL: rdict["L3_pitch"] = cS[2,2]/cL[2,2] else: rdict["L3_pitch"] = 0.0 ## now calculate the reduction in T for the screw rotation axes cTred = cT.copy() for i in (0, 1, 2): for k in (0, 1, 2): if i==k: continue if cL[k,k]>LSMALL: cTred[i,i] -= (cS[k,i]**2) / cL[k,k] for i in (0, 1, 2): for j in (0, 1, 2): for k in (0, 1, 2): if j==i: continue if cL[k,k]>LSMALL: cTred[i,j] -= (cS[k,i]*cS[k,j]) / cL[k,k] ## rotate the newly calculated reduced-T tensor from the carrot ## coordinate system (coordinate system of L) back to the structure ## coordinate system rdict["rT'"] = matrixmultiply( transpose(evec_L), matrixmultiply(cTred, evec_L)) return rdict | 742140185bc8b6b74df991525abcac33bdc82b5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/742140185bc8b6b74df991525abcac33bdc82b5f/TLS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
9905,
67,
5693,
67,
792,
67,
266,
1128,
12,
56,
67,
4949,
16,
511,
67,
4949,
16,
348,
67,
4949,
16,
4026,
4672,
3536,
8695,
394,
25122,
2511,
603,
326,
4617,
364,
12836,
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,
7029,
67,
9905,
67,
5693,
67,
792,
67,
266,
1128,
12,
56,
67,
4949,
16,
511,
67,
4949,
16,
348,
67,
4949,
16,
4026,
4672,
3536,
8695,
394,
25122,
2511,
603,
326,
4617,
364,
12836,
18... |
print to("Sending song: %s - %s" % (self.queue[i]['artist'], self.queue[i]['title'])) | log(to("Sending song: %s - %s" % (self.queue[i]['artist'], self.queue[i]['title']))) | def submit_song_helper(self): if self.__enabled: print "Plugin re-enabled - accepting new songs." if self.submission_tid != -1: gobject.source_remove(self.submission_tid); self.submission_tid = -1 else: print "Plugin disabled - not accepting any new songs." if len(self.queue) > 0: self.submission_tid = gobject.timeout_add(120 * 1000, self.submit_song_helper) print "Attempts will continue to submit the last %d songs." % len(self.queue) | 6813e514c46661f83b0631485a195a56144fb77d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/6813e514c46661f83b0631485a195a56144fb77d/qlscrobbler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
67,
816,
75,
67,
4759,
12,
2890,
4672,
309,
365,
16186,
5745,
30,
1172,
315,
3773,
283,
17,
5745,
300,
25806,
394,
272,
7260,
1199,
309,
365,
18,
12684,
67,
18081,
480,
300,
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,
4879,
67,
816,
75,
67,
4759,
12,
2890,
4672,
309,
365,
16186,
5745,
30,
1172,
315,
3773,
283,
17,
5745,
300,
25806,
394,
272,
7260,
1199,
309,
365,
18,
12684,
67,
18081,
480,
300,
21,
... |
def whatsthis_text_for_widget(widget): "Return a Python string containing the WhatsThis text for widget (perhaps ""), or None if we can't find that." | def whatsthis_text_for_widget(widget): "Return a Python string containing the WhatsThis text for \ widget (perhaps ""), or None if we can't find that." | def whatsthis_text_for_widget(widget): #bruce 060120 split this out of other code "Return a Python string containing the WhatsThis text for widget (perhaps ""), or None if we can't find that." try: ## original_text = widget.whatsThis() # never works for widgets (though it would work for QActions) text = QWhatsThis.textFor( widget) # often a null string, often an exception; don't know if it can be a QString except: # this happens for a lot of QObjects (don't know what they are), e.g. for <constants.qt.QObject object at 0xb96b750> return None else: return str( text or "" ) # note: the 'or ""' above is in case we got None (probably never needed, but might as well be safe) # note: the str() (in case of QString) might not be needed; during debug it seemed this was already a Python string pass | 596540c24ceb3b478e904a42e26d7d5dd8809d95 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/596540c24ceb3b478e904a42e26d7d5dd8809d95/whatsthis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4121,
20244,
291,
67,
955,
67,
1884,
67,
6587,
12,
6587,
4672,
468,
2848,
3965,
13026,
1611,
3462,
1416,
333,
596,
434,
1308,
981,
315,
990,
279,
6600,
533,
4191,
326,
3497,
2323,
2503,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4121,
20244,
291,
67,
955,
67,
1884,
67,
6587,
12,
6587,
4672,
468,
2848,
3965,
13026,
1611,
3462,
1416,
333,
596,
434,
1308,
981,
315,
990,
279,
6600,
533,
4191,
326,
3497,
2323,
2503,
... |
'll_math_fmod' : InstructionList([PushAllArgs, '%']), | 'll_math.ll_math_fmod' : InstructionList([PushAllArgs, '%']), | def __init__(self): list_resize = lambda g,op: SetBuiltinField.run_it(g, op.args[1], 'length', op.args[2]) self.builtin_map = { 'll_js_jseval' : CallBuiltin('eval'), 'set_on_keydown' : SetOnEvent('onkeydown'), 'set_on_keyup' : SetOnEvent('onkeyup'), 'setTimeout' : SetTimeout, 'll_int_str' : lambda g,op: Call._render_builtin_method(g, 'toString' , [op.args[2]]), 'll_strconcat' : InstructionList([PushAllArgs, '+']), 'll_int' : CallBuiltin('parseInt'), #'alert' : CallBuiltin('alert'), 'seval' : CallBuiltin('seval'), 'date': NewBuiltin('Date'), 'll_math_fmod' : InstructionList([PushAllArgs, '%']), 'll_time_time' : CallBuiltin('time'), 'll_time_clock' : CallBuiltin('clock'), 'll_os_write' : CallBuiltin('print'), } self.builtin_obj_map = { ootype.String.__class__: { 'll_strconcat' : InstructionList([PushAllArgs, '+']), 'll_strlen' : lambda g,op: GetBuiltinField.run_it(g, op.args[1], 'length'), 'll_stritem_nonneg' : lambda g, op: Call._render_builtin_method(g, 'charAt', [op.args[1], op.args[2]]), 'll_streq' : InstructionList([PushAllArgs, '==']), 'll_strcmp' : CallBuiltin('strcmp'), 'll_startswith' : CallBuiltin('startswith'), 'll_endswith' : CallBuiltin('endswith'), 'll_split_chr' : CallBuiltin('splitchr'), #'ll_substring' : lambda g,op: Call._render_builtin_method(g, 'substring', [op.args[1], op.args[2], op.args[3]]), 'll_substring' : CallBuiltin('substring'), 'll_lower' : lambda g, op: Call._render_builtin_method(g, 'toLowerCase', [op.args[1]]), 'll_upper' : lambda g, op: Call._render_builtin_method(g, 'toUpperCase', [op.args[1]]), }, ootype.List: { 'll_setitem_fast' : ListSetitem, 'll_getitem_fast' : ListGetitem, '_ll_resize' : list_resize, '_ll_resize_ge' : list_resize, '_ll_resize_le' : list_resize, 'll_length' : lambda g,op: GetBuiltinField.run_it(g, op.args[1], 'length'), }, ootype.Dict: { 'll_get' : ListGetitem, 'll_set' : ListSetitem, 'll_contains' : ListContains, 'll_get_items_iterator' : CallBuiltin('dict_items_iterator'), 'll_length' : CallBuiltin('get_dict_len'), 'll_remove' : lambda g, op: CallBuiltin('delete')._render_builtin_prepared_args(g, 'delete', ['%s[%s]' % (op.args[1], op.args[2])]), 'll_clear': CallBuiltin('clear_dict'), }, ootype.Record: { 'll_get' : ListGetitem, 'll_set' : ListSetitem, 'll_contains' : ListContains, } } | cb4c11ff256f784abd16df17aa6816aa9238867f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/cb4c11ff256f784abd16df17aa6816aa9238867f/jsbuiltin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
666,
67,
15169,
273,
3195,
314,
16,
556,
30,
1000,
28032,
974,
18,
2681,
67,
305,
12,
75,
16,
1061,
18,
1968,
63,
21,
6487,
296,
2469,
2187,
1061,
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,
666,
67,
15169,
273,
3195,
314,
16,
556,
30,
1000,
28032,
974,
18,
2681,
67,
305,
12,
75,
16,
1061,
18,
1968,
63,
21,
6487,
296,
2469,
2187,
1061,
18... |
if text[1] in ('!', '@'): if text[1:5] in ("info", "find"): | if text[1] in reply_chars: if text[1:5] in my_commands: | def inFilter(self, irc, msg): if msg.command != "PRIVMSG": return msg if not conf.supybot.defaultIgnore(): return msg text = msg.args[1].strip() if len(text) < 6: return msg user = get_user(msg) if user: return msg channel = self.__getChannel(msg.args[0]) if channel: if text[0] not in ('!', '@'): return msg if not text[1:5] in ("info", "find"): return msg | 283652a263ab69ddf4dea37a7a8e0323c2a2eb2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3102/283652a263ab69ddf4dea37a7a8e0323c2a2eb2b/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
1586,
12,
2890,
16,
277,
1310,
16,
1234,
4672,
309,
1234,
18,
3076,
480,
315,
7698,
58,
11210,
6877,
327,
1234,
309,
486,
2195,
18,
2859,
93,
4819,
18,
1886,
3777,
13332,
327,
123... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
1586,
12,
2890,
16,
277,
1310,
16,
1234,
4672,
309,
1234,
18,
3076,
480,
315,
7698,
58,
11210,
6877,
327,
1234,
309,
486,
2195,
18,
2859,
93,
4819,
18,
1886,
3777,
13332,
327,
123... |
An element of ps_ring which is the q-expansion of eta(q)/q^{1/24} truncated to n terms. | An element of ps_ring which is the q-expansion of $\eta(q)/q^{1/24}$ truncated to n terms. | def qexp_eta(ps_ring, n): r""" Return the q-expansion of $\eta(q) / q^{1/24}$, where $\eta(q)$ is Dedekind's function $$\eta(q) = q^{1/24}\prod_{i=1}^\infty (1-q^i)$$, as an element of ps_ring, to precision n. Completely naive algorithm. INPUTS: -- (PowerSeriesRing) ps_ring: a power series ring -- we pass this as an argument as we frequently need to create multiple series in the same ring. -- (integer) n: the number of terms to compute. OUTPUT: An element of ps_ring which is the q-expansion of eta(q)/q^{1/24} truncated to n terms. ALGORITHM: Multiply out the product $\prod_{i=1}^n (1 - q^i)$. Could perhaps be speeded up by using the identity \[ \eta(q) = q^{1/24}( 1 + \sum_{i \ge 1} (-1)^n (q^{n(3n+1)/2} + q^{n(3n-1)/2}),\] but I'm lazy. EXAMPLES: sage: qexp_eta(ZZ[['q']], 100) 1 - q - q^2 + q^5 + q^7 - q^12 - q^15 + q^22 + q^26 - q^35 - q^40 + q^51 + q^57 - q^70 - q^77 + q^92 + O(q^100) """ q = ps_ring.gen() t = ps_ring(1).add_bigoh(n) for i in xrange(1,n): t = t*ps_ring( 1 - q**i) return t | 0c130fed7b356e022134568630e483428d00fec2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0c130fed7b356e022134568630e483428d00fec2/etaproducts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1043,
2749,
67,
1066,
12,
1121,
67,
8022,
16,
290,
4672,
436,
8395,
2000,
326,
1043,
17,
2749,
12162,
434,
271,
64,
1066,
12,
85,
13,
342,
1043,
66,
95,
21,
19,
3247,
22496,
16,
1625... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1043,
2749,
67,
1066,
12,
1121,
67,
8022,
16,
290,
4672,
436,
8395,
2000,
326,
1043,
17,
2749,
12162,
434,
271,
64,
1066,
12,
85,
13,
342,
1043,
66,
95,
21,
19,
3247,
22496,
16,
1625... |
def get_doc(project, source_code, offset, resource=None): | def get_doc(project, source_code, offset, resource=None, maxfixes=1): | def get_doc(project, source_code, offset, resource=None): """Get the pydoc""" word_finder = WordRangeFinder(source_code) lineno = source_code[:offset].count('\n') expression = word_finder.get_primary_at(offset) pymodule = _get_pymodule(project.pycore, source_code, resource) scope = pymodule.get_scope().get_inner_scope_for_line(lineno) element = rope.base.evaluate.get_string_result(scope, expression) if element is None: return None pyobject = element.get_object() return PyDocExtractor().get_doc(pyobject) | df7197863d122070af59387f151cabe16640632c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8286/df7197863d122070af59387f151cabe16640632c/codeassist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2434,
12,
4406,
16,
1084,
67,
710,
16,
1384,
16,
1058,
33,
7036,
16,
943,
904,
281,
33,
21,
4672,
3536,
967,
326,
2395,
2434,
8395,
2076,
67,
15356,
273,
9926,
2655,
8441,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2434,
12,
4406,
16,
1084,
67,
710,
16,
1384,
16,
1058,
33,
7036,
16,
943,
904,
281,
33,
21,
4672,
3536,
967,
326,
2395,
2434,
8395,
2076,
67,
15356,
273,
9926,
2655,
8441,
1... |
L += srange(args[i-1]+diff, args[i+1]+1, diff, universe=universe, check=False) | L += srange(args[i-1]+diff, args[i+1], diff, universe=universe, check=False, include_endpoint=True) | def ellipsis_range(*args): """ Return arithmatic sequence determined by the numeric arguments and ellipsis. Best illistrated by examples. Use [1,2,..,n] notation. EXAMPLES: sage: ellipsis_range(1,Ellipsis,11,100) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 100] sage: ellipsis_range(0,2,Ellipsis,10,Ellipsis,20) [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20] sage: ellipsis_range(0,2,Ellipsis,11,Ellipsis,20) [0, 2, 4, 6, 8, 10, 11, 13, 15, 17, 19] """ from sage.structure.sequence import Sequence S = Sequence([a for a in args if a is not Ellipsis]) universe = S.universe() args = [Ellipsis if a is Ellipsis else universe(a) for a in args] diff = universe(1) if Ellipsis in args: i = args.index(Ellipsis) if i > 1: diff = args[i-1]-args[i-2] skip = False L = [] for i in range(len(args)): if skip: skip = False elif args[i] is Ellipsis: if i > 2 and args[i-2] is Ellipsis and L[-1] != args[i-1]: L.append(args[i-1]) L += srange(args[i-1]+diff, args[i+1]+1, diff, universe=universe, check=False) skip = True else: L.append(args[i]) return L | b0407bebdcafbc7357b33c8faa600978ff6cc467 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b0407bebdcafbc7357b33c8faa600978ff6cc467/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28992,
67,
3676,
30857,
1968,
4672,
3536,
2000,
419,
13612,
2126,
3102,
11383,
635,
326,
6389,
1775,
471,
28992,
18,
25717,
277,
2906,
3337,
690,
635,
10991,
18,
225,
2672,
306,
21,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28992,
67,
3676,
30857,
1968,
4672,
3536,
2000,
419,
13612,
2126,
3102,
11383,
635,
326,
6389,
1775,
471,
28992,
18,
25717,
277,
2906,
3337,
690,
635,
10991,
18,
225,
2672,
306,
21,
16,
... |
if self.rotatePhysics: rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up()) step=rotMat.xform(self.__vel) physObject.setPosition(Point3( physObject.getPosition()+step)) o=physObject.getOrientation() r=LOrientationf() r.setHpr(Vec3(rotation, 0.0, 0.0)) physObject.setOrientation(o*r) self.actorNode.updateTransform() else: rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up()) step=rotMat.xform(self.__vel) physObject.setPosition(Point3( physObject.getPosition()+step)) self.actorNode.updateTransform() self.avatarNodePath.setHpr( self.avatarNodePath.getHpr()+ Vec3(rotation, 0.0, 0.0)) if self.rotatePhysics: assert self.avatarNodePath.getHpr().almostEqual(physObject.getOrientation().getHpr(), 0.0001) | rotMat=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up()) step=rotMat.xform(self.__vel) physObject.setPosition(Point3( physObject.getPosition()+step)) o=physObject.getOrientation() r=LOrientationf() r.setHpr(Vec3(rotation, 0.0, 0.0)) physObject.setOrientation(o*r) self.actorNode.updateTransform() assert self.avatarNodePath.getHpr().almostEqual(physObject.getOrientation().getHpr(), 0.0001) | def handleAvatarControls(self, task): """ Check on the arrow keys and update the avatar. """ onScreenDebug.append("localToon pos = %s\n"%(toonbase.localToon.getPos().pPrintValues(),)) onScreenDebug.append("localToon hpr = %s\n"%(toonbase.localToon.getHpr().pPrintValues(),)) #assert(self.debugPrint("handleAvatarControls(task=%s)"%(task,))) physObject=self.actorNode.getPhysicsObject() #rotAvatarToPhys=Mat3.rotateMatNormaxis(-self.avatarNodePath.getH(), Vec3.up()) #rotPhysToAvatar=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up()) contact=self.actorNode.getContactVector() # hack fix for falling through the floor: if contact==Vec3.zero() and self.avatarNodePath.getZ()<-50.0: # reset: # DCR: don't reset X and Y; allow player to move self.avatarNodePath.setZ(50.0) self.resetPhys() | ff162e6b6bbdfa3219fdd78044bc7b872cf16b82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/ff162e6b6bbdfa3219fdd78044bc7b872cf16b82/PhysicsWalker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
16910,
18,
3536,
603,
7956,
2829,
18,
6923,
2932,
3729,
774,
265,
949,
273,
738,
87,
64,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
16910,
18,
3536,
603,
7956,
2829,
18,
6923,
2932,
3729,
774,
265,
949,
273,
738,
87,
64,
... |
for checkArgName in expected.keys(): | s = str(e) for checkArgName in expected: | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | eb7f68e05bf7b363bbe5678de958f5bc6ce66ba0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eb7f68e05bf7b363bbe5678de958f5bc6ce66ba0/test_exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
775,
30,
609,
12,
89,
11,
18601,
521,
89,
713,
41,
21,
6134,
1335,
1185,
16,
425,
30,
3296,
16532,
5509,
668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
775,
30,
609,
12,
89,
11,
18601,
521,
89,
713,
41,
21,
6134,
1335,
1185,
16,
425,
30,
3296,
16532,
5509,
668,
... |
""" | r""" | def FuzzyBallGraph(self, partition, q): """ Construct a Fuzzy Ball graph with the integer partition ``partition`` and ``q`` extra vertices. | 7d7db5252f36fea2d87565cac78d6b6e8b3c44b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7d7db5252f36fea2d87565cac78d6b6e8b3c44b4/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
478,
13903,
38,
454,
4137,
12,
2890,
16,
3590,
16,
1043,
4672,
436,
8395,
14291,
279,
478,
13903,
605,
454,
2667,
598,
326,
3571,
3590,
12176,
10534,
10335,
471,
12176,
85,
10335,
2870,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
478,
13903,
38,
454,
4137,
12,
2890,
16,
3590,
16,
1043,
4672,
436,
8395,
14291,
279,
478,
13903,
605,
454,
2667,
598,
326,
3571,
3590,
12176,
10534,
10335,
471,
12176,
85,
10335,
2870,
... |
%s """ % (start_string_prefix, uric, urilast, uric, urilast, uric, urilast, emailc, emailc, emailc, emailc, urilast, end_string_suffix,), re.VERBOSE)) | %(end_string_suffix)s """ % locals(), re.VERBOSE)) | def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages. | 9fe47ec4311156cad473d8ed8bf0dba5fd73c14e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/9fe47ec4311156cad473d8ed8bf0dba5fd73c14e/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
-100,
-100,
-100,
-100,
-100,... |
""" if not self.dominates(Partition_class(p)): | sage: p/Partition([1,1]) [[3, 2, 1], [1, 1]] """ if not self.dominates(p): | def __div__(self, p): """ Returns the skew partition self/p. | 11ea804844c7b6f19ea1338ae965390e87f57ad0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/11ea804844c7b6f19ea1338ae965390e87f57ad0/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2892,
972,
12,
2890,
16,
293,
4672,
3536,
2860,
326,
20001,
3590,
365,
19,
84,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2892,
972,
12,
2890,
16,
293,
4672,
3536,
2860,
326,
20001,
3590,
365,
19,
84,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
make_interwiki = interwiki | def get_licenses(metabook): """Return list of licenses @returns: list of dicts with license info @rtype: [dict] """ import re from mwlib import utils licenses = [] for license in metabook.licenses: wikitext = '' if license.get('mw_license_url'): url = license['mw_license_url'] if re.match(r'^.*/index\.php.*action=raw', url) and 'templates=expand' not in url: url += '&templates=expand' wikitext = utils.fetch_url(url, ignore_errors=True, expected_content_type='text/x-wiki', ) if wikitext: try: wikitext = unicode(wikitext, 'utf-8') except UnicodeError: wikitext = None else: wikitext = '' if license.get('mw_rights_text'): wikitext = license['mw_rights_text'] if license.get('mw_rights_page'): wikitext += '\n\n[[%s]]' % license['mw_rights_page'] if license.get('mw_rights_url'): wikitext += '\n\n' + license['mw_rights_url'] if not wikitext: continue licenses.append({ 'title': license.get('name', u'License'), 'wikitext': wikitext, }) return licenses | 6fd2e93be64d9caaa57615092163b91232689051 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/6fd2e93be64d9caaa57615092163b91232689051/metabook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
80,
16548,
12,
10578,
378,
1184,
4672,
3536,
990,
666,
434,
26457,
225,
632,
6154,
30,
666,
434,
15838,
598,
8630,
1123,
632,
86,
723,
30,
306,
1576,
65,
3536,
1930,
283,
628,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
80,
16548,
12,
10578,
378,
1184,
4672,
3536,
990,
666,
434,
26457,
225,
632,
6154,
30,
666,
434,
15838,
598,
8630,
1123,
632,
86,
723,
30,
306,
1576,
65,
3536,
1930,
283,
628,... | |
pprint(differences, stream=temp) | pprint(differences, stream = temp) | def assert_equals_file_content(reference_file, fixture, filetype='xml'): if os.path.isfile(fixture): with open(fixture) as fixture_file: fixture_content = fixture_file.read() else: fixture_content = fixture with open(reference_file) as expected_file: expected_content = expected_file.read() if filetype == 'xml': print fixture_content fixture_content = fromstring(fixture_content) pretty_indent(fixture_content) temp = StringIO() ElementTree(fixture_content).write(temp) fixture_content = temp.getvalue() expected_content = fromstring(expected_content) pretty_indent(expected_content) temp = StringIO() ElementTree(expected_content).write(temp) expected_content = temp.getvalue() fixture_lines = fixture_content.split('\n') expected_lines = expected_content.split('\n') differences = list(difflib.unified_diff(expected_lines, fixture_lines)) if differences: temp = StringIO() pprint(differences, stream=temp) assert False, 'Differences found : %s' % temp.getvalue() | 2f91f278ccfb5e2a91b746aa648b3b571226f944 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13008/2f91f278ccfb5e2a91b746aa648b3b571226f944/helper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
14963,
67,
768,
67,
1745,
12,
6180,
67,
768,
16,
16678,
16,
18902,
2218,
2902,
11,
4672,
309,
1140,
18,
803,
18,
291,
768,
12,
904,
10970,
4672,
598,
1696,
12,
904,
10970,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
14963,
67,
768,
67,
1745,
12,
6180,
67,
768,
16,
16678,
16,
18902,
2218,
2902,
11,
4672,
309,
1140,
18,
803,
18,
291,
768,
12,
904,
10970,
4672,
598,
1696,
12,
904,
10970,
... |
mysmtp = smtplib.SMTP(self.settings['E-mail']['SMTP Server'], self.settings['E-mail']['SMTP Port']) if self.cmdoptions.debug: mysmtp.set_debuglevel(1) if self.settings['E-mail']['SMTP Use TLS'] == True: mysmtp.ehlo() mysmtp.starttls() mysmtp.ehlo() if self.settings['E-mail']['SMTP Needs Login'] == True: mysmtp.login(self.settings['E-mail']['SMTP Username'], myutils.password_recover(self.settings['E-mail']['SMTP Password'])) sendingresults = mysmtp.sendmail(self.settings['E-mail']['SMTP From'], self.settings['E-mail']['SMTP To'].split(";"), msg.as_string()) self.PrintDebug("Email sending errors (if any): " + str(sendingresults) + "\n") | def SendZipByEmail(self): '''Send the zipped logfile archive by email, using mail settings specified in the .ini file ''' # basic logic flow: #~ if autozip is not enabled, just call the ziplogfiles function ourselves #~ read ziplog.txt (in a try block) and check if it conforms to being a proper zip filename #~ if not, then print error and get out #~ in a try block, read emaillog.txt to get latest emailed zip, and check for proper filename #~ if fail, just go ahead with sending all available zipfiles #~ do a os.listdir() on the dirname, and trim it down to only contain our zipfiles #~ and moreover, only zipfiles with names between lastemailed and latestzip, including latestzip, #~ but not including lastemailed. #~ send all the files in list #~ write new lastemailed to emaillog.txt self.PrintDebug("Sending mail to " + self.settings['E-mail']['SMTP To'] + "\n") if self.settings['Zip']['Zip Enable'] == False or os.path.isfile(os.path.join(self.settings['General']['Log Directory'], "ziplog.txt")) == False: self.ZipLogFiles() try: ziplog = open(os.path.join(self.settings['General']['Log Directory'], "ziplog.txt"), 'r') latestZipFile = ziplog.readline() ziplog.close() if not self.CheckIfZipFile(latestZipFile): self.PrintDebug("latest zip filename does not match proper filename pattern. something went wrong. stopping.\n") return except: self.PrintDebug("Unexpected error opening ziplog.txt: " + str(sys.exc_info()[0]) + ", " + str(sys.exc_info()[1]) + "\n") return try: latestZipEmailed = "" #initialize to blank, just in case emaillog.txt doesn't get read emaillog = open(os.path.join(self.settings['General']['Log Directory'], "emaillog.txt"), 'r') latestZipEmailed = emaillog.readline() emaillog.close() if not self.CheckIfZipFile(latestZipEmailed): self.PrintDebug("latest emailed zip filename does not match proper filename pattern. something went wrong. stopping.\n") return except: self.PrintDebug("Error opening emaillog.txt: " + str(sys.exc_info()[0]) + ", " + str(sys.exc_info()[1]) + "\nWill email all available log zips.\n") zipFileList = os.listdir(self.settings['General']['Log Directory']) self.PrintDebug(str(zipFileList)) if len(zipFileList) > 0: # removing elements from a list while iterating over it produces undesirable results # so we do the os.listdir again to iterate over for filename in os.listdir(self.settings['General']['Log Directory']): if not self.CheckIfZipFile(filename): zipFileList.remove(filename) self.PrintDebug("removing " + filename + " from zipfilelist because it's not a zipfile\n") # we can do the following string comparison due to the structured and dated format of the filenames elif filename <= latestZipEmailed or filename > latestZipFile: zipFileList.remove(filename) self.PrintDebug("removing " + filename + " from zipfilelist because it's not in range\n") self.PrintDebug(str(zipFileList)) # set up the message msg = MIMEMultipart() msg['From'] = self.settings['E-mail']['SMTP From'] msg['To'] = COMMASPACE.join(self.settings['E-mail']['SMTP To'].split(";")) msg['Date'] = formatdate(localtime=True) msg['Subject'] = self.settings['E-mail']['SMTP Subject'] | 6ed57ae951689329f84b1af783026391157d52a4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3638/6ed57ae951689329f84b1af783026391157d52a4/logwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
9141,
858,
4134,
12,
2890,
4672,
9163,
3826,
326,
3144,
1845,
15204,
5052,
635,
2699,
16,
1450,
4791,
1947,
1269,
316,
326,
263,
8767,
585,
9163,
468,
5337,
4058,
4693,
30,
468,
98... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
9141,
858,
4134,
12,
2890,
4672,
9163,
3826,
326,
3144,
1845,
15204,
5052,
635,
2699,
16,
1450,
4791,
1947,
1269,
316,
326,
263,
8767,
585,
9163,
468,
5337,
4058,
4693,
30,
468,
98... | |
sendchannel("Stimme gegen %s gezählt. Zuständige Stellen sind verständigt." % (target)) | sendchannel("Stimme gegen %s gezählt. \ Zuständige Stellen sind verständigt." % (target)) | def checkTimeOut(votes): if votes[0][1] + TIMEOUT > time(): return votes # no votes have timed out elif len(votes) > 1: return checkTimeOut(votes[1:]) # oldest vote has timed out, continue checking else: return [] # no valid vote left | 17c61548967182a27edf171b75277fa10ff63052 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14907/17c61548967182a27edf171b75277fa10ff63052/scherbengericht.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
950,
1182,
12,
27800,
4672,
309,
19588,
63,
20,
6362,
21,
65,
397,
24374,
405,
813,
13332,
327,
19588,
10792,
468,
1158,
19588,
1240,
7491,
596,
1327,
562,
12,
27800,
13,
405,
404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
950,
1182,
12,
27800,
4672,
309,
19588,
63,
20,
6362,
21,
65,
397,
24374,
405,
813,
13332,
327,
19588,
10792,
468,
1158,
19588,
1240,
7491,
596,
1327,
562,
12,
27800,
13,
405,
404,
... |
self.window.set_default_size(START_SIZE, START_SIZE / self.frameAspect) | self.window.set_default_size(int(START_SIZE), int(START_SIZE / self.frameAspect)) | def __init__(self, playlist, aspect=None): self.playlist = playlist self.filename, self.filepath = "", '' self.child, self.fullscreen = None, False # Load the keyboard config self.keyConfig = loadMplayerInputConf() | 4bcd650be30355c515963579d01b822c8b61d3ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13137/4bcd650be30355c515963579d01b822c8b61d3ac/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
16428,
16,
9648,
33,
7036,
4672,
365,
18,
1601,
1098,
273,
16428,
365,
18,
3459,
16,
365,
18,
10561,
273,
23453,
875,
365,
18,
3624,
16,
365,
18,
2854,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16428,
16,
9648,
33,
7036,
4672,
365,
18,
1601,
1098,
273,
16428,
365,
18,
3459,
16,
365,
18,
10561,
273,
23453,
875,
365,
18,
3624,
16,
365,
18,
2854,
... |
rv = command for arg in args: rv += ' ' + arg return rv | return command + ' ' + ' '.join(args) | def onData(self, command, args): self.inData = True if self.train_as_ham == True or self.train_as_spam == True: self.push("250 OK\r\n") return None rv = command for arg in args: rv += ' ' + arg return rv | 59bfd5959a729786d46fcecf45ea4ead85dee759 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/59bfd5959a729786d46fcecf45ea4ead85dee759/smtpproxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
751,
12,
2890,
16,
1296,
16,
833,
4672,
365,
18,
267,
751,
273,
1053,
309,
365,
18,
9754,
67,
345,
67,
31698,
422,
1053,
578,
365,
18,
9754,
67,
345,
67,
1752,
301,
422,
1053,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
751,
12,
2890,
16,
1296,
16,
833,
4672,
365,
18,
267,
751,
273,
1053,
309,
365,
18,
9754,
67,
345,
67,
31698,
422,
1053,
578,
365,
18,
9754,
67,
345,
67,
1752,
301,
422,
1053,
... |
headers = forget(context, request) | headers = forget(request) | def forget(request): """ Return a sequence of header tuples (e.g. ``[('Set-Cookie', 'foo=abc')]``) suitable for 'forgetting' the set of credentials possessed by the currently authenticated user. A common usage might look like so within the body of a view function (``response`` is assumed to be an WebOb-style response object computed previously by the view code):: from repoze.bfg.security import forget headers = forget(context, request) response.headerlist.extend(headers) return response If no authentication policy is in use, this function will always return an empty sequence.""" policy = queryUtility(IAuthenticationPolicy) if policy is None: return [] else: return policy.forget(request) | ff65a5a7b6177759191071be8790d02bd4c0ce8e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14321/ff65a5a7b6177759191071be8790d02bd4c0ce8e/security.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13776,
12,
2293,
4672,
3536,
2000,
279,
3102,
434,
1446,
10384,
261,
73,
18,
75,
18,
12176,
63,
2668,
694,
17,
6151,
2187,
296,
11351,
33,
18947,
6134,
65,
10335,
13,
10631,
364,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13776,
12,
2293,
4672,
3536,
2000,
279,
3102,
434,
1446,
10384,
261,
73,
18,
75,
18,
12176,
63,
2668,
694,
17,
6151,
2187,
296,
11351,
33,
18947,
6134,
65,
10335,
13,
10631,
364,
296,
... |
return '' | return '' | def read(self, *args): return '' | cada31e8208b1e7201f5afc9f9782089bec7ebe3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/cada31e8208b1e7201f5afc9f9782089bec7ebe3/binhex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
380,
1968,
4672,
327,
875,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
380,
1968,
4672,
327,
875,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
filename = "Start.hylt" | filename = "./Start.hylt" | def hyltMain (meta_screen, starting_filename): """The core Hylt functionality. Contains the main input and display loops, lots of initialization, and so on. """ curses.curs_set(0) # Remember: Parameters are in the order of (y, x). meta_y, meta_x = meta_screen.getmaxyx() core_state = {"y": meta_y, "x": meta_x} # Keep the "base path", as all Hylt links are relative. # TODO: Keep people from backing out of the base path using .. or the like. core_state["base_path"] = os.path.dirname (starting_filename) filename = os.path.basename (starting_filename) # There are three windows: a top status bar, a primary screen, and a bottom # status bar. There is also the main screen, of course. Create them. top = meta_screen.subwin (1, meta_x, 0, 0) main = meta_screen.subwin (meta_y - 2, meta_x, 1, 0) bottom = meta_screen.subwin (1, meta_x, meta_y - 1, 0) core_state["history"] = [] fresh_page = True done = False curses.def_prog_mode () main_needs_redraw = True while not done: if fresh_page: readHyltFile (filename, core_state) core_state["title"] = generateTitle (filename) core_state["cx"] = 0 core_state["cy"] = 0 if core_state["link_count"] > 0: core_state["selected_link"] = 0 else: core_state["selected_link"] = None dir_delta = 1 fresh_page = False main_needs_redraw = True displayHeader (top, core_state) displayLinkInfo (bottom, core_state) fixCursorCoords (core_state) if main_needs_redraw: displayPage (main, core_state) curses.doupdate () keypress = meta_screen.getch() if ord ('q') == keypress: done = True elif ord ('h') == keypress: core_state["cx"] -= min (max (1, meta_x / 2), 8) main_needs_redraw = True elif ord ('j') == keypress: core_state["cy"] += min (max (1, meta_x / 2), 8) main_needs_redraw = True elif ord ('k') == keypress: core_state["cy"] -= min (max (1, meta_x / 2), 8) main_needs_redraw = True elif ord ('l') == keypress: core_state["cx"] += min (max (1, meta_x / 2), 8) main_needs_redraw = True elif ord ('x') == keypress: exportToHTML (filename[:-4] + "html", core_state) displayNote (bottom, "Exported to '" + filename[:-4] + "html' ...", core_state) elif curses.KEY_NPAGE == keypress: core_state["cy"] += meta_y - 4 main_needs_redraw = True elif curses.KEY_PPAGE == keypress: core_state["cy"] -= meta_y - 4 main_needs_redraw = True elif ord ('r') == keypress: fresh_page = True elif curses.KEY_LEFT == keypress or curses.KEY_BACKSPACE == keypress: if len (core_state["history"]) > 0: filename = core_state["history"][-1] core_state["history"].pop () fresh_page = True # Don't even bother with arrow keys other than back unless link count > 0. elif core_state["link_count"] > 0: if curses.KEY_UP == keypress: if core_state["selected_link"] == 0: core_state["cy"] -= min (max (1, meta_x / 2), 8) dir_delta = -1 else: core_state["selected_link"] -= 1 moveCursorForLink (core_state, -1) displayLinkInfo (bottom, core_state) main_needs_redraw = True elif curses.KEY_DOWN == keypress: if core_state["selected_link"] == core_state["link_count"] - 1: core_state["cy"] += min (max (1, meta_x / 2), 8) dir_delta = -1 else: core_state["selected_link"] += 1 moveCursorForLink (core_state, 1) displayLinkInfo (bottom, core_state) main_needs_redraw = True elif ord (' ') == keypress: moveCursorForLink (core_state, dir_delta) main_needs_redraw = True elif ord ('e') == keypress: if None != os.getenv ("EDITOR", None): rel_name = core_state["link_list"][core_state["selected_link"]] real_filename = os.path.join (core_state["base_path"], rel_name) os.system (os.getenv ("EDITOR") + " \"" + real_filename + "\"") curses.reset_prog_mode () curses.curs_set(1) curses.curs_set(0) main_needs_redraw = True displayHeader (top, core_state) displayLinkInfo (bottom, core_state) elif ord ('E') == keypress: if None != os.getenv ("EDITOR", None): real_filename = os.path.join (core_state["base_path"], filename) os.system (os.getenv ("EDITOR") + " \"" + real_filename + "\"") curses.reset_prog_mode () curses.curs_set(1) curses.curs_set(0) fresh_page = True elif curses.KEY_RIGHT == keypress or 10 == keypress or curses.KEY_ENTER == keypress: # The big one--jump to a new Hylt page. First, make sure it's a # real page. rel_name = core_state["link_list"][core_state["selected_link"]] real_filename = os.path.join (core_state["base_path"], rel_name) if os.path.isfile (real_filename): # Go! Add this page to the history so we can come back. core_state["history"].append (filename) filename = rel_name fresh_page = True else: noteMissingPage (bottom, rel_name, core_state["x"]) displayLinkInfo (bottom, core_state) | 843f70834e8ac11c56ad86655cbfe1784bd17647 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2254/843f70834e8ac11c56ad86655cbfe1784bd17647/hylt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4855,
5618,
6376,
261,
3901,
67,
9252,
16,
5023,
67,
3459,
4672,
3536,
1986,
2922,
14881,
5618,
14176,
18,
225,
8398,
326,
2774,
810,
471,
2562,
14075,
16,
328,
6968,
434,
10313,
16,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4855,
5618,
6376,
261,
3901,
67,
9252,
16,
5023,
67,
3459,
4672,
3536,
1986,
2922,
14881,
5618,
14176,
18,
225,
8398,
326,
2774,
810,
471,
2562,
14075,
16,
328,
6968,
434,
10313,
16,
471... |
('/lib', None, stat.S_IFDIR), | ('/lib/', None, stat.S_IFDIR), | def doFile(self, path): | 71c13a0c0e57b6b6fae1f2b9de56ec3358d7a246 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/71c13a0c0e57b6b6fae1f2b9de56ec3358d7a246/destdirpolicy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
812,
12,
2890,
16,
589,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
812,
12,
2890,
16,
589,
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,
... |
line_num = 0 | def main(): #First, get number of CPUs, defaulting to 1 num_cpu = 1 pipe = getShellPipe("sysctl hw.ncpu") for line in pipe: line_s = line.split(" ") if len(line_s) > 1: num_cpu = int(line_s[1]) pipe.close() # Next, get physical memory (RAM), defaulting to 1 gig phys_mem = 1000000000 pipe = getShellPipe("sysctl hw.physmem") for line in pipe: line_s = line.split(" ") if len(line_s) > 1: phys_mem = int(line_s[1]) pipe.close() # Get max files open, defaulting to 1000 files_open = 1000 pipe = getShellPipe("sysctl kern.maxfiles") for line in pipe: line_s = line.split(" ") if len(line_s) > 1: files_open = int(line_s[1]) pipe.close() # Get hard drive space, defaulting to 1 gig disk_space = 1000000000 pipe = getShellPipe("df") seenFirstLine = False line_num = 0 for line in pipe: line_num += 1 if seenFirstLine: disk_space = 0 line_s = re.split("\\s*", line) if len(line_s) >= 6 and line: disk_space += (int(line_s[2]) + int(line_s[3])) * 1000 else: seenFirstLine = True pipe.close() # Get the max number of processes, defaulting to 100 events = 100 pipe = getShellPipe("sysctl kern.maxproc") for line in pipe: line_s = line.split(" ") if len(line_s) > 1: events = int(line_s[1]) pipe.close() print "resource cpu", num_cpu * 100 print "resource memory", phys_mem print "resource filesopened", files_open print "resource diskused", disk_space print "resource events", events | 2e9fee9ad2f043506898233224a839199f64aeb8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/2e9fee9ad2f043506898233224a839199f64aeb8/Mac_BSD_resources.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
468,
3759,
16,
336,
1300,
434,
5181,
3477,
16,
805,
310,
358,
404,
818,
67,
11447,
273,
404,
6010,
273,
7932,
1165,
11546,
2932,
9499,
12930,
16139,
18,
82,
11447,
7923... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
468,
3759,
16,
336,
1300,
434,
5181,
3477,
16,
805,
310,
358,
404,
818,
67,
11447,
273,
404,
6010,
273,
7932,
1165,
11546,
2932,
9499,
12930,
16139,
18,
82,
11447,
7923... | |
self.svc_mgmt.hide() | self.service_controller_close() | def on_svc_mgmt_delete(self, *args): self.svc_mgmt.hide() return gtk.TRUE | e5a19586a2c694fb03bfb0847b7e708225493cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3879/e5a19586a2c694fb03bfb0847b7e708225493cf8/ConfigTabController.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
30992,
67,
9319,
67,
3733,
12,
2890,
16,
380,
1968,
4672,
365,
18,
3278,
67,
5723,
67,
4412,
1435,
327,
22718,
18,
18724,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
30992,
67,
9319,
67,
3733,
12,
2890,
16,
380,
1968,
4672,
365,
18,
3278,
67,
5723,
67,
4412,
1435,
327,
22718,
18,
18724,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
labels -- if False, each edge is a tuple (u,v) of vertices. | labels -- (bool; default: True) if False, each edge is a tuple (u,v) of vertices. sort -- (bool; default: True) if True, ensure that the list of edges is sorted. OUTPUT: A list of tuples. It is safe to change the returned list. | def edges(self, labels=True): """ Return a list of edges. Each edge is a triple (u,v,l) where u and v are vertices and l is a label. INPUT: labels -- if False, each edge is a tuple (u,v) of vertices. EXAMPLES: sage: graphs.DodecahedralGraph().edges() [(0, 1, None), (0, 10, None), (0, 19, None), (1, 8, None), (1, 2, None), (2, 3, None), (2, 6, None), (3, 19, None), (3, 4, None), (4, 17, None), (4, 5, None), (5, 6, None), (5, 15, None), (6, 7, None), (7, 8, None), (7, 14, None), (8, 9, None), (9, 10, None), (9, 13, None), (10, 11, None), (11, 12, None), (11, 18, None), (12, 16, None), (12, 13, None), (13, 14, None), (14, 15, None), (15, 16, None), (16, 17, None), (17, 18, None), (18, 19, None)] sage: graphs.DodecahedralGraph().edges(labels=False) [(0, 1), (0, 10), (0, 19), (1, 8), (1, 2), (2, 3), (2, 6), (3, 19), (3, 4), (4, 17), (4, 5), (5, 6), (5, 15), (6, 7), (7, 8), (7, 14), (8, 9), (9, 10), (9, 13), (10, 11), (11, 12), (11, 18), (12, 16), (12, 13), (13, 14), (14, 15), (15, 16), (16, 17), (17, 18), (18, 19)] | a93c6f591f8298acfe9c0ed6cb3f79020ee76927 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a93c6f591f8298acfe9c0ed6cb3f79020ee76927/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5231,
12,
2890,
16,
3249,
33,
5510,
4672,
3536,
2000,
279,
666,
434,
5231,
18,
8315,
3591,
353,
279,
14543,
261,
89,
16,
90,
16,
80,
13,
1625,
582,
471,
331,
854,
6928,
471,
328,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5231,
12,
2890,
16,
3249,
33,
5510,
4672,
3536,
2000,
279,
666,
434,
5231,
18,
8315,
3591,
353,
279,
14543,
261,
89,
16,
90,
16,
80,
13,
1625,
582,
471,
331,
854,
6928,
471,
328,
353... |
rList.append(item) webList.append(rList) | rList.append( item ) webList.append( rList ) | def getTransformationTasks(self,condDict={},older=None, newer=None, timeStamp='CreationTime', orderAttribute=None, limit=None, inputVector=False, connection=False): connection = self.__getConnection(connection) req = "SELECT %s FROM TransformationTasks %s" % (intListToString(self.TASKSPARAMS),self.buildCondition(condDict, older, newer, timeStamp,orderAttribute,limit)) res = self._query(req,connection) if not res['OK']: return res webList = [] resultList = [] for row in res['Value']: # Prepare the structure for the web rList = [] taskDict = {} count = 0 for item in row: taskDict[self.TASKSPARAMS[count]] = item count += 1 if type(item) not in [IntType,LongType]: rList.append(str(item)) else: rList.append(item) webList.append(rList) if inputVector: taskDict['InputVector'] = '' taskID = taskDict['TaskID'] transID = taskDict['TransformationID'] res = self.getTaskInputVector(transID,taskID) if res['OK']: if res['Value'].has_key(taskID): taskDict['InputVector']=res['Value'][taskID] resultList.append(taskDict) result = S_OK(resultList) result['Records'] = webList result['ParameterNames'] = self.TASKSPARAMS return result | 9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
15292,
6685,
12,
2890,
16,
10013,
5014,
28793,
1498,
33,
7036,
16,
16069,
33,
7036,
16,
18198,
2218,
29746,
2187,
1353,
1499,
33,
7036,
16,
1800,
33,
7036,
16,
810,
5018,
33,
8381,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15292,
6685,
12,
2890,
16,
10013,
5014,
28793,
1498,
33,
7036,
16,
16069,
33,
7036,
16,
18198,
2218,
29746,
2187,
1353,
1499,
33,
7036,
16,
1800,
33,
7036,
16,
810,
5018,
33,
8381,
... |
tag = Tag.objects.get_by(slug=slug) | def do_show_tag(req, slug, page=1): """ Show all posts tagged with a given tag slug. Available template variables: `posts`: a list of post objects we want to display `pagination`: a pagination object to render a pagination `tag` the tag object for this page. :Template name: ``show_tag.html`` :URL endpoint: ``blog/show_tag`` """ data = Post.objects.get_list(tag=slug, page=page) if data.pop('probably_404'): abort(404) tag = Tag.objects.get_by(slug=slug) add_link('alternate', url_for('blog/atom_feed', tag=slug), 'application/atom+xml', _('All posts tagged %s') % tag.name) return render_response('show_tag.html', tag=tag, **data) | 95e5791bfd2a48b91043732668daa6106ae5cd46 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12815/95e5791bfd2a48b91043732668daa6106ae5cd46/blog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
4500,
67,
2692,
12,
3658,
16,
4959,
16,
1363,
33,
21,
4672,
3536,
9674,
777,
10775,
12503,
598,
279,
864,
1047,
4959,
18,
225,
15633,
1542,
3152,
30,
225,
1375,
11660,
68,
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,
741,
67,
4500,
67,
2692,
12,
3658,
16,
4959,
16,
1363,
33,
21,
4672,
3536,
9674,
777,
10775,
12503,
598,
279,
864,
1047,
4959,
18,
225,
15633,
1542,
3152,
30,
225,
1375,
11660,
68,
30,... | |
changed[gp.path] = (gp.op, gp) | changed[gp.path] = gp | def scangitpatch(fp, firstline): '''git patches can modify a file, then copy that file to a new file, but expect the source to be the unmodified form. So we scan the patch looking for that case so we can do the copies ahead of time.''' | 545f4d8d558fec3c96fc1546200fe77944791dac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/545f4d8d558fec3c96fc1546200fe77944791dac/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
539,
305,
2272,
12,
7944,
16,
1122,
1369,
4672,
9163,
6845,
16482,
848,
5612,
279,
585,
16,
1508,
1610,
716,
585,
358,
279,
394,
585,
16,
1496,
4489,
326,
1084,
358,
506,
326,
304... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
539,
305,
2272,
12,
7944,
16,
1122,
1369,
4672,
9163,
6845,
16482,
848,
5612,
279,
585,
16,
1508,
1610,
716,
585,
358,
279,
394,
585,
16,
1496,
4489,
326,
1084,
358,
506,
326,
304... |
str += groupstr return str + '</table><br />\n\n' | if self._inheritance == 'short' and container.is_class(): str += self._inheritance_list(variables, container) return str + groupstr + '</table><br />\n\n' | def _var_summary(self, variables, sortorder, container, groups, heading='Variable Summary'): """ @return: The HTML code for a variable summary table. This is used by L{_module_to_html} to list the variables in a module; and by L{_class_to_html} to list instance variables and class variables. @rtype: C{string} """ variables = self._filtersort_vars(variables, sortorder) if len(variables) == 0: return '' | 986fb527f9f5168bb2a99f7a14d03b6f9e1f2682 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/986fb527f9f5168bb2a99f7a14d03b6f9e1f2682/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1401,
67,
7687,
12,
2890,
16,
3152,
16,
1524,
1019,
16,
1478,
16,
3252,
16,
11053,
2218,
3092,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,
4916,
1014,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1401,
67,
7687,
12,
2890,
16,
3152,
16,
1524,
1019,
16,
1478,
16,
3252,
16,
11053,
2218,
3092,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,
4916,
1014,
1... |
directory = self.Root[drive_path] | directory = self.Root[drive] | def __doLookup(self, fsclass, name, directory = None, create = 1): """This method differs from the File and Dir factory methods in one important way: the meaning of the directory parameter. In this method, if directory is None or not supplied, the supplied name is expected to be an absolute path. If you try to look up a relative path with directory=None, then an AssertionError will be raised.""" | d1da3a2d42b13188250503433684019ab8aaad7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12817/d1da3a2d42b13188250503433684019ab8aaad7a/FS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2896,
6609,
12,
2890,
16,
284,
1017,
459,
16,
508,
16,
1867,
273,
599,
16,
752,
273,
404,
4672,
3536,
2503,
707,
21944,
628,
326,
1387,
471,
8446,
3272,
2590,
316,
1245,
10802,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2896,
6609,
12,
2890,
16,
284,
1017,
459,
16,
508,
16,
1867,
273,
599,
16,
752,
273,
404,
4672,
3536,
2503,
707,
21944,
628,
326,
1387,
471,
8446,
3272,
2590,
316,
1245,
10802,
4... |
if not dleft: | if dleft == None: | def on_get_value(self, rowref, column): node = self.tree.get_node_for_rowref(rowref) if not node: return None else: task = node.get_obj() if column == COL_TID: return task.get_id() elif column == COL_OBJ: return task elif column == COL_TITLE: return saxutils.escape(task.get_title()) elif column == COL_SDATE: return str(task.get_start_date()) elif column == COL_DDATE: return str(task.get_due_date()) elif column == COL_DUE: dleft = task.get_days_left() if not dleft: return str(task.get_due_date()) if dleft == 1: return _("Tomorrow") if dleft == 0: return _("Today") if dleft == -1: return _("Yesterday") if dleft < -1: return _("%s days ago") % str(abs(dleft)) if dleft > 1 and dleft <= 15: return _("In %s days") % str(dleft) else: return str(task.get_due_date()) | 12e20d4b34c0d490242ac011c26b3136fa3d99c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/12e20d4b34c0d490242ac011c26b3136fa3d99c6/tasktree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
588,
67,
1132,
12,
2890,
16,
1027,
1734,
16,
1057,
4672,
756,
273,
365,
18,
3413,
18,
588,
67,
2159,
67,
1884,
67,
492,
1734,
12,
492,
1734,
13,
309,
486,
756,
30,
327,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
67,
1132,
12,
2890,
16,
1027,
1734,
16,
1057,
4672,
756,
273,
365,
18,
3413,
18,
588,
67,
2159,
67,
1884,
67,
492,
1734,
12,
492,
1734,
13,
309,
486,
756,
30,
327,
59... |
return Factoid('','Error: unresolvable <alias>','','',0) | return Factoid('','<reply> Error: unresolvable <alias> to %s' % factoid.value[7:].lower().strip(),'','',0) | def resolve_alias(self, channel, factoid, loop=0): if loop >= 10: return Factoid('','Error: infinite <alias> loop detected','','',0) if factoid and factoid.value.lower().startswith('<alias>'): new_factoids = self.get_factoids(factoid.value[7:].lower().strip(), channel, False) for x in ['channel_primary', 'global_primary']: if getattr(new_factoids, x): return self.resolve_alias(channel, getattr(new_factoids, x), loop+1) return Factoid('','Error: unresolvable <alias>','','',0) else: return factoid | 7f0c7d962746c862e2ebbedc3dfbdd55252c6cf6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3105/7f0c7d962746c862e2ebbedc3dfbdd55252c6cf6/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
67,
4930,
12,
2890,
16,
1904,
16,
5410,
839,
16,
2798,
33,
20,
4672,
309,
2798,
1545,
1728,
30,
327,
29057,
839,
2668,
17023,
668,
30,
14853,
411,
4930,
34,
2798,
8316,
17023,
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,
2245,
67,
4930,
12,
2890,
16,
1904,
16,
5410,
839,
16,
2798,
33,
20,
4672,
309,
2798,
1545,
1728,
30,
327,
29057,
839,
2668,
17023,
668,
30,
14853,
411,
4930,
34,
2798,
8316,
17023,
17... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.