rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
SELECT name, DECODE(line, 1, '/'||chr(10)||'CREATE OR REPLACE ', '')||text | SELECT name, text, DECODE(line, 1, '/'||chr(10)||'CREATE OR REPLACE ', '') AS prefix | def customQuery(cursor, state, builder): cursor.execute(""" SELECT name, DECODE(line, 1, '/'||chr(10)||'CREATE OR REPLACE ', '')||text FROM user_source WHERE type IN ('%s') ORDER BY name, type, line""" % "', '".join(builder.DbType)) | fcf18539bec7fa46fe4d3ec35d3304dc75d654cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/760/fcf18539bec7fa46fe4d3ec35d3304dc75d654cf/code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1679,
1138,
12,
9216,
16,
919,
16,
2089,
4672,
3347,
18,
8837,
2932,
3660,
9111,
508,
16,
977,
16,
2030,
5572,
12,
1369,
16,
404,
16,
2023,
20081,
15182,
12,
2163,
14047,
16637,
9344,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1679,
1138,
12,
9216,
16,
919,
16,
2089,
4672,
3347,
18,
8837,
2932,
3660,
9111,
508,
16,
977,
16,
2030,
5572,
12,
1369,
16,
404,
16,
2023,
20081,
15182,
12,
2163,
14047,
16637,
9344,
... |
cmd = "lcg-cr --vo atlas " | cmd = cmd + " --vo atlas " | def save_file(count, griddir, dest, gridlfn, output_lfn, filename, poolguid, siteID, tokenname=''): # Calc timeout timeout = int(300 * 2**count) if timeout<300: timeout = 300 # Create LFC directory cmd = "lfc-mkdir -p %s" %(griddir) rc, out = commands.getstatusoutput(cmd) if rc != 0: print 'ERROR during execution of %s' %cmd print rc, out return -1, -1, -1 # Create file replica #cmd = "lcg-cr --vo atlas -t 300 -d %s -l %s -P %s file://%s" %(dest, gridlfn, output_lfn, filename) if tokenname: cmd = "lcg-cr --vo atlas -s %s " %tokenname else: cmd = "lcg-cr --vo atlas " if poolguid != '': cmd = cmd + " -t %s -d %s -g %s -l %s file://%s" %(timeout, dest, poolguid, gridlfn, filename) else: cmd = cmd + " -t %s -d %s -l %s file://%s" %(timeout, dest, gridlfn, filename) rc, out = commands.getstatusoutput(cmd) if rc == 0: # Open output_guids to transfer guids back to GANGA f = open('output_guids','a') print >>f, '%s,%s' %(out,siteID) f.close() if globalVerbose: print cmd print out guid = re.sub('^guid:','',out) else: print 'ERROR during execution of %s' %cmd print rc, out return -1, -1, -1 # size and md5sum size, md5sum = getLocalFileMetadata_adler32(filename) return guid, size, md5sum | 1985a21450e9841b4b0766bc46f07ea50091d496 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/1985a21450e9841b4b0766bc46f07ea50091d496/ganga-stage-in-out-dq2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
768,
12,
1883,
16,
3068,
1214,
16,
1570,
16,
3068,
80,
4293,
16,
876,
67,
80,
4293,
16,
1544,
16,
2845,
14066,
16,
2834,
734,
16,
1147,
529,
2218,
11,
4672,
225,
468,
29128... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
768,
12,
1883,
16,
3068,
1214,
16,
1570,
16,
3068,
80,
4293,
16,
876,
67,
80,
4293,
16,
1544,
16,
2845,
14066,
16,
2834,
734,
16,
1147,
529,
2218,
11,
4672,
225,
468,
29128... |
pdb.run('sliceview(randn(6,6))') | pdb.run('sliceview(fmap.data)', globals=globals(), locals=locals()) | def push_items(self, pxbuf, avbuf): self.av_stat.push(self.av_context, avbuf) self.px_stat.push(self.px_context, pxbuf) | 12103a63872d82631066300b2fbb6fbbaf4d63ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7241/12103a63872d82631066300b2fbb6fbbaf4d63ee/new_sliceview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1817,
67,
3319,
12,
2890,
16,
10318,
4385,
16,
1712,
4385,
4672,
365,
18,
842,
67,
5642,
18,
6206,
12,
2890,
18,
842,
67,
2472,
16,
1712,
4385,
13,
365,
18,
4430,
67,
5642,
18,
6206,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1817,
67,
3319,
12,
2890,
16,
10318,
4385,
16,
1712,
4385,
4672,
365,
18,
842,
67,
5642,
18,
6206,
12,
2890,
18,
842,
67,
2472,
16,
1712,
4385,
13,
365,
18,
4430,
67,
5642,
18,
6206,... |
'id' : SimpleItem(defvalue=None,protected=1,copyable=0,doc='Panda job id'), 'status' : SimpleItem(defvalue=None,protected=1,copyable=0,doc='Panda job status'), 'actualCE' : SimpleItem(defvalue=None,protected=1,copyable=0,doc='Actual CE where the job is run'), | 'id' : SimpleItem(defvalue=None,typelist=['type(None)','int'],protected=1,copyable=0,doc='Panda job id'), 'status' : SimpleItem(defvalue=None,typelist=['type(None)','str'],protected=1,copyable=0,doc='Panda job status'), 'actualCE' : SimpleItem(defvalue=None,typelist=['type(None)','str'],protected=1,copyable=0,doc='Actual CE where the job is run'), | def __init__(self): super(PandaBuildJob,self).__init__() | 7c3b094259ad8ef2e910f39d24f8f474608de44a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1488/7c3b094259ad8ef2e910f39d24f8f474608de44a/Panda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
52,
464,
69,
3116,
2278,
16,
2890,
2934,
972,
2738,
972,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
52,
464,
69,
3116,
2278,
16,
2890,
2934,
972,
2738,
972,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
MAYAVERSIONS=[("MAYA5", "SOFTWARE\\Alias|Wavefront\\Maya\\5.0\\Setup\\InstallPath"), ("MAYA6", "SOFTWARE\\Alias|Wavefront\\Maya\\6.0\\Setup\\InstallPath"), ("MAYA65", "SOFTWARE\\Alias|Wavefront\\Maya\\6.5\\Setup\\InstallPath") | MAYAVERSIONINFO=[("MAYA6", "SOFTWARE\\Alias|Wavefront\\Maya\\6.0\\Setup\\InstallPath"), ("MAYA65", "SOFTWARE\\Alias|Wavefront\\Maya\\6.5\\Setup\\InstallPath"), ("MAYA7", "SOFTWARE\\Alias|Wavefront\\Maya\\7.0\\Setup\\InstallPath") | def parseopts(args): global COMPILER,OPTIMIZE,OMIT,INSTALLER,GENMAN,SLAVEBUILD global VERSION,COMPRESSOR,DIRECTXSDK,VERBOSE,SLAVEFILE,THREADCOUNT longopts = [ "help","package-info","compiler=","directx-sdk=","slavebuild=", "optimize=","everything","nothing","installer","quiet","verbose", "version=","lzma","no-python","slaves=","threads="] anything = 0 for pkg in PACKAGES: longopts.append("no-"+pkg.lower()) for pkg in PACKAGES: longopts.append("use-"+pkg.lower()) try: opts, extras = getopt.getopt(args, "", longopts) for option,value in opts: if (option=="--help"): raise "usage" elif (option=="--package-info"): raise "package-info" elif (option=="--compiler"): COMPILER=value elif (option=="--directx-sdk"): DIRECTXSDK=value elif (option=="--optimize"): OPTIMIZE=value elif (option=="--quiet"): VERBOSE-=1 elif (option=="--verbose"): VERBOSE+=1 elif (option=="--installer"): INSTALLER=1 elif (option=="--genman"): GENMAN=1 elif (option=="--everything"): OMIT=[] elif (option=="--nothing"): OMIT=PACKAGES[:] elif (option=="--slaves"): SLAVEFILE=value elif (option=="--threads"): THREADCOUNT=int(value) elif (option=="--slavebuild"): SLAVEBUILD=value elif (option=="--version"): VERSION=value if (len(VERSION.split(".")) != 3): raise "usage" elif (option=="--lzma"): COMPRESSOR="lzma" else: for pkg in PACKAGES: if (option=="--use-"+pkg.lower()): if (OMIT.count(pkg)): OMIT.remove(pkg) break for pkg in PACKAGES: if (option=="--no-"+pkg.lower()): if (OMIT.count(pkg)==0): OMIT.append(pkg) break anything = 1 except "package-info": packageInfo() except: usage(0) if (anything==0): usage(0) if (OPTIMIZE=="1"): OPTIMIZE=1 elif (OPTIMIZE=="2"): OPTIMIZE=2 elif (OPTIMIZE=="3"): OPTIMIZE=3 elif (OPTIMIZE=="4"): OPTIMIZE=4 else: usage("Invalid setting for OPTIMIZE") if (COMPILERS.count(COMPILER)==0): usage("Invalid setting for COMPILER: "+COMPILER) | d00f745e1ceedb7d59a09beac4f23f2f45af36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/d00f745e1ceedb7d59a09beac4f23f2f45af36fe/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4952,
12,
1968,
4672,
2552,
5423,
1102,
14668,
16,
15620,
3445,
15641,
16,
1872,
1285,
16,
28865,
654,
16,
16652,
9560,
16,
55,
2534,
3412,
20215,
2552,
8456,
16,
4208,
22526,
916,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4952,
12,
1968,
4672,
2552,
5423,
1102,
14668,
16,
15620,
3445,
15641,
16,
1872,
1285,
16,
28865,
654,
16,
16652,
9560,
16,
55,
2534,
3412,
20215,
2552,
8456,
16,
4208,
22526,
916,
... |
convert(args[0], start_pass=start_pass, verbose=verbose) | util.run_app(convert, args[0], start_pass=start_pass, verbose=verbose) | def main(): opts, args = getopt.getopt(sys.argv[1:], 'p:v') if len(args) != 1: usage() verbose = 0 start_pass = 1 for opt, value in opts: if opt == '-p': start_pass = int(value) if start_pass < 1 or start_pass > len(_passes): print 'ERROR: illegal value (%d) for starting pass. ' \ 'must be 1 through %d.' % (start_pass, len(_passes)) sys.exit(1) elif opt == '-v': verbose = 1 convert(args[0], start_pass=start_pass, verbose=verbose) | 1ea553ef1f59c2ab034594d92c29d3b4b3e1eca7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6036/1ea553ef1f59c2ab034594d92c29d3b4b3e1eca7/cvs2svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
84,
30,
90,
6134,
309,
562,
12,
1968,
13,
480,
404,
30,
4084,
1435,
3988,
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,
2774,
13332,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
84,
30,
90,
6134,
309,
562,
12,
1968,
13,
480,
404,
30,
4084,
1435,
3988,
273,
... |
for i in xrange(self.numthreads): self._workerThreads.append(WorkerThread(self)) for worker in self._workerThreads: worker.setName("CP WSGIServer " + worker.getName()) worker.start() for worker in self._workerThreads: while not worker.ready: time.sleep(.1) | self.requests.start() | def start(self): """Run the server forever.""" # We don't have to trap KeyboardInterrupt or SystemExit here, # because cherrpy.server already does so, calling self.stop() for us. # If you're using this server with another framework, you should # trap those exceptions in whatever code block calls start(). self._interrupt = None # Select the appropriate socket if isinstance(self.bind_addr, basestring): # AF_UNIX socket # So we can reuse the socket... try: os.unlink(self.bind_addr) except: pass # So everyone can access the socket... try: os.chmod(self.bind_addr, 0777) except: pass info = [(socket.AF_UNIX, socket.SOCK_STREAM, 0, "", self.bind_addr)] else: # AF_INET or AF_INET6 socket # Get the correct address family for our host (allows IPv6 addresses) host, port = self.bind_addr try: info = socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE) except socket.gaierror: # Probably a DNS issue. Assume IPv4. info = [(socket.AF_INET, socket.SOCK_STREAM, 0, "", self.bind_addr)] self.socket = None msg = "No socket could be created" for res in info: af, socktype, proto, canonname, sa = res try: self.bind(af, socktype, proto) except socket.error, msg: if self.socket: self.socket.close() self.socket = None continue break if not self.socket: raise socket.error, msg # Timeout so KeyboardInterrupt can be caught on Win32 self.socket.settimeout(1) self.socket.listen(self.request_queue_size) # Create worker threads for i in xrange(self.numthreads): self._workerThreads.append(WorkerThread(self)) for worker in self._workerThreads: worker.setName("CP WSGIServer " + worker.getName()) worker.start() for worker in self._workerThreads: while not worker.ready: time.sleep(.1) self.ready = True while self.ready: self.tick() if self.interrupt: while self.interrupt is True: # Wait for self.stop() to complete. See _set_interrupt. time.sleep(0.1) if self.interrupt: raise self.interrupt | 2d230d71855f0afe3a9190e286cfb7edb5fabb4a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/82/2d230d71855f0afe3a9190e286cfb7edb5fabb4a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
3536,
1997,
326,
1438,
21238,
12123,
468,
1660,
2727,
1404,
1240,
358,
23034,
19424,
578,
25454,
2674,
16,
468,
2724,
462,
370,
2074,
18,
3567,
1818,
1552,
1427,
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,
787,
12,
2890,
4672,
3536,
1997,
326,
1438,
21238,
12123,
468,
1660,
2727,
1404,
1240,
358,
23034,
19424,
578,
25454,
2674,
16,
468,
2724,
462,
370,
2074,
18,
3567,
1818,
1552,
1427,
16,
... |
maintainer_email="kjetilja@gmail.com, markus@oberhumer.com", | maintainer_email="kjetilja at gmail.com, markus at oberhumer.com", | def get_data_files(): # a list of tuples with (path to install to, a list of local files) data_files = [] if sys.platform == "win32": datadir = os.path.join("doc", PACKAGE) else: datadir = os.path.join("share", "doc", PACKAGE) # files = ["ChangeLog", "COPYING", "INSTALL", "README", "TODO",] if files: data_files.append((os.path.join(datadir), files)) files = glob.glob(os.path.join("doc", "*.html")) if files: data_files.append((os.path.join(datadir, "html"), files)) files = glob.glob(os.path.join("examples", "*.py")) if files: data_files.append((os.path.join(datadir, "examples"), files)) files = glob.glob(os.path.join("tests", "*.py")) if files: data_files.append((os.path.join(datadir, "tests"), files)) # assert data_files for install_dir, files in data_files: assert files for f in files: assert os.path.isfile(f), (f, install_dir) return data_files | df0d1f784a6b6cd778fd083a6a65514a3c4f5cbf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10805/df0d1f784a6b6cd778fd083a6a65514a3c4f5cbf/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
892,
67,
2354,
13332,
468,
279,
666,
434,
10384,
598,
261,
803,
358,
3799,
358,
16,
279,
666,
434,
1191,
1390,
13,
501,
67,
2354,
273,
5378,
309,
2589,
18,
9898,
422,
315,
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,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
892,
67,
2354,
13332,
468,
279,
666,
434,
10384,
598,
261,
803,
358,
3799,
358,
16,
279,
666,
434,
1191,
1390,
13,
501,
67,
2354,
273,
5378,
309,
2589,
18,
9898,
422,
315,
8... |
try: os.mkdir(homeDir) except os.error: pass | try: os.mkdir(homeDir) except os.error: import glob files = glob.glob(os.path.join(self.homeDir, '*')) for file in files: os.remove(file) | def setUp(self): self.filename = self.__class__.__name__ + '.db' homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) except os.error: pass self.env = db.DBEnv() self.env.open(homeDir, db.DB_CREATE | db.DB_INIT_MPOOL | db.DB_INIT_LOCK | db.DB_THREAD | self.envFlags) | c5cf731a4deb710892c9083a468a6d173d791456 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c5cf731a4deb710892c9083a468a6d173d791456/test_associate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
3459,
273,
365,
16186,
1106,
972,
16186,
529,
972,
397,
2418,
1966,
11,
6382,
1621,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
9499,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
365,
18,
3459,
273,
365,
16186,
1106,
972,
16186,
529,
972,
397,
2418,
1966,
11,
6382,
1621,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
9499,... |
return S_OK(siteDict) | return S_OK( siteDict ) | def getSiteSummary(self): """ Get the summary of jobs in a given status on all the sites """ | 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,
11021,
4733,
12,
2890,
4672,
3536,
968,
326,
4916,
434,
6550,
316,
279,
864,
1267,
603,
777,
326,
9180,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
11021,
4733,
12,
2890,
4672,
3536,
968,
326,
4916,
434,
6550,
316,
279,
864,
1267,
603,
777,
326,
9180,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
f('\x0a\xef\x0b\x01\x05\x06\x10\x01\xff\xff\x99\x97\x00\x55\x01\x70') | f(b'\x0a\xef\x0b\x01\x05\x06\x10\x01\xff\xff\x99\x97\x00\x55\x01\x70') | def testStringToIPv6(self): if not hasattr(socket, 'inet_ntop'): return # No inet_ntop() on this platform try: from socket import inet_ntop, AF_INET6, has_ipv6 if not has_ipv6: return except ImportError: return f = lambda a: inet_ntop(AF_INET6, a) | 6718062538e642d62c626fd033f2c3a2356c5505 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/6718062538e642d62c626fd033f2c3a2356c5505/test_socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
23282,
12775,
26,
12,
2890,
4672,
309,
486,
3859,
12,
7814,
16,
296,
23864,
67,
496,
556,
11,
4672,
327,
468,
2631,
17661,
67,
496,
556,
1435,
603,
333,
4072,
775,
30,
628,
2987,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23282,
12775,
26,
12,
2890,
4672,
309,
486,
3859,
12,
7814,
16,
296,
23864,
67,
496,
556,
11,
4672,
327,
468,
2631,
17661,
67,
496,
556,
1435,
603,
333,
4072,
775,
30,
628,
2987,... |
return self.conn.request(method, url, body, headers) | return self.conn.request(method, url, body, myheaders) | def request(self, method, url, body="", headers={}): ''' raise socket.error e.g. "Operation timed out" ''' headers.update(self.headers) | 7c5559704a08cf33830fb1e794a2390e5d401eda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6425/7c5559704a08cf33830fb1e794a2390e5d401eda/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
707,
16,
880,
16,
1417,
1546,
3113,
1607,
12938,
4672,
9163,
1002,
2987,
18,
1636,
425,
18,
75,
18,
315,
2988,
7491,
596,
6,
9163,
1607,
18,
2725,
12,
2890,
18,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
590,
12,
2890,
16,
707,
16,
880,
16,
1417,
1546,
3113,
1607,
12938,
4672,
9163,
1002,
2987,
18,
1636,
425,
18,
75,
18,
315,
2988,
7491,
596,
6,
9163,
1607,
18,
2725,
12,
2890,
18,
24... |
print "running configure" | def configure(self, policyFile, runId): self.logger.log(Log.DEBUG, "ProductionRunManager:configure") | 8d5591e539bc25d823de9fa6d097aefdddba4be7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6549/8d5591e539bc25d823de9fa6d097aefdddba4be7/ProductionRunManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
2890,
16,
3329,
812,
16,
1086,
548,
4672,
365,
18,
4901,
18,
1330,
12,
1343,
18,
9394,
16,
315,
31590,
1997,
1318,
30,
14895,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
2890,
16,
3329,
812,
16,
1086,
548,
4672,
365,
18,
4901,
18,
1330,
12,
1343,
18,
9394,
16,
315,
31590,
1997,
1318,
30,
14895,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
error("package version has more than one letter at then end") | bb.error("package version has more than one letter at then end") | def ververify(myorigval,silent=1): """Returns 1 if given a valid version string, els 0. Valid versions are in the format <v1>.<v2>...<vx>[a-z,_{_package_weights_}[vy]] >>> ververify('2.4.20') 1 >>> ververify('2.4..20') # two dots 0 >>> ververify('2.x.20') # 'x' is not numeric 0 >>> ververify('2.4.20a') 1 >>> ververify('2.4.20cvs') # only one trailing letter 0 >>> ververify('1a') 1 >>> ververify('test_a') # no version at all 0 >>> ververify('2.4.20_beta1') 1 >>> ververify('2.4.20_beta') 1 >>> ververify('2.4.20_wrongext') # _wrongext is no valid trailer 0 """ # Lookup the cache first try: return __ververify_cache__[myorigval] except KeyError: pass if len(myorigval) == 0: if not silent: error("package version is empty") __ververify_cache__[myorigval] = 0 return 0 myval = myorigval.split('.') if len(myval)==0: if not silent: error("package name has empty version string") __ververify_cache__[myorigval] = 0 return 0 # all but the last version must be a numeric for x in myval[:-1]: if not len(x): if not silent: error("package version has two points in a row") __ververify_cache__[myorigval] = 0 return 0 try: foo = int(x) except: if not silent: error("package version contains non-numeric '"+x+"'") __ververify_cache__[myorigval] = 0 return 0 if not len(myval[-1]): if not silent: error("package version has trailing dot") __ververify_cache__[myorigval] = 0 return 0 try: foo = int(myval[-1]) __ververify_cache__[myorigval] = 1 return 1 except: pass # ok, our last component is not a plain number or blank, let's continue if myval[-1][-1] in lowercase: try: foo = int(myval[-1][:-1]) return 1 __ververify_cache__[myorigval] = 1 # 1a, 2.0b, etc. except: pass # ok, maybe we have a 1_alpha or 1_beta2; let's see ep=string.split(myval[-1],"_") if len(ep)!= 2: if not silent: error("package version has more than one letter at then end") __ververify_cache__[myorigval] = 0 return 0 try: foo = string.atoi(ep[0]) except: # this needs to be numeric, i.e. the "1" in "1_alpha" if not silent: error("package version must have numeric part before the '_'") __ververify_cache__[myorigval] = 0 return 0 for mye in _package_ends_: if ep[1][0:len(mye)] == mye: if len(mye) == len(ep[1]): # no trailing numeric is ok __ververify_cache__[myorigval] = 1 return 1 else: try: foo = string.atoi(ep[1][len(mye):]) __ververify_cache__[myorigval] = 1 return 1 except: # if no _package_weights_ work, *then* we return 0 pass if not silent: error("package version extension after '_' is invalid") __ververify_cache__[myorigval] = 0 return 0 | 8f83be3338d7aef4b6fcef5ea89dc69fa587c1f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/8f83be3338d7aef4b6fcef5ea89dc69fa587c1f6/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1924,
8705,
12,
4811,
4949,
1125,
16,
21862,
33,
21,
4672,
3536,
1356,
404,
309,
864,
279,
923,
1177,
533,
16,
7842,
374,
18,
2364,
5244,
854,
316,
326,
740,
225,
411,
90,
21,
18652,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1924,
8705,
12,
4811,
4949,
1125,
16,
21862,
33,
21,
4672,
3536,
1356,
404,
309,
864,
279,
923,
1177,
533,
16,
7842,
374,
18,
2364,
5244,
854,
316,
326,
740,
225,
411,
90,
21,
18652,
... |
pass try: return directives.directive(name, None, None)[0] except AttributeError: | def get_directive(name): from docutils.parsers.rst import directives try: # docutils 0.4 return directives._directives[name] except (AttributeError, KeyError): pass try: return directives.directive(name, None, None)[0] except AttributeError: raise RuntimeError("No directive named '%s' found" % name) | d8be0c2ce965d6e34b307cc4295b40fe3aa07859 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/d8be0c2ce965d6e34b307cc4295b40fe3aa07859/numpydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22347,
12,
529,
4672,
628,
997,
5471,
18,
11104,
18,
16114,
1930,
13877,
775,
30,
468,
997,
5471,
374,
18,
24,
327,
13877,
6315,
30850,
63,
529,
65,
1335,
261,
1499,
668,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22347,
12,
529,
4672,
628,
997,
5471,
18,
11104,
18,
16114,
1930,
13877,
775,
30,
468,
997,
5471,
374,
18,
24,
327,
13877,
6315,
30850,
63,
529,
65,
1335,
261,
1499,
668,
16,
... | |
def postincoming(ui, repo, modheads, optupdate, wasempty): | def postincoming(ui, repo, modheads, optupdate): | def postincoming(ui, repo, modheads, optupdate, wasempty): if modheads == 0: return if optupdate: if wasempty: return hg.update(repo, repo.lookup('default')) elif modheads == 1: return hg.update(repo, repo.changelog.tip()) # update else: ui.status(_("not updating, since new heads added\n")) if modheads > 1: ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n")) else: ui.status(_("(run 'hg update' to get a working copy)\n")) | 30c5744a87e768b1e275ea6e6bbaf632d52cff60 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/30c5744a87e768b1e275ea6e6bbaf632d52cff60/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
31033,
12,
4881,
16,
3538,
16,
681,
20263,
16,
2153,
2725,
4672,
309,
681,
20263,
422,
374,
30,
327,
309,
2153,
2725,
30,
309,
341,
448,
81,
825,
30,
327,
22576,
18,
2725,
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,
1603,
31033,
12,
4881,
16,
3538,
16,
681,
20263,
16,
2153,
2725,
4672,
309,
681,
20263,
422,
374,
30,
327,
309,
2153,
2725,
30,
309,
341,
448,
81,
825,
30,
327,
22576,
18,
2725,
12,
... |
print dst_geom.ExportToWkt() | print(dst_geom.ExportToWkt()) | def ogr_factory_2(): src_wkt = 'MULTIPOLYGON (((0 0,100 0,100 100,0 0)))' exp_wkt = 'POLYGON((0 0,100 0,100 100,0 0))' src_geom = ogr.CreateGeometryFromWkt( src_wkt ) dst_geom = ogr.ForceToPolygon( src_geom ) if ogrtest.check_feature_geometry( dst_geom, exp_wkt ): print dst_geom.ExportToWkt() return 'fail' return 'success' | aa75b013fbb8ec9e8cd52db626b33309de2decf7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10290/aa75b013fbb8ec9e8cd52db626b33309de2decf7/ogr_factory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
6848,
67,
22,
13332,
225,
1705,
67,
91,
8629,
273,
296,
24683,
1741,
30317,
673,
261,
12443,
20,
374,
16,
6625,
374,
16,
6625,
2130,
16,
20,
374,
3719,
2506,
1329,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
6848,
67,
22,
13332,
225,
1705,
67,
91,
8629,
273,
296,
24683,
1741,
30317,
673,
261,
12443,
20,
374,
16,
6625,
374,
16,
6625,
2130,
16,
20,
374,
3719,
2506,
1329,
67,
... |
if asbool(request.environ['paste.config']['app_conf'].get('debug', 'false')): warnings.warn("edit: form validation failed: %s" % errors) | warnings.warn("edit: form validation failed: %s" % errors) | def edit(self, id): """Allow editing of an object. | 711082833b4f61e1d10d47c126973d37c4e93b47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12856/711082833b4f61e1d10d47c126973d37c4e93b47/crud.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
12,
2890,
16,
612,
4672,
3536,
7009,
15755,
434,
392,
733,
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,
3874,
12,
2890,
16,
612,
4672,
3536,
7009,
15755,
434,
392,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
subentrylinks[i] = self.fix_fragment(m) | subentrylinks[i] = \ self.fix_fragment(m.group(1), m.group(2)) | def fix_genindex(self, tree): """Fix href attributes for genindex pages. """ # XXX: modifies tree inline # Logic modeled from themes/basic/genindex.html for key, columns in tree: for entryname, (links, subitems) in columns: for (i, link) in enumerate(links): m = _refuri_re.match(link) if m: links[i] = self.fix_fragment(m) for subentryname, subentrylinks in subitems: for (i, link) in enumerate(subentrylinks): m = _refuri_re.match(link) if m: subentrylinks[i] = self.fix_fragment(m) | 753a266fffc3382cd7d5d4d9be435d203452b776 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/753a266fffc3382cd7d5d4d9be435d203452b776/epub.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
4507,
1615,
12,
2890,
16,
2151,
4672,
3536,
8585,
3897,
1677,
364,
3157,
1615,
4689,
18,
3536,
468,
11329,
30,
23934,
2151,
6370,
468,
10287,
938,
329,
628,
15455,
19,
13240,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
4507,
1615,
12,
2890,
16,
2151,
4672,
3536,
8585,
3897,
1677,
364,
3157,
1615,
4689,
18,
3536,
468,
11329,
30,
23934,
2151,
6370,
468,
10287,
938,
329,
628,
15455,
19,
13240,
1... |
replicas[lfn].pop(requestedSE) | replicas[lfn].pop( requestedSE ) | def prepareNewReplicas(self): """ This is the first logical task to be executed and manages the New->Waiting transition of the Replicas """ res = self.__getNewReplicas() if not res['OK']: gLogger.fatal("RequestPreparation.prepareNewReplicas: Failed to get replicas from StagerDB.",res['Message']) return res if not res['Value']: gLogger.info("There were no New replicas found") return res replicas = res['Value']['Replicas'] replicaIDs = res['Value']['ReplicaIDs'] gLogger.info("RequestPreparation.prepareNewReplicas: Obtained %s New replicas for preparation." % len(replicaIDs)) | d68cb60fd991fa9f206177d2794f8d04f940cd00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/d68cb60fd991fa9f206177d2794f8d04f940cd00/RequestPreparationAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1908,
17248,
12,
2890,
4672,
3536,
1220,
353,
326,
1122,
6374,
1562,
358,
506,
7120,
471,
20754,
281,
326,
1166,
2122,
15946,
6007,
434,
326,
31222,
3536,
400,
273,
365,
16186,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1908,
17248,
12,
2890,
4672,
3536,
1220,
353,
326,
1122,
6374,
1562,
358,
506,
7120,
471,
20754,
281,
326,
1166,
2122,
15946,
6007,
434,
326,
31222,
3536,
400,
273,
365,
16186,
588,
... |
_debug(ui, 'reading tag cache from %s\n' % cachefile.name) | def _readtagcache(ui, repo): '''Read the tag cache and return a tuple (heads, fnodes, cachetags, shouldwrite). If the cache is completely up-to-date, cachetags is a dict of the form returned by _readtags(); otherwise, it is None and heads and fnodes are set. In that case, heads is the list of all heads currently in the repository (ordered from tip to oldest) and fnodes is a mapping from head to .hgtags filenode. If those two are set, caller is responsible for reading tag info from each head.''' try: cachefile = repo.opener('tags.cache', 'r') # force reading the file for static-http cachelines = iter(cachefile) _debug(ui, 'reading tag cache from %s\n' % cachefile.name) except IOError: cachefile = None # The cache file consists of lines like # <headrev> <headnode> [<tagnode>] # where <headrev> and <headnode> redundantly identify a repository # head from the time the cache was written, and <tagnode> is the # filenode of .hgtags on that head. Heads with no .hgtags file will # have no <tagnode>. The cache is ordered from tip to oldest (which # is part of why <headrev> is there: a quick visual check is all # that's required to ensure correct order). # # This information is enough to let us avoid the most expensive part # of finding global tags, which is looking up <tagnode> in the # manifest for each head. cacherevs = [] # list of headrev cacheheads = [] # list of headnode cachefnode = {} # map headnode to filenode if cachefile: for line in cachelines: if line == "\n": break line = line.rstrip().split() cacherevs.append(int(line[0])) headnode = bin(line[1]) cacheheads.append(headnode) if len(line) == 3: fnode = bin(line[2]) cachefnode[headnode] = fnode tipnode = repo.changelog.tip() tiprev = len(repo.changelog) - 1 # Case 1 (common): tip is the same, so nothing has changed. # (Unchanged tip trivially means no changesets have been added. # But, thanks to localrepository.destroyed(), it also means none # have been destroyed by strip or rollback.) if cacheheads and cacheheads[0] == tipnode and cacherevs[0] == tiprev: _debug(ui, "tag cache: tip unchanged\n") tags = _readtags(ui, repo, cachelines, cachefile.name) cachefile.close() return (None, None, tags, False) if cachefile: cachefile.close() # ignore rest of file repoheads = repo.heads() # Case 2 (uncommon): empty repo; get out quickly and don't bother # writing an empty cache. if repoheads == [nullid]: return ([], {}, {}, False) # Case 3 (uncommon): cache file missing or empty. if not cacheheads: _debug(ui, 'tag cache: cache file missing or empty\n') # Case 4 (uncommon): tip rev decreased. This should only happen # when we're called from localrepository.destroyed(). Refresh the # cache so future invocations will not see disappeared heads in the # cache. elif cacheheads and tiprev < cacherevs[0]: _debug(ui, 'tag cache: tip rev decremented (from %d to %d), ' 'so we must be destroying nodes\n' % (cacherevs[0], tiprev)) # Case 5 (common): tip has changed, so we've added/replaced heads. else: _debug(ui, 'tag cache: tip has changed (%d:%s); must find new heads\n' % (tiprev, short(tipnode))) # Luckily, the code to handle cases 3, 4, 5 is the same. So the # above if/elif/else can disappear once we're confident this thing # actually works and we don't need the debug output. # N.B. in case 4 (nodes destroyed), "new head" really means "newly # exposed". newheads = [head for head in repoheads if head not in set(cacheheads)] _debug(ui, 'tag cache: found %d head(s) not in cache: %s\n' % (len(newheads), map(short, newheads))) # Now we have to lookup the .hgtags filenode for every new head. # This is the most expensive part of finding tags, so performance # depends primarily on the size of newheads. Worst case: no cache # file, so newheads == repoheads. for head in newheads: cctx = repo[head] try: fnode = cctx.filenode('.hgtags') cachefnode[head] = fnode except error.LookupError: # no .hgtags file on this head pass # Caller has to iterate over all heads, but can use the filenodes in # cachefnode to get to each .hgtags revision quickly. return (repoheads, cachefnode, None, True) | b2451d75e661d2c1bb8833ce32d5b7db4222606b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/b2451d75e661d2c1bb8833ce32d5b7db4222606b/tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2692,
2493,
12,
4881,
16,
3538,
4672,
9163,
1994,
326,
1047,
1247,
471,
327,
279,
3193,
261,
20263,
16,
2295,
1145,
16,
7122,
278,
1341,
16,
1410,
2626,
2934,
225,
971,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2692,
2493,
12,
4881,
16,
3538,
4672,
9163,
1994,
326,
1047,
1247,
471,
327,
279,
3193,
261,
20263,
16,
2295,
1145,
16,
7122,
278,
1341,
16,
1410,
2626,
2934,
225,
971,
326,
... | |
'code1' : fields.function(_campaign_code,string='Code',type="char",size="64",method=True,readonly=True), | 'code1' : fields.function(_campaign_code,string='Code',type="char",size=64,method=True,readonly=True), | def _quantity_usable_total(self, cr, uid, ids, name, args, context={}): result={} campaigns = self.browse(cr,uid,ids) for campaign in campaigns: quantity=0 numeric=True for propo in campaign.proposition_ids: if propo.quantity_usable.isdigit(): quantity += int(propo.quantity_usable) else: result[campaign.id]='Check Segments' numeric=False break if numeric: result[campaign.id]=str(quantity) return result | fd579264445d426cb1816460cf19cfb07cb147aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/fd579264445d426cb1816460cf19cfb07cb147aa/campaign.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16172,
67,
16665,
67,
4963,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
12938,
4672,
563,
12938,
8965,
87,
273,
365,
18,
25731,
12,
3353,
16,
1911,
16,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16172,
67,
16665,
67,
4963,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
12938,
4672,
563,
12938,
8965,
87,
273,
365,
18,
25731,
12,
3353,
16,
1911,
16,
22... |
r = check_type(self._inherit_fields[f[i]][2]._type) data[fpos] = r | r = check_type(self._inherit_fields[f[i]][2]._type) data[fpos] = r | def check_type(field_type): if field_type == 'float': return 0.0 elif field_type == 'integer': return 0 elif field_type == 'boolean': return False return '' | 9f8394a3119b661e0f978387e8467c7103893025 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/9f8394a3119b661e0f978387e8467c7103893025/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
723,
12,
1518,
67,
723,
4672,
309,
652,
67,
723,
422,
296,
5659,
4278,
327,
374,
18,
20,
1327,
652,
67,
723,
422,
296,
7745,
4278,
327,
374,
1327,
652,
67,
723,
422,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
723,
12,
1518,
67,
723,
4672,
309,
652,
67,
723,
422,
296,
5659,
4278,
327,
374,
18,
20,
1327,
652,
67,
723,
422,
296,
7745,
4278,
327,
374,
1327,
652,
67,
723,
422,
296,
... |
return self.check1(spf, self.d, 0) | rc = self.check1(spf, self.d, 0) if self.perm_error: self.perm_error.ext = rc raise self.perm_error return rc | def check(self, spf=None): """ | 8ad4b16156cfbaa11f22f77430b55af7820cc3e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/139/8ad4b16156cfbaa11f22f77430b55af7820cc3e8/spf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
1694,
74,
33,
7036,
4672,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
1694,
74,
33,
7036,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
_machine_map = ("arm", "armv4l", "armv4tl", "armv5l", "armv5tl", "armv5tel", "armv5tejl", "armv6l", "armv7l", "armeb", "armv5teb") | _machine_map = ("arm", "armv4l", "armv4tl", "armv5tl", "armv5tel", "armv5tejl", "armv6l", "armv7l", "armeb", "armv5teb") | def __init__(self,myspec): generic_armeb.__init__(self,myspec) self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5teb-softfloat-linux-gnueabi" | 423613d4d63f3a603ff416edd814c78b4f729c55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7327/423613d4d63f3a603ff416edd814c78b4f729c55/arm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
81,
1900,
705,
4672,
5210,
67,
297,
3501,
70,
16186,
2738,
972,
12,
2890,
16,
81,
1900,
705,
13,
365,
18,
4272,
9614,
8955,
6552,
55,
6,
3737,
1546,
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,
1001,
2738,
972,
12,
2890,
16,
81,
1900,
705,
4672,
5210,
67,
297,
3501,
70,
16186,
2738,
972,
12,
2890,
16,
81,
1900,
705,
13,
365,
18,
4272,
9614,
8955,
6552,
55,
6,
3737,
1546,
30... |
if __debug__: class StackTrace: def __init__(self, label="", start=0, limit=None): """ label is a string (or anything that be be a string) that is printed as part of the trace back. This is just to make it easier to tell what the stack trace is referring to. start is an integer number of stack frames back from the most recent. (This is automatically bumped up by one to skip the __init__ call to the StackTrace). limit is an integer number of stack frames to record (or None for unlimited). """ self.label = label if limit is not None: self.trace = traceback.extract_stack(sys._getframe(1+start), limit=limit) else: self.trace = traceback.extract_stack(sys._getframe(1+start)) def __str__(self): r = "Debug stack trace of %s (back %s frames):\n"%( self.label, len(self.trace),) for i in traceback.format_list(self.trace): r+=i return r | class StackTrace: def __init__(self, label="", start=0, limit=None): """ label is a string (or anything that be be a string) that is printed as part of the trace back. This is just to make it easier to tell what the stack trace is referring to. start is an integer number of stack frames back from the most recent. (This is automatically bumped up by one to skip the __init__ call to the StackTrace). limit is an integer number of stack frames to record (or None for unlimited). """ self.label = label if limit is not None: self.trace = traceback.extract_stack(sys._getframe(1+start), limit=limit) else: self.trace = traceback.extract_stack(sys._getframe(1+start)) def __str__(self): r = "Debug stack trace of %s (back %s frames):\n"%( self.label, len(self.trace),) for i in traceback.format_list(self.trace): r+=i return r | def writeFsmTree(instance, indent = 0): if hasattr(instance, 'parentFSM'): writeFsmTree(instance.parentFSM, indent-2) elif hasattr(instance, 'fsm'): name = '' if hasattr(instance.fsm, 'state'): name = instance.fsm.state.name print "%s: %s"%(instance.fsm.name, name) | e8acdc34b45ce0c4a1c399e09d1da486b0f9d21d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/e8acdc34b45ce0c4a1c399e09d1da486b0f9d21d/PythonUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
42,
4808,
2471,
12,
1336,
16,
3504,
273,
374,
4672,
309,
3859,
12,
1336,
16,
296,
2938,
4931,
49,
11,
4672,
1045,
42,
4808,
2471,
12,
1336,
18,
2938,
4931,
49,
16,
3504,
17,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
42,
4808,
2471,
12,
1336,
16,
3504,
273,
374,
4672,
309,
3859,
12,
1336,
16,
296,
2938,
4931,
49,
11,
4672,
1045,
42,
4808,
2471,
12,
1336,
18,
2938,
4931,
49,
16,
3504,
17,
22... |
InterfaceVersion = "0.6"; | InterfaceVersion = "1.0.0"; | def get_providers(env): %(classname_l)s_prov = %(classname)sProvider(env) return {'%(classname)s': %(classname_l)s_prov} | f389461a29b3c609e95678846bdcf4512539afa8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10648/f389461a29b3c609e95678846bdcf4512539afa8/cim_provider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
17520,
12,
3074,
4672,
8975,
18340,
67,
80,
13,
87,
67,
25529,
273,
8975,
18340,
13,
87,
2249,
12,
3074,
13,
327,
13666,
17105,
18340,
13,
87,
4278,
8975,
18340,
67,
80,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17520,
12,
3074,
4672,
8975,
18340,
67,
80,
13,
87,
67,
25529,
273,
8975,
18340,
13,
87,
2249,
12,
3074,
13,
327,
13666,
17105,
18340,
13,
87,
4278,
8975,
18340,
67,
80,
13,
... |
INPUT:: - ``roots``: a list (or iterable) - ``children``: a function returning a list (or iterable) | Returns the set of nodes of the forest having the given roots, and where ``children(x)`` returns the children of the node ``x`` of the forest. See also :class:`~sage.combinat.backtrack.GenericBacktracker`, :class:`~sage.combinat.backtrack.TransitiveIdeal`, and :class:`~sage.combinat.backtrack.TransitiveIdealGraded`. INPUT: - ``roots``: a list (or iterable) - ``children``: a function returning a list (or iterable) | def search_forest_iterator(roots, children): r""" INPUT: - ``roots``: a list (or iterable) - ``children``: a function returning a list (or iterable) Returns an iterator on the nodes of the forest having the given roots, and where ``children(x)`` returns the children of the node ``x`` of the forest. Note that every node of the tree is returned, not simply the leaves. EXAMPLES: Search tree where leaves are binary sequences of length 3:: sage: from sage.combinat.backtrack import search_forest_iterator sage: list(search_forest_iterator([[]], lambda l: [l+[0], l+[1]] if len(l) < 3 else [])) [[], [0], [0, 0], [0, 0, 0], [0, 0, 1], [0, 1], [0, 1, 0], [0, 1, 1], [1], [1, 0], [1, 0, 0], [1, 0, 1], [1, 1], [1, 1, 0], [1, 1, 1]] Search tree where leaves are ordered sequences of length 2 from a 4-set:: sage: from sage.combinat.backtrack import search_forest_iterator sage: list(search_forest_iterator([[]], lambda l: [l + [i] for i in range(4) if i not in l] if len(l) < 2 else [])) [[], [0], [0, 1], [0, 2], [0, 3], [1], [1, 0], [1, 2], [1, 3], [2], [2, 0], [2, 1], [2, 3], [3], [3, 0], [3, 1], [3, 2]] """ #Invariant: stack[i] contains an iterator for the siblings of the i-th node of the current branch stack = [iter(roots)] while len(stack) > 0: # Try to get the next node at this depth try: node = stack[-1].next() except StopIteration: #If there are no more, go back up the tree # We also need to check if we've exhausted all # possibilities stack.pop() continue yield node stack.append( iter(children(node)) ) | dfb9be121c9dfbff085ea45e1c82478560ea238b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/dfb9be121c9dfbff085ea45e1c82478560ea238b/backtrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
1405,
334,
67,
9838,
12,
22078,
16,
2325,
4672,
436,
8395,
12943,
30,
225,
300,
12176,
22078,
10335,
30,
279,
666,
261,
280,
6087,
13,
225,
300,
12176,
5906,
10335,
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,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
1405,
334,
67,
9838,
12,
22078,
16,
2325,
4672,
436,
8395,
12943,
30,
225,
300,
12176,
22078,
10335,
30,
279,
666,
261,
280,
6087,
13,
225,
300,
12176,
5906,
10335,
30,
279,
... |
if not any([k.startswith(i) for i in ignore])]) | if not any([prefix_match(k, i) for i in ignore])]) | def diff_states(start, end, ignore=None): """ Differences two "filesystem states" as represented by dictionaries of FoundFile and FoundDir objects. Returns a dictionary with following keys: ``deleted`` Dictionary of files/directories found only in the start state. ``created`` Dictionary of files/directories found only in the end state. ``updated`` Dictionary of files whose size has changed (FIXME not entirely reliable, but comparing contents is not possible because FoundFile.bytes is lazy, and comparing mtime doesn't help if we want to know if a file has been returned to its earlier state). Ignores mtime and other file attributes; only presence/absence and size are considered. """ ignore = ignore or [] # FIXME: this code ignores too much, e.g. foo/bar when only foo/b is specified start_keys = set([k for k in start.keys() if not any([k.startswith(i) for i in ignore])]) end_keys = set([k for k in end.keys() if not any([k.startswith(i) for i in ignore])]) deleted = dict([(k, start[k]) for k in start_keys.difference(end_keys)]) created = dict([(k, end[k]) for k in end_keys.difference(start_keys)]) updated = {} for k in start_keys.intersection(end_keys): if (start[k].size != end[k].size): updated[k] = end[k] return dict(deleted=deleted, created=created, updated=updated) | 0c2309c3c8a7218725f2de5294240b23764a9c86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12982/0c2309c3c8a7218725f2de5294240b23764a9c86/test_pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3122,
67,
7992,
12,
1937,
16,
679,
16,
2305,
33,
7036,
4672,
3536,
21104,
2980,
2795,
315,
17846,
5493,
6,
487,
10584,
635,
16176,
434,
10750,
812,
471,
10750,
1621,
2184,
18,
225,
2860,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3122,
67,
7992,
12,
1937,
16,
679,
16,
2305,
33,
7036,
4672,
3536,
21104,
2980,
2795,
315,
17846,
5493,
6,
487,
10584,
635,
16176,
434,
10750,
812,
471,
10750,
1621,
2184,
18,
225,
2860,... |
Index '0' means the first position, '1' the second, and so on. Similarly '-1' is the last position, '-2' the second last, and so on. Using an index that does not exist on the list causes an error. The index can be either an integer or a string that can be converted to an integer. | Index '0' means the first position, '1' the second, and so on. Similarly, '-1' is the last position, '-2' the second last, and so on. Using an index that does not exist on the list causes an error. The index can be either an integer or a string that can be converted to an integer. | def get_from_list(self, L, index): """Returns the value specified with an index from L. The given list is never altered by this keyword. Index '0' means the first position, '1' the second, and so on. Similarly '-1' is the last position, '-2' the second last, and so on. Using an index that does not exist on the list causes an error. The index can be either an integer or a string that can be converted to an integer. | 2f5075140c0afeaf5bda26b5924aceb3478d1a14 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/2f5075140c0afeaf5bda26b5924aceb3478d1a14/Collections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2080,
67,
1098,
12,
2890,
16,
511,
16,
770,
4672,
3536,
1356,
326,
460,
1269,
598,
392,
770,
628,
511,
18,
225,
1021,
864,
666,
353,
5903,
22349,
635,
333,
4932,
18,
225,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2080,
67,
1098,
12,
2890,
16,
511,
16,
770,
4672,
3536,
1356,
326,
460,
1269,
598,
392,
770,
628,
511,
18,
225,
1021,
864,
666,
353,
5903,
22349,
635,
333,
4932,
18,
225,
33... |
command = '%s -cache 100' % command | extra_opts += ' -cache 100' command = '%s -vo null -ao %s %s %s' % (mpl, config.MPLAYER_AO_DEV, demux, extra_opts) command = command.replace('\n', '').split(' ') command.append(filename) | def play(self, item, playerGUI): """ play a audioitem with mplayer """ if item.url: filename = item.url else: filename = item.filename | a602e24b8ae8d0d4c0f37da8cf10a19d9edec20d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/a602e24b8ae8d0d4c0f37da8cf10a19d9edec20d/mplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
761,
16,
7291,
43,
5370,
4672,
3536,
6599,
279,
7447,
1726,
598,
312,
14872,
3536,
309,
761,
18,
718,
30,
1544,
273,
761,
18,
718,
469,
30,
1544,
273,
761,
18,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6599,
12,
2890,
16,
761,
16,
7291,
43,
5370,
4672,
3536,
6599,
279,
7447,
1726,
598,
312,
14872,
3536,
309,
761,
18,
718,
30,
1544,
273,
761,
18,
718,
469,
30,
1544,
273,
761,
18,
34... |
return self.__fileSystem.open() | return parted.FileSystem(PedFileSystem=self.__fileSystem.open()) | def open(self): return self.__fileSystem.open() | 86fc7a9999e732f7ae4a96161f0924959a05e294 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5978/86fc7a9999e732f7ae4a96161f0924959a05e294/filesystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
327,
365,
16186,
768,
3163,
18,
3190,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
327,
365,
16186,
768,
3163,
18,
3190,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.data += line line = nmlfile.readline() iline += 1 nmlfile.close() | while match!=None: ch = match.group(0) if ch=='\'' or ch=='"': ipos = match.end(0) inextquote = line.find(ch,ipos) if inextquote==-1: raise NamelistParser.NamelistParseException('Line %i: opening quote %s was not matched by end quote.' % (iline,ch),path) ipos = inextquote+1 else: line = line[:match.start(0)] break match = self.commentchar_re.search(line,pos=ipos) self.data += line line = nmlfile.readline() iline += 1 finally: nmlfile.close() | def __init__(self,path,requireordered,subs=[]): # Attempt to open namelist file and read all data try: nmlfile = open(path,'rU') except Exception,e: raise NamelistParser.NamelistParseException('Cannot open namelist file. Error: %s' % (str(e),),path) self.data = '' line = nmlfile.readline() iline = 1 while line!='': | 402bc8158dd9f1f7a1fa7ee4048cc635886b3815 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/381/402bc8158dd9f1f7a1fa7ee4048cc635886b3815/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
803,
16,
6528,
9885,
16,
22284,
33,
8526,
4672,
468,
12864,
358,
1696,
15135,
5449,
585,
471,
855,
777,
501,
775,
30,
290,
781,
768,
273,
1696,
12,
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,
1001,
2738,
972,
12,
2890,
16,
803,
16,
6528,
9885,
16,
22284,
33,
8526,
4672,
468,
12864,
358,
1696,
15135,
5449,
585,
471,
855,
777,
501,
775,
30,
290,
781,
768,
273,
1696,
12,
803,
... |
self.exif_date = None | self.reliable_date = None | def __init__(self, path, album): MediaFile.__init__(self, path, album) | 9579e648e4ad1b612154d0158eb22191dd83872c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4663/9579e648e4ad1b612154d0158eb22191dd83872c/sourcetree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
14844,
4672,
6128,
812,
16186,
2738,
972,
12,
2890,
16,
589,
16,
14844,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
14844,
4672,
6128,
812,
16186,
2738,
972,
12,
2890,
16,
589,
16,
14844,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"hideTabs", "autoRotate", "showCords", "figuresInNotation", "tipOfTheDay", | "hideTabs", "autoRotate", "showCords", "figuresInNotation", | def __init__ (self, widgets): conf.set("firstName", conf.get("firstName", username)) conf.set("secondName", conf.get("secondName", _("Guest"))) # Give to uistuff.keeper for key in ("firstName", "secondName", "hideTabs", "autoRotate", "showCords", "figuresInNotation", "tipOfTheDay", "fullAnimation", "moveAnimation", "noAnimation"): uistuff.keep(widgets[key], key) | a4c95723e1daa26210eac324cfc1785479e9e983 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5339/a4c95723e1daa26210eac324cfc1785479e9e983/preferencesDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
10965,
4672,
225,
2195,
18,
542,
2932,
3645,
461,
3113,
2195,
18,
588,
2932,
3645,
461,
3113,
2718,
3719,
2195,
18,
542,
2932,
8538,
461,
3113,
2195,
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,
261,
2890,
16,
10965,
4672,
225,
2195,
18,
542,
2932,
3645,
461,
3113,
2195,
18,
588,
2932,
3645,
461,
3113,
2718,
3719,
2195,
18,
542,
2932,
8538,
461,
3113,
2195,
18,
... |
preOps = [ | postOps = [ | def mutator(pop, param): 'Parameter has a length of region and a mutation rate at each basepair' region, rate = param # there are certainly more efficient algorithm, but this # example just mutate each basepair one by one.... for i in range(region): if random.random() < rate: try: idx = pop.addLoci(chrom=0, pos=i)[0] except: # position might duplicate continue # choose someone to mutate ind = pop.individual(random.randint(0, pop.popSize() - 1)) ind.setAllele(1, idx) return True | 505ded08bbab01d6828bb201d31e079f6d9e3b55 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/401/505ded08bbab01d6828bb201d31e079f6d9e3b55/userGuide.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29156,
12,
5120,
16,
579,
4672,
296,
1662,
711,
279,
769,
434,
3020,
471,
279,
11934,
4993,
622,
1517,
1026,
6017,
11,
3020,
16,
4993,
273,
579,
468,
1915,
854,
8626,
715,
1898,
14382,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29156,
12,
5120,
16,
579,
4672,
296,
1662,
711,
279,
769,
434,
3020,
471,
279,
11934,
4993,
622,
1517,
1026,
6017,
11,
3020,
16,
4993,
273,
579,
468,
1915,
854,
8626,
715,
1898,
14382,
... |
s -- int; order of the latin square will be 2^s. | s -- int; order of the latin square will be 2\^s. | def abelian_2group(s): """ Returns the latin square based on the Cayley table for the abelian 2-group of order 2^s. INPUT: s -- int; order of the latin square will be 2^s. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: print abelian_2group(3) [0 1 2 3 4 5 6 7] [1 0 3 2 5 4 7 6] [2 3 0 1 6 7 4 5] [3 2 1 0 7 6 5 4] [4 5 6 7 0 1 2 3] [5 4 7 6 1 0 3 2] [6 7 4 5 2 3 0 1] [7 6 5 4 3 2 1 0] """ assert s > 0 if s == 1: L = LatinSquare(2, 2) L[0, 0] = 0 L[0, 1] = 1 L[1, 0] = 1 L[1, 1] = 0 return L else: L_prev = abelian_2group(s-1) L = LatinSquare(2**s, 2**s) offset = L.nrows()/2 for r in range(L_prev.nrows()): for c in range(L_prev.ncols()): L[r, c] = L_prev[r, c] L[r+offset, c] = L_prev[r, c] + offset L[r, c+offset] = L_prev[r, c] + offset L[r+offset, c+offset] = L_prev[r, c] return L | b912fcc3f6e81017bcafed666fd88a387d1cf679 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/b912fcc3f6e81017bcafed666fd88a387d1cf679/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1223,
292,
2779,
67,
22,
1655,
12,
87,
4672,
3536,
2860,
326,
30486,
8576,
2511,
603,
326,
385,
528,
30678,
1014,
364,
326,
1223,
292,
2779,
576,
17,
1655,
434,
1353,
576,
66,
87,
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,
1223,
292,
2779,
67,
22,
1655,
12,
87,
4672,
3536,
2860,
326,
30486,
8576,
2511,
603,
326,
385,
528,
30678,
1014,
364,
326,
1223,
292,
2779,
576,
17,
1655,
434,
1353,
576,
66,
87,
18,
... |
'extended_property', [ExtendedProperty]) _children['{%s}visibility' % gdata.GDATA_NAMESPACE] = ('visibility', | 'extended_property', [ExtendedProperty]) _children['{%s}visibility' % gdata.GDATA_NAMESPACE] = ('visibility', | def __init__(self, value='false', *args, **kwargs): atom.AtomBase.__init__(self, *args, **kwargs) self.value = value | 6a016768dbbd7d5ee9c62bcd2d2ce3bf7f6d1048 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6580/6a016768dbbd7d5ee9c62bcd2d2ce3bf7f6d1048/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
460,
2218,
5743,
2187,
380,
1968,
16,
2826,
4333,
4672,
3179,
18,
3641,
2171,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
13,
365,
18,
113... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
460,
2218,
5743,
2187,
380,
1968,
16,
2826,
4333,
4672,
3179,
18,
3641,
2171,
16186,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
13,
365,
18,
113... |
packt=self._packt | packt = self._packt | def undoLog(self, first=0, last=-20, filter=None): if last < 0: last=first-last+1 self._lock_acquire() try: packt=self._packt if packt is None: raise UndoError( 'Undo is currently disabled for database maintenance.<p>') pos=self._pos if pos < 39: return [] file=self._file seek=file.seek read=file.read unpack=struct.unpack strip=string.strip encode=base64.encodestring r=[] append=r.append i=0 while i < last and pos > 39: seek(pos-8) pos=pos-U64(read(8))-8 seek(pos) h=read(TRANS_HDR_LEN) tid, tl, status, ul, dl, el = unpack(">8s8scHHH", h) if tid < packt: break if status != ' ': continue u=ul and read(ul) or '' d=dl and read(dl) or '' d={'id': encode(tid+p64(pos))[:22], 'time': TimeStamp(tid).timeTime(), 'user_name': u, 'description': d} if el: try: e=loads(read(el)) d.update(e) except: pass if filter is None or filter(d): if i >= first: append(d) i=i+1 return r finally: self._lock_release() | 606639c4e5cffab1a4e8d25df6976c1eb540036e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/606639c4e5cffab1a4e8d25df6976c1eb540036e/FileStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15436,
1343,
12,
2890,
16,
1122,
33,
20,
16,
1142,
29711,
3462,
16,
1034,
33,
7036,
4672,
309,
1142,
411,
374,
30,
1142,
33,
3645,
17,
2722,
15,
21,
365,
6315,
739,
67,
1077,
1039,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15436,
1343,
12,
2890,
16,
1122,
33,
20,
16,
1142,
29711,
3462,
16,
1034,
33,
7036,
4672,
309,
1142,
411,
374,
30,
1142,
33,
3645,
17,
2722,
15,
21,
365,
6315,
739,
67,
1077,
1039,
1... |
cxx.ExprSelect(ahvar, '.', 'm'+ self.myside +'Id'), objid))) | cxx.ExprSelect(ahvar, '.', 'mId'), objid))) | def injectDtorResponseHandler(block, actorObjVar, actorId): block.addstmt(cxx.StmtExpr( cxx.ExprCall(cxx.ExprVar('Unregister'), [ actorId ]))) block.addstmt(cxx.StmtExpr( cxx.ExprAssn(actorId, cxx.ExprLiteral.Int(-1)))) block.addstmt(cxx.StmtExpr( cxx.ExprAssn( cxx.ExprSelect(actorObjVar, '->', 'mManager'), cxx.ExprLiteral.ZERO))) block.addstmt(cxx.StmtExpr( cxx.ExprAssn( cxx.ExprSelect(actorObjVar, '->', 'mPeerId'), cxx.ExprLiteral.Int(-1)))) | a864017a0319c1647f5f43fdebf3ac181d70f464 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/a864017a0319c1647f5f43fdebf3ac181d70f464/lower.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4590,
40,
13039,
1064,
1503,
12,
2629,
16,
8327,
2675,
1537,
16,
8327,
548,
4672,
1203,
18,
1289,
10589,
12,
71,
5279,
18,
8952,
4742,
12,
276,
5279,
18,
4742,
1477,
12,
71,
5279,
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,
4590,
40,
13039,
1064,
1503,
12,
2629,
16,
8327,
2675,
1537,
16,
8327,
548,
4672,
1203,
18,
1289,
10589,
12,
71,
5279,
18,
8952,
4742,
12,
276,
5279,
18,
4742,
1477,
12,
71,
5279,
18,
... |
print "FATAL: Cannot access %s, a required directory for OMERO" % path | print "FATAL: Cannot access %s, a required file/directory for OMERO" % path | def can_access(self, path, mask=os.R_OK|os.W_OK): """ Check that the given path belongs to or is accessible by the current user on Linux systems. """ if "Windows" == platform.system(): return | fbbf8a3d00479bd8578b88c3bb4a1f9d3edc4af7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/fbbf8a3d00479bd8578b88c3bb4a1f9d3edc4af7/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
67,
3860,
12,
2890,
16,
589,
16,
3066,
33,
538,
18,
54,
67,
3141,
96,
538,
18,
59,
67,
3141,
4672,
3536,
2073,
716,
326,
864,
589,
11081,
358,
578,
353,
12718,
635,
326,
783,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
67,
3860,
12,
2890,
16,
589,
16,
3066,
33,
538,
18,
54,
67,
3141,
96,
538,
18,
59,
67,
3141,
4672,
3536,
2073,
716,
326,
864,
589,
11081,
358,
578,
353,
12718,
635,
326,
783,
... |
If specified, `host' is the name of the remote host to which to connect. If specified, `port' specifies the port to which to connect. By default, smtplib.SMTP_PORT is used. | If specified, `host' is the name of the remote host to which to connect. If specified, `port' specifies the port to which to connect. By default, smtplib.SMTP_PORT is used. | def __init__(self, host = '', port = 0): """Initialize a new instance. | 58a0b3fcac35fd85d6794fbcb62a4f4925cb00da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58a0b3fcac35fd85d6794fbcb62a4f4925cb00da/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
374,
4672,
3536,
7520,
279,
394,
791,
18,
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,
1001,
2738,
972,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
374,
4672,
3536,
7520,
279,
394,
791,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
""" Find files who do NOT have a particular pattern in their file name -> list | """ Finds files who do NOT have 'forbidpattern' in their file name starting from 'basedir' -> list | def find_nomasked_files(self, forbidpattern, basedir='.'): """ Find files who do NOT have a particular pattern in their file name -> list """ | f9b5bccd6b4fd4355a72b9b495908af2da52cae3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2163/f9b5bccd6b4fd4355a72b9b495908af2da52cae3/pyfind_revdep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
12306,
835,
329,
67,
2354,
12,
2890,
16,
364,
19773,
4951,
16,
15573,
2218,
1093,
4672,
3536,
4163,
87,
1390,
10354,
741,
4269,
1240,
296,
1884,
19773,
4951,
11,
316,
3675,
585... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
12306,
835,
329,
67,
2354,
12,
2890,
16,
364,
19773,
4951,
16,
15573,
2218,
1093,
4672,
3536,
4163,
87,
1390,
10354,
741,
4269,
1240,
296,
1884,
19773,
4951,
11,
316,
3675,
585... |
if i != j: (-1)**p1 * self._term(i) + (-1)**p2 * self._term(j) else: return (-1)**p1 * self._term(i) def simple_roots(self): return [ self.root(i, i+1,0,1) for i in range(self.n-1) ] + [self.root(self.n, self.n, 0, 0)] def positive_roots(self): return [ self.root(i,j,0,p) for i in range(j-1) for j in range(n) for p in [0,1] ] +\ [ self.root(i,i,0,0) for i in range(n) ] def negative_roots(self): return [ self.root(i,j,1,p) for i in range(j-1) for j in range(n) for p in [0,1] ] +\ [ self.root(i,i,1,1) for i in range(n) ] def fundamental_weights(self): return [ sum(self._term(j) for j in range(i)) for i in range(self.n)] | return (-1)**p1 * self._term(i) + (-1)**p2 * self._term(j) def simple_roots(self): """ EXAMPLES: sage: RootSystem(['C',3]).ambient_lattice().simple_roots() [(1, -1, 0), (0, 1, -1), (0, 0, 2)] """ return [ self.root(i, i+1,0,1) for i in range(self.n-1) ] + [self.root(self.n-1, self.n-1, 0, 0)] def positive_roots(self): """ EXAMPLES: sage: RootSystem(['C',3]).ambient_lattice().positive_roots() [(1, 1, 0), (1, 0, 1), (0, 1, 1), (1, -1, 0), (1, 0, -1), (0, 1, -1), (2, 0, 0), (0, 2, 0), (0, 0, 2)] """ res = [] for p in [0,1]: for j in range(self.n): res.extend([self.root(i,j,0,p) for i in range(j)]) res.extend([self.root(i,i,0,0) for i in range(self.n)]) return res def negative_roots(self): """ EXAMPLES: sage: RootSystem(['C',3]).ambient_lattice().negative_roots() [(-1, 1, 0), (-1, 0, 1), (0, -1, 1), (-1, -1, 0), (-1, 0, -1), (0, -1, -1), (-2, 0, 0), (0, -2, 0), (0, 0, -2)] """ res = [] for p in [0,1]: for j in range(self.n): res.extend( [self.root(i,j,1,p) for i in range(j) ] ) res.extend( [ self.root(i,i,1,1) for i in range(self.n) ] ) return res def fundamental_weights(self): """ EXAMPLES: sage: RootSystem(['C',3]).ambient_lattice().fundamental_weights() [(1, 0, 0), (1, 1, 0), (1, 1, 1)] """ return [ sum(self._term(j) for j in range(i+1)) for i in range(self.n)] | def root(self, i, j, p1, p2): if i != j: (-1)**p1 * self._term(i) + (-1)**p2 * self._term(j) else: return (-1)**p1 * self._term(i) | 3a4dfd531db8dac31e06cd098aad418663c01af4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/3a4dfd531db8dac31e06cd098aad418663c01af4/root_system.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1365,
12,
2890,
16,
277,
16,
525,
16,
293,
21,
16,
293,
22,
4672,
309,
277,
480,
525,
30,
24927,
21,
13,
636,
84,
21,
380,
365,
6315,
6408,
12,
77,
13,
397,
24927,
21,
13,
636,
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,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1365,
12,
2890,
16,
277,
16,
525,
16,
293,
21,
16,
293,
22,
4672,
309,
277,
480,
525,
30,
24927,
21,
13,
636,
84,
21,
380,
365,
6315,
6408,
12,
77,
13,
397,
24927,
21,
13,
636,
8... |
self._repr = "VectorElement(%r, %r, %d, %d)" % \ (self._family, self._cell, self._degree, len(self._sub_elements)) | self._repr = "VectorElement(%r, %r, %s, %d)" % \ (self._family, self._cell, str(self._degree), len(self._sub_elements)) | def __init__(self, family, cell, degree, dim=None): "Create vector element (repeated mixed element)" | 104710cfc4335ecba9fb39af0d1f69788c14ad1e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/624/104710cfc4335ecba9fb39af0d1f69788c14ad1e/finiteelement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6755,
16,
2484,
16,
10782,
16,
2464,
33,
7036,
4672,
315,
1684,
3806,
930,
261,
266,
9061,
7826,
930,
2225,
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,
16,
6755,
16,
2484,
16,
10782,
16,
2464,
33,
7036,
4672,
315,
1684,
3806,
930,
261,
266,
9061,
7826,
930,
2225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if fn.endswith('/'): | if fn.endswith('/') or fn.endswith('\\'): | def unzip_file(self, filename, location, flatten=True): """Unzip the file (zip file located at filename) to the destination location""" if not os.path.exists(location): os.makedirs(location) zipfp = open(filename, 'rb') try: zip = zipfile.ZipFile(zipfp) leading = has_leading_dir(zip.namelist()) and flatten for name in zip.namelist(): data = zip.read(name) fn = name if leading: fn = split_leading_dir(name)[1] fn = os.path.join(location, fn) dir = os.path.dirname(fn) if not os.path.exists(dir): os.makedirs(dir) if fn.endswith('/'): # A directory if not os.path.exists(fn): os.makedirs(fn) else: fp = open(fn, 'wb') try: fp.write(data) finally: fp.close() finally: zipfp.close() | 5e08433978e72f5c1f94bcc8596d289079d9ece7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/5e08433978e72f5c1f94bcc8596d289079d9ece7/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20259,
67,
768,
12,
2890,
16,
1544,
16,
2117,
16,
5341,
33,
5510,
4672,
3536,
984,
4450,
326,
585,
261,
4450,
585,
13801,
622,
1544,
13,
358,
326,
2929,
2117,
8395,
309,
486,
1140,
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,
20259,
67,
768,
12,
2890,
16,
1544,
16,
2117,
16,
5341,
33,
5510,
4672,
3536,
984,
4450,
326,
585,
261,
4450,
585,
13801,
622,
1544,
13,
358,
326,
2929,
2117,
8395,
309,
486,
1140,
18,... |
self.rootitem = goocanvas.Group(parent = self.gcomprisBoard.canvas.get_root_item()) | self.rootitem = goocanvas.Group(parent = self.gcomprisBoard.canvas.get_root_item()) | def start(self): progname='tuxpaint' tuxpaint_dir = None flags = gobject.SPAWN_DO_NOT_REAP_CHILD | gobject.SPAWN_SEARCH_PATH | 646588d1df89f2ab93dd27ec51769450fdc785b6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11306/646588d1df89f2ab93dd27ec51769450fdc785b6/tuxpaint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
11243,
529,
2218,
88,
2616,
84,
1598,
11,
268,
2616,
84,
1598,
67,
1214,
273,
599,
2943,
273,
314,
1612,
18,
3118,
37,
5665,
67,
3191,
67,
4400,
67,
862,
2203,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
11243,
529,
2218,
88,
2616,
84,
1598,
11,
268,
2616,
84,
1598,
67,
1214,
273,
599,
2943,
273,
314,
1612,
18,
3118,
37,
5665,
67,
3191,
67,
4400,
67,
862,
2203,
6... |
if line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'per': | if line.category_id.contribute and line.category_id.amount_type == 'per': | def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids for slip in self.browse(cr, uid, ids): allow = 0.0 #for emp in emp_pool.browse(cr, uid, [vals['employee_id'][0]]): emp = slip.employee_id sql_req= ''' SELECT c.id as id, c.wage as wage, function as function FROM hr_contract c LEFT JOIN hr_employee emp on (c.employee_id=emp.id) LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id) LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id) WHERE (emp.id=%s) AND (date_start <= %s) AND (date_end IS NULL OR date_end >= %s) LIMIT 1 ''' cr.execute(sql_req, (emp.id, vals['date'], vals['date'])) contract_id = cr.dictfetchone() if not contract_id: continue contract = self.pool.get('hr.contract').browse(cr, uid, contract_id['id']) sal_type = contract.wage_type_id.type function = contract.function.id lines = [] if function: func = func_pool.read(cr, uid, function, ['line_ids']) lines = slip_line_pool.browse(cr, uid, func['line_ids']) | 9cefb7520803ded7f648633ccca30e623a0dd192 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/9cefb7520803ded7f648633ccca30e623a0dd192/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
8118,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
801,
84,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
351,
2817,
1340,
6134,
272,
3169,
67,
60... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
8118,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
801,
84,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
351,
2817,
1340,
6134,
272,
3169,
67,
60... |
3 | 3 | def chromatic_number(G): r""" Returns the minimal number of colors needed to color the vertices of the graph `G`. EXAMPLES:: sage: from sage.graphs.graph_coloring import chromatic_number sage: G = Graph({0:[1,2,3],1:[2]}) sage: chromatic_number(G) 3 sage: G = graphs.PetersenGraph() sage: G.chromatic_number() 3 """ o = G.order() if o == 0: return 0 if len(G.edges()) == 0: return 1 elif G.is_bipartite(): #can we do it in linear time? return 2 else: #counting cliques is faster than our brute-force method... m = G.clique_number() if m >= o-1: #marginal improvement... if there's an o-1 clique and not an o clique, don't waste our time coloring. return m for n in range(m,o+1): for C in all_graph_colorings(G,n): return n | 0d7c50e7966c0248757876bb79ed98d62c5f0550 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/0d7c50e7966c0248757876bb79ed98d62c5f0550/graph_coloring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8123,
2126,
67,
2696,
12,
43,
4672,
436,
8395,
2860,
326,
16745,
1300,
434,
5740,
3577,
358,
2036,
326,
6928,
434,
326,
2667,
1375,
43,
8338,
225,
5675,
8900,
11386,
2866,
225,
272,
410,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8123,
2126,
67,
2696,
12,
43,
4672,
436,
8395,
2860,
326,
16745,
1300,
434,
5740,
3577,
358,
2036,
326,
6928,
434,
326,
2667,
1375,
43,
8338,
225,
5675,
8900,
11386,
2866,
225,
272,
410,... |
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s view = self.fields_view_get(cr, uid, False, 'form', context=context) root = etree.fromstring(encode(view['arch'])) res = etree.XML("""<search string="%s"></search>""" % root.get("string", "")) node = etree.Element("group") res.append(node) fields = root.xpath("//field[@select=1]") | form_view = self.fields_view_get(cr, uid, False, 'form', context=context) tree_view = self.fields_view_get(cr, uid, False, 'tree', context=context) fields_to_search = set() fields = self.fields_get(cr, uid, context=context) | def __get_default_search_view(self, cr, uid, context=None): | e1663d72f86244644955f2074d50c8680c4e987f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/e1663d72f86244644955f2074d50c8680c4e987f/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
1886,
67,
3072,
67,
1945,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
1886,
67,
3072,
67,
1945,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
start = time.time() x = fmin_cg(rosen, x0, fprime=rosen_der, maxiter=80) print x times.append(time.time() - start) algor.append('Nonlinear CG\t') | def _scalarfunc(*params): params = squeeze(asarray(params)) return func(params,*args) | d00f433519cbe9ce0d4306fb9512ac79d655e1fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/d00f433519cbe9ce0d4306fb9512ac79d655e1fc/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8748,
644,
30857,
2010,
4672,
859,
273,
17173,
12,
345,
1126,
12,
2010,
3719,
327,
1326,
12,
2010,
16,
14,
1968,
13,
225,
2,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8748,
644,
30857,
2010,
4672,
859,
273,
17173,
12,
345,
1126,
12,
2010,
3719,
327,
1326,
12,
2010,
16,
14,
1968,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.logger.debug('Connection shutting down (%s:%d)', self._addr[0], self._addr[1]) | if len(self._addr) == 2: self.logger.debug('Connection shutting down (%s:%d)', self._addr[0], self._addr[1]) | def run(self): self.logger.debug('Connection starting up (%s:%d)', self._addr[0], self._addr[1]) | b8be54f18c2a37e9184784f912f37b0ae6972706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7624/b8be54f18c2a37e9184784f912f37b0ae6972706/scgi_base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
4901,
18,
4148,
2668,
1952,
5023,
731,
6142,
87,
5319,
72,
13,
2187,
365,
6315,
4793,
63,
20,
6487,
365,
6315,
4793,
63,
21,
5717,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
4901,
18,
4148,
2668,
1952,
5023,
731,
6142,
87,
5319,
72,
13,
2187,
365,
6315,
4793,
63,
20,
6487,
365,
6315,
4793,
63,
21,
5717,
2,
-100,
-100,
-100,
... |
if v == None: r[key] = False if key in self._columns.keys(): type = self._columns[key]._type elif key in self._inherit_fields.keys(): type = self._inherit_fields[key][2]._type | if key in self._columns: column = self._columns[key] elif key in self._inherit_fields: column = self._inherit_fields[key][2] | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ Read records with given ids with the given fields | 5b146e80623363f66d775fb7088daa02a541a9d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b146e80623363f66d775fb7088daa02a541a9d7/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
1466,
33,
7036,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
3536,
2720,
3853,
598,
864,
3258,
598,
326,
864,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
855,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
1466,
33,
7036,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
3536,
2720,
3853,
598,
864,
3258,
598,
326,
864,
... |
result = {} picture = self.guess_directory_picture(subdir) if picture is not None: result['album_picture'] = picture | if not result.has_key('album_picture'): picture = self.guess_directory_picture(subdir) if picture is not None: result['album_picture'] = picture if result.has_key('album_picture'): result['album_picture'] = result['album_picture'].replace('.', '_thumb.') | def get_directory_metadata(self, subdir = None): ''' Returns directory meta data. First tries to parse known formats and then fall backs to built in defaults. ''' try: result = self.get_matew_directory_metadata(subdir) return result except NoMetadata: pass | 0072aa3fcb21238a79a805652e0dd4ec982a2bd5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4663/0072aa3fcb21238a79a805652e0dd4ec982a2bd5/lazygal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5149,
67,
4165,
12,
2890,
16,
16921,
273,
599,
4672,
9163,
2860,
1867,
2191,
501,
18,
5783,
9327,
358,
1109,
4846,
6449,
471,
1508,
4159,
1473,
87,
358,
6650,
316,
3467,
18,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5149,
67,
4165,
12,
2890,
16,
16921,
273,
599,
4672,
9163,
2860,
1867,
2191,
501,
18,
5783,
9327,
358,
1109,
4846,
6449,
471,
1508,
4159,
1473,
87,
358,
6650,
316,
3467,
18,
9... |
def updateVersions(version, workingDir): client = get_svn_conn() client.checkout(svnBase + "/tags/" + version, localTagsDir + '/' + version) | def updateVersions(version, workingDir, trunkDir, test = False): if test: shutil.copytree(trunkDir, workingDir) else: client = get_svn_conn() client.checkout(svnBase + "/tags/" + version, workingDir) | def updateVersions(version, workingDir): client = get_svn_conn() client.checkout(svnBase + "/tags/" + version, localTagsDir + '/' + version) pomsToPatch = get_poms_to_patch(workingDir) for pom in pomsToPatch: patch(pom, version) ## Now look for Version.java version_bytes = '{' for ch in version: if not ch == ".": version_bytes += "'%s', " % ch version_bytes = version_bytes[:-2] version_bytes += "}" version_java = workingDir + "/core/src/main/java/org/infinispan/Version.java" f_in = open(version_java) f_out = open(version_java+".tmp", "w") try: for l in f_in: if l.find("static final byte[] version_id = ") > -1: l = re.sub('version_id = .*;', 'version_id = ' + version_bytes + ';', l) else: if l.find("public static final String version =") > -1: l = re.sub('version = "[A-Z0-9\.]*";', 'version = "' + version + '";', l) f_out.write(l) finally: f_in.close() f_out.close() os.rename(version_java+".tmp", version_java) # Now make sure this goes back into SVN. checkInMessage = "Infinispan Release Script: Updated version numbers" client.checkin(workingDir, checkInMessage) | 9fc43e2136f3e38733f93df7b17599075f1fadbd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14175/9fc43e2136f3e38733f93df7b17599075f1fadbd/release.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
5940,
12,
1589,
16,
5960,
1621,
16,
25917,
1621,
16,
1842,
273,
1083,
4672,
309,
1842,
30,
11060,
18,
3530,
3413,
12,
26133,
1621,
16,
5960,
1621,
13,
469,
30,
1004,
273,
336,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
5940,
12,
1589,
16,
5960,
1621,
16,
25917,
1621,
16,
1842,
273,
1083,
4672,
309,
1842,
30,
11060,
18,
3530,
3413,
12,
26133,
1621,
16,
5960,
1621,
13,
469,
30,
1004,
273,
336,
67... |
class DLLHandleCache( object ): def __init__( self ): | class DLLHandleCache(object): def __init__(self): | def GetTZCapabilities(): """Run a few known tests to determine the capabilities of the time zone database on this machine. Note Dynamic Time Zone support is not available on any platform at this time; this is a limitation of this library, not the platform.""" tzi = TimeZoneInfo( 'Mountain Standard Time' ) MissingTZPatch = datetime.datetime( 2007,11,2,tzinfo=tzi ).utctimetuple() != (2007,11,2,6,0,0,4,306,0) DynamicTZSupport = not MissingTZPatch and datetime.datetime( 2003,11,2,tzinfo=tzi).utctimetuple() == (2003,11,2,7,0,0,6,306,0) del tzi return vars() | 59648a863c896e2f14363d0c28a25b3865360d9a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/992/59648a863c896e2f14363d0c28a25b3865360d9a/win32timezone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
21647,
14012,
13332,
3536,
1997,
279,
11315,
4846,
7434,
358,
4199,
326,
12359,
434,
326,
813,
4157,
2063,
603,
333,
5228,
18,
3609,
12208,
2647,
10912,
2865,
353,
486,
2319,
603,
128... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21647,
14012,
13332,
3536,
1997,
279,
11315,
4846,
7434,
358,
4199,
326,
12359,
434,
326,
813,
4157,
2063,
603,
333,
5228,
18,
3609,
12208,
2647,
10912,
2865,
353,
486,
2319,
603,
128... |
self._check() if not self._loaded: self._load() return self.membernames | return [tarinfo.name for tarinfo in self.getmembers()] | def getnames(self): """Return the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). """ self._check() if not self._loaded: self._load() return self.membernames | c23c3ef50067bbfc7538d3ea9d8f68f85cf0f577 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c23c3ef50067bbfc7538d3ea9d8f68f85cf0f577/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1973,
12,
2890,
4672,
3536,
990,
326,
4833,
434,
326,
5052,
487,
279,
666,
434,
3675,
1257,
18,
2597,
711,
326,
1967,
1353,
487,
326,
666,
2106,
635,
336,
7640,
7675,
3536,
365,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1973,
12,
2890,
4672,
3536,
990,
326,
4833,
434,
326,
5052,
487,
279,
666,
434,
3675,
1257,
18,
2597,
711,
326,
1967,
1353,
487,
326,
666,
2106,
635,
336,
7640,
7675,
3536,
365,
6... |
s_input = [scalar.Scalar(x.dtype).make_variable() for x in i.owner.inputs] | def local_elemwise_fusion(node): """ As part of specialisation, we fusion two consecutif elemwise op of the same shape. For mixed dtype, we let the Compise op do the cast. It let the C compile do the cast. The number of dimension is validated at call time by theano itself. TODO:The broadcast flag? """ | 11fdf48345d5eeb4344ddd0f53ef1ba583192f0e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/11fdf48345d5eeb4344ddd0f53ef1ba583192f0e/opt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
10037,
2460,
67,
74,
7063,
12,
2159,
4672,
3536,
2970,
1087,
434,
4582,
10742,
16,
732,
25944,
2795,
356,
15166,
430,
3659,
2460,
1061,
434,
326,
1967,
2179,
18,
225,
2457,
782... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
10037,
2460,
67,
74,
7063,
12,
2159,
4672,
3536,
2970,
1087,
434,
4582,
10742,
16,
732,
25944,
2795,
356,
15166,
430,
3659,
2460,
1061,
434,
326,
1967,
2179,
18,
225,
2457,
782... | |
help="If true, upload incremental json results to server."), | help="If true, upload full json results to server."), | def parse_args(args=None): """Provides a default set of command line args. Returns a tuple of options, args from optparse""" # FIXME: All of these options should be stored closer to the code which # FIXME: actually uses them. configuration_options should move # FIXME: to WebKitPort and be shared across all scripts. configuration_options = [ optparse.make_option("-t", "--target", dest="configuration", help="(DEPRECATED)"), # FIXME: --help should display which configuration is default. optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'), optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'), # old-run-webkit-tests also accepts -c, --configuration CONFIGURATION. ] print_options = printing.print_options() # FIXME: These options should move onto the ChromiumPort. chromium_options = [ optparse.make_option("--chromium", action="store_true", default=False, help="use the Chromium port"), optparse.make_option("--startup-dialog", action="store_true", default=False, help="create a dialog on DumpRenderTree startup"), optparse.make_option("--gp-fault-error-box", action="store_true", default=False, help="enable Windows GP fault error box"), optparse.make_option("--nocheck-sys-deps", action="store_true", default=False, help="Don't check the system dependencies (themes)"), optparse.make_option("--use-drt", action="store_true", default=False, help="Use DumpRenderTree instead of test_shell"), ] # Missing Mac-specific old-run-webkit-tests options: # FIXME: Need: -g, --guard for guard malloc support on Mac. # FIXME: Need: -l --leaks Enable leaks checking. # FIXME: Need: --sample-on-timeout Run sample on timeout old_run_webkit_tests_compat = [ # NRWT doesn't generate results by default anyway. _compat_shim_option("--no-new-test-results"), # NRWT doesn't sample on timeout yet anyway. _compat_shim_option("--no-sample-on-timeout"), # FIXME: NRWT needs to support remote links eventually. _compat_shim_option("--use-remote-links-to-tests"), # FIXME: NRWT doesn't need this option as much since failures are # designed to be cheap. We eventually plan to add this support. _compat_shim_option("--exit-after-n-failures", nargs=1, type="int"), ] results_options = [ # NEED for bots: --use-remote-links-to-tests Link to test files # within the SVN repository in the results. optparse.make_option("-p", "--pixel-tests", action="store_true", dest="pixel_tests", help="Enable pixel-to-pixel PNG comparisons"), optparse.make_option("--no-pixel-tests", action="store_false", dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"), optparse.make_option("--fuzzy-pixel-tests", action="store_true", default=False, help="Also use fuzzy matching to compare pixel test outputs."), # old-run-webkit-tests allows a specific tolerance: --tolerance t # Ignore image differences less than this percentage (default: 0.1) optparse.make_option("--results-directory", default="layout-test-results", help="Output results directory source dir, relative to Debug or " "Release"), optparse.make_option("--new-baseline", action="store_true", default=False, help="Save all generated results as new baselines " "into the platform directory, overwriting whatever's " "already there."), optparse.make_option("--reset-results", action="store_true", default=False, help="Reset any existing baselines to the " "generated results"), optparse.make_option("--no-show-results", action="store_false", default=True, dest="show_results", help="Don't launch a browser with results after the tests " "are done"), # FIXME: We should have a helper function to do this sort of # deprectated mapping and automatically log, etc. optparse.make_option("--noshow-results", action="store_false", dest="show_results", help="Deprecated, same as --no-show-results."), optparse.make_option("--no-launch-safari", action="store_false", dest="show_results", help="old-run-webkit-tests compat, same as --noshow-results."), # old-run-webkit-tests: # --[no-]launch-safari Launch (or do not launch) Safari to display # test results (default: launch) optparse.make_option("--full-results-html", action="store_true", default=False, help="Show all failures in results.html, rather than only " "regressions"), optparse.make_option("--clobber-old-results", action="store_true", default=False, help="Clobbers test results from previous runs."), optparse.make_option("--platform", help="Override the platform for expected results"), # old-run-webkit-tests also has HTTP toggle options: # --[no-]http Run (or do not run) http tests # (default: run) # --[no-]wait-for-httpd Wait for httpd if some other test # session is using it already (same # as WEBKIT_WAIT_FOR_HTTPD=1). # (default: 0) ] test_options = [ optparse.make_option("--build", dest="build", action="store_true", default=True, help="Check to ensure the DumpRenderTree build is up-to-date " "(default)."), optparse.make_option("--no-build", dest="build", action="store_false", help="Don't check to see if the " "DumpRenderTree build is up-to-date."), # old-run-webkit-tests has --valgrind instead of wrapper. optparse.make_option("--wrapper", help="wrapper command to insert before invocations of " "DumpRenderTree; option is split on whitespace before " "running. (Example: --wrapper='valgrind --smc-check=all')"), # old-run-webkit-tests: # -i|--ignore-tests Comma-separated list of directories # or tests to ignore optparse.make_option("--test-list", action="append", help="read list of tests to run from file", metavar="FILE"), # old-run-webkit-tests uses --skipped==[default|ignore|only] # instead of --force: optparse.make_option("--force", action="store_true", default=False, help="Run all tests, even those marked SKIP in the test list"), optparse.make_option("--use-apache", action="store_true", default=False, help="Whether to use apache instead of lighttpd."), optparse.make_option("--time-out-ms", help="Set the timeout for each test"), # old-run-webkit-tests calls --randomize-order --random: optparse.make_option("--randomize-order", action="store_true", default=False, help=("Run tests in random order (useful " "for tracking down corruption)")), optparse.make_option("--run-chunk", help=("Run a specified chunk (n:l), the nth of len l, " "of the layout tests")), optparse.make_option("--run-part", help=("Run a specified part (n:m), " "the nth of m parts, of the layout tests")), # old-run-webkit-tests calls --batch-size: --nthly n # Restart DumpRenderTree every n tests (default: 1000) optparse.make_option("--batch-size", help=("Run a the tests in batches (n), after every n tests, " "DumpRenderTree is relaunched.")), # old-run-webkit-tests calls --run-singly: -1|--singly # Isolate each test case run (implies --nthly 1 --verbose) optparse.make_option("--run-singly", action="store_true", default=False, help="run a separate DumpRenderTree for each test"), optparse.make_option("--child-processes", help="Number of DumpRenderTrees to run in parallel."), # FIXME: Display default number of child processes that will run. optparse.make_option("--experimental-fully-parallel", action="store_true", default=False, help="run all tests in parallel"), # FIXME: Need --exit-after-n-failures N # Exit after the first N failures instead of running all tests # FIXME: Need --exit-after-n-crashes N # Exit after the first N crashes instead of running all tests # FIXME: consider: --iterations n # Number of times to run the set of tests (e.g. ABCABCABC) optparse.make_option("--print-last-failures", action="store_true", default=False, help="Print the tests in the last run that " "had unexpected failures (or passes)."), optparse.make_option("--retest-last-failures", action="store_true", default=False, help="re-test the tests in the last run that " "had unexpected failures (or passes)."), optparse.make_option("--retry-failures", action="store_true", default=True, help="Re-try any tests that produce unexpected results (default)"), optparse.make_option("--no-retry-failures", action="store_false", dest="retry_failures", help="Don't re-try any tests that produce unexpected results."), ] misc_options = [ optparse.make_option("--lint-test-files", action="store_true", default=False, help=("Makes sure the test files parse for all " "configurations. Does not run any tests.")), ] # FIXME: Move these into json_results_generator.py results_json_options = [ optparse.make_option("--builder-name", default="DUMMY_BUILDER_NAME", help=("The name of the builder shown on the waterfall running " "this script e.g. WebKit.")), optparse.make_option("--build-name", default="DUMMY_BUILD_NAME", help=("The name of the builder used in its path, e.g. " "webkit-rel.")), optparse.make_option("--build-number", default="DUMMY_BUILD_NUMBER", help=("The build number of the builder running this script.")), optparse.make_option("--test-results-server", default="", help=("If specified, upload results json files to this appengine " "server.")), optparse.make_option("--upload-incremental-results", action="store_true", default=False, help="If true, upload incremental json results to server."), ] option_list = (configuration_options + print_options + chromium_options + results_options + test_options + misc_options + results_json_options + old_run_webkit_tests_compat) option_parser = optparse.OptionParser(option_list=option_list) options, args = option_parser.parse_args(args) if options.sources: options.verbose = True return options, args | e6afcf5a4b45e7e9c43171afdc0e8781dfbbdcdf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/e6afcf5a4b45e7e9c43171afdc0e8781dfbbdcdf/run_webkit_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1968,
12,
1968,
33,
7036,
4672,
3536,
17727,
279,
805,
444,
434,
1296,
980,
833,
18,
225,
2860,
279,
3193,
434,
702,
16,
833,
628,
2153,
2670,
8395,
225,
468,
9852,
30,
4826,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1968,
12,
1968,
33,
7036,
4672,
3536,
17727,
279,
805,
444,
434,
1296,
980,
833,
18,
225,
2860,
279,
3193,
434,
702,
16,
833,
628,
2153,
2670,
8395,
225,
468,
9852,
30,
4826,... |
DEBUG: Expectations only apply when running the debug build. | DEBUG: Expectations apply only to the debug build. RELEASE: Expectations apply only to release build. | def StripComments(line): """Strips comments from a line and return None if the line is empty or else the contents of line with leading and trailing spaces removed and all other whitespace collapsed""" commentIndex = line.find('//') if commentIndex is -1: commentIndex = len(line) line = re.sub(r'\s+', ' ', line[:commentIndex].strip()) if line == '': return None else: return line | 26af87d20e2ea76d93214918d8f93f9fd8304056 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9392/26af87d20e2ea76d93214918d8f93f9fd8304056/test_expectations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15589,
9051,
12,
1369,
4672,
3536,
1585,
7146,
5678,
628,
279,
980,
471,
327,
599,
309,
326,
980,
353,
1008,
578,
469,
326,
2939,
434,
980,
598,
7676,
471,
7341,
7292,
3723,
471,
777,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15589,
9051,
12,
1369,
4672,
3536,
1585,
7146,
5678,
628,
279,
980,
471,
327,
599,
309,
326,
980,
353,
1008,
578,
469,
326,
2939,
434,
980,
598,
7676,
471,
7341,
7292,
3723,
471,
777,
... |
Returns an iterator for Dyck words with ``k1`` opening and ``k2`` closing parentheses. | Returns an iterator for Dyck words with ``k1`` opening and ``k2`` closing parentheses. | def __iter__(self): r""" Returns an iterator for Dyck words with ``k1`` opening and ``k2`` closing parentheses. EXAMPLES:: sage: [ w for w in DyckWords(0) ] [[]] sage: [ w for w in DyckWords(1) ] [[1, 0]] sage: [ w for w in DyckWords(2) ] [[1, 0, 1, 0], [1, 1, 0, 0]] sage: len([ 'x' for _ in DyckWords(5) ]) 42 """ if self.k1 == 0: yield DyckWord_class([]) elif self.k2 == 0: yield DyckWord_class([ open_symbol for _ in range(self.k1) ]) else: for w in DyckWordBacktracker(self.k1, self.k2): yield DyckWord_class(w) | 58987736f0b32e9cfa39285a2b0af054cbaf4453 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/58987736f0b32e9cfa39285a2b0af054cbaf4453/dyck_word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
436,
8395,
2860,
392,
2775,
364,
463,
93,
363,
4511,
598,
12176,
79,
21,
10335,
10890,
471,
12176,
79,
22,
10335,
7647,
27888,
18,
225,
5675,
8900,
11386... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
436,
8395,
2860,
392,
2775,
364,
463,
93,
363,
4511,
598,
12176,
79,
21,
10335,
10890,
471,
12176,
79,
22,
10335,
7647,
27888,
18,
225,
5675,
8900,
11386... |
print "Debug M: "+ str(text.encode('utf-8')) | print "Debug M: "+ text | def debug(text, level=DEBUG_LOW): "Prints a text in the terminal if the debug level is higher than the requested" try: if level <= debug_level: if level == DEBUG_LOW: print "Debug L: "+ str(text.encode('utf-8')) if level == DEBUG_MEDIUM: print "Debug M: "+ str(text.encode('utf-8')) if level == DEBUG_HIGH: print "Debug H: "+ str(text.encode('utf-8')) except: print_error("Can't print debug message") | 990f55bf193b984bc987e2c88e849aae26422f8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6139/990f55bf193b984bc987e2c88e849aae26422f8b/TFglobals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
955,
16,
1801,
33,
9394,
67,
4130,
4672,
315,
15402,
279,
977,
316,
326,
8651,
309,
326,
1198,
1801,
353,
10478,
2353,
326,
3764,
6,
775,
30,
309,
1801,
1648,
1198,
67,
2815,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
955,
16,
1801,
33,
9394,
67,
4130,
4672,
315,
15402,
279,
977,
316,
326,
8651,
309,
326,
1198,
1801,
353,
10478,
2353,
326,
3764,
6,
775,
30,
309,
1801,
1648,
1198,
67,
2815,... |
super(set, self).__init__() | super(NGram, self).__init__() | def __init__(self, items=[], threshold=0.0, warp=1.0, iconv=None, N=3, pad_len=None, pad_char='$', qconv=None): super(set, self).__init__() if not (0 <= threshold <= 1): raise ValueError("Threshold %s outside 0.0 to 1.0 range" % threshold) if not(1.0 <= warp <= 3.0): raise ValueError("Warp %s outside 1.0 to 3.0 range" % warp) if not N >= 1: raise ValueError("N of %s needs to be >= 1" % N) if pad_len is None: pad_len = N-1 if not (0 <= pad_len < N): raise ValueError("pad_len of %s is outside 0 to %d range" % (pad_len,N)) if not (isinstance(pad_char,basestring) and len(pad_char)==1): raise ValueError("pad_char %s is not a single-character string." % pad_char) if not (iconv is None or hasattr(iconv, "__call__")): raise ValueError("iconv %s is not a function." % pad_char) if not (qconv is None or hasattr(qconv, "__call__")): raise ValueError("qconv %s is not a function." % pad_char) self.threshold = threshold self.warp = warp self.N = N self._pad_len = pad_len self._pad_char = pad_char self._padding = pad_char * pad_len # derive a padding string def identity(x): return x self.iconv = iconv or identity self.qconv = qconv or identity self._grams = {} self.length = {} self.update(items) | 511eb150195b7a874376841e707f0d58e0cac66d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12095/511eb150195b7a874376841e707f0d58e0cac66d/ngram.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1516,
22850,
6487,
5573,
33,
20,
18,
20,
16,
341,
11441,
33,
21,
18,
20,
16,
21567,
33,
7036,
16,
423,
33,
23,
16,
4627,
67,
1897,
33,
7036,
16,
4627... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1516,
22850,
6487,
5573,
33,
20,
18,
20,
16,
341,
11441,
33,
21,
18,
20,
16,
21567,
33,
7036,
16,
423,
33,
23,
16,
4627,
67,
1897,
33,
7036,
16,
4627... |
"Door template", "Automatic door template", "Scaling zone", "Light zone", \ | "Door template", \ | def create_project(self, templ, name, folder): proj = CProject() wx.GetApp().artub_frame.project = proj proj.name = name proj.project_path = folder proj.normname = name | 160af4999f26c82116d4f06bd713b71fd74d4648 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8143/160af4999f26c82116d4f06bd713b71fd74d4648/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4406,
12,
2890,
16,
13988,
16,
508,
16,
3009,
4672,
10296,
273,
385,
4109,
1435,
7075,
18,
967,
3371,
7675,
485,
373,
67,
3789,
18,
4406,
273,
10296,
10296,
18,
529,
273,
508,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4406,
12,
2890,
16,
13988,
16,
508,
16,
3009,
4672,
10296,
273,
385,
4109,
1435,
7075,
18,
967,
3371,
7675,
485,
373,
67,
3789,
18,
4406,
273,
10296,
10296,
18,
529,
273,
508,... |
raise ParseError() | raise ParseError("Bad class definition line") | def process_classdef(line, parent_docs, prev_line_doc, lineno, comments, decorators): """ The line handler for class declaration lines, such as: >>> class Foo(Bar, Baz): This handler creates and initializes a new C{VariableDoc} containing a C{ClassDoc}, adds the C{VariableDoc} to the containing namespace, and returns the C{ClassDoc}. """ # Check syntax if len(line)<3 or len(line)>4 or line[-1] != (token.OP, ':'): raise ParseError() # If we're not in a namespace, then ignore it. parent_doc = parent_docs[-1] if not isinstance(parent_doc, NamespaceDoc): return # Get the class's name class_name = parse_name(line[1]) canonical_name = DottedName(parent_doc.canonical_name, class_name) # Create the class's ClassDoc & VariableDoc. class_doc = ClassDoc(variables={}, sort_spec=[], bases=[], subclasses=[], canonical_name=canonical_name) var_doc = VariableDoc(name=class_name, value=class_doc, is_imported=False, is_alias=False) # Add the bases. if len(line) == 4: if (not isinstance(line[2], list) or line[2][0] != (token.OP, '(')): raise ParseError() try: for base in parse_classdef_bases(line[2]): base_doc = lookup_value(base, parent_docs) if base_doc is None: # [XX] This might be a problem?? base_doc = ClassDoc(variables={}, sort_spec=[], bases=[], subclasses=[], imported_from = base) class_doc.bases.append(base_doc) except ParseError: class_doc.bases = UNKNOWN else: class_doc.bases = [] # Register ourselves as a subclass to our bases. if class_doc.bases is not UNKNOWN: for basedoc in class_doc.bases: if isinstance(basedoc, ClassDoc): basedoc.subclasses.append(class_doc) # If the preceeding comment includes a docstring, then add it. add_docstring_from_comments(class_doc, comments) # Add the VariableDoc to our container. set_variable(parent_doc, var_doc) return class_doc | 76aa87c4f3f84f87b6c947e3387d535503259a2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/76aa87c4f3f84f87b6c947e3387d535503259a2a/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1106,
536,
12,
1369,
16,
982,
67,
8532,
16,
2807,
67,
1369,
67,
2434,
16,
7586,
16,
5678,
16,
19423,
4672,
3536,
1021,
980,
1838,
364,
667,
8266,
2362,
16,
4123,
487,
30,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1106,
536,
12,
1369,
16,
982,
67,
8532,
16,
2807,
67,
1369,
67,
2434,
16,
7586,
16,
5678,
16,
19423,
4672,
3536,
1021,
980,
1838,
364,
667,
8266,
2362,
16,
4123,
487,
30,
2... |
sage: sr = mq.SR(1,1,1,4, allow_zero_inversions=True) | sage: sr = mq.SR(1, 1, 1, 4, allow_zero_inversions=True) | def sub_byte(self, b): """ Perform SubByte on a single byte/halfbyte b. | e506ccc2459e6e3948659b0d1b28d9d6b70342e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e506ccc2459e6e3948659b0d1b28d9d6b70342e4/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
67,
7229,
12,
2890,
16,
324,
4672,
3536,
11217,
2592,
3216,
603,
279,
2202,
1160,
19,
20222,
7229,
324,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
67,
7229,
12,
2890,
16,
324,
4672,
3536,
11217,
2592,
3216,
603,
279,
2202,
1160,
19,
20222,
7229,
324,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
different instances. This is useful when you want to load a model once several times before parenting each instance somewhere, or when you want to load a model and immediately set a transform on it. But also consider loadModelCopy(). """ Loader.notify.debug("Loading model once: %s under %s" % (modelPath, nodeName)) | different instances. underNode may be either a node name, or a NodePath or a Node to an already-existing node. This is useful when you want to load a model once several times before parenting each instance somewhere, or when you want to load a model and immediately set a transform on it. But also consider loadModelCopy(). """ Loader.notify.debug("Loading model once: %s under %s" % (modelPath, underNode)) | def loadModelOnceUnder(self, modelPath, nodeName): """loadModelOnceUnder(self, string, string) Behaves like loadModelOnce, but also implicitly creates a new node to attach the model under, which helps to differentiate different instances. This is useful when you want to load a model once several times before parenting each instance somewhere, or when you want to load a model and immediately set a transform on it. But also consider loadModelCopy(). """ | 4f4939dd81bf21b05e784b73681dfd55bf721fb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/4f4939dd81bf21b05e784b73681dfd55bf721fb6/Loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
1488,
12212,
14655,
12,
2890,
16,
938,
743,
16,
7553,
4672,
3536,
945,
1488,
12212,
14655,
12,
2890,
16,
533,
16,
533,
13,
4823,
76,
6606,
3007,
1262,
1488,
12212,
16,
1496,
2546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
1488,
12212,
14655,
12,
2890,
16,
938,
743,
16,
7553,
4672,
3536,
945,
1488,
12212,
14655,
12,
2890,
16,
533,
16,
533,
13,
4823,
76,
6606,
3007,
1262,
1488,
12212,
16,
1496,
2546,
... |
snps_within_this_region = self.findSNPsInRegion(snp_info, this_snp.chromosome, this_snp.position, this_snp.stop) snps_within_this_region_snpData = self.findSNPsInRegion(snpData, this_snp.chromosome, this_snp.position, this_snp.stop) | snps_within_this_region = cls.findSNPsInRegion(snp_info, this_snp.chromosome, this_snp.position, this_snp.stop) snps_within_this_region_snpData = cls.findSNPsInRegion(snpData, this_snp.chromosome, this_snp.position, this_snp.stop) | def drawRegionAroundThisSNP(self, phenotype_method_id, this_snp, candidate_gene_set, gene_annotation, snp_info, analysis_method_id2gwr, \ LD_info, output_dir, which_LD_statistic, snp_region=None, min_distance=40000, list_type_id=None, label_gene=0, draw_LD_relative_to_center_SNP=0, commit=0, snpData=None, phenData=None, ecotype_info=None,\ snpData_before_impute=None, snp_matrix_data_type=1): """ 2009-4-30 deal with argument snp_matrix_data_type =4 (arbitrary non-diallelic SNP matrix) could handle both (chr,pos) and (chr,pos,offset) SNP representation skip drawing gene models if no SNPs in the region at all. return None if no SNPs are found in the region. 2009-3-23 add arguments snp_matrix_data_type to allow CNV or CNV amplitude to fill the SNP matrix 2008-12-01 add option snpData_before_impute 2008-11-30 add code to replace axe_LD with axe_strain_pca, axe_snp_matrix, axe_map to demonstrate the haplotype structure, phenotype and geographic source of strains. 2008-10-24 handle option commit to return png_data & svg_data 2008-10-01 remove the frame of ax1 and add a grid to ax1 leave axe_gene_model's xticks there as otherwise ax1's xticks will go with it as they share xticks. 2008-10-01 draw gene models on a separate axe, add a twinx axe to draw LD w.r.t the center SNP if output_dir is not a directory, it's treated as a filename. 2008-09-24 """ sys.stderr.write("Drawing region ... \n") phenotype = Stock_250kDB.PhenotypeMethod.get(phenotype_method_id) if not os.path.isdir(output_dir): output_fname_prefix = output_dir else: #list_type = Stock_250kDB.GeneListType.get(list_type_id) fname_basename = 'snp_%s_%s_id_%s_phenotype_%s_%s'%\ (this_snp.chromosome, this_snp.position, this_snp.snps_id, phenotype.id, phenotype.short_name) fname_basename = fname_basename.replace('/', '_') output_fname_prefix = os.path.join(output_dir, fname_basename) if snp_region: snps_within_this_region = snp_region elif getattr(this_snp, 'stop', None): snps_within_this_region = self.findSNPsInRegion(snp_info, this_snp.chromosome, this_snp.position, this_snp.stop) snps_within_this_region_snpData = self.findSNPsInRegion(snpData, this_snp.chromosome, this_snp.position, this_snp.stop) else: snps_within_this_region = self.getSNPsAroundThisSNP(this_snp, snp_info, min_distance) snps_within_this_region_snpData = snps_within_this_region if len(snps_within_this_region.chr_pos_ls)==0 and len(snps_within_this_region_snpData.chr_pos_ls)==0: return None pylab.clf() #fig = pylab.figure() axe_y_offset1 = 0.05 #y_offset for axe_LD, axe_strain_pca, axe_phenotype, axe_map axe_height1 = 0.55 #height of axe_LD or axe_snp_matrix axe_y_offset2 = axe_y_offset1+axe_height1 axe_height2 = 0.1 #height of axe_gene_model axe_y_offset3 = axe_y_offset2+axe_height2 axe_height3 = 0.25 #height of ax1 axe_y_offset4 = axe_y_offset3+axe_height3 axe_x_offset1 = 0.02 # axe_width1 = 0.2 #width of axe_strain_pca axe_x_offset2 = axe_x_offset1 + axe_width1 axe_width2 = 0.55 #width of ax1, axe_LD, or axe_snp_matrix axe_x_offset3 = axe_x_offset2 + axe_width2 axe_width3 = 0.02 #width of axe_phenotype axe_x_offset4 = axe_x_offset3 + axe_width3 axe_width4 = 0.2 #width of axe_map, axe_map_frame axe_x_offset5 = axe_x_offset4 + axe_width4 no_of_axes_drawn = 0 ax1 = pylab.axes([axe_x_offset2, axe_y_offset3, axe_width2, axe_height3], frameon=False) #left gap, bottom gap, width, height, axes for pvalue, gene models ax1.grid(True, alpha=0.3) ax1.set_xticklabels([]) #remove xtick labels on ax1 because axe_LD's xtick labels cover this. axe_LD_center_SNP = pylab.twinx() #axes for LD with center SNP, copy ax1's axe_LD_center_SNP.set_xticklabels([]) axe_gene_model = pylab.axes([axe_x_offset2, axe_y_offset2, axe_width2, axe_height2], frameon=False, sharex=ax1) #axe_gene_model.set_xticks([]) #this will set ax1's xticks off as well because the x-axis is shared. axe_gene_model.set_yticks([]) snp_region_tup = [snps_within_this_region_snpData.chr_pos_ls[0][0], snps_within_this_region_snpData.chr_pos_ls[0][1],\ snps_within_this_region_snpData.chr_pos_ls[-1][0], snps_within_this_region_snpData.chr_pos_ls[-1][1]] axe_snp_matrix_margin = abs(snp_region_tup[3]-snp_region_tup[1])/15. #offset to push strain labels on even rows further right if LD_info: axe_LD = pylab.axes([axe_x_offset2, axe_y_offset1, axe_width2, axe_height1], frameon=False) #axes for LD axe_LD_legend = pylab.axes([axe_x_offset3-0.1, axe_y_offset1+0.03, 0.1, 0.13], frameon=False) #axes for the legend of LD axe_LD_legend.set_xticks([]) axe_LD_legend.set_yticks([]) axe_to_put_pvalue_legend = axe_LD legend_loc = 'lower left' axe_pvalue_xlim = [snp_region_tup[1]-axe_snp_matrix_margin, snp_region_tup[3]+axe_snp_matrix_margin] elif snpData: phenotype_col_index = PlotGroupOfSNPs.findOutWhichPhenotypeColumn(phenData, Set([phenotype_method_id]))[0] genome_wide_result = analysis_method_id2gwr.get(1) if not genome_wide_result: sys.stderr.write("No genome association results for phenotype_method_id=%s, analysis_method_id=%s. Take a random one out of analysis_method_id2gwr.\n"%\ (phenotype_method_id, 1)) genome_wide_result = analysis_method_id2gwr.values()[0] #take random gwr if snp_matrix_data_type==1: chr_pos_ls = None else: chr_pos_ls = snpData.chr_pos2index.keys() #2008-12-08 for CNV probes. use snpData.chr_pos2index.keys() to locate top_snp_data because here snpData doesn't match genome_wide_result. top_snp_data = self.getTopSNPData(genome_wide_result, None, snp_region_tup, chr_pos_ls=chr_pos_ls) if snp_matrix_data_type==3: #2009-3-23 for CNV amplitude data, don't convert alleles into binary 0/1=major/minor form and use allele/amplitude to determine alpha need_convert_alleles2binary = False useAlleleToDetermineAlpha = True elif snp_matrix_data_type==4: #2009-3-27, for arbitrary non-diallelic SNP matrix need_convert_alleles2binary = False useAlleleToDetermineAlpha = False else: need_convert_alleles2binary = True useAlleleToDetermineAlpha = False subSNPData = self.getSubStrainSNPMatrix(snpData, phenData, phenotype_method_id, phenotype_col_index, top_snp_data.snp_id_ls, need_convert_alleles2binary=need_convert_alleles2binary) #2009-3-23 last argument is for CNV intensity matrix snp_value2color = None if snp_matrix_data_type==4: ##2009-3-27 it's for SNP matrix inferred from raw sequences, might have >2 alleles, heterozygous calls, deletions etc. from DrawSNPMatrix import DrawSNPMatrix subSNPData.data_matrix = DrawSNPMatrix.transformMatrixIntoTwoAllelesAndHetero(subSNPData.data_matrix) snp_value2color = self.snp_value2five_color #the two offsets below decides where the label of strains/snps should start in axe_snp_matrix last_chr_pos = snps_within_this_region_snpData.chr_pos_ls[-1] strain_id_label_x_offset=snps_within_this_region_snpData.chr_pos2adjacent_window[last_chr_pos][1] #right next to the rightmost SNP snp_id_label_y_offset=0.95 StrainID2PCAPosInfo = self.getStrainID2PCAPosInfo(subSNPData, pca_range=[0,1], snp_id_label_y_offset=snp_id_label_y_offset) #fake one SNPID2PCAPosInfo only for drawSNPMtrix() SNPID2PCAPosInfo = PassingData(step=None, snp_id2img_x_pos={}) for chr_pos, adjacent_window in snps_within_this_region_snpData.chr_pos2adjacent_window.iteritems(): chr_pos = map(str, chr_pos) snp_id = '_'.join(chr_pos) SNPID2PCAPosInfo.snp_id2img_x_pos[snp_id] = adjacent_window phenotype_cmap = mpl.cm.jet max_phenotype = numpy.nanmax(phenData.data_matrix[:,phenotype_col_index]) min_phenotype = numpy.nanmin(phenData.data_matrix[:,phenotype_col_index]) phenotype_gap = max_phenotype - min_phenotype phenotype_jitter = phenotype_gap/10. phenotype_norm = mpl.colors.Normalize(vmin=min_phenotype-phenotype_jitter, vmax=max_phenotype+phenotype_jitter) axe_map_phenotype_legend = pylab.axes([axe_x_offset4+0.02, axe_y_offset1, axe_width4-0.02, axe_height1/10.], frameon=False) cb = mpl.colorbar.ColorbarBase(axe_map_phenotype_legend, cmap=phenotype_cmap, norm=phenotype_norm, orientation='horizontal') cb.set_label('Phenotype Legend On the Map') axe_strain_map = None #no strain map axe_strain_pca = pylab.axes([axe_x_offset1, axe_y_offset1, axe_width1, axe_height1], frameon=False) axe_strain_map_pca_cover = None #not used. axe_strain_pca_xlim = [-0.05,1.05] axe_strain_pca_ylim = [0, 1] axe_strain_pca.set_xlim(axe_strain_pca_xlim) axe_strain_pca.set_ylim(axe_strain_pca_ylim) axe_strain_pca.grid(True, alpha=0.3) axe_strain_pca.set_xticks([]) axe_strain_pca.set_yticks([]) axe_strain_pca_legend =None self.drawStrainPCA(axe_strain_pca, axe_strain_map, axe_strain_map_pca_cover, axe_strain_pca_legend, StrainID2PCAPosInfo, \ ecotype_info, phenData, \ phenotype_col_index, phenotype_cmap, phenotype_norm, rightmost_x_value=axe_strain_pca_xlim[1],\ country_order_name='', strain_color_type=2, draw_axe_strain_map=False) axe_strain_pca.set_xlim(axe_strain_pca_xlim) axe_strain_pca.set_ylim(axe_strain_pca_ylim) no_of_axes_drawn += 1 if self.debug: pylab.savefig('%s_%s.png'%(output_fname_prefix, no_of_axes_drawn), dpi=400) #mark ecotypes on the map colored according to phenotype axe_map = pylab.axes([axe_x_offset4, axe_y_offset1, axe_width4, axe_height1], frameon=False) #axe_map_frame is used to connect strains from axe_phenotype to dot on the axe_map (another axe due to reasons stated in drawMap()) axe_map_frame = pylab.axes([axe_x_offset4, axe_y_offset1, axe_width4, axe_height1], frameon=False, sharey=axe_strain_pca) axe_map_frame.set_xticks([]) axe_map_frame.set_yticks([]) self.drawMap(axe_map_frame, axe_map, StrainID2PCAPosInfo, phenData, phenotype_col_index, phenotype_method_id, \ ecotype_info, phenotype_cmap, phenotype_norm) #axe_map.set_ylim([0,1]) no_of_axes_drawn += 1 if self.debug: pylab.savefig('%s_%s.png'%(output_fname_prefix, no_of_axes_drawn), dpi=400) axe_snp_matrix = pylab.axes([axe_x_offset2, axe_y_offset1, axe_width2, axe_height1], frameon=False, sharey=axe_strain_pca) #axe_snp_matrix.set_xticks([]) axe_snp_matrix.set_yticks([]) self.drawSNPMtrix(axe_snp_matrix, subSNPData, top_snp_data, StrainID2PCAPosInfo, SNPID2PCAPosInfo, \ ecotype_info, strain_id_label_x_offset, snp_id_label_y_offset, strain_id_label_x_offset_extra=axe_snp_matrix_margin,\ draw_snp_id_label=False, snpData_before_impute=snpData_before_impute, \ useAlleleToDetermineAlpha=useAlleleToDetermineAlpha,\ snp_value2color=snp_value2color) #2008-11-14 turn draw_snp_id_label off #axe_snp_matrix.set_xlim([0,1]) #axe_snp_matrix.set_ylim([0,1]) no_of_axes_drawn += 1 #pylab.savefig('%s_%s.png'%(self.output_fname_prefix, no_of_axes_drawn), dpi=400) axe_phenotype = pylab.axes([axe_x_offset3, axe_y_offset1, axe_width3, axe_height1], frameon=False, sharey=axe_snp_matrix) axe_phenotype.set_yticks([]) axe_phenotype.set_xticklabels([]) #no tick labels (axe_map_phenotype_legend has it already) self.drawPhenotype(axe_phenotype, StrainID2PCAPosInfo, phenData, phenotype_col_index, phenotype_method_id, ecotype_info) no_of_axes_drawn += 1 axe_phenotype.set_ylim([0,1]) axe_snp_matrix.set_ylim([0,1]) #without this, ylim of all 3 axes are set to [0,0.9] because axe_map automatically adjust to 0-0.9 #pylab.savefig('%s_%s.png'%(self.output_fname_prefix, no_of_axes_drawn), dpi=400) axe_to_put_pvalue_legend = ax1 #axe_LD is gone. put legend into ax1 itself. legend_loc = 'upper right' axe_LD = None axe_LD_legend = None axe_pvalue_xlim = [snp_region_tup[1]-axe_snp_matrix_margin, snp_region_tup[3]+axe_snp_matrix_margin*2] fig_title = 'SNP chr %s. pos %s.'%(this_snp.chromosome, this_snp.position) if getattr(this_snp, 'stop', None): fig_title += ' - %s. '%this_snp.stop fig_title += "Phenotype %s (id=%s)."%(phenotype.short_name, phenotype.id) ax1.title.set_text(fig_title) #main title using this snp. self.drawPvalue(ax1, axe_to_put_pvalue_legend, axe_LD_center_SNP, snps_within_this_region, analysis_method_id2gwr, LD_info, \ which_LD_statistic, draw_LD_relative_to_center_SNP=draw_LD_relative_to_center_SNP, legend_loc=legend_loc) gene_position_cycle = 5 base_y_value = 1 gene_width=0.8 gene_box_text_gap = min_distance*2*0.005 skip_gene_model = False if len(snps_within_this_region.chr_pos_ls)>0: _snps_within_this_region = snps_within_this_region elif len(snps_within_this_region_snpData.chr_pos_ls)>0: _snps_within_this_region = snps_within_this_region_snpData else: skip_gene_model = True if not skip_gene_model: return_data = self.drawGeneModel(axe_gene_model, _snps_within_this_region, gene_annotation, \ candidate_gene_set, gene_width=gene_width, gene_position_cycle=gene_position_cycle, \ base_y_value=base_y_value, gene_box_text_gap=gene_box_text_gap,\ label_gene=label_gene) matrix_of_gene_descriptions = return_data.matrix_of_gene_descriptions gene_model_min_y = base_y_value-gene_width gene_model_max_y = gene_position_cycle + base_y_value -1 + gene_width #"-1" because genes never sit on y=gene_position_cycle + base_y_value if not skip_gene_model: self.drawLD(axe_gene_model, axe_LD, _snps_within_this_region, LD_info, gene_model_min_y=gene_model_min_y,\ gene_model_max_y=gene_model_max_y, which_LD_statistic=which_LD_statistic) if LD_info: self.drawLDLegend(axe_LD_legend, which_LD_statistic) #adjust x, y limits and etc ax1.set_xlim(axe_pvalue_xlim) ax1_ylim = ax1.get_ylim() ax1.set_ylim((0, ax1_ylim[1])) #set ax1 to 0 to sit right above axe_gene_model axe_gene_model.set_ylim((gene_model_min_y, gene_model_max_y)) #LD panel right under gene models if LD_info: axe_LD.set_xlim(ax1.get_xlim()) #make the axe_LD and ax1 within the same X range axe_LD_x_span = (axe_LD.get_xlim()[1]-axe_LD.get_xlim()[0]) axe_LD.set_ylim((-axe_LD_x_span/2., 0)) #has to force here, don't know why. otherwise it's (0,1) axe_LD.set_yticks([]) #remove all Y ticks on LD plot elif snpData: axe_snp_matrix.set_xlim(ax1.get_xlim()) png_data = None svg_data = None png_output_fname = None if len(snps_within_this_region.chr_pos_ls)>0: distance = abs(snps_within_this_region.chr_pos_ls[-1][1] - snps_within_this_region.chr_pos_ls[0][1]) elif len(snps_within_this_region_snpData.chr_pos_ls)>0: distance = abs(snps_within_this_region_snpData.chr_pos_ls[-1][1] - snps_within_this_region_snpData.chr_pos_ls[0][1]) else: distance = 0 if commit: #2008-10-24 png_data = StringIO.StringIO() svg_data = StringIO.StringIO() pylab.savefig(png_data, format='png', dpi=600) if distance<=20000: #save the svg format if less than 80kb pylab.savefig(svg_data, format='svg', dpi=300) else: png_output_fname = '%s.png'%output_fname_prefix pylab.savefig(png_output_fname, dpi=600) if distance<=20000: #save the svg format if less than 80kb pylab.savefig('%s.svg'%output_fname_prefix, dpi=300) if self.debug: pylab.show() del ax1, axe_LD_center_SNP, axe_gene_model, axe_LD, axe_LD_legend sys.stderr.write("Done.\n") after_plot_data = PassingData(png_output_fname=png_output_fname, matrix_of_gene_descriptions=matrix_of_gene_descriptions, \ png_data=png_data,\ svg_data=svg_data,\ snps_within_this_region=snps_within_this_region) return after_plot_data | bdc3752350001c791e90fb2760fcc0578318b113 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/bdc3752350001c791e90fb2760fcc0578318b113/DrawSNPRegion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
5165,
30022,
2503,
13653,
52,
12,
2890,
16,
28825,
67,
2039,
67,
350,
16,
333,
67,
87,
6782,
16,
5500,
67,
11857,
67,
542,
16,
7529,
67,
11495,
16,
28648,
67,
1376,
16,
6285,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
5165,
30022,
2503,
13653,
52,
12,
2890,
16,
28825,
67,
2039,
67,
350,
16,
333,
67,
87,
6782,
16,
5500,
67,
11857,
67,
542,
16,
7529,
67,
11495,
16,
28648,
67,
1376,
16,
6285,
6... |
parts.append(value + (fieldsize - l) * NUL) | parts.append(value[:fieldsize] + (fieldsize - l) * NUL) | def tobuf(self): """Return a tar header block as a 512 byte string. """ name = self.name | aca89a4803ebbb1cc3da984004fb2fd67edba066 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/aca89a4803ebbb1cc3da984004fb2fd67edba066/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
4672,
3536,
990,
279,
8232,
1446,
1203,
487,
279,
13908,
1160,
533,
18,
3536,
508,
273,
365,
18,
529,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
4385,
12,
2890,
4672,
3536,
990,
279,
8232,
1446,
1203,
487,
279,
13908,
1160,
533,
18,
3536,
508,
273,
365,
18,
529,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.mode_shuffle == 1: media = self.get_next_media_rand() else: media = self.get_next_media_lin() | media = self.get_next_media() | def run(self): q = self.q | 95ceaf3edd8eef9223ea99bca356ceec4d029d9f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12047/95ceaf3edd8eef9223ea99bca356ceec4d029d9f/deefuzz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1043,
273,
365,
18,
85,
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,
1086,
12,
2890,
4672,
1043,
273,
365,
18,
85,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if "meta_command" in command and command["meta_command"].value == 3: return command["text"].value | if "meta_command" in command \ and command["meta_command"].value in (Command.META_COMMAND_TEXT, Command.META_COMMAND_NAME) \ and "text" in command: return command["text"].value.strip("\r\n") | def createDescription(self): command = self["command[0]"] if "meta_command" in command and command["meta_command"].value == 3: return command["text"].value else: return "" | 58ed6c09d12e8a4cc672d4dae5d8e7a8cd7f3a6a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/58ed6c09d12e8a4cc672d4dae5d8e7a8cd7f3a6a/midi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
3291,
12,
2890,
4672,
1296,
273,
365,
9614,
3076,
63,
20,
4279,
65,
309,
315,
3901,
67,
3076,
6,
316,
1296,
521,
471,
1296,
9614,
3901,
67,
3076,
6,
8009,
1132,
316,
261,
2189,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3291,
12,
2890,
4672,
1296,
273,
365,
9614,
3076,
63,
20,
4279,
65,
309,
315,
3901,
67,
3076,
6,
316,
1296,
521,
471,
1296,
9614,
3901,
67,
3076,
6,
8009,
1132,
316,
261,
2189,
... |
'amount': fields.function(_compute_total, method=True, type='float', digits=(14,2), string='Total', store=True), 'tax_amount':fields.float('Tax Amount', digits=(14,2), readonly=True, states={'draft':[('readonly',False)]}), | 'amount': fields.float('Total', digits=(16, 2), readonly=True, states={'draft':[('readonly',False)]}), 'tax_amount':fields.float('Tax Amount', digits=(14,4), readonly=True, states={'draft':[('readonly',False)]}), | def _compute_total(self, cr, uid, ids, name, args, context=None): position_pool = self.pool.get('account.fiscal.position') voucher_pool = self.pool.get('account.voucher') voucher_line_pool = self.pool.get('account.voucher.line') partner_pool = self.pool.get('res.partner') tax_pool = self.pool.get('account.tax') res = {} for voucher in self.browse(cr, uid, ids): total = 0.0 for line in voucher.payment_ids: total += line.amount | c1a9af0020b8b799fa4ca9940cdd72d451126c08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c1a9af0020b8b799fa4ca9940cdd72d451126c08/voucher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9200,
67,
4963,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
1754,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
74,
291,
771,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9200,
67,
4963,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
1754,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
74,
291,
771,
1... |
if self.exists(): | try: self.get() except NoPage: output(u'%s has been deleted before getting the Hash. Skipping...' % self.title()) return None except IsRedirectPage: output("Skipping %s because it's a redirect." % self.title()) return None else: | def getHash(self): """ Function that return the Hash of an image in oder to understand if two Images are the same or not. """ if self.exists(): params = { 'action' :'query', 'titles' :self.title(), 'prop' :'imageinfo', 'iiprop' :'sha1', } # First of all we need the Hash that identify an image data = query.GetData(params, useAPI = True, encodeTitle = False) pageid = data['query']['pages'].keys()[0] try: hash_found = data['query']['pages'][pageid][u'imageinfo'][0][u'sha1'] except (KeyError, IndexError): if self.exists(): raise NoHash('No Hash found in the APIs! Maybe the regex to catch it is wrong or someone has changed the APIs structure.') else: output(u'Image deleted before getting the Hash. Skipping...') return None else: return hash_found else: output(u'Image deleted before getting the Hash. Skipping...') return None | b4e6dbf405f65d45e84baeb5508d02d04da189c0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/b4e6dbf405f65d45e84baeb5508d02d04da189c0/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16075,
12,
2890,
4672,
3536,
4284,
716,
327,
326,
2474,
434,
392,
1316,
316,
320,
765,
358,
22413,
309,
2795,
23022,
854,
326,
1967,
578,
486,
18,
3536,
775,
30,
365,
18,
588,
1435,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16075,
12,
2890,
4672,
3536,
4284,
716,
327,
326,
2474,
434,
392,
1316,
316,
320,
765,
358,
22413,
309,
2795,
23022,
854,
326,
1967,
578,
486,
18,
3536,
775,
30,
365,
18,
588,
1435,
13... |
mb = associated_task.add_subtask(self.modify_bootini) | mb = associated_task.add_subtask(self.modify_configsys) | def modify_bootloader(self, associated_task): for drive in self.info.drives: if drive.type not in ('removable', 'hd'): continue mb = None if self.info.bootloader == 'xp': mb = associated_task.add_subtask(self.modify_bootini) elif self.info.bootloader == '98': mb = associated_task.add_subtask(self.modify_bootini) elif self.info.bootloader == 'vista': mb = associated_task.add_subtask(self.modify_bootini) if mb: mb(drive) | 3baf62aad80770d0d33ad3344cd3142240cd3c2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/702/3baf62aad80770d0d33ad3344cd3142240cd3c2c/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5612,
67,
7137,
6714,
12,
2890,
16,
3627,
67,
4146,
4672,
364,
14316,
316,
365,
18,
1376,
18,
3069,
3606,
30,
309,
14316,
18,
723,
486,
316,
7707,
2764,
1527,
429,
2187,
296,
22057,
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,
5612,
67,
7137,
6714,
12,
2890,
16,
3627,
67,
4146,
4672,
364,
14316,
316,
365,
18,
1376,
18,
3069,
3606,
30,
309,
14316,
18,
723,
486,
316,
7707,
2764,
1527,
429,
2187,
296,
22057,
11... |
self._debug('Close all connections to %r', dsn) | self.__logger.info('%r: Close all connections to %r', self, dsn) | def close_all(self, dsn): self._debug('Close all connections to %r', dsn) for i, (cnx, used) in tools.reverse_enumerate(self._connections): if dsn_are_equals(cnx.dsn, dsn): cnx.close() self._connections.pop(i) | 6a457064353f36e0a90e79d5ff7e1fc66e4eb568 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/6a457064353f36e0a90e79d5ff7e1fc66e4eb568/sql_db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
454,
12,
2890,
16,
11676,
4672,
365,
16186,
4901,
18,
1376,
29909,
86,
30,
3527,
777,
5921,
358,
738,
86,
2187,
365,
16,
11676,
13,
364,
277,
16,
261,
10305,
92,
16,
1399,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
454,
12,
2890,
16,
11676,
4672,
365,
16186,
4901,
18,
1376,
29909,
86,
30,
3527,
777,
5921,
358,
738,
86,
2187,
365,
16,
11676,
13,
364,
277,
16,
261,
10305,
92,
16,
1399,
... |
debug("importing env %s=%s"%(var, os.environ[var])) | debug("importing %s=%s"%(var, os.environ[var])) | def import_env(self): whitelist = BB_ENV_WHITELIST if "BB_ENV_EXTRAWHITE" in os.environ: whitelist += os.environ["BB_ENV_EXTRAWHITE"].split() if "BB_ENV_EXTRAWHITE" in self.config: whitelist += self.config["BB_ENV_EXTRAWHITE"].split() for var in whitelist: if not var in self.config and var in os.environ: self.config[var] = os.environ[var] debug("importing env %s=%s"%(var, os.environ[var])) return | bc7109b48adee86f6afaf482fde3d8cc38772b69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5897/bc7109b48adee86f6afaf482fde3d8cc38772b69/baker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
3074,
12,
2890,
4672,
10734,
273,
21752,
67,
11986,
67,
16861,
7085,
309,
315,
9676,
67,
11986,
67,
4142,
10821,
44,
5398,
6,
316,
1140,
18,
28684,
30,
10734,
1011,
1140,
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,
1930,
67,
3074,
12,
2890,
4672,
10734,
273,
21752,
67,
11986,
67,
16861,
7085,
309,
315,
9676,
67,
11986,
67,
4142,
10821,
44,
5398,
6,
316,
1140,
18,
28684,
30,
10734,
1011,
1140,
18,
... |
testStringWidthAlgorithms() | testStringWidthAlgorithms() | def test(): helv = TypeFace('Helvetica') registerTypeFace(helv) print helv.glyphNames[0:30] wombat = TypeFace('Wombat') print wombat.glyphNames registerTypeFace(wombat) dumpFontData() | 2c48c7eda8db39df88d7f32d57fbcfb0fec2b8fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/2c48c7eda8db39df88d7f32d57fbcfb0fec2b8fe/pdfmetrics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
13150,
90,
273,
1412,
11824,
2668,
44,
292,
90,
7943,
69,
6134,
1744,
559,
11824,
12,
76,
292,
90,
13,
1172,
13150,
90,
18,
19426,
1557,
63,
20,
30,
5082,
65,
225,
341,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13332,
13150,
90,
273,
1412,
11824,
2668,
44,
292,
90,
7943,
69,
6134,
1744,
559,
11824,
12,
76,
292,
90,
13,
1172,
13150,
90,
18,
19426,
1557,
63,
20,
30,
5082,
65,
225,
341,
... |
return self._executeSingleFileCatalogFunction(lfn,'addFile',catalogs=catalogs) else: return self._executeFileCatalogFunction(lfn,'addFile',catalogs=catalogs) def removeCatalogFile(self,lfn,singleFile=False,catalogs=[]): | return self._executeSingleFileCatalogFunction( lfn, 'addFile', catalogs=catalogs ) else: return self._executeFileCatalogFunction( lfn, 'addFile', catalogs=catalogs ) def removeCatalogFile( self, lfn, singleFile=False, catalogs=[] ): | def addCatalogFile(self,lfn,singleFile=False,catalogs=[]): """ Add a new file to the FileCatalog 'lfn' is the dictionary containing the file properties """ if singleFile: return self._executeSingleFileCatalogFunction(lfn,'addFile',catalogs=catalogs) else: return self._executeFileCatalogFunction(lfn,'addFile',catalogs=catalogs) | 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,
527,
9769,
812,
12,
2890,
16,
80,
4293,
16,
7526,
812,
33,
8381,
16,
2574,
287,
14072,
33,
8526,
4672,
3536,
1436,
279,
394,
585,
358,
326,
1387,
9769,
225,
296,
80,
4293,
11,
353,
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,
527,
9769,
812,
12,
2890,
16,
80,
4293,
16,
7526,
812,
33,
8381,
16,
2574,
287,
14072,
33,
8526,
4672,
3536,
1436,
279,
394,
585,
358,
326,
1387,
9769,
225,
296,
80,
4293,
11,
353,
3... |
resp['username']=self.username resp['realm']=chal['realm'] resp['nonce']=chal['nonce'] cnonce='OA6MHXh6VqTrRk' | resp['username']=self.username resp['realm']=chal['realm'] resp['nonce']=chal['nonce'] cnonce='' for i in range(7): cnonce+=hex(int(random.random()*65536*4096))[2:] | def SASLHandler(self,conn,challenge): if challenge.getNamespace()<>NS_SASL: return if challenge.getName()=='failure': self.startsasl='failure' try: reason=challenge.getChildren()[0] except: reason=challenge self._owner.DEBUG(DBG_SASL,'Failed SASL authentification: %s'%reason,'error') return elif challenge.getName()=='success': self.startsasl='success' self._owner.DEBUG(DBG_SASL,'Successfully authenticated with remote server.','ok') self._owner.Dispatcher.PlugOut() dispatcher.Dispatcher().PlugIn(self._owner) self._owner.send_header() self._owner.User=self.username return | ed9bbc187c416413336b1cec5d7c6ab176ee8864 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/ed9bbc187c416413336b1cec5d7c6ab176ee8864/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24380,
48,
1503,
12,
2890,
16,
4646,
16,
25092,
4672,
309,
12948,
18,
588,
3402,
1435,
29667,
3156,
67,
55,
3033,
48,
30,
327,
309,
12948,
18,
17994,
1435,
18920,
12251,
4278,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24380,
48,
1503,
12,
2890,
16,
4646,
16,
25092,
4672,
309,
12948,
18,
588,
3402,
1435,
29667,
3156,
67,
55,
3033,
48,
30,
327,
309,
12948,
18,
17994,
1435,
18920,
12251,
4278,
365,
18,
... |
sendmess(mycontext["server_ip"], mycontext["udp_port"], get_mess(512)) | sendmess(mycontext["server_ip"], mycontext["udp_port"], "0" * 512, ip, mycontext["upd_port"]) | def get_mess(bytes): mess = "" for i in range(bytes): mess += "0" return mess | db230f22e4c679967a823e6a82d26e34a62ab76e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/db230f22e4c679967a823e6a82d26e34a62ab76e/BandwidthClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
81,
403,
12,
3890,
4672,
12755,
273,
1408,
364,
277,
316,
1048,
12,
3890,
4672,
12755,
1011,
315,
20,
6,
327,
12755,
225,
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,
336,
67,
81,
403,
12,
3890,
4672,
12755,
273,
1408,
364,
277,
316,
1048,
12,
3890,
4672,
12755,
1011,
315,
20,
6,
327,
12755,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if ext in set(['.cc', '.cpp', '.cxx', '.c', '.C', '.s', '.S', '.bin', '.grit']): result.addFile(sources.cppsource(file, platforms, archs, doprocess, self.usepch)) | if ext in set(['.cc', '.cpp', '.cxx', '.c', '.C', '.s', '.S', '.bin', '.grit', '.m', '.mm']): result.addFile(sources.cppsource(file, fileplatforms, filearchs, doprocess, self.usepch)) | def scandir(self, path, local, process, platforms, archs, sourcelist = []): result = sources.directory() | c04f24b6cfc091cb371499211c80f4a4f0f88990 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/c04f24b6cfc091cb371499211c80f4a4f0f88990/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24865,
12,
2890,
16,
589,
16,
1191,
16,
1207,
16,
17422,
16,
6637,
87,
16,
272,
477,
2183,
376,
273,
5378,
4672,
563,
273,
5550,
18,
5149,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24865,
12,
2890,
16,
589,
16,
1191,
16,
1207,
16,
17422,
16,
6637,
87,
16,
272,
477,
2183,
376,
273,
5378,
4672,
563,
273,
5550,
18,
5149,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class DummyMain: def _registerCommand(*P, **K): pass | def getPluginManager(): cfg = buildcfg.BuildConfiguration(True, ignoreErrors=True) if not getattr(cfg, 'usePlugins', True): return plugins.PluginManager([]) disabledPlugins = [ x[0] for x in cfg.usePlugin.items() if not x[1] ] disabledPlugins.append('monitor') p = plugins.PluginManager(cfg.pluginDirs, disabledPlugins) p.loadPlugins() return p | 9ccac7b5e48aa634cb7db5f7bee3f782668fd8bc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7644/9ccac7b5e48aa634cb7db5f7bee3f782668fd8bc/cook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16319,
1318,
13332,
2776,
273,
1361,
7066,
18,
3116,
1750,
12,
5510,
16,
2305,
4229,
33,
5510,
13,
309,
486,
3869,
12,
7066,
16,
296,
1202,
9461,
2187,
1053,
4672,
327,
4799,
18,
3773,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16319,
1318,
13332,
2776,
273,
1361,
7066,
18,
3116,
1750,
12,
5510,
16,
2305,
4229,
33,
5510,
13,
309,
486,
3869,
12,
7066,
16,
296,
1202,
9461,
2187,
1053,
4672,
327,
4799,
18,
3773,
... | |
def BigFileRuns(rcsf): while 1: rand = random.Random() f1 = open(TMPDIR + "/big.1", "w") f2 = open(TMPDIR + "/big.2", "w") f1sz = 0 f2sz = 0 for file in rcsf.rcsfiles: if file.versions < 2: continue r1 = 0 r2 = 0 while r1 == r2: r1 = rand.randint(0, len(file.versions) - 1) r2 = rand.randint(0, len(file.versions) - 1) f1sz += file.AppendVersion(f1, r1) f2sz += file.AppendVersion(f2, r2) f1.close() f2.close() print "Test input sizes: %d %d" % (f1sz, f2sz) BigFileRun(TMPDIR + "/big.1", TMPDIR + "/big.2") | def MakeBigFiles(rcsf): rand = random.Random() f1 = open(TMPDIR + "/big.1", "w") f2 = open(TMPDIR + "/big.2", "w") f1sz = 0 f2sz = 0 for file in rcsf.rcsfiles: if file.versions < 2: continue r1 = 0 r2 = 0 while r1 == r2: r1 = rand.randint(0, len(file.versions) - 1) r2 = rand.randint(0, len(file.versions) - 1) f1sz += file.AppendVersion(f1, r1) f2sz += file.AppendVersion(f2, r2) f1.close() f2.close() return (TMPDIR + "/big.1", TMPDIR + "/big.2") | def BigFileRuns(rcsf): while 1: rand = random.Random() f1 = open(TMPDIR + "/big.1", "w") f2 = open(TMPDIR + "/big.2", "w") f1sz = 0 f2sz = 0 for file in rcsf.rcsfiles: if file.versions < 2: continue r1 = 0 r2 = 0 while r1 == r2: r1 = rand.randint(0, len(file.versions) - 1) r2 = rand.randint(0, len(file.versions) - 1) f1sz += file.AppendVersion(f1, r1) f2sz += file.AppendVersion(f2, r2) f1.close() f2.close() print "Test input sizes: %d %d" % (f1sz, f2sz) BigFileRun(TMPDIR + "/big.1", TMPDIR + "/big.2") #continue #end | 6904a1f350fb8e16cfe391f76f3f707ad3703889 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9009/6904a1f350fb8e16cfe391f76f3f707ad3703889/xdelta3-regtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4454,
812,
9361,
12,
1310,
21668,
4672,
1323,
404,
30,
225,
5605,
273,
2744,
18,
8529,
1435,
284,
21,
273,
1696,
12,
28259,
4537,
397,
2206,
14002,
18,
21,
3113,
315,
91,
7923,
284,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4454,
812,
9361,
12,
1310,
21668,
4672,
1323,
404,
30,
225,
5605,
273,
2744,
18,
8529,
1435,
284,
21,
273,
1696,
12,
28259,
4537,
397,
2206,
14002,
18,
21,
3113,
315,
91,
7923,
284,
22... |
query += self._substitution.transform(ref) | query += self._substitution.substituteOnly(ref) | def _makeChunkQuery(self, chunkId, table): # Prefix with empty subchunk spec. query = self._headerFunc() +"\n" ref = self._pConfig.chunkMapping.getMapReference(chunkId,0) query += self._createTableTmpl % table query += self._substitution.transform(ref) print query return query | 54bb547ef5ce6fd3f5e025d6b1b003634b2d56b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6510/54bb547ef5ce6fd3f5e025d6b1b003634b2d56b0/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
5579,
1138,
12,
2890,
16,
2441,
548,
16,
1014,
4672,
468,
10139,
598,
1008,
720,
6551,
857,
18,
843,
273,
365,
6315,
3374,
2622,
1435,
397,
12691,
82,
6,
1278,
273,
365,
631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
5579,
1138,
12,
2890,
16,
2441,
548,
16,
1014,
4672,
468,
10139,
598,
1008,
720,
6551,
857,
18,
843,
273,
365,
6315,
3374,
2622,
1435,
397,
12691,
82,
6,
1278,
273,
365,
631... |
result = trim(result) | def _do_query_directory(directory, category): sql = 'SELECT host.id, host.country, host_category_url.url, site.private, host.private ' sql += 'FROM host_category_dir, host_category, host_category_url, host, site ' sql += 'WHERE host_category_dir.host_category_id = host_category.id ' # join criteria sql += 'AND host_category_url.host_category_id = host_category.id ' # join criteria sql += 'AND host_category.host_id = host.id ' # join criteria sql += 'AND host.site_id = site.id ' # join criteria sql += 'AND host_category.category_id = %d ' % category.id # but select only the target category sql += "AND host_category_dir.directory_id = %s " % directory.id # and target directory sql += 'AND (host_category_dir.up2date OR host_category.always_up2date) ' sql += 'AND NOT host_category_url.private ' sql += 'AND host.user_active AND site.user_active ' sql += 'AND host.admin_active AND site.admin_active ' result = directory._connection.queryAll(sql) result = trim(result) return result | e15a52dbde749000bdad35402b0bc452c40a3f3f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13031/e15a52dbde749000bdad35402b0bc452c40a3f3f/mirrorlist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
2271,
67,
5149,
12,
5149,
16,
3150,
4672,
1847,
225,
273,
296,
4803,
1479,
18,
350,
16,
1479,
18,
9082,
16,
1479,
67,
4743,
67,
718,
18,
718,
16,
2834,
18,
1152,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
2271,
67,
5149,
12,
5149,
16,
3150,
4672,
1847,
225,
273,
296,
4803,
1479,
18,
350,
16,
1479,
18,
9082,
16,
1479,
67,
4743,
67,
718,
18,
718,
16,
2834,
18,
1152,
16,
... | |
req = Mock(Request, path_info='/build', args={}, hdf=HDFWrapper(), perm=PermissionCache(self.env, 'joe')) | req = Mock(Request, cgi_location='', path_info='/build', args={}, hdf=HDFWrapper(), perm=PermissionCache(self.env, 'joe')) | def test_overview_admin(self): PermissionSystem(self.env).grant_permission('joe', 'BUILD_ADMIN') req = Mock(Request, path_info='/build', args={}, hdf=HDFWrapper(), perm=PermissionCache(self.env, 'joe')) req.hdf['htdocs_location'] = '/htdocs' | 31d623021a4051055a44ec529f842c01a8d178ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4547/31d623021a4051055a44ec529f842c01a8d178ba/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26081,
67,
3666,
12,
2890,
4672,
8509,
3163,
12,
2890,
18,
3074,
2934,
16243,
67,
9827,
2668,
78,
15548,
2187,
296,
20215,
67,
15468,
6134,
1111,
273,
7867,
12,
691,
16,
276,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26081,
67,
3666,
12,
2890,
4672,
8509,
3163,
12,
2890,
18,
3074,
2934,
16243,
67,
9827,
2668,
78,
15548,
2187,
296,
20215,
67,
15468,
6134,
1111,
273,
7867,
12,
691,
16,
276,
... |
ld t1, ds, [scale, index, base], disp | ld t1, ds, [0, t0, t7], disp | def macroop AND_P_R | 0e6be2a9b16660903306b2762e69a2678a54a6ba /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6787/0e6be2a9b16660903306b2762e69a2678a54a6ba/logical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
4116,
67,
52,
67,
54,
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,
11522,
556,
4116,
67,
52,
67,
54,
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,
... |
if isinstance(p, bstyleoption): | if isinstance(p[opt], bstyleoption): | def invoke(self, tex): res = Base.Command.invoke(self, tex) try: s = self.styles[self.attributes['style']] except KeyError: # log.warning('Could not find bibstyle: "%s"', # self.attributes['style']) return res p = bibpunct.punctuation for i, opt in enumerate(['post','open','close','sep','style','dates','years']): if isinstance(p, bstyleoption): p[opt] = s[i] return res | 261e24412beff5697c6665d51635a2e3056f255b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7864/261e24412beff5697c6665d51635a2e3056f255b/natbib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
12,
2890,
16,
16573,
4672,
400,
273,
3360,
18,
2189,
18,
14407,
12,
2890,
16,
16573,
13,
775,
30,
272,
273,
365,
18,
10218,
63,
2890,
18,
4350,
3292,
4060,
3546,
65,
1335,
4999,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
12,
2890,
16,
16573,
4672,
400,
273,
3360,
18,
2189,
18,
14407,
12,
2890,
16,
16573,
13,
775,
30,
272,
273,
365,
18,
10218,
63,
2890,
18,
4350,
3292,
4060,
3546,
65,
1335,
4999,
... |
if document.stat.m_time != mtime: | docmtime = document.stat.st_mtime if docmtime != mtime: | def get_result(self, document): try: result, mtime = self._cache[document.unique_id] except KeyError: result = mtime = None if document.stat.m_time != mtime: result = self._get_result(document) mtime = document.stat.m_time self._cache[document.unique_id] = (result, mtime) return result | 2ebcfaabc90a25bb5c97016d621acdd91403a27b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/2ebcfaabc90a25bb5c97016d621acdd91403a27b/document.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2088,
12,
2890,
16,
1668,
4672,
775,
30,
563,
16,
13158,
273,
365,
6315,
2493,
63,
5457,
18,
6270,
67,
350,
65,
1335,
4999,
30,
563,
273,
13158,
273,
599,
997,
10838,
273,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2088,
12,
2890,
16,
1668,
4672,
775,
30,
563,
16,
13158,
273,
365,
6315,
2493,
63,
5457,
18,
6270,
67,
350,
65,
1335,
4999,
30,
563,
273,
13158,
273,
599,
997,
10838,
273,
1... |
2 functions: 1. detect deletions. make sure the deletion is covered by the sequencing. | Two functions: 1. deletion_only=True. make sure the deletion is covered by the sequencing. | def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make sure the deletion is covered by the sequencing. one naive criteria is if the boundary (two adjacent non-deleted probes) is within the same contig, then yes. 2. detect copy number changes. If two adjacent probes have different number of contigs, then it's a copy number change point. """ from pymodule import getColName2IndexFromHeader, PassingData, figureOutDelimiter sys.stderr.write("Reading from %s ... \n"%ler_blast_result_fname) counter = 0 real_counter = 0 import csv reader = csv.reader(open(ler_blast_result_fname), delimiter=figureOutDelimiter(ler_blast_result_fname)) header = reader.next() col_name2index = getColName2IndexFromHeader(header) probe_id2contig_id_ls = {} for row in reader: contig_label = row[col_name2index['Alignment_title']] probe_id = int(row[col_name2index['Probe_ID']]) no_of_matches = int(row[col_name2index['Number_matches']]) if no_of_matches>=min_no_of_matches: contig_id = ' '.join(contig_label.split()[1:]) if probe_id not in probe_id2contig_id_ls: probe_id2contig_id_ls[probe_id] = [] probe_id2contig_id_ls[probe_id].append(contig_id) sys.stderr.write("Done.\n") del reader import Stock_250kDB from DB_250k2Array import DB_250k2Array session = db_250k.session probes, xy_ls, chr_pos_ls, total_probe_id_ls = DB_250k2Array.get_probes(db_250k.metadata.bind, Stock_250kDB.Probes.table.name, \ snps=None, run_type=2) chr2xy_ls, chr2probe_id_ls = DB_250k2Array.organizeProbesIntoChromosome(xy_ls, chr_pos_ls, total_probe_id_ls) writer = csv.writer(open(output_fname, 'w'), delimiter='\t') header_row = ['start_probe_id', 'start_chr_pos', 'stop_probe_id', 'stop_chr_pos', 'no_of_probes', 'length', 'copy_number'] writer.writerow(header_row) sys.stderr.write("Discovering deletions ...\n") counter = 0 real_counter = 0 for chr, probe_id_ls in chr2probe_id_ls.iteritems(): no_of_probes = len(probe_id_ls) index_of_prev_probe_within_a_contig = None index_of_prev_probe_with_a_different_copy_number = None for i in range(no_of_probes): probe_id = probe_id_ls[i] contig_id_ls = probe_id2contig_id_ls.get(probe_id,[]) copy_number = len(contig_id_ls) if i==0: index_of_prev_probe_with_a_different_copy_number = -1 # set before the first probe (index=0) else: prev_probe_contig_id_ls = probe_id2contig_id_ls.get(probe_id_ls[i-1],[]) prev_copy_number = len(prev_probe_contig_id_ls) if not deletion_only: if copy_number != prev_copy_number: # a change point of copy number if index_of_prev_probe_with_a_different_copy_number is not None: start_probe_id = probe_id_ls[index_of_prev_probe_with_a_different_copy_number+1] start_probe = probes.get_one_probe(start_probe_id) start_chr_pos = '%s_%s'%(start_probe.chr, start_probe.pos) stop_probe_id = probe_id_ls[i-1] stop_probe = probes.get_one_probe(stop_probe_id) stop_chr_pos = '%s_%s'%(stop_probe.chr, stop_probe.pos) row = [start_probe_id, start_chr_pos, stop_probe_id, stop_chr_pos, \ i-index_of_prev_probe_with_a_different_copy_number-1, stop_probe.pos-start_probe.pos, prev_copy_number] writer.writerow(row) real_counter += 1 index_of_prev_probe_with_a_different_copy_number = i-1 else: # look for deleton only. The only difference from above is make sure the deletion is covered by the sequencing. #one naive criteria is if the boundary is within the same contig, then yes. if prev_copy_number>0 and copy_number==0: # from non-deletion to deletion index_of_prev_probe_within_a_contig = i-1 elif prev_copy_number==0 and copy_number>0: # from deletion to non-deletion if index_of_prev_probe_within_a_contig is not None: # found a potential deletion current_contig_id_set = set(contig_id_ls) prev_non_deleted_probe_id = probe_id_ls[index_of_prev_probe_within_a_contig] prev_non_deleted_probe_contig_id_ls = probe_id2contig_id_ls.get(prev_non_deleted_probe_id, []) prev_non_deleted_probe_contig_id_set = set(prev_non_deleted_probe_contig_id_ls) if len(prev_non_deleted_probe_contig_id_set¤t_contig_id_set)>0: #share at least one contig. deletion confirmed deletion_start_probe_id = probe_id_ls[index_of_prev_probe_within_a_contig+1] deletion_start_probe = probes.get_one_probe(deletion_start_probe_id) deletion_start_chr_pos = '%s_%s'%(deletion_start_probe.chr, deletion_start_probe.pos) deletion_stop_probe_id = probe_id_ls[i-1] deletion_stop_probe = probes.get_one_probe(deletion_stop_probe_id) deletion_stop_chr_pos = '%s_%s'%(deletion_stop_probe.chr, deletion_stop_probe.pos) row = [deletion_start_probe_id, deletion_start_chr_pos, deletion_stop_probe_id, deletion_stop_chr_pos, \ i-index_of_prev_probe_within_a_contig-1, deletion_stop_probe.pos-deletion_start_probe.pos, prev_copy_number] writer.writerow(row) real_counter += 1 index_of_prev_probe_within_a_contig = i elif prev_copy_number>0 and copy_number>0: # from non-deletion to non-deletion index_of_prev_probe_within_a_contig = i counter += 1 if counter%10000==0: sys.stderr.write("%s%s\t%s"%('\x08'*80, counter, real_counter)) # don't forget the last segment if it's not in the deletion_only mode. if not deletion_only and index_of_prev_probe_with_a_different_copy_number is not None: start_probe_id = probe_id_ls[index_of_prev_probe_with_a_different_copy_number+1] start_probe = probes.get_one_probe(start_probe_id) start_chr_pos = '%s_%s'%(start_probe.chr, start_probe.pos) stop_probe_id = probe_id_ls[i] # watch: not i-1. stop_probe = probes.get_one_probe(stop_probe_id) stop_chr_pos = '%s_%s'%(stop_probe.chr, stop_probe.pos) row = [start_probe_id, start_chr_pos, stop_probe_id, stop_chr_pos, \ i-index_of_prev_probe_with_a_different_copy_number, stop_probe.pos-start_probe.pos, copy_number] # watch no -1, and it's copy_number writer.writerow(row) real_counter += 1 sys.stderr.write("Done.\n") del writer | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10372,
48,
264,
13064,
40,
89,
1254,
12,
6429,
16,
1319,
67,
26520,
79,
16,
328,
264,
67,
30901,
67,
2088,
67,
12749,
16,
876,
67,
12749,
16,
10899,
67,
3700,
33,
5510,
16,
1131,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10372,
48,
264,
13064,
40,
89,
1254,
12,
6429,
16,
1319,
67,
26520,
79,
16,
328,
264,
67,
30901,
67,
2088,
67,
12749,
16,
876,
67,
12749,
16,
10899,
67,
3700,
33,
5510,
16,
1131,
67,... |
outFile.write("\n// @pymethod %s|%s|%s|%s\n" % (fields[0],thisModName,fields[1], fields[2])) | outFile.write("// @pymethod %s|%s|%s|%s\n" % (fields[0],thisModName,fields[1], fields[2])) | def make_doc_summary(inFile, outFile): methods = [] nativeMethods = [] modDoc = "" modName = "" lines = inFile.readlines() curMethod = None constants = [] extra_tags = [] lineNo = 0 bInRawBlock = 0 while lineNo < len(lines): line = lines[lineNo] if bInRawBlock and len(line)>2 and line[:2]=="%}": bInRawBlock = 0 if not bInRawBlock and len(line)>2 and line[:2]=="%{": bInRawBlock = 1 try: if line[:7]=="%module": extra = string.split(line, "//") if len(extra)>1: modName = string.strip(extra[0][7:]) modDoc, lineNo = GetComments(line, lineNo, lines) lineNo += 1 elif line[:7]=="#define" and not bInRawBlock: cname = string.split(line)[1] doc, lineNo = GetComments(line, lineNo, lines) constants.append((cname, doc)) elif line[:2]=="//": rest = line[2:].strip() if rest.startswith("@pyswig"): doc, lineNo = GetComments(line, lineNo, lines) curMethod = doc[8:], [] methods.append(curMethod) elif rest.startswith("@pymeth "): doc, lineNo = GetComments(line, lineNo, lines) nativeMethods.append(line+doc) else: if rest.startswith("@"): doc, lineNo = GetComments(line, lineNo, lines) if curMethod: curMethod[1].append("// " + doc + '\n') else: extra_tags.append("// " + doc + '\n') except: print "Line %d is badly formed - %s" % (lineNo, str(sys.exc_value)) lineNo = lineNo + 1 # autoduck seems to crash when > ~97 methods. Loop multiple times, # creating a synthetic module name when this happens. max_methods = 90 # native ones first - hopefully never more than 90 of them! assert len(nativeMethods) < max_methods method_num = len(nativeMethods) chunk_number = 0 while 1: these_methods = methods[method_num:method_num+max_methods] if not these_methods: break thisModName = modName if g_com_parent: thisModName = "Py" + modName if chunk_number == 0: pass elif chunk_number == 1: thisModName = thisModName + " (more)" else: thisModName = thisModName + " (more %d)" % (chunk_number+1,) for (meth, extras) in these_methods: fields = string.split(meth,'|') if len(fields)<>3: print "**Error - %s does not have enough fields" % meth else: outFile.write("\n// @pymethod %s|%s|%s|%s\n" % (fields[0],thisModName,fields[1], fields[2])) for extra in extras: outFile.write(extra) if g_com_parent: outFile.write("\n// @object %s|%s" % (thisModName,modDoc)) outFile.write("\n// <nl>Derived from <o %s>\n" % (g_com_parent)) else: outFile.write("\n// @module %s|%s\n" % (thisModName,modDoc)) for (meth, extras) in these_methods: fields = string.split(meth,'|') outFile.write("// @pymeth %s|%s\n" % (fields[1], fields[2])) if chunk_number == 0: for meth in nativeMethods: outFile.write(meth) outFile.write("\n") chunk_number += 1 method_num += max_methods outFile.write("\n") for (cname, doc) in constants: outFile.write("// @const %s|%s|%s\n" % (modName, cname, doc) ) for extra in extra_tags: outFile.write("%s\n" % (extra) ) | de6d785f6e32e155061010dd66103baf7ea116fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/de6d785f6e32e155061010dd66103baf7ea116fe/makedfromi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2434,
67,
7687,
12,
267,
812,
16,
21651,
4672,
2590,
273,
5378,
6448,
4712,
273,
5378,
681,
1759,
273,
1408,
681,
461,
273,
1408,
2362,
273,
316,
812,
18,
896,
3548,
1435,
66... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2434,
67,
7687,
12,
267,
812,
16,
21651,
4672,
2590,
273,
5378,
6448,
4712,
273,
5378,
681,
1759,
273,
1408,
681,
461,
273,
1408,
2362,
273,
316,
812,
18,
896,
3548,
1435,
66... |
['response', ['mesg_num octets', ...]]. | ['response', ['mesg_num octets', ...], octets]. | def list(self, which=None): """Request listing, return result. | fc9f052e19f8490896d51accc3a4fd4cad2c7944 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/fc9f052e19f8490896d51accc3a4fd4cad2c7944/poplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
1492,
33,
7036,
4672,
3536,
691,
11591,
16,
327,
563,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
1492,
33,
7036,
4672,
3536,
691,
11591,
16,
327,
563,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.body.append (self.end_frametag()) | self.out.append (self.end_frametag()) | def depart_section (self, node): # Remove counter for potential subsections: LaTeXTranslator.depart_section (self, node) if (self.section_level == self.frame_level):#0 self.body.append (self.end_frametag()) | 7fa34d63a11663a7daeb27efb01eb826b364662a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1278/7fa34d63a11663a7daeb27efb01eb826b364662a/rst2beamer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
3464,
261,
2890,
16,
756,
4672,
468,
3581,
3895,
364,
8555,
720,
11657,
30,
21072,
21575,
60,
12233,
18,
323,
2680,
67,
3464,
261,
2890,
16,
756,
13,
309,
261,
2890,
18,
346... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
3464,
261,
2890,
16,
756,
4672,
468,
3581,
3895,
364,
8555,
720,
11657,
30,
21072,
21575,
60,
12233,
18,
323,
2680,
67,
3464,
261,
2890,
16,
756,
13,
309,
261,
2890,
18,
346... |
_verify_attributes('START SUITE', attrs, START_ATTRIBUTES+['longname']) | _verify_attributes('START SUITE', attrs, START_ATTRIBUTES+['longname', 'metadata']) | def start_suite(name, attrs): _verify_attributes('START SUITE', attrs, START_ATTRIBUTES+['longname']) | 5656b9141c15cb69990f6904f643ad7af168a769 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/5656b9141c15cb69990f6904f643ad7af168a769/attributeverifyinglistener.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
30676,
12,
529,
16,
3422,
4672,
389,
8705,
67,
4350,
2668,
7570,
11726,
5398,
2187,
3422,
16,
10485,
67,
22308,
15,
3292,
5748,
529,
2187,
296,
4165,
19486,
225,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
30676,
12,
529,
16,
3422,
4672,
389,
8705,
67,
4350,
2668,
7570,
11726,
5398,
2187,
3422,
16,
10485,
67,
22308,
15,
3292,
5748,
529,
2187,
296,
4165,
19486,
225,
2,
-100,
-100,
... |
"[private] save our current view into self.part [if not None] and forget about self.part" | """ [private] save our current view into self.part [if not None] and forget about self.part """ | def _close_part(self): "[private] save our current view into self.part [if not None] and forget about self.part" if self.part: self._saveLastViewIntoPart( self.part) self.part = None | 9dc95351096c9deab5f64e3e704bde7a93f95b49 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/9dc95351096c9deab5f64e3e704bde7a93f95b49/GLPane.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4412,
67,
2680,
12,
2890,
4672,
3536,
306,
1152,
65,
1923,
3134,
783,
1476,
1368,
365,
18,
2680,
306,
430,
486,
599,
65,
471,
13776,
2973,
365,
18,
2680,
3536,
309,
365,
18,
2680,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4412,
67,
2680,
12,
2890,
4672,
3536,
306,
1152,
65,
1923,
3134,
783,
1476,
1368,
365,
18,
2680,
306,
430,
486,
599,
65,
471,
13776,
2973,
365,
18,
2680,
3536,
309,
365,
18,
2680,... |
txt = None | def defrag(plist): """defrag(plist) -> ([not fragmented], [defragmented], [ [bad fragments], [bad fragments], ... ])""" frags = {} nofrag = PacketList() for p in plist: ip = p[IP] if IP not in p: nofrag.append(p) continue if ip.frag == 0 and ip.flags & 1 == 0: nofrag.append(p) continue uniq = (ip.id,ip.src,ip.dst,ip.proto) if uniq in frags: frags[uniq].append(p) else: frags[uniq] = PacketList([p]) defrag = [] missfrag = [] for lst in frags.itervalues(): lst.sort(lambda x,y:cmp(x.frag, y.frag)) p = lst[0] if p.frag > 0: missfrag.append(lst) continue p = p.copy() if Padding in p: del(p[Padding].underlayer.payload) ip = p[IP] if ip.len is None or ip.ihl is None: clen = len(ip.payload) else: clen = ip.len - (ip.ihl<<2) txt = Raw() for q in lst[1:]: if clen != q.frag<<3: if clen > q.frag<<3: warning("Fragment overlap (%i > %i) %r || %r || %r" % (clen, q.frag<<3, p,txt,q)) missfrag.append(lst) txt = None break if q[IP].len is None or q[IP].ihl is None: clen += len(q[IP].payload) else: clen += q[IP].len - (q[IP].ihl<<2) if Padding in q: del(q[Padding].underlayer.payload) txt.add_payload(q[IP].payload.copy()) if txt is None: continue ip.flags &= ~1 # !MF del(ip.chksum) del(ip.len) p = p/txt defrag.append(p) defrag2=PacketList() for p in defrag: defrag2.append(p.__class__(str(p))) return nofrag,defrag2,missfrag | 7e8bdd8210586069d64921ecdcaff510dbd1286b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7311/7e8bdd8210586069d64921ecdcaff510dbd1286b/inet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1652,
2458,
12,
17842,
4672,
3536,
536,
2458,
12,
17842,
13,
317,
23265,
902,
5481,
329,
6487,
306,
536,
3520,
329,
6487,
306,
306,
8759,
14656,
6487,
306,
8759,
14656,
6487,
1372,
308,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1652,
2458,
12,
17842,
4672,
3536,
536,
2458,
12,
17842,
13,
317,
23265,
902,
5481,
329,
6487,
306,
536,
3520,
329,
6487,
306,
306,
8759,
14656,
6487,
306,
8759,
14656,
6487,
1372,
308,
... | |
pathname = pathname_match.group(1) | pathname = os.path.dirname(pathname_match.group(1)) | def get_package_info(package_name, pkginfo, pkgchk): try: return package_info[package_name] except KeyError: version = None pathname = None try: sadm_contents = open('/var/sadm/install/contents', 'r').read() except EnvironmentError: pass else: sadm_re = re.compile('^(\S*/bin/CC)[= ].* %s$' % package_name, re.M) sadm_match = sadm_re.search(sadm_contents) if sadm_match: pathname = sadm_match.group(1) try: p = subprocess.Popen([pkginfo, '-l', package_name], stdout=subprocess.PIPE, stderr=open('/dev/null', 'w')) except EnvironmentError: pass else: pkginfo_contents = p.communicate()[0] version_re = re.compile('^ *VERSION:\s*(.*)$', re.M) version_match = version_re.search(pkginfo_contents) if version_match: version = version_match.group(1) if pathname is None: try: p = subprocess.Popen([pkgchk, '-l', package_name], stdout=subprocess.PIPE, stderr=open('/dev/null', 'w')) except EnvironmentError: pass else: pkgchk_contents = p.communicate()[0] pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M) pathname_match = pathname_re.search(pkgchk_contents) if pathname_match: pathname = pathname_match.group(1) package_info[package_name] = (version, pathname) return package_info[package_name] | fcdfe52e8e4306230db7a4aa6f63caf302bb1402 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12817/fcdfe52e8e4306230db7a4aa6f63caf302bb1402/sunc++.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5610,
67,
1376,
12,
5610,
67,
529,
16,
3475,
1376,
16,
3475,
27038,
4672,
775,
30,
327,
2181,
67,
1376,
63,
5610,
67,
529,
65,
1335,
4999,
30,
1177,
273,
599,
9806,
273,
599... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5610,
67,
1376,
12,
5610,
67,
529,
16,
3475,
1376,
16,
3475,
27038,
4672,
775,
30,
327,
2181,
67,
1376,
63,
5610,
67,
529,
65,
1335,
4999,
30,
1177,
273,
599,
9806,
273,
599... |
print prog_path time.sleep(2) | def install(prog_path): """ <Purpose> Goes through all the steps necessary to install seattle on the current system, printing status messages if not in silent mode. <Arguments> prog_path: Path to the directory in which seattle is being installed. <Exceptions> UnsupportedPythonError if the Python version is unsupported. <Side Effects> None. <Returns> None. """ global OS # Make sure we're running a supported version of Python version = sys.version.split(" ")[0].split(".") if version[0] != '2' or version[1] != '5': # If it's not Python 2.5 raise UnsupportedPythonError(version[0] + "." + version[1]) prog_path = os.path.realpath(prog_path) print prog_path time.sleep(2) # First, setup seattle to run at startup output("Preparing seattle to run at startup...") startup_retval = setup_startup(prog_path) if startup_retval: output("Done!") else: output("Failed.") # Next, if it is a Windows system and we were able to find the startup folder, # customize the uninstaller if (OS == "Windows" or OS == "WindowsCE") and startup_retval: output("Creating uninstaller...") setup_uninstaller(prog_path, startup_retval) output("Done!") # Next, setup the sitecustomize.py file, if running on WindowsCE if OS == "WindowsCE": output("Configuring python...") setup_sitecustomize(prog_path) output("Done!") # Next, customize the constants file output("Configuring seattle constants...") setup_constants(prog_path) output("Done!") # Next, generate the node keys output("Generating node keys (may take a few minutes)...") generate_keys(prog_path) output("Done!") # If on a Linux-like system, make sure that the scripts have the right permissions if OS != "Windows" and OS != "WindowsCE": output("Setting script permissions...") setup_permissions(prog_path) output("Done!") # Everything has been installed, so start seattle output("Starting seattle...") start_seattle(prog_path) output("Started!") # Display final messages if startup_retval: # The install went smoothly. output("seattle was successfully installed and has been started!") output("If you would like to uninstall seattle at any time, just run " + get_uninstaller_name() + ".") output("After running it, you can remove the directory containing seattle.") else: # We weren't able to find the startup folder output("seattle could not be installed correctly to run at startup, but it has been started.") output("If you would like to manually run seattle at any time, just run " + get_starter_file_name() + ".") | 2fb22fab19b0909e3adbe521cbe0ba20e7837f8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/2fb22fab19b0909e3adbe521cbe0ba20e7837f8c/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
12,
14654,
67,
803,
4672,
3536,
411,
10262,
4150,
34,
4220,
281,
3059,
777,
326,
6075,
4573,
358,
3799,
695,
4558,
298,
603,
326,
783,
2619,
16,
19171,
1267,
2743,
309,
486,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
12,
14654,
67,
803,
4672,
3536,
411,
10262,
4150,
34,
4220,
281,
3059,
777,
326,
6075,
4573,
358,
3799,
695,
4558,
298,
603,
326,
783,
2619,
16,
19171,
1267,
2743,
309,
486,
316,
... | |
if not (typ in (DictType, ListType, TupleType) and object): | if not (typ in (DictType, ListType, TupleType, StringType) and object): | def _safe_repr(object, context, maxlevels=None, level=0): level += 1 typ = type(object) if not (typ in (DictType, ListType, TupleType) and object): rep = `object` return rep, (rep and (rep[0] != '<')), 0 if context.has_key(id(object)): return `_Recursion(object)`, 0, 1 objid = id(object) context[objid] = 1 readable = 1 recursive = 0 startchar, endchar = {ListType: "[]", TupleType: "()", DictType: "{}"}[typ] if maxlevels and level > maxlevels: with_commas = "..." readable = 0 elif typ is DictType: components = [] for k, v in object.iteritems(): krepr, kreadable, krecur = _safe_repr(k, context, maxlevels, level) vrepr, vreadable, vrecur = _safe_repr(v, context, maxlevels, level) components.append("%s: %s" % (krepr, vrepr)) readable = readable and kreadable and vreadable recursive = recursive or krecur or vrecur with_commas = ", ".join(components) else: # list or tuple assert typ in (ListType, TupleType) components = [] for element in object: subrepr, subreadable, subrecur = _safe_repr( element, context, maxlevels, level) components.append(subrepr) readable = readable and subreadable recursive = recursive or subrecur if len(components) == 1 and typ is TupleType: components[0] += "," with_commas = ", ".join(components) s = "%s%s%s" % (startchar, with_commas, endchar) del context[objid] return s, readable and not recursive, recursive | a0d993b2886056d71790b67f0f5714fc6bdd62ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0d993b2886056d71790b67f0f5714fc6bdd62ef/pprint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4626,
67,
12715,
12,
1612,
16,
819,
16,
943,
12095,
33,
7036,
16,
1801,
33,
20,
4672,
1801,
1011,
404,
3815,
273,
618,
12,
1612,
13,
309,
486,
261,
12846,
316,
261,
5014,
559,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4626,
67,
12715,
12,
1612,
16,
819,
16,
943,
12095,
33,
7036,
16,
1801,
33,
20,
4672,
1801,
1011,
404,
3815,
273,
618,
12,
1612,
13,
309,
486,
261,
12846,
316,
261,
5014,
559,
1... |
ev = linalg.eigvals(a) | if a.dtype.type in (single, double): ad = a.astype(double) else: ad = a.astype(cdouble) ev = linalg.eigvals(ad) | def do(self, a, b): d = linalg.det(a) ev = linalg.eigvals(a) assert_almost_equal(d, multiply.reduce(ev)) | cf0dd874261547add03a56baf14b4d5102f64f1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/cf0dd874261547add03a56baf14b4d5102f64f1e/test_linalg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
279,
16,
324,
4672,
302,
273,
11818,
18,
8238,
12,
69,
13,
309,
279,
18,
8972,
18,
723,
316,
261,
7526,
16,
1645,
4672,
1261,
273,
279,
18,
689,
388,
12,
9056,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
279,
16,
324,
4672,
302,
273,
11818,
18,
8238,
12,
69,
13,
309,
279,
18,
8972,
18,
723,
316,
261,
7526,
16,
1645,
4672,
1261,
273,
279,
18,
689,
388,
12,
9056,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.