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.__GetNextToken( "{"): | if self.__IsToken( "{"): | def __GetSectionData(self, ffsFile): if self.__GetNextToken( "{"): while self.__GetLeafSection( ffsFile): pass while self.__GetEncapsulationSec( ffsFile): pass | a83bd801068d42d6c1460cf15ea4f6626d50d403 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/a83bd801068d42d6c1460cf15ea4f6626d50d403/FdfParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
967,
5285,
751,
12,
2890,
16,
284,
2556,
812,
4672,
225,
309,
365,
16186,
2520,
1345,
12,
18173,
4672,
1323,
365,
16186,
967,
9858,
5285,
12,
284,
2556,
812,
4672,
1342,
1323,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
967,
5285,
751,
12,
2890,
16,
284,
2556,
812,
4672,
225,
309,
365,
16186,
2520,
1345,
12,
18173,
4672,
1323,
365,
16186,
967,
9858,
5285,
12,
284,
2556,
812,
4672,
1342,
1323,
365,... |
print 'filename:', self.filename | def Load(self): try: print 'filename:', self.filename self.file=CDRXfile(self.filename) cmx = CCXFile(self, self.file) cmx.Load() self.document() prefix = '' num_pages = cmx.NumPages() for num in range(num_pages): data, start = cmx.PageData(num) if data: if num_pages > 1: prefix = 'Page %d: ' % num if cmx.coord_size == 2: interpreter = CMXInterpreter16(self, cmx, layer_prefix = prefix) else: interpreter = CMXInterpreter32(self, cmx, layer_prefix = prefix) interpreter.Run(data, start) self.end_all() self.object.load_Completed() return self.object except RiffEOF: raise SketchLoadError(_("Unexpected end of file")) except: import traceback traceback.print_exc() raise | 005d65a1317c0d7ddba798bcfb5132e409ea3148 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3123/005d65a1317c0d7ddba798bcfb5132e409ea3148/ccxloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
12,
2890,
4672,
775,
30,
365,
18,
768,
33,
39,
6331,
60,
768,
12,
2890,
18,
3459,
13,
5003,
92,
273,
16525,
60,
812,
12,
2890,
16,
365,
18,
768,
13,
5003,
92,
18,
2563,
1435,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
12,
2890,
4672,
775,
30,
365,
18,
768,
33,
39,
6331,
60,
768,
12,
2890,
18,
3459,
13,
5003,
92,
273,
16525,
60,
812,
12,
2890,
16,
365,
18,
768,
13,
5003,
92,
18,
2563,
1435,... | |
print self.__query_string__ print str(self.__param_tuple__) | """ __repr__ gets called when you type self and hit enter. It should return a string representing the object. Here, the current query string along with the parameter tuples are printed. """ s = "Query for sql database: " s += self.__database__ + "\n" s += "Query string: " s += self.__query_string__ + "\n" s += "Parameter tuple: " s += str(self.__param_tuple__) + "\n" return s | def __repr__(self): # stupid problem with this crap print self.__query_string__ print str(self.__param_tuple__) | f444548a79bfaff35a22bfb50aa45243715f4188 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/f444548a79bfaff35a22bfb50aa45243715f4188/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
468,
384,
416,
350,
6199,
598,
333,
276,
1266,
8395,
1001,
12715,
972,
5571,
2566,
1347,
1846,
618,
365,
471,
6800,
6103,
18,
2597,
1410,
327,
279,
533,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12715,
972,
12,
2890,
4672,
468,
384,
416,
350,
6199,
598,
333,
276,
1266,
8395,
1001,
12715,
972,
5571,
2566,
1347,
1846,
618,
365,
471,
6800,
6103,
18,
2597,
1410,
327,
279,
533,... |
feed = self.doclist.QueryDocumentListFeed(query) | feed = self.client.QueryDocumentListFeed(query) | def testExportSpreadsheet(self): query = ('http://docs.google.com/feeds/documents/private/full' '/-/spreadsheet?max-results=1') feed = self.doclist.QueryDocumentListFeed(query) file_paths = ['./downloadedTest.xls', './downloadedTest.csv', './downloadedTest.pdf', './downloadedTest.ods', './downloadedTest.tsv', './downloadedTest.html'] docs_token = self.doclist.GetClientLoginToken() self.doclist.SetClientLoginToken(self.spreadsheets.GetClientLoginToken()) for path in file_paths: self.doclist.DownloadSpreadsheet(feed.entry[0], path) self.assert_(os.path.exists(path)) self.assert_(os.path.getsize(path)) os.remove(path) self.doclist.SetClientLoginToken(docs_token) | dcc46816af19bac967f4b588353a3ee4514dd5d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6580/dcc46816af19bac967f4b588353a3ee4514dd5d2/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6144,
28719,
8118,
12,
2890,
4672,
843,
273,
7707,
2505,
2207,
8532,
18,
9536,
18,
832,
19,
7848,
87,
19,
24795,
19,
1152,
19,
2854,
11,
1173,
17,
19,
26007,
8118,
35,
1896,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6144,
28719,
8118,
12,
2890,
4672,
843,
273,
7707,
2505,
2207,
8532,
18,
9536,
18,
832,
19,
7848,
87,
19,
24795,
19,
1152,
19,
2854,
11,
1173,
17,
19,
26007,
8118,
35,
1896,
17,
... |
self.assert_(self.g1.test_overlap(self.g2) == False) self.assert_(self.g2.test_overlap(self.g1) == False) | self.assert_(self.g1.test_inside(self.g2) == False) self.assert_(self.g2.test_inside(self.g1) == False) | def runTest(self): # g1 and g2 are the same, so they exist inside each other. self.assert_(self.g1.test_inside(self.g2) == True) self.assert_(self.g2.test_inside(self.g1) == False) | 7ea094a5a9369af6702e865d752b1bac938f2e5d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5978/7ea094a5a9369af6702e865d752b1bac938f2e5d/test_geometry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4709,
12,
2890,
4672,
468,
314,
21,
471,
314,
22,
854,
326,
1967,
16,
1427,
2898,
1005,
4832,
1517,
1308,
18,
365,
18,
11231,
67,
12,
2890,
18,
75,
21,
18,
3813,
67,
28091,
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,
1086,
4709,
12,
2890,
4672,
468,
314,
21,
471,
314,
22,
854,
326,
1967,
16,
1427,
2898,
1005,
4832,
1517,
1308,
18,
365,
18,
11231,
67,
12,
2890,
18,
75,
21,
18,
3813,
67,
28091,
12,... |
if data[0][-1] == ',' or data[0] in _daynames: | if data[0][-1] in (',', '.') or string.lower(data[0]) in _daynames: | def parsedate_tz(data): """Convert a date string to a time tuple. Accounts for military timezones. """ data = string.split(data) if data[0][-1] == ',' or data[0] in _daynames: # There's a dayname here. Skip it del data[0] if len(data) == 3: # RFC 850 date, deprecated stuff = string.split(data[0], '-') if len(stuff) == 3: data = stuff + data[1:] if len(data) == 4: s = data[3] i = string.find(s, '+') if i > 0: data[3:] = [s[:i], s[i+1:]] else: data.append('') # Dummy tz if len(data) < 5: return None data = data[:5] [dd, mm, yy, tm, tz] = data if not mm in _monthnames: dd, mm, yy, tm, tz = mm, dd, tm, yy, tz if not mm in _monthnames: return None mm = _monthnames.index(mm)+1 tm = string.splitfields(tm, ':') if len(tm) == 2: [thh, tmm] = tm tss = '0' elif len(tm) == 3: [thh, tmm, tss] = tm else: return None try: yy = string.atoi(yy) dd = string.atoi(dd) thh = string.atoi(thh) tmm = string.atoi(tmm) tss = string.atoi(tss) except string.atoi_error: return None tzoffset=None tz=string.upper(tz) if _timezones.has_key(tz): tzoffset=_timezones[tz] else: try: tzoffset=string.atoi(tz) except string.atoi_error: pass # Convert a timezone offset into seconds ; -0500 -> -18000 if tzoffset: if tzoffset < 0: tzsign = -1 tzoffset = -tzoffset else: tzsign = 1 tzoffset = tzsign * ( (tzoffset/100)*3600 + (tzoffset % 100)*60) tuple = (yy, mm, dd, thh, tmm, tss, 0, 0, 0, tzoffset) return tuple | bc7a73da2036ee7693857fcf046c4a19feecfc9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc7a73da2036ee7693857fcf046c4a19feecfc9e/rfc822.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
712,
67,
12994,
12,
892,
4672,
3536,
2723,
279,
1509,
533,
358,
279,
813,
3193,
18,
225,
30849,
364,
312,
330,
305,
814,
25954,
18,
3536,
501,
273,
533,
18,
4939,
12,
892,
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,
1109,
712,
67,
12994,
12,
892,
4672,
3536,
2723,
279,
1509,
533,
358,
279,
813,
3193,
18,
225,
30849,
364,
312,
330,
305,
814,
25954,
18,
3536,
501,
273,
533,
18,
4939,
12,
892,
13,
... |
url = %(url)s | url = '%(url)s' | def after_install(options, home_dir): global logger reqs = %(reqs)s cmds = %(cmds)s url = %(url)s found = [c for c in cmds if url in c] if not found: cmds.extend(['-f',url]) etc = join(home_dir, 'etc') ## TODO: this should all come from distutils ## like distutils.sysconfig.get_python_inc() if sys.platform == 'win32': lib_dir = join(home_dir, 'Lib') bin_dir = join(home_dir, 'Scripts') elif is_jython: lib_dir = join(home_dir, 'Lib') bin_dir = join(home_dir, 'bin') else: lib_dir = join(home_dir, 'lib', py_version) bin_dir = join(home_dir, 'bin') if not os.path.exists(etc): os.makedirs(etc) reqnumpy = 'numpy' numpyidx = None for i,req in enumerate(reqs): if req.startswith('numpy') and len(req)>5 and (req[5]=='=' or req[5]=='>'): # for now, just require 'numpy' instead of a specific version #reqnumpy = req numpyidx = i break _single_install(cmds, reqnumpy, bin_dir) # force numpy first so we can use f2py later if numpyidx is not None: reqs.remove(reqs[numpyidx]) for req in reqs: _single_install(cmds, req, bin_dir) """ parser = OptionParser() parser.add_option("-d", "--destination", action="store", type="string", dest='dest', help="specify destination directory", default='.') parser.add_option("-t", "--test", action="store_true", dest="test", help="if present, generated installer will point to /OpenMDAO/test_server/dists") (options, args) = parser.parse_args() openmdao_pkgs = ['openmdao.util', 'openmdao.units', 'openmdao.main', 'openmdao.lib', 'openmdao.test', 'openmdao.examples.simple', 'openmdao.examples.bar3simulation', 'openmdao.examples.enginedesign', ] cmds = [] reqs = [] import openmdao.main.releaseinfo version = openmdao.main.releaseinfo.__version__ dists = working_set.resolve([Requirement.parse(r) for r in openmdao_pkgs]) excludes = set(['setuptools', 'distribute']) for dist in dists: if dist.project_name not in excludes: reqs.append('%s' % dist.as_requirement()) if options.test: url = 'file:///home/bnaylor/dists' else: url = 'http://openmdao.org/dists' reqs = list(set(reqs)) # eliminate duplicates (numpy was in there twice somehow) optdict = { 'reqs': reqs, 'cmds':cmds, 'version': version, 'url': url } dest = os.path.abspath(options.dest) scriptname = os.path.join(dest,'go-openmdao-%s.py' % version) with open(scriptname, 'wb') as f: f.write(virtualenv.create_bootstrap_script(script_str % optdict)) os.chmod(scriptname, 0755) | 928825c1849d2f10fb3730d9d72a85cac4dd44cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12610/928825c1849d2f10fb3730d9d72a85cac4dd44cf/mkinstaller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
67,
5425,
12,
2116,
16,
6382,
67,
1214,
4672,
2552,
1194,
20927,
273,
8975,
25782,
13,
87,
13446,
273,
8975,
24680,
13,
87,
880,
273,
21063,
718,
13,
87,
11,
1392,
273,
306,
71,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
67,
5425,
12,
2116,
16,
6382,
67,
1214,
4672,
2552,
1194,
20927,
273,
8975,
25782,
13,
87,
13446,
273,
8975,
24680,
13,
87,
880,
273,
21063,
718,
13,
87,
11,
1392,
273,
306,
71,
... |
>>> triple_quoted_incomplete("a(''''''") | >>> triple_quoted_incomplete("''''''") | def triple_quoted_incomplete(line): """ Test if line contains an incomplete triple-quoted string. >>> triple_quoted_incomplete("a('''") True >>> triple_quoted_incomplete("a(''''''") False >>> triple_quoted_incomplete("a('''''''''") True """ if line.count('"""') % 2: return True if line.count("'''") % 2: return True return False | 1fbee09b78dc37ee96b0d40e6484ea6d414896a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3111/1fbee09b78dc37ee96b0d40e6484ea6d414896a2/pep8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14543,
67,
15179,
67,
17624,
12,
1369,
4672,
3536,
7766,
309,
980,
1914,
392,
14715,
14543,
17,
15179,
533,
18,
225,
4080,
14543,
67,
15179,
67,
17624,
2932,
69,
2668,
11,
4970,
13,
1053... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14543,
67,
15179,
67,
17624,
12,
1369,
4672,
3536,
7766,
309,
980,
1914,
392,
14715,
14543,
17,
15179,
533,
18,
225,
4080,
14543,
67,
15179,
67,
17624,
2932,
69,
2668,
11,
4970,
13,
1053... |
"long_description": open('README').read(), | "long_description": long_description, | def main(): hachoir_wx = load_source("version", path.join("hachoir_wx", "version.py")) PACKAGES = {"hachoir_wx": "hachoir_wx"} for name in MODULES: PACKAGES["hachoir_wx." + name] = path.join("hachoir_wx", name) install_options = { "name": hachoir_wx.PACKAGE, "version": hachoir_wx.VERSION, "url": hachoir_wx.WEBSITE, "download_url": hachoir_wx.WEBSITE, "license": hachoir_wx.LICENSE, "author": "Cyril Zorin", "description": "hachoir-wx is a wxWidgets GUI that's meant to provide a (more) user-friendly interface to the hachoir binary parsing engine", "long_description": open('README').read(), "classifiers": CLASSIFIERS, "scripts": ["hachoir-wx"], "packages": PACKAGES.keys(), "package_dir": PACKAGES, "package_data": {"hachoir_wx.resource": ['hachoir_wx.xrc']}, } if use_setuptools: install_options["install_requires"] = ( "hachoir-core>=1.2", "hachoir-parser>=0.7.0", "wxPython>=2.6.3") install_options["zip_safe"] = True install_options["include_package_data"] = True setup(**install_options) | bf2973be0fc18bec8358e041327004c0062e9ce9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9327/bf2973be0fc18bec8358e041327004c0062e9ce9/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
366,
497,
83,
481,
67,
27226,
273,
1262,
67,
3168,
2932,
1589,
3113,
589,
18,
5701,
2932,
76,
497,
83,
481,
67,
27226,
3113,
315,
1589,
18,
2074,
6,
3719,
225,
23599,
55,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
366,
497,
83,
481,
67,
27226,
273,
1262,
67,
3168,
2932,
1589,
3113,
589,
18,
5701,
2932,
76,
497,
83,
481,
67,
27226,
3113,
315,
1589,
18,
2074,
6,
3719,
225,
23599,
55,
... |
tend = '' while t[-1] in ('*','&') : tend = tend + t[-1] t = t[:-1] t = string.translate(str(t), self.transtable)[2:] t += tend if ( string.translate(str(self.genTypeName(noPubTypeAttrs['id'])), self.transtable) not in self.generated_shadow_classes ): c += self.genClassShadow(noPubTypeAttrs) | cmem = self.genTypeName(noPubTypeAttrs['id'],const=True,colon=True) if cmem != cls and cmem not in inner_shadows : inner_shadows[cmem] = string.translate(str(cmem), self.transtable) c += self.genClassShadow(noPubTypeAttrs, inner + 1) ikeys = inner_shadows.keys() ikeys.sort(lambda x,y : len(y) - len(x)) for ikey in ikeys : if t.find(ikey) == 0 : t = t.replace(ikey, inner_shadows[ikey]) elif t.find(ikey[2:]) != -1 : t = t.replace(ikey[2:], inner_shadows[ikey]) | def genClassShadow(self, attrs, inner = 0 ) : bases = self.getBases( attrs['id'] ) if inner : cls = attrs['name'] else : cls = self.genTypeName(attrs['id']) clt = string.translate(str(cls), self.transtable) self.generated_shadow_classes.append(clt) typ = self.xref[attrs['id']]['elem'].lower() indent = inner * 2 * ' ' if typ == 'enumeration' : c = indent + 'enum %s {};\n' % clt else: if not bases : c = indent + '%s %s {\n%s public:\n' % (typ, clt, indent) else : c = indent + '%s %s : ' % (typ, clt) for b in bases : if b.get('virtual','') == '1' : acc = 'virtual ' + b['access'] else : acc = b['access'] c += indent + '%s %s' % ( acc , self.genTypeName(b['type'],colon=True) ) if b is not bases[-1] : c += ', ' c += indent + ' {\n' + indent +' public:\n' c += indent + ' %s();\n' % (clt) if self.isClassVirtual( attrs ) : c += indent + ' virtual ~%s() throw();\n' % ( clt ) members = attrs.get('members','') memList = members.split() for m in memList : member = self.xref[m] if member['elem'] in ('Class','Struct'): c += self.genClassShadow(member['attrs'], inner + 1) for m in memList : member = self.xref[m] if member['elem'] in ('Field',) : a = member['attrs'] t = self.genTypeName(a['type'],colon=True,const=True) noPublicType = self.checkAccessibleType(self.xref[a['type']]) if ( noPublicType ): noPubTypeAttrs = self.xref[noPublicType]['attrs'] tend = '' while t[-1] in ('*','&') : tend = tend + t[-1] t = t[:-1] t = string.translate(str(t), self.transtable)[2:] t += tend if ( string.translate(str(self.genTypeName(noPubTypeAttrs['id'])), self.transtable) not in self.generated_shadow_classes ): c += self.genClassShadow(noPubTypeAttrs) if t[-1] == ']' : c += indent + ' %s %s;\n' % ( t[:t.find('[')], a['name']+t[t.find('['):] ) elif t.find(')(') != -1 : c += indent + ' %s;\n' % ( t.replace(')(', ' %s)('%a['name'])) else : c += indent + ' %s %s;\n' % ( t, a['name'] ) c += indent + '};\n' return c | 4606eac13282958ef263c8105cadb904bd2a80dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4350/4606eac13282958ef263c8105cadb904bd2a80dc/gendict.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
797,
12957,
12,
2890,
16,
3422,
16,
3443,
273,
374,
262,
294,
8337,
273,
365,
18,
588,
38,
3304,
12,
3422,
3292,
350,
3546,
262,
309,
3443,
294,
2028,
273,
3422,
3292,
529,
3546,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
797,
12957,
12,
2890,
16,
3422,
16,
3443,
273,
374,
262,
294,
8337,
273,
365,
18,
588,
38,
3304,
12,
3422,
3292,
350,
3546,
262,
309,
3443,
294,
2028,
273,
3422,
3292,
529,
3546,... |
if len(args) == 3 and stamp1 in ('-f', '-force'): | if len(args) == 3 and far_stamp in ('-f', '-force'): | def main(args): if not args: raise LocalError('Must specify help, read or write as first argument') if args[0] in ('-help', '--help', '-h', 'help'): print __doc__ return PATCH_DIR = 'patches' if not os.path.isdir(os.path.join(os.getcwd(), '.muddle')): raise LocalError('** Oops - not at the top level of a muddle build tree') if args[0] == 'write': args = args[1:] if len(args) < 3: raise LocalError('Must specify two stamp files and a "patch" directory') if len(args) > 4: raise LocalError('Too many arguments') stamp1 = args[-3] stamp2 = args[-2] patch_dir = args[-1] if len(args) == 3 and stamp1 in ('-f', '-force'): raise LocalError('Must specify two stamp files and a "patch" directory') if len(args) == 4: if args[0] in ('-f', '-force'): if os.path.exists(patch_dir): shutil.rmtree(patch_dir) else: raise LocalError('Unexpected switch "%s" (not -f)'%args[0]) write(stamp1, stamp2, patch_dir) elif args[0] == 'read': args = args[1:] if len(args) != 1: raise LocalError('Must specify the "patch" directory') else: read(args[0]) else: raise LocalError('Must specify help, read or write as first argument') | 81ef31672eddce2e0b2103cab34a52e10be1db58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4427/81ef31672eddce2e0b2103cab34a52e10be1db58/muddle_patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
4672,
309,
486,
833,
30,
1002,
3566,
668,
2668,
10136,
4800,
2809,
16,
855,
578,
1045,
487,
1122,
1237,
6134,
225,
309,
833,
63,
20,
65,
316,
7707,
17,
5201,
2187,
3534... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1968,
4672,
309,
486,
833,
30,
1002,
3566,
668,
2668,
10136,
4800,
2809,
16,
855,
578,
1045,
487,
1122,
1237,
6134,
225,
309,
833,
63,
20,
65,
316,
7707,
17,
5201,
2187,
3534... |
if p2cread != -1: p2cread.Close() if c2pwrite != -1: c2pwrite.Close() if errwrite != -1: errwrite.Close() | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session): """Execute program (MS Windows version)""" | bfc915efb455b57176af3c3bc99ee5617b68e12d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/bfc915efb455b57176af3c3bc99ee5617b68e12d/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... | |
'unset key' | def _get_temp_file(self): return '/tmp/qtgnuplot.tmp.%d' % random.random() | 8366577ca2d3703e7d654e659403126d5dc32986 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6471/8366577ca2d3703e7d654e659403126d5dc32986/qtgnuplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
5814,
67,
768,
12,
2890,
4672,
327,
1173,
5645,
19,
23311,
1600,
89,
4032,
18,
5645,
7866,
72,
11,
738,
2744,
18,
9188,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
5814,
67,
768,
12,
2890,
4672,
327,
1173,
5645,
19,
23311,
1600,
89,
4032,
18,
5645,
7866,
72,
11,
738,
2744,
18,
9188,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
return MySQLdb.connect(host=mysql_host, user=mysql_user, passwd=mysql_passwd, db=mysql_db) | return MySQLdb.connect(host=mysql_host, user=mysql_user, passwd=mysql_passwd, db=mysql_db, init_command='SET NAMES utf8') | def getDatabaseConnection(): """Returns a mySQL connection to mythconverg database.""" return MySQLdb.connect(host=mysql_host, user=mysql_user, passwd=mysql_passwd, db=mysql_db) | 1b753e22ac6347b19aca6f86478dee874c8772b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13713/1b753e22ac6347b19aca6f86478dee874c8772b8/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11263,
1952,
13332,
3536,
1356,
279,
3399,
3997,
1459,
358,
3399,
451,
591,
502,
75,
2063,
12123,
327,
13485,
1966,
18,
3612,
12,
2564,
33,
12527,
67,
2564,
16,
729,
33,
12527,
67,
1355,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11263,
1952,
13332,
3536,
1356,
279,
3399,
3997,
1459,
358,
3399,
451,
591,
502,
75,
2063,
12123,
327,
13485,
1966,
18,
3612,
12,
2564,
33,
12527,
67,
2564,
16,
729,
33,
12527,
67,
1355,... |
toPml( self, '/tmp/main-debug.pml' ) pass | from os import environ user = environ['USER'] toPml(self, '/tmp/main-debug-%s.pml' % user) | def main(self, *args, **kwds): if self.debug: from configurationSaver import toPml toPml( self, '/tmp/main-debug.pml' ) pass # end if super(WebApplication, self).main(*args, **kwds) return | 6839a948f8326a36c28347ebafa717885867ea21 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/578/6839a948f8326a36c28347ebafa717885867ea21/WebApplication.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
309,
365,
18,
4148,
30,
628,
1664,
55,
21851,
1930,
358,
52,
781,
628,
1140,
1930,
5473,
729,
273,
5473,
3292,
4714,
3546,
358,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
309,
365,
18,
4148,
30,
628,
1664,
55,
21851,
1930,
358,
52,
781,
628,
1140,
1930,
5473,
729,
273,
5473,
3292,
4714,
3546,
358,
52... |
assert False | self.clearStackToTableContext() self.parser.insertElement(name, attributes) self.switchInsertionMode("inTableBody") | def startTagRowGroup(self, name, attributes={}): # XXX need a better name... emit tokens... assert False | e64c800f78b70cc9e68254242b8f6e3481c29af2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/e64c800f78b70cc9e68254242b8f6e3481c29af2/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
1999,
1114,
12,
2890,
16,
508,
16,
1677,
12938,
4672,
468,
11329,
1608,
279,
7844,
508,
2777,
3626,
2430,
2777,
1815,
1083,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
1999,
1114,
12,
2890,
16,
508,
16,
1677,
12938,
4672,
468,
11329,
1608,
279,
7844,
508,
2777,
3626,
2430,
2777,
1815,
1083,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
The walk is performed in breadth-first order. This method is a | The walk is performed in depth-first order. This method is a | def walk(self): """Walk over the message tree, yielding each subpart. | 65a642dfc157ed521fa7e3aa4d5ad2ffbdd8bce3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/65a642dfc157ed521fa7e3aa4d5ad2ffbdd8bce3/Message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5442,
12,
2890,
4672,
3536,
9463,
1879,
326,
883,
2151,
16,
31009,
1517,
720,
2680,
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,... | [
1,
1,
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,
5442,
12,
2890,
4672,
3536,
9463,
1879,
326,
883,
2151,
16,
31009,
1517,
720,
2680,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not exit_pid: launched = 1 | if exit_pid != pid: launched = 1 | def launch(self): """Launch external editor""" editor = self.getEditorPath() file = self.body_file last_fstat = os.stat(file) pid = os.spawnl(os.P_NOWAIT, editor, editor, file) use_locks = int(self.options.get('use_locks')) if use_locks: self.lock() exit_pid = 0 save_interval = self.config.getfloat('general', 'save_interval') launched = 0 while exit_pid != pid: sleep(save_interval or 2) try: exit_pid, exit_status = os.waitpid(pid, os.WNOHANG) if not exit_pid: launched = 1 except OSError: exit_pid = pid fstat = os.stat(file) if (exit_pid == pid or save_interval) \ and fstat[stat.ST_MTIME] != last_fstat[stat.ST_MTIME]: # File was modified self.saved = self.putChanges() last_fstat = fstat if not launched: fatalError(('Editor "%s" did not launch.\n' 'It may not be a graphical editor.') % editor) if use_locks: self.unlock() if not self.saved and has_tk(): from tkMessageBox import askyesno if askyesno('Zope External Editor', 'File not saved to Zope.\nReopen local copy?'): has_tk() # ugh, keeps tk happy self.launch() else: self.clean_up = 0 # Keep temp file has_tk() # ugh | d80276eb31deb2d001be9fd87020c0ea3bb854e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/d80276eb31deb2d001be9fd87020c0ea3bb854e4/zopeedit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
12,
2890,
4672,
3536,
9569,
3903,
4858,
8395,
4858,
273,
365,
18,
588,
6946,
743,
1435,
585,
273,
365,
18,
3432,
67,
768,
1142,
67,
74,
5642,
273,
1140,
18,
5642,
12,
768,
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,
8037,
12,
2890,
4672,
3536,
9569,
3903,
4858,
8395,
4858,
273,
365,
18,
588,
6946,
743,
1435,
585,
273,
365,
18,
3432,
67,
768,
1142,
67,
74,
5642,
273,
1140,
18,
5642,
12,
768,
13,
... |
self.insert_none_breaking_blanks = 1 | self.insert_non_breaking_blanks = 1 | def visit_literal_block(self, node): """Render a literal block.""" # environments and packages to typeset literal blocks packages = {'listing': r'\usepackage{moreverb}', 'lstlisting': r'\usepackage{listings}', 'Verbatim': r'\usepackage{fancyvrb}', # 'verbatim': '', 'verbatimtab': r'\usepackage{moreverb}'} | 1b8dac55202344263da9188c7d59f13cb6f789ae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5620/1b8dac55202344263da9188c7d59f13cb6f789ae/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
13107,
67,
2629,
12,
2890,
16,
756,
4672,
3536,
3420,
279,
7158,
1203,
12123,
468,
15900,
471,
5907,
358,
1953,
278,
7158,
4398,
5907,
273,
13666,
21228,
4278,
436,
8314,
1202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
13107,
67,
2629,
12,
2890,
16,
756,
4672,
3536,
3420,
279,
7158,
1203,
12123,
468,
15900,
471,
5907,
358,
1953,
278,
7158,
4398,
5907,
273,
13666,
21228,
4278,
436,
8314,
1202,
... |
data_files=convert_data_files([ 'pywin32.chm', | data_files=convert_optional_data_files([ 'PyWin32.chm', ]) + convert_data_files([ | def convert_data_files(files): base_dir = "Lib/site-packages" ret = [] for file in files: file = os.path.normpath(file) if file.find("*") >= 0: flist = FileList() flist.findall(os.path.dirname(file)) flist.include_pattern(os.path.basename(file)) # We never want CVS flist.exclude_pattern(re.compile(".*\\\\CVS\\\\"), is_regex=1) if not flist.files: raise RuntimeError, "No files match '%s'" % file files_use = flist.files else: if not os.path.isfile(file): raise RuntimeError, "No file '%s'" % file files_use = (file,) path_use = os.path.dirname(file) if path_use.startswith("com/") or path_use.startswith("com\\"): path_use = path_use[4:] path_use = os.path.join(base_dir, path_use) ret.append( (path_use, files_use)) return ret | 382c6b5f358401e1c35e1f995f2ca0bed522c186 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/382c6b5f358401e1c35e1f995f2ca0bed522c186/setup_win32all.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
892,
67,
2354,
12,
2354,
4672,
1026,
67,
1214,
273,
315,
5664,
19,
4256,
17,
10308,
6,
325,
273,
5378,
364,
585,
316,
1390,
30,
585,
273,
1140,
18,
803,
18,
7959,
803,
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,
1765,
67,
892,
67,
2354,
12,
2354,
4672,
1026,
67,
1214,
273,
315,
5664,
19,
4256,
17,
10308,
6,
325,
273,
5378,
364,
585,
316,
1390,
30,
585,
273,
1140,
18,
803,
18,
7959,
803,
12,
... |
value += ' ' + DateTime().timezone() | original = value | def set(self, instance, value, **kwargs): """ Check if value is an actual date/time value. If not, attempt to convert it to one; otherwise, set to None. Assign all properties passed as kwargs to object. """ if not value: value = None elif not isinstance(value, DateTime): try: # strings returned from the widget need a time zone, # which is assumed to be the local one # see http://dev.plone.org/plone/ticket/10141 value += ' ' + DateTime().timezone() value = DateTime(value) except DateTime.DateTimeError: value = None | bb8d1a9f35d189695945c654be2958a287695261 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12165/bb8d1a9f35d189695945c654be2958a287695261/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
791,
16,
460,
16,
2826,
4333,
4672,
3536,
2073,
309,
460,
353,
392,
3214,
1509,
19,
957,
460,
18,
971,
486,
16,
4395,
358,
1765,
518,
358,
1245,
31,
3541,
16,
444,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
791,
16,
460,
16,
2826,
4333,
4672,
3536,
2073,
309,
460,
353,
392,
3214,
1509,
19,
957,
460,
18,
971,
486,
16,
4395,
358,
1765,
518,
358,
1245,
31,
3541,
16,
444,... |
def __init__(self, wsgi_iterator): | def __init__(self, wsgi_iterator, check_start_response): | def __init__(self, wsgi_iterator): self.original_iterator = wsgi_iterator self.iterator = iter(wsgi_iterator) self.closed = False | 9b4d86328e40817bcdcbd5619e8b438dd6e7c764 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/9b4d86328e40817bcdcbd5619e8b438dd6e7c764/lint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
341,
17537,
67,
9838,
16,
866,
67,
1937,
67,
2740,
4672,
365,
18,
8830,
67,
9838,
273,
341,
17537,
67,
9838,
365,
18,
9838,
273,
1400,
12,
28539,
67,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
341,
17537,
67,
9838,
16,
866,
67,
1937,
67,
2740,
4672,
365,
18,
8830,
67,
9838,
273,
341,
17537,
67,
9838,
365,
18,
9838,
273,
1400,
12,
28539,
67,
9... |
char.socket.sysmessage('Your gm page has been deleted.', 0x846) player.socket.sysmessage('You remove the page.', 0x846) player.log(LOG_MESSAGE, "%s deletes gm page from %s (%s).\n" % (player.name, char.name, self.account)) | char.socket.sysmessage(tr('Your gm page has been deleted.'), 0x846) player.socket.sysmessage(tr('You remove the page.'), 0x846) player.log(LOG_MESSAGE, tr("%s deletes gm page from %s (%s).\n") % (player.name, char.name, self.account)) pages_gump(player) | def details_response(self, player, response): if response.button == 0: return char = wolfpack.findchar(self.serial) if not char: return # Go to character if response.button == 1: player.removefromview() player.moveto(char.pos) player.update() player.socket.resendworld() # Bring character elif response.button == 2: char.removefromview() char.moveto(player.pos) char.update() if char.socket: char.socket.resendworld() | d8b7b7c1b9e926bd4732e104ef67fe1e1cc770bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/d8b7b7c1b9e926bd4732e104ef67fe1e1cc770bf/pages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3189,
67,
2740,
12,
2890,
16,
7291,
16,
766,
4672,
309,
766,
18,
5391,
422,
374,
30,
327,
225,
1149,
273,
341,
355,
74,
2920,
18,
4720,
3001,
12,
2890,
18,
8818,
13,
225,
309,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3189,
67,
2740,
12,
2890,
16,
7291,
16,
766,
4672,
309,
766,
18,
5391,
422,
374,
30,
327,
225,
1149,
273,
341,
355,
74,
2920,
18,
4720,
3001,
12,
2890,
18,
8818,
13,
225,
309,
486,
... |
def __init__(self, gski, uri, asnum, date, asn1): | def __init__(self, uri, asnum, date, asn1): | def __init__(self, gski, uri, asnum, date, asn1): assert len(asn1[0]) <= self.addr_type.bits x = 0L for y in asn1[0]: x = (x << 1) | y x <<= (self.addr_type.bits - len(asn1[0])) self.gski = gski self.uri = uri self.asn = asnum self.date = date self.prefix = self.addr_type(x) self.prefixlen = len(asn1[0]) self.max_prefixlen = self.prefixlen if asn1[1] is None else asn1[1] | 1565073a89f0b0413e01d5f3cf538c7b947f2850 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/119/1565073a89f0b0413e01d5f3cf538c7b947f2850/roa-to-irr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2003,
16,
487,
2107,
16,
1509,
16,
12211,
21,
4672,
1815,
562,
12,
31432,
21,
63,
20,
5717,
1648,
365,
18,
4793,
67,
723,
18,
6789,
619,
273,
374,
48,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2003,
16,
487,
2107,
16,
1509,
16,
12211,
21,
4672,
1815,
562,
12,
31432,
21,
63,
20,
5717,
1648,
365,
18,
4793,
67,
723,
18,
6789,
619,
273,
374,
48,
... |
getattr(itk.Image, '%s%s' % (short_type, dim))].New() self._reader_type = short_type self._reader_dim = dim | getattr(itk.Image, reader_type_text)].New() self._reader_type_text = reader_type_text print reader_type_text | def execute_module(self): if self._config.autotype: self._autotype_reader.SetFileName(self._config.filename) self._autotype_reader.UpdateOutputInformation() iio = self._autotype_reader.GetImageIO() comp_type = iio.GetComponentTypeAsString(iio.GetComponentType()) if comp_type == 'short': comp_type = 'signed_short' # lc will convert e.g. unsigned_char to UC short_type = ''.join([i[0].upper() for i in comp_type.split('_')]) print comp_type, short_type dim = iio.GetNumberOfDimensions() | 07157f0e860fb6ba55406b135684d1d0c9f0eadc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4494/07157f0e860fb6ba55406b135684d1d0c9f0eadc/ITKReader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
2978,
12,
2890,
4672,
309,
365,
6315,
1425,
18,
5854,
10570,
30,
365,
6315,
5854,
10570,
67,
10530,
18,
694,
4771,
12,
2890,
6315,
1425,
18,
3459,
13,
365,
6315,
5854,
10570,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
2978,
12,
2890,
4672,
309,
365,
6315,
1425,
18,
5854,
10570,
30,
365,
6315,
5854,
10570,
67,
10530,
18,
694,
4771,
12,
2890,
6315,
1425,
18,
3459,
13,
365,
6315,
5854,
10570,
... |
os.system("killall -9 xenbaked") os.system("xenbaked --ms_per_sample=%d &" % | global kill_cmd global xenbaked_cmd os.system(kill_cmd) os.system(xenbaked_cmd + " --ms_per_sample=%d &" % | def start_xenbaked(): global options os.system("killall -9 xenbaked") # assumes that xenbaked is in your path os.system("xenbaked --ms_per_sample=%d &" % options.mspersample) time.sleep(1) | 25cb94f3ca63c9d18a7714d2d089c6c1e0168c05 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/25cb94f3ca63c9d18a7714d2d089c6c1e0168c05/xenmon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
92,
275,
70,
9477,
13332,
2552,
702,
225,
1140,
18,
4299,
2932,
16418,
454,
300,
29,
23048,
70,
9477,
7923,
468,
13041,
716,
23048,
70,
9477,
353,
316,
3433,
589,
1140,
18,
42... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
92,
275,
70,
9477,
13332,
2552,
702,
225,
1140,
18,
4299,
2932,
16418,
454,
300,
29,
23048,
70,
9477,
7923,
468,
13041,
716,
23048,
70,
9477,
353,
316,
3433,
589,
1140,
18,
42... |
command = "%s -f .pool %s"%(self.extractor, path) | command = "%s -f %s %s"%(self.extractor, self.poolSuffix, path) | def QueryDescriptors(self, id, ignoreCache=False, computeIfNotCached=False, keepCache=True) : if not ignoreCache: try : return Pool(file(self._poolPath(id))) except IOError, e : pass # Not found path=id # TODO: This should take the file given an id, by now using the path as id if self.path : linkName = os.path.join(self.path, id) try : os.symlink(path, linkName) path = linkName except: pass if self.extractor : command = "%s -f .pool %s"%(self.extractor, path) os.popen(command, 'r').read() try : return Pool(file(self._poolPath(id))) except IOError, e : pass # Not found raise FileMetadataSource.SongNotFoundException(id) | cbefa694a868fef3ff347b3d18f4b10f2a57e3d9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1456/cbefa694a868fef3ff347b3d18f4b10f2a57e3d9/FileMetadataSource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2770,
12705,
12,
2890,
16,
612,
16,
2305,
1649,
33,
8381,
16,
3671,
10288,
9839,
33,
8381,
16,
3455,
1649,
33,
5510,
13,
294,
309,
486,
2305,
1649,
30,
775,
294,
327,
8828,
12,
768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2770,
12705,
12,
2890,
16,
612,
16,
2305,
1649,
33,
8381,
16,
3671,
10288,
9839,
33,
8381,
16,
3455,
1649,
33,
5510,
13,
294,
309,
486,
2305,
1649,
30,
775,
294,
327,
8828,
12,
768,
... |
self.check_sizeof(class_oldstyle(), h + 3*p) | self.check_sizeof(class_oldstyle(), size(h + '3P')) | def method(): pass | 9cbed723c019f67adc5f76d1f21ed8d14c9df22c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/9cbed723c019f67adc5f76d1f21ed8d14c9df22c/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
707,
13332,
1342,
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,
0,
0,
0,
0,
... | [
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
707,
13332,
1342,
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,
-100,
-100,
... |
Function does the same as task_low_level_submission_tuple. | Function does the same as task_low_level_submission. | def task_low_level_submission_tuple(name, user, argv): """ Function does the same as task_low_level_submission_tuple. The only difference is that the arguments are passed as tuple """ def get_priority(argv): """Try to get the priority by analysing the arguments.""" priority = 0 try: stripped_argv = [arg for arg in argv if not arg.startswith('-') or arg.startswith('-P') or arg.startswith('--priority')] opts, args = getopt.gnu_getopt(stripped_argv, 'P:', ['priority=']) for opt in opts: if opt[0] in ('-P', '--priority'): priority = opt[1] except: pass return priority task_id = None try: if not name in CFG_BIBTASK_VALID_TASKS: raise StandardError('%s is not a valid task name' % name) priority = get_priority(argv) argv = tuple([os.path.join(CFG_BINDIR, name)] + list(argv)) ## submit task: task_id = run_sql("""INSERT INTO schTASK (proc,user, runtime,sleeptime,status,progress,arguments,priority) VALUES (%s,%s,NOW(),'','WAITING','',%s,%s)""", (name, user, marshal.dumps(argv), priority)) except Exception: register_exception() if task_id: run_sql("""DELETE FROM schTASK WHERE id=%s""", (task_id, )) raise return task_id | c4b3ee19245cd5957db0f354f04d26020de64b36 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/c4b3ee19245cd5957db0f354f04d26020de64b36/bibtask.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
821,
67,
2815,
67,
12684,
67,
8052,
12,
529,
16,
729,
16,
5261,
4672,
3536,
4284,
1552,
326,
1967,
487,
1562,
67,
821,
67,
2815,
67,
12684,
18,
1021,
1338,
7114,
353,
716,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
821,
67,
2815,
67,
12684,
67,
8052,
12,
529,
16,
729,
16,
5261,
4672,
3536,
4284,
1552,
326,
1967,
487,
1562,
67,
821,
67,
2815,
67,
12684,
18,
1021,
1338,
7114,
353,
716,
... |
f = open(file, 'r') x = TestSGML() while 1: line = f.readline() if not line: x.close() break x.feed(line) | if file == '-': f = sys.stdin else: try: f = open(file, 'r') except IOError, msg: print file, ":", msg sys.exit(1) data = f.read() if f is not sys.stdin: f.close() x = klass() for c in data: x.feed(c) x.close() | def test(): file = 'test.html' f = open(file, 'r') x = TestSGML() while 1: line = f.readline() if not line: x.close() break x.feed(line) | 48766512a0b438b66e97dfdfcb933cd104baeffe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48766512a0b438b66e97dfdfcb933cd104baeffe/sgmllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
585,
273,
296,
3813,
18,
2620,
11,
225,
309,
585,
422,
4014,
30,
284,
273,
2589,
18,
21772,
469,
30,
775,
30,
284,
273,
1696,
12,
768,
16,
296,
86,
6134,
1335,
8340,
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,
1842,
13332,
585,
273,
296,
3813,
18,
2620,
11,
225,
309,
585,
422,
4014,
30,
284,
273,
2589,
18,
21772,
469,
30,
775,
30,
284,
273,
1696,
12,
768,
16,
296,
86,
6134,
1335,
8340,
16,... |
dnaStrand = chunk1.parent_node_of_class(self.win.assy.DnaStrand) if dnaStrand: chunkList = [dnaStrand] | dnaStrandOrSegment = chunk1.parent_node_of_class( self.win.assy.DnaStrandOrSegment) if dnaStrandOrSegment: chunkList = [dnaStrandOrSegment] | def _get_objects_to_highlight(self, selobj, hiColor1, hiColor2): """ Returns a python dictionary with objects to be drawn highlighted as its keys and highlight color as their corresponding values. The object to be highlighted is determined based the current graphics mode using the glpane.selobj. The subclasses can override this method to return objects to be highlighted in that particular graphics mode. @param selobj: GLPane.selobj (object under cursoe which can be registered as a GLPane.selobj @param hiColor1 : highlight color 1 @paramhiColor2: alternative highlight color. Example: If there are two chunks that need to be highlighted, one chunk gets hiColor1 and other gets hiColor2. @TODO: - may be hiColors should be in a list to make it more general @return: dictionary of objects to be highlighted. @rtype: dict @see: self._is_dnaGroup_highlighting_enabled() @see: self.drawHighlightedChunk() @see : self.drawHighlightedObjectUnderMouse() | 9b62a45032a66e2bb994ed6192351ad80ddd1d98 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/9b62a45032a66e2bb994ed6192351ad80ddd1d98/SelectChunks_GraphicsMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
6911,
67,
869,
67,
15978,
12,
2890,
16,
357,
2603,
16,
10118,
2957,
21,
16,
10118,
2957,
22,
4672,
3536,
2860,
279,
5790,
3880,
598,
2184,
358,
506,
19377,
24375,
487,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
6911,
67,
869,
67,
15978,
12,
2890,
16,
357,
2603,
16,
10118,
2957,
21,
16,
10118,
2957,
22,
4672,
3536,
2860,
279,
5790,
3880,
598,
2184,
358,
506,
19377,
24375,
487,
20... |
xmin, ymin, xmax, ymax -- start and stop point of arrow | xtail, ytail, xhead, yhead -- start and stop point of arrow | def _arrow(self, xmin, ymin, xmax, ymax, options): """ Add an arrow with given bounding box to this graphics object. | 20fed398d25002f78f9edd13592206eb593b0a5f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/20fed398d25002f78f9edd13592206eb593b0a5f/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7815,
12,
2890,
16,
13777,
16,
15763,
16,
14016,
16,
15275,
16,
702,
4672,
3536,
1436,
392,
12274,
598,
864,
7552,
3919,
358,
333,
17313,
733,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
7815,
12,
2890,
16,
13777,
16,
15763,
16,
14016,
16,
15275,
16,
702,
4672,
3536,
1436,
392,
12274,
598,
864,
7552,
3919,
358,
333,
17313,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
... |
except DistributionNotFound: | except DistributionNotFound: | def uninstall(self, specs): """ Uninstall function to remove all files associated with an egg, including scripts generated. Also does a back-check of dependencies on the package(s) being uninstalled and prompts the user for uninstalling unnecessary dependencies that can be removed and warns if uninstalling a package could break another installed package. """ all_deps = self.get_deps() for spec in specs: try: pkgs = require(spec) # If the package found has dependencies, prompt the user if they # want the dependencies to be uninstalled as well. if len(pkgs) > 1: for dep in pkgs[1:]: if self.check_deps(dep.project_name, spec, all_deps): self._remove_dist(dep) # Finally, check if user-specified package can be safely # removed. if self.check_deps(pkgs[0].project_name, spec, all_deps): self._remove_dist(pkgs[0]) except DistributionNotFound: log.info("Could not find suitable package for: %s" % spec) | 4853cbd76cdb3ed034db2a88e27dc562817f8840 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7707/4853cbd76cdb3ed034db2a88e27dc562817f8840/easy_install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16577,
12,
2890,
16,
10607,
4672,
3536,
1351,
5425,
445,
358,
1206,
777,
1390,
3627,
598,
392,
25144,
16,
6508,
8873,
4374,
18,
225,
8080,
1552,
279,
1473,
17,
1893,
434,
5030,
603,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16577,
12,
2890,
16,
10607,
4672,
3536,
1351,
5425,
445,
358,
1206,
777,
1390,
3627,
598,
392,
25144,
16,
6508,
8873,
4374,
18,
225,
8080,
1552,
279,
1473,
17,
1893,
434,
5030,
603,
326,... |
debug(" - checking cookie %s=%s", cookie.name, cookie.value) | _debug(" - checking cookie %s=%s", cookie.name, cookie.value) | def return_ok(self, cookie, request): """ If you override .return_ok(), be sure to call this method. If it returns false, so should your subclass (assuming your subclass wants to be more strict about which cookies to return). | e3485b205e7bc77f437c4e5fc2d8b00eefb7fc77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/e3485b205e7bc77f437c4e5fc2d8b00eefb7fc77/cookielib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
327,
67,
601,
12,
2890,
16,
3878,
16,
590,
4672,
3536,
971,
1846,
3849,
263,
2463,
67,
601,
9334,
506,
3071,
358,
745,
333,
707,
18,
225,
971,
518,
1135,
629,
16,
1427,
1410,
3433,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
327,
67,
601,
12,
2890,
16,
3878,
16,
590,
4672,
3536,
971,
1846,
3849,
263,
2463,
67,
601,
9334,
506,
3071,
358,
745,
333,
707,
18,
225,
971,
518,
1135,
629,
16,
1427,
1410,
3433,
1... |
for n in ['b2a_qp', 'a2b_hex', 'b2a_base64', 'a2b_uu', 'a2b_qp', 'b2a_hex', 'unhexlify', 'hexlify', 'crc32', 'b2a_hqx', 'a2b_hqx', 'a2b_base64', 'rlecode_hqx', 'b2a_uu', 'rledecode_hqx']: f = getattr(binascii, n) f('') binascii.crc_hqx('', 0) | empty = self.type2test('') for func in all_functions: if func == 'crc_hqx': binascii.crc_hqx(empty, 0) continue f = getattr(binascii, func) try: f(empty) except Exception, err: self.fail("{}({!r}) raises {!r}".format(func, empty, err)) | def test_empty_string(self): # A test for SF bug #1022953. Make sure SystemError is not raised. for n in ['b2a_qp', 'a2b_hex', 'b2a_base64', 'a2b_uu', 'a2b_qp', 'b2a_hex', 'unhexlify', 'hexlify', 'crc32', 'b2a_hqx', 'a2b_hqx', 'a2b_base64', 'rlecode_hqx', 'b2a_uu', 'rledecode_hqx']: f = getattr(binascii, n) f('') binascii.crc_hqx('', 0) | 56917fffc941f205cbeb70b1cd4a3d4666741ebc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/56917fffc941f205cbeb70b1cd4a3d4666741ebc/test_binascii.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5531,
67,
1080,
12,
2890,
4672,
468,
432,
1842,
364,
21318,
7934,
468,
2163,
3787,
29,
8643,
18,
225,
4344,
3071,
2332,
668,
353,
486,
11531,
18,
364,
290,
316,
10228,
70,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5531,
67,
1080,
12,
2890,
4672,
468,
432,
1842,
364,
21318,
7934,
468,
2163,
3787,
29,
8643,
18,
225,
4344,
3071,
2332,
668,
353,
486,
11531,
18,
364,
290,
316,
10228,
70,
22... |
if not os.path.isfile(new_image_path): | if not os.path.isfile(image_path): | def add_movie_db(self, close): details = get_details(self) if not details['o_title'] and not details['title']: gutils.error(self.widgets['results']['window'], _("You should fill the original title\nor the movie title."), parent=self.widgets['add']['window']) return False if details['o_title']: tmp_movie = self.db.Movie.get_by(o_title=details['o_title']) if tmp_movie is not None: response = gutils.question(self, msg=_('Movie with that title already exists, are you sure you want to add?'), cancel=0, parent=self.widgets['add']['window']) if response == gtk.RESPONSE_NO: return False if details['title']: tmp_movie = self.db.Movie.get_by(title=details['title']) if tmp_movie is not None: response = gutils.question(self, msg=_('Movie with that title already exists, are you sure you want to add?'), cancel=0, parent=self.widgets['add']['window']) if response == gtk.RESPONSE_NO: return False movie = self.db.Movie() if not movie.add_to_db(details): return False # lets move poster from tmp to posters dir tmp_dest = self.locations['posters'] image_path = '' if details['image']: image_path = os.path.join(self.locations['temp'], "poster_%s.jpg" % details['image']) if os.path.isfile(image_path): new_image_path = os.path.join(tmp_dest, "%s.jpg" % details['image']) shutil.move(image_path, new_image_path) #lets make the thumbnail and medium image from poster for future use gutils.make_thumbnail(self, "%s.jpg"%details['image']) gutils.make_medium_image(self, "%s.jpg"%details['image']) rows = len(self.treemodel) if rows>0: insert_after = self.treemodel.get_iter(rows-1) # last else: insert_after = None myiter = self.treemodel.insert_after(None, insert_after) if not os.path.isfile(new_image_path): image_path = os.path.join(self.locations['images'], 'default.png') handler = self.Image.set_from_file(new_image_path) pixbuf = self.Image.get_pixbuf() self.treemodel.set_value(myiter, 0, '%004d' % details['number']) self.treemodel.set_value(myiter, 1, pixbuf.scale_simple(30,40,3)) self.treemodel.set_value(myiter, 2, details['o_title']) self.treemodel.set_value(myiter, 3, details['title']) self.treemodel.set_value(myiter, 4, details['director']) #update statusbar self.total += 1 self.count_statusbar() #select new entry from main treelist self.widgets['treeview'].get_selection().select_iter(myiter) self.treeview_clicked() clear(self) if close: self.hide_add_window() | 16d0bfeef00cad23856a199748ce08e8f55e6d5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2687/16d0bfeef00cad23856a199748ce08e8f55e6d5c/add.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8683,
13120,
67,
1966,
12,
2890,
16,
1746,
4672,
3189,
273,
336,
67,
6395,
12,
2890,
13,
309,
486,
3189,
3292,
83,
67,
2649,
3546,
471,
486,
3189,
3292,
2649,
3546,
30,
314,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8683,
13120,
67,
1966,
12,
2890,
16,
1746,
4672,
3189,
273,
336,
67,
6395,
12,
2890,
13,
309,
486,
3189,
3292,
83,
67,
2649,
3546,
471,
486,
3189,
3292,
2649,
3546,
30,
314,
... |
4. Re-initialise the server by running "python demo.py nuke".''' % url | 4. Re-initialise the server by running "python demo.py nuke". ''' % cfg["TRACKER_WEB"] | def run_demo(): ''' Run a demo server for users to play with for instant gratification. Sets up the web service on localhost. Disables nosy lists. ''' home = os.path.abspath('demo') backend = 'anydbm' if not os.path.exists(home) or sys.argv[-1] == 'nuke': if len(sys.argv) > 2: backend = sys.argv[-2] install_demo(home, backend) cfg = ConfigParser.ConfigParser() cfg.read(os.path.join(home, 'config.ini')) url = cfg.get('tracker', 'web') hostname, port = urlparse.urlparse(url)[1].split(':') port = int(port) # ok, so start up the server from roundup.scripts import roundup_server roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home} success_message = '''Server running - connect to: %s | 4e39cc9c84cb81d6ae66e39468fe97b20a969216 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4e39cc9c84cb81d6ae66e39468fe97b20a969216/demo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
27928,
13332,
9163,
1939,
279,
21477,
1438,
364,
3677,
358,
6599,
598,
364,
5934,
3821,
270,
1480,
18,
225,
11511,
731,
326,
3311,
1156,
603,
17365,
18,
3035,
1538,
26628,
93,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
27928,
13332,
9163,
1939,
279,
21477,
1438,
364,
3677,
358,
6599,
598,
364,
5934,
3821,
270,
1480,
18,
225,
11511,
731,
326,
3311,
1156,
603,
17365,
18,
3035,
1538,
26628,
93,
... |
def write(self, arg, move=0): x, y = start = self._position | def write(self, text, move=False): """ Write text at the current pen position. If move is true, the pen is moved to the bottom-right corner of the text. By default, move is False. Example: >>> turtle.write('The race is on!') >>> turtle.write('Home = (0, 0)', True) """ x, y = self._position | def write(self, arg, move=0): x, y = start = self._position x = x-1 # correction -- calibrated for Windows item = self._canvas.create_text(x, y, text=str(arg), anchor="sw", fill=self._color) self._items.append(item) if move: x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) self._draw_turtle() | e3a25838db0ac392aa9e68379e167635f8e67a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3a25838db0ac392aa9e68379e167635f8e67a43/turtle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
977,
16,
3635,
33,
8381,
4672,
3536,
2598,
977,
622,
326,
783,
14264,
1754,
18,
225,
971,
3635,
353,
638,
16,
326,
14264,
353,
10456,
358,
326,
5469,
17,
4083,
1105... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
977,
16,
3635,
33,
8381,
4672,
3536,
2598,
977,
622,
326,
783,
14264,
1754,
18,
225,
971,
3635,
353,
638,
16,
326,
14264,
353,
10456,
358,
326,
5469,
17,
4083,
1105... |
OPTS=['BUILDING_DTOOLCONFIG', 'NSPR', 'OPT4'] | OPTS=['BUILDING_DTOOLCONFIG', 'NSPR', 'OPT3'] | if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n" | bc5fc1af0298e68a51a18dc8bc8da9f86c4f411e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/bc5fc1af0298e68a51a18dc8bc8da9f86c4f411e/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
309,
261,
1125,
422,
296,
2124,
12904,
11,
4672,
2195,
273,
2195,
397,
6619,
318,
536,
315,
397,
498,
397,
1548,
82,
6,
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,
309,
261,
1125,
422,
296,
2124,
12904,
11,
4672,
2195,
273,
2195,
397,
6619,
318,
536,
315,
397,
498,
397,
1548,
82,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
rsp = self.apiDelete("reviewrequests/%s/reviews/draft" % | rsp = self.apiDelete("reviewrequests/%s/reviews/919239" % | def test_delete_review_with_does_not_exist(self): """Testing the DELETE reviewrequests/<id>/reviews/<id>/ API with Does Not Exist error""" review_request = ReviewRequest.objects.public()[0] rsp = self.apiDelete("reviewrequests/%s/reviews/draft" % review_request.id, expected_status=404) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], DOES_NOT_EXIST.code) | 6f62171a9876a999f22f6ebd5ed31ea85071c2f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/6f62171a9876a999f22f6ebd5ed31ea85071c2f8/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3733,
67,
16041,
67,
1918,
67,
20657,
67,
902,
67,
7398,
12,
2890,
4672,
3536,
22218,
326,
8568,
10725,
11420,
28177,
350,
16893,
266,
7061,
28177,
350,
16893,
1491,
598,
9637,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3733,
67,
16041,
67,
1918,
67,
20657,
67,
902,
67,
7398,
12,
2890,
4672,
3536,
22218,
326,
8568,
10725,
11420,
28177,
350,
16893,
266,
7061,
28177,
350,
16893,
1491,
598,
9637,
... |
loggers = qE.createLoggers(variables) qE.run_and_plot(1000, variables) | loggers = qE.create_loggers(variables) qE.run_and_plot(1000, variables, loggers) plt.show() | def demo(): """Demo method. This should be the skeleton of your simulation""" qE = QuickEcell('simple_ecell_mod.eml') variables = ['S', 'P'] loggers = qE.createLoggers(variables) qE.run_and_plot(1000, variables) | 1cf86d6668a0f6d9627128153fe0d77a29f0d411 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14363/1cf86d6668a0f6d9627128153fe0d77a29f0d411/quickEcell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
13332,
3536,
27126,
707,
18,
1220,
1410,
506,
326,
17761,
434,
3433,
14754,
8395,
225,
1043,
41,
273,
19884,
41,
3855,
2668,
9647,
67,
557,
1165,
67,
1711,
18,
351,
80,
6134,
3152... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
13332,
3536,
27126,
707,
18,
1220,
1410,
506,
326,
17761,
434,
3433,
14754,
8395,
225,
1043,
41,
273,
19884,
41,
3855,
2668,
9647,
67,
557,
1165,
67,
1711,
18,
351,
80,
6134,
3152... |
parser = PottyMouth(emdash=False, ellipsis=False, smart_quotes=False) | parser = PottyMouth(emdash=False, ellipsis=False, smart_quotes=False, youtube=False, image=False) | def parse(self, input_data, reason): from zine._ext.pottymouth import PottyMouth parser = PottyMouth(emdash=False, ellipsis=False, smart_quotes=False) node = parser.parse(input_data) return self._to_zeml(node) | 4e9bb192c077c19c1f7935925d087aa724303a1c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12815/4e9bb192c077c19c1f7935925d087aa724303a1c/parsers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
810,
67,
892,
16,
3971,
4672,
628,
998,
558,
6315,
408,
18,
13130,
88,
2942,
15347,
1930,
23435,
4098,
49,
15347,
2082,
273,
23435,
4098,
49,
15347,
12,
351,
21817,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
810,
67,
892,
16,
3971,
4672,
628,
998,
558,
6315,
408,
18,
13130,
88,
2942,
15347,
1930,
23435,
4098,
49,
15347,
2082,
273,
23435,
4098,
49,
15347,
12,
351,
21817,
... |
label = self.body[size] text = ''.join(self.body[size+1:]) | text = ''.join(self.body[size:]) | def depart_citation(self, node): size = self.context.pop() label = self.body[size] text = ''.join(self.body[size+1:]) del self.body[size:] self.bibitems.append([label, text]) | 56f11bfd0e2241aedff17fcf1dcdc92d3904a297 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5532/56f11bfd0e2241aedff17fcf1dcdc92d3904a297/latexwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
71,
8773,
12,
2890,
16,
756,
4672,
963,
273,
365,
18,
2472,
18,
5120,
1435,
977,
273,
875,
18,
5701,
12,
2890,
18,
3432,
63,
1467,
30,
5717,
1464,
365,
18,
3432,
63,
1467,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26000,
67,
71,
8773,
12,
2890,
16,
756,
4672,
963,
273,
365,
18,
2472,
18,
5120,
1435,
977,
273,
875,
18,
5701,
12,
2890,
18,
3432,
63,
1467,
30,
5717,
1464,
365,
18,
3432,
63,
1467,... |
self.store.remove (ti) del self.challenges [index] count = int(self.widgets["activeSeeksLabel"].get_text().split()[0])-1 self.widgets["activeSeeksLabel"].set_text(_("Active seeks: %d") % count) | self.store.remove(ti) del self.challenges[index] self.__updateActiveSeeksLabel() def onClearSeeks (self): self.store.clear() self.seeks = {} self.__updateActiveSeeksLabel() def onAcceptClicked (self, button): model, iter = self.tv.get_selection().get_selected() if iter == None: return gameno = model.get_value(iter, 0) if gameno.startswith("C"): self.connection.om.acceptIndex(gameno[1:]) else: self.connection.om.playIndex(gameno) def onClearSeeksClicked (self, button): print >> self.connection.client, "unseek" self.widgets["clearSeeksButton"].set_sensitive(False) def row_activated (self, treeview, path, view_column): model, iter = self.tv.get_selection().get_selected() if iter == None: return gameno = model.get_value(iter, 0) if gameno != self.lastSeekSelected: return if path != model.get_path(iter): return self.onAcceptClicked(None) def onSelectionChanged (self, selection): model, iter = self.widgets["seektreeview"].get_selection().get_selected() if iter == None: return self.lastSeekSelected = model.get_value(iter, 0) def onPlayingGame (self): self.widgets["seekListContent"].set_sensitive(False) self.widgets["challengeExpander"].set_sensitive(False) self.widgets["clearSeeksButton"].set_sensitive(False) self.store.clear() self.__updateActiveSeeksLabel() def onCurGameEnded (self): self.widgets["seekListContent"].set_sensitive(True) self.widgets["challengeExpander"].set_sensitive(True) self.connection.glm.refreshSeeks() | def onChallengeRemove (self, index): if not index in self.challenges: return ti = self.challenges [index] if not self.store.iter_is_valid(ti): return self.store.remove (ti) del self.challenges [index] count = int(self.widgets["activeSeeksLabel"].get_text().split()[0])-1 self.widgets["activeSeeksLabel"].set_text(_("Active seeks: %d") % count) | ecd9ea4654305def156d9650ba6eabaf3086a366 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5339/ecd9ea4654305def156d9650ba6eabaf3086a366/ICLounge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
18359,
3288,
261,
2890,
16,
770,
4672,
309,
486,
770,
316,
365,
18,
343,
7862,
2852,
30,
327,
11374,
273,
365,
18,
343,
7862,
2852,
306,
1615,
65,
309,
486,
365,
18,
2233,
18,
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,
603,
18359,
3288,
261,
2890,
16,
770,
4672,
309,
486,
770,
316,
365,
18,
343,
7862,
2852,
30,
327,
11374,
273,
365,
18,
343,
7862,
2852,
306,
1615,
65,
309,
486,
365,
18,
2233,
18,
2... |
(subject.CN)) | (commonName)) | def loadCerts(parcel, moduleName, filename='cacert.pem'): # Load cacert.pem into the repository import os, sys import logging from M2Crypto import X509, util from M2Crypto.EVP import MessageDigest log = logging.getLogger(__name__) chop = -1 cert = schema.ns('osaf.framework.certstore', parcel) lobType = schema.itemFor(schema.Lob, parcel.itsView) from osaf.framework.certstore import utils lastLine = '' pem = [] certificates = 0 for line in open( os.path.join( os.path.dirname(sys.modules[moduleName].__file__),filename ), 'rU' ): if line[:3] == '===': itsName = lastLine itsName = itsName[:chop] elif line[:chop] == '-----BEGIN CERTIFICATE-----': pem = [line] elif line[:chop] == '-----END CERTIFICATE-----': pem.append(line[:chop]) x509 = X509.load_cert_string(''.join(pem)) commonName = itsName itsName = itsName.replace('/', '_') if not x509.verify(): subject = x509.get_subject() log.warn('Skipping certificate, does not verify: %s' % \ (subject.CN)) #print x509.as_text() continue cert.Certificate.update(parcel, itsName, subjectCommonName = commonName, type='root',#cert.TYPE_ROOT, trust=3,#cert.TRUST_AUTHENTICITY | cert.TRUST_SITE, fingerprintAlgorithm='sha1', fingerprint=utils.fingerprint(x509), pem=lobType.makeValue(''.join(pem)), asText=lobType.makeValue(x509.as_text()), ) pem = [] certificates += 1 elif pem: pem.append(line) lastLine = line log.info( 'Imported %d certificates from %s in %s', certificates, filename, moduleName ) | bf6b3625a8b14580929d8222655f237ee5f5a62b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/bf6b3625a8b14580929d8222655f237ee5f5a62b/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
16273,
12,
1065,
2183,
16,
9780,
16,
1544,
2218,
71,
1077,
1051,
18,
20313,
11,
4672,
468,
4444,
276,
1077,
1051,
18,
20313,
1368,
326,
3352,
225,
1930,
1140,
16,
2589,
1930,
2907,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
16273,
12,
1065,
2183,
16,
9780,
16,
1544,
2218,
71,
1077,
1051,
18,
20313,
11,
4672,
468,
4444,
276,
1077,
1051,
18,
20313,
1368,
326,
3352,
225,
1930,
1140,
16,
2589,
1930,
2907,... |
for e in self.incoming_edges(labels = False): p.add_constraint(vertex_used[v] - edge_used[e], min = 0) for e in self.outgoing_edges(labels = False): p.add_constraint(vertex_used[v] - edge_used[e], min = 0) | for e in self.incoming_edges(labels=False): p.add_constraint(vertex_used[v] - edge_used[e], min=0) for e in self.outgoing_edges(labels=False): p.add_constraint(vertex_used[v] - edge_used[e], min=0) | def longest_path(self, s = None, t = None, weighted = False, algorithm = "MILP", solver = None, verbose = 0): r""" Returns a longest path of ``self``. | 815c98d316de2356ea416011f877811bcf39fae3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/815c98d316de2356ea416011f877811bcf39fae3/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... |
value = lltype.top_container(value) | if value is not lltype.top_container(value): return | def consider_constant(self, TYPE, value): value = lltype.top_container(value) | 6f933a1403d8ea294e47939a151f6269f0efc5ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/6f933a1403d8ea294e47939a151f6269f0efc5ce/gctransform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5260,
67,
14384,
12,
2890,
16,
3463,
16,
460,
4672,
460,
273,
6579,
723,
18,
3669,
67,
3782,
12,
1132,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5260,
67,
14384,
12,
2890,
16,
3463,
16,
460,
4672,
460,
273,
6579,
723,
18,
3669,
67,
3782,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
res = self._checkAdminPermission() | res = self._checkAdminPermission(credDict) | def addGroup(self,groupName,credDict): res = self._checkAdminPermission() if not res['OK']: return res if not res['Value']: return S_ERROR("Permission denied") return self.ugManager.addGroup(userName) | 1fab4af2a2efe3dcf87ee8515cc87998ad9cf2f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/1fab4af2a2efe3dcf87ee8515cc87998ad9cf2f6/FileCatalogDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18899,
12,
2890,
16,
1655,
461,
16,
20610,
5014,
4672,
400,
273,
365,
6315,
1893,
4446,
5041,
12,
20610,
5014,
13,
309,
486,
400,
3292,
3141,
3546,
30,
327,
400,
309,
486,
400,
3292,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18899,
12,
2890,
16,
1655,
461,
16,
20610,
5014,
4672,
400,
273,
365,
6315,
1893,
4446,
5041,
12,
20610,
5014,
13,
309,
486,
400,
3292,
3141,
3546,
30,
327,
400,
309,
486,
400,
3292,
6... |
cline = cline + " -QUICKTREE" | cline = cline + " -quicktree" | def __str__(self): """Write out the command line as a string.""" cline = self.command + " " + self.sequence_file | 240af8bbe31789b31d07273beaedf257c01edcd9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/240af8bbe31789b31d07273beaedf257c01edcd9/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
3536,
3067,
596,
326,
1296,
980,
487,
279,
533,
12123,
927,
558,
273,
365,
18,
3076,
397,
315,
315,
397,
365,
18,
6178,
67,
768,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
3536,
3067,
596,
326,
1296,
980,
487,
279,
533,
12123,
927,
558,
273,
365,
18,
3076,
397,
315,
315,
397,
365,
18,
6178,
67,
768,
2,
-100,
-100,
-100,
... |
print 'py' | def vq(obs,code_book): """ Vector Quantization: assign features sets to codes in a code book. Description: Vector quantization determines which code in the code book best represents an observation of a target. The features of each observation are compared to each code in the book, and assigned the one closest to it. The observations are contained in the obs array. These features should be "whitened," or nomalized by the standard deviation of all the features before being quantized. The code book can be created using the kmeans algorithm or something similar. Note: This currently forces 32 bit math precision for speed. Anyone know of a situation where this undermines the accuracy of the algorithm? Arguments: obs -- 2D array. Each row of the array is an observation. The columns are the "features" seen during each observation The features must be whitened first using the whiten function or something equivalent. code_book -- 2D array. The code book is usually generated using the kmeans algorithm. Each row of the array holds a different code, and the columns are the features of the code. # c0 c1 c2 c3 code_book = [[ 1., 2., 3., 4.], #f0 [ 1., 2., 3., 4.], #f1 [ 1., 2., 3., 4.]]) #f2 Outputs: code -- 1D array. If obs is a NxM array, then a length M array is returned that holds the selected code book index for each observation. dist -- 1D array. The distortion (distance) between the observation and its nearest code Reference Test >>> code_book = array([[1.,1.,1.], ... [2.,2.,2.]]) >>> features = array([[ 1.9,2.3,1.7], ... [ 1.5,2.5,2.2], ... [ 0.8,0.6,1.7]]) >>> vq(features,code_book) (array([1, 1, 0],'i'), array([ 0.43588989, 0.73484692, 0.83066239])) """ try: import _vq from scipy.misc import _common_type ct = _common_type(obs,code_book) c_obs = obs.astype(ct) c_code_book = code_book.astype(ct) if ct == 'f': results = _vq.float_vq(c_obs,c_code_book) elif ct == 'd': results = _vq.double_vq(c_obs,c_code_book) else: results = py_vq(obs,code_book) except ImportError: print 'py' results = py_vq(obs,code_book) return results | 66282068cbd84edcddaa490e8207299a4f99045a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/66282068cbd84edcddaa490e8207299a4f99045a/vq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
85,
12,
10992,
16,
710,
67,
3618,
4672,
3536,
5589,
4783,
970,
1588,
30,
2683,
4467,
1678,
358,
6198,
316,
279,
981,
6978,
18,
225,
6507,
30,
5589,
10251,
1588,
12949,
1492,
981,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
85,
12,
10992,
16,
710,
67,
3618,
4672,
3536,
5589,
4783,
970,
1588,
30,
2683,
4467,
1678,
358,
6198,
316,
279,
981,
6978,
18,
225,
6507,
30,
5589,
10251,
1588,
12949,
1492,
981,
... | |
try: if (os.path.exists(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"))): os.rename(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"), os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache-backup")) except: pass | global DCACHE_BACKED_UP if not DCACHE_BACKED_UP: try: if (os.path.exists(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"))): os.rename(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"), os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache-backup")) except: pass DCACHE_BACKED_UP = True | def SaveDependencyCache(): try: if (os.path.exists(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"))): os.rename(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"), os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache-backup")) except: pass try: icache = open(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"),'wb') except: icache = 0 if (icache!=0): print "Storing dependency cache." cPickle.dump(CXXINCLUDECACHE, icache, 1) cPickle.dump(BUILTFROMCACHE, icache, 1) icache.close() | 704bcc4932bd978cd3b0a66ec679f8531235471d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/704bcc4932bd978cd3b0a66ec679f8531235471d/makepandacore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7074,
7787,
1649,
13332,
2552,
463,
8495,
67,
8720,
2056,
67,
3079,
309,
486,
463,
8495,
67,
8720,
2056,
67,
3079,
30,
775,
30,
309,
261,
538,
18,
803,
18,
1808,
12,
538,
18,
803,
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,
7074,
7787,
1649,
13332,
2552,
463,
8495,
67,
8720,
2056,
67,
3079,
309,
486,
463,
8495,
67,
8720,
2056,
67,
3079,
30,
775,
30,
309,
261,
538,
18,
803,
18,
1808,
12,
538,
18,
803,
18... |
print "We don't have enough builds to bisect. revlist: %s" % revlist | print 'We don\'t have enough builds to bisect. revlist: %s' % revlist | def main(): usage = ('%prog [options] [-- chromium-options]\n' 'Perform binary search on the snapshot builds.') parser = optparse.OptionParser(usage=usage) # Strangely, the default help output doesn't include the choice list. choices = ['mac', 'xp', 'linux', 'linux-64'] parser.add_option('-a', '--archive', choices = choices, help = 'The buildbot archive to bisect [%s].' % '|'.join(choices)) parser.add_option('-b', '--bad', type = 'int', help = 'The bad revision to bisect to.') parser.add_option('-g', '--good', type = 'int', help = 'The last known good revision to bisect from.') parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', help = 'Profile to use; this will not reset every run. ' + 'Defaults to a clean profile.') (opts, args) = parser.parse_args() if opts.archive is None: parser.print_help() return 1 if opts.bad and opts.good and (opts.good > opts.bad): print ('The good revision (%d) must precede the bad revision (%d).\n' % (opts.good, opts.bad)) parser.print_help() return 1 SetArchiveVars(opts.archive) # Pick a starting point, try to get HEAD for this. if opts.bad: bad_rev = opts.bad else: bad_rev = 0 try: # Location of the latest build revision number BUILD_LATEST_URL = "%s/LATEST" % (BUILD_BASE_URL) nh = urllib.urlopen(BUILD_LATEST_URL) latest = int(nh.read()) nh.close() bad_rev = raw_input("Bad revision [HEAD:%d]: " % latest) if (bad_rev == ""): bad_rev = latest bad_rev = int(bad_rev) except Exception, e: print("Could not determine latest revision. This could be bad...") bad_rev = int(raw_input("Bad revision: ")) # Find out when we were good. if opts.good: good_rev = opts.good else: good_rev = 0 try: good_rev = int(raw_input("Last known good [0]: ")) except Exception, e: pass # Get a list of revisions to bisect across. revlist = GetRevList(good_rev, bad_rev) if len(revlist) < 2: # Don't have enough builds to bisect print "We don't have enough builds to bisect. revlist: %s" % revlist sys.exit(1) # If we don't have a |good_rev|, set it to be the first revision possible. if good_rev == 0: good_rev = revlist[0] # These are indexes of |revlist|. good = 0 bad = len(revlist) - 1 last_known_good_rev = revlist[good] # Binary search time! while good < bad: candidates = revlist[good:bad] num_poss = len(candidates) if num_poss > 10: print("%d candidates. %d tries left." % (num_poss, round(math.log(num_poss, 2)))) else: print("Candidates: %s" % revlist[good:bad]) # Cut the problem in half... test = int((bad - good) / 2) + good test_rev = revlist[test] # Let the user give this rev a spin (in her own profile, if she wants). profile = opts.profile if not profile: profile = 'profile' # In a temp dir. TryRevision(test_rev, profile, args) if AskIsGoodBuild(test_rev): last_known_good_rev = revlist[good] good = test + 1 else: bad = test # We're done. Let the user know the results in an official manner. print("You are probably looking for build %d." % revlist[bad]) print("CHANGELOG URL:") print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) print("Built at revision:") print(BUILD_VIEWVC_URL % revlist[bad]) | bd8dcb92e8921af7f33bb5d675d9439c018cc819 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/bd8dcb92e8921af7f33bb5d675d9439c018cc819/build-bisect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
4084,
273,
7707,
9,
14654,
306,
2116,
65,
306,
413,
8123,
5077,
17,
2116,
13944,
82,
11,
296,
4990,
3112,
1623,
603,
326,
4439,
10736,
1093,
13,
2082,
273,
2153,
2670,
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,
2774,
13332,
4084,
273,
7707,
9,
14654,
306,
2116,
65,
306,
413,
8123,
5077,
17,
2116,
13944,
82,
11,
296,
4990,
3112,
1623,
603,
326,
4439,
10736,
1093,
13,
2082,
273,
2153,
2670,
18,
... |
'discount' : fields.float('Discount'), | 'discount' : fields.float('Discount (%)'), | def action_done(self, cr, uid, ids,group=True,type='out_refund', context=None): # need to make perfect checking # remaining to check sale condition # need Improvement invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') tax_obj=self.pool.get('account.invoice.tax') partner_obj = self.pool.get('res.partner') res = {} for campaign in self.browse(cr, uid, ids): invoices_group = {} invoices_line_group={} res[campaign.id]=[] cr.execute(""" SELECT invoice.id from account_invoice invoice left join res_partner partner on invoice.partner_id=partner.id where partner.discount_campaign=%d and (invoice.date_invoice BETWEEN %s AND %s) AND invoice.type = 'out_invoice' AND state = 'open' """ , (campaign.id,campaign.date_start,campaign.date_stop,)) invoice_ids = map(lambda x:x[0],cr.fetchall()) | 49ba78affef4aa09d339c2c0860b36f6171a6f1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/49ba78affef4aa09d339c2c0860b36f6171a6f1f/discount_campaign.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
8734,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1655,
33,
5510,
16,
723,
2218,
659,
67,
1734,
1074,
2187,
819,
33,
7036,
4672,
468,
1608,
358,
1221,
24746,
6728,
468,
4463,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
8734,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1655,
33,
5510,
16,
723,
2218,
659,
67,
1734,
1074,
2187,
819,
33,
7036,
4672,
468,
1608,
358,
1221,
24746,
6728,
468,
4463,... |
buff=self.find_buffer(None,None) if buff: return buff | conv=self.find_conversation(None,None) if conv: return conv | def find_or_make(self,user,thread): bset=self.settings["buffer"] if bset=="separate": pass elif bset=="per-thread": buff=self.find_buffer(user,thread) if buff: return buff elif bset=="per-user": buff=self.find_buffer(user,None) if buff: return buff thread=None else: buff=self.find_buffer(None,None) if buff: return buff thread=None user=None buff=Conversation(self,user,thread) if user: key=user.bare().as_unicode() else: key=user if not self.buffers.has_key(key): self.buffers[key]=[buff] else: self.buffers[key].append(buff) if self.settings.get("auto_popup"): cjc_globals.screen.display_buffer(buff.buffer) return buff | 2ed38e70a33bd2df44c8386053a4e6083705130d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12768/2ed38e70a33bd2df44c8386053a4e6083705130d/message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
280,
67,
6540,
12,
2890,
16,
1355,
16,
5930,
4672,
324,
542,
33,
2890,
18,
4272,
9614,
4106,
11929,
309,
324,
542,
31713,
16627,
340,
6877,
1342,
1327,
324,
542,
31713,
457,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
280,
67,
6540,
12,
2890,
16,
1355,
16,
5930,
4672,
324,
542,
33,
2890,
18,
4272,
9614,
4106,
11929,
309,
324,
542,
31713,
16627,
340,
6877,
1342,
1327,
324,
542,
31713,
457,
... |
reflist = self.document.refnames[target['id']] | reflist = self.document.refids.get(target['id'], []) | def nonexistent_indirect_target(self, target): naming = '' if target.hasattr('name'): naming = '"%s" ' % target['name'] reflist = self.document.refnames[target['name']] else: reflist = self.document.refnames[target['id']] naming += '(id="%s")' % target['id'] msg = self.document.reporter.warning( 'Indirect hyperlink target %s refers to target "%s", ' 'which does not exist.' % (naming, target['refname'])) self.document.messages += msg msgid = self.document.set_id(msg) for ref in reflist: prb = nodes.problematic( ref.rawsource, ref.rawsource, refid=msgid) prbid = self.document.set_id(prb) msg.add_backref(prbid) ref.parent.replace(ref, prb) target.resolved = 1 | 3c5273b786e701d5f489cee0c160606f66a95dec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/3c5273b786e701d5f489cee0c160606f66a95dec/references.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1661,
19041,
67,
728,
867,
67,
3299,
12,
2890,
16,
1018,
4672,
14634,
273,
875,
309,
1018,
18,
5332,
1747,
2668,
529,
11,
4672,
14634,
273,
22563,
87,
6,
296,
738,
1018,
3292,
529,
354... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1661,
19041,
67,
728,
867,
67,
3299,
12,
2890,
16,
1018,
4672,
14634,
273,
875,
309,
1018,
18,
5332,
1747,
2668,
529,
11,
4672,
14634,
273,
22563,
87,
6,
296,
738,
1018,
3292,
529,
354... |
testData.setFrameMode(self, 1) | testData.setFrameMode(1) | def processOneImage(self, imNum): """Process one image to (Qx, Qy, Qz, I) modes of frames are: theta- (1), phi- (2), cartesian- (3) and hkl-frame (4)""" | 0ac0ccb3ff3f7c2a5554b84199874f3c9dfab4e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8436/0ac0ccb3ff3f7c2a5554b84199874f3c9dfab4e1/transformations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
3335,
2040,
12,
2890,
16,
709,
2578,
4672,
3536,
2227,
1245,
1316,
358,
261,
53,
92,
16,
2238,
93,
16,
2238,
94,
16,
467,
13,
12382,
434,
7793,
854,
30,
7338,
17,
261,
21,
3631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
3335,
2040,
12,
2890,
16,
709,
2578,
4672,
3536,
2227,
1245,
1316,
358,
261,
53,
92,
16,
2238,
93,
16,
2238,
94,
16,
467,
13,
12382,
434,
7793,
854,
30,
7338,
17,
261,
21,
3631... |
setStyle(self.pStyle, cel) setText(i, cel) | self.applyTextToFrame(i, cel) | def createHeader(self, monthName): """ Draw calendar header. Month name and days of the week """ header = createText(self.marginl, self.calHeight, self.width, self.rowSize) setText(monthName, header) colCnt = 0 for i in self.dayOrder: cel = createText(self.marginl + colCnt * self.colSize, self.calHeight + self.rowSize, self.colSize, self.rowSize) setStyle(self.pStyle, cel) setText(i, cel) colCnt += 1 | 65dce40946c1279b11de5770a1c36f312663cb8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3910/65dce40946c1279b11de5770a1c36f312663cb8b/CalendarWizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
1864,
12,
2890,
16,
3138,
461,
4672,
3536,
10184,
5686,
1446,
18,
10337,
508,
471,
4681,
434,
326,
4860,
3536,
1446,
273,
752,
1528,
12,
2890,
18,
10107,
80,
16,
365,
18,
771,
268... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
1864,
12,
2890,
16,
3138,
461,
4672,
3536,
10184,
5686,
1446,
18,
10337,
508,
471,
4681,
434,
326,
4860,
3536,
1446,
273,
752,
1528,
12,
2890,
18,
10107,
80,
16,
365,
18,
771,
268... |
fileo = traced_call(None,"open",open,args,kwargs) | fileo = traced_call(None,"openfile",openfile,args,kwargs) | def wrapped_open(*args,**kwargs): # Trace the call to get the file object fileo = traced_call(None,"open",open,args,kwargs) # Return the wrapped object return FileObj(fileo) | d4d3bf92076e2369dc442814f3f33a0ac55f20cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7279/d4d3bf92076e2369dc442814f3f33a0ac55f20cd/strace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5805,
67,
3190,
30857,
1968,
16,
636,
4333,
4672,
468,
2677,
326,
745,
358,
336,
326,
585,
733,
585,
83,
273,
2606,
72,
67,
1991,
12,
7036,
10837,
3190,
768,
3113,
3190,
768,
16,
1968,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5805,
67,
3190,
30857,
1968,
16,
636,
4333,
4672,
468,
2677,
326,
745,
358,
336,
326,
585,
733,
585,
83,
273,
2606,
72,
67,
1991,
12,
7036,
10837,
3190,
768,
3113,
3190,
768,
16,
1968,... |
newtext += '\n[[%s]]' % paginetta | newtext += '\n[[%s]]' % paginetta.encode(site.encoding()) except UnicodeEncodeError: try: newtext += '\n[[%s]]' % paginetta.encode('utf-8') except UnicodeEncodeError: newtext += '\n[[%s]]' % paginetta.encode(site.encoding()) | def add_text(page = None, addText = None, summary = None, regexSkip = None, regexSkipUrl = None, always = False, up = False, putText = True, oldTextGiven = None): if not addText: raise NoEnoughData('You have to specify what text you want to add!') if not summary: summary = wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg) % addText) # When a page is tagged as "really well written" it has a star in the interwiki links. # This is a list of all the templates used (in regex format) to make the stars appear. starsList = ['link[ _]fa', 'link[ _]adq', 'enllaç[ _]ad', 'link[ _]ua', 'legătură[ _]af', 'destacado', 'ua', 'liên k[ _]t[ _]chọn[ _]lọc'] errorCount = 0 site = wikipedia.getSite() # /wiki/ is not always the right path in non-wiki projects pathWiki = site.family.nicepath(site.lang) if putText: wikipedia.output(u'Loading %s...' % page.title()) if oldTextGiven == None: try: text = page.get() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist, skip!" % page.title()) return False # continue except wikipedia.IsRedirectPage: wikipedia.output(u"%s is a redirect, skip!" % page.title()) return False # continue else: text = oldTextGiven # Understand if the bot has to skip the page or not # In this way you can use both -except and -excepturl if regexSkipUrl != None: url = '%s%s' % (pathWiki, page.urlname()) result = re.findall(regexSkipUrl, site.getUrl(url)) if result != []: wikipedia.output(u'Exception! regex (or word) used with -exceptUrl is in the page. Skip!') return False # continue if regexSkip != None: result = re.findall(regexSkip, text) if result != []: wikipedia.output(u'Exception! regex (or word) used with -except is in the page. Skip!') return False # continue # If not up, text put below if not up: newtext = text categoryNamespace = site.namespace(14) # Getting the categories regexpCat = re.compile(r'\[\[((?:category|%s):.*?)\]\]' % categoryNamespace.lower(), re.I) categorieInside = regexpCat.findall(text) # Deleting the categories newtext = wikipedia.removeCategoryLinks(newtext, site) # Getting the interwiki interwikiInside = page.interwiki() interwikiList = list() for paginetta in interwikiInside: nome = str(paginetta).split('[[')[1].split(']]')[0] interwikiList.append(nome) lang = nome.split(':')[0] # Removing the interwiki newtext = wikipedia.removeLanguageLinks(newtext, site) # Sorting the interwiki interwikiList.sort() newtext += "\n%s" % addText # Reputting the categories for paginetta in categorieInside: try: newtext += '\n[[%s]]' % paginetta.decode('utf-8') except UnicodeDecodeError: try: newtext += '\n[[%s]]' % paginetta.decode('Latin-1') except UnicodeDecodeError: newtext += '\n[[%s]]' % paginetta newtext += '\n' # Dealing the stars' issue starsListInPage = list() for star in starsList: regex = re.compile('(\{\{(?:template:|)%s\|.*?\}\}\n)' % star, re.I) risultato = regex.findall(newtext) if risultato != []: newtext = regex.sub('', newtext) for element in risultato: newtext += '\n%s' % element # Adding the interwiki for paginetta in interwikiList: try: newtext += '\n[[%s]]' % paginetta.decode('utf-8') except UnicodeDecodeError: try: newtext += '\n[[%s]]' % paginetta.decode('Latin-1') except UnicodeDecodeError: newtext += '\n[[%s]]' % paginetta # If instead the text must be added above... else: newtext = addText + '\n' + text if putText: wikipedia.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title()) wikipedia.showDiff(text, newtext) choice = '' # Let's put the changes. while 1: # If someone load it as module, maybe it's not so useful to put the text in the page if putText: if not always: choice = wikipedia.inputChoice(u'Do you want to accept these changes?', ['Yes', 'No', 'All'], ['y', 'N', 'a'], 'N') if choice.lower() in ['a', 'all']: always = True if choice.lower() in ['n', 'no']: return False if choice.lower() in ['y', 'yes'] or always: try: page.put(newtext, summary) except wikipedia.EditConflict: wikipedia.output(u'Edit conflict! skip!') return False except wikipedia.ServerError: errorCount += 1 if errorCount < 5: wikipedia.output(u'Server Error! Wait..') time.sleep(3) continue else: raise wikipedia.ServerError(u'Fifth Server Error!') except wikipedia.SpamfilterError, e: wikipedia.output(u'Cannot change %s because of blacklist entry %s' % (page.title(), e.url)) return False except wikipedia.PageNotSaved, error: wikipedia.output(u'Error putting page: %s' % error.args) return False except wikipedia.LockedPage: wikipedia.output(u'Skipping %s (locked page)' % page.title()) return False else: # Break only if the errors are one after the other... errorCount = 0 return True else: return (text, newtext) | 2dc5b5885dbfd71db74a77dff20c5056f8caf092 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/2dc5b5885dbfd71db74a77dff20c5056f8caf092/add_text.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
955,
12,
2433,
273,
599,
16,
25796,
273,
599,
16,
4916,
273,
599,
16,
3936,
6368,
273,
599,
16,
3936,
6368,
1489,
273,
599,
16,
3712,
273,
1083,
16,
731,
273,
1083,
16,
1378... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
955,
12,
2433,
273,
599,
16,
25796,
273,
599,
16,
4916,
273,
599,
16,
3936,
6368,
273,
599,
16,
3936,
6368,
1489,
273,
599,
16,
3712,
273,
1083,
16,
731,
273,
1083,
16,
1378... |
'old_value_text': self.get_value_text(cr,uid,field,old_values[res_id][field],model_object) | 'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object) | def log_fct(self, db, uid, passwd, object, method, fct_src, *args): logged_uids = [] pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() obj=pool.get(object) object_name=obj._name obj_ids= pool.get('ir.model').search(cr, uid,[('model','=',object_name)]) model_object=pool.get('ir.model').browse(cr,uid,obj_ids)[0] if method in ('create'): res_id = fct_src( db, uid, passwd, object, method, *args) cr.commit() new_value=pool.get(model_object.model).read(cr,uid,[res_id],args[0].keys())[0] if 'id' in new_value: del new_value['id'] if not len(logged_uids) or uid in logged_uids: resource_name = pool.get(model_object.model).name_get(cr,uid,[res_id]) resource_name = resource_name and resource_name[0][1] or '' id=pool.get('audittrail.log').create(cr, uid, {"method": method , "object_id": model_object.id, "user_id": uid, "res_id": res_id, "name": resource_name}) lines=[] for field in new_value: if new_value[field]: line={ 'name':field, 'new_value':new_value[field], 'new_value_text': self.get_value_text(cr,uid,field,new_value[field],model_object) } lines.append(line) self.create_log_line(cr,uid,id,model_object,lines) cr.commit() cr.close() return res_id | d8781cd0f2eee29372e5a54862aa63c732ae3150 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/d8781cd0f2eee29372e5a54862aa63c732ae3150/audittrail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
67,
74,
299,
12,
2890,
16,
1319,
16,
4555,
16,
19093,
16,
733,
16,
707,
16,
28478,
67,
4816,
16,
380,
1968,
4672,
7545,
67,
21428,
273,
5378,
2845,
273,
2845,
264,
18,
588,
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,
613,
67,
74,
299,
12,
2890,
16,
1319,
16,
4555,
16,
19093,
16,
733,
16,
707,
16,
28478,
67,
4816,
16,
380,
1968,
4672,
7545,
67,
21428,
273,
5378,
2845,
273,
2845,
264,
18,
588,
67,
... |
line = main_table.readline() | if table.header_rows > 0: for i in range(table.header_rows): line = main_table.readline() | def create_table(db, table): """Creates a database based on settings supplied in dbinfo object""" warnings.filterwarnings("ignore") # Connect to the database if db.engine == "postgresql": object = "SCHEMA" else: object = "DATABASE" if db.drop: db.cursor.execute(drop_statement(db.engine, object, db.dbname)) db.cursor.execute("CREATE " + object + " " + db.dbname) else: db.cursor.execute("CREATE " + object + " IF NOT EXISTS " + db.dbname) # Create the table if table.drop: db.cursor.execute(drop_statement(db.engine, "TABLE", db.dbname + "." + table.tablename)) createstatement = "CREATE TABLE " + db.dbname + "." + table.tablename + "(" else: createstatement = "CREATE TABLE IF NOT EXISTS " + db.dbname + "." + table.tablename + "(" for item in table.columns: if (item[1][0] != "skip") and (item[1][0] != "combine"): createstatement += item[0] + " " + convert_data_type(db.engine, item[1]) + ", " if table.pk and db.engine == "mysql": createstatement += "PRIMARY KEY (" + table.pk + ")" else: createstatement = createstatement.rstrip(', ') createstatement += ")" print "Creating table " + table.tablename + " in database " + db.dbname + " . . ." db.cursor.execute(createstatement) main_table = urllib.urlopen(table.sourceurl) # Skip over the header line by reading it before processing line = main_table.readline() print "Inserting rows: " species_id = 0 for line in main_table: line = line.strip() if line: # If there is a primary key specified, add an auto-incrementing integer if table.pk: species_id += 1 linevalues = [species_id] column = 0 else: linevalues = [] column = -1 for value in line.split(table.delimiter): column += 1 thiscolumn = table.columns[column][1][0] # If data type is "skip" ignore the value if thiscolumn == "skip": pass elif thiscolumn == "combine": # If "combine" append value to end of previous column linevalues[len(linevalues) - 1] += " " + value else: # Otherwise, add new value linevalues.append(value) # Build insert statement with the correct # of values insertstatement = "INSERT INTO " + db.dbname + "." + table.tablename + " VALUES (" for value in linevalues: insertstatement += "%s, " insertstatement = insertstatement.rstrip(", ") + ");" sys.stdout.write(str(species_id) + "\b" * len(str(species_id))) db.cursor.execute(insertstatement, # Run correct_invalid_value on each value before insertion [datacleanup.correct_invalid_value(value) for value in linevalues]) print "\n Done!" main_table.close() | e15b3d784aae599e7e54ad9e03980478efa38dde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12606/e15b3d784aae599e7e54ad9e03980478efa38dde/dbtk_tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2121,
12,
1966,
16,
1014,
4672,
3536,
2729,
279,
2063,
2511,
603,
1947,
4580,
316,
1319,
1376,
733,
8395,
5599,
18,
2188,
12103,
2932,
6185,
7923,
225,
468,
8289,
358,
326,
2063... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2121,
12,
1966,
16,
1014,
4672,
3536,
2729,
279,
2063,
2511,
603,
1947,
4580,
316,
1319,
1376,
733,
8395,
5599,
18,
2188,
12103,
2932,
6185,
7923,
225,
468,
8289,
358,
326,
2063... |
Subgroup of Abelian group on 4 generators (a, b, c, d) with invariants [1008, 2003, 3001, 4001] | Subgroup of AbelianGroup( 4, [1008, 2003, 3001, 4001]) | def __init__(self, ambient, gens, names="f"): """ EXAMPLES: sage: F = AbelianGroup(5,[30,64,729],names = list("abcde")) sage: a,b,c,d,e = F.gens() sage: F.subgroup([a^3,b]) AbelianGroup( 2, [0, 0]) sage: F.subgroup([c]) AbelianGroup( 3, [2, 3, 5]) sage: F.subgroup([a,c]) AbelianGroup( 4, [0, 2, 3, 5]) sage: F.subgroup([a,b*c]) AbelianGroup( 2, [0, 0]) sage: F.subgroup([b*c,d]) AbelianGroup( 2, [0, 64]) sage: F.subgroup([a*b,c^6,d],names = list("xyz")) AbelianGroup( 3, [0, 5, 64]) sage: G = F.subgroup([a*b,c^6,d],names = list("xyz")) sage: G AbelianGroup( 3, [0, 5, 64]) sage: print G Subgroup of Abelian group on 5 generators (a, b, c, d, e) with invariants [0, 0, 30, 64, 729] generated by [a*b, c^6, d] with elementary divisors [0, 5, 64] sage: x,y,z = G.gens() sage: x.order() Infinity sage: y.order() 5 sage: z.order() 64 sage: A = AbelianGroup(5,[3, 5, 5, 7, 8], names = "abcde") sage: a,b,c,d,e = A.gens() sage: A.subgroup([a,b]) AbelianGroup( 2, [3, 5]) sage: A.subgroup([a,b,c,d^2,e]) AbelianGroup( 5, [3, 5, 5, 7, 8]) sage: A.subgroup([a,b,c,d^2,e^2]) AbelianGroup( 5, [3, 4, 5, 5, 7]) sage: B = A.subgroup([a^3,b,c,d,e^2]); B AbelianGroup( 4, [4, 5, 5, 7]) sage: B.invariants() [4, 5, 5, 7] sage: A = AbelianGroup(4,[1009, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B.invariants() [1009, 2003, 3001, 4001] sage: A.order() 24266473210027 sage: B.order() 24266473210027 sage: A = AbelianGroup(4,[1008, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B AbelianGroup( 6, [3, 7, 16, 2003, 3001, 4001]) sage: print B Subgroup of Abelian group on 4 generators (a, b, c, d) with invariants [1008, 2003, 3001, 4001] generated by [a^3, b, c, d] with elementary divisors [3, 7, 16, 2003, 3001, 4001] Infinite groups can also be handled: sage: G = AbelianGroup([3,4,0], names = "abc") sage: a,b,c = G.gens() sage: F = G.subgroup([a,b^2,c]); F AbelianGroup( 3, [0, 3, 4]) sage: F.invariants() [0, 3, 4] sage: F.gens() [a, b^2, c] sage: F.order() Infinity | 474e9cd21e5543c10385340d5e9747ad7d0f1773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/474e9cd21e5543c10385340d5e9747ad7d0f1773/abelian_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2779,
1114,
12,
25,
16,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2779,
1114,
12,
25,
16,
63... |
month = win32SystemTime[ 1 ] | month = win32SystemTime[1] | def _LocateDay( self, year, win32SystemTime ): """ Takes a SYSTEMTIME structure as retrieved from a TIME_ZONE_INFORMATION structure and interprets it based on the given year to identify the actual day. | c68039a3f4004e3fe46621e4c6512fd2401398fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/677/c68039a3f4004e3fe46621e4c6512fd2401398fc/win32timezone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1333,
340,
4245,
12,
365,
16,
3286,
16,
5657,
1578,
3163,
950,
262,
30,
3536,
23004,
279,
18786,
4684,
3695,
487,
10295,
628,
279,
8721,
67,
20725,
67,
706,
23805,
3695,
471,
10634,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1333,
340,
4245,
12,
365,
16,
3286,
16,
5657,
1578,
3163,
950,
262,
30,
3536,
23004,
279,
18786,
4684,
3695,
487,
10295,
628,
279,
8721,
67,
20725,
67,
706,
23805,
3695,
471,
10634,... |
def spawnChild(monitor, process): | def spawnChild(monitor, process, args=''): | def spawnChild(monitor, process): """Returns an xmlrpclib.Server, a connection to an xml-rpc server, and the input and error streams. """ # Start ChildProcessServerStart.py in a new process. script_fn = os.path.join(os.path.dirname(__file__), 'ChildProcessServerStart.py') os.environ['PYTHONPATH'] = string.join(sys.path, os.pathsep) cmd = '%s "%s"' % (sys.executable, script_fn) try: pid = wx.wxExecute(cmd, 0, process) line = '' if monitor.isAlive(): istream = process.GetInputStream() estream = process.GetErrorStream() err = '' # read in the port and auth hash while monitor.isAlive() and string.find(line, '\n') < 0: # don't take more time than the process we wait for ;) time.sleep(0.00001) if not istream.eof(): line = line + istream.read(1) # test for tracebacks on stderr if not estream.eof(): err = estream.read() errlines = string.split(err, '\n') while not string.strip(errlines[-1]): del errlines[-1] exctype, excvalue = string.split(errlines[-1], ':') while errlines and errlines[-1][:7] != ' File ': del errlines[-1] if errlines: errfile = ' (%s)' % string.strip(errlines[-1]) else: errfile = '' raise __builtins__[string.strip(exctype)], ( string.strip(excvalue)+errfile) if not KEEP_STREAMS_OPEN: process.CloseOutput() if monitor.isAlive(): line = string.strip(line) if not line: raise RuntimeError, ( 'The debug server address could not be read') port, auth = string.split(string.strip(line)) if USE_TCPWATCH: # Start TCPWatch as a connection forwarder. from thread import start_new_thread def run_tcpwatch(port): os.system("tcpwatch -L9100:%d" % int(port)) start_new_thread(run_tcpwatch, (port,)) time.sleep(1) port = 9100 trans = TransportWithAuth(auth) server = xmlrpclib.Server( 'http://127.0.0.1:%d' % int(port), trans) return server, istream, estream, pid else: raise RuntimeError, 'The debug server failed to start' except: if monitor.isAlive(): process.CloseOutput() monitor.kill() raise | 1281f8194c9b2b594d12796ee61cfbb25525fa3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/1281f8194c9b2b594d12796ee61cfbb25525fa3a/ChildProcessClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
1763,
12,
10259,
16,
1207,
16,
833,
2218,
11,
4672,
3536,
1356,
392,
2025,
13832,
830,
495,
18,
2081,
16,
279,
1459,
358,
392,
2025,
17,
7452,
1438,
16,
471,
326,
810,
471,
555,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
1763,
12,
10259,
16,
1207,
16,
833,
2218,
11,
4672,
3536,
1356,
392,
2025,
13832,
830,
495,
18,
2081,
16,
279,
1459,
358,
392,
2025,
17,
7452,
1438,
16,
471,
326,
810,
471,
555,... |
print>>posefile, ",{" + t[0:t.find(",")] + "," + t[t.find(",")+1:] + "}", | print>>posefile, ",{" + t[0:t.find("|")] + "," + t[t.find("|")+1:] + "}", | print>>posefile, "#ifndef " + self.name.upper() + "_POSES" | 26e076ebcceafc434412e68876132ee13cfc8a7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9859/26e076ebcceafc434412e68876132ee13cfc8a7d/project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1172,
9778,
4150,
768,
16,
6619,
430,
82,
536,
315,
397,
365,
18,
529,
18,
5797,
1435,
397,
4192,
23757,
55,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1172,
9778,
4150,
768,
16,
6619,
430,
82,
536,
315,
397,
365,
18,
529,
18,
5797,
1435,
397,
4192,
23757,
55,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
del lwtparser | uniq_def = (row[ifos_col],row[name_col],row[vers_col]) | 15d95b3c8cf259e9d26119cf55dce8ab26dfffde /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/15d95b3c8cf259e9d26119cf55dce8ab26dfffde/LDBDServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
10748,
67,
536,
273,
261,
492,
63,
430,
538,
67,
1293,
6487,
492,
63,
529,
67,
1293,
6487,
492,
63,
2496,
67,
1293,
5717,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
10748,
67,
536,
273,
261,
492,
63,
430,
538,
67,
1293,
6487,
492,
63,
529,
67,
1293,
6487,
492,
63,
2496,
67,
1293,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
fp = file(fname, 'w') | fp = file(fname, 'wb') | def write_rej(self): # our rejects are a little different from patch(1). This always # creates rejects in the same form as the original patch. A file # header is inserted so that you can run the reject through patch again # without having to type the filename. | e7af8babfd61c408dec564c925298cef5367a3cf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/e7af8babfd61c408dec564c925298cef5367a3cf/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
266,
78,
12,
2890,
4672,
468,
3134,
4925,
87,
854,
279,
12720,
3775,
628,
4729,
12,
21,
2934,
225,
1220,
3712,
468,
3414,
4925,
87,
316,
326,
1967,
646,
487,
326,
2282,
4729,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
266,
78,
12,
2890,
4672,
468,
3134,
4925,
87,
854,
279,
12720,
3775,
628,
4729,
12,
21,
2934,
225,
1220,
3712,
468,
3414,
4925,
87,
316,
326,
1967,
646,
487,
326,
2282,
4729,... |
self._auto_scroll_save_width = 0 | self._auto_scroll_save_width = width | def __init__(self, interval=200): """Don't forget to call this mixin's init method in your List. | 6bc6bef6fcfe26aa923224e536d4db13def8c29a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/6bc6bef6fcfe26aa923224e536d4db13def8c29a/dropscroller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3673,
33,
6976,
4672,
3536,
22293,
1404,
13776,
358,
745,
333,
11682,
1807,
1208,
707,
316,
3433,
987,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3673,
33,
6976,
4672,
3536,
22293,
1404,
13776,
358,
745,
333,
11682,
1807,
1208,
707,
316,
3433,
987,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
find_table_of_contents(r, edition) | find_toc(r, edition) | def parser(file_locator, input, bad_data): for r in MARC21BiblioFile (input): edition = { 'source_record_loc': encode_record_locator (r, file_locator) } try: curr_loc = edition['source_record_loc'][0] if len(r.get_fields('001')) > 1: continue find_title(r, edition) if not "title" in edition: continue find_other_titles(r, edition) find_work_title(r, edition) find_toc(r, edition) find_authors(r, edition) find_contributions(r, edition) find_edition(r, edition) find_publisher(r, edition) find_pagination(r, edition) find_subjects(r, edition) find_subject_place(r, edition) find_subject_time(r, edition) find_genre(r, edition) find_series(r, edition) find_description(r, edition) find_table_of_contents(r, edition) find_dewey_number(r, edition) find_lc_classification(r, edition) find_isbn(r, edition) find_oclc(r, edition) find_lccn(r, edition) find_url(r, edition) if len(r.get_fields('008')) > 1: continue f = r.get_field('008') edition["publish_date"] = str(f)[7:11] edition["publish_country"] = str(f)[15:18] edition["languages"] = ["ISO:" + str(f)[35:38]] yield edition except KeyboardInterrupt: raise except: bad_data(edition['source_record_loc']) | 0169069e6a6560a0f1f9c29af034f3cda64a1ca7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3913/0169069e6a6560a0f1f9c29af034f3cda64a1ca7/parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2082,
12,
768,
67,
20048,
16,
810,
16,
5570,
67,
892,
4672,
364,
436,
316,
490,
27206,
5340,
38,
495,
549,
83,
812,
261,
2630,
4672,
28432,
273,
288,
296,
3168,
67,
3366,
67,
1829,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2082,
12,
768,
67,
20048,
16,
810,
16,
5570,
67,
892,
4672,
364,
436,
316,
490,
27206,
5340,
38,
495,
549,
83,
812,
261,
2630,
4672,
28432,
273,
288,
296,
3168,
67,
3366,
67,
1829,
4... |
USE_CTYPES_GETPROCESSTIMES = 'cytpes GetProcessTimes() wrapper' | USE_CTYPES_GETPROCESSTIMES = 'ctypes GetProcessTimes() wrapper' | def systimes(): | 160b3650f60736e58c9434bcf56deaffc4dde7e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/160b3650f60736e58c9434bcf56deaffc4dde7e1/systimes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
1094,
4485,
13332,
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,
0,
0,
... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
1094,
4485,
13332,
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,
-100,
... |
def _write( self, sBuffer ): self.oSocket.send( sBuffer ) | def getSocket( self ): return self.oSocket | 50d268528280aca31b058f38e04a52a71af67957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50d268528280aca31b058f38e04a52a71af67957/BaseTransport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28673,
12,
365,
262,
30,
327,
365,
18,
83,
4534,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28673,
12,
365,
262,
30,
327,
365,
18,
83,
4534,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
self.DC.DrawText(month, (adjust, self.cy_st + th)) | DC.DrawText(month, (adjust, self.cy_st + th)) | def DrawMonth(self): month = Month[self.month] | b25cb7db43121f1f6899b7ebfcd6ccc3806dd0f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/b25cb7db43121f1f6899b7ebfcd6ccc3806dd0f6/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
5445,
12,
2890,
4672,
3138,
273,
10337,
63,
2890,
18,
7496,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
5445,
12,
2890,
4672,
3138,
273,
10337,
63,
2890,
18,
7496,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
class pAdicGeneralExtensionRingLazy(pAdicGeneralExtensionGeneric, pAdicLazyRingGeneric): def __init__(self, upoly, epoly, poly, prec, halt, print_mode, names): pAdicGeneralExtensionGeneric.__init__(self, upoly, epoly, poly, prec, print_mode, names, pAdicGeneralExtensionLazyElement) pAdicLazyRingGeneric.__init__(self, upoly.base_ring().prime(), prec, print_mode, names, halt) class pAdicGeneralExtensionFieldLazy(pAdicGeneralExtensionGeneric, pAdicLazyFieldGeneric): def __init__(self, upoly, epoly, poly, prec, halt, print_mode, names): pAdicGeneralExtensionGeneric.__init__(self, upoly, epoly, poly, prec, print_mode, names, pAdicGeneralExtensionLazyElement) pAdicLazyFieldGeneric.__init__(self, upoly.base_ring().prime(), prec, print_mode, names, halt) class pAdicGeneralExtensionRingCappedAbsolute(pAdicGeneralExtensionGeneric, pAdicCappedAbsoluteRingGeneric): def __init__(self, upoly, epoly, poly, prec, halt, print_mode, names): pAdicGeneralExtensionGeneric.__init__(self, upoly, epoly, poly, prec, print_mode, names, pAdicGeneralExtensionAbsoluteElement) class pAdicGeneralExtensionRingFixedMod(pAdicGeneralExtensionGeneric, pAdicFixedModRingGeneric): def __init__(self, upoly, epoly, poly, prec, halt, print_mode, names): pAdicGeneralExtensionGeneric.__init__(self, upoly, epoly, poly, prec, print_mode, names, pAdicGeneralExtensionAbsoluteElement) | def __init__(self, upoly, epoly, poly, prec, halt, print_mode, names): pAdicGeneralExtensionGeneric.__init__(self, upoly, epoly, poly, prec, print_mode, names, pAdicGeneralExtensionCappedRelativeElement) | ba045ed1184b908554216b56093b975bd5ff14cc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/ba045ed1184b908554216b56093b975bd5ff14cc/padic_extension_leaves.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
731,
355,
93,
16,
425,
16353,
16,
7573,
16,
13382,
16,
18389,
16,
1172,
67,
3188,
16,
1257,
4672,
293,
1871,
335,
12580,
3625,
7014,
16186,
2738,
972,
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,
1001,
2738,
972,
12,
2890,
16,
731,
355,
93,
16,
425,
16353,
16,
7573,
16,
13382,
16,
18389,
16,
1172,
67,
3188,
16,
1257,
4672,
293,
1871,
335,
12580,
3625,
7014,
16186,
2738,
972,
12... | |
vif_properties = \ map(server.xenapi.VIF.get_runtime_properties, vif_refs) | vif_properties = [] for vif_ref in vif_refs: vif_property = server.xenapi.VIF.get_runtime_properties(vif_ref) vif_property['mac'] = server.xenapi.VIF.get_MAC(vif_ref) vif_properties.append(vif_property) | def xm_network_list(args): (use_long, params) = arg_check_for_resource_list(args, "network-list") dom = params[0] if serverType == SERVER_XEN_API: vif_refs = server.xenapi.VM.get_VIFs(get_single_vm(dom)) vif_properties = \ map(server.xenapi.VIF.get_runtime_properties, vif_refs) devs = map(lambda (handle, properties): [handle, map2sxp(properties)], zip(range(len(vif_properties)), vif_properties)) else: devs = server.xend.domain.getDeviceSxprs(dom, 'vif') if use_long: map(PrettyPrint.prettyprint, devs) else: hdr = 0 for x in devs: if hdr == 0: print 'Idx BE MAC Addr. handle state evt-ch tx-/rx-ring-ref BE-path' hdr = 1 ni = parse_dev_info(x[1]) ni['idx'] = int(x[0]) print ("%(idx)-3d " "%(backend-id)-3d" "%(mac)-17s " "%(handle)-3d " "%(state)-3d " "%(event-ch)-3d " "%(tx-ring-ref)-5d/%(rx-ring-ref)-5d " "%(be-path)-30s " % ni) | 15330bd542341a884267a3d49040758f9f060be9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6195/15330bd542341a884267a3d49040758f9f060be9/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25179,
67,
5185,
67,
1098,
12,
1968,
4672,
261,
1202,
67,
5748,
16,
859,
13,
273,
1501,
67,
1893,
67,
1884,
67,
3146,
67,
1098,
12,
1968,
16,
315,
5185,
17,
1098,
7923,
225,
4092,
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,
25179,
67,
5185,
67,
1098,
12,
1968,
4672,
261,
1202,
67,
5748,
16,
859,
13,
273,
1501,
67,
1893,
67,
1884,
67,
3146,
67,
1098,
12,
1968,
16,
315,
5185,
17,
1098,
7923,
225,
4092,
27... |
'from': fields.float('From', digits=(16, int(config['price_accuracy']))), 'to': fields.float('To', digits=(16, int(config['price_accuracy']))), | 'from_val': fields.float('From', digits=(16, int(config['price_accuracy']))), 'to_val': fields.float('To', digits=(16, int(config['price_accuracy']))), | def execute_function(self, cr, uid, id, value, context): line_pool = self.pool.get('hr.payslip.line.line') res = 0 ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('to','>=',value),('from','<=',value)]) if not ids: ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('from','<=',value)]) if not ids: res = 0 else: res = line_pool.browse(cr, uid, ids)[0].value return res | 910b18c43259dc8e764886a06d9de5289ea8c60b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/910b18c43259dc8e764886a06d9de5289ea8c60b/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
915,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
460,
16,
819,
4672,
980,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
84,
8271,
3169,
18,
1369,
18,
1369,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
915,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
460,
16,
819,
4672,
980,
67,
6011,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
84,
8271,
3169,
18,
1369,
18,
1369,
6134,
... |
output.extend(self.outgoing_edge_iterator(vertices1,labels=labels)) | def edge_boundary(self, vertices1, vertices2=None, labels=True): """ Returns a list of edges `(u,v,l)` with `u` in ``vertices1`` and `v` in ``vertices2``. If ``vertices2`` is ``None``, then it is set to the complement of ``vertices1``. | 7b9afb3b66d010e574487a319d86af01cd22bcc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7b9afb3b66d010e574487a319d86af01cd22bcc7/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
16604,
12,
2890,
16,
6928,
21,
16,
6928,
22,
33,
7036,
16,
3249,
33,
5510,
4672,
3536,
2860,
279,
666,
434,
5231,
1375,
12,
89,
16,
90,
16,
80,
22025,
598,
1375,
89,
68,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
16604,
12,
2890,
16,
6928,
21,
16,
6928,
22,
33,
7036,
16,
3249,
33,
5510,
4672,
3536,
2860,
279,
666,
434,
5231,
1375,
12,
89,
16,
90,
16,
80,
22025,
598,
1375,
89,
68,
... | |
('(%s)' % '|'.join( re.escape(entry) + ' ' for entry in keywords), | ('(%s)' % '|'.join([ re.escape(entry) + ' ' for entry in keywords]), | def get_tokens_unprocessed(self, text): for index, token, value in \ RegexLexer.get_tokens_unprocessed(self, text): if token is Name: if value in self._functions: yield index, Name.Function, value continue elif '.' in value: a, b = value.split('.') yield index, Name, a yield index + len(a), Text, u'.' yield index + len(a) + 1, Name, b continue yield index, token, value | 8a3942b9e8f3763a12fdbc39f52a55e6e3c3fe8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2885/8a3942b9e8f3763a12fdbc39f52a55e6e3c3fe8c/agile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
364,
770,
16,
1147,
16,
460,
316,
521,
15078,
13356,
18,
588,
67,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
309,
1147,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
364,
770,
16,
1147,
16,
460,
316,
521,
15078,
13356,
18,
588,
67,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
309,
1147,
35... |
SystemDrive = os.environ.get("SystemDrive", "") if os.environ.get("OS") == "Windows_NT": HostIsNT = True else: HostIsNT = False | def SetupEnvironment(): SystemDrive = os.environ.get("SystemDrive", "") if os.environ.get("OS") == "Windows_NT": HostIsNT = True else: HostIsNT = False SystemDrive = os.environ.get("SYSTEMDRIVE") if SystemDrive: SystemDrive += os.path.sep # Do this earlier so that its link isn't a problem. # Looking in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2 # would be reasonable here. if CM3IsCygwin: _SetupEnvironmentVariableAll( "PATH", ["cygwin1.dll"], os.path.join(SystemDrive, "cygwin", "bin")) # some host/target confusion here.. if Target == "NT386" and HostIsNT and Config == "NT386" and (not GCC_BACKEND) and TargetOS == "WIN32": VCBin = "" VCInc = "" VCLib = "" MspdbDir = "" # 4.0 e:\MSDEV # 5.0 E:\Program Files\DevStudio\SharedIDE MSDevDir = os.environ.get("MSDEVDIR") # 5.0 MSVCDir = os.environ.get("MSVCDIR") # E:\Program Files\DevStudio\VC # 7.1 Express VCToolkitInstallDir = os.environ.get("VCTOOLKITINSTALLDIR") # E:\Program Files\Microsoft Visual C++ Toolkit 2003 (not set by vcvars32) # 8.0 Express # E:\Program Files\Microsoft Visual Studio 8\VC # E:\Program Files\Microsoft Visual Studio 8\Common7\Tools DevEnvDir = os.environ.get("DevEnvDir") # E:\Program Files\Microsoft Visual Studio 8\Common7\IDE VSInstallDir = os.environ.get("VSINSTALLDIR") # E:\Program Files\Microsoft Visual Studio 8 # VS80CommonTools = os.environ.get("VS80COMNTOOLS") # E:\Program Files\Microsoft Visual Studio 8\Common7\Tools VCInstallDir = os.environ.get("VCINSTALLDIR") # E:\Program Files\Microsoft Visual Studio 8\VC # 9.0 Express # always, global #VS90COMNTOOLS=D:\msdev\90\Common7\Tools\ # after running the shortcut #VCINSTALLDIR=D:\msdev\90\VC #VSINSTALLDIR=D:\msdev\90 VSCommonTools = os.environ.get("VS90COMNTOOLS") if VSCommonTools and not VSInstallDir: VSInstallDir = RemoveLastPathElement(RemoveLastPathElement(VSCommonTools)) # The Windows SDK is carried with the express edition and tricky to find. # Best if folks just run the installed shortcut probably. # We do a pretty good job now of finding it, be need to encode # more paths to known versions. # This is not yet finished. # # Probe the partly version-specific less-polluting environment variables, # from newest to oldest. # That is, having setup alter PATH, INCLUDE, and LIB system-wide is not # a great idea, but having setup set DevEnvDir, VSINSTALLDIR, VS80COMNTOOLS, etc. # isn't so bad and we can temporarily establish the first set from the second # set. if VSInstallDir: # Visual C++ 2005/8.0, at least the Express Edition, free download # also Visual C++ 2008/9.0 Express Edition if not VCInstallDir: VCInstallDir = os.path.join(VSInstallDir, "VC") #print("VCInstallDir:" + VCInstallDir) if not DevEnvDir: DevEnvDir = os.path.join(VSInstallDir, "Common7", "IDE") #print("DevEnvDir:" + DevEnvDir) MspdbDir = DevEnvDir elif VCToolkitInstallDir: # free download Visual C++ 2003; no longer available VCInstallDir = VCToolkitInstallDir elif MSVCDir and MSDevDir: # Visual C++ 5.0 pass # do more research # VCInstallDir = MSVCDir elif MSDevDir: # Visual C++ 4.0, 5.0 pass # do more research # VCInstallDir = MSDevDir else: # This is what really happens on my machine, for 8.0. # It might be good to guide pylib.py to other versions, # however setting things up manually suffices and I have, um, # well automated. Msdev = os.path.join(SystemDrive, "msdev", "80") VCInstallDir = os.path.join(Msdev, "VC") DevEnvDir = os.path.join(Msdev, "Common7", "IDE") if VCInstallDir: VCBin = os.path.join(VCInstallDir, "bin") VCLib = os.path.join(VCInstallDir, "lib") VCInc = os.path.join(VCInstallDir, "include") if DevEnvDir: MspdbDir = DevEnvDir #elif VCBin: # MspdbDir = VCBin # Look for SDKs. # expand this as they are released/discovered # ordering is from newest to oldest PossibleSDKs = [os.path.join("Microsoft SDKs", "Windows", "v6.0A"), "Microsoft Platform SDK for Windows Server 2003 R2"] SDKs = [] for a in GetProgramFiles(): #print("checking " + a) for b in PossibleSDKs: c = os.path.join(a, b) #print("checking " + c) if isdir(c) and not (c in SDKs): SDKs.append(c) # Make sure %INCLUDE% contains errno.h and windows.h. # This doesn't work correctly for Cygwin Python, ok. if _CheckSetupEnvironmentVariableAll("INCLUDE", ["errno.h", "windows.h"], VCInc): for a in SDKs: b = os.path.join(a, "include") if isfile(os.path.join(b, "windows.h")): _SetupEnvironmentVariableAll("INCLUDE", ["errno.h", "windows.h"], VCInc + ";" + b, ";") break # Make sure %LIB% contains kernel32.lib and libcmt.lib. # We carry our own kernel32.lib so we don't look in the SDKs. # We usually use msvcrt.lib and not libcmt.lib, but Express 2003 had libcmt.lib and not msvcrt.lib # I think, and libcmt.lib is always present. _SetupEnvironmentVariableAll( "LIB", ["kernel32.lib", "libcmt.lib"], VCLib + ";" + os.path.join(InstallRoot, "lib")) # Check that cl.exe and link.exe are in path, and if not, add VCBin to it, # checking that they are in it. # # Do this before mspdb*dll because it sometimes gets it in the path. # (Why do we care?) _SetupEnvironmentVariableAll("PATH", ["cl", "link"], VCBin) # If none of mspdb*.dll are in PATH, add MpsdbDir to PATH, and check that one of them is in it. _SetupEnvironmentVariableAny( "PATH", ["mspdb80.dll", "mspdb71.dll", "mspdb70.dll", "mspdb60.dll", "mspdb50.dll", "mspdb41.dll", "mspdb40.dll", "dbi.dll"], MspdbDir) # Try to get mt.exe in %PATH% if it isn't already. # We only need this for certain toolsets. if not SearchPath("mt.exe", os.environ.get("PATH")): for a in SDKs: b = os.path.join(a, "bin") if isfile(os.path.join(b, "mt.exe")): SetEnvironmentVariable("PATH", os.environ.get("PATH") + os.pathsep + b) break # sys.exit(1) # The free Visual C++ 2003 has neither delayimp.lib nor msvcrt.lib. # Very old toolsets have no delayimp.lib. # The Quake config file checks these environment variables. Lib = os.environ.get("LIB") if not SearchPath("delayimp.lib", Lib): os.environ["USE_DELAYLOAD"] = "0" print("set USE_DELAYLOAD=0") if not SearchPath("msvcrt.lib", Lib): os.environ["USE_MSVCRT"] = "0" print("set USE_MSVCRT=0") # some host/target confusion here.. if Target == "NT386MINGNU" or (Target == "NT386" and GCC_BACKEND and TargetOS == "WIN32"): _ClearEnvironmentVariable("LIB") _ClearEnvironmentVariable("INCLUDE") _SetupEnvironmentVariableAll( "PATH", ["gcc", "as", "ld"], os.path.join(SystemDrive, "mingw", "bin")) # need to probe for ld that accepts response files. # For example, this version does not: # C:\dev2\cm3\scripts\python>ld -v # GNU ld version 2.15.91 20040904 # This comes with Qt I think (free Windows version) # # This version works: # C:\dev2\cm3\scripts\python>ld -v # GNU ld version 2.17.50 20060824 # Ensure msys make is ahead of mingwin make, by adding # msys to the start of the path after adding mingw to the # start of the path. Modula-3 does not generally use # make, but this might matter when building m3cg, and # is usually the right thing. _SetupEnvironmentVariableAll( "PATH", ["sh", "sed", "gawk", "make"], os.path.join(SystemDrive, "msys", "1.0", "bin")) # some host/target confusion here.. if Host == "NT386GNU" or (Host == "NT386" and GCC_BACKEND and TargetOS == "POSIX"): #_ClearEnvironmentVariable("LIB") #_ClearEnvironmentVariable("INCLUDE") #if HostIsNT: # _SetupEnvironmentVariableAll( # "PATH", # ["cygX11-6.dll"], # os.path.join(SystemDrive, "cygwin", "usr", "X11R6", "bin")) _SetupEnvironmentVariableAll( "PATH", ["gcc", "as", "ld"], os.path.join(SystemDrive, "cygwin", "bin")) | 14e6facff06b2fc91279af79db1d8f8435565022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9328/14e6facff06b2fc91279af79db1d8f8435565022/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10939,
5494,
13332,
2332,
24681,
273,
1140,
18,
28684,
18,
588,
2932,
14318,
40,
2259,
3412,
7923,
309,
2332,
24681,
30,
2332,
24681,
1011,
1140,
18,
803,
18,
10814,
225,
468,
2256,
333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10939,
5494,
13332,
2332,
24681,
273,
1140,
18,
28684,
18,
588,
2932,
14318,
40,
2259,
3412,
7923,
309,
2332,
24681,
30,
2332,
24681,
1011,
1140,
18,
803,
18,
10814,
225,
468,
2256,
333,
... | |
os.rename(agentFile['tempFile'], agentFile['name']) | shutil.move(agentFile['tempFile'], agentFile['name']) | def downloadFile(agentFile, recursed = False): mainLogger.debug('Update: downloading ' + agentFile['name']) print 'Downloading ' + agentFile['name'] downloadedFile = urllib.urlretrieve('http://www.serverdensity.com/downloads/sd-agent/' + agentFile['name']) # Do md5 check to make sure the file downloaded properly checksum = md5.new() f = file(downloadedFile[0], 'rb') # Although the files are small, we can't guarantee the available memory nor that there # won't be large files in the future, so read the file in small parts (1kb at time) while True: part = f.read(1024) if not part: break # end of file checksum.update(part) f.close() # Do we have a match? if checksum.hexdigest() == agentFile['md5']: return downloadedFile[0] else: # Try once more if recursed == False: downloadFile(agentFile, True) else: print agentFile['name'] + ' did not match its checksum - it is corrupted. This may be caused by network issues so please try again in a moment.' sys.exit(2) | 0770c3ee1ff7e53eaa7dd315bb760be6b5198847 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13266/0770c3ee1ff7e53eaa7dd315bb760be6b5198847/agent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
812,
12,
5629,
812,
16,
8112,
730,
273,
1083,
4672,
2774,
3328,
18,
4148,
2668,
1891,
30,
23742,
296,
397,
4040,
812,
3292,
529,
19486,
1172,
296,
27217,
296,
397,
4040,
812,
3292,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
812,
12,
5629,
812,
16,
8112,
730,
273,
1083,
4672,
2774,
3328,
18,
4148,
2668,
1891,
30,
23742,
296,
397,
4040,
812,
3292,
529,
19486,
1172,
296,
27217,
296,
397,
4040,
812,
3292,... |
dot = rfind(".") | dot = version.rfind(".") | def load(self): | 8ca9b0124f4dce0b5dc277a9e8c0b56e4bc51987 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/8ca9b0124f4dce0b5dc277a9e8c0b56e4bc51987/synthesis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
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,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1262,
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,
-100,
-100,
-100,
-100,
-100,
-... |
gHelpFolder = 'Help' | # TODO : selection "Object-Method" and choosing alt + j will open the class def file for THAT method | 834d09fc9dfde3f24de1676683d68b32b2d08451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11200/834d09fc9dfde3f24de1676683d68b32b2d08451/Psycollider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
2660,
294,
4421,
315,
921,
17,
1305,
6,
471,
24784,
310,
3770,
397,
525,
903,
1696,
326,
667,
1652,
585,
364,
7662,
789,
707,
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,
468,
2660,
294,
4421,
315,
921,
17,
1305,
6,
471,
24784,
310,
3770,
397,
525,
903,
1696,
326,
667,
1652,
585,
364,
7662,
789,
707,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
App_ns.root.Remove() | App_ns.root.Remove({'testing' : True}) | def publishSubscribe(logger): """ A function to publish and subscribe a collection. """ # action # Webdav Account Setting ap = UITestAccounts(logger) ap.Open() # first, open the accounts dialog window ap.CreateAccount("WebDAV") ap.TypeValue("displayName", uw("Publish Test WebDAV")) ap.TypeValue("host", "osaf.us") ap.TypeValue("path", "cosmo/home/demo1") ap.TypeValue("username", "demo1") ap.TypeValue("password", "ad3leib5") ap.TypeValue("port", "443") ap.ToggleValue("ssl", True) ap.ToggleValue("default", True) ap.Ok() # verification ap.VerifyValues("WebDAV", uw("Publish Test WebDAV"), displayName = uw("Publish Test WebDAV"), host = "osaf.us", username = "demo1", password="ad3leib5", port=443) # import events so test will have something to share even when run by itself path = os.path.join(os.getenv('CHANDLERHOME'),"tools/QATestScripts/DataFiles") # Upcast path to unicode since Sharing requires a unicode path path = unicode(path, 'utf8') share = sharing.OneTimeFileSystemShare(path, u'testSharing.ics', sharing.ICalendarFormat, itsView=App_ns.itsView) collection = share.get() App_ns.sidebarCollection.add(collection) scripting.User.idle() # Collection selection sidebar = App_ns.sidebar scripting.User.emulate_sidebarClick(sidebar, "testSharing") # Sharing dialog collection = Block.findBlockByName("MainView").getSidebarSelectedCollection() if collection is not None: publishName = "TestSharing_%s" % str(collection.itsUUID) win = ShowPublishDialog(wx.GetApp().mainFrame, view=App_ns.itsView, collection=collection, modal=False, name=publishName) #Share button call app = wx.GetApp() # We are interested in seeing how quickly we can upload the collection logger.Start('Publish') win.PublishCollection() while not win.done: app.Yield() logger.Stop() if not win.success: logger.ReportFailure("(On publish collection)") win.OnCancel(None) # Close the window which should be showing a failure return # Get a read-write ticket to the published collection # XXX This is ripped from PublishCollection if win.publishType == 'freebusy': share = sharing.getFreeBusyShare(win.collection) else: share = sharing.getShare(win.collection) urls = sharing.getUrls(share) if len(urls) == 1: urlString = urls[0] elif win.publishType == 'freebusy': urlString = urls[1] else: urlString = urls[0] # read-write #Done button call win.OnPublishDone(None) app.Yield() # Unsubscribe and delete the (local) collection we just published so # that we can subscribe to it below. sharing.unsubscribe(collection) # Two clicks are required to select the collection (this is the second) scripting.User.emulate_sidebarClick(sidebar, "testSharing") App_ns.root.Remove() scripting.User.idle() # Subscribe to the remote collection, forcing the subscribed name to # be "testSharing" because it was given a random name when published above. win = SubscribeCollection.Show(wx.GetApp().mainFrame, view=App_ns.itsView, modal=False, name="testSharing") url = win.toolPanel.GetChildren()[1] url.SetFocus() url.Clear() # Need to have this or first letter of URL is not # typed into control on Linux scripting.User.idle() scripting.User.emulate_typing(urlString) # We are interested in seeing how quickly we can download the collection logger.Start('Subscribe') win.OnSubscribe(None) try: while win.subscribing: app.Yield() except wx.PyDeadObjectError: # XXX The C++ part of the dialog was gone, so we are no longer # XXX supposed to touch any attributes of the dialog. In our # XXX case this is safe, so just ignore. This seems to be needed # XXX on Linux only. pass logger.Stop() scripting.User.idle() # verification if scripting.User.emulate_sidebarClick(App_ns.sidebar, "testSharing"): # We need to click twice to move the focus to the sidebar scripting.User.emulate_sidebarClick(App_ns.sidebar, "testSharing") # cleanup # cosmo can only handle so many shared calendars # so remove this one when done collection = sidebarCollectionNamed('testSharing') sharing.unpublish(collection) App_ns.root.Remove() logger.ReportPass("(On Subscribe collection)") else: logger.ReportFailure("(On Subscribe collection)") logger.SetChecked(True) | 51369d7c7b84bc7021791fb6f50ae1b3d0c05b88 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/51369d7c7b84bc7021791fb6f50ae1b3d0c05b88/QAUITestAppLib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3808,
16352,
12,
4901,
4672,
3536,
432,
445,
358,
3808,
471,
9129,
279,
1849,
18,
3536,
468,
1301,
468,
2999,
20752,
6590,
13274,
513,
273,
587,
1285,
395,
13971,
12,
4901,
13,
513,
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,
3808,
16352,
12,
4901,
4672,
3536,
432,
445,
358,
3808,
471,
9129,
279,
1849,
18,
3536,
468,
1301,
468,
2999,
20752,
6590,
13274,
513,
273,
587,
1285,
395,
13971,
12,
4901,
13,
513,
18,
... |
self.book.default = self.translate(link) | self.book.default = self.translate_link(link) | def start_book(self, name, title, link, base = None, **dummy): assert len(self.contents_stack) == 1 | c60623948fcebfbbb0546f8b9ac9efe3612d792c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/c60623948fcebfbbb0546f8b9ac9efe3612d792c/DevHelp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
3618,
12,
2890,
16,
508,
16,
2077,
16,
1692,
16,
1026,
273,
599,
16,
2826,
21050,
4672,
1815,
562,
12,
2890,
18,
3980,
67,
3772,
13,
422,
404,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
3618,
12,
2890,
16,
508,
16,
2077,
16,
1692,
16,
1026,
273,
599,
16,
2826,
21050,
4672,
1815,
562,
12,
2890,
18,
3980,
67,
3772,
13,
422,
404,
2,
-100,
-100,
-100,
-100,
-10... |
this = apply(_quickfix.new_LegSettlmntTyp, args) | this = _quickfix.new_LegSettlmntTyp(*args) | def __init__(self, *args): this = apply(_quickfix.new_LegSettlmntTyp, 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,
8329,
694,
6172,
21818,
18488,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
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,
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,
8329,
694,
6172,
21818,
18488,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,... |
buf.append(" Service class: %s" % service.service_class.values[0]) | buf.append(" Service class: %s" % service.service_class.value) | def display_service(service, pidf, buf): # display class if service.rpid_class is not None: buf.append(" Class: %s" % person.rpid_class) # display timestamp if service.timestamp is not None: buf.append(" Timestamp: %s" % service.timestamp) # display notes for note in service.notes: buf.append(" %s" % format_note(note)) # display status if service.status is not None and service.status.basic is not None: buf.append(" Status: %s" % service.status.basic) # display contact if service.contact is not None: buf.append(" Contact%s: %s" % ((service.contact.priority is not None) and (' priority %s' % service.contact.priority) or '', service.contact)) # display device ID if service.device_id is not None: buf.append(" Service offered by device id: %s" % service.device_id) # display relationship if service.relationship is not None: buf.append(" Relationship: %s" % service.relationship.values[0]) # display service-class if service.service_class is not None: buf.append(" Service class: %s" % service.service_class.values[0]) # display status icon if service.status_icon is not None: buf.append(" Status icon: %s" % service.status_icon) # display user input if service.user_input is not None: buf.append(" Service is %s" % service.user_input) if service.user_input.last_input: buf.append(" Last input at: %s" % service.user_input.last_input) if service.user_input.idle_threshold: buf.append(" Idle threshold: %s seconds" % service.user_input.idle_threshold) | 435361a2660131f917ffc693c6c45ce987a954dd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5703/435361a2660131f917ffc693c6c45ce987a954dd/sip_subscribe_presence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
3278,
12,
3278,
16,
4231,
74,
16,
1681,
4672,
468,
2562,
667,
309,
1156,
18,
86,
6610,
67,
1106,
353,
486,
599,
30,
1681,
18,
6923,
2932,
565,
1659,
30,
738,
87,
6,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
3278,
12,
3278,
16,
4231,
74,
16,
1681,
4672,
468,
2562,
667,
309,
1156,
18,
86,
6610,
67,
1106,
353,
486,
599,
30,
1681,
18,
6923,
2932,
565,
1659,
30,
738,
87,
6,
738,
... |
return int(resp[3:].strip()) | s = resp[3:].strip() try: return int(s) except OverflowError: return long(s) | def size(self, filename): '''Retrieve the size of a file.''' # Note that the RFC doesn't say anything about 'SIZE' resp = self.sendcmd('SIZE ' + filename) if resp[:3] == '213': return int(resp[3:].strip()) | b6aca6afe2c46b57810c0f3e726e6dae5336d324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6aca6afe2c46b57810c0f3e726e6dae5336d324/ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
963,
12,
2890,
16,
1544,
4672,
9163,
5767,
326,
963,
434,
279,
585,
1093,
6309,
468,
3609,
716,
326,
8372,
3302,
1404,
12532,
6967,
2973,
296,
4574,
11,
1718,
273,
365,
18,
4661,
4172,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
963,
12,
2890,
16,
1544,
4672,
9163,
5767,
326,
963,
434,
279,
585,
1093,
6309,
468,
3609,
716,
326,
8372,
3302,
1404,
12532,
6967,
2973,
296,
4574,
11,
1718,
273,
365,
18,
4661,
4172,
... |
db = HyperDatabase.HyperDatabase(dir) | db = HyperDatabase.HyperDatabase(dir, maillist) | def __init__(self, maillist): # can't init the database while other processes are writing to it! # XXX TODO- implement native locking # with mailman's LockFile module for HyperDatabase.HyperDatabase # dir = maillist.archive_dir() db = HyperDatabase.HyperDatabase(dir) self.__super_init(dir, reload=1, database=db) | ee571157641bb7ff0c8a14b908d79597627f5370 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/ee571157641bb7ff0c8a14b908d79597627f5370/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4791,
1098,
4672,
468,
848,
1404,
1208,
326,
2063,
1323,
1308,
8488,
854,
7410,
358,
518,
5,
468,
11329,
2660,
17,
2348,
6448,
18887,
468,
598,
4791,
4728,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4791,
1098,
4672,
468,
848,
1404,
1208,
326,
2063,
1323,
1308,
8488,
854,
7410,
358,
518,
5,
468,
11329,
2660,
17,
2348,
6448,
18887,
468,
598,
4791,
4728,... |
verbosity, gather_info) | verbosity, (gather_print, regroup, namespace)) | def ttyloop(task, nodeset, gather, timeout, label, verbosity, (gather_print, regroup, namespace)): """Manage the interactive prompt to run command""" readline_avail = False if task.default("USER_interactive"): assert sys.stdin.isatty() try: import readline readline_setup() readline_avail = True except ImportError: pass if verbosity >= VERB_STD: print "Enter 'quit' to leave this interactive mode" rc = 0 ns = NodeSet(nodeset) ns_info = True cmd = "" while task.default("USER_running") or cmd.lower() != 'quit': try: if task.default("USER_interactive") and not task.default("USER_running"): if ns_info: print "Working with nodes: %s" % ns ns_info = False prompt = "clush> " else: prompt = "" cmd = raw_input(prompt) except EOFError: print return except UpdatePromptException: if task.default("USER_interactive"): continue return except KeyboardInterrupt, e: signal.signal(signal.SIGUSR1, signal.SIG_IGN) if gather: # Suspend task, so we can safely access its data from # the main thread task.suspend() print_warn = False # Display command output, but cannot order buffers by rc nodesetify = lambda v: (v[0], NodeSet.fromlist(v[1])) for buf, nodeset in sorted(map(nodesetify, task.iter_buffers()), cmp=bufnodeset_cmp): if not print_warn: print_warn = True print >> sys.stderr, "Warning: Caught keyboard interrupt!" gather_print(nodeset, buf, regroup, namespace) # Return code handling ns_ok = NodeSet() for rc, nodelist in task.iter_retcodes(): ns_ok.add(NodeSet.fromlist(nodelist)) if rc != 0: # Display return code if not ok ( != 0) ns = NodeSet.fromlist(nodelist) print >> sys.stderr, \ "clush: %s: exited with exit code %s" % (ns, rc) # Add uncompleted nodeset to exception object e.uncompleted_nodes = ns - ns_ok # Display nodes that didn't answer within command timeout delay if task.num_timeout() > 0: print >> sys.stderr, "clush: %s: command timeout" % \ NodeSet.fromlist(task.iter_keys_timeout()) raise e if task.default("USER_running"): ns_reg, ns_unreg = NodeSet(), NodeSet() for c in task._engine.clients(): if c.registered: ns_reg.add(c.key) else: ns_unreg.add(c.key) if ns_unreg: pending = "\nclush: pending(%d): %s" % (len(ns_unreg), ns_unreg) else: pending = "" print >> sys.stderr, "clush: interrupt (^C to abort task)\n" \ "clush: in progress(%d): %s%s" % (len(ns_reg), ns_reg, pending) else: cmdl = cmd.lower() try: ns_info = True if cmdl.startswith('+'): ns.update(cmdl[1:]) elif cmdl.startswith('-'): ns.difference_update(cmdl[1:]) elif cmdl.startswith('@'): ns = NodeSet(cmdl[1:]) elif cmdl == '=': gather = not gather if verbosity >= VERB_STD: if gather: print "Switching to gathered output format" else: print "Switching to standard output format" ns_info = False continue elif not cmdl.startswith('?'): # if ?, just print ns_info ns_info = False except NodeSetParseError: print >> sys.stderr, "clush: nodeset parse error (ignoring)" if ns_info: continue if cmdl.startswith('!') and len(cmd.strip()) > 0: run_command(task, cmd[1:], None, gather, timeout, None, verbosity, gather_info) elif cmdl != "quit": if not cmd: continue if readline_avail: readline.write_history_file(get_history_file()) run_command(task, cmd, ns, gather, timeout, label, verbosity, gather_info) return rc | fa12d716e7b14fc16a9a3fa9f83fcdeb49d96806 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11479/fa12d716e7b14fc16a9a3fa9f83fcdeb49d96806/clush.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21520,
6498,
12,
4146,
16,
2199,
278,
16,
11090,
16,
2021,
16,
1433,
16,
11561,
16,
261,
75,
4806,
67,
1188,
16,
960,
656,
16,
1981,
3719,
30,
3536,
21258,
326,
12625,
6866,
358,
1086,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21520,
6498,
12,
4146,
16,
2199,
278,
16,
11090,
16,
2021,
16,
1433,
16,
11561,
16,
261,
75,
4806,
67,
1188,
16,
960,
656,
16,
1981,
3719,
30,
3536,
21258,
326,
12625,
6866,
358,
1086,... |
col.text = txt | col.text = tools.ustr(txt or '') | def _append_node(name, text): n = etree.Element(name) n.text = text config.append(n) | 84482c22551657727590b165ce10a485cba19e5e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/84482c22551657727590b165ce10a485cba19e5e/ps_list.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
12031,
18,
1046,
12,
529,
13,
290,
18,
955,
273,
977,
642,
18,
6923,
12,
82,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
12031,
18,
1046,
12,
529,
13,
290,
18,
955,
273,
977,
642,
18,
6923,
12,
82,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def process_sql_file(cr, file): | def process_sql_file(cr, fp): | def process_sql_file(cr, file): queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query) | 037067881ebfb0350b227ecf326237e7586cd885 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/037067881ebfb0350b227ecf326237e7586cd885/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
4669,
67,
768,
12,
3353,
16,
4253,
4672,
6218,
273,
4253,
18,
896,
7675,
4939,
2668,
4359,
13,
364,
843,
316,
6218,
30,
394,
67,
2271,
273,
296,
2418,
5701,
12,
2271,
18,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
4669,
67,
768,
12,
3353,
16,
4253,
4672,
6218,
273,
4253,
18,
896,
7675,
4939,
2668,
4359,
13,
364,
843,
316,
6218,
30,
394,
67,
2271,
273,
296,
2418,
5701,
12,
2271,
18,
4... |
print "Fallback succeeded" | def callPrimitiveAndPush(self, primitive, selector, argcount, interp): try: print "Pushing result" self.push(primitives.prim_table[primitive](self)) print "Pushed result" except primitives.PrimitiveFailedError: print "Falling back to smalltalk version" self._sendSelfSelector(selector, argcount, interp) print "Fallback succeeded" | 1adbd8118e74e31856b14248f8917ad10e12f25a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/1adbd8118e74e31856b14248f8917ad10e12f25a/interpreter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
9840,
1876,
7621,
12,
2890,
16,
8225,
16,
3451,
16,
1501,
1883,
16,
8174,
4672,
775,
30,
1172,
315,
7621,
310,
563,
6,
365,
18,
6206,
12,
683,
18116,
18,
30438,
67,
2121,
63,
68... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9840,
1876,
7621,
12,
2890,
16,
8225,
16,
3451,
16,
1501,
1883,
16,
8174,
4672,
775,
30,
1172,
315,
7621,
310,
563,
6,
365,
18,
6206,
12,
683,
18116,
18,
30438,
67,
2121,
63,
68... | |
words = dir(object) if hasattr(object,'__class__'): | words = dir(thisobject) if "__builtins__" in words: words.remove("__builtins__") if hasattr(thisobject, '__class__'): | def attr_matches(self, text): """Compute matches when text contains a dot. | 311279bc75ca8640eb928be4079866f776eb390d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/311279bc75ca8640eb928be4079866f776eb390d/rlcompleter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1604,
67,
8436,
12,
2890,
16,
977,
4672,
3536,
7018,
1885,
1347,
977,
1914,
279,
3928,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1604,
67,
8436,
12,
2890,
16,
977,
4672,
3536,
7018,
1885,
1347,
977,
1914,
279,
3928,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Return a new segment by adding x to the upper and lower bounds of this segment. | Return a new segment whose bounds are given by adding x to the segment's upper and lower bounds. | def shift(self, x): """ Return a new segment by adding x to the upper and lower bounds of this segment. """ return tuple.__new__(self.__class__, (self[0] + x, self[1] + x)) | 9301b9f3a871cdefb75a7d1f1ef08c76b72e6f42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3589/9301b9f3a871cdefb75a7d1f1ef08c76b72e6f42/segments.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4654,
12,
2890,
16,
619,
4672,
3536,
2000,
279,
394,
3267,
8272,
4972,
854,
864,
635,
6534,
619,
358,
326,
3267,
1807,
3854,
471,
2612,
4972,
18,
3536,
327,
3193,
16186,
2704,
972,
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,
4654,
12,
2890,
16,
619,
4672,
3536,
2000,
279,
394,
3267,
8272,
4972,
854,
864,
635,
6534,
619,
358,
326,
3267,
1807,
3854,
471,
2612,
4972,
18,
3536,
327,
3193,
16186,
2704,
972,
12,
... |
if robustlist and robustify: for mname in robustlist: m=classdict.get(mname) if m and isinstance(m, types.FunctionType): classdict[mname]=robustify(m) | for mname in robustlist: m=classdict.get(mname) if not m: for b in bases: if hasattr(b, mname): m=getattr(b, mname) break if m: classdict[mname]=_robustify(m) else: print type(m) | def __new__(self, classname, bases, classdict): robustlist=classdict.get('robust') robustify=classdict.get('robustify') if robustlist and robustify: for mname in robustlist: m=classdict.get(mname) if m and isinstance(m, types.FunctionType): classdict[mname]=robustify(m) return type.__new__(self, classname, bases, classdict) | b074c5c4c23429072760f03d733fb89d1991526d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/b074c5c4c23429072760f03d733fb89d1991526d/ftpfs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
2890,
16,
7479,
16,
8337,
16,
667,
1576,
4672,
27920,
1098,
33,
1106,
1576,
18,
588,
2668,
303,
70,
641,
6134,
27920,
1164,
33,
1106,
1576,
18,
588,
2668,
303,
70,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2704,
972,
12,
2890,
16,
7479,
16,
8337,
16,
667,
1576,
4672,
27920,
1098,
33,
1106,
1576,
18,
588,
2668,
303,
70,
641,
6134,
27920,
1164,
33,
1106,
1576,
18,
588,
2668,
303,
70,... |
self.streams.remove(stream) local_sdp.media[stream.index].port = 0 for stream in self.streams: local_sdp.media[stream.index] = stream.get_local_media(for_offer=False) self._invitation.send_response(200, sdp=local_sdp) for stream in removed_streams: | def _NH_SIPInvitationChangedState(self, notification): notification_center = NotificationCenter() if self.greenlet is not None and self.greenlet is not api.getcurrent(): if notification.data.state == 'disconnected' and notification.data.prev_state != 'disconnecting': self._channel.send_exception(InvitationDidFailError(notification.sender, notification.data)) else: self._channel.send(notification) else: if notification.data.state == 'connected' and notification.data.sub_state == 'received_proposal': self.state = 'received_proposal' try: proposed_remote_sdp = self._invitation.sdp.proposed_remote active_remote_sdp = self._invitation.sdp.active_remote for stream in self.streams: if not stream.validate_update(proposed_remote_sdp, stream.index): engine = Engine() self._invitation.send_response(488, extra_headers=[WarningHeader(399, engine.user_agent, 'Failed to update media stream index %d' % stream.index)]) self.state = 'connected' notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='remote', method='INVITE', code=488, reason=sip_status_messages[488], ack_received='unknown')) return # These tests are here because some ALGs mess up the SDP and the behaviour # of pjsip in these situations is unexpected (eg. loss of audio). -Luci for attr in ('user', 'net_type', 'address_type', 'address'): if getattr(proposed_remote_sdp, attr) != getattr(active_remote_sdp, attr): engine = Engine() self._invitation.send_response(488, extra_headers=[WarningHeader(399, engine.user_agent, 'Difference in contents of o= line')]) self.state = 'connected' notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='remote', method='INVITE', code=488, reason=sip_status_messages[488], ack_received='unknown')) return added_media_indexes = set() removed_media_indexes = set() for index, media_stream in enumerate(proposed_remote_sdp.media): if index >= len(active_remote_sdp.media): added_media_indexes.add(index) elif media_stream.media != active_remote_sdp.media[index].media: added_media_indexes.add(index) removed_media_indexes.add(index) elif not media_stream.port and active_remote_sdp.media[index].port: removed_media_indexes.add(index) removed_media_indexes.update(xrange(len(proposed_remote_sdp.media), len(active_remote_sdp.media))) if added_media_indexes and removed_media_indexes: engine = Engine() self._invitation.send_response(488, extra_headers=[WarningHeader(399, engine.user_agent, 'Both removing AND adding a media stream is currently not supported')]) notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='remote', method='INVITE', code=488, reason=sip_status_messages[488], ack_received='unknown')) elif added_media_indexes: self.proposed_streams = [] for index in added_media_indexes: media_stream = proposed_remote_sdp.media[index] if media_stream.port != 0: for stream_type in MediaStreamRegistry(): try: stream = stream_type.new_from_sdp(self.account, proposed_remote_sdp, index) except InvalidStreamError: break except UnknownStreamError: continue else: stream.index = index self.proposed_streams.append(stream) break if self.proposed_streams: self._invitation.send_response(100) notification_center.post_notification('SIPSessionGotProposal', sender=self, data=TimestampedNotificationData(originator='remote', streams=self.proposed_streams)) return else: self._invitation.send_response(488) notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='remote', method='INVITE', code=488, reason=sip_status_messages[488], ack_received='unknown')) else: local_sdp = SDPSession.new(self._invitation.sdp.active_local) local_sdp.version += 1 removed_streams = [stream for stream in self.streams if stream.index in removed_media_indexes] prev_on_hold_streams = set(stream for stream in self.streams if stream.hold_supported and stream.on_hold_by_remote) for stream in removed_streams: notification_center.remove_observer(self, sender=stream) stream.deactivate() self.streams.remove(stream) local_sdp.media[stream.index].port = 0 for stream in self.streams: local_sdp.media[stream.index] = stream.get_local_media(for_offer=False) self._invitation.send_response(200, sdp=local_sdp) for stream in removed_streams: stream.end() notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='remote', method='INVITE', code=200, reason=sip_status_messages[200], ack_received='unknown')) | 849b83b8269b2356a6cabd3ba71c0c5cacb998d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3449/849b83b8269b2356a6cabd3ba71c0c5cacb998d3/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
50,
44,
67,
17739,
19896,
5033,
1119,
12,
2890,
16,
3851,
4672,
3851,
67,
5693,
273,
8050,
8449,
1435,
309,
365,
18,
11571,
1810,
353,
486,
599,
471,
365,
18,
11571,
1810,
353,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
50,
44,
67,
17739,
19896,
5033,
1119,
12,
2890,
16,
3851,
4672,
3851,
67,
5693,
273,
8050,
8449,
1435,
309,
365,
18,
11571,
1810,
353,
486,
599,
471,
365,
18,
11571,
1810,
353,
48... | |
entity = self.TonalEntityWildcard(plainEntity) | entity = self._createTonalEntityWildcard( plainEntity) | def _getWildcardForms(self, searchStr, **options): if self._getWildcardFormsOptions != (searchStr, options): decompEntities = self._getPlainForms(searchStr, **options) | 7113513f178bcd574bd86ef5fe518238142a3598 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/7113513f178bcd574bd86ef5fe518238142a3598/dictionary.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
12121,
18529,
12,
2890,
16,
1623,
1585,
16,
2826,
2116,
4672,
309,
365,
6315,
588,
12121,
18529,
1320,
480,
261,
3072,
1585,
16,
702,
4672,
443,
2919,
8108,
273,
365,
6315,
588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
12121,
18529,
12,
2890,
16,
1623,
1585,
16,
2826,
2116,
4672,
309,
365,
6315,
588,
12121,
18529,
1320,
480,
261,
3072,
1585,
16,
702,
4672,
443,
2919,
8108,
273,
365,
6315,
588... |
if object.__name__ == '<lambda>': decl = '<lambda> ' + argspec[1:-1] else: decl = self.bold(object.__name__) + argspec | if realname == '<lambda>': title = 'lambda' argspec = argspec[1:-1] decl = title + argspec + note | def docroutine(self, object): """Produce text documentation for a function or method object.""" if inspect.ismethod(object): object = object.im_func if inspect.isbuiltin(object): decl = self.bold(object.__name__) + '(...)' else: args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) if object.__name__ == '<lambda>': decl = '<lambda> ' + argspec[1:-1] else: decl = self.bold(object.__name__) + argspec doc = getdoc(object) if doc: return decl + '\n' + rstrip(self.indent(doc)) + '\n' else: return decl + '\n' | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
4672,
3536,
25884,
977,
7323,
364,
279,
445,
578,
707,
733,
12123,
309,
5334,
18,
291,
2039,
12,
1612,
4672,
733,
273,
733,
18,
381,
67,
644,
309,
5334,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
4672,
3536,
25884,
977,
7323,
364,
279,
445,
578,
707,
733,
12123,
309,
5334,
18,
291,
2039,
12,
1612,
4672,
733,
273,
733,
18,
381,
67,
644,
309,
5334,
... |
changed = False | def terminate_device_jobs(self): changed = False for job in self.running_jobs: if isinstance(job, DeviceJob): job.terminate() | 2dc7ba64e369dd4be2d200fed04b78b0d1b43285 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/2dc7ba64e369dd4be2d200fed04b78b0d1b43285/jobs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10850,
67,
5964,
67,
10088,
12,
2890,
4672,
364,
1719,
316,
365,
18,
8704,
67,
10088,
30,
309,
1549,
12,
4688,
16,
6077,
2278,
4672,
1719,
18,
30017,
1435,
282,
2,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10850,
67,
5964,
67,
10088,
12,
2890,
4672,
364,
1719,
316,
365,
18,
8704,
67,
10088,
30,
309,
1549,
12,
4688,
16,
6077,
2278,
4672,
1719,
18,
30017,
1435,
282,
2,
-100,
-100,
-100,
-1... | |
onAfterCompile = None | onAfterCompile = None | def __repr__(self): return "after compile script: %s\n%s" % (repr(self.script), repr(self.state)) | d76ea3f452d147f051e65b20fdab9b87a8b84413 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2065/d76ea3f452d147f051e65b20fdab9b87a8b84413/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
315,
5205,
4074,
2728,
30,
738,
87,
64,
82,
9,
87,
6,
738,
261,
12715,
12,
2890,
18,
4263,
3631,
8480,
12,
2890,
18,
2019,
3719,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12715,
972,
12,
2890,
4672,
327,
315,
5205,
4074,
2728,
30,
738,
87,
64,
82,
9,
87,
6,
738,
261,
12715,
12,
2890,
18,
4263,
3631,
8480,
12,
2890,
18,
2019,
3719,
2,
-100,
-100,... |
"""Return an absolute path to the source file or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" return os.path.normcase(os.path.abspath(getsourcefile(object) or getfile(object))) | """Return an absolute path to the source or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" return os.path.normcase( os.path.abspath(getsourcefile(object) or getfile(object))) | def getabsfile(object): """Return an absolute path to the source file or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" return os.path.normcase(os.path.abspath(getsourcefile(object) or getfile(object))) | a50bc378702521085821dd7005c1856e98d7bb5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a50bc378702521085821dd7005c1856e98d7bb5e/inspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5113,
768,
12,
1612,
4672,
3536,
990,
392,
4967,
589,
358,
326,
1084,
578,
7743,
585,
364,
392,
733,
18,
225,
1021,
21463,
353,
364,
1517,
733,
358,
1240,
279,
3089,
4026,
16,
142... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5113,
768,
12,
1612,
4672,
3536,
990,
392,
4967,
589,
358,
326,
1084,
578,
7743,
585,
364,
392,
733,
18,
225,
1021,
21463,
353,
364,
1517,
733,
358,
1240,
279,
3089,
4026,
16,
142... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.