rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if self.allowed != None: s.write('<table summary="files">\n' \ | if self.allowed != None and self.show_names: s.write('<table summary="files" border=1>\n' \ | def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(s[i+1:]) except ValueError, e: return (400, 'Bad Request', {'Content-Type': 'text/plain'}, 'you sent me garbage - ' + str(e)) if path == '' or path == 'index.html': s = StringIO() s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n' \ '<html><head><title>BitTorrent download info</title></head>\n' \ '<body>\n' \ '<h3>BitTorrent download info</h3>\n'\ '<ul>\n' '<li><strong>tracker version:</strong> %s</li>\n' \ '<li><strong>server time:</strong> %s</li>\n' \ '</ul>\n' % (__init__.version, isotime())) names = self.downloads.keys() if names: names.sort() if self.allowed != None: s.write('<table summary="files">\n' \ '<tr><th>info hash</th><th>torrent name</th><th align="right">complete</th><th align="right">downloading</th></tr>\n') else: s.write('<table summary="files">\n' \ '<tr><th>info hash</th><th align="right">complete</th><th align="right">downloading</th></tr>\n') for name in names: l = self.downloads[name] c = len([1 for i in l.values() if i['left'] == 0]) d = len(l) - c if self.allowed != None and self.show_names and self.allowed.has_key(name): s.write('<tr><td><code>%s</code></td><td><code>%s</code></td><td align="right"><code>%i</code></td><td align="right"><code>%i</code></td></tr>\n' \ % (b2a_hex(name), self.allowed[name], c, d)) | dfdc76b107ec3a651b41d500aa24cc4458d46733 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/dfdc76b107ec3a651b41d500aa24cc4458d46733/track.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
1459,
16,
589,
16,
1607,
4672,
775,
30,
261,
9068,
16,
17345,
16,
589,
16,
13249,
16,
843,
16,
5481,
13,
273,
15185,
12,
803,
13,
589,
273,
25611,
12,
803,
25146,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
1459,
16,
589,
16,
1607,
4672,
775,
30,
261,
9068,
16,
17345,
16,
589,
16,
13249,
16,
843,
16,
5481,
13,
273,
15185,
12,
803,
13,
589,
273,
25611,
12,
803,
25146,
... |
db.readfp(f) return db.types_map | db.readfp(f, True) return db.types_map[True] | def read_mime_types(file): try: f = open(file) except IOError: return None db = MimeTypes() db.readfp(f) return db.types_map | bb51ed333b623b6acf90a34ec6da9b4d076503e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb51ed333b623b6acf90a34ec6da9b4d076503e5/mimetypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
11757,
67,
2352,
12,
768,
4672,
775,
30,
284,
273,
1696,
12,
768,
13,
1335,
8340,
30,
327,
599,
1319,
273,
22059,
2016,
1435,
1319,
18,
896,
7944,
12,
74,
16,
1053,
13,
327,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
11757,
67,
2352,
12,
768,
4672,
775,
30,
284,
273,
1696,
12,
768,
13,
1335,
8340,
30,
327,
599,
1319,
273,
22059,
2016,
1435,
1319,
18,
896,
7944,
12,
74,
16,
1053,
13,
327,... |
expr = re.compile(r'(\\.)') | expr = compile(r'(\\.)') | def escape(s): return s.replace('\n', '\\n').replace('"', '\\"') | fbc7a9225c4dcbd5451e999eabeec3606f4c3f1a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/fbc7a9225c4dcbd5451e999eabeec3606f4c3f1a/po.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4114,
12,
87,
4672,
327,
272,
18,
2079,
2668,
64,
82,
2187,
3718,
82,
16063,
2079,
22076,
2187,
3718,
5187,
13,
282,
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,
4114,
12,
87,
4672,
327,
272,
18,
2079,
2668,
64,
82,
2187,
3718,
82,
16063,
2079,
22076,
2187,
3718,
5187,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
result.append(PA(self.lower_left)) | result.append(PA(self.xyabsolute + self.lower_left)) | def _subcommands_corner_dots(self): result = [PU( )] result.append(PA(self.upper_left)) result += [PD( ), PU( )] result.append(PA(self.upper_right)) result += [PD( ), PU( )] result.append(PA(self.lower_left)) result += [PD( ), PU( )] result.append(PA(self.lower_right)) result += [PD( ), PU( )] return result | cd5cfeb256d607b0398a54ca138dbdcc9058e232 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3716/cd5cfeb256d607b0398a54ca138dbdcc9058e232/businesscard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1717,
7847,
67,
30519,
67,
72,
6968,
12,
2890,
4672,
563,
273,
306,
18061,
12,
262,
65,
563,
18,
6923,
12,
4066,
12,
2890,
18,
5797,
67,
4482,
3719,
563,
1011,
306,
21527,
12,
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,
389,
1717,
7847,
67,
30519,
67,
72,
6968,
12,
2890,
4672,
563,
273,
306,
18061,
12,
262,
65,
563,
18,
6923,
12,
4066,
12,
2890,
18,
5797,
67,
4482,
3719,
563,
1011,
306,
21527,
12,
2... |
dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE) | _, vbd_info = dom0.info['devices'][mounted_vbd_uuid] dom0.destroyDevice(dom0.getBlockDeviceClass(vbd_info['devid']), BOOTLOADER_LOOPBACK_DEVICE, force = True) | def _configureBootloader(self): """Run the bootloader if we're configured to do so.""" | f55a5dc321e56e4351ea72e53bddd7bb7e279661 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6195/f55a5dc321e56e4351ea72e53bddd7bb7e279661/XendDomainInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14895,
15817,
6714,
12,
2890,
4672,
3536,
1997,
326,
4835,
6714,
309,
732,
4565,
4351,
358,
741,
1427,
12123,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14895,
15817,
6714,
12,
2890,
4672,
3536,
1997,
326,
4835,
6714,
309,
732,
4565,
4351,
358,
741,
1427,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elif md.decl.type.isDtor(): | if md.decl.type.isDtor(): | block.addstmt(cxx.CppDirective('endif', '// ifdef DEBUG')) | 3d94f90bc71fec223796859b49666c55bb08751c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/3d94f90bc71fec223796859b49666c55bb08751c/lower.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1203,
18,
1289,
10589,
12,
71,
5279,
18,
39,
11858,
13307,
2668,
409,
430,
2187,
12084,
309,
536,
6369,
26112,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1203,
18,
1289,
10589,
12,
71,
5279,
18,
39,
11858,
13307,
2668,
409,
430,
2187,
12084,
309,
536,
6369,
26112,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.installed_packetlist.has_key(x[0].strip()): if self.installed_packetlist[x[0].strip()] == x[1].strip(): status = "installed" self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status)) | if self.installed_packetlist.has_key(x[0]): if self.opkgAvail: if self.upgradeable_packages.has_key(x[0]): status = "upgradeable" else: status = "installed" | def buildPacketList(self): self.list = [] self.cachelist = [] | 8600c86a6928e70d8468a55970d6933bbb9f71c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6652/8600c86a6928e70d8468a55970d6933bbb9f71c3/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
6667,
682,
12,
2890,
4672,
365,
18,
1098,
273,
5378,
365,
18,
17703,
5449,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
6667,
682,
12,
2890,
4672,
365,
18,
1098,
273,
5378,
365,
18,
17703,
5449,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def __init__(self): super(OpenAgedBalance, self).__init__() self._error_messages.update({ 'warning': 'Warning', 'term_overlap_desc': 'You cannot define overlapping terms'}) | def __init__(self): super(OpenAgedBalance, self).__init__() self._error_messages.update({ 'warning': 'Warning', 'term_overlap_desc': 'You cannot define overlapping terms'}) | ed5bd42bb8620f2ce5768b89c9d65497a58ae567 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9290/ed5bd42bb8620f2ce5768b89c9d65497a58ae567/account.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
3678,
37,
2423,
13937,
16,
365,
2934,
972,
2738,
972,
1435,
365,
6315,
1636,
67,
6833,
18,
2725,
12590,
296,
8551,
4278,
296,
6210,
2187,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
3678,
37,
2423,
13937,
16,
365,
2934,
972,
2738,
972,
1435,
365,
6315,
1636,
67,
6833,
18,
2725,
12590,
296,
8551,
4278,
296,
6210,
2187,
296,
... | |
b.comment("Also, you should use -fno-omit-frame-pointer in order to debug on 64-bit Linux.") | b.comment("Also, you should use -fno-omit-frame-pointer for better debugging support on 64-bit Linux.") | def build_casa(b, url, revision, type, ops, architecture): builddirs = {'Linux' : {'i386' : 'linux_gnu', 'x86_64' : 'linux_64b'}, 'Darwin' : {'10.5' : 'darwin', '10.6': 'darwin'}} if not ops in builddirs.keys() or \ not architecture in builddirs[ops].keys(): raise Exception, ("Unknown OS and architecture " + str(ops) + ", " + str(architecture) + ", must be one of " + str(builddirs)) # Setup platform- and machine dependent variables oss = platform('oss', ops) arch = platform('arch', architecture) builddir = platform('builddir', builddirs[ops][architecture]) if ops == "Darwin": datadir = machine('datadir', "/opt/casa_data/trunk") prefix = machine('prefix', "/opt/casa/active") # Prefix is hardcoded in 3rd-party executables if architecture == '10.5': coredir = platform('coredir', "core2-apple-darwin8") third = platform('third', "core2-apple-darwin8/3rd-party") else: coredir = platform('coredir', "core2-apple-darwin10") third = platform('third', "core2-apple-darwin10") else: datadir = machine('datadir', "/mnt/hgfs/trunk") prefix = machine('prefix', "/opt/casa") if ops == "Linux": threads = machine("threads", "2") else: threads = machine("threads", "4") b.comment("The following documentation was verified as of ", url, ", revision ", revision, " on " + time.asctime() + ". Here we go...") # # Install external packages # if type == "full": b.comment("Buidling CASA from source consists of two major steps: 1) Build and install CASACore, 2) Build \"code\" which uses the libraries from CASACore") b.comment("You will need to install quite a number of packages which are required for CASA development.") if ops == "Darwin": b.do("Create the directory, where you want to install CASA. On Mac, you should use a subdirectory of /opt/casa/. You do not need to (and should not) install CASA as root, just make the install directory writeable for non-root users.", "ls -l ", prefix) b.chdir(prefix, "/..") if architecture == '10.5': third_party = "3rd-party.tbz" d = "https://svn.cv.nrao.edu/casa/osx_distro/developers/10.5/" else: third_party = "core2.10.6.tar.bz2" d = "https://svn.cv.nrao.edu/casa/osx_distro/developers/10.6/" if False: b.do("", "curl " + d + third_party + " -o " + third_party) else: b.do("Now you should download " + d + third_party + " to the local directory. This could take a very long time, therefore I cheat and link to a local copy of the 3rd-party package", "ln -s /opt/casa_build/" + third_party + " .") if architecture == '10.5': qt = "qt-sdk-mac-opensource-2009.02.dmg" qwt = "qwt5.2.tbz" b.do("Then get the Qt SDK from " + d + " and put it in the current directory", "ln -s /opt/casa_build/" + qt + " .") b.do("Get qwt", "curl %s/%s -o %s" % (d, qwt, qwt)) b.do("You may want to double check that you have the right packages,", "cksum %s %s %s" % (third_party, qt, qwt)) else: gfortran = "gfortran-42-5646.pkg" b.do("Get the Fortran compiler,", "curl %s%s -o %s" % (d, gfortran, gfortran)) b.do("You may want to double check that you have the right packages,", "cksum %s %s" % (third_party, gfortran)) b.comment("The paths in the binary contents of the 3rd party package requires that it is extracted in this directory,") if architecture == '10.5': b.do("", "mkdir ", coredir) b.chdir(coredir) b.do("", "tar jxvf ../" + third_party) b.do("Workaround for CAS-2071, do not use the Qt in 3rd-party:", "rm -rf ", prefix, "/../", third, "/include/Qt*") b.chdir("3rd-party") b.do("", "tar jxvf ../../qwt5.2.tbz") b.chdir("../..") else: b.do("", "tar jxvf " + third_party) if architecture == "10.6": b.comment("In the, not so likely, case that you are running Snow Leopard on older hardware without 64bit support, you will need to do the following, because the distributed python and perl executables do not run on 32bit):") b.do("", "rm ", prefix, "/../", third, "/bin/python") b.do("", "rm ", prefix, "/../", third, "/bin/pythonw") b.do("", "ln -s /usr/bin/python ", prefix, "/../", third, "/bin/python") b.do("", "ln -s /usr/bin/pythonw ", prefix, "/../", third, "/bin/pythonw") b.comment("The python version must be 2.6.4. If it is not, go and install python 2.6.4") b.do("", prefix, "/../", third, "/bin/python -V") b.do("", prefix, "/../", third, "/bin/pythonw -V") b.do("Also, if your hardware is 32 bit, you need to put a perl in the path which works (version is less critical)", "rm ", prefix, "/../", third, "/bin/perl") b.do("", "which perl") if architecture == "10.5": b.do("", "hdiutil attach ./qt-sdk-mac-opensource-2009.02.dmg -mountroot .") b.comment("If you did not install Qt already, do 'sudo installer -package Qt\ SDK/QtSDK.mpkg/ -target .'") b.comment("Password:") b.comment("installer: Package name is Qt SDK") b.comment("installer: Installing at base path /") b.comment("installer: The install was successful.") else: b.comment("If you did not already, install gfortran") b.comment("'sudo installer -pkg " + gfortran + " -target /'") b.comment("2010-02-10 19:46:59.675 installer[463:4007] PackageKit: *** Missing bundle identifier: /Library/Receipts/Citrix ICA Client.pkg") b.comment("2010-02-10 19:46:59.850 installer[463:4007] PackageKit: *** Missing bundle identifier: /Library/Receipts/vpnclient-api.pkg") b.comment("2010-02-10 19:46:59.854 installer[463:4007] PackageKit: *** Missing bundle identifier: /Library/Receipts/vpnclient-bin.pkg") b.comment("2010-02-10 19:46:59.864 installer[463:4007] PackageKit: *** Missing bundle identifier: /Library/Receipts/vpnclient-gui.pkg") b.comment("2010-02-10 19:46:59.880 installer[463:4007] PackageKit: *** Missing bundle identifier: /Library/Receipts/vpnclient-kext.pkg") b.comment("2010-02-10 19:46:59.889 installer[463:4007] PackageKit: *** Missing bundle identifier: /Library/Receipts/vpnclient-profiles.pkg") b.comment("2010-02-10 19:46:59.906 installer[463:4007] PackageKit: *** Missing bundle identifier: /Library/Receipts/vpnclient-startup.pkg") b.comment("installer: Package name is GNU Fortran 4.2.4 for Xcode 3.2 (build 5646)") b.comment("installer: Installing at base path /") b.comment("installer: The install was successful.") b.comment("If you did not already install CMake, do it now.") b.chdir(prefix, "/..") b.do("", "curl http://www.cmake.org/files/v2.8/cmake-2.8.0-Darwin-universal.dmg -o cmake-2.8.0-Darwin-universal.dmg") b.do("", "hdiutil attach cmake-2.8.0-Darwin-universal.dmg -mountroot .") b.comment("sudo installer -package cmake-2.8.0-Darwin-universal/cmake-2.8.0-Darwin-universal.pkg -target /") b.comment("Password:") b.comment("installer: Package name is CMake") b.comment("installer: Installing at base path /") b.comment("installer: The install was successful.") else: # Linux b.comment("On Linux, we use yum to install the required RPM development packages. You will need root access to do so. In the following the sudo command is used.") b.do("First, setup the yum configuration to point to CASA's repositories. A way to do that is to create a /etc/yum.repos.d/casa.repo containing the following four lines (execute these commands)", "echo [casa] > casa.repo") b.do("", "echo \"name=CASA RPMs for RedHat Enterprise Linux 5 (", arch, ")\" >> casa.repo") b.do("", "echo \"baseurl=https://svn.cv.nrao.edu/casa/repo/el5/", arch, "\" >> casa.repo") b.do("", "echo \"gpgkey=https://svn.cv.nrao.edu/casa/RPM-GPG-KEY-casa http://ww.jpackage.org/jpackage.asc http://svn.cv.nrao.edu/casa/repo/el5/RPM-GPG-KEY-EPEL\" >> casa.repo") b.do("Move the file to /etc/yum.repos.d/ as superuser", "sudo mv casa.repo /etc/yum.repos.d/") b.do("Your yum configuration should now look like this,", "cat /etc/yum.repos.d/casa.repo") b.do("Remove this package if you have it installed (which is to avoid conflicts with qt434-devel-4.3.4),", "sudo yum -y erase qt4-devel") b.comment("Install all required development packages. Either answer yes when prompted, or pass the -y flag to yum.") if False: # Brute force b.do("", "sudo yum -y install casapy-test-devel") else: b.do("", "sudo yum -y install antlr-c++-devel antlr-c++-shared casapy-boost casapy-boost-devel casapy-ccmtools casapy-ccmtools-python casapy-ccmtools-shared casapy-python casapy-python-devel cfitsio-devel dbus-c++ fftw3 fftw3-devel qt434-devel qt434-qwt-devel rpfits tix tix-devel wcslib xerces-c xerces-c-devel aatm aatm-devel dbus-c++-devel blas-devel lapack lapack-devel pgplot pgplot-devel cmake") # It should cause packages to be installed only from the casa RPM # repository. If there were conflicts with other repositories, you # might need to b.do("", "sudo rm -f /etc/yum.repos.d/*") and start over b.comment("Create the directory where you want to build CASA. Here we choose to build everything in /opt/casa. You could also create a subdirectory in your home directory, but be aware that if have an NFS mounted home directory, all the file I/O that the build system is going to do, will be somewhat slower.") b.do("", "sudo chmod 777 /opt") b.do("", "mkdir ", prefix) b.comment("For building CASACore you will need to install SCons") b.chdir("/tmp") b.do("", "wget http://prdownloads.sourceforge.net/scons/scons-1.2.0.tar.gz") # Darwin: b.do("", "curl -o ./scons-1.2.0.tar.gz http://heanet.dl.sourceforge.net/project/scons/scons/1.2.0/scons-1.2.0.tar.gz") # But don't need to install scons on mac b.do("", "tar zxvf scons-1.2.0.tar.gz") b.chdir("scons-1.2.0") b.do("You can install the scons executable whereever you like, just change the --prefix", "python setup.py install --prefix=", prefix, "/scons") # endif full build if type == "incremental" and ops == "Linux": if False: b.do("", "sudo yum -y upgrade antlr-c++-devel antlr-c++-shared casapy-boost casapy-boost-devel casapy-ccmtools casapy-ccmtools-python casapy-ccmtools-shared casapy-python casapy-python-devel cfitsio-devel dbus-c++ fftw3 fftw3-devel qt434-devel qt434-qwt-devel rpfits tix tix-devel wcslib xerces-c xerces-c-devel aatm aatm-devel dbus-c++-devel blas-devel cmake") if ops == "Darwin": b.comment("It is essential that 3rd-party/bin comes before other stuff in your $PATH.") b.set_env('PATH', prefix, "/../", third, "/bin:$PATH") b.set_env('PATH', "$PATH:/Applications/CMake\\ 2.8-0.app/Contents/bin") b.comment("This is a workaround for QWT and CASACore libraries not containing the proper rpaths (Note: Do not define the environment variable named DYLD_LIBRARY_PATH or something else might break.)") if architecture == "10.5": qwtdir = "qwt-5.2.0" else: qwtdir = "qwt-5.2.1-svn" b.set_env('DYLD_FALLBACK_LIBRARY_PATH', prefix, "/", builddir, "/lib:", prefix, "/../", third, "/" + qwtdir + "/lib:", prefix, "/../", third, "/lib") else: b.set_env('PATH', "$PATH:", prefix, "/scons/bin:/usr/lib/casapy/bin") if type == "full": b.comment("You have now installed all prequisite packages. It is time to compile.") if type == "full" and ops == "Darwin": b.comment("Install aatm from sources.") b.chdir(prefix) b.svn_exe(url + "/aatm", revision, "aatm") b.chdir("aatm") if ops == "Linux": b.do("", "./configure --prefix=", prefix, "/", builddir, " --without-boost") elif architecture == "10.5": b.do("", "./configure --prefix=", prefix, "/", builddir, " --with-boost=", prefix, "/../", third, " --with-boost-program-options=\"boost_program_options-mt-1_35\" LDFLAGS=\"-march=i586 -mtune=nocona\" CFLAGS=\"-march=i586 -mtune=nocona\" CXXFLAGS=\"-march=i586 -mtune=nocona\"") else: b.do("", "./configure --prefix=", prefix, "/", builddir, " --with-boost=", prefix, "/../", third, " LDFLAGS=\"-arch i386\" CXXFLAGS=\"-arch i386\"") b.do("", "make -j ", threads) b.do("", "make install") if type == "full" and ops == "Darwin" and architecture == "10.5": b.comment("Build WCSLIB from sources") b.chdir(prefix) b.svn_exe(url + "/wcslib", revision, "wcslib") b.chdir("./wcslib") b.do("This directory must already exist, or the WCSLIB build will fail", "mkdir -p ../", builddir, "/bin") b.comment("Compile WCSLIB, make sure that . is in the PATH, or the build will fail") b.set_env('PATH', "$PATH:.") b.do("", "./configure --prefix=", prefix, "/", builddir, " F77=gfortran FFLAGS=-fPIC CFLAGS=-fPIC") b.do("Warning: Do not try parallel building (failures have been seen which do not happen with a non-parallel build)", "make -j 1") b.do("", "make install") b.chdir("..") b.chdir(prefix) if type != "test": b.comment("Check out CASACore's sources.") b.svn_exe(url + "/casacore", revision, "casacore") if type == "full": b.comment("We need parts of CASA's data repository, ", prefix, "/data/geodetic and ", prefix, "/data/ephemerides, in order to build CASACore.") if ops == "Darwin": b.comment("The location of the data repository at /opt/casa/data is fixed on Mac.") b.do("", "rm -rf ", prefix, "/data") b.do("", "mkdir -p ./data") b.chdir("./data") b.do("", "svn checkout https://svn.cv.nrao.edu/svn/casa-data/trunk/ephemerides ephemerides") b.do("", "svn checkout https://svn.cv.nrao.edu/svn/casa-data/trunk/geodetic geodetic") b.chdir("..") b.comment("Compile CASACore.") b.chdir("casacore") if architecture == "x86_64": extra_cpp_flags = platform('extra_cpp_flags', ' -DAIPS_64B') else: extra_cpp_flags = platform('extra_cpp_flags', '') if type == "test": if False: b.do("", "scons -j ", threads, " test") else: b.comment("You need to give quite many command line options to scons for it to find the packages it needs. You are advised to put the scons command in a one-liner script (or save the command somewhere else), so that you can easily repeat it later.") b.comment("SCons' -j option is used to enable parallel builds. See scons --help for more.") b.comment("The --extra-cppflags option specifies the compile flags (for C++ code), you can add -g in order to compile with debugging info enabled.") if ops == "Linux": b.comment("Also, you should use -fno-omit-frame-pointer in order to debug on 64-bit Linux.") b.do("", "scons -j ", threads, " --prefix=", prefix, "/", builddir, " --extra-cppflags=\"-g -fno-omit-frame-pointer -DCASA_USECASAPATH -DCASACORE_NEEDS_RETHROW", extra_cpp_flags, "\" --libdir=", prefix, "/", builddir, "/lib --data-dir=", prefix, "/data --cfitsio-libdir=/usr/lib --cfitsio-incdir=/usr/include/cfitsio --extra-cflags=\"-g -fno-omit-frame-pointer\" --extra-fflags=\"-g -fno-omit-frame-pointer\" --extra-libs=\"-lfftw3f_threads -lfftw3_threads -lfftw3f -lfftw3 -lgomp\" --enable-shared --disable-static") elif ops == "Darwin": b.do("", "scons -j ", threads, " --extra-root=", prefix, "/../", third, " --prefix=", prefix, "/", builddir, " --extra-cppflags=\"-g -DCASA_USECASAPATH -DCASACORE_NEEDS_RETHROW -DCASACORE_NOEXIT -fopenmp\" --data-dir=", prefix, "/../data --wcs-root=", prefix, "/", builddir, " --cfitsio-libdir=", prefix, "/../", third, "/lib --cfitsio-incdir=", prefix, "/../", third, "/include --fftw3-root=", prefix, "/../", third, " --extra-libs=\"-lfftw3f_threads -lfftw3_threads -lfftw3f -lfftw3 -lgomp\" --enable-shared --disable-static") else: assert False b.do("If scons did not end with an error message, the build was successful and you can install the libraries and headers", "scons install") if ops == "Darwin": b.comment("If the compilation of CASACore stops with the error message \"flex: fatal internal error, exec failed\", it might help to download and install flex-2.5.35 from sources, put it in your path and try again.") b.chdir("..") b.comment("Next up is CASA non-core,") if type != "test": b.svn_exe(url + "/code", revision, "code") b.chdir("code") if type == "full": b.comment("You need to create a build directory, which holds cmake internals and object files (libraries etc.), before they are installed into ", prefix, "/", builddir) b.comment("You may have more than one build directory, e.g. for debug and release, or cross compiling. We'll just use one named build") b.do("", "mkdir ./build") b.chdir("build") b.do("Invoke CMake. The argument to cmake is the path to your source directory, in this case the parent directory", "cmake ..") b.chdir("..") if type != "test": b.chdir("build") b.do("", "make -j ", threads, " VERBOSE=on") b.do("You should now have the casapy executable (and other executables) at this location:", "ls -l ", prefix, "/", builddir, "/bin") b.comment("Build ASAP (optionally, if you want to reduce single dish data). This must be done after building the rest of CASA.") b.chdir(prefix) b.svn_exe(url + "/asap", revision, "asap") b.chdir("asap") b.do("", "make") b.do("", "make install") if type == "test" or type == "full": b.comment("In order to verify that your build is correct, you may want to run the python unit test suite.") b.comment("First you must check out CASA's data repository from https://svn.cv.nrao.edu/svn/casa-data/trunk and create a link to it from where you built CASA.") b.comment("The data repository is big. You can save 50% of disk space if you retrieve the repository with 'svn export' instead of 'svn checkout'.") b.do("Remove the link first (in case it already exists)", "rm -f ", prefix, "/data") b.do("", "ln -s ", datadir, " ", prefix, "/data") b.comment("Then setup your CASAPATH and PATH environment variable in order to be able to run casapy. Just source the script that was created during the build:") b.do("", "source ", prefix, "/casainit.sh") b.comment("or you can set the variables manually (note: it is a space, not a '/', in CASAPATH)") b.set_env('CASAPATH', "", prefix, " ", builddir) b.set_env('PATH', "$PATH:", prefix, "/", builddir, "/bin") b.do("Then launch the python unit test suite,", "casapy --nogui --log2term -c ", prefix, "/code/xmlcasa/scripts/regressions/admin/runUnitTest.py --mem") b.comment("which will summarize near the end if your build is okay or if there were problems.") # # Does not seem to return here... # #b.do("", "rm -f $HOME/XUnit.tar.gz") #b.chdir("nosexml") #b.do("", "tar zcf $HOME/XUnit.tar.gz *.xml") if False: b.comment("Run regression suite...") b.do("Link to the local data repository checkout", "rm -rf ", prefix, "/data") b.do("", "ln -s ", datadir, " ", prefix, "/data") b.do("Get old results out of the way and launch the suite,", "rm -rf /tmp/results") b.do("", "mkdir -p /tmp/results") b.do("", prefix, "/code/xmlcasa/scripts/regressions/admin/scheduler.pl -all -noloop -noclean -res_dir=/tmp/results -work=/tmp/work /tmp/ ", prefix, "/data 9999 14400 </dev/null") | a2d063af78340cec21794dd771c7d1c6ee6590d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/a2d063af78340cec21794dd771c7d1c6ee6590d4/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6349,
69,
12,
70,
16,
880,
16,
6350,
16,
618,
16,
6727,
16,
27418,
4672,
225,
25666,
330,
449,
10539,
273,
13666,
19475,
11,
294,
13666,
77,
23,
5292,
11,
294,
296,
20132,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6349,
69,
12,
70,
16,
880,
16,
6350,
16,
618,
16,
6727,
16,
27418,
4672,
225,
25666,
330,
449,
10539,
273,
13666,
19475,
11,
294,
13666,
77,
23,
5292,
11,
294,
296,
20132,
... |
btn = wx.Button(self, -1, ' Close ', (x_pos + 120, y_pos), but_size) | btn = wx.Button(self, wx.ID_CANCEL, ' Close ', (x_pos + 120, y_pos), but_size) | def __init__(self, parent, month=None, day = None, year=None): wx.Dialog.__init__(self, parent, -1, "Event Calendar", wx.DefaultPosition, (280, 360)) | dba0885d8c52d3a9a3e3f3887b525db57ba759f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/dba0885d8c52d3a9a3e3f3887b525db57ba759f7/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
3138,
33,
7036,
16,
2548,
273,
599,
16,
3286,
33,
7036,
4672,
7075,
18,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
315,
1133,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
3138,
33,
7036,
16,
2548,
273,
599,
16,
3286,
33,
7036,
4672,
7075,
18,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
315,
1133,... |
task_dismiss.add_accelerator( | self.dismiss_mi.add_accelerator( | def _init_accelerators(self): | 75a4f8fc4331cc720e9d8c18e303ddad24d6afbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/75a4f8fc4331cc720e9d8c18e303ddad24d6afbc/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
8981,
22990,
3062,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
389,
2738,
67,
8981,
22990,
3062,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
% (self.config.project, self.config.version))\ .encode('utf-8')) | % (self.config.project, self.config.version) ).encode('utf-8')) | def dump_inventory(self): self.info(bold('dumping object inventory... '), nonl=True) f = open(path.join(self.outdir, INVENTORY_FILENAME), 'wb') try: f.write((u'# Sphinx inventory version 2\n' u'# Project: %s\n' u'# Version: %s\n' u'# The remainder of this file is compressed using zlib.\n' % (self.config.project, self.config.version))\ .encode('utf-8')) compressor = zlib.compressobj(9) for domainname, domain in self.env.domains.iteritems(): for name, dispname, type, docname, anchor, prio in \ domain.get_objects(): if anchor.endswith(name): # this can shorten the inventory by as much as 25% anchor = anchor[:-len(name)] + '$' uri = self.get_target_uri(docname) + '#' + anchor if dispname == name: dispname = u'-' f.write(compressor.compress( (u'%s %s:%s %s %s %s\n' % (name, domainname, type, prio, uri, dispname))\ .encode('utf-8'))) f.write(compressor.flush()) finally: f.close() self.info('done') | 3bf665e01829e90bb472469b571e6fffe3075cf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/3bf665e01829e90bb472469b571e6fffe3075cf6/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
26024,
12,
2890,
4672,
365,
18,
1376,
12,
16390,
2668,
13302,
1382,
733,
13086,
2777,
296,
3631,
1661,
80,
33,
5510,
13,
284,
273,
1696,
12,
803,
18,
5701,
12,
2890,
18,
659,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
67,
26024,
12,
2890,
4672,
365,
18,
1376,
12,
16390,
2668,
13302,
1382,
733,
13086,
2777,
296,
3631,
1661,
80,
33,
5510,
13,
284,
273,
1696,
12,
803,
18,
5701,
12,
2890,
18,
659,... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addindex(ln=cdslang, idxNAME='', callback="yes", confirm=-1): """form to add a new index. idxNAME - the name of the new index""" output = "" subtitle = """<a name="3"></a>3. Add new index""" text = """ <span class="adminlabel">Index name</span> <input class="admin_w200" type="text" name="idxNAME" value="%s" /><br> """ % idxNAME output = createhiddenform(action="%s/admin/bibindex/bibindexadmin.py/addindex" % weburl, text=text, ln=ln, button="Add index", confirm=1) if idxNAME and confirm in ["1", 1]: res = add_idx(idxNAME) output += write_outcome(res) + """<br><a href="%s/admin/bibindex/bibindexadmin.py/editindex?idxID=%s&ln=%s">Configure this index</a>.""" % (weburl, res[1], ln) elif confirm not in ["-1", -1]: output += """<b><span class="info">Please give the index a name.</span></b> """ try: body = [output, extra] except NameError: body = [output] if callback: return perform_index(ln, "perform_addindex", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | 2bfebc745d97514fe63c0e385bb842bede8f697e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/2bfebc745d97514fe63c0e385bb842bede8f697e/bibindexadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
1289,
1615,
12,
2370,
33,
4315,
2069,
539,
16,
2067,
1985,
2218,
2187,
1348,
1546,
9707,
3113,
6932,
29711,
21,
4672,
3536,
687,
358,
527,
279,
394,
770,
18,
2067,
1985,
300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
1289,
1615,
12,
2370,
33,
4315,
2069,
539,
16,
2067,
1985,
2218,
2187,
1348,
1546,
9707,
3113,
6932,
29711,
21,
4672,
3536,
687,
358,
527,
279,
394,
770,
18,
2067,
1985,
300,
... |
... t = tree("ABCDEFGHIJKLMNOPQRSTUVWXYZ") ... ... for x in t: | >>> t = tree("ABCDEFGHIJKLMNOPQRSTUVWXYZ") >>> >>> for x in t: | >>> def inorder(t): | d62e37d3721d97506f0474aaf970232447adfa04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d62e37d3721d97506f0474aaf970232447adfa04/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
316,
1019,
12,
88,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
316,
1019,
12,
88,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if not newresult['byHostId'].has_key(hostid): newresult['byHostId'][hostid] = [v] | if not cache[directoryname]['byHostId'].has_key(hostid): cache[directoryname]['byHostId'][hostid] = [v] | def populate_directory_cache(directory): repo = directory.repository # if a directory is in more than one category, problem... if repo is not None: category = repo.category else: numcats = len(directory.categories) if numcats == 0: # no category, so we can't know a mirror host's URLs. # nothing to add. return elif numcats >= 1: # any of them will do, so just look at the first one category = directory.categories[0] path = directory.name[len(category.topdir.name)+1:] result = _do_query_directory(directory, category) newresult = {'global':[], 'byCountry':{}, 'byHostId':{}, 'subpath':path} for (hostid, country, hcurl, siteprivate, hostprivate) in result: country = country.upper() v = (hostid, hcurl) if not siteprivate and not hostprivate: newresult['global'].append(v) if not newresult['byCountry'].has_key(country): newresult['byCountry'][country] = [v] else: newresult['byCountry'][country].append(v) if not newresult['byHostId'].has_key(hostid): newresult['byHostId'][hostid] = [v] else: newresult['byHostId'][hostid].append(v) global mirrorlist_cache mirrorlist_cache[directory.name] = newresult global repo_arch_to_directoryname if repo is not None: repo_arch_to_directoryname[(repo.prefix, repo.arch.name)] = directory.name | 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,
6490,
67,
5149,
67,
2493,
12,
5149,
4672,
3538,
273,
1867,
18,
9071,
468,
309,
279,
1867,
353,
316,
1898,
2353,
1245,
3150,
16,
6199,
2777,
309,
3538,
353,
486,
599,
30,
3150,
273,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
5149,
67,
2493,
12,
5149,
4672,
3538,
273,
1867,
18,
9071,
468,
309,
279,
1867,
353,
316,
1898,
2353,
1245,
3150,
16,
6199,
2777,
309,
3538,
353,
486,
599,
30,
3150,
273,
353... |
r += "[+ FOR " + gtag + " +][+ ." + gtag + " +] [+ ENDFOR +]" r += "[+ ELSE +][+ FOR " + default_tag + " +][+ ." + default_tag + " +] [+ ENDFOR +][+ ENDIF +]" return r def under_conditional(x): return "[+ IF condition +]\nif [+ condition +]\n[+ ENDIF +]" + x + "[+ IF condition +]\nendif\n[+ ENDIF +]" | r += "[+ FOR " + gtag + " +]" + closure("[+ ." + gtag + " +]") + "[+ ENDFOR +]" r += "[+ ELSE +][+ FOR " + tag + " +]" + closure("[+ ." + tag + " +]") + "[+ ENDFOR +][+ ENDIF +]" return r | def platform_values(platform, group_tag, default_tag): r = "" for group in RMAP[platform]: gtag = group + group_tag if group == RMAP[platform][0]: r += "[+ IF " + gtag + " +]" else: r += "[+ ELIF " + gtag + " +]" r += "[+ FOR " + gtag + " +][+ ." + gtag + " +] [+ ENDFOR +]" r += "[+ ELSE +][+ FOR " + default_tag + " +][+ ." + default_tag + " +] [+ ENDFOR +][+ ENDIF +]" return r | c8d22d34fb910911782f3cb62d58a3495edc8286 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9475/c8d22d34fb910911782f3cb62d58a3495edc8286/gentpl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4072,
67,
2372,
12,
9898,
16,
1041,
67,
2692,
16,
805,
67,
2692,
4672,
436,
273,
1408,
364,
1041,
316,
534,
8352,
63,
9898,
14542,
314,
2692,
273,
1041,
397,
1041,
67,
2692,
225,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4072,
67,
2372,
12,
9898,
16,
1041,
67,
2692,
16,
805,
67,
2692,
4672,
436,
273,
1408,
364,
1041,
316,
534,
8352,
63,
9898,
14542,
314,
2692,
273,
1041,
397,
1041,
67,
2692,
225,
309,
... |
INNER JOIN wikiusers ON revision_histories.wikiusers_id = wikiusers.id | LEFT JOIN wikiusers ON revision_histories.wikiusers_id = wikiusers.id LEFT JOIN deleted_wikiusers ON revision_histories.wikiusers_id = deleted_wikiusers.id | def get_ZonedDate(d, time): """Given a time (as given by time.time()) and a dictionary which may have a 'preferences' field, return a suitable ZonedDate object. """ tz = userprefs.USER_PREFS['time_zone']['default'] if d.has_key('preferences'): tz = d['preferences']['time_zone'] return ZonedDate(time, tz) | ae430d435e68643193c5a5eea5e48d44f9cbdcbd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8158/ae430d435e68643193c5a5eea5e48d44f9cbdcbd/gliki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
62,
8184,
1626,
12,
72,
16,
813,
4672,
3536,
6083,
279,
813,
261,
345,
864,
635,
813,
18,
957,
10756,
471,
279,
3880,
1492,
2026,
1240,
279,
296,
23219,
11,
652,
16,
327,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
62,
8184,
1626,
12,
72,
16,
813,
4672,
3536,
6083,
279,
813,
261,
345,
864,
635,
813,
18,
957,
10756,
471,
279,
3880,
1492,
2026,
1240,
279,
296,
23219,
11,
652,
16,
327,
27... |
u'[]' self.assert_equal(env.from_string('{{ missing is not defined }}').render, 'True') | self.assert_equal(env.from_string('{{ missing is not defined }}').render(), 'True') | def test_debug_undefined(): env = Environment(undefined=DebugUndefined) self.assert_equal(env.from_string('{{ missing }}').render(), '{{ missing }}') self.assert_raises(UndefinedError, env.from_string('{{ missing.attribute }}').render()) self.assert_equal(env.from_string('{{ missing|list }}').render(), '[]') u'[]' self.assert_equal(env.from_string('{{ missing is not defined }}').render, 'True') self.assert_equal(env.from_string('{{ foo.missing }}').render(foo=42), u"{{ no such element: int['missing'] }}") self.assert_equal(env.from_string('{{ not missing }}').render(), 'True') | 82a2225ac939318e7d812cb4ae537be9fb6362cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14446/82a2225ac939318e7d812cb4ae537be9fb6362cf/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4148,
67,
5978,
13332,
1550,
273,
7518,
12,
5978,
33,
2829,
10317,
13,
365,
18,
11231,
67,
9729,
12,
3074,
18,
2080,
67,
1080,
2668,
12187,
3315,
29893,
2934,
5902,
9334,
12997... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4148,
67,
5978,
13332,
1550,
273,
7518,
12,
5978,
33,
2829,
10317,
13,
365,
18,
11231,
67,
9729,
12,
3074,
18,
2080,
67,
1080,
2668,
12187,
3315,
29893,
2934,
5902,
9334,
12997... |
self.atoms.SetCartesianPositions(array(atoms.get_positions())) | self.atoms.SetCartesianPositions(array(atoms.get_positions(), Float)) | def get_potential_energy(self, atoms): from Numeric import array # XXXX what about the cell? self.atoms.SetCartesianPositions(array(atoms.get_positions())) return self.calc.GetPotentialEnergy() | 00836fe7ba7dc98ee8997299b7e06ef0e82cd0bc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5735/00836fe7ba7dc98ee8997299b7e06ef0e82cd0bc/old.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26451,
67,
15358,
12,
2890,
16,
9006,
4672,
628,
16980,
1930,
526,
468,
11329,
60,
4121,
2973,
326,
2484,
35,
365,
18,
14937,
18,
694,
13006,
13404,
11024,
12,
1126,
12,
14937,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26451,
67,
15358,
12,
2890,
16,
9006,
4672,
628,
16980,
1930,
526,
468,
11329,
60,
4121,
2973,
326,
2484,
35,
365,
18,
14937,
18,
694,
13006,
13404,
11024,
12,
1126,
12,
14937,
... |
rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir) | D = os.path.join(os.path.dirname(reportlab.__file__), 'tools','pythonpoint') fn = os.path.join(D,'stdparser.py') if os.path.isfile(fn) or os.path.isfile(fn+'c') or os.path.isfile(fn+'o'): m1 = recursiveImport('stdparser', baseDir=D) | def test2(self): "try under a directory NOT on the path" rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir) | fdf9ba86294407f6a1fef0d23d826b6599e6b69e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/fdf9ba86294407f6a1fef0d23d826b6599e6b69e/test_lib_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
22,
12,
2890,
4672,
315,
698,
3613,
279,
1867,
4269,
603,
326,
589,
6,
463,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
6006,
7411,
16186,
768,
972,
3631,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22,
12,
2890,
4672,
315,
698,
3613,
279,
1867,
4269,
603,
326,
589,
6,
463,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
6006,
7411,
16186,
768,
972,
3631,
29... |
label_parts.append(_('%d Channel Folders Selected') % self.folder_count) label_parts.append(_('(contains %d channels)') % self.folder_child_count) | label_parts.append(ngettext( '%(count)d Channel Folder Selected', '%(count)d Channel Folders Selected', self.folder_count, {"count": self.folder_count})) label_parts.append(ngettext( '(contains %(count)d channel)', '(contains %(count)d channels)', self.folder_child_count, {"count": self.folder_child_count})) | def _make_label(self, tab_type, selected_tabs): label_parts = [] if self.folder_count > 0: if tab_type in ('feed', 'audio-feed'): label_parts.append(_('%d Channel Folders Selected') % self.folder_count) label_parts.append(_('(contains %d channels)') % self.folder_child_count) else: label_parts.append(_('%d Playlist Folders Selected') % self.folder_count) label_parts.append(_('(contains %d playlists)') % self.folder_child_count) | 77197da57d686c7e5fa90603dbf079559bd86730 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/77197da57d686c7e5fa90603dbf079559bd86730/displays.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
1925,
12,
2890,
16,
3246,
67,
723,
16,
3170,
67,
16056,
4672,
1433,
67,
6019,
273,
5378,
309,
365,
18,
5609,
67,
1883,
405,
374,
30,
309,
3246,
67,
723,
316,
7707,
784... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
1925,
12,
2890,
16,
3246,
67,
723,
16,
3170,
67,
16056,
4672,
1433,
67,
6019,
273,
5378,
309,
365,
18,
5609,
67,
1883,
405,
374,
30,
309,
3246,
67,
723,
316,
7707,
784... |
goodUnits = lineItem.numberUnitsGood damadgedUnits =lineItem.numberUnitsDamaged damadgedReason = lineItem.unitsDamagedReason.compasCode lostUnits =lineItem.numberUnitsLost lossReason = lineItem.unitsLostReason.compasCode | goodUnits = unicode(lineItem.numberUnitsGood) if lineItem.numberUnitsDamaged > 0: damadgedUnits =unicode(lineItem.numberUnitsDamaged) damadgedReason = unicode(lineItem.unitsDamagedReason.compasCode) else: damadgedReason = u'' damadgedUnits = u'' if lineItem.numberUnitsLost: lostUnits =unicode(lineItem.numberUnitsLost) lossReason = unicode(lineItem.unitsLostReason.compasCode) else: lossReason = u'' lostUnits = u'' | def write_receipt_waybill_compas(self,waybill_id): db = cx_Oracle.Connection(u'TESTJERX001/TESTJERX001@//10.11.216.4:1521/JERX001') cursor = db.cursor()#connections['compas'].cursor() self.ErrorMessages = '' self.ErrorCodes = '' the_waybill = Waybill.objects.get(id=waybill_id) lineItems = the_waybill.loadingdetail_set.select_related() WB_CODE = the_waybill.waybillNumber receiverPerson = EpicPerson.objects.get(person_pk = the_waybill.recipientName) recPersonOUC = receiverPerson.org_unit_code recPersonCode = receiverPerson.code arrival_date = the_waybill.recipientArrivalDate all_ok = True ## check if containers = 2 & lines = 2 twoCont = False if lineItems.count() == 2: if len(the_waybill.containerTwoNumber) > 0: twoCont = True codeLetter = u'A' db.begin() for lineItem in lineItems: CURR_CODE=unicode(datetime.datetime.now().strftime('%y') +WB_CODE) if twoCont: CURR_CODE = unicode(datetime.datetime.now().strftime('%y') + codeLetter + WB_CODE) codeLetter = u'B' goodUnits = lineItem.numberUnitsGood damadgedUnits =lineItem.numberUnitsDamaged damadgedReason = lineItem.unitsDamagedReason.compasCode lostUnits =lineItem.numberUnitsLost lossReason = lineItem.unitsLostReason.compasCode COI_CODE = unicode(lineItem.siNo.coi_code()) TheStockItems = EpicStock.objects.filter(origin_id__contains=COI_CODE) Full_coi= TheStockItems[0].origin_id | bac3271289c746ef21c5d0d7c401050276c6aaa7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12559/bac3271289c746ef21c5d0d7c401050276c6aaa7/compas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
8606,
8138,
67,
1888,
17240,
67,
2919,
345,
12,
2890,
16,
1888,
17240,
67,
350,
4672,
1319,
273,
9494,
67,
23601,
18,
1952,
12,
89,
11,
16961,
46,
654,
60,
11664,
19,
16961,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
8606,
8138,
67,
1888,
17240,
67,
2919,
345,
12,
2890,
16,
1888,
17240,
67,
350,
4672,
1319,
273,
9494,
67,
23601,
18,
1952,
12,
89,
11,
16961,
46,
654,
60,
11664,
19,
16961,
... |
if (pow(type(i),1)!=type(i)): | if pow(type(i), 1) != type(i): | def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' for i in range(-100, 100): if (pow(type(i),3)!=i*i*i): raise ValueError, 'pow('+str(i)+',3) != '+str(i*i*i) pow2=1 for i in range(0,31): if (pow(2,i)!=pow2): raise ValueError, 'pow(2,'+str(i)+') != '+str(pow2) if (i!=30): pow2=pow2*2 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 8dbaa911a5a2dba1998dff520a2ae2eb3acf2eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/8dbaa911a5a2dba1998dff520a2ae2eb3acf2eb6/test_pow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
315,
565,
7766,
310,
576,
17,
3446,
7602,
1435,
445,
7070,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
309,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
315,
565,
7766,
310,
576,
17,
3446,
7602,
1435,
445,
7070,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
309,
26... |
if y is None: y = 0 yCtrl = panel.SpinIntCtrl(y, min=-maxint-1, max=maxint) yCtrl.Enable(False) else: yCtrl = panel.SpinIntCtrl(y, min=-maxint-1, max=maxint) | yCtrl = panel.SpinIntCtrl(y or 0, min=-maxint-1, max=maxint) yCtrl.Enable(y is not None) | def HandleYCheckBox(event): yCtrl.Enable(event.IsChecked()) | 01c6d3c4ff3ac8c97d8b5107510605949ed460ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8076/01c6d3c4ff3ac8c97d8b5107510605949ed460ca/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
61,
19174,
12,
2575,
4672,
677,
12418,
18,
8317,
12,
2575,
18,
2520,
11454,
10756,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
61,
19174,
12,
2575,
4672,
677,
12418,
18,
8317,
12,
2575,
18,
2520,
11454,
10756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
error(self.pos, "Compile-time name '%s' not defined", self.name) | error(self.pos, "Compile-time name '%s' not defined" % self.name) | def compile_time_value(self, denv): try: return denv.lookup(self.name) except KeyError: error(self.pos, "Compile-time name '%s' not defined", self.name) | 09b67121357b01bc0bb9f92d07a34d326f50bf8c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2099/09b67121357b01bc0bb9f92d07a34d326f50bf8c/ExprNodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
957,
67,
1132,
12,
2890,
16,
302,
3074,
4672,
775,
30,
327,
302,
3074,
18,
8664,
12,
2890,
18,
529,
13,
1335,
4999,
30,
555,
12,
2890,
18,
917,
16,
315,
9937,
17,
957,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
957,
67,
1132,
12,
2890,
16,
302,
3074,
4672,
775,
30,
327,
302,
3074,
18,
8664,
12,
2890,
18,
529,
13,
1335,
4999,
30,
555,
12,
2890,
18,
917,
16,
315,
9937,
17,
957,
50... |
self.assert_(isinstance(p.get_connections(), list)) | if not POSIX and self.__class__.__name__ != "LimitedUserTestCase": self.assert_(isinstance(p.get_connections(), list)) | def test_types(self): self.proc = subprocess.Popen(PYTHON, stdout=DEVNULL, stderr=DEVNULL) p = psutil.Process(self.proc.pid) self.assert_(isinstance(p.pid, int)) self.assert_(isinstance(p.ppid, int)) self.assert_(isinstance(p.parent, psutil.Process)) self.assert_(isinstance(p.name, str)) self.assert_(isinstance(p.path, str)) self.assert_(isinstance(p.cmdline, list)) self.assert_(isinstance(p.uid, int)) self.assert_(isinstance(p.gid, int)) self.assert_(isinstance(p.create_time, float)) self.assert_(isinstance(p.username, str) or \ isinstance(p.username, type(u''))) if hasattr(p, 'getcwd'): self.assert_(isinstance(p.getcwd(), str)) if hasattr(p, 'get_open_files'): # XXX if not LINUX and self.__class__.__name__ != "LimitedUserTestCase": self.assert_(isinstance(p.get_open_files(), list)) for path in p.get_open_files(): self.assert_(isinstance(path, str) or \ isinstance(path, type(u''))) if hasattr(p, 'get_connections'): self.assert_(isinstance(p.get_connections(), list)) self.assert_(isinstance(p.is_running(), bool)) self.assert_(isinstance(p.get_cpu_times(), tuple)) self.assert_(isinstance(p.get_cpu_times()[0], float)) self.assert_(isinstance(p.get_cpu_times()[1], float)) self.assert_(isinstance(p.get_cpu_percent(), float)) self.assert_(isinstance(p.get_memory_info(), tuple)) self.assert_(isinstance(p.get_memory_info()[0], int)) self.assert_(isinstance(p.get_memory_info()[1], int)) self.assert_(isinstance(p.get_memory_percent(), float)) self.assert_(isinstance(psutil.get_process_list(), list)) self.assert_(isinstance(psutil.get_process_list()[0], psutil.Process)) self.assert_(isinstance(psutil.process_iter(), types.GeneratorType)) self.assert_(isinstance(psutil.process_iter().next(), psutil.Process)) self.assert_(isinstance(psutil.get_pid_list(), list)) self.assert_(isinstance(psutil.get_pid_list()[0], int)) self.assert_(isinstance(psutil.pid_exists(1), bool)) | 37c352ee66c63531992da2a12613487a84f08935 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7296/37c352ee66c63531992da2a12613487a84f08935/test_psutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2352,
12,
2890,
4672,
365,
18,
9381,
273,
6652,
18,
52,
3190,
12,
16235,
20131,
16,
3909,
33,
15301,
8560,
16,
4514,
33,
15301,
8560,
13,
293,
273,
27024,
18,
2227,
12,
2890,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2352,
12,
2890,
4672,
365,
18,
9381,
273,
6652,
18,
52,
3190,
12,
16235,
20131,
16,
3909,
33,
15301,
8560,
16,
4514,
33,
15301,
8560,
13,
293,
273,
27024,
18,
2227,
12,
2890,... |
libraries=['m', 'X11', 'Xext', 'tk8.5', 'tcl8.5', 'cairo']) | libraries=['m', 'X11', 'Xext', 'tk'+tcl_ver, 'tcl'+tcl_ver, 'cairo']) | def file_scan(cat): proc = os.popen("find "+cat+" -type f|grep -v \.svn|grep -v \.xvpics|grep -v \.py$|grep -v \.c$|sed 's/^/include /g'>>MANIFEST.in") proc.close() | 4fb150af467fc784b74a35cc3b1b9538603954be /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3123/4fb150af467fc784b74a35cc3b1b9538603954be/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
585,
67,
9871,
12,
2574,
4672,
5418,
273,
1140,
18,
84,
3190,
2932,
4720,
13773,
2574,
9078,
300,
723,
284,
96,
11556,
84,
300,
90,
15558,
31505,
96,
11556,
84,
300,
90,
15558,
92,
201... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
585,
67,
9871,
12,
2574,
4672,
5418,
273,
1140,
18,
84,
3190,
2932,
4720,
13773,
2574,
9078,
300,
723,
284,
96,
11556,
84,
300,
90,
15558,
31505,
96,
11556,
84,
300,
90,
15558,
92,
201... |
if save: record.__setattr__(self.attr,result) | if save: record.__setattr__(self.attr,(isFid,result)) | def mapFids(self,record,function,save=False): value = record.__getattribute__(self.attr) if value is None: return (isFid, value) = value if isFid: result = function(value) if save: record.__setattr__(self.attr,result) | a008bdb7d70d43e9ee1cf2b5d0c46dcee555a070 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/a008bdb7d70d43e9ee1cf2b5d0c46dcee555a070/bosh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
852,
42,
2232,
12,
2890,
16,
3366,
16,
915,
16,
5688,
33,
8381,
4672,
460,
273,
1409,
16186,
588,
4589,
972,
12,
2890,
18,
1747,
13,
309,
460,
353,
599,
30,
327,
261,
291,
42,
350,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
852,
42,
2232,
12,
2890,
16,
3366,
16,
915,
16,
5688,
33,
8381,
4672,
460,
273,
1409,
16186,
588,
4589,
972,
12,
2890,
18,
1747,
13,
309,
460,
353,
599,
30,
327,
261,
291,
42,
350,
... |
gpatch = changed.get(bfile[2:]) | gpatch = changed.get(bfile) | def iterhunks(ui, fp, sourcefile=None): """Read a patch and yield the following events: - ("file", afile, bfile, firsthunk): select a new target file. - ("hunk", hunk): a new hunk is ready to be applied, follows a "file" event. - ("git", gitchanges): current diff is in git format, gitchanges maps filenames to gitpatch records. Unique event. """ changed = {} current_hunk = None afile = "" bfile = "" state = None hunknum = 0 emitfile = False git = False gitre = re.compile('diff --git (a/.*) (b/.*)') # our states BFILE = 1 context = None lr = linereader(fp) dopatch = True # gitworkdone is True if a git operation (copy, rename, ...) was # performed already for the current file. Useful when the file # section may have no hunk. gitworkdone = False while True: newfile = False x = lr.readline() if not x: break if current_hunk: if x.startswith('\ '): current_hunk.fix_newline() yield 'hunk', current_hunk current_hunk = None gitworkdone = False if ((sourcefile or state == BFILE) and ((not context and x[0] == '@') or ((context or context == None) and x.startswith('***************')))): try: if context == None and x.startswith('***************'): context = True gpatch = changed.get(bfile[2:]) create = afile == '/dev/null' or gpatch and gpatch.op == 'ADD' remove = bfile == '/dev/null' or gpatch and gpatch.op == 'DELETE' current_hunk = hunk(x, hunknum + 1, lr, context, create, remove) except PatchError, err: ui.debug(err) current_hunk = None continue hunknum += 1 if emitfile: emitfile = False yield 'file', (afile, bfile, current_hunk) elif state == BFILE and x.startswith('GIT binary patch'): current_hunk = binhunk(changed[bfile[2:]]) hunknum += 1 if emitfile: emitfile = False yield 'file', (afile, bfile, current_hunk) current_hunk.extract(lr) elif x.startswith('diff --git'): # check for git diff, scanning the whole patch file if needed m = gitre.match(x) if m: afile, bfile = m.group(1, 2) if not git: git = True dopatch, gitpatches = scangitpatch(lr, x) yield 'git', gitpatches for gp in gitpatches: changed[gp.path] = gp # else error? # copy/rename + modify should modify target, not source gp = changed.get(bfile[2:]) if gp and gp.op in ('COPY', 'DELETE', 'RENAME'): afile = bfile gitworkdone = True newfile = True elif x.startswith('---'): # check for a unified diff l2 = lr.readline() if not l2.startswith('+++'): lr.push(l2) continue newfile = True context = False afile = parsefilename(x) bfile = parsefilename(l2) elif x.startswith('***'): # check for a context diff l2 = lr.readline() if not l2.startswith('---'): lr.push(l2) continue l3 = lr.readline() lr.push(l3) if not l3.startswith("***************"): lr.push(l2) continue newfile = True context = True afile = parsefilename(x) bfile = parsefilename(l2) if newfile: emitfile = True state = BFILE hunknum = 0 if current_hunk: if current_hunk.complete(): yield 'hunk', current_hunk else: raise PatchError(_("malformed patch %s %s") % (afile, current_hunk.desc)) if hunknum == 0 and dopatch and not gitworkdone: raise NoHunks | b0ccc6c4afc2daea22e79b7bd96dda5f7dfb9bcc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/b0ccc6c4afc2daea22e79b7bd96dda5f7dfb9bcc/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
76,
1683,
87,
12,
4881,
16,
4253,
16,
1084,
768,
33,
7036,
4672,
3536,
1994,
279,
4729,
471,
2824,
326,
3751,
2641,
30,
300,
7566,
768,
3113,
279,
768,
16,
324,
768,
16,
1122,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
76,
1683,
87,
12,
4881,
16,
4253,
16,
1084,
768,
33,
7036,
4672,
3536,
1994,
279,
4729,
471,
2824,
326,
3751,
2641,
30,
300,
7566,
768,
3113,
279,
768,
16,
324,
768,
16,
1122,
... |
this = apply(_quickfix.new_ExDate, args) | this = _quickfix.new_ExDate(*args) | def __init__(self, *args): this = apply(_quickfix.new_ExDate, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
424,
1626,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
424,
1626,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
18... |
def runExecute(self, result): if result: self.session.openWithCallback(self.runExecuteFinished, Ipkg, cmdList = self.cmdList) | def runExecute(self, result = None): if result is not None: if result[0] is True: self.session.openWithCallback(self.runExecuteFinished, Ipkg, cmdList = self.cmdList) elif result[0] is False: self.cmdList = result[1] self.session.openWithCallback(self.runExecuteFinished, Ipkg, cmdList = self.cmdList) | def runExecute(self, result): if result: self.session.openWithCallback(self.runExecuteFinished, Ipkg, cmdList = self.cmdList) else: self.close() | 018534fa7bf9be0885b2ffc753d8d6fc5b56143c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/018534fa7bf9be0885b2ffc753d8d6fc5b56143c/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
5289,
12,
2890,
16,
563,
273,
599,
4672,
309,
563,
353,
486,
599,
30,
309,
563,
63,
20,
65,
353,
1053,
30,
365,
18,
3184,
18,
3190,
1190,
2428,
12,
2890,
18,
2681,
5289,
10577,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
5289,
12,
2890,
16,
563,
273,
599,
4672,
309,
563,
353,
486,
599,
30,
309,
563,
63,
20,
65,
353,
1053,
30,
365,
18,
3184,
18,
3190,
1190,
2428,
12,
2890,
18,
2681,
5289,
10577,... |
['K',[41,101,201,401,801], | ['K',[41,81,161,321,641], | def verify(test): print ' ++++ verifying ' + test[2] + ' using test ' + test[0] + ' ++++' print ' ' + test[5] for myMx in test[1][:levs]: if test[3] == 0: gridopts = ' -Mx ' + str(myMx) + ' -My ' + str(myMx) elif test[3] == 1: gridopts = ' -My ' + str(myMx) elif test[3] == 2: gridopts = ' -Mx ' + str(myMx) + ' -My ' + str(myMx) + ' -Mz ' + str(myMx) elif test[3] == 3: myMz = myMx myMbz = (myMz - 1) / 4 + 1 gridopts = ' -Mz ' + str(myMz) + ' -Mbz ' + str(myMbz) if nproc > 1: predo = mpi + ' -np ' + str(nproc) + ' ' else: predo = '' testdo = predo + pref + 'pismv -test ' + test[0] + gridopts + test[4] print ' trying \"' + testdo + '\"' testdo = testdo + ' -verbose 1' # only need final errors anyway try: lasttime = time.time() (status,output) = commands.getstatusoutput(testdo) elapsetime = time.time() - lasttime except KeyboardInterrupt: sys.exit(2) if status: sys.exit(status) print ' finished in %7.4f seconds; reported numerical errors as follows:' % elapsetime errpos = output.find('NUMERICAL ERRORS') if errpos >= 0: errreport = output[errpos:output.rfind('Writing')-1] print ' |' + string.replace(errreport,'\n','\n |') else: print ' ERROR: can\'t find reported numerical error' sys.exit(99) | 89e2d55d25b61c0decb9bade847dc3a1c1d14c81 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7383/89e2d55d25b61c0decb9bade847dc3a1c1d14c81/verifynow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
3813,
4672,
1172,
296,
965,
9904,
3929,
310,
296,
397,
1842,
63,
22,
65,
397,
296,
1450,
1842,
296,
397,
1842,
63,
20,
65,
397,
296,
965,
15,
6797,
1172,
296,
296,
397,
184... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
3813,
4672,
1172,
296,
965,
9904,
3929,
310,
296,
397,
1842,
63,
22,
65,
397,
296,
1450,
1842,
296,
397,
1842,
63,
20,
65,
397,
296,
965,
15,
6797,
1172,
296,
296,
397,
184... |
Emin, Emax = context.Emin, context.Emax Etop = context.Etop() | Emin = context.Emin | def _fixexponents(self, prec=None, rounding=None, folddown=None, context=None): """Fix the exponents and return a copy with the exponent in bounds.""" if self._isinfinity(): return self if context is None: context = getcontext() if prec is None: prec = context.prec if folddown is None: folddown = context._clamp Emin, Emax = context.Emin, context.Emax Etop = context.Etop() ans = Decimal(self) if ans.adjusted() < Emin: Etiny = context.Etiny() if ans._exp < Etiny: if not ans: ans._exp = Etiny context._raise_error(Clamped) return ans ans = ans._rescale(Etiny, context=context) #It isn't zero, and exp < Emin => subnormal context._raise_error(Subnormal) if context.flags[Inexact]: context._raise_error(Underflow) else: if ans: #Only raise subnormal if non-zero. context._raise_error(Subnormal) elif folddown and ans._exp > Etop: context._raise_error(Clamped) ans = ans._rescale(Etop, context=context) elif ans.adjusted() > Emax: if not ans: ans._exp = Emax context._raise_error(Clamped) return ans context._raise_error(Inexact) context._raise_error(Rounded) return context._raise_error(Overflow, 'above Emax', ans._sign) return ans | 323d0b30a64964b89a85e1b02e8fcc4017ce9fa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/323d0b30a64964b89a85e1b02e8fcc4017ce9fa7/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
904,
24045,
87,
12,
2890,
16,
13382,
33,
7036,
16,
13885,
33,
7036,
16,
28420,
449,
995,
33,
7036,
16,
819,
33,
7036,
4672,
3536,
8585,
326,
9100,
87,
471,
327,
279,
1610,
598,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
904,
24045,
87,
12,
2890,
16,
13382,
33,
7036,
16,
13885,
33,
7036,
16,
28420,
449,
995,
33,
7036,
16,
819,
33,
7036,
4672,
3536,
8585,
326,
9100,
87,
471,
327,
279,
1610,
598,
... |
while 1: | rv = "(unknown file)", 0, "(unknown function)" while hasattr(f, "f_code"): | def findCaller(self): """ Find the stack frame of the caller so that we can note the source file name, line number and function name. """ f = currentframe().f_back while 1: co = f.f_code filename = os.path.normcase(co.co_filename) if filename == _srcfile: f = f.f_back continue return filename, f.f_lineno, co.co_name | a406b2cb5829da3ac37e700284a734eaa994b623 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a406b2cb5829da3ac37e700284a734eaa994b623/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
11095,
12,
2890,
4672,
3536,
4163,
326,
2110,
2623,
434,
326,
4894,
1427,
716,
732,
848,
4721,
326,
1084,
585,
508,
16,
980,
1300,
471,
445,
508,
18,
3536,
284,
273,
783,
3789,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
11095,
12,
2890,
4672,
3536,
4163,
326,
2110,
2623,
434,
326,
4894,
1427,
716,
732,
848,
4721,
326,
1084,
585,
508,
16,
980,
1300,
471,
445,
508,
18,
3536,
284,
273,
783,
3789,
7... |
namegroup = self.explicit.groups.target.name | def hyperlink_target(self, match): pattern = self.explicit.patterns.target namegroup = self.explicit.groups.target.name lineno = self.state_machine.abs_line_number() block, indent, offset, blank_finish = \ self.state_machine.get_first_known_indented( match.end(), until_blank=1, strip_indent=0) blocktext = match.string[:match.end()] + '\n'.join(block) block = [escape2null(line) for line in block] escaped = block[0] blockindex = 0 while 1: targetmatch = pattern.match(escaped) if targetmatch: break blockindex += 1 try: escaped += block[blockindex] except (IndexError, MarkupError): raise MarkupError('malformed hyperlink target at line %s.' % lineno) del block[:blockindex] block[0] = (block[0] + ' ')[targetmatch.end()-len(escaped)-1:].strip() if block and block[-1].strip()[-1:] == '_': # possible indirect target reference = ' '.join([line.strip() for line in block]) refname = self.is_reference(reference) if refname: target = nodes.target(blocktext, '', refname=refname) self.add_target(targetmatch.group(namegroup), '', target) self.document.note_indirect_target(target) return [target], blank_finish nodelist = [] reference = ''.join([line.strip() for line in block]) if reference.find(' ') != -1: warning = self.reporter.warning( 'Hyperlink target at line %s contains whitespace. ' 'Perhaps a footnote was intended?' % (self.state_machine.abs_line_number() - len(block) + 1), '', nodes.literal_block(blocktext, blocktext)) nodelist.append(warning) else: unescaped = unescape(reference) target = nodes.target(blocktext, '') self.add_target(targetmatch.group(namegroup), unescaped, target) nodelist.append(target) return nodelist, blank_finish | 72a0c19a34dcc90353f2d799116ebcadd510f22a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/72a0c19a34dcc90353f2d799116ebcadd510f22a/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9512,
1232,
67,
3299,
12,
2890,
16,
845,
4672,
1936,
273,
365,
18,
16511,
18,
13317,
18,
3299,
7586,
273,
365,
18,
2019,
67,
9149,
18,
5113,
67,
1369,
67,
2696,
1435,
1203,
16,
3504,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9512,
1232,
67,
3299,
12,
2890,
16,
845,
4672,
1936,
273,
365,
18,
16511,
18,
13317,
18,
3299,
7586,
273,
365,
18,
2019,
67,
9149,
18,
5113,
67,
1369,
67,
2696,
1435,
1203,
16,
3504,
... | |
if not os.path.exists(os.path.dirname(DV.log_file)): self.makedirs(os.path.dirname(DV.log_file)) | if not os.path.exists(DV.appdata_path): self.makedirs(DV.appdata_path) | def __init__(self): self.time=0 try: if not os.path.exists(os.path.dirname(DV.log_file)): self.makedirs(os.path.dirname(DV.log_file)) self.stream=open(DV.log_file,'w') self.stream.write((self.getPrefix()+u'Log opened.').encode('utf8')) except: self.stream=None try: print 'Warning: No log stream!' traceback.print_exc() except: pass | a6f5cfc7b7972dc06f7fbea0e0528482c8489e95 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/a6f5cfc7b7972dc06f7fbea0e0528482c8489e95/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
957,
33,
20,
775,
30,
309,
486,
1140,
18,
803,
18,
1808,
12,
30199,
18,
2910,
892,
67,
803,
4672,
365,
18,
81,
9477,
10539,
12,
30199,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
957,
33,
20,
775,
30,
309,
486,
1140,
18,
803,
18,
1808,
12,
30199,
18,
2910,
892,
67,
803,
4672,
365,
18,
81,
9477,
10539,
12,
30199,
18,
... |
for attack in self.attacks: attack.setVerbose(vb) | def verbosity(self,vb): self.verbose=vb self.HTTP.verbosity(vb) for attack in self.attacks: attack.setVerbose(vb) | 6a454dfa3c412d72c675c8861c3a90ee26a39caa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6330/6a454dfa3c412d72c675c8861c3a90ee26a39caa/wapiti.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11561,
12,
2890,
16,
90,
70,
4672,
365,
18,
11369,
33,
90,
70,
365,
18,
3693,
18,
16629,
8807,
12,
90,
70,
13,
364,
13843,
316,
365,
18,
4558,
22098,
30,
13843,
18,
542,
14489,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11561,
12,
2890,
16,
90,
70,
4672,
365,
18,
11369,
33,
90,
70,
365,
18,
3693,
18,
16629,
8807,
12,
90,
70,
13,
364,
13843,
316,
365,
18,
4558,
22098,
30,
13843,
18,
542,
14489,
12,
... | |
for i in range(0,len(l2),e): | for i in range(0, len(l2), e): | def antiphi(self,l): """ Inverse of self.phi. | 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,
392,
14587,
12266,
12,
2890,
16,
80,
4672,
3536,
657,
2476,
434,
365,
18,
9973,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
392,
14587,
12266,
12,
2890,
16,
80,
4672,
3536,
657,
2476,
434,
365,
18,
9973,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return tensor.hashtype(self) ^ hash(self.val.value) | return tensor.hashtype(self) ^ hash(self.val.data) | def __hash__(self): return tensor.hashtype(self) ^ hash(self.val.value) | e4bb78371fd3e5b550734172de9ff7396558ae17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/e4bb78371fd3e5b550734172de9ff7396558ae17/nnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2816,
972,
12,
2890,
4672,
327,
8171,
18,
5332,
647,
388,
12,
2890,
13,
3602,
1651,
12,
2890,
18,
1125,
18,
1132,
13,
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,
1001,
2816,
972,
12,
2890,
4672,
327,
8171,
18,
5332,
647,
388,
12,
2890,
13,
3602,
1651,
12,
2890,
18,
1125,
18,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
skeleton stays same but all data disappears... | Removes all data from table_name, except for the structure of the columns. EXAMPLE: sage: D = SQLDatabase() sage: D.create_table('simon',{'col1':{'sql':'INTEGER'}}) sage: D.add_row('simon',(9,)) sage: D.show('simon') col1 -------------------- 9 sage: D.drop_data_from_table('simon') sage: D.show('simon') col1 -------------------- | def drop_data_from_table(self, table_name): """ skeleton stays same but all data disappears... """ if not self.__skeleton__.has_key(table_name): raise ValueError("Database has no table %s."%table_name) self.__connection__.execute('delete from ' + table_name) | 12098d45ba68813e42a6a22032a2f2e6d360e158 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/12098d45ba68813e42a6a22032a2f2e6d360e158/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3640,
67,
892,
67,
2080,
67,
2121,
12,
2890,
16,
1014,
67,
529,
4672,
3536,
20284,
777,
501,
628,
1014,
67,
529,
16,
1335,
364,
326,
3695,
434,
326,
2168,
18,
225,
5675,
21373,
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,
3640,
67,
892,
67,
2080,
67,
2121,
12,
2890,
16,
1014,
67,
529,
4672,
3536,
20284,
777,
501,
628,
1014,
67,
529,
16,
1335,
364,
326,
3695,
434,
326,
2168,
18,
225,
5675,
21373,
30,
2... |
exception_value=str(value), | exception_value=self.safeStr(value), | def collectException(self, etype, value, tb, limit=None): # The next line provides a way to detect recursion. __exception_formatter__ = 1 frames = [] ident_data = [] traceback_decorators = [] if limit is None: limit = self.getLimit() n = 0 extra_data = {} while tb is not None and (limit is None or n < limit): if tb.tb_frame.f_locals.get('__exception_formatter__'): # Stop recursion. @@: should make a fake ExceptionFrame frames.append('(Recursive formatException() stopped)\n') break data = self.collectLine(tb, extra_data) frame = ExceptionFrame(**data) frames.append(frame) if frame.traceback_decorator is not None: traceback_decorators.append(frame.traceback_decorator) ident_data.append(frame.modname or '?') ident_data.append(frame.name or '?') tb = tb.tb_next n = n + 1 ident_data.append(str(etype)) ident = serial_number_generator.hash_identifier( ' '.join(ident_data), length=5, upper=True, prefix=DEBUG_IDENT_PREFIX) | 70555e0cd110c4785506f762e44592c74960137d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12946/70555e0cd110c4785506f762e44592c74960137d/collector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3274,
503,
12,
2890,
16,
24700,
16,
460,
16,
8739,
16,
1800,
33,
7036,
4672,
468,
1021,
1024,
980,
8121,
279,
4031,
358,
5966,
13917,
18,
1001,
4064,
67,
12354,
972,
273,
404,
7793,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3274,
503,
12,
2890,
16,
24700,
16,
460,
16,
8739,
16,
1800,
33,
7036,
4672,
468,
1021,
1024,
980,
8121,
279,
4031,
358,
5966,
13917,
18,
1001,
4064,
67,
12354,
972,
273,
404,
7793,
27... |
self.postEventByName ('RequestSelectSidebarItem', {'item':schema.ns('osaf.app', self).allCollection}) viewFilter = Block.findBlockByName ("Sidebar").filterKind | sidebar = Block.findBlockByName("Sidebar") sidebaritem = sidebar.selectedItemToView isReadOnly = getattr(sidebaritem, 'isReadOnly', None) if isReadOnly and isReadOnly(): allCollection = schema.ns('osaf.app', self).allCollection self.postEventByName ('RequestSelectSidebarItem', {'item': allCollection}) elif hasattr(sidebaritem, 'add'): sidebaritem.add(newItem) viewFilter = sidebar.filterKind | def onNewEvent (self, event): # Create a new Content Item # Triggered from "File | New Item" menu, for any of the item kinds. try: kindParam = event.kindParameter except AttributeError: kindParam = pim.Note.getKind(self.itsView) # default kind for "New" newItem = kindParam.newItem (None, None) newItem.InitOutgoingAttributes () self.RepositoryCommitWithStatus () | 1283c493d2f779830d1cb1fda996bc7ad4bc00ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/1283c493d2f779830d1cb1fda996bc7ad4bc00ed/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1908,
1133,
261,
2890,
16,
871,
4672,
468,
1788,
279,
394,
3697,
4342,
468,
11321,
329,
628,
315,
812,
571,
1166,
4342,
6,
3824,
16,
364,
1281,
434,
326,
761,
21961,
18,
775,
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,
603,
1908,
1133,
261,
2890,
16,
871,
4672,
468,
1788,
279,
394,
3697,
4342,
468,
11321,
329,
628,
315,
812,
571,
1166,
4342,
6,
3824,
16,
364,
1281,
434,
326,
761,
21961,
18,
775,
30,
... |
result.__name__ = form.prefix + '.' + result.__name__ | result.__name__ = expandPrefix(form.prefix) + result.__name__ | def __get__(self, form, class_=None): if form is None: return self result = self.__class__.__new__(self.__class__) result.__dict__.update(self.__dict__) result.form = form result.__name__ = form.prefix + '.' + result.__name__ interface.alsoProvides(result, interfaces.IBoundAction) return result | b454136ef456c884ae4bf11b3f8d29e8bd8fd1f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9642/b454136ef456c884ae4bf11b3f8d29e8bd8fd1f1/form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
972,
12,
2890,
16,
646,
16,
667,
67,
33,
7036,
4672,
309,
646,
353,
599,
30,
327,
365,
563,
273,
365,
16186,
1106,
972,
16186,
2704,
972,
12,
2890,
16186,
1106,
972,
13,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
972,
12,
2890,
16,
646,
16,
667,
67,
33,
7036,
4672,
309,
646,
353,
599,
30,
327,
365,
563,
273,
365,
16186,
1106,
972,
16186,
2704,
972,
12,
2890,
16186,
1106,
972,
13,
5... |
except: pass | def readWidgets(directory, category, cachedWidgetDescriptions): import sys, imp global hasErrors, splashWindow widgets = [] for filename in glob.iglob(os.path.join(directory, "*.py")): if os.path.isdir(filename) or os.path.islink(filename): continue datetime = str(os.stat(filename)[stat.ST_MTIME]) cachedDescription = cachedWidgetDescriptions.get(filename, None) if cachedDescription and cachedDescription.time == datetime and hasattr(cachedDescription, "inputClasses"): widgets.append((cachedDescription.name, cachedDescription)) continue data = file(filename).read() istart = data.find("<name>") iend = data.find("</name>") if istart < 0 or iend < 0: continue name = data[istart+6:iend] inputList = getSignalList(re_inputs, data) outputList = getSignalList(re_outputs, data) dirname, fname = os.path.split(filename) widgname = os.path.splitext(fname)[0] try: if not splashWindow: import orngEnviron logo = QPixmap(os.path.join(orngEnviron.directoryNames["canvasDir"], "icons", "splash.png")) splashWindow = QSplashScreen(logo, Qt.WindowStaysOnTopHint) splashWindow.setMask(logo.mask()) splashWindow.show() splashWindow.showMessage("Registering widget %s" % name, Qt.AlignHCenter + Qt.AlignBottom) qApp.processEvents() # We import modules using imp.load_source to avoid storing them in sys.modules, # but we need to append the path to sys.path in case the module would want to load # something sys.path.append(dirname) wmod = imp.load_source(widgname, filename) try: # I have no idea, why we need this, but it seems to disappear sometimes?! sys.path.remove(dirname) except: pass widgClass = wmod.__dict__[widgname] inputClasses = set(eval(x[1], wmod.__dict__).__name__ for x in eval(inputList)) outputClasses = set(y.__name__ for x in eval(outputList) for y in eval(x[1], wmod.__dict__).mro()) widgetInfo = WidgetDescription( name = data[istart+6:iend], category = category, time = datetime, fileName = widgname, fullName = filename, inputList = inputList, outputList = outputList, inputClasses = inputClasses, outputClasses = outputClasses ) for attr, deflt in (("contact>", "") , ("icon>", "icons/Unknown.png"), ("priority>", "5000"), ("description>", "")): istart, iend = data.find("<"+attr), data.find("</"+attr) setattr(widgetInfo, attr[:-1], istart >= 0 and iend >= 0 and data[istart+1+len(attr):iend].strip() or deflt) # build the tooltip widgetInfo.inputs = [InputSignal(*signal) for signal in eval(widgetInfo.inputList)] if len(widgetInfo.inputs) == 0: formatedInList = "<b>Inputs:</b><br> None<br>" else: formatedInList = "<b>Inputs:</b><br>" for signal in widgetInfo.inputs: formatedInList += " - " + signal.name + " (" + signal.type + ")<br>" widgetInfo.outputs = [OutputSignal(*signal) for signal in eval(widgetInfo.outputList)] if len(widgetInfo.outputs) == 0: formatedOutList = "<b>Outputs:</b><br> None<br>" else: formatedOutList = "<b>Outputs:</b><br>" for signal in widgetInfo.outputs: formatedOutList += " - " + signal.name + " (" + signal.type + ")<br>" widgetInfo.tooltipText = "<b><b> %s</b></b><hr><b>Description:</b><br> %s<hr>%s<hr>%s" % (name, widgetInfo.description, formatedInList[:-4], formatedOutList[:-4]) widgets.append((name, widgetInfo)) except Exception, msg: if not hasErrors: print "The following widgets could not be imported and will not be available" hasErrors = True print " %s: %s" % (widgname, msg) return widgets | 3625fadcfd1dfa355599ffe69f9e762d6cb72720 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6366/3625fadcfd1dfa355599ffe69f9e762d6cb72720/orngRegistry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
16166,
12,
5149,
16,
3150,
16,
3472,
4609,
16844,
4672,
1930,
2589,
16,
1646,
2552,
24208,
16,
6121,
961,
3829,
225,
10965,
273,
5378,
364,
1544,
316,
4715,
18,
360,
1295,
12,
538,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
16166,
12,
5149,
16,
3150,
16,
3472,
4609,
16844,
4672,
1930,
2589,
16,
1646,
2552,
24208,
16,
6121,
961,
3829,
225,
10965,
273,
5378,
364,
1544,
316,
4715,
18,
360,
1295,
12,
538,
... | |
print "calling easy_thumbnails_relative_name: %s" % self.rel_image_url | def easy_thumbnails_relative_name(self): print "calling easy_thumbnails_relative_name: %s" % self.rel_image_url return self.rel_image_url | e3fe468a91b1031a21a31bcb325a9695957897f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14213/e3fe468a91b1031a21a31bcb325a9695957897f1/imagemodels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12779,
67,
14904,
87,
67,
11626,
67,
529,
12,
2890,
4672,
327,
365,
18,
2878,
67,
2730,
67,
718,
225,
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,
12779,
67,
14904,
87,
67,
11626,
67,
529,
12,
2890,
4672,
327,
365,
18,
2878,
67,
2730,
67,
718,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
Returns the ith generator of self; that is, the ith element of the list ``self.gens()``. EXAMPLES: We explicitly construct the alternating group on four | Returns the i-th generator of ``self``; that is, the i-th element of the list ``self.gens()``. EXAMPLES: We explicitly construct the alternating group on four | def gen(self, i): r""" Returns the ith generator of self; that is, the ith element of the list ``self.gens()``. EXAMPLES: We explicitly construct the alternating group on four elements:: sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 Permutation Group with generators [(2,3,4), (1,2,3)] sage: A4.gens() [(2,3,4), (1,2,3)] sage: A4.gen(0) (2,3,4) sage: A4.gen(1) (1,2,3) sage: A4.gens()[0]; A4.gens()[1] (2,3,4) (1,2,3) """ return self.gens()[i] | f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
12,
2890,
16,
277,
4672,
436,
8395,
2860,
326,
277,
17,
451,
4456,
434,
12176,
2890,
10335,
31,
716,
353,
16,
326,
277,
17,
451,
930,
434,
326,
666,
12176,
2890,
18,
23730,
20338... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
12,
2890,
16,
277,
4672,
436,
8395,
2860,
326,
277,
17,
451,
4456,
434,
12176,
2890,
10335,
31,
716,
353,
16,
326,
277,
17,
451,
930,
434,
326,
666,
12176,
2890,
18,
23730,
20338... |
print state.last_info print state.deleted | def delete(self, event): # wxGlade: Movinator.<event_handler> row = self.grid_1.GetGridCursorRow() if isVisible(self.grid_1, row): if self.grid_1.GetRowLabelValue(row) not in state.deleted: state.deleted.append(self.grid_1.GetRowLabelValue(row)) state.last_action = 2 state.last_info = [row, self.grid_1.GetRowLabelValue(row)] for i in xrange(self.grid_1.GetNumberCols()): state.last_info.append(self.grid_1.GetCellValue(row,i)) self.enableUndo(True) shiftRows(self.grid_1, row) print state.last_info print state.deleted | 61e85a19eab6040b0d3364c60a9ea0b7878c41ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2517/61e85a19eab6040b0d3364c60a9ea0b7878c41ef/movinator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
2890,
16,
871,
4672,
468,
7075,
21308,
2486,
30,
490,
1527,
4240,
22782,
2575,
67,
4176,
34,
1027,
273,
365,
18,
5222,
67,
21,
18,
967,
6313,
6688,
1999,
1435,
309,
20453,
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,
1430,
12,
2890,
16,
871,
4672,
468,
7075,
21308,
2486,
30,
490,
1527,
4240,
22782,
2575,
67,
4176,
34,
1027,
273,
365,
18,
5222,
67,
21,
18,
967,
6313,
6688,
1999,
1435,
309,
20453,
12... | |
dest = self.patch_dir + basename(patch) | dest = os.path.join(self.patch_dir, basename(patch)) | def get_patches(self, patches): """fetch the patches to the local patch_dir""" local_patches = [] for patch in patches: dest = self.patch_dir + basename(patch) get_file(patch, dest) local_patches.append(dest) | d0cbe3ef3e9910ba3893f6cf88408eaf750bec98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/d0cbe3ef3e9910ba3893f6cf88408eaf750bec98/kernel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
30278,
12,
2890,
16,
16482,
4672,
3536,
5754,
326,
16482,
358,
326,
1191,
4729,
67,
1214,
8395,
1191,
67,
30278,
273,
5378,
364,
4729,
316,
16482,
30,
1570,
273,
1140,
18,
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,
336,
67,
30278,
12,
2890,
16,
16482,
4672,
3536,
5754,
326,
16482,
358,
326,
1191,
4729,
67,
1214,
8395,
1191,
67,
30278,
273,
5378,
364,
4729,
316,
16482,
30,
1570,
273,
1140,
18,
803,
... |
ffi_builddir, ffi_srcdir] | ffi_builddir, os.path.join(ffi_srcdir, 'src')] | def configure_ctypes(self, ext): if not self.use_system_libffi: if sys.platform == 'darwin': return self.configure_ctypes_darwin(ext) | 30b66794c2de92a60eab83003627eed662225224 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/30b66794c2de92a60eab83003627eed662225224/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
67,
299,
989,
12,
2890,
16,
1110,
4672,
309,
486,
365,
18,
1202,
67,
4299,
67,
2941,
1403,
77,
30,
309,
2589,
18,
9898,
422,
296,
28076,
4278,
327,
365,
18,
14895,
67,
299,
989... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
67,
299,
989,
12,
2890,
16,
1110,
4672,
309,
486,
365,
18,
1202,
67,
4299,
67,
2941,
1403,
77,
30,
309,
2589,
18,
9898,
422,
296,
28076,
4278,
327,
365,
18,
14895,
67,
299,
989... |
simu = '\nSimulation Mode (locking disabled)' | simu = _('\nSimulation Mode (locking disabled)') | def updateState(self): # update the display with newest measurement values (once per second) newVal = int(self.proxi.Dist) # Values are negative! if newVal > self.minDist: self.minDist = newVal if newVal < self.maxDist: self.maxDist = newVal self.wTree.get_widget("labState").set_text("min: " + str(-self.minDist) + " max: " + str(-self.maxDist) + " state: " + self.proxi.State) self.wTree.get_widget("hscaleAct").set_value(-newVal) #Update icon too if self.pauseMode: self.icon.set_from_file(dist_path + icon_pause) self.icon.set_tooltip('Pause Mode - not connected') else: if self.proxi.ErrorMsg == "No connection found, trying to establish one...": self.icon.set_from_file(dist_path + icon_con) else: if self.proxi.State != 'active': self.icon.set_from_file(dist_path + icon_away) else: if newVal < self.proxi.active_limit: self.icon.set_from_file(dist_path + icon_att) else: self.icon.set_from_file(dist_path + icon_base) if self.proxi.Simulate: simu = '\nSimulation Mode (locking disabled)' else: simu = '' self.icon.set_tooltip('Detected Distance: ' + str(-newVal) + "\nCurrent State: " + self.proxi.State + "\nStatus: " + self.proxi.ErrorMsg + simu) self.timer = gobject.timeout_add(1000,self.updateState) | d62eb7fc2f8da5cc0b33e5d1229c2a062b1c701d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/61/d62eb7fc2f8da5cc0b33e5d1229c2a062b1c701d/proximity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1119,
12,
2890,
4672,
468,
1089,
326,
2562,
598,
19824,
12464,
924,
261,
8243,
1534,
2205,
13,
20957,
273,
509,
12,
2890,
18,
20314,
77,
18,
5133,
13,
468,
6876,
854,
6092,
5,
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,
1089,
1119,
12,
2890,
4672,
468,
1089,
326,
2562,
598,
19824,
12464,
924,
261,
8243,
1534,
2205,
13,
20957,
273,
509,
12,
2890,
18,
20314,
77,
18,
5133,
13,
468,
6876,
854,
6092,
5,
30... |
"absolute_import", "with_statement", "print_function") | "absolute_import", "with_statement", "print_function", "unicode_literals") | def is_future(stmt): """Return true if statement is a well-formed future statement""" if not isinstance(stmt, ast.From): return 0 if stmt.modname == "__future__": return 1 else: return 0 | 5c9d864255e48ea002a159557bd226e0576f7fb0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/5c9d864255e48ea002a159557bd226e0576f7fb0/future.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
14343,
12,
10589,
4672,
3536,
990,
638,
309,
3021,
353,
279,
5492,
17,
7312,
3563,
3021,
8395,
309,
486,
1549,
12,
10589,
16,
3364,
18,
1265,
4672,
327,
374,
309,
3480,
18,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
14343,
12,
10589,
4672,
3536,
990,
638,
309,
3021,
353,
279,
5492,
17,
7312,
3563,
3021,
8395,
309,
486,
1549,
12,
10589,
16,
3364,
18,
1265,
4672,
327,
374,
309,
3480,
18,
17... |
out_file.write(binascii.b2a_uu(data)) | out_file.write(str(binascii.b2a_uu(data), "ascii")) | def encode(in_file, out_file, name=None, mode=None): """Uuencode file""" # # If in_file is a pathname open it and change defaults # if in_file == '-': in_file = sys.stdin elif isinstance(in_file, basestring): if name is None: name = os.path.basename(in_file) if mode is None: try: mode = os.stat(in_file).st_mode except AttributeError: pass in_file = open(in_file, 'rb') # # Open out_file if it is a pathname # if out_file == '-': out_file = sys.stdout elif isinstance(out_file, basestring): out_file = open(out_file, 'w') # # Set defaults for name and mode # if name is None: name = '-' if mode is None: mode = 0o666 # # Write the data # out_file.write('begin %o %s\n' % ((mode & 0o777),name)) data = in_file.read(45) while len(data) > 0: out_file.write(binascii.b2a_uu(data)) data = in_file.read(45) out_file.write(' \nend\n') | 5c49259813528aed5e8d6107d132c44f7a852133 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/5c49259813528aed5e8d6107d132c44f7a852133/uu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
267,
67,
768,
16,
596,
67,
768,
16,
508,
33,
7036,
16,
1965,
33,
7036,
4672,
3536,
57,
89,
3015,
585,
8395,
468,
468,
971,
316,
67,
768,
353,
279,
9806,
1696,
518,
471,
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,
2017,
12,
267,
67,
768,
16,
596,
67,
768,
16,
508,
33,
7036,
16,
1965,
33,
7036,
4672,
3536,
57,
89,
3015,
585,
8395,
468,
468,
971,
316,
67,
768,
353,
279,
9806,
1696,
518,
471,
2... |
if encoding is not None: text = text.decode(encoding) | def testfile(filename, module_relative=True, name=None, package=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, parser=DocTestParser(), encoding=None): """ Test examples in the given file. Return (#failures, #tests). Optional keyword arg "module_relative" specifies how filenames should be interpreted: - If "module_relative" is True (the default), then "filename" specifies a module-relative path. By default, this path is relative to the calling module's directory; but if the "package" argument is specified, then it is relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and should not be an absolute path (i.e., it may not begin with "/"). - If "module_relative" is False, then "filename" specifies an os-specific path. The path may be absolute or relative (to the current working directory). Optional keyword arg "name" gives the name of the test; by default use the file's basename. Optional keyword argument "package" is a Python package or the name of a Python package whose directory should be used as the base directory for a module relative filename. If no package is specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use {}. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS SKIP IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Optional keyword arg "parser" specifies a DocTestParser (or subclass) that should be used to extract tests from the files. Optional keyword arg "encoding" specifies an encoding that should be used to convert the file to unicode. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. """ global master if package and not module_relative: raise ValueError("Package may only be specified for module-" "relative paths.") # Relativize the path text, filename = _load_testfile(filename, package, module_relative) # If no name was given, then use the file's name. if name is None: name = os.path.basename(filename) # Assemble the globals. if globs is None: globs = {} else: globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) else: runner = DocTestRunner(verbose=verbose, optionflags=optionflags) if encoding is not None: text = text.decode(encoding) # Read the file, convert it to a test, and run it. test = parser.get_doctest(text, globs, name, filename, 0) runner.run(test) if report: runner.summarize() if master is None: master = runner else: master.merge(runner) return runner.failures, runner.tries | 1862736c3afcbb0446c06eff1ce76a43ca03ebb1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/1862736c3afcbb0446c06eff1ce76a43ca03ebb1/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
768,
12,
3459,
16,
1605,
67,
11626,
33,
5510,
16,
508,
33,
7036,
16,
2181,
33,
7036,
16,
4715,
87,
33,
7036,
16,
3988,
33,
7036,
16,
2605,
33,
5510,
16,
1456,
7133,
33,
20,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
768,
12,
3459,
16,
1605,
67,
11626,
33,
5510,
16,
508,
33,
7036,
16,
2181,
33,
7036,
16,
4715,
87,
33,
7036,
16,
3988,
33,
7036,
16,
2605,
33,
5510,
16,
1456,
7133,
33,
20,
1... | |
self.insertionModes["inHead"](self.parser).processStartTag(name, | self.parser.phase.insertionModes["inHead"](self.parser).processStartTag(name, | def startTagScript(self, name, attributes): self.insertionModes["inHead"](self.parser).processStartTag(name, attributes) | 3f6081e8cdf476677cbd0ea3842a280aa8d91840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4487/3f6081e8cdf476677cbd0ea3842a280aa8d91840/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
3651,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
13961,
18,
6387,
285,
18868,
9614,
267,
1414,
11929,
12,
2890,
18,
4288,
2934,
2567,
30512,
12,
529,
16,
1677,
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,
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,
1805,
3651,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
4288,
18,
13961,
18,
6387,
285,
18868,
9614,
267,
1414,
11929,
12,
2890,
18,
4288,
2934,
2567,
30512,
12,
529,
16,
1677,
13... |
".//dd": r'Return spam\.', | ".//dd/p": r'Return spam\.', | def teardown_module(): (test_root / '_build').rmtree(True) | 0044b943bc79587dbae29b2aa9dd6ef7e38b4338 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/0044b943bc79587dbae29b2aa9dd6ef7e38b4338/test_build_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28196,
67,
2978,
13332,
261,
3813,
67,
3085,
342,
2070,
3510,
16063,
86,
17371,
12,
5510,
13,
282,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
28196,
67,
2978,
13332,
261,
3813,
67,
3085,
342,
2070,
3510,
16063,
86,
17371,
12,
5510,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
earlier_datestamp = sample_datestamp[0:3] + str(int(sample_datestamp[3]) - 1) + sample_datestamp[4:] | earlier_datestamp = str(sample_datestamp_year - 1) + sample_datestamp_rest | def test_from_and_until(self): """bibharvest oai repository - testing selective harvesting with 'from' and 'until' parameters""" | 51481f6f7ea5dfc671083cc349e59556e4ef244b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/51481f6f7ea5dfc671083cc349e59556e4ef244b/oai_repository_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2080,
67,
464,
67,
12198,
12,
2890,
4672,
3536,
70,
495,
30250,
26923,
320,
10658,
3352,
300,
7769,
2027,
688,
17895,
90,
10100,
598,
296,
2080,
11,
471,
296,
12198,
11,
1472,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2080,
67,
464,
67,
12198,
12,
2890,
4672,
3536,
70,
495,
30250,
26923,
320,
10658,
3352,
300,
7769,
2027,
688,
17895,
90,
10100,
598,
296,
2080,
11,
471,
296,
12198,
11,
1472,
... |
for k in self.classcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.classcodes[k])) | for k, v in self.namemappers[0].getall('class'): self.fp.write("\t%s : %s,\n" % (`k`, v)) | def dumpindex(self): self.fp.write("\n#\n# Indices of types declared in this module\n#\n") self.fp.write("_classdeclarations = {\n") for k in self.classcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.classcodes[k])) self.fp.write("}\n") self.fp.write("\n_propdeclarations = {\n") for k in self.propcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.propcodes[k])) self.fp.write("}\n") self.fp.write("\n_compdeclarations = {\n") for k in self.compcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.compcodes[k])) self.fp.write("}\n") self.fp.write("\n_enumdeclarations = {\n") for k in self.enumcodes.keys(): self.fp.write("\t%s : %s,\n" % (`k`, self.enumcodes[k])) self.fp.write("}\n") | 42eee53a968a82394c0e1946ffbb8abc26471a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/42eee53a968a82394c0e1946ffbb8abc26471a5d/gensuitemodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
1615,
12,
2890,
4672,
365,
18,
7944,
18,
2626,
31458,
82,
7,
64,
82,
7,
23046,
434,
1953,
7886,
316,
333,
1605,
64,
82,
7,
64,
82,
7923,
365,
18,
7944,
18,
2626,
2932,
67,
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,
4657,
1615,
12,
2890,
4672,
365,
18,
7944,
18,
2626,
31458,
82,
7,
64,
82,
7,
23046,
434,
1953,
7886,
316,
333,
1605,
64,
82,
7,
64,
82,
7923,
365,
18,
7944,
18,
2626,
2932,
67,
11... |
applications.add(name) | def parse_module_info(path, applications, required_modules): file = open(path, "r") dom = xml.dom.minidom.parse(file) file.close() module_info = {} module_name = str(dom.getElementsByTagName('module')[0].attributes['name'].value) module_info['version'] = str(dom.getElementsByTagName('module')[0].attributes['version'].value) module_info['requires'] = [] if 0 < len(dom.getElementsByTagName('requires')): for node in dom.getElementsByTagName('requires')[0].getElementsByTagName('module'): current_req = {} current_req['name'] = str(node.attributes['name'].value) if 'minversion' in node.attributes.keys(): current_req['minversion'] = str(node.attributes['minversion'].value) if 'maxversion' in node.attributes.keys(): current_req['maxversion'] = str(node.attributes['maxversion'].value) module_info['requires'].append(current_req) required_modules.add(current_req['name']) module_info['conflicts'] = [] if 0 < len(dom.getElementsByTagName('conflicts')): for node in dom.getElementsByTagName('conflicts')[0].getElementsByTagName('module'): current_con = {} current_con['name'] = str(node.attributes['name'].value) if 'minversion' in node.attributes.keys(): current_con['minversion'] = str(node.attributes['minversion'].value) if 'maxversion' in node.attributes.keys(): current_con['maxversion'] = str(node.attributes['maxversion'].value) module_info['conflicts'].append(current_con) module_info['application'] = {} if 0 == len(dom.getElementsByTagName('application')): print '|\n| WARNING in configuration of ' + module_name + ':', print 'no application tag found' print '| Please check configuration file' raise Error() for current_app in dom.getElementsByTagName('application'): app_info = {} name = str(current_app.attributes['name'].value) applications.add(name) app_info['header_file'] = str(current_app.attributes['header_file'].value) app_info['init_function'] = str(current_app.attributes['init_function'].value) module_info['application'][name] = app_info return (applications, module_name, module_info, required_modules) | 442be850a27cb8fc6a324af407ed82d739960406 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6933/442be850a27cb8fc6a324af407ed82d739960406/process_modules.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2978,
67,
1376,
12,
803,
16,
12165,
16,
1931,
67,
6400,
4672,
225,
585,
273,
1696,
12,
803,
16,
315,
86,
7923,
4092,
273,
2025,
18,
9859,
18,
1154,
350,
362,
18,
2670,
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,
1109,
67,
2978,
67,
1376,
12,
803,
16,
12165,
16,
1931,
67,
6400,
4672,
225,
585,
273,
1696,
12,
803,
16,
315,
86,
7923,
4092,
273,
2025,
18,
9859,
18,
1154,
350,
362,
18,
2670,
12,
... | |
sage: P._macaulay2_() | sage: P._macaulay2_() | def macaulay2_str(self): """ Return a Macaulay2 representation of self. | 848026b3822637d89b15eefd18ccb22f079905f9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/848026b3822637d89b15eefd18ccb22f079905f9/term_order.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5318,
69,
332,
528,
22,
67,
701,
12,
2890,
4672,
3536,
2000,
279,
13217,
69,
332,
528,
22,
4335,
434,
365,
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,
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,
5318,
69,
332,
528,
22,
67,
701,
12,
2890,
4672,
3536,
2000,
279,
13217,
69,
332,
528,
22,
4335,
434,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
numRows = int(cursor.execute("select distinct ai.maternal_ecotype_id, ai.paternal_ecotype_id, ci.filename, ai.id from call_info ci, array_info ai where ci.array_id=ai.id and ci.method_id="+str(methodId)+" order by ai.id")) | numRows = int(cursor.execute("select distinct ai.maternal_ecotype_id, ai.paternal_ecotype_id, ci.filename, ai.id from call_info ci, array_info ai where ci.array_id=ai.id and ci.method_id="+str(methodId)+" and ai.maternal_ecotype_id is not null and ai.paternal_ecotype_id is not null order by ai.id")) | def get250KDataFromDb(host="banyan.usc.edu", chromosomes=[1,2,3,4,5], db = "stock_250k", withArrayIds=False, methodId=1, user = None, passwd = None): """ Retrieve 2010 data from DB. Returns a list of RawSnpsData objects. withArrayInfo: if True, then a row of array used to genotype is added before the accession row. methodId: Specify the (base-calling/imputation) method. """ rt = time.time() decoder = RawDecoder() #Other unused informative letters are ['R','Y','S','M','K','W']!! print "Connecting to db, host="+host if not user: import sys sys.stdout.write("Username: ") user = sys.stdin.readline().rstrip() if not passwd: import getpass passwd = getpass.getpass() try: conn = MySQLdb.connect (host = host, user = user, passwd = passwd, db = db) except MySQLdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) sys.exit (1) cursor = conn.cursor () #Get distinct accessions and their id. #Generate an internal dictionary using their id. print "Fetching data" numRows = int(cursor.execute("select distinct ai.maternal_ecotype_id, ai.paternal_ecotype_id, ci.filename, ai.id from call_info ci, array_info ai where ci.array_id=ai.id and ci.method_id="+str(methodId)+" order by ai.id")) dict = {} accessions = [] arrayIds = [] dataFiles = [] i = 0 while(1): row = cursor.fetchone() if not row: break; if int(row[0])==int(row[1]): accession = str(int(row[0])) else: accession = str(int(row[0]))+"_"+str(int(row[1])) dict[accession]=i accessions.append(accession) dataFiles.append(row[2]) arrayIds.append(str(int(row[3]))) i = i+1 f = open(dataFiles[0],"r") lines = f.readlines() f.close() numSnps = len(lines) line = lines[1].split() linesList = [] for i in range(0,len(accessions)): #Checking files f = open(dataFiles[i],"r") newLines = f.readlines() f.close() if len(newLines)!=numSnps: raise Exception("Data files are not equal in length.") linesList.append(newLines) chromosomes = [] positionsList = [] snpsList = [] i = 1 newChr = int(line[0].split("_")[0]) while i < len(lines): chromosomes.append(int(newChr)) oldChr = newChr positions = [] snps =[] while i < len(lines) and newChr == oldChr: line = lines[i].split() chrPos = line[0].split("_") oldChr = int(chrPos[0]) positions.append(int(chrPos[1])) snp = [] for j in range(0,len(accessions)): l = linesList[j][i].split() snp.append(l[1].rstrip()) snps.append(snp) i += 1 if i < len(lines): line = lines[i].split() newChr = int(line[0].split("_")[0]) else: break print "Fetched ",i,"SNPs of",len(lines) positionsList.append(positions) snpsList.append(snps) snpsds = [] for i in chromosomes: snpsds.append(RawSnpsData(snpsList[i-1], positionsList[i-1], accessions=accessions, arrayIds=arrayIds)) dif = int(time.time() - rt) print "It took "+str(dif/60)+" min. and "+str(dif%60)+" sec. to fetch data." return snpsds | 1005eca5e72e7e3b9747c8482d325c47919b7ddb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/1005eca5e72e7e3b9747c8482d325c47919b7ddb/dataParsers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
26520,
47,
751,
1265,
4331,
12,
2564,
1546,
70,
2273,
304,
18,
19446,
18,
28049,
3113,
8123,
538,
21912,
22850,
21,
16,
22,
16,
23,
16,
24,
16,
25,
6487,
1319,
273,
315,
15381,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26520,
47,
751,
1265,
4331,
12,
2564,
1546,
70,
2273,
304,
18,
19446,
18,
28049,
3113,
8123,
538,
21912,
22850,
21,
16,
22,
16,
23,
16,
24,
16,
25,
6487,
1319,
273,
315,
15381,
... |
if _debug: print "\t%s: Called Camera.setAzimuth()" % rendererName | debugMsg("Called Camera.setAzimuth()") | def setAzimuth(self,azimuth): """ Set the azimuthal angle (in degrees) of the Camera | 96b00238a8d5cd11876b111a3518775124c30a4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/96b00238a8d5cd11876b111a3518775124c30a4c/camera.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
37,
94,
15968,
12,
2890,
16,
28306,
4672,
3536,
1000,
326,
23090,
287,
5291,
261,
267,
10904,
13,
434,
326,
30355,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
37,
94,
15968,
12,
2890,
16,
28306,
4672,
3536,
1000,
326,
23090,
287,
5291,
261,
267,
10904,
13,
434,
326,
30355,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
(beta, coeffs, coeff_names, basis, m, probfunc, flip) = parser(classifier,examples, buckets) | (beta, coeffs, coeff_names, basis, m, probfunc) = parser(classifier,examples, buckets) | def __init__(self, examples, classifier, dimensions = 2, buckets = 3, getpies = 0, getexamples = 1): # error detection if len(examples.domain.classVar.values) != 2: raise "The domain does not have a binary class. Binary class is required." | 0a311cc0938f5547055258b42c5dff80f4d9072f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/0a311cc0938f5547055258b42c5dff80f4d9072f/orngLinVis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
10991,
16,
14622,
16,
5769,
273,
576,
16,
9169,
273,
890,
16,
336,
84,
606,
273,
374,
16,
336,
16858,
273,
404,
4672,
468,
555,
11649,
309,
562,
12,
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,
1001,
2738,
972,
12,
2890,
16,
10991,
16,
14622,
16,
5769,
273,
576,
16,
9169,
273,
890,
16,
336,
84,
606,
273,
374,
16,
336,
16858,
273,
404,
4672,
468,
555,
11649,
309,
562,
12,
16... |
argument = ctx['T'] self.fix_object_gap(ctx['PP'], ctx['P'], ctx['T'], ctx['S']) | argument = ctx.t self.fix_object_gap(ctx.pp, ctx.p, ctx.t, ctx.s) | def fix_rnr(self, rnr, g): debug("Fixing RNR: %s", pprint(g)) index = get_trace_index_from_tag(rnr.lex) # -i debug("index: %s", index) expr = r'*=PP < { *=P < { *=T < ^/\*RNR\*%s/ $ *=S } }' % index for node, ctx in find_all(g, expr, with_context=True): inherit_tag(ctx['S'], ctx['P']) self.fix_object_gap(ctx['PP'], ctx['P'], ctx['T'], ctx['S']) self.fix_categories_starting_from(ctx['S'], g) debug("post deletion: %s", pprint(g)) | 6550bb6489583e5c02c61dbb907bc6e2b4b74174 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8383/6550bb6489583e5c02c61dbb907bc6e2b4b74174/fix_rc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
86,
11611,
12,
2890,
16,
436,
11611,
16,
314,
4672,
1198,
2932,
8585,
310,
534,
50,
54,
30,
738,
87,
3113,
18771,
12,
75,
3719,
770,
273,
336,
67,
5129,
67,
1615,
67,
2080,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
86,
11611,
12,
2890,
16,
436,
11611,
16,
314,
4672,
1198,
2932,
8585,
310,
534,
50,
54,
30,
738,
87,
3113,
18771,
12,
75,
3719,
770,
273,
336,
67,
5129,
67,
1615,
67,
2080,... |
ports = client.get_ports() | ports = monitor_client.get_ports() | def clients() : ports = client.get_ports() l = [] l += set( [_client_from_port(port) for port in ports] ) return l | 7966e22855b4c00c398506a8416f929e50d01492 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1456/7966e22855b4c00c398506a8416f929e50d01492/jack_bus_connect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7712,
1435,
294,
9048,
273,
6438,
67,
2625,
18,
588,
67,
4363,
1435,
328,
273,
5378,
328,
1011,
444,
12,
306,
67,
2625,
67,
2080,
67,
655,
12,
655,
13,
364,
1756,
316,
9048,
65,
262,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7712,
1435,
294,
9048,
273,
6438,
67,
2625,
18,
588,
67,
4363,
1435,
328,
273,
5378,
328,
1011,
444,
12,
306,
67,
2625,
67,
2080,
67,
655,
12,
655,
13,
364,
1756,
316,
9048,
65,
262,... |
if IBrowserRequest.providedBy(self): zope.publisher.skinnable.setDefaultSkin(request) | if ISkinnable.providedBy(self): setDefaultSkin(request) | def retry(self): 'See IPublisherRequest' count = getattr(self, '_retry_count', 0) self._retry_count = count + 1 | cf00df9d4861c15ed26074091e178d3a239eef77 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9825/cf00df9d4861c15ed26074091e178d3a239eef77/http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3300,
12,
2890,
4672,
296,
9704,
2971,
2394,
264,
691,
11,
1056,
273,
3869,
12,
2890,
16,
2070,
9620,
67,
1883,
2187,
374,
13,
365,
6315,
9620,
67,
1883,
273,
1056,
397,
404,
2,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3300,
12,
2890,
4672,
296,
9704,
2971,
2394,
264,
691,
11,
1056,
273,
3869,
12,
2890,
16,
2070,
9620,
67,
1883,
2187,
374,
13,
365,
6315,
9620,
67,
1883,
273,
1056,
397,
404,
2,
-100,
... |
('max-age', max_age), ('HttpOnly', httponly)): | ('max-age', max_age), ('httponly', httponly)): | def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False): """Set a new cookie.""" try: key = str(key) except UnicodeError: raise TypeError('invalid key %r' % key) c = SimpleCookie() if isinstance(value, unicode): value = value.encode(self.charset) c[key] = value if expires is not None: if not isinstance(expires, basestring): expires = cookie_date(expires) c[key]['expires'] = expires for k, v in (('path', path), ('domain', domain), ('secure', secure), ('max-age', max_age), ('HttpOnly', httponly)): if v is not None and v is not False: c[key][k] = str(v) self.headers.add('Set-Cookie', c[key].output(header='').lstrip()) | 1734fcc7bed9a003480849e3feaa939331050c82 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14437/1734fcc7bed9a003480849e3feaa939331050c82/wrappers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
8417,
12,
2890,
16,
498,
16,
460,
2218,
2187,
943,
67,
410,
33,
7036,
16,
7368,
33,
7036,
16,
589,
2218,
19,
2187,
2461,
33,
7036,
16,
8177,
33,
7036,
16,
15851,
27864,
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,
444,
67,
8417,
12,
2890,
16,
498,
16,
460,
2218,
2187,
943,
67,
410,
33,
7036,
16,
7368,
33,
7036,
16,
589,
2218,
19,
2187,
2461,
33,
7036,
16,
8177,
33,
7036,
16,
15851,
27864,
33,
... |
answer = self.ask(askit,pl) | def assemblefirstrun(self): temp = {} new = {} for pl in self.done.keys(): code = pl.code() if code == wikipedia.mylang and pl.exists() and not pl.isRedirectPage() and not pl.isEmpty(): if pl != self.inpl: err = 'Someone refers to %s with us' % pl.asasciilink() self.problem(err) if globalvar.autonomous: return None elif pl.exists() and not pl.isRedirectPage(): if new.has_key(code) and new[code] is None: print "NOTE: Ignoring %s"%(pl.asasciilink()) elif temp.has_key(code) and temp[code] is None: answer = ' ' while answer not in 'yng': answer = raw_input('%s y(es)/n(o)/g(ive up)? '%pl.asasciilink()) answer = self.ask(askit,pl) if answer == 'y': temp[code] = pl new[code] = pl elif answer == 'n': pass elif answer == 'g': return None elif temp.has_key(code) and temp[code] != pl: err = "'%s' as well as '%s'" % (temp[code].asasciilink(), pl.asasciilink()) self.problem(err) if globalvar.autonomous: return None while 1: answer = raw_input("Use (f)ormer or (l)atter or (n)either or (g)ive up?") if answer.startswith('f'): new[code] = temp[code] break elif answer.startswith('l'): temp[code] = pl new[code] = pl break elif answer.startswith('n'): temp[code] = None break elif answer.startswith('g'): # Give up return None elif code in ('zh-tw','zh-cn') and temp.has_key('zh') and temp['zh'] is not None: temp['zh'] = None # Remove the global zh link temp[code] = pl # Add the more precise one elif code == 'zh' and ( (temp.has_key('zh-tw') and temp['zh-tw'] is not None) or (temp.has_key('zh-cn') and temp['zh-cn'] is not None)): pass # do not add global zh if there is a specific zh-tw or zh-cn elif code not in temp: temp[code] = pl for k,v in temp.items(): if v is None: new[k] = None return new | 39be14125a7247ee5054239cc49a023d4f37a71d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/39be14125a7247ee5054239cc49a023d4f37a71d/interwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19540,
74,
481,
701,
318,
12,
2890,
4672,
1906,
273,
2618,
394,
273,
2618,
364,
886,
316,
365,
18,
8734,
18,
2452,
13332,
981,
273,
886,
18,
710,
1435,
309,
981,
422,
21137,
18,
4811,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19540,
74,
481,
701,
318,
12,
2890,
4672,
1906,
273,
2618,
394,
273,
2618,
364,
886,
316,
365,
18,
8734,
18,
2452,
13332,
981,
273,
886,
18,
710,
1435,
309,
981,
422,
21137,
18,
4811,
... | |
self.response_event.set() | def _caller(self, backend, function, args, kwargs): debug('%s: Thread created successfully' % backend) with backend: try: # Call method on backend try: debug('%s: Calling function %s' % (backend, function)) if callable(function): result = function(backend, *args, **kwargs) else: result = getattr(backend, function)(*args, **kwargs) except Exception, error: debug('%s: Called function %s raised an error: %r' % (backend, function, error)) self._store_error(backend, error) else: debug('%s: Called function %s returned: %r' % (backend, function, result)) | 734e73dce6e914b5564027537922eeb0af9b78e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/734e73dce6e914b5564027537922eeb0af9b78e3/bcall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16140,
12,
2890,
16,
4221,
16,
445,
16,
833,
16,
1205,
4672,
1198,
29909,
87,
30,
4884,
2522,
4985,
11,
738,
4221,
13,
598,
4221,
30,
775,
30,
468,
3049,
707,
603,
4221,
775,
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,
389,
16140,
12,
2890,
16,
4221,
16,
445,
16,
833,
16,
1205,
4672,
1198,
29909,
87,
30,
4884,
2522,
4985,
11,
738,
4221,
13,
598,
4221,
30,
775,
30,
468,
3049,
707,
603,
4221,
775,
30... | |
img = image(disp.file) | img = image(disp.file, scene) | def start_render(render, ribfile, current_pass, rhandle, scene): r = scene.render x = int(r.resolution_x * r.resolution_percentage * 0.01) y = int(r.resolution_y * r.resolution_percentage * 0.01) | 7f85553c4440f5b8b61bece99e657a34af1b0143 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14285/7f85553c4440f5b8b61bece99e657a34af1b0143/export_renderman.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
5902,
12,
5902,
16,
436,
495,
768,
16,
783,
67,
5466,
16,
436,
4110,
16,
9065,
4672,
436,
273,
9065,
18,
5902,
619,
273,
509,
12,
86,
18,
19182,
67,
92,
380,
436,
18,
1918... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
5902,
12,
5902,
16,
436,
495,
768,
16,
783,
67,
5466,
16,
436,
4110,
16,
9065,
4672,
436,
273,
9065,
18,
5902,
619,
273,
509,
12,
86,
18,
19182,
67,
92,
380,
436,
18,
1918... |
sim.getRNG().setSeed(12345) | sim.getRNG().set(seed=12345) | def passInfo(x, y, anc): 'Parental fields will be passed as tuples' off_anc = (anc[0] + anc[1])/2. off_x = (x[0] + x[1])/2 + random.normalvariate(off_anc - 0.5, 0.1) off_y = (y[0] + y[1])/2 + random.normalvariate(0, 0.1) return off_x, off_y, off_anc | 205f55f8c6cd28aed704d70838912648f07ac340 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/205f55f8c6cd28aed704d70838912648f07ac340/userGuide.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1342,
966,
12,
92,
16,
677,
16,
392,
71,
4672,
296,
3054,
287,
1466,
903,
506,
2275,
487,
10384,
11,
3397,
67,
19292,
273,
261,
19292,
63,
20,
65,
397,
392,
71,
63,
21,
5717,
19,
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,
1342,
966,
12,
92,
16,
677,
16,
392,
71,
4672,
296,
3054,
287,
1466,
903,
506,
2275,
487,
10384,
11,
3397,
67,
19292,
273,
261,
19292,
63,
20,
65,
397,
392,
71,
63,
21,
5717,
19,
2... |
q1 = s.query(User).filter(User.name=='ed') q2 = s.query(User).filter(User.name=='fred') | q1 = s.query(User).filter(User.name=='ed').with_labels() q2 = s.query(User).filter(User.name=='fred').with_labels() | def test_union(self): s = create_session() q1 = s.query(User).filter(User.name=='ed') q2 = s.query(User).filter(User.name=='fred') eq_( s.query(User).from_statement(union(q1, q2).order_by(User.name)).all(), [User(name='ed'), User(name='fred')] ) | 22b32da23a6a2e489afff9f778c37b2787950ef3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1074/22b32da23a6a2e489afff9f778c37b2787950ef3/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
18910,
12,
2890,
4672,
272,
273,
752,
67,
3184,
1435,
225,
1043,
21,
273,
272,
18,
2271,
12,
1299,
2934,
2188,
12,
1299,
18,
529,
18920,
329,
16063,
1918,
67,
5336,
1435,
104... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18910,
12,
2890,
4672,
272,
273,
752,
67,
3184,
1435,
225,
1043,
21,
273,
272,
18,
2271,
12,
1299,
2934,
2188,
12,
1299,
18,
529,
18920,
329,
16063,
1918,
67,
5336,
1435,
104... |
team_map = {} | team_count_map = {} | def testing_status() : server_name = 'rcssserver' server_user = '' process_list = get_cmd_output('export LANG="POSIX"; ps -e -o comm,user=').strip().split('\n') process_list.pop(0) team_map = {} cmd_count_map = {} matched_cmds = {} for process in process_list : info = process.split() (cmd, user) = (info[0], info[1]) cmd_count_map[cmd] = 1 + cmd_count_map.get(cmd, 0) for pattern in team_name_map.keys() : if pattern.match(cmd) : matched_cmds[cmd] = 1 team_name = team_name_map[pattern] team_map[team_name] = 1 + team_map.get(team_name, 0) break if not server_user and cmd == server_name : server_user = user message = ' #rcssserver: ' if server_user : server_count = cmd_count_map[server_name] if len(team_map) <= 1 : count_cmd_map = {} sucess = False for cmd in cmd_count_map.keys() : count_cmd_map.setdefault(cmd_count_map[cmd], []).append(cmd) count_list = count_cmd_map.keys() count_list.sort() count_list.reverse() for count in count_list : for cmd in count_cmd_map[count] : if not matched_cmds.has_key(cmd) : team_map['[' + cmd + ']'] = cmd_count_map[cmd] if len(team_map) >= 2 : sucess = True break if sucess : break message += '%d, %s (' % (server_count, server_user) for team in sorted(team_map.keys()) : message += '%s x %s, ' % (team, team_map[team]) message = message.rstrip(', ') + ')' else : message += '0' return message | fda0c75e81e4171fbfd5b7da1e054db790bac19c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/228/fda0c75e81e4171fbfd5b7da1e054db790bac19c/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7769,
67,
2327,
1435,
294,
1438,
67,
529,
273,
296,
1310,
1049,
3567,
11,
1438,
67,
1355,
273,
875,
225,
1207,
67,
1098,
273,
336,
67,
4172,
67,
2844,
2668,
6530,
19913,
1546,
2419,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7769,
67,
2327,
1435,
294,
1438,
67,
529,
273,
296,
1310,
1049,
3567,
11,
1438,
67,
1355,
273,
875,
225,
1207,
67,
1098,
273,
336,
67,
4172,
67,
2844,
2668,
6530,
19913,
1546,
2419,
31... |
sf = StringIO(headers) | sf = StringIO(str(headers)) | def ftp_open(self, req): import ftplib import mimetypes host = req.get_host() if not host: raise URLError('ftp error: no host given') host, port = splitport(host) if port is None: port = ftplib.FTP_PORT else: port = int(port) | 3c94e8bc86d2587303d10103f396440eaf4acf72 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/3c94e8bc86d2587303d10103f396440eaf4acf72/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
3190,
12,
2890,
16,
1111,
4672,
1930,
11038,
6673,
1930,
20369,
15180,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
309,
486,
1479,
30,
1002,
1976,
668,
2668,
11727,
555,
30,
115... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
3190,
12,
2890,
16,
1111,
4672,
1930,
11038,
6673,
1930,
20369,
15180,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
309,
486,
1479,
30,
1002,
1976,
668,
2668,
11727,
555,
30,
115... |
>>> c = Counter('hocus pocus') | >>> c = Counter('gallahad') | def __init__(self, iterable=None): '''Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. | ecf592b1d3dbb37597b9c478af625a05cee2aeba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/ecf592b1d3dbb37597b9c478af625a05cee2aeba/collections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6087,
33,
7036,
4672,
9163,
1684,
279,
394,
16,
1008,
9354,
733,
18,
225,
7835,
309,
864,
16,
1056,
2186,
628,
392,
810,
6087,
18,
225,
2965,
16,
4046,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6087,
33,
7036,
4672,
9163,
1684,
279,
394,
16,
1008,
9354,
733,
18,
225,
7835,
309,
864,
16,
1056,
2186,
628,
392,
810,
6087,
18,
225,
2965,
16,
4046,
... |
"localmoduletable", "manpage", "input"]) | "localmoduletable"]) | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries are name # -> ([list of attribute names], first_is_optional, empty) "cfuncdesc": (["type", "name", ("args",)], 0, 0), "chapter": ([("title",)], 0, 0), "chapter*": ([("title",)], 0, 0), "classdesc": (["name", ("constructor-args",)], 0, 0), "ctypedesc": (["name"], 0, 0), "cvardesc": (["type", "name"], 0, 0), "datadesc": (["name"], 0, 0), "declaremodule": (["id", "type", "name"], 1, 1), "deprecated": (["release"], 0, 1), "documentclass": (["classname"], 0, 1), "excdesc": (["name"], 0, 0), "funcdesc": (["name", ("args",)], 0, 0), "funcdescni": (["name", ("args",)], 0, 0), "indexii": (["ie1", "ie2"], 0, 1), "indexiii": (["ie1", "ie2", "ie3"], 0, 1), "indexiv": (["ie1", "ie2", "ie3", "ie4"], 0, 1), "input": (["source"], 0, 1), "item": ([("leader",)], 1, 0), "label": (["id"], 0, 1), "manpage": (["name", "section"], 0, 1), "memberdesc": (["class", "name"], 1, 0), "methoddesc": (["class", "name", ("args",)], 1, 0), "methoddescni": (["class", "name", ("args",)], 1, 0), "opcodedesc": (["name", "var"], 0, 0), "par": ([], 0, 1), "rfc": (["number"], 0, 1), "section": ([("title",)], 0, 0), "seemodule": (["ref", "name"], 1, 0), "tableii": (["colspec", "style", "head1", "head2"], 0, 0), "tableiii": (["colspec", "style", "head1", "head2", "head3"], 0, 0), "tableiv": (["colspec", "style", "head1", "head2", "head3", "head4"], 0, 0), "versionadded": (["version"], 0, 1), "versionchanged": (["version"], 0, 1), # "ABC": "ABC", "ASCII": "ASCII", "C": "C", "Cpp": "Cpp", "EOF": "EOF", "e": "backslash", "ldots": "ldots", "NULL": "NULL", "POSIX": "POSIX", "UNIX": "Unix", # # Things that will actually be going away! # "fi": ([], 0, 1), "ifhtml": ([], 0, 1), "makeindex": ([], 0, 1), "makemodindex": ([], 0, 1), "maketitle": ([], 0, 1), "noindent": ([], 0, 1), "tableofcontents": ([], 0, 1), }, discards=["fi", "ifhtml", "makeindex", "makemodindex", "maketitle", "noindent", "tableofcontents"], autoclosing=["chapter", "section", "subsection", "subsubsection", "paragraph", "subparagraph", ], knownempties=["rfc", "declaremodule", "appendix", "maketitle", "makeindex", "makemodindex", "localmoduletable", "manpage", "input"]) | daf351be69c52ca2c4be41ece7f9ece802a76f64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/daf351be69c52ca2c4be41ece7f9ece802a76f64/latex2esis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
562,
12,
9499,
18,
19485,
13,
422,
576,
30,
309,
84,
273,
1696,
12,
9499,
18,
19485,
63,
21,
5717,
434,
84,
273,
2589,
18,
10283,
1327,
562,
12,
9499,
18,
19485,
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,
2774,
13332,
309,
562,
12,
9499,
18,
19485,
13,
422,
576,
30,
309,
84,
273,
1696,
12,
9499,
18,
19485,
63,
21,
5717,
434,
84,
273,
2589,
18,
10283,
1327,
562,
12,
9499,
18,
19485,
13... |
if (res == 11): | sig = res & 0x7F if (GetVerbose() and res != 0): print GetColor("red") + "Process exited with exit status %d and signal code %d" % ((res & 0xFF00) >> 8, sig) + GetColor() if (sig == signal.SIGINT): raise KeyboardInterrupt if (sig == signal.SIGSEGV or res == 35584 or res == 34304): | def oscmd(cmd, ignoreError = False): if VERBOSE: print GetColor("blue") + cmd.split(" ", 1)[0] + " " + GetColor("magenta") + cmd.split(" ", 1)[1] + GetColor() sys.stdout.flush() if sys.platform == "win32": exe = cmd.split()[0] if not (len(exe) > 4 and exe[-4:] == ".exe"): exe += ".exe" if os.path.isfile(exe)==0: for i in os.environ["PATH"].split(";"): if os.path.isfile(os.path.join(i, exe)): exe = os.path.join(i, exe) break if os.path.isfile(exe)==0: exit("Cannot find "+exe+" on search path") res = os.spawnl(os.P_WAIT, exe, cmd) else: res = os.system(cmd) if (res == 11): if (LocateBinary("gdb") and GetVerbose()): print GetColor("red") + "Received SIGSEGV, retrieving traceback..." + GetColor() os.system("gdb -batch -ex 'handle SIG33 pass nostop noprint' -ex 'set pagination 0' -ex 'run' -ex 'bt full' -ex 'info registers' -ex 'thread apply all backtrace' -ex 'quit' --args %s < /dev/null" % cmd) else: print GetColor("red") + "Received SIGSEGV" + GetColor() if res != 0 and not ignoreError: if "interrogate" in cmd.split(" ", 1)[0] and GetVerbose(): print GetColor("red") + "Interrogate failed, retrieving debug output..." + GetColor() os.system(cmd.split(" ", 1)[0] + " -v " + cmd.split(" ", 1)[1]) exit("") | 38b35ef153d2a826f1881db1045426eba0725ebb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8543/38b35ef153d2a826f1881db1045426eba0725ebb/makepandacore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31476,
1264,
12,
4172,
16,
2305,
668,
273,
1083,
4672,
309,
27857,
30,
1172,
968,
2957,
2932,
14081,
7923,
397,
1797,
18,
4939,
2932,
3104,
404,
25146,
20,
65,
397,
315,
315,
397,
968,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31476,
1264,
12,
4172,
16,
2305,
668,
273,
1083,
4672,
309,
27857,
30,
1172,
968,
2957,
2932,
14081,
7923,
397,
1797,
18,
4939,
2932,
3104,
404,
25146,
20,
65,
397,
315,
315,
397,
968,
... |
pb = gtk.gdk.pixbuf_new_from_file("../../../panel-applet/keyring.png") | pb = gtk.gdk.pixbuf_new_from_file("/usr/share/icons/hicolor/16x16/stock/generic/stock_keyring.png") | def _get_encrypted_icon(self): pb = gtk.gdk.pixbuf_new_from_file("../../../panel-applet/keyring.png") pb = pb.scale_simple(16,16,gtk.gdk.INTERP_NEAREST) _keyring = gtk.Image() _keyring.set_from_pixbuf(pb) return _keyring | 47fab57a6729659d98af499e8f13a43a74eb5416 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11281/47fab57a6729659d98af499e8f13a43a74eb5416/network_tray.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
18702,
67,
3950,
12,
2890,
4672,
6386,
273,
22718,
18,
75,
2883,
18,
14861,
4385,
67,
2704,
67,
2080,
67,
768,
2932,
19,
13640,
19,
14419,
19,
14516,
19,
76,
12463,
280,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
18702,
67,
3950,
12,
2890,
4672,
6386,
273,
22718,
18,
75,
2883,
18,
14861,
4385,
67,
2704,
67,
2080,
67,
768,
2932,
19,
13640,
19,
14419,
19,
14516,
19,
76,
12463,
280,
... |
for site, d in self.tree: | for site, d in self.tree.iteritems(): | def __iter__(self): for site, d in self.tree: for page in d: yield page | 775163596e87803126b8943a719cd5a3e70d387e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/775163596e87803126b8943a719cd5a3e70d387e/interwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
364,
2834,
16,
302,
316,
365,
18,
3413,
18,
2165,
3319,
13332,
364,
1363,
316,
302,
30,
2824,
1363,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
364,
2834,
16,
302,
316,
365,
18,
3413,
18,
2165,
3319,
13332,
364,
1363,
316,
302,
30,
2824,
1363,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
x,l = encode_func(x) | y,l = encode_func(x) | def unicode2html(x, encoding='latin1'): # We have a unicode string. We can attempt to encode it into the desired # format, and if that doesn't work, we encode the unicode into html # # entities. try: encode_func, decode_func, stream_reader, stream_writer = codecs.lookup(encoding) x,l = encode_func(x) except UnicodeError: x = UnicodeToAsciiHtml(x) return str(x) | a8e02e59e66745dcdc0d66c343f0ade5f36faca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/a8e02e59e66745dcdc0d66c343f0ade5f36faca6/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5252,
22,
2620,
12,
92,
16,
2688,
2218,
26578,
21,
11,
4672,
468,
1660,
1240,
279,
5252,
533,
18,
1660,
848,
4395,
358,
2017,
518,
1368,
326,
6049,
468,
740,
16,
471,
309,
716,
3302,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5252,
22,
2620,
12,
92,
16,
2688,
2218,
26578,
21,
11,
4672,
468,
1660,
1240,
279,
5252,
533,
18,
1660,
848,
4395,
358,
2017,
518,
1368,
326,
6049,
468,
740,
16,
471,
309,
716,
3302,
... |
try: altconn = me.database.connection() altcur = altconn.cursor() except Exception, x: print "Exception at line 40:",type(x),x raise | altconn = me.database.connection() altcur = altconn.cursor() | def makeBogusReports (connection, cursor, logger): # make some bogus data in the reports table reportsTable = sch.ReportsTable(logger) reportsTable.createPartitions(me.cur, sch.mondayPairsIteratorFactory(dt.datetime(2009,05,04),dt.datetime(2009,05,04))) # ( uuid, client_crash_date, date_processed, product, version, build, signature, url, install_age, last_crash, uptime, email, build_date, user_id, user_comments, app_notes, distributor, distributor_version, topmost_filenames, addons_checked, flash_version, hangid, process_type, started_datetime, completed_datetime, truncated, success, processor_notes) values fakeReportData = [ (( "uuid1", None, dt.datetime(2009, 05, 04), "bogus", "1.0", "xxx", '', "http://cnn.com", 100, 14, 10, None, None, None, "bogus", "", "", ",", None, None, None, None, None, dt.datetime.now(), dt.datetime.now(), False, True, ''), "BogusClass::bogus_signature (const char**, void *)"), (( "uuid2", None, dt.datetime(2009, 05, 04), "bogus", "1.0", "xxx", '', "http://cnn.com", 100, 14, 10, None, None, None, "bogus", "", "", ",", None, None, None, None, None, dt.datetime.now(), dt.datetime.now(), False, True, ''), "js3250.dll@0x6cb96"), (( "uuid3", None, dt.datetime(2009, 05, 04), "bogus", "1.0", "xxx", '', "http://cnn.com", 100, 14, 10, None, None, None, "bogus", "", "", ",", None, None, None, None, None, dt.datetime.now(), dt.datetime.now(), False, True, ''), "libobjc.A.dylib@0x1568c"), (( "uuid4", None, dt.datetime(2009, 05, 04), "bogus", "1.0", "xxx", '', "http://cnn.com", 100, 14, 10, None, None, None, "bogus", "", "", ",", None, None, None, None, None, dt.datetime.now(), dt.datetime.now(), False, True, ''), "nanojit::LIns::isTramp()"), (( "uuid5", None, dt.datetime(2009, 05, 04), "bogus", "1.0", "xxx", '', "http://cnn.com", 100, 14, 10, None, None, None, "bogus", "", "", ",", None, None, None, None, None, dt.datetime.now(), dt.datetime.now(), False, True, ''), "libobjc.A.dylib@0x1568c"), ] try: #altconn = psycopg2.connect(me.dsn) altconn = me.database.connection() altcur = altconn.cursor() except Exception, x: print "Exception at line 40:",type(x),x raise def cursorFunction(): return altconn, altcur for rep, sig in fakeReportData: try: reportsTable.insert(cursor, rep, cursorFunction, date_processed=rep[2]) connection.commit() cursor.execute("update reports set signature=%s where date_processed = %s and uuid = %s", (sig, rep[2], rep[0])) connection.commit() except Exception, x: print "Exception at line 51", type(x),x connection.rollback() altconn.close() | 2001b67b7bf5a4d3744ede55d765e4552ba04d6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12383/2001b67b7bf5a4d3744ede55d765e4552ba04d6d/testBugzilla.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
38,
28774,
18631,
261,
4071,
16,
3347,
16,
1194,
4672,
468,
1221,
2690,
324,
28774,
501,
316,
326,
10557,
1014,
10557,
1388,
273,
18551,
18,
18631,
1388,
12,
4901,
13,
10557,
1388,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
38,
28774,
18631,
261,
4071,
16,
3347,
16,
1194,
4672,
468,
1221,
2690,
324,
28774,
501,
316,
326,
10557,
1014,
10557,
1388,
273,
18551,
18,
18631,
1388,
12,
4901,
13,
10557,
1388,
... |
if type(rs) is IIBType: | if sort_index is None and type(rs) is IIBType: | def _indexedSearch(self, args, sort_index, append, used, IIBType=type(IIBucket()), intSType=type(intSet())): """ Iterate through the indexes, applying the query to each one. Do some magic to join result sets. Be intelligent about handling intSets and IIBuckets. """ | c616b8dda383bf13a96c97291d204113250827e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c616b8dda383bf13a96c97291d204113250827e2/Catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19626,
2979,
12,
2890,
16,
833,
16,
1524,
67,
1615,
16,
714,
16,
1399,
16,
467,
13450,
559,
33,
723,
12,
6954,
4103,
1435,
3631,
509,
55,
559,
33,
723,
12,
474,
694,
1435,
3719,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19626,
2979,
12,
2890,
16,
833,
16,
1524,
67,
1615,
16,
714,
16,
1399,
16,
467,
13450,
559,
33,
723,
12,
6954,
4103,
1435,
3631,
509,
55,
559,
33,
723,
12,
474,
694,
1435,
3719,... |
self.targetValue = 0 self.openContext("", self.data) if self.data and len(self.data.domain.attributes) > 0: self.setVariable() | self.targetValue = 0 | def cdata(self, data): self.closeContext() if data == None: self.variablesQCB.clear() self.targetQCB.clear() self.outcomes = [] | c13f546c5f300c247c60f0d75e3a913cfb6c3646 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/c13f546c5f300c247c60f0d75e3a913cfb6c3646/OWDistributions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20712,
12,
2890,
16,
501,
4672,
365,
18,
4412,
1042,
1435,
225,
309,
501,
422,
599,
30,
365,
18,
7528,
53,
8876,
18,
8507,
1435,
365,
18,
3299,
53,
8876,
18,
8507,
1435,
365,
18,
659... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20712,
12,
2890,
16,
501,
4672,
365,
18,
4412,
1042,
1435,
225,
309,
501,
422,
599,
30,
365,
18,
7528,
53,
8876,
18,
8507,
1435,
365,
18,
3299,
53,
8876,
18,
8507,
1435,
365,
18,
659... |
for (frac,size) in skyreses: htmlfile.write('<tr><td>%f</td>%f</td></tr>'%(frac,size)) | for (frac,skysize) in skyreses: htmlfile.write('<tr><td>%f</td>%f</td></tr>'%(frac,skysize)) | def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/yax.ptp() | 647ad923ab86edfe537f5abc2b4402de62356695 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/647ad923ab86edfe537f5abc2b4402de62356695/OddsPostProc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
22,
40,
8111,
12,
92,
3404,
16,
93,
3404,
16,
50,
92,
16,
50,
93,
4672,
619,
651,
33,
80,
15738,
12,
1154,
12,
92,
3404,
3631,
1896,
12,
92,
3404,
3631,
50,
92,
13,
677,
65... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
22,
40,
8111,
12,
92,
3404,
16,
93,
3404,
16,
50,
92,
16,
50,
93,
4672,
619,
651,
33,
80,
15738,
12,
1154,
12,
92,
3404,
3631,
1896,
12,
92,
3404,
3631,
50,
92,
13,
677,
65... |
if cfg_use_aleph_sysnos: alephsysnos = get_fieldvalues(recID, "970__a") if len(alephsysnos)>0: alephsysno = alephsysnos[0] out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?sysno=%s">Detailed record</a></span>""" \ % (weburl, alephsysno) | if format != "hp": if cfg_use_aleph_sysnos: alephsysnos = get_fieldvalues(recID, "970__a") if len(alephsysnos)>0: alephsysno = alephsysnos[0] out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?sysno=%s">Detailed record</a></span>""" \ % (weburl, alephsysno) else: out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?recid=%s">Detailed record</a></span>""" \ % (weburl, recID) | def print_record(recID, format='hb', ot='', decompress=zlib.decompress): "Prints record 'recID' formatted accoding to 'format'." out = "" # sanity check: if not record_exists(recID): return out # print record opening tags, if needed: if format == "marcxml" or format == "oai_dc": out += " <record>\n" out += " <header>\n" for id in get_fieldvalues(recID,oaiidfield): out += " <identifier>%s</identifier>\n" % id out += " <datestamp>%s</datestamp>\n" % get_modification_date(recID) out += " </header>\n" out += " <metadata>\n" if format.startswith("xm") or format == "marcxml": # look for detailed format existence: query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query, None, 1) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format' -- they are not in "bibfmt" table; so fetch all the data from "bibXXx" tables: if format == "marcxml": out += """ <record xmlns="http://www.loc.gov/MARC21/slim">\n""" out += " <controlfield tag=\"001\">%d</controlfield>\n" % int(recID) elif format.startswith("xm"): out += """ <record>\n""" out += " <controlfield tag=\"001\">%d</controlfield>\n" % int(recID) for digit1 in range(0,10): for digit2 in range(0,10): bx = "bib%d%dx" % (digit1, digit2) bibx = "bibrec_bib%d%dx" % (digit1, digit2) query = "SELECT b.tag,b.value,bb.field_number FROM %s AS b, %s AS bb "\ "WHERE bb.id_bibrec='%s' AND b.id=bb.id_bibxxx AND b.tag LIKE '%s%%' "\ "ORDER BY bb.field_number, b.tag ASC" % (bx, bibx, recID, str(digit1)+str(digit2)) res = run_sql(query) field_number_old = -999 field_old = "" for row in res: field, value, field_number = row[0], row[1], row[2] ind1, ind2 = field[3], field[4] if ind1 == "_": ind1 = "" if ind2 == "_": ind2 = "" # print field tag if field_number != field_number_old or field[:-1] != field_old[:-1]: if format.startswith("xm") or format == "marcxml": fieldid = encode_for_xml(field[0:3]) if field_number_old != -999: out += """ </datafield>\n""" out += """ <datafield tag="%s" ind1="%s" ind2="%s">\n""" % (encode_for_xml(field[0:3]), encode_for_xml(ind1), encode_for_xml(ind2)) field_number_old = field_number field_old = field # print subfield value if format.startswith("xm") or format == "marcxml": value = encode_for_xml(value) out += """ <subfield code="%s">%s</subfield>\n""" % (encode_for_xml(field[-1:]), value) # all fields/subfields printed in this run, so close the tag: if (format.startswith("xm") or format == "marcxml") and field_number_old != -999: out += """ </datafield>\n""" # we are at the end of printing the record: if format.startswith("xm") or format == "marcxml": out += " </record>\n" elif format == "xd" or format == "oai_dc": # XML Dublin Core format, possibly OAI -- select only some bibXXx fields: out += """ <dc xmlns="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://purl.org/dc/elements/1.1/ http://www.openarchives.org/OAI/1.1/dc.xsd">\n""" for f in get_fieldvalues(recID, "041__a"): out += " <language>%s</language>\n" % f for f in get_fieldvalues(recID, "100__a"): out += " <creator>%s</creator>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "700__a"): out += " <creator>%s</creator>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "245__a"): out += " <title>%s</title>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "65017a"): out += " <subject>%s</subject>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "8564_u"): out += " <identifier>%s</identifier>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "520__a"): out += " <description>%s</description>\n" % encode_for_xml(f) out += " <date>%s</date>\n" % get_creation_date(recID) out += " </dc>\n" elif str(format[0:3]).isdigit(): # user has asked to print some fields only if format == "001": out += "<!--%s-begin-->%s<!--%s-end-->\n" % (format, recID, format) else: vals = get_fieldvalues(recID, format) for val in vals: out += "<!--%s-begin-->%s<!--%s-end-->\n" % (format, val, format) elif format.startswith('t'): ## user directly asked for some tags to be displayed only out += get_fieldvalues_alephseq_like(recID, ot) elif format == "hm": out += "<pre>" + cgi.escape(get_fieldvalues_alephseq_like(recID, ot)) + "</pre>" elif format.startswith("h") and ot: ## user directly asked for some tags to be displayed only out += "<pre>" + get_fieldvalues_alephseq_like(recID, ot) + "</pre>" elif format == "hd": # HTML detailed format # look for detailed format existence: query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query, None, 1) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format', so either call BibFormat on the fly or use default format # second, see if we are calling BibFormat on the fly: if cfg_call_bibformat: out += call_bibformat(recID) else: # okay, need to construct a simple "Detailed record" format of our own: out += "<p> " # secondly, title: titles = get_fieldvalues(recID, "245__a") for title in titles: out += "<p><p><center><big><strong>%s</strong></big></center>" % title # thirdly, authors: authors = get_fieldvalues(recID, "100__a") + get_fieldvalues(recID, "700__a") if authors: out += "<p><p><center>" for author in authors: out += """<a href="%s/search.py?p=%s&f=author">%s</a> ;""" % (weburl, urllib.quote(author), author) out += "</center>" # fourthly, date of creation: dates = get_fieldvalues(recID, "260__c") for date in dates: out += "<p><center><small>%s</small></center>" % date # fifthly, abstract: abstracts = get_fieldvalues(recID, "520__a") for abstract in abstracts: out += """<p style="margin-left: 15%%; width: 70%%"> <small><strong>Abstract:</strong> %s</small></p>""" % abstract # fifthly bis, keywords: keywords = get_fieldvalues(recID, "6531_a") if len(keywords): out += """<p style="margin-left: 15%; width: 70%"> <small><strong>Keyword(s):</strong></small>""" for keyword in keywords: out += """<small><a href="%s/search.py?p=%s&f=keyword">%s</a> ;</small> """ % (weburl, urllib.quote(keyword), keyword) # fifthly bis bis, published in: prs_p = get_fieldvalues(recID, "909C4p") prs_v = get_fieldvalues(recID, "909C4v") prs_y = get_fieldvalues(recID, "909C4y") prs_n = get_fieldvalues(recID, "909C4n") prs_c = get_fieldvalues(recID, "909C4c") for idx in range(0,len(prs_p)): out += """<p style="margin-left: 15%%; width: 70%%"> <small><strong>Publ. in:</strong> %s""" % prs_p[idx] if prs_v and prs_v[idx]: out += """<strong>%s</strong>""" % prs_v[idx] if prs_y and prs_y[idx]: out += """(%s)""" % prs_y[idx] if prs_n and prs_n[idx]: out += """, no.%s""" % prs_n[idx] if prs_c and prs_c[idx]: out += """, p.%s""" % prs_c[idx] out += """.</small>""" # sixthly, fulltext link: urls_z = get_fieldvalues(recID, "8564_z") urls_u = get_fieldvalues(recID, "8564_u") for idx in range(0,len(urls_u)): link_text = "URL" if urls_z[idx]: link_text = urls_z[idx] out += """<p style="margin-left: 15%%; width: 70%%"> <small><strong>%s:</strong> <a href="%s">%s</a></small>""" % (link_text, urls_u[idx], urls_u[idx]) # print some white space at the end: out += "<p><p>" elif format == "hb-fly": # HTML brief called on the fly; suitable for testing brief formats out += call_bibformat(recID, "BRIEF_HTML") out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?recid=%s">Detailed record</a></span>""" \ % (weburl, recID) elif format == "hd-ejournalsite": # HTML brief called on the fly; suitable for testing brief formats out += call_bibformat(recID, "EJOURNALSITE") out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?recid=%s">Detailed record</a></span>""" \ % (weburl, recID) else: # HTML brief format by default query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' does not exist in format 'format', so print some default format: # firstly, title: titles = get_fieldvalues(recID, "245__a") for title in titles: out += "<strong>%s</strong> " % title # secondly, authors: authors = get_fieldvalues(recID, "100__a") + get_fieldvalues(recID, "700__a") if authors: out += " / " for i in range (0,cfg_author_et_al_threshold): if i < len(authors): out += """<a href="%s/search.py?p=%s&f=author">%s</a> ;""" % (weburl, urllib.quote(authors[i]), authors[i]) if len(authors) > cfg_author_et_al_threshold: out += " <em>et al.</em>" # thirdly, date of creation: dates = get_fieldvalues(recID, "260__c") for date in dates: out += " %s." % date # thirdly bis, report numbers: rns = get_fieldvalues(recID, "037__a") for rn in rns: out += """ <small class="quicknote">[%s]</small>""" % rn rns = get_fieldvalues(recID, "088__a") for rn in rns: out += """ <small class="quicknote">[%s]</small>""" % rn # fourthly, beginning of abstract: abstracts = get_fieldvalues(recID, "520__a") for abstract in abstracts: out += "<br><small>%s [...]</small>" % abstract[:1+string.find(abstract, '.')] # fifthly, fulltext link: urls_z = get_fieldvalues(recID, "8564_z") urls_u = get_fieldvalues(recID, "8564_u") for idx in range(0,len(urls_u)): out += """<br><small class="note"><a class="note" href="%s">%s</a></small>""" % (urls_u[idx], urls_u[idx]) # at the end of HTML mode, print the "Detailed record" functionality: if cfg_use_aleph_sysnos: alephsysnos = get_fieldvalues(recID, "970__a") if len(alephsysnos)>0: alephsysno = alephsysnos[0] out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?sysno=%s">Detailed record</a></span>""" \ % (weburl, alephsysno) else: out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?recid=%s">Detailed record</a></span>""" \ % (weburl, recID) else: out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?recid=%s">Detailed record</a></span>""" \ % (weburl, recID) # ...and the "Mark record" functionality: #out += """<span class="moreinfo"> - <input name="recid" type="checkbox" value="%s"> Mark record</span>""" % recID # print record closing tags, if needed: if format == "marcxml" or format == "oai_dc": out += " </metadata>\n" out += " </record>\n" return out | 93df52a8b4e21b7c4c82b6e802d81b3cb8ed9f3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/93df52a8b4e21b7c4c82b6e802d81b3cb8ed9f3d/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
3366,
12,
3927,
734,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
16824,
33,
94,
2941,
18,
323,
14706,
4672,
315,
15402,
1409,
296,
3927,
734,
11,
4955,
4078,
4751,
358,
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,
1172,
67,
3366,
12,
3927,
734,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
16824,
33,
94,
2941,
18,
323,
14706,
4672,
315,
15402,
1409,
296,
3927,
734,
11,
4955,
4078,
4751,
358,
2... |
if context.get('read', False) != 'custom': for rs in result: if rs.get('model',False) == 'board.board': cr.execute("select id,arch,ref_id from ir_ui_view_custom where user_id=%d and ref_id=%d", (uid, rs['id'])) oview = cr.dictfetchall() if oview: rs['arch'] = oview[0]['arch'] | for rs in result: if rs.get('model',False) == 'board.board': cr.execute("select id,arch,ref_id from ir_ui_view_custom where user_id=%d and ref_id=%d", (uid, rs['id'])) oview = cr.dictfetchall() if oview: rs['arch'] = oview[0]['arch'] | def read(self,cr, uid, ids, fields=None, context={}, load='_classic_read'): | 62fcc008c459d7a23b8d43af7414982207b61721 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/62fcc008c459d7a23b8d43af7414982207b61721/ir_ui_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
3353,
16,
4555,
16,
3258,
16,
1466,
33,
7036,
16,
819,
28793,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
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,
855,
12,
2890,
16,
3353,
16,
4555,
16,
3258,
16,
1466,
33,
7036,
16,
819,
28793,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if vals and addpagename: | if addpagename: result += f.listitem(1, **entryfmt) | def construct_table(macro, pagelist, metakeys, legend='', checkAccess=True, styles=dict(), addpagename=False): request = macro.request request.page.formatter = request.formatter _ = request.getText row = 0 entryfmt = {'class': 'metamatrix_entry'} # Start table request.write(macro.formatter.linebreak() + u'<div class="metamatrix">' + macro.formatter.table(1)) # Give a class to headers to make it customisable request.write(macro.formatter.table_row(1, {'rowclass': 'meta_head'})) # Upper left cell is empty or has the desired legend t_cell(macro, [legend]) x_key, y_key = metakeys[:2] x_values, y_values = set(), set() page_vals = dict() for page in pagelist: page_vals[page] = get_metas(request, page, metakeys, checkAccess=False) x_values.update(page_vals[page].get(x_key, set())) y_values.update(page_vals[page].get(y_key, set())) metakeys = metakeys[2:] # Make header row for oval, value in sorted((ordervalue(y), y) for y in y_values): style = styles.get(y_key, dict()) # Styles can modify key naming name = style.get('gwikiname', '').strip('"') # We don't want stuff like bullet lists in out header headerstyle = dict() for st in style: if not st.startswith('gwiki'): headerstyle[st] = style[st] if name: t_cell(macro, [name], style=headerstyle) else: t_cell(macro, [value], style=headerstyle) request.write(macro.formatter.table_row(0)) tmp_page = request.page f = macro.formatter # Table for oval, x_value in sorted((ordervalue(x), x) for x in x_values): row = row + 1 if row % 2: request.write(f.table_row(1, {'rowclass': 'metamatrix-odd-row'})) else: request.write(f.table_row(1, {'rowclass': 'metamatrix-even-row'})) t_cell(macro, [x_value]) for oval, y_value in sorted((ordervalue(y), y) for y in y_values): style = styles.get(y_value, dict()) if not style.has_key('class'): style['class'] = 'meta_cell' macro.request.write(f.table_cell(1, attrs=style)) for page in pagelist: pageobj = Page(request, page) if (x_value in page_vals[page].get(x_key, set()) and y_value in page_vals[page].get(y_key, set())): result = '' args = {'class': 'metamatrix_link'} # Were there vals? vals = None for key in metakeys: for val in page_vals[page].get(key, list()): # Strip ugly brackets from bracketed links val = val.lstrip('[').strip(']') result += f.listitem(1, **entryfmt) result += pageobj.link_to(request, text=val, **args) result += f.listitem(0) vals = val if vals and addpagename: result += pageobj.link_to(request, **args) macro.request.write(result) request.write(macro.formatter.table_row(0)) request.page = tmp_page request.formatter.page = tmp_page request.write(macro.formatter.table(0)) request.write(u'</div>') | 8601b0e32e433e8ec10103b13ce3e7c4f8a44bb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/888/8601b0e32e433e8ec10103b13ce3e7c4f8a44bb1/MetaMatrix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4872,
67,
2121,
12,
26448,
16,
4262,
5449,
16,
5100,
581,
402,
87,
16,
7241,
2218,
2187,
28484,
33,
5510,
16,
5687,
33,
1576,
9334,
527,
9095,
1069,
33,
8381,
4672,
590,
273,
11522,
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,
4872,
67,
2121,
12,
26448,
16,
4262,
5449,
16,
5100,
581,
402,
87,
16,
7241,
2218,
2187,
28484,
33,
5510,
16,
5687,
33,
1576,
9334,
527,
9095,
1069,
33,
8381,
4672,
590,
273,
11522,
18... |
key4 = win32api.RegOpenKey(key3, "%s\win32" % (lcid,)) | key4 = win32api.RegOpenKey(key3, "%s\\win32" % (lcid,)) | def EnumTlbs(excludeFlags = 0): """Return a list of TypelibSpec objects, one for each registered library. """ key = win32api.RegOpenKey(win32con.HKEY_CLASSES_ROOT, "Typelib") iids = EnumKeys(key) results = [] for iid, crap in iids: try: key2 = win32api.RegOpenKey(key, str(iid)) except win32api.error: # A few good reasons for this, including "access denied". continue for version, tlbdesc in EnumKeys(key2): major_minor = string.split(version, '.', 1) if len(major_minor) < 2: major_minor.append('0') try: # For some reason, this code used to assume the values were hex. # This seems to not be true - particularly for CDO 1.21 # *sigh* - it appears there are no rules here at all, so when we need # to know the info, we must load the tlb by filename and request it. # The Resolve() method on the TypelibSpec does this. major = int(major_minor[0]) minor = int(major_minor[1]) except ValueError: # crap in the registry! continue key3 = win32api.RegOpenKey(key2, str(version)) try: # The "FLAGS" are at this point flags = int(win32api.RegQueryValue(key3, "FLAGS")) except (win32api.error, ValueError): flags = 0 if flags & excludeFlags==0: for lcid, crap in EnumKeys(key3): try: lcid = int(lcid) except ValueError: # not an LCID entry continue # Only care about "{lcid}\win32" key - jump straight there. try: key4 = win32api.RegOpenKey(key3, "%s\win32" % (lcid,)) except win32api.error: continue try: dll, typ = win32api.RegQueryValueEx(key4, None) if typ==win32con.REG_EXPAND_SZ: dll = win32api.ExpandEnvironmentStrings(dll) except win32api.error: dll = None spec = TypelibSpec(iid, lcid, major, minor, flags) spec.dll = dll spec.desc = tlbdesc spec.ver_desc = tlbdesc + " (" + version + ")" results.append(spec) return results | 152575316b8415344b8ed98366889964e2799af1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/152575316b8415344b8ed98366889964e2799af1/selecttlb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6057,
56,
80,
2038,
12,
10157,
5094,
273,
374,
4672,
3536,
990,
279,
666,
434,
16973,
30575,
1990,
2184,
16,
1245,
364,
1517,
4104,
5313,
18,
3536,
498,
273,
5657,
1578,
2425,
18,
1617,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6057,
56,
80,
2038,
12,
10157,
5094,
273,
374,
4672,
3536,
990,
279,
666,
434,
16973,
30575,
1990,
2184,
16,
1245,
364,
1517,
4104,
5313,
18,
3536,
498,
273,
5657,
1578,
2425,
18,
1617,
... |
self.outputs = [("Images as Numpy Array", numpy.array), ("Images in PIL format", list)] | self.outputs = [("Images PIL", list)] | def __init__(self, parent=None, signalManager = None): OWImageSubFile.__init__(self, parent, signalManager, "Image Dataset") OWImageDataset.__init__(self) | acc69052736fce0593fbae92083234ff2ceca235 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2658/acc69052736fce0593fbae92083234ff2ceca235/OWImageLoader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
2040,
1676,
812,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
315,
2040,
10778,
7923,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
982,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
2040,
1676,
812,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
315,
2040,
10778,
7923,
1... |
del self.honeypot.commands['/bin/cat'] | def call(self): del self.honeypot.commands['/bin/cat'] for f in self.args: path = self.fs.resolve_path(f, self.honeypot.cwd) try: dir = self.fs.get_path('/'.join(path.split('/')[:-1])) except IndexError: dir = None if not dir or f not in [x[A_NAME] for x in dir]: self.writeln( 'rmdir: failed to remove `%s\': ' % f + \ 'No such file or directory') continue for i in dir[:]: if i[A_NAME] == f: dir.remove(i) | 078904c7a8cd33ae8f18690ba824e17cfe326fb5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7245/078904c7a8cd33ae8f18690ba824e17cfe326fb5/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
12,
2890,
4672,
364,
284,
316,
365,
18,
1968,
30,
589,
273,
365,
18,
2556,
18,
10828,
67,
803,
12,
74,
16,
365,
18,
76,
265,
402,
13130,
18,
11089,
13,
775,
30,
1577,
273,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
12,
2890,
4672,
364,
284,
316,
365,
18,
1968,
30,
589,
273,
365,
18,
2556,
18,
10828,
67,
803,
12,
74,
16,
365,
18,
76,
265,
402,
13130,
18,
11089,
13,
775,
30,
1577,
273,
365... | |
self.vboxlayout6.addWidget(self.update_asap_rbtn) self.hboxlayout3 = QtGui.QHBoxLayout() self.hboxlayout3.setMargin(0) self.hboxlayout3.setSpacing(0) self.hboxlayout3.setObjectName("hboxlayout3") | self.vboxlayout4.addWidget(self.update_asap_rbtn) self.hboxlayout4 = QtGui.QHBoxLayout() self.hboxlayout4.setMargin(0) self.hboxlayout4.setSpacing(0) self.hboxlayout4.setObjectName("hboxlayout4") | def setupUi(self, MinimizeEnergyPropDialog): MinimizeEnergyPropDialog.setObjectName("MinimizeEnergyPropDialog") MinimizeEnergyPropDialog.resize(QtCore.QSize(QtCore.QRect(0,0,400,842).size()).expandedTo(MinimizeEnergyPropDialog.minimumSizeHint())) | 4cf7d69a606c10cf896a0045c5df06ba517408f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/4cf7d69a606c10cf896a0045c5df06ba517408f0/MinimizeEnergyPropDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
5444,
10153,
664,
31920,
4658,
6353,
4672,
5444,
10153,
664,
31920,
4658,
6353,
18,
542,
16707,
2932,
2930,
10153,
664,
31920,
4658,
6353,
7923,
5444,
10153,
664,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
5444,
10153,
664,
31920,
4658,
6353,
4672,
5444,
10153,
664,
31920,
4658,
6353,
18,
542,
16707,
2932,
2930,
10153,
664,
31920,
4658,
6353,
7923,
5444,
10153,
664,
... |
docv = [int(part) for part in docutils.__version__.split('.')] reqv = [int(part) for part in REQUIRES['docutils'].split('.')] if docutils.__version__ < REQUIRES['docutils']: | installed = [int(part) for part in docutils.__version__.split('.')] required = [int(part) for part in REQUIRES['docutils'].split('.')] if installed < required: | def check_requirements(): # Check Python: try: from email.Utils import parseaddr except ImportError: PEP_TYPE_DISPATCH['text/plain'] = None PEP_TYPE_MESSAGES['text/plain'] = ( 'Python %s or better required for "%%(pep_type)s" PEP ' 'processing; %s present (%%(inpath)s).' % (REQUIRES['python'], sys.version.split()[0])) # Check Docutils: try: import docutils except ImportError: PEP_TYPE_DISPATCH['text/x-rst'] = None PEP_TYPE_MESSAGES['text/x-rst'] = ( 'Docutils not present for "%(pep_type)s" PEP file %(inpath)s. ' 'See README.txt for installation.') else: docv = [int(part) for part in docutils.__version__.split('.')] reqv = [int(part) for part in REQUIRES['docutils'].split('.')] if docutils.__version__ < REQUIRES['docutils']: PEP_TYPE_DISPATCH['text/x-rst'] = None PEP_TYPE_MESSAGES['text/x-rst'] = ( 'Docutils must be reinstalled for "%%(pep_type)s" PEP ' 'processing (%%(inpath)s). Version %s or better required; ' '%s present. See README.txt for installation.' % (REQUIRES['docutils'], docutils.__version__)) | 0b11d4e0b27529f41a6ac678214ed89d9bd5743c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/0b11d4e0b27529f41a6ac678214ed89d9bd5743c/pep2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
16175,
13332,
468,
2073,
6600,
30,
775,
30,
628,
2699,
18,
1989,
1930,
1109,
4793,
1335,
11308,
30,
453,
10541,
67,
2399,
67,
2565,
3118,
5858,
3292,
955,
19,
7446,
3546,
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,
866,
67,
16175,
13332,
468,
2073,
6600,
30,
775,
30,
628,
2699,
18,
1989,
1930,
1109,
4793,
1335,
11308,
30,
453,
10541,
67,
2399,
67,
2565,
3118,
5858,
3292,
955,
19,
7446,
3546,
273,
... |
t1 + O(t1^4) + (1 + O(t1^4))*t2 + (-4*t1^3 + O(t1^4))*t2^2 + (-4*t1^2 + O(t1^4))*t2^3 + O(t2^4) | t1 + O(t1^4) + (1 + O(t1^4))*t2 + (2*t1^3 + O(t1^4))*t2^2 + (2*t1^2 + O(t1^4))*t2^3 + O(t2^4) Test for trac ticket 9646:: sage: P.<a1, a2, a3, a4, a6> = PolynomialRing(ZZ, 5) sage: E = EllipticCurve(list(P.gens())) sage: F = E.formal().group_law(prec = 4) sage: t2 = F.parent().gen() sage: t1 = F.parent().base_ring().gen() sage: F(t1, 0) t1 sage: F(0, t2) t2 sage: F[2][1] -a2 | def group_law(self, prec=10): r""" The formal group law. INPUT: - ``prec`` - integer (default 10) OUTPUT: a power series with given precision in ZZ[[ ZZ[['t1']],'t2']] DETAILS: Return the formal power series .. math:: F(t_1, t_2) = t_1 + t_2 - a_1 t_1 t_2 - \cdots to precision `O(t^{prec})` of page 115 of [Silverman AEC1]. The result is cached, and a cached version is returned if possible. .. warning:: | 2f86129d4d7b385ac3ae43330ca26f41453d9ab6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2f86129d4d7b385ac3ae43330ca26f41453d9ab6/formal_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1041,
67,
80,
2219,
12,
2890,
16,
13382,
33,
2163,
4672,
436,
8395,
1021,
25739,
1041,
328,
2219,
18,
225,
12943,
30,
282,
300,
225,
12176,
4036,
10335,
300,
3571,
261,
1886,
1728,
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,
1041,
67,
80,
2219,
12,
2890,
16,
13382,
33,
2163,
4672,
436,
8395,
1021,
25739,
1041,
328,
2219,
18,
225,
12943,
30,
282,
300,
225,
12176,
4036,
10335,
300,
3571,
261,
1886,
1728,
13,
... |
andi t3, t3, 32 or reg, reg, t3 | andi t4, t3, 32, flags=(EZF,) or reg, reg, t4 mov t1, t1, t3, flags=(nCEZF,) | def macroop BSF_R_M { mov t1, t1, t0, dataSize=8 ld t1, seg, sib, disp # Determine if the input was zero, and also move it to a temp reg. and t1, t1, t1, flags=(ZF,) bri t0, label("end"), flags=(CZF,) # Zero out the result register mov reg, reg, t0 subi t2, t1, 1 xor t1, t2, t1 # Bit 6 srli t3, t1, 32, dataSize=8 andi t3, t3, 32 or reg, reg, t3 # Bit 5 srli t3, t1, 16, dataSize=8 andi t3, t3, 16 or reg, reg, t3 # Bit 4 srli t3, t1, 8, dataSize=8 andi t3, t3, 8 or reg, reg, t3 # Bit 3 srli t3, t1, 4, dataSize=8 andi t3, t3, 4 or reg, reg, t3 # Bit 2 srli t3, t1, 2, dataSize=8 andi t3, t3, 2 or reg, reg, t3 # Bit 1 srli t3, t1, 1, dataSize=8 andi t3, t3, 1 or reg, reg, t3 | 8e2991b529fd63f4d7c56518ebfbd2424f964172 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6787/8e2991b529fd63f4d7c56518ebfbd2424f964172/bit_scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
605,
22395,
67,
54,
67,
49,
288,
225,
5730,
268,
21,
16,
268,
21,
16,
268,
20,
16,
30216,
33,
28,
16916,
268,
21,
16,
2291,
16,
12092,
16,
16232,
225,
468,
10229,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
605,
22395,
67,
54,
67,
49,
288,
225,
5730,
268,
21,
16,
268,
21,
16,
268,
20,
16,
30216,
33,
28,
16916,
268,
21,
16,
2291,
16,
12092,
16,
16232,
225,
468,
10229,
309,
... |
def main(): | def main(n, maxTime=1.0e20): global N, RADIUS, MAXTIME N = n RADIUS = 15 / n**.5 MAXTIME = maxTime | def main(): app = QApplication(sys.argv) cr = Jello() cr.app = app app.setMainWidget(cr) cr.show() cr.update() app.exec_loop() | a345b3a7256c53c6d1e33b9e6f4af9771ffc75e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/a345b3a7256c53c6d1e33b9e6f4af9771ffc75e7/jello.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
82,
16,
25328,
33,
21,
18,
20,
73,
3462,
4672,
2552,
423,
16,
534,
23575,
16,
4552,
4684,
423,
273,
290,
534,
23575,
273,
4711,
342,
290,
636,
18,
25,
4552,
4684,
273,
2532... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
82,
16,
25328,
33,
21,
18,
20,
73,
3462,
4672,
2552,
423,
16,
534,
23575,
16,
4552,
4684,
423,
273,
290,
534,
23575,
273,
4711,
342,
290,
636,
18,
25,
4552,
4684,
273,
2532... |
self.connected = False make_timer(secs, self.set_readable) def set_readable (self): self.connected = True | oldstate, self.state = self.state, 'client' make_timer(secs, lambda: self.set_readable(oldstate)) def set_readable (self, state): self.state = state | def set_unreadable (self, secs): self.connected = False make_timer(secs, self.set_readable) | a9c024aeb6ca3f50e5f1bc772b7942c7d2b134e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/a9c024aeb6ca3f50e5f1bc772b7942c7d2b134e6/HttpServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
318,
11018,
261,
2890,
16,
18043,
4672,
365,
18,
8537,
273,
1083,
1221,
67,
12542,
12,
21317,
16,
365,
18,
542,
67,
11018,
13,
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,
444,
67,
318,
11018,
261,
2890,
16,
18043,
4672,
365,
18,
8537,
273,
1083,
1221,
67,
12542,
12,
21317,
16,
365,
18,
542,
67,
11018,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def test_compresscopy(self): data0 = HAMLET_SCENE data1 = HAMLET_SCENE.swapcase() c0 = zlib.compressobj(zlib.Z_BEST_COMPRESSION) bufs0 = [] bufs0.append(c0.compress(data0)) c1 = c0.copy() bufs1 = bufs0[:] bufs0.append(c0.compress(data0)) bufs0.append(c0.flush()) s0 = ''.join(bufs0) bufs1.append(c1.compress(data1)) bufs1.append(c1.flush()) s1 = ''.join(bufs1) self.assertEqual(zlib.decompress(s0),data0+data0) self.assertEqual(zlib.decompress(s1),data0+data1) def test_badcompresscopy(self): c = zlib.compressobj() c.compress(HAMLET_SCENE) c.flush() self.assertRaises(ValueError, c.copy) def test_decompresscopy(self): data = HAMLET_SCENE comp = zlib.compress(data) d0 = zlib.decompressobj() bufs0 = [] bufs0.append(d0.decompress(comp[:32])) d1 = d0.copy() bufs1 = bufs0[:] bufs0.append(d0.decompress(comp[32:])) s0 = ''.join(bufs0) bufs1.append(d1.decompress(comp[32:])) s1 = ''.join(bufs1) self.assertEqual(s0,s1) self.assertEqual(s0,data) def test_baddecompresscopy(self): data = zlib.compress(HAMLET_SCENE) d = zlib.decompressobj() d.decompress(data) d.flush() self.assertRaises(ValueError, d.copy) | if hasattr(zlib.compressobj(), "copy"): def test_compresscopy(self): data0 = HAMLET_SCENE data1 = HAMLET_SCENE.swapcase() c0 = zlib.compressobj(zlib.Z_BEST_COMPRESSION) bufs0 = [] bufs0.append(c0.compress(data0)) c1 = c0.copy() bufs1 = bufs0[:] bufs0.append(c0.compress(data0)) bufs0.append(c0.flush()) s0 = ''.join(bufs0) bufs1.append(c1.compress(data1)) bufs1.append(c1.flush()) s1 = ''.join(bufs1) self.assertEqual(zlib.decompress(s0),data0+data0) self.assertEqual(zlib.decompress(s1),data0+data1) def test_badcompresscopy(self): c = zlib.compressobj() c.compress(HAMLET_SCENE) c.flush() self.assertRaises(ValueError, c.copy) if hasattr(zlib.decompressobj(), "copy"): def test_decompresscopy(self): data = HAMLET_SCENE comp = zlib.compress(data) d0 = zlib.decompressobj() bufs0 = [] bufs0.append(d0.decompress(comp[:32])) d1 = d0.copy() bufs1 = bufs0[:] bufs0.append(d0.decompress(comp[32:])) s0 = ''.join(bufs0) bufs1.append(d1.decompress(comp[32:])) s1 = ''.join(bufs1) self.assertEqual(s0,s1) self.assertEqual(s0,data) def test_baddecompresscopy(self): data = zlib.compress(HAMLET_SCENE) d = zlib.decompressobj() d.decompress(data) d.flush() self.assertRaises(ValueError, d.copy) | def test_compresscopy(self): # Test copying a compression object data0 = HAMLET_SCENE data1 = HAMLET_SCENE.swapcase() c0 = zlib.compressobj(zlib.Z_BEST_COMPRESSION) bufs0 = [] bufs0.append(c0.compress(data0)) | 24e05969d4bffb9d228aa7da6318228a12e25f87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/24e05969d4bffb9d228aa7da6318228a12e25f87/test_zlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14706,
3530,
12,
2890,
4672,
468,
7766,
8933,
279,
9154,
733,
501,
20,
273,
670,
2192,
15146,
67,
2312,
1157,
41,
501,
21,
273,
670,
2192,
15146,
67,
2312,
1157,
41,
18,
2227... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14706,
3530,
12,
2890,
4672,
468,
7766,
8933,
279,
9154,
733,
501,
20,
273,
670,
2192,
15146,
67,
2312,
1157,
41,
501,
21,
273,
670,
2192,
15146,
67,
2312,
1157,
41,
18,
2227... |
''' return the current index args as form elements ''' | """ return the current index args as form elements """ | def indexargs_form(self, columns=1, sort=1, group=1, filter=1, filterspec=1, search_text=1): ''' return the current index args as form elements ''' l = [] sc = self.special_char def add(k, v): l.append(self.input(type="hidden", name=k, value=v)) if columns and self.columns: add(sc+'columns', ','.join(self.columns)) if sort: val = [] for dir, attr in self.sort: if dir == '-': val.append('-'+attr) else: val.append(attr) add(sc+'sort', ','.join (val)) if group: val = [] for dir, attr in self.group: if dir == '-': val.append('-'+attr) else: val.append(attr) add(sc+'group', ','.join (val)) if filter and self.filter: add(sc+'filter', ','.join(self.filter)) if self.classname and filterspec: props = self.client.db.getclass(self.classname).getprops() for k,v in self.filterspec.items(): if type(v) == type([]): if isinstance(props[k], hyperdb.String): add(k, ' '.join(v)) else: add(k, ','.join(v)) else: add(k, v) if search_text and self.search_text: add(sc+'search_text', self.search_text) add(sc+'pagesize', self.pagesize) add(sc+'startwith', self.startwith) return '\n'.join(l) | 16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
1968,
67,
687,
12,
2890,
16,
2168,
33,
21,
16,
1524,
33,
21,
16,
1041,
33,
21,
16,
1034,
33,
21,
16,
1034,
2793,
33,
21,
16,
1623,
67,
955,
33,
21,
4672,
3536,
327,
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,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
1968,
67,
687,
12,
2890,
16,
2168,
33,
21,
16,
1524,
33,
21,
16,
1041,
33,
21,
16,
1034,
33,
21,
16,
1034,
2793,
33,
21,
16,
1623,
67,
955,
33,
21,
4672,
3536,
327,
326,
783... |
storage.save(history_id=1, obj=DummyData(0)) | def test02_beforeSaveHookKeepsMaximumTwoVersions(self): purgepolicy = self.portal.portal_purgepolicy storage = self.portal.portal_historiesstorage purgepolicy.maxNumberOfVersionsToKeep = 2 storage.save(history_id=1, obj=DummyData(0)) res = purgepolicy.beforeSaveHook(history_id=1, obj=2, metadata={}) self.failUnless(res) self.assertEqual(len(storage.getHistory(history_id=1)), 1) storage.save(history_id=1, obj=DummyData(1)) res = purgepolicy.beforeSaveHook(history_id=1, obj=2, metadata={}) self.failUnless(res) self.assertEqual(len(storage.getHistory(history_id=1)), 2) # check if purged the first saved version storage.save(history_id=1, obj=DummyData(2)) res = purgepolicy.beforeSaveHook(history_id=1, obj=2, metadata={}) self.failUnless(res) history = storage.getHistory(history_id=1) self.assertEqual(len(history), 2) self.assertEqual(history[0].data, 1) self.assertEqual(history[1].data, 2) | 2c383a841c1a858fa80d59ec81fc58356f9c0859 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11952/2c383a841c1a858fa80d59ec81fc58356f9c0859/test_KeepLastNVersionsTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3103,
67,
5771,
4755,
5394,
11523,
87,
13528,
11710,
5940,
12,
2890,
4672,
5405,
75,
881,
1590,
273,
365,
18,
24386,
18,
24386,
67,
12688,
75,
881,
1590,
2502,
273,
365,
18,
24386,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3103,
67,
5771,
4755,
5394,
11523,
87,
13528,
11710,
5940,
12,
2890,
4672,
5405,
75,
881,
1590,
273,
365,
18,
24386,
18,
24386,
67,
12688,
75,
881,
1590,
2502,
273,
365,
18,
24386,... | |
'step_id' : pool.get('dm.offer.step').search(cr,uid,[('type_id.code','=','ASEVENT'),('name','=','After-Sale Event (email)')])[0], | 'step_id' : step_id, | def _create_event(self,cr,uid,data,context): pool = pooler.get_pool(cr.dbname) vals = { 'segment_id' : data['form']['segment_id'], 'step_id' : pool.get('dm.offer.step').search(cr,uid,[('type_id.code','=','ASEVENT'),('name','=','After-Sale Event (email)')])[0], 'address_id' : data['id'], 'trigger_type_id' : data['form']['action_id'], 'mail_service_id' : data['form']['mail_service_id'] } id = pool.get('dm.event').create(cr,uid,vals,context) return {} | a8c557212df18538914fa907bb3f69ae360b28e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/a8c557212df18538914fa907bb3f69ae360b28e4/address_after_sale_action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
2575,
12,
2890,
16,
3353,
16,
1911,
16,
892,
16,
2472,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
5773,
273,
288,
296,
9273,
67,
350,
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,
389,
2640,
67,
2575,
12,
2890,
16,
3353,
16,
1911,
16,
892,
16,
2472,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
5773,
273,
288,
296,
9273,
67,
350,
11,
... |
to_char(create_date,'YYYY:IW') | to_char(p.date_planned,'YYYY:IW') | def init(self, cr): cr.execute(""" create or replace view report_workcenter_load as ( SELECT min(wl.id) as id, to_char(create_date,'YYYY:IW') as name, SUM(wl.hour) AS hour, SUM(wl.cycle) AS cycle, wl.workcenter_id as workcenter_id FROM mrp_production_workcenter_line wl GROUP BY wl.workcenter_id, to_char(create_date,'YYYY:IW') )""") | ff35f7da17ad482799df40abf28cfe095b608a87 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/ff35f7da17ad482799df40abf28cfe095b608a87/report_mrp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
4422,
18,
8837,
2932,
3660,
752,
578,
1453,
1476,
2605,
67,
1252,
5693,
67,
945,
487,
261,
9111,
1131,
12,
21504,
18,
350,
13,
487,
612,
16,
358,
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,
1208,
12,
2890,
16,
4422,
4672,
4422,
18,
8837,
2932,
3660,
752,
578,
1453,
1476,
2605,
67,
1252,
5693,
67,
945,
487,
261,
9111,
1131,
12,
21504,
18,
350,
13,
487,
612,
16,
358,
67,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.