rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return GetResultAs<%s>();\n" % func.return_type) file.Write("}\n") file.Write("\n") | impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Write(" *result = 0;\n") arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file) | def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return GetResultAs<%s>();\n" % func.return_type) file.Write("}\n") file.Write("\n") | 1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
43,
11386,
22,
13621,
1864,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
27188,
87,
738,
87,
9275,
87,
13,
18890,
82,
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,
2598,
43,
11386,
22,
13621,
1864,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
27188,
87,
738,
87,
9275,
87,
13,
18890,
82,
6,
738,... |
h.url_token())) | h.url_token()))) | def _login(self, user): """ Raw login giving severe headaches to repoze.who, repoze.what and any bystanding squirrels. """ identity = { 'userdata': '', 'repoze.who.userid': str(user.user_name), 'timestamp': int(datetime.now().strftime("%s")), 'user': user, } # set up repoze.what authorization_md = request.environ['repoze.who.plugins']['authorization_md'] authorization_md.add_metadata(request.environ, identity) auth_tkt = request.environ['repoze.who.plugins']['auth_tkt'] header = auth_tkt.remember(request.environ, identity) response.headerlist.extend(header) if c.instance and not user.is_member(c.instance): redirect_to(c.instance, path="/instance/join/%s?%s" % (c.instance.key, h.url_token())) redirect_to("/") | daf6cb11b5052d3be756c504e7d130219ec67e2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/daf6cb11b5052d3be756c504e7d130219ec67e2a/openidauth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5819,
12,
2890,
16,
729,
4672,
3536,
6576,
3925,
21057,
25882,
910,
497,
281,
358,
3538,
8489,
18,
3350,
83,
16,
3538,
8489,
18,
23770,
471,
1281,
635,
15167,
17715,
481,
2878,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5819,
12,
2890,
16,
729,
4672,
3536,
6576,
3925,
21057,
25882,
910,
497,
281,
358,
3538,
8489,
18,
3350,
83,
16,
3538,
8489,
18,
23770,
471,
1281,
635,
15167,
17715,
481,
2878,
87,
... |
raise LdtpServerException('Object does not have a "click" action') | raise LdtpServerException('Object does not have a "%s" action' % action) def _get_object_in_window(self, appmap, obj_name): for name in appmap.keys(): obj = appmap[name] if self._match_name_to_appmap(obj_name, obj): return obj return None | def _click_object(self, obj, action = 'click'): try: iaction = obj.queryAction() except NotImplementedError: raise LdtpServerException( 'Object does not have an Action interface') else: for i in xrange(iaction.nActions): if re.match(action, iaction.getName(i)): iaction.doAction(i) return raise LdtpServerException('Object does not have a "click" action') | 43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7475,
67,
1612,
12,
2890,
16,
1081,
16,
1301,
273,
296,
7475,
11,
4672,
775,
30,
277,
1128,
273,
1081,
18,
2271,
1803,
1435,
1335,
11206,
30,
1002,
511,
72,
6834,
21003,
12,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7475,
67,
1612,
12,
2890,
16,
1081,
16,
1301,
273,
296,
7475,
11,
4672,
775,
30,
277,
1128,
273,
1081,
18,
2271,
1803,
1435,
1335,
11206,
30,
1002,
511,
72,
6834,
21003,
12,
296,
... |
LAYOUT = ''' executable abs.richards abs.pystone rel.richards rel.pystone pypy-c-17439 40929 ms 637.274 47.8 56.6 pypy-c-17512 46105 ms 658.1 53.9 54.8 pypy-current 33937 ms 698.415 39.6 51.7 python 2.3.3 856 ms 36081.6 1.0 1.0 ''' | def get_executables(): exes = [name for name in os.listdir('.') if name.endswith('.exe')] exes.sort() return exes | b3cb3be415df318162c477554a46311313be6b7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/b3cb3be415df318162c477554a46311313be6b7b/bench-windows.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4177,
322,
1538,
13332,
431,
281,
273,
306,
529,
364,
508,
316,
1140,
18,
1098,
1214,
2668,
1093,
13,
309,
508,
18,
5839,
1918,
2668,
18,
14880,
6134,
65,
431,
281,
18,
3804,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4177,
322,
1538,
13332,
431,
281,
273,
306,
529,
364,
508,
316,
1140,
18,
1098,
1214,
2668,
1093,
13,
309,
508,
18,
5839,
1918,
2668,
18,
14880,
6134,
65,
431,
281,
18,
3804,
... | |
jstool.moveResourceAfter(SARISSA, 'plone_javascripts.js') | if 'plone_javascripts.js' in existing: jstool.moveResourceAfter(SARISSA, 'plone_javascripts.js') else: jstool.moveResourceToBottom(SARISSA) | def install_resources(self, out): """Add the js and css files to the resource registry so that they can be merged for download. """ try: from Products.ResourceRegistries.config import CSSTOOLNAME, JSTOOLNAME except ImportError: print >>out, "Resource registry not found: kupu will load its own resources" return data = _read_resources() CONDITION = '''python:portal.kupu_library_tool.isKupuEnabled(REQUEST=request)''' csstool = getToolByName(self, CSSTOOLNAME, None) jstool = getToolByName(self, JSTOOLNAME, None) if csstool is None or jstool is None: return for id in css_files(data): print >>out, "CSS file", id cookable = True csstool.manage_removeStylesheet(id=id) csstool.manage_addStylesheet(id=id, expression=CONDITION, rel='stylesheet', enabled=True, cookable=cookable) existing = [ sheet.getId() for sheet in jstool.getResources()] if 'kupucontextmenu.js' in existing: jstool.manage_removeScript('kupucontextmenu.js'); # Insert sarissa.js into the scripts but only if it isn't already # there. SARISSA = 'sarissa.js' if SARISSA not in existing: jstool.manage_addScript(id=SARISSA, enabled=True, cookable=True, compression='safe', cacheable=True) jstool.moveResourceAfter(SARISSA, 'plone_javascripts.js') print >>out, "JS file", SARISSA for id in js_files(data): print >>out, "JS file", id jstool.manage_removeScript(id=id) jstool.manage_addScript(id=id, expression=CONDITION, enabled=True, compression='safe', cookable=True) | c6c253deb063b7d303bd0a6ee54890439df3eb98 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10193/c6c253deb063b7d303bd0a6ee54890439df3eb98/Install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
4683,
12,
2890,
16,
596,
4672,
3536,
986,
326,
3828,
471,
3747,
1390,
358,
326,
1058,
4023,
1427,
716,
2898,
848,
506,
5384,
364,
4224,
18,
3536,
775,
30,
628,
8094,
87,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
4683,
12,
2890,
16,
596,
4672,
3536,
986,
326,
3828,
471,
3747,
1390,
358,
326,
1058,
4023,
1427,
716,
2898,
848,
506,
5384,
364,
4224,
18,
3536,
775,
30,
628,
8094,
87,
18,
... |
roundtrip(sys.argv[1]) | main(sys.argv[1:]) | def roundtrip(filename): source = open(filename).read() tree = compile(source, filename, "exec", 0x400) Unparser(tree) | 3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3643,
25125,
12,
3459,
4672,
1084,
273,
1696,
12,
3459,
2934,
896,
1435,
2151,
273,
4074,
12,
3168,
16,
1544,
16,
315,
4177,
3113,
374,
92,
16010,
13,
1351,
4288,
12,
3413,
13,
225,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3643,
25125,
12,
3459,
4672,
1084,
273,
1696,
12,
3459,
2934,
896,
1435,
2151,
273,
4074,
12,
3168,
16,
1544,
16,
315,
4177,
3113,
374,
92,
16010,
13,
1351,
4288,
12,
3413,
13,
225,
2,... |
dir = makepath(sitedir, dir) if dir not in sys.path and os.path.exists(dir): | dir, dircase = makepath(sitedir, dir) if not dirs_in_sys_path.has_key(dircase) and os.path.exists(dir): | def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir = makepath(sitedir, dir) if dir not in sys.path and os.path.exists(dir): sys.path.append(dir) | c4ce4db3160f9a22a1062ef98f6390b7bfe4e61d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c4ce4db3160f9a22a1062ef98f6390b7bfe4e61d/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
5610,
12,
87,
16261,
481,
16,
508,
4672,
13321,
273,
1140,
18,
803,
18,
5701,
12,
87,
16261,
481,
16,
508,
13,
775,
30,
284,
273,
1696,
12,
21885,
13,
1335,
8340,
30,
327,
1323,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
5610,
12,
87,
16261,
481,
16,
508,
4672,
13321,
273,
1140,
18,
803,
18,
5701,
12,
87,
16261,
481,
16,
508,
13,
775,
30,
284,
273,
1696,
12,
21885,
13,
1335,
8340,
30,
327,
1323,... |
previous_shelve = old_dbshelve.open(filename + '.previous') | previous_shelve = bsddb.dbshelve.open(filename + '.previous') | def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename) | 515e74c733626d74dfe8d685b4c41efe359006c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7531/515e74c733626d74dfe8d685b4c41efe359006c5/apt_proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
674,
292,
537,
12,
3459,
4672,
628,
7081,
449,
70,
23,
1930,
1319,
16,
1966,
674,
292,
537,
613,
18,
4148,
2668,
21378,
2063,
296,
397,
1544,
13,
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,
1696,
67,
674,
292,
537,
12,
3459,
4672,
628,
7081,
449,
70,
23,
1930,
1319,
16,
1966,
674,
292,
537,
613,
18,
4148,
2668,
21378,
2063,
296,
397,
1544,
13,
2,
-100,
-100,
-100,
-100,
... |
return page.get('revisions', ()) | return page.get('revisions', []) | def get_history(self, title, since, username): address = self.site.api_address() predata = [ ('action', 'query'), ('prop', 'revisions'), ('titles', title.encode('utf-8')), ('rvprop', 'timestamp|user|comment|content'), ('rvlimit', '50'), ('format', 'json'), ('rvend', since), ('rvexcludeuser', username.encode('utf-8')) ] response, data = self.site.postForm(address, predata) data = simplejson.loads(data) if 'error' in data: raise RuntimeError(data['error']) | 5326c7e03d0037c0781e9405f6fc763d4a2ade51 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/5326c7e03d0037c0781e9405f6fc763d4a2ade51/image_replacer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8189,
12,
2890,
16,
2077,
16,
3241,
16,
2718,
4672,
1758,
273,
365,
18,
4256,
18,
2425,
67,
2867,
1435,
675,
892,
273,
306,
7707,
1128,
2187,
296,
2271,
19899,
7707,
5986,
218... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8189,
12,
2890,
16,
2077,
16,
3241,
16,
2718,
4672,
1758,
273,
365,
18,
4256,
18,
2425,
67,
2867,
1435,
675,
892,
273,
306,
7707,
1128,
2187,
296,
2271,
19899,
7707,
5986,
218... |
n = V1.dimension() | n = int(V1.dimension()) | def intersection(self, other): """ Return the intersection of self and other, which must be R-submodules of a common ambient vector space. | c13c03298f6439296710cb55122f9a3b7bcbd9b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/c13c03298f6439296710cb55122f9a3b7bcbd9b3/free_module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7619,
12,
2890,
16,
1308,
4672,
3536,
2000,
326,
7619,
434,
365,
471,
1308,
16,
1492,
1297,
506,
534,
17,
1717,
6400,
434,
279,
2975,
13232,
1979,
3806,
3476,
18,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7619,
12,
2890,
16,
1308,
4672,
3536,
2000,
326,
7619,
434,
365,
471,
1308,
16,
1492,
1297,
506,
534,
17,
1717,
6400,
434,
279,
2975,
13232,
1979,
3806,
3476,
18,
2,
-100,
-100,
-100,
... |
self.addBool('Network', 'debugTraffic', False) | self.__dict__['autoMode'] = False self.__dict__['debugTraffic'] = False | def __init__(self): if util.PREF: logException(Exception('PREF is not None')) util.PREF = self KConfigSkeleton.__init__(self) self.addString('General', 'tilesetName', 'default') self.addString('General', 'windTilesetName', 'traditional') self.addString('General', 'backgroundName', 'default') self.addBool('Network', 'autoMode', False) self.addInteger('Network', 'serverPort', 8149) self.addBool('Network', 'debugTraffic', False) | 509eb007a42c616dd9cf9ed5597801f41187ea93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1679/509eb007a42c616dd9cf9ed5597801f41187ea93/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
309,
1709,
18,
3670,
42,
30,
28483,
12,
503,
2668,
3670,
42,
353,
486,
599,
26112,
1709,
18,
3670,
42,
273,
365,
1475,
809,
28070,
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,
4672,
309,
1709,
18,
3670,
42,
30,
28483,
12,
503,
2668,
3670,
42,
353,
486,
599,
26112,
1709,
18,
3670,
42,
273,
365,
1475,
809,
28070,
16186,
2738,
972,
12... |
object.deltag( "active" ) | deactivate( object ) | def onContextEntry(player, object, entry): if entry == 400: object.settag( "active", 0 ) if entry == 401: object.deltag( "active" ) object.resendtooltip() return True | fee0bd587814a931b25d1fd5c61d8581d0aed4c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/fee0bd587814a931b25d1fd5c61d8581d0aed4c5/comcrystals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1042,
1622,
12,
14872,
16,
733,
16,
1241,
4672,
309,
1241,
422,
7409,
30,
733,
18,
542,
2692,
12,
315,
3535,
3113,
374,
262,
309,
1241,
422,
14052,
30,
18790,
12,
733,
262,
733,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
603,
1042,
1622,
12,
14872,
16,
733,
16,
1241,
4672,
309,
1241,
422,
7409,
30,
733,
18,
542,
2692,
12,
315,
3535,
3113,
374,
262,
309,
1241,
422,
14052,
30,
18790,
12,
733,
262,
733,
... |
def CalcPerms(initial, perms): | def calc_perms(initial, perms): '''This compares ondisk permissions with specified ones''' | def CalcPerms(initial, perms): tempperms = initial if len(perms) == 3: perms = '0%s' % (perms) [s, u, g, o] = [perms[int(x)] for x in range(4)] if s & 1: tempperms |= S_ISVTX if s & 2: tempperms |= S_ISGID if s & 4: tempperms |= S_ISUID if u & 1: tempperms |= S_IXUSR if u & 2: tempperms |= S_IWUSR if u & 4: tempperms |= S_IRUSR if g & 1: tempperms |= S_IXGRP if g & 2: tempperms |= S_IWGRP if g & 4: tempperms |= S_IRGRP if o & 1: tempperms |= S_IXOTH if o & 2: tempperms |= S_IWOTH if o & 4: tempperms |= S_IROTH return tempperms | 7f96b6e6c21e510fb73ea66f3c3e52b21d089e3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/7f96b6e6c21e510fb73ea66f3c3e52b21d089e3e/Toolset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
15969,
12,
6769,
16,
13793,
4672,
9163,
2503,
20670,
603,
10863,
4371,
598,
1269,
5945,
26418,
1906,
15969,
273,
2172,
309,
562,
12,
15969,
13,
422,
890,
30,
13793,
273,
296,
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,
7029,
67,
15969,
12,
6769,
16,
13793,
4672,
9163,
2503,
20670,
603,
10863,
4371,
598,
1269,
5945,
26418,
1906,
15969,
273,
2172,
309,
562,
12,
15969,
13,
422,
890,
30,
13793,
273,
296,
2... |
return self.entry.link.decode('ascii', 'replace') | try: return self.entry.link.decode('ascii', 'replace') except UnicodeDecodeError: return self.entry.link.decode('ascii', 'ignore') | def get_link(self): """Returns the URL of the webpage associated with the item. """ self.confirmDBThread() if hasattr(self.entry, "link"): return self.entry.link.decode('ascii', 'replace') | 41ca6821787ab4664449d32ce04ed0fec52cae57 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/41ca6821787ab4664449d32ce04ed0fec52cae57/item.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1232,
12,
2890,
4672,
3536,
1356,
326,
1976,
434,
326,
3311,
2433,
3627,
598,
326,
761,
18,
3536,
365,
18,
10927,
2290,
3830,
1435,
309,
3859,
12,
2890,
18,
4099,
16,
315,
123... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1232,
12,
2890,
4672,
3536,
1356,
326,
1976,
434,
326,
3311,
2433,
3627,
598,
326,
761,
18,
3536,
365,
18,
10927,
2290,
3830,
1435,
309,
3859,
12,
2890,
18,
4099,
16,
315,
123... |
new_crontab = re.sub('(?m)^.*cozy-backup.py -s\n', '', crontab) | new_crontab = re.sub('(?m)^.*cozy-backup -s\n', '', crontab) | def __remove_crontab_entry(self): 'Removes an entry from the users crontab.' pid = subprocess.Popen(['crontab', '-l'], stdout=subprocess.PIPE) crontab = pid.stdout.read() new_crontab = re.sub('(?m)^.*cozy-backup.py -s\n', '', crontab) pid = subprocess.Popen(['crontab', '-'], stdin=subprocess.PIPE) pid.stdin.write(new_crontab) pid.stdin.close() | 1de0740b9143908c992922a8e39a2259609b01c8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/736/1de0740b9143908c992922a8e39a2259609b01c8/cozy_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4479,
67,
3353,
30335,
67,
4099,
12,
2890,
4672,
296,
6220,
392,
1241,
628,
326,
3677,
4422,
30335,
1093,
4231,
273,
6652,
18,
52,
3190,
12,
3292,
3353,
30335,
2187,
2400,
80,
1733... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4479,
67,
3353,
30335,
67,
4099,
12,
2890,
4672,
296,
6220,
392,
1241,
628,
326,
3677,
4422,
30335,
1093,
4231,
273,
6652,
18,
52,
3190,
12,
3292,
3353,
30335,
2187,
2400,
80,
1733... |
('(%Z)', '(%s)' % tz, 'time zone name'), | ('%Z', '%s' % tz, 'time zone name'), | def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = str(long(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='AM' else: ampm='PM' jan1 = time.localtime(time.mktime((now[0], 1, 1) + (0,)*6)) try: if now[8]: tz = time.tzname[1] else: tz = time.tzname[0] except AttributeError: tz = '' if now[3] > 12: clock12 = now[3] - 12 elif now[3] > 0: clock12 = now[3] else: clock12 = 12 expectations = ( ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'), ('%A', calendar.day_name[now[6]], 'full weekday name'), ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%B', calendar.month_name[now[1]], 'full month name'), # %c see below ('%d', '%02d' % now[2], 'day of month as number (00-31)'), ('%H', '%02d' % now[3], 'hour (00-23)'), ('%I', '%02d' % clock12, 'hour (01-12)'), ('%j', '%03d' % now[7], 'julian day (001-366)'), ('%m', '%02d' % now[1], 'month as number (01-12)'), ('%M', '%02d' % now[4], 'minute, (00-59)'), ('%p', ampm, 'AM or PM as appropriate'), ('%S', '%02d' % now[5], 'seconds of current time (00-60)'), ('%U', '%02d' % ((now[7] + jan1[6])/7), 'week number of the year (Sun 1st)'), ('%w', '%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'), ('%W', '%02d' % ((now[7] + (jan1[6] - 1)%7)/7), 'week number of the year (Mon 1st)'), # %x see below ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%y', '%02d' % (now[0]%100), 'year without century'), ('%Y', '%d' % now[0], 'year with century'), # %Z see below ('%%', '%', 'single percent sign'), ) nonstandard_expectations = ( # These are standard but don't have predictable output ('%c', fixasctime(time.asctime(now)), 'near-asctime() format'), ('%x', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), '%m/%d/%y %H:%M:%S'), ('(%Z)', '(%s)' % tz, 'time zone name'), # These are some platform specific extensions ('%D', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), 'mm/dd/yy'), ('%e', '%2d' % now[2], 'day of month as number, blank padded ( 0-31)'), ('%h', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%k', '%2d' % now[3], 'hour, blank padded ( 0-23)'), ('%n', '\n', 'newline character'), ('%r', '%02d:%02d:%02d %s' % (clock12, now[4], now[5], ampm), '%I:%M:%S %p'), ('%R', '%02d:%02d' % (now[3], now[4]), '%H:%M'), ('%s', nowsecs, 'seconds since the Epoch in UCT'), ('%t', '\t', 'tab character'), ('%T', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%3y', '%03d' % (now[0]%100), 'year without century rendered using fieldwidth'), ) if verbose: print "Strftime test, platform: %s, Python version: %s" % \ (sys.platform, string.split(sys.version)[0]) for e in expectations: try: result = time.strftime(e[0], now) except ValueError, error: print "Standard '%s' format gave error:" % e[0], error continue if result == e[1]: continue if result[0] == '%': print "Does not support standard '%s' format (%s)" % (e[0], e[2]) else: print "Conflict for %s (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) for e in nonstandard_expectations: try: result = time.strftime(e[0], now) except ValueError, result: if verbose: print "Error for nonstandard '%s' format (%s): %s" % \ (e[0], e[2], str(result)) continue if result == e[1]: if verbose: print "Supports nonstandard '%s' format (%s)" % (e[0], e[2]) elif result[0] == '%': if verbose: print "Does not appear to support '%s' format (%s)" % (e[0], e[2]) else: if verbose: print "Conflict for nonstandard '%s' format (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) | 50d16ee5beb5684c050a456204981c91fe8f1afa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/50d16ee5beb5684c050a456204981c91fe8f1afa/test_strftime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... |
e.grid(row=self.row, col=1, sticky="nwe") | e.grid(row=self.row, column=1, sticky="nwe") | def make_entry(self, label, var): l = Label(self.top, text=label) l.grid(row=self.row, col=0, sticky="nw") e = Entry(self.top, textvariable=var, exportselection=0) e.grid(row=self.row, col=1, sticky="nwe") self.row = self.row + 1 return e | 4fc904708bc3175669d158d647b8a2fd14036373 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4fc904708bc3175669d158d647b8a2fd14036373/SearchDialogBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4099,
12,
2890,
16,
1433,
16,
569,
4672,
328,
273,
5287,
12,
2890,
18,
3669,
16,
977,
33,
1925,
13,
328,
18,
5222,
12,
492,
33,
2890,
18,
492,
16,
645,
33,
20,
16,
21750,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4099,
12,
2890,
16,
1433,
16,
569,
4672,
328,
273,
5287,
12,
2890,
18,
3669,
16,
977,
33,
1925,
13,
328,
18,
5222,
12,
492,
33,
2890,
18,
492,
16,
645,
33,
20,
16,
21750,... |
Valist_load(myAlist, len(atoms), x,y,z,chg,rad) | Valist_load(myAlist, len(x), x,y,z,chg,rad) | def runAPBS(PQR, INPUT): """ Main driver for testing. Runs APBS on given input file """ # Initialize variables, arrays com = Vcom_ctor(1) rank = Vcom_rank(com) size = Vcom_size(com) mgparm = MGparm() pbeparm = PBEparm() mem = Vmem_ctor("Main") pbe = new_pbelist(NOSH_MAXMOL) pmg = new_pmglist(NOSH_MAXMOL) pmgp = new_pmgplist(NOSH_MAXMOL) realCenter = double_array(3) totEnergy = [] x = [] y = [] z = [] chg = [] rad = [] nforce = int_array(NOSH_MAXCALC) atomforce = new_atomforcelist(NOSH_MAXCALC) # Start the main timer main_timer_start = time.clock() # Parse the input file nosh = NOsh_ctor(rank, size) # Instead of having an input file, we have a string! if not parseInputFromString(nosh, INPUT): stderr.write("main: Error while parsing input file.\n") raise APBSError, "Error occurred!" # Load the molecules using Valist_load routine, thereby # loading atoms directly into the valist object, removing # the need for an actual PQR file from stdin alist = new_valist(NOSH_MAXMOL) atoms = string.split(PQR,"\n") for i in range(len(atoms)): atom = atoms[i] params = string.split(atom) x.append(float(params[5])) y.append(float(params[6])) z.append(float(params[7])) chg.append(float(params[8])) rad.append(float(params[9])) # If there are more than one PQR file, make multiple Valist # objects myAlist = make_Valist(alist,0) Valist_load(myAlist, len(atoms), x,y,z,chg,rad) if not NOsh_setupElecCalc(nosh, alist): stderr.write("main: Error setting up calculation.\n") raise APBSError, "Error setting up calculations!" for i in range(nosh.ncalc): totEnergy.append(0.0) # Initialize the Python holders energyList = [] potList = [] forceList = [] # Load the various maps - since this example shows how to eliminate # inputs from the command line, this will probably not be used dielXMap = new_gridlist(NOSH_MAXMOL) dielYMap = new_gridlist(NOSH_MAXMOL) dielZMap = new_gridlist(NOSH_MAXMOL) if loadDielMaps(nosh, dielXMap, dielYMap, dielZMap) != 1: stderr.write("Error reading dielectric maps!\n") raise APBSError, "Error reading dielectric maps!" kappaMap = new_gridlist(NOSH_MAXMOL) if loadKappaMaps(nosh, kappaMap) != 1: stderr.write("Error reading kappa maps!\n") raise APBSError, "Error reading kappa maps!" chargeMap = new_gridlist(NOSH_MAXMOL) if loadChargeMaps(nosh, chargeMap) != 1: stderr.write("Error reading charge maps!\n") raise APBSError, "Error reading charge maps!" # Do the calculations stdout.write("Preparing to run %d PBE calculations. \n" % nosh.ncalc) for icalc in xrange(nosh.ncalc): stdout.write("---------------------------------------------\n") calc = NOsh_getCalc(nosh, icalc) mgparm = calc.mgparm pbeparm = calc.pbeparm if calc.calctype != 0: stderr.write("main: Only multigrid calculations supported!\n") raise APBSError, "Only multigrid calculations supported!" for k in range(0, nosh.nelec): if NOsh_elec2calc(nosh,k) >= icalc: break name = NOsh_elecname(nosh, k) if name == "": stdout.write("CALCULATION #%d: MULTIGRID\n" % (icalc+1)) else: stdout.write("CALCULATION #%d (%s): MULTIGRID\n" % ((icalc+1),name)) stdout.write("Setting up problem...\n") # Routine initMG if initMG(icalc, nosh, mgparm, pbeparm, realCenter, pbe, alist, dielXMap, dielYMap, dielZMap, kappaMap, chargeMap, pmgp, pmg) != 1: stderr.write("Error setting up MG calculation!\n") raise APBSError, "Error setting up MG calculation!" # Print problem parameters if desired (comment out if you want # to minimize output to stdout) printMGPARM(mgparm, realCenter) printPBEPARM(pbeparm) # Solve the problem : Routine solveMG thispmg = get_Vpmg(pmg,icalc) if solveMG(nosh, thispmg, mgparm.type) != 1: stderr.write("Error solving PDE! \n") raise APBSError, "Error Solving PDE!" # Set partition information : Routine setPartMG if setPartMG(nosh, mgparm, thispmg) != 1: stderr.write("Error setting partition info!\n") raise APBSError, "Error setting partition info!" # Get the energies - the energy for this calculation # (calculation number icalc) will be stored in the totEnergy array ret, totEnergy[icalc] = energyMG(nosh, icalc, thispmg, 0, 0.0, 0.0, 0.0, 0.0) # Calculate forces - doforce will be > 0 if anything other than # "calcforce no" is specified aforce = get_AtomForce(atomforce, icalc) doforce = wrap_forceMG(mem, nosh, pbeparm, mgparm, thispmg, aforce, alist, nforce, icalc) # Write out data from MG calculations : Routine writedataMG writedataMG(rank, nosh, pbeparm, thispmg) # Write out matrix from MG calculations writematMG(rank, nosh, pbeparm, thispmg) # Get the per-atom potentials and energies from this calculation. potentials = getPotentials(nosh, pbeparm, thispmg, myAlist) potList.append(potentials) energies = getEnergies(thispmg, myAlist) energyList.append(energies) # Get the forces from this calculation and store the result in # forceList. For information on how to use this array see # printResults() if doforce: forceList.append(getForces(aforce, myAlist)) # Handle print statements - comment out if limiting output to stdout if nosh.nprint > 0: stdout.write("---------------------------------------------\n") stdout.write("PRINT STATEMENTS\n") for iprint in xrange(nosh.nprint): if NOsh_printWhat(nosh, iprint) == NPT_ENERGY: printEnergy(com, nosh, totEnergy, iprint) elif NOsh_printWhat(nosh, iprint) == NPT_FORCE: printForce(com, nosh, nforce, atomforce, iprint) else: stdout.write("Undefined PRINT keyword!\n") break stdout.write("----------------------------------------\n") stdout.write("CLEANING UP AND SHUTTING DOWN...\n") # Clean up APBS structures killForce(mem, nosh, nforce, atomforce) killEnergy() killMG(nosh, pbe, pmgp, pmg) killChargeMaps(nosh, chargeMap) killKappaMaps(nosh, kappaMap) killDielMaps(nosh, dielXMap, dielYMap, dielZMap) killMolecules(nosh, alist) #delete_Nosh(nosh) # Clean up Python structures delete_double_array(realCenter) delete_int_array(nforce) delete_atomforcelist(atomforce) delete_valist(alist) delete_gridlist(dielXMap) delete_gridlist(dielYMap) delete_gridlist(dielZMap) delete_gridlist(kappaMap) delete_gridlist(chargeMap) delete_pmglist(pmg) delete_pmgplist(pmgp) delete_pbelist(pbe) # Clean up MALOC structures #delete_Com(com) #delete_Mem(mem) stdout.write("\n") stdout.write("Thanks for using APBS!\n\n") # Stop the main timer main_timer_stop = time.clock() stdout.write("Total execution time: %1.6e sec\n" % (main_timer_stop - main_timer_start)) return energyList, potList, forceList | a5cc2dcd3934c1d50b61faaeba57f94b39bb9361 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8179/a5cc2dcd3934c1d50b61faaeba57f94b39bb9361/noinput.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
2203,
12692,
12,
28386,
54,
16,
12943,
4672,
3536,
12740,
3419,
364,
7769,
18,
225,
1939,
87,
14410,
12692,
603,
864,
810,
585,
3536,
225,
468,
9190,
3152,
16,
5352,
532,
273,
776,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2203,
12692,
12,
28386,
54,
16,
12943,
4672,
3536,
12740,
3419,
364,
7769,
18,
225,
1939,
87,
14410,
12692,
603,
864,
810,
585,
3536,
225,
468,
9190,
3152,
16,
5352,
532,
273,
776,... |
if isMethod and haveCcx: | if haveCcx: | def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False): """ Write a single quick stub (a custom SpiderMonkey getter/setter/method) for the specified XPCOM interface-member. """ isAttr = (member.kind == 'attribute') isMethod = (member.kind == 'method') assert isAttr or isMethod isGetter = isAttr and not isSetter customMethodCall = customMethodCalls.get(stubName, None) # Function prolog. f.write("static JSBool\n") if isAttr: # JSPropertyOp signature. f.write(stubName + "(JSContext *cx, JSObject *obj, jsval id, " "jsval *vp)\n") else: # JSFastNative. f.write(stubName + "(JSContext *cx, uintN argc, jsval *vp)\n") f.write("{\n") f.write(" XPC_QS_ASSERT_CONTEXT_OK(cx);\n") # For methods, compute "this". if isMethod: f.write(" JSObject *obj = JS_THIS_OBJECT(cx, vp);\n" " if (!obj)\n" " return JS_FALSE;\n") # Create ccx if needed. haveCcx = isMethod and (isInterfaceType(member.realtype) or anyParamRequiresCcx(member)) if haveCcx: f.write(" XPCCallContext ccx(JS_CALLER, cx, obj, " "JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)));\n") else: # In some cases we emit a ccx, but it does not count as # "haveCcx" because it's not complete. if isAttr and isInterfaceType(member.realtype): f.write(" XPCCallContext ccx(JS_CALLER, cx, obj);\n") # Get the 'self' pointer. if customMethodCall is None or not 'thisType' in customMethodCall: f.write(" %s *self;\n" % member.iface.name) else: f.write(" %s *self;\n" % customMethodCall['thisType']) f.write(" xpc_qsSelfRef selfref;\n") # Don't use FromCcx for getters or setters; the way we construct the ccx in # a getter/setter causes it to find the wrong wrapper in some cases. if isMethod and haveCcx: # Undocumented, but the interpreter puts 'this' at argv[-1], # which is vp[1]; and it's ok to overwrite it. f.write(" if (!xpc_qsUnwrapThisFromCcx(ccx, &self, &selfref.ptr, " "&vp[1]))\n") f.write(" return JS_FALSE;\n") else: if isGetter: pthisval = 'vp' elif isSetter: f.write(" JSAutoTempValueRooter tvr(cx);\n") pthisval = 'tvr.addr()' else: pthisval = '&vp[1]' # as above, ok to overwrite vp[1] f.write(" if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, " "%s))\n" % pthisval) f.write(" return JS_FALSE;\n") if isMethod: # If there are any required arguments, check argc. requiredArgs = len(member.params) while requiredArgs and member.params[requiredArgs-1].optional: requiredArgs -= 1 if requiredArgs: f.write(" if (argc < %d)\n" % requiredArgs) f.write(" return xpc_qsThrow(cx, " "NS_ERROR_XPC_NOT_ENOUGH_ARGS);\n") # Convert in-parameters. rvdeclared = False if isMethod: if len(member.params) > 0: f.write(" jsval *argv = JS_ARGV(cx, vp);\n") for i, param in enumerate(member.params): validateParam(member, param) # Emit code to convert this argument from jsval. rvdeclared = writeArgumentUnboxing( f, i, 'arg%d' % i, param.realtype, haveCcx=haveCcx, optional=param.optional, rvdeclared=rvdeclared) elif isSetter: rvdeclared = writeArgumentUnboxing(f, None, 'arg0', member.realtype, haveCcx=False, optional=False, rvdeclared=rvdeclared) if customMethodCall is not None: f.write("%s\n" % customMethodCall['code']) f.write("#ifdef DEBUG\n") f.write(" nsresult debug_rv;\n") f.write(" nsCOMPtr<%s> debug_self = do_QueryInterface(self);\n" % member.iface.name); prefix = 'debug_' else: if not rvdeclared: f.write(" nsresult rv;\n") rvdeclared = True prefix = '' resultname = prefix + 'result' selfname = prefix + 'self' nsresultname = prefix + 'rv' # Prepare out-parameter. if isMethod or isGetter: writeResultDecl(f, member.realtype, resultname) # Call the method. if isMethod: comName = header.methodNativeName(member) argv = ['arg' + str(i) for i, p in enumerate(member.params)] if not isVoidType(member.realtype): argv.append(outParamForm(resultname, member.realtype)) args = ', '.join(argv) else: comName = header.attributeNativeName(member, isGetter) if isGetter: args = outParamForm(resultname, member.realtype) else: args = "arg0" f.write(" %s = %s->%s(%s);\n" % (nsresultname, selfname, comName, args)) if customMethodCall is None: # Check for errors. f.write(" if (NS_FAILED(rv))\n") if isMethod: if haveCcx: f.write(" return xpc_qsThrowMethodFailedWithCcx(" "ccx, rv);\n") else: f.write(" return xpc_qsThrowMethodFailed(" "cx, rv, vp);\n") else: if isGetter: thisval = '*vp' else: thisval = '*tvr.addr()' f.write(" return xpc_qsThrowGetterSetterFailed(cx, rv, " + "JSVAL_TO_OBJECT(%s), id);\n" % thisval) else: if isMethod or isGetter: f.write(" NS_ASSERTION(NS_SUCCEEDED(debug_rv) && " "xpc_qsSameResult(debug_result, result),\n" " \"Got the wrong answer from the custom " "method call!\");\n") f.write("#endif\n") # Convert the return value. if isMethod: writeResultConv(f, member.realtype, len(member.params) + 1, 'vp', '*vp') elif isGetter: writeResultConv(f, member.realtype, None, 'vp', '*vp') else: f.write(" return JS_TRUE;\n") # Epilog. f.write("}\n\n") | 6a1f237207f51d1463e1c61da017872f3721beeb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/6a1f237207f51d1463e1c61da017872f3721beeb/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
13663,
11974,
12,
74,
16,
1679,
1305,
10125,
16,
3140,
16,
7168,
461,
16,
353,
8465,
33,
8381,
4672,
3536,
2598,
279,
2202,
9549,
7168,
261,
69,
1679,
5878,
3585,
11415,
856,
7060,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13663,
11974,
12,
74,
16,
1679,
1305,
10125,
16,
3140,
16,
7168,
461,
16,
353,
8465,
33,
8381,
4672,
3536,
2598,
279,
2202,
9549,
7168,
261,
69,
1679,
5878,
3585,
11415,
856,
7060,... |
winInfo = self.getWinInfo( dt.year ) if not self.fixedStandardTime and self._inDaylightSavings( dt ): | winInfo = self.getWinInfo(dt.year) if not self.fixedStandardTime and self._inDaylightSavings(dt): | def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self | 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,
3046,
12,
365,
16,
3681,
262,
30,
315,
10587,
326,
2548,
5099,
4087,
899,
1384,
4888,
358,
326,
3314,
18,
12994,
1376,
857,
6,
309,
3681,
353,
599,
30,
327,
1815,
3681,
18,
12994,
1376... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3046,
12,
365,
16,
3681,
262,
30,
315,
10587,
326,
2548,
5099,
4087,
899,
1384,
4888,
358,
326,
3314,
18,
12994,
1376,
857,
6,
309,
3681,
353,
599,
30,
327,
1815,
3681,
18,
12994,
1376... |
l = Link._submit(request.post.title, request.post.article, c.user, sr, ip, spam) | l = Link._submit(request.post.title, (new_content if new_content else ''), c.user, sr, ip, spam) | def POST_submit(self, res, l, new_content, title, save, continue_editing, sr, ip): # TODO: find out where arguments come from res._update('status', innerHTML = '') should_ratelimit = sr.should_ratelimit(c.user, 'link') #remove the ratelimit error if the user's karma is high if not should_ratelimit: c.errors.remove(errors.RATELIMIT) | 706252acbaee7d92ac491edd7db3f65698972310 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6723/706252acbaee7d92ac491edd7db3f65698972310/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5485,
67,
9297,
12,
2890,
16,
400,
16,
328,
16,
394,
67,
1745,
16,
2077,
16,
1923,
16,
1324,
67,
4619,
310,
16,
9133,
16,
2359,
4672,
468,
2660,
30,
1104,
596,
1625,
1775,
12404,
628... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5485,
67,
9297,
12,
2890,
16,
400,
16,
328,
16,
394,
67,
1745,
16,
2077,
16,
1923,
16,
1324,
67,
4619,
310,
16,
9133,
16,
2359,
4672,
468,
2660,
30,
1104,
596,
1625,
1775,
12404,
628... |
c = pool[-1] del pool[-1] | c = pool.pop() | def open(self, version='', transaction=None, temporary=0, force=None, waitflag=1, mvcc=True, txn_mgr=None, synch=True): """Return a database Connection for use by application code. | 516183b5448db1aa401616599c1141cbda0d1be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516183b5448db1aa401616599c1141cbda0d1be5/DB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
1177,
2218,
2187,
2492,
33,
7036,
16,
6269,
33,
20,
16,
2944,
33,
7036,
16,
2529,
6420,
33,
21,
16,
7701,
952,
33,
5510,
16,
7827,
67,
13552,
33,
7036,
16,
272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
1177,
2218,
2187,
2492,
33,
7036,
16,
6269,
33,
20,
16,
2944,
33,
7036,
16,
2529,
6420,
33,
21,
16,
7701,
952,
33,
5510,
16,
7827,
67,
13552,
33,
7036,
16,
272,
... |
i = index.row() name, old, index = self.schemaList[i] self.schemaList[i] = (name, list(self.preprocessorsList), self.preprocessorsListSelectionModel.selectedRow().row()) | if index.isValid(): row = index.row() schema = self.schemaList[row] self.schemaList[row] = PreprocessorSchema(schema.name, list(self.preprocessorsList), self.preprocessorsListSelectionModel.selectedRow().row()) | def onUpdateSchema(self): index = self.schemaListSelectionModel.selectedRow() i = index.row() name, old, index = self.schemaList[i] self.schemaList[i] = (name, list(self.preprocessorsList), self.preprocessorsListSelectionModel.selectedRow().row()) | 040b4fbf2aa44ad50b9f46c3dfe85ba5dcbacbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/040b4fbf2aa44ad50b9f46c3dfe85ba5dcbacbec/OWPreprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27728,
3078,
12,
2890,
4672,
770,
273,
365,
18,
4821,
682,
6233,
1488,
18,
8109,
1999,
1435,
309,
770,
18,
26810,
13332,
1027,
273,
770,
18,
492,
1435,
1963,
273,
365,
18,
4821,
682,
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,
27728,
3078,
12,
2890,
4672,
770,
273,
365,
18,
4821,
682,
6233,
1488,
18,
8109,
1999,
1435,
309,
770,
18,
26810,
13332,
1027,
273,
770,
18,
492,
1435,
1963,
273,
365,
18,
4821,
682,
6... |
if (div == 1 and lineLevel == 1): print divName(linein) | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increasing depth while (lineLevel > level): if (formatMode == "indent"): if (inBodyText == 1): print"</p>" inBodyText = 0 print "<ol>" else: sys.exit("Error! Unknown formatMode type") level = level + 1 elif (lineLevel < level): # decreasing depth while (lineLevel < level): if (inBodyText == 1): print"</p>" inBodyText = 0 elif (inBodyText == 2): print"</pre>" inBodyText = 0 elif (inBodyText == 3): print"</table>" inBodyText = 0 print "</ol>" level = level - 1 if (div == 1 and level == 1): print'</div>' else: print # same depth if (slides == 0): if (lineLevel == find(linein," ") +1 ) or \ (lineLevel == find(linein,":") +1 ): if (inBodyText == 0): handleBodyText(linein,lineLevel) elif (colonStrip(rstrip(lstrip(linein))) == ""): print "</p>" handleBodyText(linein,lineLevel) else: print colonStrip(rstrip(lstrip(linein))), elif (lineLevel == find(linein,";") +1 ): if (inBodyText == 0): handlePreformattedText(linein,lineLevel) elif (semicolonStrip(rstrip(lstrip(linein))) == ""): print "</pre>" handlePreformattedText(linein,lineLevel) else: print semicolonStrip(rstrip(lstrip(linein))), elif (lineLevel == find(linein,"|") +1 ): if (inBodyText == 0): handleTable(linein,lineLevel) elif (pipeStrip(rstrip(lstrip(linein))) == ""): print "</table>" handleTtable(linein,lineLevel) else: print handleTableRow(linein,lineLevel), else: if (inBodyText == 1): print"</p>" inBodyText = 0 elif (inBodyText == 2): print"</pre>" inBodyText = 0 elif (inBodyText == 3): print"</table>" inBodyText = 0 if (div == 1 and lineLevel == 1): print divName(linein) print "<li", if (styleSheet != ""): if (lineLevel == find(linein,"- ") +1 ): print " class=\"LB" + str(lineLevel) + "\"", print ">" + lstrip(rstrip(dashStrip(lstrip(linein)))), elif (lineLevel == find(linein,"+ ") +1 ): print " class=\"LN" + str(lineLevel) + "\"", print ">" + lstrip(rstrip(plusStrip(lstrip(linein)))), else: print " class=\"L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)), else: if (lineLevel == 1): if (linein[0] == " "): if (inBodyText == 0): handleBodyText(linein,lineLevel) else: print rstrip(lstrip(linein)), else: print "<address>" print rstrip(lstrip(linein)), print "</address>\n" else: if (lineLevel == find(linein," ") +1 ) or \ (lineLevel == find(linein,":") +1 ): if (inBodyText == 0): handleBodyText(linein,lineLevel) else: print rstrip(lstrip(linein)), else: if (inBodyText == 1): print"</p>" inBodyText = 0 print "<li", if (styleSheet != ""): print " class=\"LI.L" + str(lineLevel) + "\"", print ">" + rstrip(lstrip(linein)), | fc16136abe0e486a37c93cf3944efd4ef14901d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6154/fc16136abe0e486a37c93cf3944efd4ef14901d9/otl2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1670,
12,
1369,
267,
4672,
2552,
1801,
16,
740,
2309,
16,
30119,
16,
6853,
9051,
16,
316,
2250,
1528,
16,
2154,
8229,
16,
6370,
2885,
16,
3739,
309,
261,
80,
6406,
12,
1369,
267,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1670,
12,
1369,
267,
4672,
2552,
1801,
16,
740,
2309,
16,
30119,
16,
6853,
9051,
16,
316,
2250,
1528,
16,
2154,
8229,
16,
6370,
2885,
16,
3739,
309,
261,
80,
6406,
12,
1369,
267,... | |
self.processSpaceCharacters = new.instancemethod( Phase.processSpaceCharacters, self) | self.processSpaceCharacters = self.processSpaceCharactersNonPre | def endTagBlock(self, name): #Put us back in the right whitespace handling mode if name == "pre": self.processSpaceCharacters = new.instancemethod( Phase.processSpaceCharacters, self) inScope = self.tree.elementInScope(name) if inScope: self.tree.generateImpliedEndTags() if self.tree.openElements[-1].name != name: self.parser.parseError((u"End tag (" + name + ") seen too " u"early. Expected other end tag.")) if inScope: node = self.tree.openElements.pop() while node.name != name: node = self.tree.openElements.pop() | 913244bcee47c21d2bbc2443babbca4d1fb43acd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9368/913244bcee47c21d2bbc2443babbca4d1fb43acd/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
1768,
12,
2890,
16,
508,
4672,
468,
6426,
584,
1473,
316,
326,
2145,
7983,
5057,
1965,
309,
508,
422,
315,
1484,
6877,
365,
18,
2567,
3819,
11600,
273,
365,
18,
2567,
3819,
11600,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
1768,
12,
2890,
16,
508,
4672,
468,
6426,
584,
1473,
316,
326,
2145,
7983,
5057,
1965,
309,
508,
422,
315,
1484,
6877,
365,
18,
2567,
3819,
11600,
273,
365,
18,
2567,
3819,
11600,... |
new_node = markdown.etree.fromstring(new_text) node.clear() node.text = new_node.text node[:] = list(new_node) | try: new_node = markdown.etree.fromstring(new_text) node.clear() node.text = new_node.text node[:] = list(new_node) except SyntaxError: log.exception('Error adding <br> tags') pass | def run(self, root): for node in root.getiterator('p'): text = markdown.etree.tostring(node).strip() if '\n' not in text: continue new_text = text.replace('\n', '<br/>') new_node = markdown.etree.fromstring(new_text) node.clear() node.text = new_node.text node[:] = list(new_node) return root | e01e26f1765af5b7d92152b1276198db766b009b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/e01e26f1765af5b7d92152b1276198db766b009b/markdown_extensions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
1365,
4672,
364,
756,
316,
1365,
18,
588,
9838,
2668,
84,
11,
4672,
977,
273,
12737,
18,
31303,
18,
14627,
371,
12,
2159,
2934,
6406,
1435,
309,
2337,
82,
11,
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,
1086,
12,
2890,
16,
1365,
4672,
364,
756,
316,
1365,
18,
588,
9838,
2668,
84,
11,
4672,
977,
273,
12737,
18,
31303,
18,
14627,
371,
12,
2159,
2934,
6406,
1435,
309,
2337,
82,
11,
486,
... |
padx=5, padx=0, ipadx=0) | padx=5, ipadx=0) | def createDialog(self): self.app = tk.Tk() self.app.protocol('WM_DELETE_WINDOW', self.denyWindowManagerClose) self.app.title(self.title) # # the main window self.entryWidgets = [None]*len(self.options) self.labelWidgets = [None]*len(self.options) # all use grid management # top message topMsg = tk.Label(self.app, text=self.description) topMsg.grid(row=0, column=0, columnspan = 2 * self.nCol, sticky=tk.E + tk.W, padx=10, pady=5) # find out number of items etc numRows = self.getNumOfRows(True) rowIndex = 0 # all entries for g,opt in enumerate(self.options): if not (opt.has_key('label') or opt.has_key('separator')): continue colIndex = rowIndex / numRows value = self.values[g] # use different entry method for different types if opt.has_key('separator'): self.labelWidgets[g] = tk.Label(self.app, text=opt['separator'], font=tkFont.Font(size=12, weight='bold')) self.labelWidgets[g].grid(column=colIndex*2, row= rowIndex % numRows + 1, ipadx=0, padx=0, sticky=tk.E) emptyInput = tk.Label(self.app, text='') emptyInput.grid(column = colIndex*2 + 1, row= rowIndex % numRows + 1, ipadx=0, padx=0) self.entryWidgets[g] = None rowIndex += 1 continue if opt.has_key('chooseOneOf'): # single choice height = len(opt['chooseOneOf']) self.labelWidgets[g] = tk.Label(self.app, text=opt['label']) self.labelWidgets[g].grid(column=colIndex*2, row=rowIndex%numRows+1, padx=5, rowspan = height, sticky=tk.E) self.entryWidgets[g] = tk.Listbox(self.app, selectmode=tk.SINGLE, exportselection=0, height = height) self.entryWidgets[g].grid(column=colIndex*2+1, row=rowIndex%numRows+1, padx=5, rowspan = height) rowIndex += height for entry in opt['chooseOneOf']: self.entryWidgets[g].insert(tk.END, str(entry)) if value is not None: self.entryWidgets[g].select_set(opt['chooseOneOf'].index(value)) elif opt.has_key('chooseFrom'): # multiple choice height = len(opt['chooseFrom']) self.labelWidgets[g] = tk.Label(self.app, text=opt['label']) self.labelWidgets[g].grid(column=colIndex*2, row=rowIndex%numRows+1, padx=5, rowspan = height, sticky=tk.E) self.entryWidgets[g] = tk.Listbox(self.app, selectmode=tk.EXTENDED, exportselection=0, height = height) self.entryWidgets[g].grid(column=colIndex*2+1, row=rowIndex%numRows+1, padx=5, rowspan = height) rowIndex += height for entry in opt['chooseFrom']: self.entryWidgets[g].insert(tk.END, str(entry)) if value is not None: if type(value) in [types.TupleType, types.ListType]: for val in value: self.entryWidgets[g].select_set( opt['chooseFrom'].index(val)) else: self.entryWidgets[g].select_set( opt['chooseFrom'].index( value )) elif (opt.has_key('arg') and opt['arg'][-1] != ':') or \ (opt.has_key('longarg') and opt['longarg'][-1] != '='): # true or false self.labelWidgets[g] = tk.Label(self.app, text=opt['label']) self.labelWidgets[g].grid(column=colIndex*2, row=rowIndex%numRows+1, padx=10, rowspan = 1, sticky=tk.E) # replace value by a tk IntVar() because tk.Checkbutton has to store # its value in such a variable. value.get() will be used to return the # state of this Checkbutton. # c.f. http://infohost.nmt.edu/tcc/help/pubs/tkinter/control-variables.html iv = tk.IntVar() iv.set(self.values[g] == True) # value can be None, True or False self.values[g] = iv self.entryWidgets[g] = tk.Checkbutton(self.app, height=1, text = "Yes / No", variable=self.values[g]) self.entryWidgets[g].grid(column=colIndex*2+1, row=rowIndex%numRows+1, padx=5, sticky=tk.W) rowIndex += 1 self.entryWidgets[g].deselect() else: self.labelWidgets[g] = tk.Label(self.app, text=opt['label']) self.labelWidgets[g].grid(column=colIndex*2, row=rowIndex%numRows+1, padx=5, sticky=tk.E) self.entryWidgets[g] = tk.Entry(self.app) self.entryWidgets[g].grid(column=colIndex*2+1, row=rowIndex%numRows+1, padx=5, padx=0, ipadx=0) rowIndex += 1 # put default value into the entryWidget if value is not None: self.entryWidgets[g].insert(0, prettyOutput(value)) self.entryWidgets[g].bind("<Return>", self.onOK) self.entryWidgets[g].bind("<Escape>", self.onCancel) # help button helpButton = tk.Button(self.app, takefocus=1, text="Help") helpButton.bind("<Return>", self.onHelp) helpButton.bind("<Button-1>", self.onHelp) helpButton.grid(column=0, columnspan=self.nCol, row = numRows+1, pady=20) # ok button okButton = tk.Button(self.app, takefocus=1, text="Run!") okButton.bind("<Return>", self.onOK) okButton.bind("<Button-1>", self.onOK) okButton.grid( column=self.nCol, columnspan=self.nCol, row = numRows+1, pady=20) # cancel button cancelButton = tk.Button(self.app, takefocus=1, text="Cancel") cancelButton.bind("<Return>", self.onCancel) cancelButton.bind("<Button-1>", self.onCancel) cancelButton.grid( column=0, columnspan=2*self.nCol, row = numRows+1, pady=20) # self.app.bind("<Escape>", self.onCancel) # first un-none for g in range(len(self.options)): if self.entryWidgets[g] is not None: self.entryWidgets[g].focus_force() break | 286e24f4f75c5527056758f6bd40d8687ae44f4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/401/286e24f4f75c5527056758f6bd40d8687ae44f4c/simuOpt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
6353,
12,
2890,
4672,
365,
18,
2910,
273,
13030,
18,
56,
79,
1435,
365,
18,
2910,
18,
8373,
2668,
25173,
67,
6460,
67,
23407,
2187,
365,
18,
13002,
93,
3829,
1318,
4605,
13,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
6353,
12,
2890,
4672,
365,
18,
2910,
273,
13030,
18,
56,
79,
1435,
365,
18,
2910,
18,
8373,
2668,
25173,
67,
6460,
67,
23407,
2187,
365,
18,
13002,
93,
3829,
1318,
4605,
13,
365,
... |
output += Record.INTERNAL_FORMAT % "PUBMED" output += self.pubmed_id | output += Record.OTHER_INTERNAL_FORMAT % "PUBMED" output += self.pubmed_id + "\n" | def _pubmed_line(self): """Output for PUBMED information. """ output = "" if self.pubmed_id: output += Record.INTERNAL_FORMAT % "PUBMED" output += self.pubmed_id return output | e78f502ab9e90b3b912ce01557b24207bb78184e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/e78f502ab9e90b3b912ce01557b24207bb78184e/Record.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10174,
2937,
67,
1369,
12,
2890,
4672,
3536,
1447,
364,
23295,
25773,
1779,
18,
3536,
876,
273,
1408,
309,
365,
18,
10174,
2937,
67,
350,
30,
876,
1011,
5059,
18,
23940,
67,
14005,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10174,
2937,
67,
1369,
12,
2890,
4672,
3536,
1447,
364,
23295,
25773,
1779,
18,
3536,
876,
273,
1408,
309,
365,
18,
10174,
2937,
67,
350,
30,
876,
1011,
5059,
18,
23940,
67,
14005,
... |
atom = graph.molecule.atoms[atomindex] | atom = atoms[atomindex] | def coords_to_zeobuilder(org_coords, opt_coords, atoms, parent, graph=None): if graph == None: groups = [numpy.arange(len(atoms))] else: # if the molecular graph has disconnected islands, then each independent # part is treated seperately in the loop below groups = graph.independent_vertices for group in groups: group_org = org_coords[group] group_opt = opt_coords[group] # Transform the guessed geometry as to overlap with the original geometry transf = superpose(group_org, group_opt) group_opt = transf * group_opt # Put coordinates of guessed geometry back into Zeobuilder model for i,atomindex in enumerate(group): atom = graph.molecule.atoms[atomindex] # Make sure atoms in subframes are treated properly transf = atom.parent.get_frame_relative_to(parent) org_pos = atom.transformation.t opt_pos = transf.inv * group_opt[i] primitive.Transform(atom, Translation(opt_pos - org_pos)) | d22f90023195fc26b12942793d0e4cef18299a1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11052/d22f90023195fc26b12942793d0e4cef18299a1b/geometry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6074,
67,
869,
67,
8489,
947,
953,
12,
3341,
67,
9076,
16,
2153,
67,
9076,
16,
9006,
16,
982,
16,
2667,
33,
7036,
4672,
309,
2667,
422,
599,
30,
3252,
273,
306,
15974,
18,
297,
726,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6074,
67,
869,
67,
8489,
947,
953,
12,
3341,
67,
9076,
16,
2153,
67,
9076,
16,
9006,
16,
982,
16,
2667,
33,
7036,
4672,
309,
2667,
422,
599,
30,
3252,
273,
306,
15974,
18,
297,
726,
... |
'hg annotate [-r REV] [-u] [-n] [-c] FILE...'), | 'hg annotate [OPTION]... FILE...'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() | 17c8db82b9238d90c35f7628ff62416747ae37c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/17c8db82b9238d90c35f7628ff62416747ae37c2/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
4881,
16,
3538,
4672,
3536,
8705,
326,
24425,
434,
326,
3352,
8395,
327,
3538,
18,
8705,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
4881,
16,
3538,
4672,
3536,
8705,
326,
24425,
434,
326,
3352,
8395,
327,
3538,
18,
8705,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
pid = wx.wxExecute(cmd, 0, process) | if wx.wxVERSION > (2, 3, 2): flags = wx.wxEXEC_NOHIDE else: flags = 0 pid = wx.wxExecute(cmd, flags, process) | def spawnChild(monitor, process, args=''): """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" %s' % (sys.executable, script_fn, args) 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 new_port = 20202 # Hopefully free def run_tcpwatch(port1, port2): os.system("tcpwatch -L %d:127.0.0.1:%d" % ( int(port1), int(port2))) start_new_thread(run_tcpwatch, (new_port, port)) time.sleep(3) port = new_port 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 | 58ab2b5cc630600d11050cf5e6b0106c3bb1f7d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/58ab2b5cc630600d11050cf5e6b0106c3bb1f7d2/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,... |
STORED = Field.Store.YES UN_INDEXED = Field.Index.NO UN_TOKENIZED = Field.Index.UN_TOKENIZED doc = Document() doc.add(Field("item", uItem.str64(), STORED, UN_TOKENIZED)) doc.add(Field("attribute", uAttr.str64(), STORED, UN_TOKENIZED)) doc.add(Field("value", uValue.str64(), STORED, UN_INDEXED)) doc.add(Field("version", str(version), STORED, UN_INDEXED)) doc.add(Field("contents", reader, Field.TermVector.YES)) indexWriter.addDocument(doc) | try: STORED = Field.Store.YES UN_INDEXED = Field.Index.NO UN_TOKENIZED = Field.Index.UN_TOKENIZED doc = Document() doc.add(Field("item", uItem.str64(), STORED, UN_TOKENIZED)) doc.add(Field("attribute", uAttr.str64(), STORED, UN_TOKENIZED)) doc.add(Field("value", uValue.str64(), STORED, UN_INDEXED)) doc.add(Field("version", str(version), STORED, UN_INDEXED)) doc.add(Field("contents", reader, Field.TermVector.YES)) indexWriter.addDocument(doc) except JavaError: self.store.repository.logger.exception("in indexReader()") | def indexReader(self, indexWriter, reader, uItem, uAttr, uValue, version): | f7036d7f3debee5c923bee7501174e1c46813284 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/f7036d7f3debee5c923bee7501174e1c46813284/FileContainer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
2514,
12,
2890,
16,
770,
2289,
16,
2949,
16,
582,
1180,
16,
582,
3843,
16,
582,
620,
16,
1177,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
2514,
12,
2890,
16,
770,
2289,
16,
2949,
16,
582,
1180,
16,
582,
3843,
16,
582,
620,
16,
1177,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if 'index' in info: | if 'index' in info and linenum != len(self.lines): | def parse_special_header(self, linenum, info): linenum = super(SVNDiffParser, self).parse_special_header(linenum, info) | d6c2e9795681149e970a9e3743938fed5e6b4ce7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/d6c2e9795681149e970a9e3743938fed5e6b4ce7/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
9371,
67,
3374,
12,
2890,
16,
4739,
7924,
16,
1123,
4672,
4739,
7924,
273,
2240,
12,
23927,
2908,
3048,
2678,
16,
365,
2934,
2670,
67,
9371,
67,
3374,
12,
7511,
7924,
16,
112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
9371,
67,
3374,
12,
2890,
16,
4739,
7924,
16,
1123,
4672,
4739,
7924,
273,
2240,
12,
23927,
2908,
3048,
2678,
16,
365,
2934,
2670,
67,
9371,
67,
3374,
12,
7511,
7924,
16,
112... |
return work_db_naive_mem(conf) | db_type = conf.work_db_type class_name = "work_db_%s" % db_type g = globals() if g.has_key(class_name): cls = g[class_name] else: Es("no such work_db_type %s, defaults to text\n" % db_type) cls = work_db_text return cls(conf) | def mk_work_db(conf): return work_db_naive_mem(conf) | 7174d4736f8e656778dd6ef8c003dbc1c4b7a48f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/924/7174d4736f8e656778dd6ef8c003dbc1c4b7a48f/gxp_js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
67,
1252,
67,
1966,
12,
3923,
4672,
1319,
67,
723,
273,
2195,
18,
1252,
67,
1966,
67,
723,
667,
67,
529,
273,
315,
1252,
67,
1966,
10185,
87,
6,
738,
1319,
67,
723,
314,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
67,
1252,
67,
1966,
12,
3923,
4672,
1319,
67,
723,
273,
2195,
18,
1252,
67,
1966,
67,
723,
667,
67,
529,
273,
315,
1252,
67,
1966,
10185,
87,
6,
738,
1319,
67,
723,
314,
273,
... |
value = _EmptyClass() value.__class__ = klass else: | try: value = _EmptyClass() value.__class__ = klass instantiated = 1 except RuntimeError: pass if not instantiated: | def load_obj(self): stack = self.stack k = self.marker() klass = stack[k + 1] del stack[k + 1] args = tuple(stack[k + 1:]) del stack[k:] | 7fc9684d2fed30316a5c0d0d805b97af7abc7d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7fc9684d2fed30316a5c0d0d805b97af7abc7d32/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2603,
12,
2890,
4672,
2110,
273,
365,
18,
3772,
417,
273,
365,
18,
11145,
1435,
7352,
273,
2110,
63,
79,
397,
404,
65,
1464,
2110,
63,
79,
397,
404,
65,
833,
273,
3193,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2603,
12,
2890,
4672,
2110,
273,
365,
18,
3772,
417,
273,
365,
18,
11145,
1435,
7352,
273,
2110,
63,
79,
397,
404,
65,
1464,
2110,
63,
79,
397,
404,
65,
833,
273,
3193,
12,... |
lexer = get_lexer_for_filename(filename, stripnl=False) | lexer = get_lexer_for_filename(filename, stripnl=False, encoding='utf-8') | def apply_pygments(data, filename): # XXX Guessing is preferable but really slow, especially on XML # files. #if filename.endswith(".xml"): lexer = get_lexer_for_filename(filename, stripnl=False) #else: # lexer = guess_lexer_for_filename(filename, data, stripnl=False) | 2720c7d35cc3991ccd2182e08931a35752aaf203 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/2720c7d35cc3991ccd2182e08931a35752aaf203/diffutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
2074,
75,
1346,
12,
892,
16,
1544,
4672,
468,
11329,
30282,
310,
353,
13256,
429,
1496,
8654,
11816,
16,
29440,
603,
3167,
468,
377,
1390,
18,
468,
430,
1544,
18,
5839,
1918,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
2074,
75,
1346,
12,
892,
16,
1544,
4672,
468,
11329,
30282,
310,
353,
13256,
429,
1496,
8654,
11816,
16,
29440,
603,
3167,
468,
377,
1390,
18,
468,
430,
1544,
18,
5839,
1918,
... |
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('string').encode('utf8')) | trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('string')) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') access_pool = self.pool.get('ir.model.access') can_see = any(access_pool.check_groups(cr, user, group) for group in groups) if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making field visible later del(node.attrib['groups']) return can_see else: return True | 3dd004798135bad79208cd34821a64f7f7cbede1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/3dd004798135bad79208cd34821a64f7f7cbede1/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
2006,
67,
6011,
273,
365,
18,
6011,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
2006,
67,
6011,
273,
365,
18,
6011,
18,
588,
... |
table_elems = xmldoc.getElementsByTagName(ligolw.Table.tagName) | table_elems = dbtables.get_xml(connection).getElementsByTagName(ligolw.Table.tagName) | def update_ids(xmldoc, connection, verbose = False): """ For internal use only. """ table_elems = xmldoc.getElementsByTagName(ligolw.Table.tagName) for i, tbl in enumerate(table_elems): if verbose: print >>sys.stderr, "updating IDs: %d%%\r" % (100 * i / len(table_elems)), tbl.applyKeyMapping() if verbose: print >>sys.stderr, "updating IDs: 100%" # reset ID mapping for next document dbtables.idmap_reset(connection) | c919bd8b8a16850b9c39d56810fa60b9c4ae227f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3589/c919bd8b8a16850b9c39d56810fa60b9c4ae227f/ligolw_sqlite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2232,
12,
2902,
2434,
16,
1459,
16,
3988,
273,
1083,
4672,
3536,
2457,
2713,
999,
1338,
18,
3536,
1014,
67,
292,
7424,
273,
1319,
9373,
18,
588,
67,
2902,
12,
4071,
2934,
588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2232,
12,
2902,
2434,
16,
1459,
16,
3988,
273,
1083,
4672,
3536,
2457,
2713,
999,
1338,
18,
3536,
1014,
67,
292,
7424,
273,
1319,
9373,
18,
588,
67,
2902,
12,
4071,
2934,
588... |
publisherDown=False, protocolVersion=-1): | publisherDown=False, protocolVersion=-1 ): | def __init__(self, root, depth=-1, branch=-1, numFiles=-1, binFileSize=-1, binRandomSeed=long(time.time()), maxFileName=-1, fileTypes=[], oddBranchContent=-1, badFileLoc=None, badFileNum=-1, publisherDown=False, protocolVersion=-1): self.root = root self.depth = depth self.branch = branch self.numFiles = numFiles self.binFileSize = binFileSize self.binRandomSeed = binRandomSeed self.maxFileName = maxFileName self.fileTypeArray = fileTypes self.fileTypes = sum(self.fileTypeArray) self.oddBranchContent = oddBranchContent self.badFileLoc = badFileLoc self.badFileNum = badFileNum self.publisherDown = publisherDown self.protocolVersion = protocolVersion self.baseUrl = 'http://www.example.com' self.dirStruct = path.join('www.example.com', 'http') self.pluginId = 'org.lockss.plugin.simulated.SimulatedPlugin' self.auId = "%s&root~%s" % (self.pluginId.replace('.', '|'), self.root) self.title = "Simulated Content: " + root self.startUrl = self.baseUrl + '/index.html' | cb9a70c7bbdce1e09c351d60188d3e6bda051e84 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/766/cb9a70c7bbdce1e09c351d60188d3e6bda051e84/lockss_daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
16,
3598,
29711,
21,
16,
3803,
29711,
21,
16,
818,
2697,
29711,
21,
16,
4158,
15100,
29711,
21,
16,
4158,
8529,
12702,
33,
5748,
12,
957,
18,
957,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1365,
16,
3598,
29711,
21,
16,
3803,
29711,
21,
16,
818,
2697,
29711,
21,
16,
4158,
15100,
29711,
21,
16,
4158,
8529,
12702,
33,
5748,
12,
957,
18,
957,
... |
self.canvasitems[2] = self.gcomprisBoard.canvas.root().add( | self.rootitem.add( | def start(self): self.gcomprisBoard.level=1 self.gcomprisBoard.maxlevel=1 self.gcomprisBoard.sublevel=1 self.gcomprisBoard.number_of_sublevel=1 | 690f8ac7446757307ab013b8fb8fe772b4ea0d9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/690f8ac7446757307ab013b8fb8fe772b4ea0d9d/watercycle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
75,
832,
683,
291,
22233,
18,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
1896,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
87,
1255... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
75,
832,
683,
291,
22233,
18,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
1896,
2815,
33,
21,
365,
18,
75,
832,
683,
291,
22233,
18,
87,
1255... |
cr = pooler.get_db(db).cursor() | cr = pooler.get_db(db).cursor() | def access(self, db, uid, passwd, sec_level, ids): if not passwd: return False cr = pooler.get_db(db).cursor() cr.execute('select id from res_users where id=%s and password=%s', (uid, passwd)) res = cr.fetchone() cr.close() if not res: raise security.ExceptionNoTb('Bad username or password') return res[0] | 0a5f82bd3b22aa2fc8fe3a0baa53c7020b314313 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0a5f82bd3b22aa2fc8fe3a0baa53c7020b314313/res_user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2006,
12,
2890,
16,
1319,
16,
4555,
16,
19093,
16,
1428,
67,
2815,
16,
3258,
4672,
309,
486,
19093,
30,
327,
1083,
4422,
273,
2845,
264,
18,
588,
67,
1966,
12,
1966,
2934,
9216,
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,
2006,
12,
2890,
16,
1319,
16,
4555,
16,
19093,
16,
1428,
67,
2815,
16,
3258,
4672,
309,
486,
19093,
30,
327,
1083,
4422,
273,
2845,
264,
18,
588,
67,
1966,
12,
1966,
2934,
9216,
1435,
... |
raise Error("Command '%s' execution failed - %d"%(cmd,rv)) | raise Error("Command '%s' execution failed - %d"%(cmd,returncode)) | def get_cmd_data(cmd, env=None, isSystem=False, fold_stderr=True, verbose=False, fail_nonzero=True): """ Run the given command, and return its (returncode, stdout, stderr). If 'fold_stderr', then "fold" stderr into stdout, and return (returncode, stdout_data, NONE). If 'fail_nonzero' then if the return code is non-0, raise an explanatory exception (Error is 'isSystem', otherwise Failure). And yes, that means the default use-case returns a tuple of the form (0, <string>, None), but otherwise it gets rather awkward handling all the options. """ if env is None: env = os.environ if verbose: print "> %s"%cmd p = subprocess.Popen(cmd, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT if fold_stderr else subprocess.PIPE) stdoutdata, stderrdata = p.communicate() returncode = p.returncode if fail_nonzero and returncode: if isSystem: raise Error("Command '%s' execution failed - %d"%(cmd,rv)) else: raise Failure("Command '%s' execution failed - %d"%(cmd,rv)) return returncode, stdoutdata, stderrdata | c8f3ed3c1058a348f4f7bde90d4532d10c8c1845 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4427/c8f3ed3c1058a348f4f7bde90d4532d10c8c1845/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4172,
67,
892,
12,
4172,
16,
1550,
33,
7036,
16,
353,
3163,
33,
8381,
16,
11590,
67,
11241,
33,
5510,
16,
3988,
33,
8381,
16,
2321,
67,
26449,
33,
5510,
4672,
3536,
1939,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4172,
67,
892,
12,
4172,
16,
1550,
33,
7036,
16,
353,
3163,
33,
8381,
16,
11590,
67,
11241,
33,
5510,
16,
3988,
33,
8381,
16,
2321,
67,
26449,
33,
5510,
4672,
3536,
1939,
32... |
if os.path.exists('00_cmt'+ext): return | if os.path.exists('00_cmt'+ext): os.remove('00_cmt'+ext) | def do_link(ext): if os.path.exists('00_cmt'+ext): return os.symlink(setup+ext,'00_cmt'+ext) | 2bc9d5f5c57ce25b04080895d1b78e76783fee30 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9874/2bc9d5f5c57ce25b04080895d1b78e76783fee30/cmt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1232,
12,
408,
4672,
309,
1140,
18,
803,
18,
1808,
2668,
713,
67,
71,
1010,
11,
15,
408,
4672,
1140,
18,
4479,
2668,
713,
67,
71,
1010,
11,
15,
408,
13,
1140,
18,
21278,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
67,
1232,
12,
408,
4672,
309,
1140,
18,
803,
18,
1808,
2668,
713,
67,
71,
1010,
11,
15,
408,
4672,
1140,
18,
4479,
2668,
713,
67,
71,
1010,
11,
15,
408,
13,
1140,
18,
21278,
1... |
self.portstr = device(port) | self.portstr = device(port) | def __init__(self, port, #number of device, numbering starts at #zero. if everything fails, the user #can specify a device string, note #that this isn't portable anymore baudrate=9600, #baudrate bytesize=EIGHTBITS, #number of databits parity=PARITY_NONE, #enable parity checking stopbits=STOPBITS_ONE, #number of stopbits timeout=None, #set a timeout value, None for waiting forever xonxoff=0, #enable software flow control rtscts=0, #enable RTS/CTS flow control ): """init comm port""" self.fd = None self.timeout = timeout vmin = vtime = 0 #timeout is done via select #open if type(port) == type(''): #strings are taken directly self.portstr = port else: self.portstr = device(port) #numbers are transformed to a os dependant string try: self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK) except Exception, msg: self.fd = None raise serialutil.SerialException, "could not open port: %s" % msg fcntl.fcntl(self.fd, FCNTL.F_SETFL, 0) #set blocking self.__tcgetattr() #read current settings #set up raw mode / no echo / binary self.cflag = self.cflag | (TERMIOS.CLOCAL|TERMIOS.CREAD) self.lflag = self.lflag & ~(TERMIOS.ICANON|TERMIOS.ECHO|TERMIOS.ECHOE|TERMIOS.ECHOK|TERMIOS.ECHONL| TERMIOS.ECHOCTL|TERMIOS.ECHOKE|TERMIOS.ISIG|TERMIOS.IEXTEN) #|TERMIOS.ECHOPRT self.oflag = self.oflag & ~(TERMIOS.OPOST) if hasattr(TERMIOS, 'IUCLC'): self.iflag = self.iflag & ~(TERMIOS.INLCR|TERMIOS.IGNCR|TERMIOS.ICRNL|TERMIOS.IUCLC|TERMIOS.IGNBRK) else: self.iflag = self.iflag & ~(TERMIOS.INLCR|TERMIOS.IGNCR|TERMIOS.ICRNL|TERMIOS.IGNBRK) #setup baudrate try: self.ispeed = self.ospeed = baudIntToEnum[baudrate] except: raise ValueError,'invalid baud rate: %s' % baudrate #setup char len self.cflag = self.cflag & ~TERMIOS.CSIZE if bytesize == 8: self.cflag = self.cflag | TERMIOS.CS8 elif bytesize == 7: self.cflag = self.cflag | TERMIOS.CS7 elif bytesize == 6: self.cflag = self.cflag | TERMIOS.CS6 elif bytesize == 5: self.cflag = self.cflag | TERMIOS.CS5 else: raise ValueError,'invalid char len: '+str(clen) #setup stopbits if stopbits == STOPBITS_ONE: self.cflag = self.cflag & ~(TERMIOS.CSTOPB) elif stopbits == STOPBITS_TWO: self.cflag = self.cflag | (TERMIOS.CSTOPB) else: raise ValueError,'invalid stopit specification:'+str(stopbits) #setup parity self.iflag = self.iflag & ~(TERMIOS.INPCK|TERMIOS.ISTRIP) if parity == PARITY_NONE: self.cflag = self.cflag & ~(TERMIOS.PARENB|TERMIOS.PARODD) elif parity == PARITY_EVEN: self.cflag = self.cflag & ~(TERMIOS.PARODD) self.cflag = self.cflag | (TERMIOS.PARENB) elif parity == PARITY_ODD: self.cflag = self.cflag | (TERMIOS.PARENB|TERMIOS.PARODD) else: raise ValueError,'invalid parity: '+str(par) #setup flow control #xonxoff if hasattr(TERMIOS, 'IXANY'): if xonxoff: self.iflag = self.iflag | (TERMIOS.IXON|TERMIOS.IXOFF|TERMIOS.IXANY) else: self.iflag = self.iflag & ~(TERMIOS.IXON|TERMIOS.IXOFF|TERMIOS.IXANY) else: if xonxoff: self.iflag = self.iflag | (TERMIOS.IXON|TERMIOS.IXOFF) else: self.iflag = self.iflag & ~(TERMIOS.IXON|TERMIOS.IXOFF) #rtscts if hasattr(TERMIOS, 'CRTSCTS'): if rtscts: self.cflag = self.cflag | (TERMIOS.CRTSCTS) else: self.cflag = self.cflag & ~(TERMIOS.CRTSCTS) elif hasattr(TERMIOS, 'CNEW_RTSCTS'): #try it with alternate constant name if rtscts: self.cflag = self.cflag | (TERMIOS.CNEW_RTSCTS) else: self.cflag = self.cflag & ~(TERMIOS.CNEW_RTSCTS) #XXX should there be a warning if setting up rtscts (and xonxoff etc) fails?? #buffer #vmin "minimal number of characters to be read. = for non blocking" if vmin<0 or vmin>255: raise ValueError,'invalid vmin: '+str(vmin) self.cc[TERMIOS.VMIN] = vmin #vtime if vtime<0 or vtime>255: raise ValueError,'invalid vtime: '+str(vtime) self.cc[TERMIOS.VTIME] = vtime #activate settings self.__tcsetattr() | e566c0e850f0100cbf2ec4b128b86a6c61dbea41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/e566c0e850f0100cbf2ec4b128b86a6c61dbea41/serialposix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1756,
16,
5375,
468,
2696,
434,
2346,
16,
1300,
310,
2542,
622,
468,
7124,
18,
309,
7756,
6684,
16,
326,
729,
468,
4169,
4800,
279,
2346,
533,
16,
4721,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1756,
16,
5375,
468,
2696,
434,
2346,
16,
1300,
310,
2542,
622,
468,
7124,
18,
309,
7756,
6684,
16,
326,
729,
468,
4169,
4800,
279,
2346,
533,
16,
4721,
... |
packages[_("Keep (%d)") % len(keep)] = keep | packages[Sorter(_("Keep (%d)") % len(keep))] = keep | def __lt__(self, other): return cmp(self, other) < 0 | 3274cdd7fd076cb580f68fc96f93ff71250be9f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/3274cdd7fd076cb580f68fc96f93ff71250be9f9/changes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5618,
972,
12,
2890,
16,
1308,
4672,
327,
9411,
12,
2890,
16,
1308,
13,
411,
374,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5618,
972,
12,
2890,
16,
1308,
4672,
327,
9411,
12,
2890,
16,
1308,
13,
411,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
openid_form=OpenidSigninForm, auth_form=AuthenticationForm): | openid_form=OpenidSigninForm, auth_form=AuthenticationForm, on_failure=None): | def signin(request, template_name='authopenid/signin.html', redirect_field_name=REDIRECT_FIELD_NAME, openid_form=OpenidSigninForm, auth_form=AuthenticationForm): """ signin page. It manage the legacy authentification (user/password) and authentification with openid. :attr request: request object :attr template_name: string, name of template to use :attr redirect_field_name: string, field name used for redirect. by default 'next' :attr openid_form: form use for openid signin, by default `OpenidSigninForm` :attr auth_form: form object used for legacy authentification. by default AuthentificationForm form auser auth contrib. """ on_failure = signin_failure redirect_to = request.REQUEST.get(redirect_field_name, '') form1 = openid_form() form2 = auth_form() if request.POST: if not redirect_to or '//' in redirect_to or ' ' in redirect_to: redirect_to = settings.LOGIN_REDIRECT_URL if 'bsignin' in request.POST.keys(): form1 = openid_form(data=request.POST) if form1.is_valid(): sreg_req = sreg.SRegRequest(optional=['nickname', 'email']) redirect_url = "%s%s?%s" % ( get_url_host(request), reverse('user_complete_signin'), urllib.urlencode({ redirect_field_name: redirect_to }) ) return ask_openid(request, form1.cleaned_data['openid_url'], redirect_url, on_failure=signin_failure, sreg_request=sreg_req) elif 'blogin' in request.POST.keys(): # perform normal django authentification form2 = auth_form(data=request.POST) if form2.is_valid(): login(request, form2.get_user()) if request.session.test_cookie_worked(): request.session.delete_test_cookie() return HttpResponseRedirect(redirect_to) return render(template_name, { 'form1': form1, 'form2': form2, redirect_field_name: redirect_to, 'msg': request.GET.get('msg','') }, context_instance=RequestContext(request)) | 91542aa3f9c7eae76c960247aef367cd0bfbe1e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5675/91542aa3f9c7eae76c960247aef367cd0bfbe1e4/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1573,
267,
12,
2293,
16,
1542,
67,
529,
2218,
1944,
20619,
19,
2977,
267,
18,
2620,
2187,
3136,
67,
1518,
67,
529,
33,
25103,
67,
6776,
67,
1985,
16,
21629,
67,
687,
33,
3678,
350,
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,
1573,
267,
12,
2293,
16,
1542,
67,
529,
2218,
1944,
20619,
19,
2977,
267,
18,
2620,
2187,
3136,
67,
1518,
67,
529,
33,
25103,
67,
6776,
67,
1985,
16,
21629,
67,
687,
33,
3678,
350,
2... |
lyric = get_lyrics(song.getArtist(), song.getTitle()) | try: lyric = get_lyrics(song.getArtist(), song.getTitle()) except: LOG.error("Lyrics get error") pass | def get_album_image_url(self, song): """set urls""" """TODO TypeError: cannot concatenate 'str' and 'NoneType' objects """ self.lastfm_url.set_uri("http://www.lastfm.ru/search?q=" + song.getArtist() + "&type=artist") self.wiki_linkbutton.set_uri("http://en.wikipedia.org/w/index.php?search=" + song.getArtist()) self.mb_linkbutton.set_uri("http://musicbrainz.org/search/textsearch.html?type=artist&query=" + song.getArtist()) if song.getArtist() and song.getTitle(): lyric = get_lyrics(song.getArtist(), song.getTitle()) if lyric: self.lyrics_buffer.set_text(lyric) else: self.lyrics_buffer.set_text(_("Lyric not found")) self.lyric_artist_title.set_markup("<b>" + song.getArtist() + " - " + song.getTitle() + "</b>") self.current_song_label.set_markup("<b>" + song.getTitle() + "</b>") track = self.last_fm_network.get_track(song.getArtist(), song.getTitle()) self.similar_songs_cntr.parent = song.getArtist() + " - " + song.getTitle() LOG.info(track) if not track: return None """similar tracks""" try: similars = track.get_similar() except: LOG.error("Similar not found") return None self.similar_songs_cntr.clear() for tsong in similars: try: tsong_item = tsong.item except AttributeError: tsong_item = tsong['item'] #tsong = CommonBean(name=str(tsong_item), type=CommonBean.TYPE_MUSIC_URL) self.similar_songs_cntr.add_item(str(tsong_item)) """similar tags""" tags = track.get_top_tags(15) self.song_tags_cntr.clear() for tag in tags: try: tag_item = tag.item except AttributeError: tag_item = tag['item'] self.add_tag(tag_item.get_name()) """similar artists""" artist = track.get_artist() similar_artists = artist.get_similar(15) self.similar_artists_cntr.clear() for artist in similar_artists: try: artist_item = artist.item except AttributeError: artist_item = artist['item'] self.add_similar_artist(artist_item.get_name()) album = track.get_album() if album: self.album_name.set_markup("<b>" + song.getArtist() + " - " + album.get_name() + " (" + album.get_release_year() + ")</b>") else: self.album_name.set_markup(u"<b>" + song.getArtist() + "</b>") #album = self.last_fm_network.get_album(song.getArtist(), song.getTitle()) if not album: return None LOG.info("Find album", album) if self.last_album_name == album.get_name(): LOG.info("Album the same, not need to dowlaod image") #TODO need to implement album image cache return self.last_image if not album: return None LOG.info(album) try: self.last_album_name = album.get_name() heigth = gtk.gdk.screen_height() if heigth < 800: self.last_image = album.get_cover_image(size=pylast.COVER_LARGE) else: self.last_image = album.get_cover_image(size=pylast.COVER_EXTRA_LARGE) except: LOG.info("image not found for:", song) LOG.info("image:", self.last_image) return self.last_image | 978dcf2e0a4fabfa1322d6b7ce47fd8701ffde8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14563/978dcf2e0a4fabfa1322d6b7ce47fd8701ffde8b/information_controller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
25090,
67,
2730,
67,
718,
12,
2890,
16,
17180,
4672,
565,
3536,
542,
6903,
8395,
3536,
6241,
3580,
30,
2780,
11361,
296,
701,
11,
471,
296,
7036,
559,
11,
2184,
3536,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
25090,
67,
2730,
67,
718,
12,
2890,
16,
17180,
4672,
565,
3536,
542,
6903,
8395,
3536,
6241,
3580,
30,
2780,
11361,
296,
701,
11,
471,
296,
7036,
559,
11,
2184,
3536,
365,
18,... |
gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_autogen.h") | gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") | def main(argv): """This is the main function.""" parser = OptionParser() parser.add_option( "-g", "--generate-implementation-templates", action="store_true", help="generates files that are generally hand edited..") parser.add_option( "--generate-command-id-tests", action="store_true", help="generate tests for commands ids. Commands MUST not change ID!") parser.add_option( "-v", "--verbose", action="store_true", help="prints more output.") (options, args) = parser.parse_args(args=argv) gen = GLGenerator(options.verbose) gen.ParseGLH("common/GLES2/gl2.h") gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") gen.WriteFormat("common/gles2_cmd_format_autogen.h") gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_autogen.h") gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") gen.WriteServiceUtilsImplementation( "service/gles2_cmd_validation_implementation_autogen.h") if options.generate_command_id_tests: gen.WriteCommandIdTest("common/gles2_cmd_id_test_autogen.h") if gen.errors > 0: print "%d errors" % gen.errors sys.exit(1) | 3916c97e1bb1ef3fecfdcaf9d80f239016756c06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/3916c97e1bb1ef3fecfdcaf9d80f239016756c06/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
3536,
2503,
353,
326,
2774,
445,
12123,
2082,
273,
18862,
1435,
2082,
18,
1289,
67,
3482,
12,
3701,
75,
3113,
5238,
7163,
17,
30810,
17,
8502,
3113,
1301,
1546,
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,
2774,
12,
19485,
4672,
3536,
2503,
353,
326,
2774,
445,
12123,
2082,
273,
18862,
1435,
2082,
18,
1289,
67,
3482,
12,
3701,
75,
3113,
5238,
7163,
17,
30810,
17,
8502,
3113,
1301,
1546,
22... |
dcg.grabDtellaTopic() | dch.grabDtellaTopic() | def syncComplete(self): | 5ba6c211de6e4baf794b345a1f2cc1554dbc3ea1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12372/5ba6c211de6e4baf794b345a1f2cc1554dbc3ea1/dtella.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
6322,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
6322,
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,
-... |
OUTPUT: bool | OUTPUT: - boolean; ``True`` if ``self`` and ``right`` are isomorphic groups; ``False`` otherwise. | def is_isomorphic(self, right): """ Return True if the groups are isomorphic. If mode="verbose" then an isomorphism is printed. INPUT: - ``self`` - this group - ``right`` - a permutation group OUTPUT: bool EXAMPLES:: sage: v = ['(1,2,3)(4,5)', '(1,2,3,4,5)'] sage: G = PermutationGroup(v) sage: H = PermutationGroup(['(1,2,3)(4,5)']) sage: G.is_isomorphic(H) False sage: G.is_isomorphic(G) True sage: G.is_isomorphic(PermutationGroup(list(reversed(v)))) True """ if not isinstance(right, PermutationGroup_generic): raise TypeError, "right must be a permutation group" G = self._gap_() H = right._gap_() return gap.eval("IsomorphismGroups( %s, %s )"%(G.name(),H.name())) != "fail" | f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
291,
362,
18435,
12,
2890,
16,
2145,
4672,
3536,
2000,
1053,
309,
326,
3252,
854,
353,
362,
18435,
18,
971,
1965,
1546,
11369,
6,
1508,
392,
353,
362,
7657,
6228,
353,
14099,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
291,
362,
18435,
12,
2890,
16,
2145,
4672,
3536,
2000,
1053,
309,
326,
3252,
854,
353,
362,
18435,
18,
971,
1965,
1546,
11369,
6,
1508,
392,
353,
362,
7657,
6228,
353,
14099,
... |
outfile.write("@%s[%s]" % (cmd, line)) | outfile.write("@%s[%s][%s]" % (cp, styleval, line)) | def format(self, tokensource, outfile): # TODO: add support for background colors enc = self.encoding | 4d385e994dd93f663c8e5897bfa9d153388d863a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6148/4d385e994dd93f663c8e5897bfa9d153388d863a/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
2430,
552,
16,
8756,
4672,
468,
2660,
30,
527,
2865,
364,
5412,
5740,
2446,
273,
365,
18,
5999,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
2430,
552,
16,
8756,
4672,
468,
2660,
30,
527,
2865,
364,
5412,
5740,
2446,
273,
365,
18,
5999,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
path = self.first_urls.get_active_text() | path = "." | def populate_table(self): # returns a list of dicts(path, summarize_kind, node_kind, prop_changed) summary = self.action.get_result(1) | c13318831ef6554cf062f7d57fb3fe0bee53d3b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5119/c13318831ef6554cf062f7d57fb3fe0bee53d3b0/compare.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
2121,
12,
2890,
4672,
468,
1135,
279,
666,
434,
15838,
12,
803,
16,
28712,
67,
9224,
16,
756,
67,
9224,
16,
2270,
67,
6703,
13,
4916,
273,
365,
18,
1128,
18,
588,
67,
2088,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
2121,
12,
2890,
4672,
468,
1135,
279,
666,
434,
15838,
12,
803,
16,
28712,
67,
9224,
16,
756,
67,
9224,
16,
2270,
67,
6703,
13,
4916,
273,
365,
18,
1128,
18,
588,
67,
2088,... |
bitesized_text='bitesized' | bitesized_text='bitesized', documentation_type='key', | def test_miro_bugzilla_detects_closedness(self, mock_xml_opener): cooked_xml = open(os.path.join( settings.MEDIA_ROOT, 'sample-data', 'miro-2294-2009-08-06.xml')).read().replace( 'NEW', 'CLOSED') mock_xml_opener.return_value = lxml.etree.XML(cooked_xml) | c386306223e60d09ed0ac73512e53a9f59eb6dd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/c386306223e60d09ed0ac73512e53a9f59eb6dd1/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9197,
303,
67,
925,
15990,
67,
16518,
87,
67,
12204,
4496,
12,
2890,
16,
5416,
67,
2902,
67,
25098,
4672,
15860,
329,
67,
2902,
273,
1696,
12,
538,
18,
803,
18,
5701,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9197,
303,
67,
925,
15990,
67,
16518,
87,
67,
12204,
4496,
12,
2890,
16,
5416,
67,
2902,
67,
25098,
4672,
15860,
329,
67,
2902,
273,
1696,
12,
538,
18,
803,
18,
5701,
12,
1... |
seekable = service.seek() | seekable = self.getSeek() | def doSeek(self, seektime): print "doseek", seektime service = self.session.nav.getCurrentService() if service is None: return seekable = service.seek() if seekable is None: return seekable.seekTo(90 * seektime) | f372e30ee47557091c643660761fb5fb822827ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/f372e30ee47557091c643660761fb5fb822827ec/InfoBarGenerics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
16134,
12,
2890,
16,
6520,
957,
4672,
1172,
315,
72,
2584,
3839,
3113,
6520,
957,
1156,
273,
365,
18,
3184,
18,
11589,
18,
588,
3935,
1179,
1435,
309,
1156,
353,
599,
30,
327,
225... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
16134,
12,
2890,
16,
6520,
957,
4672,
1172,
315,
72,
2584,
3839,
3113,
6520,
957,
1156,
273,
365,
18,
3184,
18,
11589,
18,
588,
3935,
1179,
1435,
309,
1156,
353,
599,
30,
327,
225... |
itemString += ("%s: %s (%s)<br>" % (key, clean(entryValue), clean(type(entryValue)))) | itemString += ( '<span class="editable">%s</span>: %s ' '<a href=%s>%s</a><br>' % (key, entryValue.itsName, toLink(entryValue.itsPath), entryValue.itsPath)) | def Render_dict(self, name, value): itemString = "" for key, entryValue in value.iteritems(): try: itemString += ( '<span class="editable">%s</span>: %s ' '<a href=%s>%s</a><br>' % (key, entryValue.itsName, toLink(entryValue.itsPath), entryValue.itsPath)) except: try: itemString += ("%s: %s (%s)<br>" % (key, clean(entryValue), clean(type(entryValue)))) except: itemString += "%s: <i>(Can't display)</i> (%s)<br>" % \ (key, clean(type(entryValue))) return itemString | 0ec3d8ab5330e943971e5ae80cb43bbd6f7ba3fe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/0ec3d8ab5330e943971e5ae80cb43bbd6f7ba3fe/repo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6987,
67,
1576,
12,
2890,
16,
508,
16,
460,
4672,
761,
780,
273,
1408,
364,
498,
16,
1241,
620,
316,
460,
18,
2165,
3319,
13332,
775,
30,
761,
780,
1011,
261,
2368,
3969,
667,
1546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6987,
67,
1576,
12,
2890,
16,
508,
16,
460,
4672,
761,
780,
273,
1408,
364,
498,
16,
1241,
620,
316,
460,
18,
2165,
3319,
13332,
775,
30,
761,
780,
1011,
261,
2368,
3969,
667,
1546,
... |
kwds = '' | def _repr_(self, simplify=True): if simplify: return self.simplify()._repr_(simplify=False) else: kwds = '' args = ', '.join([x._repr_(simplify=simplify) for x in self._args]) if not self._kwds is None: kwds = ', '.join(["%s=%s" %(x, y) for x,y in self._kwds.iteritems()]) | 9829d319044d570fa47335910ed27a36ec82d400 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/9829d319044d570fa47335910ed27a36ec82d400/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
16,
16499,
33,
5510,
4672,
309,
16499,
30,
327,
365,
18,
9812,
412,
1164,
1435,
6315,
12715,
67,
12,
9812,
412,
1164,
33,
8381,
13,
469,
30,
833,
273,
2265,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12715,
67,
12,
2890,
16,
16499,
33,
5510,
4672,
309,
16499,
30,
327,
365,
18,
9812,
412,
1164,
1435,
6315,
12715,
67,
12,
9812,
412,
1164,
33,
8381,
13,
469,
30,
833,
273,
2265,
... | |
guard = self.MakeGuard(filename) | def WriteFormat(self, filename): """Writes the command buffer format""" guard = self.MakeGuard(filename) file = CWriter(filename) self.WriteHeader(file) file.Write("\n") file.Write("#ifndef %s\n" % guard) file.Write("#define %s\n" % guard) file.Write("\n") file.Write( "#include \"gpu/command_buffer/common/gles2_cmd_utils.h\"\n") file.Write( "#include \"gpu/command_buffer/common/cmd_buffer_common.h\"\n") file.Write("\n") | fe9b9e029c920a893ad48ebfd3f4e78282a1845d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/fe9b9e029c920a893ad48ebfd3f4e78282a1845d/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1630,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
1296,
1613,
740,
8395,
585,
273,
385,
2289,
12,
3459,
13,
365,
18,
3067,
1864,
12,
768,
13,
585,
18,
3067,
31458,
82,
7923,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1630,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
1296,
1613,
740,
8395,
585,
273,
385,
2289,
12,
3459,
13,
365,
18,
3067,
1864,
12,
768,
13,
585,
18,
3067,
31458,
82,
7923,
585,
... | |
self.assertEquals(r, expected) reactor.iterate() reactor.iterate() reactor.iterate() | tutil.spinUntil(lambda :r == expected) tutil.spinUntil(lambda :pproto.ended) | def testCyclicAlias(self): aliases = {} domain = {'': TestDomain(aliases, [])} A1 = mail.alias.AddressAlias('alias2', domain, 'alias1') A2 = mail.alias.AddressAlias('alias3', domain, 'alias2') A3 = mail.alias.AddressAlias('alias1', domain, 'alias3') aliases.update({ 'alias1': A1, 'alias2': A2, 'alias3': A3 }) | b7a5f84340189d7589aaeca78cd80759f1fcc096 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b7a5f84340189d7589aaeca78cd80759f1fcc096/test_mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
17992,
18964,
2936,
12,
2890,
4672,
6900,
273,
2618,
2461,
273,
13666,
4278,
7766,
3748,
12,
13831,
16,
5378,
16869,
432,
21,
273,
4791,
18,
4930,
18,
1887,
2936,
2668,
4930,
22,
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,
1842,
17992,
18964,
2936,
12,
2890,
4672,
6900,
273,
2618,
2461,
273,
13666,
4278,
7766,
3748,
12,
13831,
16,
5378,
16869,
432,
21,
273,
4791,
18,
4930,
18,
1887,
2936,
2668,
4930,
22,
2... |
if context is None: context = getcontext() other = self._convert_other(other) sn = self._isnan() on = other._isnan() if sn or on: if on == 1 and sn != 2: return self if sn == 1 and on != 2: return other return self._check_nans(other, context) | other = _convert_other(other) if self._is_special or other._is_special: sn = self._isnan() on = other._isnan() if sn or on: if on == 1 and sn != 2: return self if sn == 1 and on != 2: return other return self._check_nans(other, context) | def min(self, other, context=None): """Returns the smaller value. | 1a63da64df2af26e1f050749c19281f1de9084fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a63da64df2af26e1f050749c19281f1de9084fa/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
326,
10648,
460,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
1356,
326,
10648,
460,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
sys.stderr.write(' Done.\n') | if not self.quiet: sys.stderr.write(' Done.\n') | def initcolormap(self): self.colormapinited = 1 if self.format == 'rgb': gl.RGBmode() gl.gconfig() return gl.cmode() gl.gconfig() self.skipchrom = 0 sys.stderr.write('Initializing color map...') self.initcmap() sys.stderr.write(' Done.\n') if self.offset == 0: gl.color(0x800) gl.clear() self.mask = 0x7ff else: self.mask = 0xfff gl.clear() | 9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a35d57ab2d1f2a8eafd0d487ac8166c93db0a5a/VFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
1293,
18804,
12,
2890,
4672,
365,
18,
1293,
18804,
2738,
329,
273,
404,
309,
365,
18,
2139,
422,
296,
10948,
4278,
5118,
18,
11343,
3188,
1435,
5118,
18,
75,
1425,
1435,
327,
5118,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
1293,
18804,
12,
2890,
4672,
365,
18,
1293,
18804,
2738,
329,
273,
404,
309,
365,
18,
2139,
422,
296,
10948,
4278,
5118,
18,
11343,
3188,
1435,
5118,
18,
75,
1425,
1435,
327,
5118,... |
usage: mock [options] /path/to/srpm optional commands: | usage: mock [options] [rebuild] /path/to/srpm(s) mock [options] chroot <cmd> mock [options] {init|clean|shell} commands: rebuild - build the specified SRPM(s) [default command] | def command_parse(): """return options and args from parsing the command line""" usage = """ usage: mock [options] /path/to/srpm optional commands: chroot - run the specified command within the chroot clean - clean out the specified chroot init - initialize the chroot, do not build anything""" parser = OptionParser(usage=usage, version=__VERSION__) parser.add_option("-r", action="store", type="string", dest="chroot", help="chroot name/config file name default: %default", default='default') parser.add_option("--no-clean", action ="store_false", dest="clean", help="do not clean chroot before building", default=True) parser.add_option("--arch", action ="store", dest="arch", default=None, help="target build arch") parser.add_option("--debug", action ="store_true", dest="debug", default=False, help="Output copious debugging information") parser.add_option("--resultdir", action="store", type="string", default=None, help="path for resulting files to be put") parser.add_option("--statedir", action="store", type="string", default=None, help="path for state file is written") parser.add_option("--uniqueext", action="store", type="string", default=None, help="Arbitrary, unique extension to append to buildroot directory name") parser.add_option("--configdir", action="store", dest="configdir", default=None, help="Change where config files are found") parser.add_option("--quiet", action ="store_true", dest="quiet", default=False, help="quiet down output") parser.add_option("--autocache", action ="store_true", dest="use_cache", default=False, help="Turn on build-root caching") parser.add_option("--rebuildcache", action ="store_true", dest="rebuild_cache", default=False, help="Force rebuild of build-root cache") return parser.parse_args() | 0da82906230f2f357462d9d3c9cd62ce6a934eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7328/0da82906230f2f357462d9d3c9cd62ce6a934eec/mock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
2670,
13332,
3536,
2463,
702,
471,
833,
628,
5811,
326,
1296,
980,
8395,
225,
4084,
273,
3536,
4084,
30,
5416,
306,
2116,
65,
306,
266,
3510,
65,
342,
803,
19,
869,
19,
11254... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
2670,
13332,
3536,
2463,
702,
471,
833,
628,
5811,
326,
1296,
980,
8395,
225,
4084,
273,
3536,
4084,
30,
5416,
306,
2116,
65,
306,
266,
3510,
65,
342,
803,
19,
869,
19,
11254... |
arguments.append(os.path.basename(scriptname)) self.addToInputSandbox.append(scriptname) if paramsDict.has_key('LogLevel'): | arguments.append( os.path.basename( scriptname ) ) self.addToInputSandbox.append( scriptname ) if paramsDict.has_key( 'LogLevel' ): | def _toJDL(self,xmlFile=''): #messy but need to account for xml file being in /tmp/guid dir """Creates a JDL representation of itself as a Job. """ #Check if we have to do old bootstrap... classadJob = ClassAd('[]') | 50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
46,
8914,
12,
2890,
16,
2902,
812,
2218,
11,
4672,
468,
81,
403,
93,
1496,
1608,
358,
2236,
364,
2025,
585,
3832,
316,
342,
5645,
19,
14066,
1577,
3536,
2729,
279,
804,
8914,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
869,
46,
8914,
12,
2890,
16,
2902,
812,
2218,
11,
4672,
468,
81,
403,
93,
1496,
1608,
358,
2236,
364,
2025,
585,
3832,
316,
342,
5645,
19,
14066,
1577,
3536,
2729,
279,
804,
8914,... |
c.appendExten("%s" % self.set, "UserEvent(ASTDB|Channel: ${CHAN}^Family: DND^Value: True", self.pbx ) | c.appendExten("%s" % self.set, "UserEvent(ASTDB|Channel: ${CHAN}^Family: DND^Value: True)", self.pbx ) | def createAsteriskConfig(self): import configlets tapisupport = False for obj in configlets.configlet_tree: if obj.__class__.__name__ == 'CfgOptSettings': if obj.tapi: tapisupport = True c = AstConf("extensions.conf") c.setSection(self.pbx) c.appendExten("%s" % self.set, "Set(DB(DND/%s/${CALLERIDNUM})=True)" % self.pbx, self.pbx) if tapisupport: needModule("app_cut") c.appendExten("%s" % self.set, "Set(CHAN=${CUT(CHANNEL|-|1)})", self.pbx) c.appendExten("%s" % self.set, "UserEvent(ASTDB|Channel: ${CHAN}^Family: DND^Value: True", self.pbx ) c.appendExten("%s" % self.set, "Playback(do-not-disturb)", self.pbx) c.appendExten("%s" % self.set, "Playback(activated)", self.pbx) c.appendExten("%s" % self.set, "Hangup", self.pbx) | 145a6b329f190b2bb32aba23759e9e0347188ba4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2627/145a6b329f190b2bb32aba23759e9e0347188ba4/cfg_app_dnd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
37,
8190,
10175,
809,
12,
2890,
4672,
1930,
642,
17307,
13495,
291,
416,
655,
273,
1083,
364,
1081,
316,
642,
17307,
18,
1425,
1810,
67,
3413,
30,
309,
1081,
16186,
1106,
972,
16186... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
37,
8190,
10175,
809,
12,
2890,
4672,
1930,
642,
17307,
13495,
291,
416,
655,
273,
1083,
364,
1081,
316,
642,
17307,
18,
1425,
1810,
67,
3413,
30,
309,
1081,
16186,
1106,
972,
16186... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 337) else quickfix.StringField.__init__(self, 337, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
6418,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
6418,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
9... |
self.write(cursor, user, [new_id], translate[lang], | self.write(cursor, user, new_id, translate[lang], | fields_def = self.fields_get(cursor, user, context=context) | 33a2aefda755900cf1c79acb1b8300ca1ad3541f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/33a2aefda755900cf1c79acb1b8300ca1ad3541f/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
9216,
16,
729,
16,
819,
33,
2472,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1466,
67,
536,
273,
365,
18,
2821,
67,
588,
12,
9216,
16,
729,
16,
819,
33,
2472,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
assert sys.getrefcount(a[1]) == 2 assert a[1] == 123.0 | assert_equal(sys.getrefcount(a[1]),2) assert_equal(a[1],123.0) | def check_set_double(self,level=5): a = UserList([1,2,3]) inline_tools.inline("a[1] = 123.0;",['a']) assert sys.getrefcount(a[1]) == 2 assert a[1] == 123.0 | 267b08d9c3e7613c126729a179f4503c91625e9c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7416/267b08d9c3e7613c126729a179f4503c91625e9c/test_scxx_object.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
542,
67,
9056,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
2177,
682,
3816,
21,
16,
22,
16,
23,
5717,
6370,
67,
6642,
18,
10047,
2932,
69,
63,
21,
65,
273,
17335,
18,
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,
866,
67,
542,
67,
9056,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
2177,
682,
3816,
21,
16,
22,
16,
23,
5717,
6370,
67,
6642,
18,
10047,
2932,
69,
63,
21,
65,
273,
17335,
18,
20,
... |
"""Return true if the character 'c' is a hexadecimal digit.""" return '0' <= c <= '9' or 'a' <= c <= 'f' or 'A' <= c <= 'F' | """Return true if the character 'c' is a hexadecimal digit.""" return '0' <= c <= '9' or 'a' <= c <= 'f' or 'A' <= c <= 'F' | def ishex(c): """Return true if the character 'c' is a hexadecimal digit.""" return '0' <= c <= '9' or 'a' <= c <= 'f' or 'A' <= c <= 'F' | 7ad3eb0691b28b7bbfefbfe6d3feaf80fa53186d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7ad3eb0691b28b7bbfefbfe6d3feaf80fa53186d/quopri.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
7118,
12,
71,
4672,
3536,
990,
638,
309,
326,
3351,
296,
71,
11,
353,
279,
20070,
8035,
12123,
327,
296,
20,
11,
1648,
276,
1648,
296,
29,
11,
578,
296,
69,
11,
1648,
276,
1648,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
7118,
12,
71,
4672,
3536,
990,
638,
309,
326,
3351,
296,
71,
11,
353,
279,
20070,
8035,
12123,
327,
296,
20,
11,
1648,
276,
1648,
296,
29,
11,
578,
296,
69,
11,
1648,
276,
1648,... |
[[-89.5 , -89. , -88.5 ], [-89.5 , -89. , -88.5 ], [-89.5 , -89. , -88.5 ]], | def test_Fstdc_ezgetlalo_KnownValues(self): """Fstdc_ezgetlalo should give known result with known input""" la = numpy.array( [[-89.5, -89. , -88.5], [-89.5, -89. , -88.5], [-89.5, -89. , -88.5]] ,dtype=numpy.dtype('float32'),order='FORTRAN') lo = numpy.array( [[ 180. , 180. , 180. ], [ 180.5, 180.5, 180.5], [ 181. , 181. , 181. ]] ,dtype=numpy.dtype('float32'),order='FORTRAN') cla = numpy.array( [[[-89.75, -89.25, -88.75], [-89.75, -89.25, -88.75], [-89.75, -89.25, -88.75]], [[-89.5 , -89. , -88.5 ], [-89.5 , -89. , -88.5 ], [-89.5 , -89. , -88.5 ]], [[-89.25, -88.75, -88.25], [-89.25, -88.75, -88.25], [-89.25, -88.75, -88.25]], [[-89.5 , -89. , -88.5 ], [-89.5 , -89. , -88.5 ], [-89.5 , -89. , -88.5 ]]] ,dtype=numpy.dtype('float32'),order='FORTRAN') clo = numpy.array( [[[ 180. , 180. , 180. ], [ 180.5 , 180.5 , 180.5 ], [ 181. , 181. , 181. ]], [[ 179.75, 179.75, 179.75], [ 180.25, 180.25, 180.25], [ 180.75, 180.75, 180.75]], [[ 180. , 180. , 180. ], [ 180.5 , 180.5 , 180.5 ], [ 181. , 181. , 181. ]], [[ 180.25, 180.25, 180.25], [ 180.75, 180.75, 180.75], [ 181.25, 181.25, 181.25]]] ,dtype=numpy.dtype('float32'),order='FORTRAN') ni = 3 nj = 3 grtyp='L' grref='L' (ig1,ig2,ig3,ig4) = rpnstd.cxgaig(grtyp,-89.5,180.0,0.5,0.5) (la2,lo2,cla2,clo2) = Fstdc.ezgetlalo((ni,nj),grtyp,(grref,ig1,ig2,ig3,ig4),None,None,0,1) self.assertFalse(numpy.any(la!=la2)) self.assertFalse(numpy.any(lo!=lo2)) for ic in range(0,4): if numpy.any(cla[ic,...]!=cla2[ic,...]): print ic,'cla' print cla[ic,...] print cla2[ic,...] self.assertFalse(numpy.any(cla[ic,...]!=cla2[ic,...])) if numpy.any(clo[ic,...]!=clo2[ic,...]): print ic,'clo' print clo[ic,...] print clo2[ic,...] self.assertFalse(numpy.any(clo[ic,...]!=clo2[ic,...])) | 0957ccd0ab986ea025154f907ecf12bfbc46b086 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1808/0957ccd0ab986ea025154f907ecf12bfbc46b086/rpnstdtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
42,
5084,
71,
67,
6664,
588,
80,
287,
83,
67,
11925,
1972,
12,
2890,
4672,
3536,
42,
5084,
71,
67,
6664,
588,
80,
287,
83,
1410,
8492,
4846,
563,
598,
4846,
810,
8395,
7125... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
42,
5084,
71,
67,
6664,
588,
80,
287,
83,
67,
11925,
1972,
12,
2890,
4672,
3536,
42,
5084,
71,
67,
6664,
588,
80,
287,
83,
1410,
8492,
4846,
563,
598,
4846,
810,
8395,
7125... | |
if auth_plugin.getUserFolder().getUser(user.getId()) is user: | user_of_plugin = auth_plugin.getUserFolder().getUser(user.getId()) if user_of_plugin is not None: | def user_in_group_factory(self, user): """ Returns a function that checks whether `user` is part of the specified group. | 696e806b1e62f5cf04b1c902862ee12b7cf29d04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/696e806b1e62f5cf04b1c902862ee12b7cf29d04/plugLDAPUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
267,
67,
1655,
67,
6848,
12,
2890,
16,
729,
4672,
3536,
2860,
279,
445,
716,
4271,
2856,
1375,
1355,
68,
353,
1087,
434,
326,
1269,
1041,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
267,
67,
1655,
67,
6848,
12,
2890,
16,
729,
4672,
3536,
2860,
279,
445,
716,
4271,
2856,
1375,
1355,
68,
353,
1087,
434,
326,
1269,
1041,
18,
2,
-100,
-100,
-100,
-100,
-100,
... |
@cached | def __init__(self, type): Converter.__init__(self, type) if type == "Provider": self.type = self.PROVIDER else: self.type = self.NAME | 3069d1da6697619b0ed6f58f57f52fc5d4d51e03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/3069d1da6697619b0ed6f58f57f52fc5d4d51e03/ServiceName.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
4672,
14768,
16186,
2738,
972,
12,
2890,
16,
618,
13,
309,
618,
422,
315,
2249,
6877,
365,
18,
723,
273,
365,
18,
26413,
469,
30,
365,
18,
723,
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,
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,
618,
4672,
14768,
16186,
2738,
972,
12,
2890,
16,
618,
13,
309,
618,
422,
315,
2249,
6877,
365,
18,
723,
273,
365,
18,
26413,
469,
30,
365,
18,
723,
27... | |
mo = self.__SECTCRE.match(line) | mo = self.SECTCRE.match(line) | def __read(self, fp): """Parse a sectioned setup file. | 9e480adf9b3520ea3deb322fd1214f53a2293a0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e480adf9b3520ea3deb322fd1214f53a2293a0d/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
12,
2890,
16,
4253,
4672,
3536,
3201,
279,
2442,
329,
3875,
585,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
12,
2890,
16,
4253,
4672,
3536,
3201,
279,
2442,
329,
3875,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
message = 'Blocked user "%s" from posting' % sender_id LOG('MailBoxer', PROBLEM, message) | message = '%s (%s): Blocked user %s (%s) from posting' %\ (self.getProperty('title', ''), self.getId(), user.getProperty('fn', ''), user.getId()) log.error(message) | def checkMail(self, REQUEST): # Check for ip, loops and spam. # Check for correct IP mtahosts = self.getValueFor('mtahosts') if mtahosts: if 'HTTP_X_FORWARDED_FOR' in self.REQUEST.environ.keys(): REMOTE_IP = self.REQUEST.environ['HTTP_X_FORWARDED_FOR'] else: REMOTE_IP = self.REQUEST.environ['REMOTE_ADDR'] | 022876f88e927316bd924ded9b9dc1cbc88f4167 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6274/022876f88e927316bd924ded9b9dc1cbc88f4167/XWFMailingList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6759,
12,
2890,
16,
12492,
4672,
468,
2073,
364,
2359,
16,
14075,
471,
24824,
18,
225,
468,
2073,
364,
3434,
2971,
312,
2351,
11588,
273,
365,
18,
24805,
1290,
2668,
1010,
69,
11588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6759,
12,
2890,
16,
12492,
4672,
468,
2073,
364,
2359,
16,
14075,
471,
24824,
18,
225,
468,
2073,
364,
3434,
2971,
312,
2351,
11588,
273,
365,
18,
24805,
1290,
2668,
1010,
69,
11588... |
attributes['office:title'] = office_title.encode('utf_8') | attributes['office:title'] = office_title | def _make_xpath_query(element_name, style=None, family=None, draw_name=None, draw_style=None, table_name=None, style_name=None, note_class=None, text_id=None, text_name=None, office_name=None, office_title=None, level=None, position=None, context=None, **kw): if context is None: query = ['//'] else: query = [] query.append(element_name) attributes = kw if style: attributes['text:style-name'] = style.encode('utf_8') if family: attributes['style:family'] = family if draw_name: attributes['draw:name'] = draw_name.encode('utf_8') if draw_style: attributes['draw:style-name'] = draw_style.encode('utf_8') if table_name: attributes['table:name'] = table_name.encode('utf_8') if style_name: attributes['style:name'] = style_name.encode('utf_8') if note_class: attributes['text:note-class'] = note_class if text_id: attributes['text:id'] = text_id if text_name: attributes['text:name'] = text_name.encode('utf_8') if office_name: attributes['office:name'] = office_name.encode('utf_8') if office_title: attributes['office:title'] = office_title.encode('utf_8') if level: attributes['text:outline-level'] = level # Sort attributes for reproducible test cases for qname in sorted(attributes): value = attributes[qname] if value is not None: query.append('[@{qname}="{value}"]'.format(qname=qname, value=str(value))) else: query.append('[@{qname}]'.format(qname=qname)) query = ''.join(query) if position is not None: query = '({query})[{position}]'.format(query=query, position=str(position)) return query | 4c27701c7ddcd949feef6f24cae30ec972c89e61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10612/4c27701c7ddcd949feef6f24cae30ec972c89e61/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
18644,
67,
2271,
12,
2956,
67,
529,
16,
2154,
33,
7036,
16,
6755,
33,
7036,
16,
3724,
67,
529,
33,
7036,
16,
3724,
67,
4060,
33,
7036,
16,
1014,
67,
529,
33,
7036,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
18644,
67,
2271,
12,
2956,
67,
529,
16,
2154,
33,
7036,
16,
6755,
33,
7036,
16,
3724,
67,
529,
33,
7036,
16,
3724,
67,
4060,
33,
7036,
16,
1014,
67,
529,
33,
7036,
1... |
return dir, branch | return realpath(dir), branch | def _parse_stock(stock): try: dir, branch = stock.split("#", 1) except ValueError: dir = stock branch = None | 627150a4dc71a949275caddf9eb632c7fc535155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/627150a4dc71a949275caddf9eb632c7fc535155/pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
15381,
12,
15381,
4672,
775,
30,
1577,
16,
3803,
273,
12480,
18,
4939,
2932,
7,
3113,
404,
13,
1335,
2068,
30,
1577,
273,
12480,
3803,
273,
599,
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,
389,
2670,
67,
15381,
12,
15381,
4672,
775,
30,
1577,
16,
3803,
273,
12480,
18,
4939,
2932,
7,
3113,
404,
13,
1335,
2068,
30,
1577,
273,
12480,
3803,
273,
599,
2,
-100,
-100,
-100,
-10... |
The value to give the ``<text>`` elements' ``font-family`` attribute, defaults to ``"monospace"``. | The value to give the wrapping ``<g>`` element's ``font-family`` attribute, defaults to ``"monospace"``. | def escape_html(text): """Escape &, <, > as well as single and double quotes for HTML.""" return text.replace('&', '&'). \ replace('<', '<'). \ replace('>', '>'). \ replace('"', '"'). \ replace("'", ''') | 9106d0b73f5fd10667ea3805a5e8b4eaa222201d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6148/9106d0b73f5fd10667ea3805a5e8b4eaa222201d/svg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4114,
67,
2620,
12,
955,
4672,
3536,
8448,
473,
16,
411,
16,
405,
487,
5492,
487,
2202,
471,
1645,
10681,
364,
3982,
12123,
327,
977,
18,
2079,
2668,
10,
2187,
5183,
931,
4359,
2934,
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,
4114,
67,
2620,
12,
955,
4672,
3536,
8448,
473,
16,
411,
16,
405,
487,
5492,
487,
2202,
471,
1645,
10681,
364,
3982,
12123,
327,
977,
18,
2079,
2668,
10,
2187,
5183,
931,
4359,
2934,
2... |
u = u'\U00010001\U00020002\U00030003\U00040004\U00050005' for encoding in ('utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'unicode_escape', 'unicode_internal'): verify(unicode(u.encode(encoding),encoding) == u) | def __str__(self): return self.x | 4a0e72fc9a811e71e17cda74ace222f138ec6a2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4a0e72fc9a811e71e17cda74ace222f138ec6a2d/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
365,
18,
92,
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,
1001,
701,
972,
12,
2890,
4672,
327,
365,
18,
92,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
self.say_public("Remember: votes can be changed at any time.") | def print_tally(self): "Publically display the vote tally." | 863bcdf6f9f1f2457e8bd3c074bd5ac41565511d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3953/863bcdf6f9f1f2457e8bd3c074bd5ac41565511d/wolfbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
88,
1230,
12,
2890,
4672,
315,
4782,
1230,
2562,
326,
12501,
268,
1230,
1199,
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,
1172,
67,
88,
1230,
12,
2890,
4672,
315,
4782,
1230,
2562,
326,
12501,
268,
1230,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
'words_used': [str(i) for i in words_used], | 'words_used': words_used, | def get(self): self.response.headers['Cache-Control'] = 'public, max-age=86400' id = self.request.path[6:] w = Word.get(id) if w: # Update access time. w.accessed = datetime.datetime.now() w.put() # Find users of this word. query = db.GqlQuery('SELECT __key__ FROM Word ' 'WHERE words_used=:1 ' 'ORDER BY score DESC', w.key()) words_used = query.fetch(100) if not words_used: words_used = [] # Output info on word. path = os.path.join(os.path.dirname(__file__), 'html/read.html') self.response.out.write(template.render(path, { 'id': id, 'description': w.description, 'definition': w.definition.split(' '), 'created': str(w.created), 'author': w.author, 'keywords': w.keywords, 'words_used': [str(i) for i in words_used], })) else: path = os.path.join(os.path.dirname(__file__), 'html/read_notfound.html') self.response.out.write(template.render(path, {})) | 6a9e66023c99bbce238e2d0d2a944ab00e99952c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3507/6a9e66023c99bbce238e2d0d2a944ab00e99952c/iconforth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
365,
18,
2740,
18,
2485,
3292,
1649,
17,
3367,
3546,
273,
296,
482,
16,
943,
17,
410,
33,
28,
1105,
713,
11,
612,
273,
365,
18,
2293,
18,
803,
63,
26,
26894,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
365,
18,
2740,
18,
2485,
3292,
1649,
17,
3367,
3546,
273,
296,
482,
16,
943,
17,
410,
33,
28,
1105,
713,
11,
612,
273,
365,
18,
2293,
18,
803,
63,
26,
26894,
3... |
def getKind(kindName): kindKind = view.findPath("//Schema/Core/Kind") matching = [] for kind in kindKind.iterItems(): if kind.itsName == kindName: matching.append(kind) if len(matching) == 0: return None return matching[0] def ofKind(kindName, recursive=True): kind = getKind(kindName) if kind is not None: for item in kind.iterItems(recursive=recursive): yield item | def getKind(kindName): kindKind = view.findPath("//Schema/Core/Kind") matching = [] | e28d47e01ba5208b075eb7c52cf1f7adf65dbe63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/e28d47e01ba5208b075eb7c52cf1f7adf65dbe63/gen_docs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21842,
12,
9224,
461,
4672,
3846,
5677,
273,
1476,
18,
4720,
743,
2932,
759,
3078,
19,
4670,
19,
5677,
7923,
3607,
273,
5378,
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,
0,
0,
0,
0,
0,
0,
0,
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,
21842,
12,
9224,
461,
4672,
3846,
5677,
273,
1476,
18,
4720,
743,
2932,
759,
3078,
19,
4670,
19,
5677,
7923,
3607,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
assert res == "bar results" | assert_equal(res,"bar results") | def check_std_noargs(self,level=5): a = foo() method = "bar" res = inline_tools.inline('return_val = a.mcall(method);',['a','method']) assert res == "bar results" first = sys.getrefcount(res) del res res = inline_tools.inline('return_val = a.mcall(method);',['a','method']) assert res == "bar results" second = sys.getrefcount(res) assert first == second | 1a2e32f8d57897230b5265290279639d73dda37e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/1a2e32f8d57897230b5265290279639d73dda37e/test_scxx_object.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
5084,
67,
2135,
1968,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
8431,
1435,
707,
273,
315,
3215,
6,
400,
273,
6370,
67,
6642,
18,
10047,
2668,
2463,
67,
1125,
273,
279,
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,
866,
67,
5084,
67,
2135,
1968,
12,
2890,
16,
2815,
33,
25,
4672,
279,
273,
8431,
1435,
707,
273,
315,
3215,
6,
400,
273,
6370,
67,
6642,
18,
10047,
2668,
2463,
67,
1125,
273,
279,
18... |
request.user.language = form.get('language', [''])[0] | request.user.language = wikiutil.clean_input(form.get('language', [''])[0]) | def _save_user_prefs(self): _ = self._ form = self.request.form request = self.request | ca9d149b6f6e52e2df1a52d1e3e60ffbca7d0cf3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/888/ca9d149b6f6e52e2df1a52d1e3e60ffbca7d0cf3/prefs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5688,
67,
1355,
67,
1484,
2556,
12,
2890,
4672,
389,
273,
365,
6315,
646,
273,
365,
18,
2293,
18,
687,
590,
273,
365,
18,
2293,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5688,
67,
1355,
67,
1484,
2556,
12,
2890,
4672,
389,
273,
365,
6315,
646,
273,
365,
18,
2293,
18,
687,
590,
273,
365,
18,
2293,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
nl('%s: %s: "%s" -> "%s"' % (TR('change', 'Change'), ev.field, ev.old, ev.new)) | nl('%s: %s: "%s" -> "%s"' % (TR('Change', 'Change'), ev.field, ev.old, ev.new)) | def indent_block(text): return '\n'.join([' %s' % line for line in text.split('\n')]) | 1e52812c6bc0a767280c2f079f13124f1a5dea9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/1e52812c6bc0a767280c2f079f13124f1a5dea9a/format_transcript.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3504,
67,
2629,
12,
955,
4672,
327,
2337,
82,
10332,
5701,
12,
3292,
565,
738,
87,
11,
738,
980,
565,
364,
980,
316,
977,
18,
4939,
2668,
64,
82,
6134,
5717,
225,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3504,
67,
2629,
12,
955,
4672,
327,
2337,
82,
10332,
5701,
12,
3292,
565,
738,
87,
11,
738,
980,
565,
364,
980,
316,
977,
18,
4939,
2668,
64,
82,
6134,
5717,
225,
2,
-100,
-100,
-100... |
if self.locationType = "3dloc": | if self.locationType == "3dloc": | def uploadSeishub(self): """ Upload xml file to seishub """ userid = "admin" passwd = "admin" | a75f8f415abda37fa849d746dcf131eef65ddc52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/a75f8f415abda37fa849d746dcf131eef65ddc52/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
1761,
1468,
373,
12,
2890,
4672,
3536,
9414,
2025,
585,
358,
695,
1468,
373,
3536,
6709,
273,
315,
3666,
6,
19093,
273,
315,
3666,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
1761,
1468,
373,
12,
2890,
4672,
3536,
9414,
2025,
585,
358,
695,
1468,
373,
3536,
6709,
273,
315,
3666,
6,
19093,
273,
315,
3666,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
bb.build.del_stamp('do_%s' % self.configuration.cmd, bbfile_data) | bb.build.del_stamp('do_%s' % self.configuration.cmd, self.status, fn) | def buildFile(self, buildfile): """ Build the file matching regexp buildfile """ | 532d757bc817a18dbfcdb2a77af1076228b7c2e3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2672/532d757bc817a18dbfcdb2a77af1076228b7c2e3/cooker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
812,
12,
2890,
16,
1361,
768,
4672,
3536,
3998,
326,
585,
3607,
7195,
1361,
768,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
812,
12,
2890,
16,
1361,
768,
4672,
3536,
3998,
326,
585,
3607,
7195,
1361,
768,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if hasattr(folder,'banned_links'): | if hasattr(self.folder(),'banned_links'): | def updateSpamBlocks(self): """ Update the wiki's spam-blocking rules based on this message. | f310a56a3d279b61b886acba64c8b84de6fd435f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5225/f310a56a3d279b61b886acba64c8b84de6fd435f/mailin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
3389,
301,
6450,
12,
2890,
4672,
3536,
2315,
326,
9050,
1807,
24824,
17,
18926,
2931,
2511,
603,
333,
883,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1089,
3389,
301,
6450,
12,
2890,
4672,
3536,
2315,
326,
9050,
1807,
24824,
17,
18926,
2931,
2511,
603,
333,
883,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def fl_get_chart_bounds(ob, min, max): """ fl_get_chart_bounds(ob, min, max) """ _fl_get_chart_bounds(ob, min, max) _fl_set_chart_maxnumb = cfuncproto(so_libforms, "fl_set_chart_maxnumb", cty.c_int, [cty.POINTER(FL_OBJECT), cty.c_int], | def fl_get_chart_bounds(pObject, min_bound, max_bound): """ fl_get_chart_bounds(pObject, min_bound, max_bound) """ _fl_get_chart_bounds(pObject, min_bound, max_bound) _fl_set_chart_maxnumb = cfuncproto(so_libforms, "fl_set_chart_maxnumb", cty.c_int, [cty.POINTER(FL_OBJECT), cty.c_int], | def fl_get_chart_bounds(ob, min, max): """ fl_get_chart_bounds(ob, min, max) """ _fl_get_chart_bounds(ob, min, max) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11563,
67,
10576,
12,
947,
16,
1131,
16,
943,
4672,
3536,
1183,
67,
588,
67,
11563,
67,
10576,
12,
947,
16,
1131,
16,
943,
13,
3536,
225,
389,
2242,
67,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
11563,
67,
10576,
12,
947,
16,
1131,
16,
943,
4672,
3536,
1183,
67,
588,
67,
11563,
67,
10576,
12,
947,
16,
1131,
16,
943,
13,
3536,
225,
389,
2242,
67,
588,
67,
... |
TaskManager.notify.debug('spawning doLater named: ' + task.name) | TaskManager.notify.debug('spawning doLater: %s' % (task)) | def __spawnDoLater(self, task): if TaskManager.notify.getDebug(): TaskManager.notify.debug('spawning doLater named: ' + task.name) # Add this task to the nameDict nameList = ifAbsentPut(self.nameDict, task.name, []) nameList.append(task) task.setStartTimeFrame(self.currentTime, self.currentFrame) # search from the beginning of the list to put this doLater in # the list in order of execution from earliest to latest # Assume it goes last unless we break out early index = len(self.doLaterList) + 1 for i in range(len(self.doLaterList)): dl = self.doLaterList[i] remainingTime = ((dl.starttime + dl.delayTime) - self.currentTime) if task.delayTime < remainingTime: index = i break self.doLaterList.insert(index, task) if self.fVerbose: # Alert the world, a new task is born! messenger.send('TaskManager-spawnDoLater', sentArgs = [task, task.name, index]) return task | b0bdc0639cc70de5353ab928771487812048aae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/b0bdc0639cc70de5353ab928771487812048aae2/Task.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1752,
9533,
3244,
20607,
12,
2890,
16,
1562,
4672,
309,
3837,
1318,
18,
12336,
18,
588,
2829,
13332,
3837,
1318,
18,
12336,
18,
4148,
2668,
1752,
2219,
2093,
741,
20607,
30,
738,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1752,
9533,
3244,
20607,
12,
2890,
16,
1562,
4672,
309,
3837,
1318,
18,
12336,
18,
588,
2829,
13332,
3837,
1318,
18,
12336,
18,
4148,
2668,
1752,
2219,
2093,
741,
20607,
30,
738,
8... |
wiistate.WIIState.setGyroCalibration(gyroCalibrationOrig) | if (self.motionPlusPresent()): wiistate.WIIState.setGyroCalibration(gyroCalibrationOrig) | def zeroDevice(self): """Find the at-rest values of the accelerometer and the gyro. | 014c57bd25a3cf37d5eafc34366f656ac62b1370 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/917/014c57bd25a3cf37d5eafc34366f656ac62b1370/WIIMote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3634,
3654,
12,
2890,
4672,
3536,
3125,
326,
622,
17,
8792,
924,
434,
326,
15153,
264,
362,
847,
471,
326,
25295,
303,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3634,
3654,
12,
2890,
4672,
3536,
3125,
326,
622,
17,
8792,
924,
434,
326,
15153,
264,
362,
847,
471,
326,
25295,
303,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
cc.initialize() | cc.initialize() | def msvc_exists(): """ Determine whether MSVC is available on the machine. """ result = 0 try: p = subprocess.Popen(['cl'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) str_result = p.stdout.read() #print str_result if 'Microsoft' in str_result: result = 1 except: #assume we're ok if devstudio exists import distutils.msvccompiler try: cc = distutils.msvccompiler.MSVCCompiler() cc.initialize() p = subprocess.Popen([cc.cc]) result = 1 except distutils.errors.DistutilsPlatformError: pass except WindowsError: pass return result | 4b3826de8579a09301edf93abb08295ec3798e4b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/4b3826de8579a09301edf93abb08295ec3798e4b/build_tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4086,
4227,
67,
1808,
13332,
3536,
10229,
2856,
9238,
13464,
353,
2319,
603,
326,
5228,
18,
3536,
563,
273,
374,
775,
30,
293,
273,
6652,
18,
52,
3190,
12,
3292,
830,
17337,
5972,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4086,
4227,
67,
1808,
13332,
3536,
10229,
2856,
9238,
13464,
353,
2319,
603,
326,
5228,
18,
3536,
563,
273,
374,
775,
30,
293,
273,
6652,
18,
52,
3190,
12,
3292,
830,
17337,
5972,
33,
... |
cls_dct.update(base._xml_classes) if '_xml_classes' in dct: cls_dct.update(dict((xml_cls.qname, xml_cls) for xml_cls in dct['_xml_classes'])) cls._xml_classes = cls_dct class XMLMeta(object): __metaclass__ = XMLMetaType | cls._xml_classes.update(base._xml_classes) if hasattr(base, 'xml_nsmap'): cls.xml_nsmap.update(base.xml_nsmap) if dct['__module__'] != XMLApplicationType.__module__: for base in bases: if issubclass(base, XMLApplication): base.add_child(cls) class XMLApplication(object): __metaclass__ = XMLApplicationType | def __init__(cls, name, bases, dct): cls_dct = {} for base in reversed(bases): if hasattr(base, '_xml_classes'): cls_dct.update(base._xml_classes) if '_xml_classes' in dct: cls_dct.update(dict((xml_cls.qname, xml_cls) for xml_cls in dct['_xml_classes'])) cls._xml_classes = cls_dct | 86a3cb09569495d76ac3ea45504458f43e29e618 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/86a3cb09569495d76ac3ea45504458f43e29e618/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
6429,
16,
508,
16,
8337,
16,
18253,
4672,
2028,
67,
72,
299,
273,
2618,
364,
1026,
316,
9553,
12,
18602,
4672,
309,
3859,
12,
1969,
16,
2070,
2902,
67,
4701,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
6429,
16,
508,
16,
8337,
16,
18253,
4672,
2028,
67,
72,
299,
273,
2618,
364,
1026,
316,
9553,
12,
18602,
4672,
309,
3859,
12,
1969,
16,
2070,
2902,
67,
4701,
11,
... |
url.append((entry.URL, 'google')) | if config.copyright_check_in_source_google: if check_in_source(entry.URL): continue add_in_urllist(url, entry.URL, 'google') | def get_results(query, numresults = 10): url = list() query = re.sub("[()\"<>]", "", query) #wikipedia.output(query) if search_in_google: import google google.LICENSE_KEY = config.google_key print " google query..." search_request_retry = 6 while search_request_retry: #SOAP.faultType: <Fault SOAP-ENV:Server: Exception from service object: # Daily limit of 1000 queries exceeded for key xxx> try: data = google.doGoogleSearch('-Wikipedia "' + query + '"') search_request_retry = 0 for entry in data.results: url.append((entry.URL, 'google')) except Exception, err: print "Got an error ->", err search_request_retry -= 1 if search_in_yahoo: import yahoo.search.web print " yahoo query..." data = yahoo.search.web.WebSearch(config.yahoo_appid, query='"' + query.encode('utf_8') + '" -Wikipedia', results=numresults) search_request_retry = 6 while search_request_retry: try: for entry in data.parse_results(): if check_in_source_yahoo: if check_in_source(entry.Url): continue if not check_urllist(url, entry.Url): url.append((entry.Url, 'yahoo')) search_request_retry = 0 except Exception, err: print "Got an error ->", err search_request_retry -= 1 #if search_in_msn: # from __SOAPpy import WSDL # print " msn query..." # wsdl_url = 'http://soap.search.msn.com/webservices.asmx?wsdl' # server = WSDL.Proxy(wsdl_url) # params = {'AppID': config.msn_appid, 'Query': query, 'CultureInfo': 'en-US', 'SafeSearch': 'Off', 'Requests': { # 'SourceRequest':{'Source': 'Web', 'Offset': 0, 'Count': 10, 'ResultFields': 'All',}}} # server_results = server.Search(Request=params) # if server_results.Responses[0].Results: # results = server_results.Responses[0].Results[0] # for entry in results: # url.append((entry.Url, 'msn')) offset = 0 for i in range(len(url)): if check_list(url[i+offset][0], excl_list, debug=True): url.pop(i+offset) offset+=-1 return url | d445bcd2a4d71b17d4de9993e4f333dc7419cfb5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/d445bcd2a4d71b17d4de9993e4f333dc7419cfb5/copyright.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4717,
12,
2271,
16,
818,
4717,
273,
1728,
4672,
880,
273,
666,
1435,
843,
273,
283,
18,
1717,
2932,
63,
1435,
2412,
29667,
65,
3113,
23453,
843,
13,
468,
11999,
13744,
18,
284... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4717,
12,
2271,
16,
818,
4717,
273,
1728,
4672,
880,
273,
666,
1435,
843,
273,
283,
18,
1717,
2932,
63,
1435,
2412,
29667,
65,
3113,
23453,
843,
13,
468,
11999,
13744,
18,
284... |
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1) | try: self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1) except AttributeError: pass | def server_bind(self): """Called by constructor to bind the socket. | 3b87bb648d3b2ad0c36b8c872ac3cb8aa6e54458 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13981/3b87bb648d3b2ad0c36b8c872ac3cb8aa6e54458/wzmasterserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
67,
4376,
12,
2890,
4672,
3536,
8185,
635,
3885,
358,
1993,
326,
2987,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
67,
4376,
12,
2890,
4672,
3536,
8185,
635,
3885,
358,
1993,
326,
2987,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=%s">%s</a>''' % (config.weburl, ln, _("Manage Format Templates"))) | navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class="navtrail" href="%s/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=%s">%s</a>''' % (config.weburl, ln, _("Manage Format Templates"))) | def validate_format(req, ln=config.cdslang, bfo=None, bft=None, bfe=None): """ Returns a page showing the status of an output format or format template or format element. This page is called from output formats management page or format template management page or format elements documentation. The page only shows the status of one of the format, depending on the specified one. If multiple are specified, shows the first one. @param ln language @param bfo an output format 6 chars code @param bft a format element filename @param bfe a format element name """ ln = wash_language(ln) _ = gettext_set_language(ln) try: uid = getUid(req) except MySQLdb.Error, e: return error_page(req) (auth_code, auth_msg) = check_user(req, 'cfgbibformat') if not auth_code: if bfo is not None: #Output format validation bfo = wash_url_argument(bfo, 'str') navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/output_formats_manage?ln=%s">%s</a>'''%(config.weburl, ln, _("Manage Output Formats"))) if not bibformatadminlib.can_read_output_format(bfo): #No read permission return page(title=_("Restricted Output Format"), body = """You don't have permission to view this output format.""", language=ln, navtrail = navtrail_previous_links, errors = [("ERR_BIBFORMAT_CANNOT_READ_OUTPUT_FILE", bfo , "")], lastupdated=__lastupdated__, req=req) output_format = bibformat_engine.get_output_format(code=bfo, with_attributes=True) name = output_format['attrs']['names']['generic'] title = _("Validation of Output Format %s" % name) elif bft is not None: #Format template validation bft = wash_url_argument(bft, 'str') navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=%s">%s</a>''' % (config.weburl, ln, _("Manage Format Templates"))) if not bibformatadminlib.can_read_format_template(bft): #No read permission return page(title=_("Restricted Format Template"), body = """You don't have permission to view this format template.""", language=ln, navtrail = navtrail_previous_links, errors = [("ERR_BIBFORMAT_CANNOT_READ_TEMPLATE_FILE", bft , "")], lastupdated=__lastupdated__, req=req) name = bibformat_engine.get_format_template_attrs(bft)['name'] title = _("Validation of Format Template %s" % name) elif bfe is not None: #Format element validation bfe = wash_url_argument(bfe, 'str') navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/format_elements_doc?ln=%s#%s">%s</a>''' % (config.weburl, ln , bfe.upper() , _("Format Elements Documentation"))) if not bibformatadminlib.can_read_format_element(bfe) and \ not bibformat_dblayer.tag_exists_for_name(bfe): #No read permission return page(title=_("Restricted Format Element"), body = """You don't have permission to view this format element.""", language=ln, navtrail = navtrail_previous_links, errors = [("ERR_BIBFORMAT_CANNOT_READ_ELEMENT_FILE", bfe ,"")], lastupdated=__lastupdated__, req=req) title = _("Validation of Format Element %s" % bfe) else: #No format specified return page(title=_("Format Validation"), uid=uid, language=ln, errors = [("ERR_BIBFORMAT_VALIDATE_NO_FORMAT")], navtrail = navtrail_previous_links, lastupdated=__lastupdated__, req=req) return page(title=title, body=bibformatadminlib.perform_request_format_validate(ln=ln, bfo=bfo, bft=bft, bfe=bfe), uid=uid, language=ln, navtrail = navtrail_previous_links, lastupdated=__lastupdated__, req=req) else: navtrail_previous_links = bibformatadminlib.getnavtrail(''' > <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/?ln=%s'''%(config.weburl, ln)) return page_not_authorized(req=req, text=auth_msg, navtrail=navtrail_previous_links) | f08fe81d00d74f462e6a931c4d621a61c821b5b1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/f08fe81d00d74f462e6a931c4d621a61c821b5b1/bibformatadmin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
2139,
12,
3658,
16,
7211,
33,
1425,
18,
4315,
2069,
539,
16,
324,
617,
33,
7036,
16,
324,
1222,
33,
7036,
16,
324,
3030,
33,
7036,
4672,
3536,
2860,
279,
1363,
17253,
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,
1954,
67,
2139,
12,
3658,
16,
7211,
33,
1425,
18,
4315,
2069,
539,
16,
324,
617,
33,
7036,
16,
324,
1222,
33,
7036,
16,
324,
3030,
33,
7036,
4672,
3536,
2860,
279,
1363,
17253,
326,
... |
setattr (self, 'install_' + key, scheme[key]) | attrname = 'install_' + key if getattr(self, attrname) is None: setattr(self, attrname, scheme[key]) | def select_scheme (self, name): # it's the caller's problem if they supply a bad name! scheme = INSTALL_SCHEMES[name] for key in ('purelib', 'platlib', 'scripts', 'data'): setattr (self, 'install_' + key, scheme[key]) | 40705576016b863336e1f04a6b45438175cd2cff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/40705576016b863336e1f04a6b45438175cd2cff/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
9068,
261,
2890,
16,
508,
4672,
468,
518,
1807,
326,
4894,
1807,
6199,
309,
2898,
14467,
279,
5570,
508,
5,
4355,
273,
22880,
4685,
67,
22870,
55,
63,
529,
65,
364,
498,
316,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
9068,
261,
2890,
16,
508,
4672,
468,
518,
1807,
326,
4894,
1807,
6199,
309,
2898,
14467,
279,
5570,
508,
5,
4355,
273,
22880,
4685,
67,
22870,
55,
63,
529,
65,
364,
498,
316,... |
'quote': quote[0], | 'body': body[0], | def tfln(self, event, number=u'random', timeframe=None): if number.lower() in (u'worst', u'best'): number += u'-nights' if timeframe: if timeframe.lower().endswith(u'week'): number += u'/this-week' elif timeframe.lower().endswith(u'month'): number += u'/this-month' elif number.isdigit(): number = 'view/%s' % number | 8f257757f4e8a450e95d055ecd06974205993d75 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/8f257757f4e8a450e95d055ecd06974205993d75/lookup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2242,
82,
12,
2890,
16,
871,
16,
1300,
33,
89,
11,
9188,
2187,
813,
3789,
33,
7036,
4672,
309,
1300,
18,
8167,
1435,
316,
261,
89,
11,
91,
280,
334,
2187,
582,
11,
12729,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2242,
82,
12,
2890,
16,
871,
16,
1300,
33,
89,
11,
9188,
2187,
813,
3789,
33,
7036,
4672,
309,
1300,
18,
8167,
1435,
316,
261,
89,
11,
91,
280,
334,
2187,
582,
11,
12729,
11,
... |
print_warning(req, "No match found, looking for substrings...", "") | print_warning(req, "No exact match found, looking for substrings...", "") | def search_in_bibxxx(req, p, f, type): """Searches for pattern 'p' inside bibxxx tables for field 'f' and returns hitlist of recIDs found. The search type is defined by 'type' (e.g. equals to 'r' for a regexp search).""" p_orig = p # saving for eventual future 'no match' reporting # wash arguments: f = string.replace(f, '*', '%') # replace truncation char '*' in field definition if type == 'r': pattern = "REGEXP '%s'" % MySQLdb.escape_string(p) else: p = string.replace(p, '*', '%') # we now use '*' as the truncation character ps = string.split(p, "->", 1) # check for span query: if len(ps) == 2: pattern = "BETWEEN '%s' AND '%s'" % (MySQLdb.escape_string(ps[0]), MySQLdb.escape_string(ps[1])) else: pattern = "LIKE '%s'" % MySQLdb.escape_string(ps[0]) # construct 'tl' which defines the tag list (MARC tags) to search in: tl = [] if str(f[0]).isdigit() and str(f[1]).isdigit(): tl.append(f) # 'f' seems to be okay as it starts by two digits else: # convert old ALEPH tag names, if appropriate: (TODO: get rid of this before entering this function) if cfg_fields_convert.has_key(string.lower(f)): f = cfg_fields_convert[string.lower(f)] # deduce desired MARC tags on the basis of chosen 'f' tl = get_field_tags(f) if not tl: # by default we are searching in author index: tl = get_field_tags("author") print_warning(req, "The phrase or access file search does not work in this field. Choosing author index instead.", "Warning") # okay, start search: l = [] # will hold list of recID that matched for t in tl: # deduce into which bibxxx table we will search: digit1, digit2 = int(t[0]), int(t[1]) bx = "bib%d%dx" % (digit1, digit2) bibx = "bibrec_bib%d%dx" % (digit1, digit2) # construct query: if len(t) != 6 or t[-1:]=='%': # only the beginning of field 't' is defined, so add wildcard character: query = "SELECT bibx.id_bibrec FROM %s AS bx LEFT JOIN %s AS bibx ON bx.id=bibx.id_bibxxx WHERE bx.value %s AND bx.tag LIKE '%s%%'" %\ (bx, bibx, pattern, t) else: query = "SELECT bibx.id_bibrec FROM %s AS bx LEFT JOIN %s AS bibx ON bx.id=bibx.id_bibxxx WHERE bx.value %s AND bx.tag='%s'" %\ (bx, bibx, pattern, t) if dbg: print_warning(req, query, "Debug") # launch the query: res = run_sql(query) # fill the result set: for id_bibrec in res: if id_bibrec[0]: l.append(id_bibrec[0]) # check no of hits found: nb_hits = len(l) if dbg: print_warning(req, "The pattern '%s' in field '%s' has got '%d' hits." % (p, f, nb_hits), "Info") # check whether it is sound to do a new search: if nb_hits == 0 and not (p.startswith("%") and p.endswith("%")): # try to launch substring search: p_new = "%" + p + "%" print_warning(req, "No match found, looking for substrings...", "") return search_in_bibxxx(req, p_new, f, type) else: # okay, return result set: set = HitList() set.addlist(Numeric.array(l)) return set | 9abc6750025b014a8ac519a428db93e9918f7e41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/9abc6750025b014a8ac519a428db93e9918f7e41/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
267,
67,
70,
495,
18310,
12,
3658,
16,
293,
16,
284,
16,
618,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
4832,
25581,
18310,
4606,
364,
652,
296,
74,
11,
471,
1135,
6800,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
267,
67,
70,
495,
18310,
12,
3658,
16,
293,
16,
284,
16,
618,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
4832,
25581,
18310,
4606,
364,
652,
296,
74,
11,
471,
1135,
6800,
1... |
domain="[('company', 'child_of', [main_company])]") | domain="[('company', 'child_of', [main_company], 'parent')]") | def write(self, cursor, user, ids, vals, context=None): res = super(Company, self).write(cursor, user, ids, vals, context=context) # Restart the cache on the domain_get method self.pool.get('ir.rule').domain_get(cursor.dbname) return res | 9e3c5412e82d7667f99e3322135ad059a16356d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9291/9e3c5412e82d7667f99e3322135ad059a16356d7/company.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
12627,
16,
365,
2934,
2626,
12,
9216,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
12627,
16,
365,
2934,
2626,
12,
9216,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
... |
if self.shell.last_exception[0]: | if self.shell.last_exception and self.shell.last_exception[0]: | def on_update_db_clicked(self, button, skip_update_db = False): if button == self.update_db: self.init_transaction = False | a4081b40f6e74444f607da29b08aa39587e19706 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2759/a4081b40f6e74444f607da29b08aa39587e19706/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2725,
67,
1966,
67,
7475,
329,
12,
2890,
16,
3568,
16,
2488,
67,
2725,
67,
1966,
273,
1083,
4672,
309,
3568,
422,
365,
18,
2725,
67,
1966,
30,
365,
18,
2738,
67,
7958,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2725,
67,
1966,
67,
7475,
329,
12,
2890,
16,
3568,
16,
2488,
67,
2725,
67,
1966,
273,
1083,
4672,
309,
3568,
422,
365,
18,
2725,
67,
1966,
30,
365,
18,
2738,
67,
7958,
273,
... |
opts.num += 1 | if opts.num is not None: opts.num += 1 | def card_detect(opts, scc): # Detect type if needed card = None ctypes = dict([(kls.name, kls) for kls in _cards_classes]) if opts.type in ("auto", "auto_once"): for kls in _cards_classes: card = kls.autodetect(scc) if card: print "Autodetected card type %s" % card.name card.reset() break if card is None: print "Autodetection failed" return if opts.type == "auto_once": opts.type = card.name elif opts.type in ctypes: card = ctypes[opts.type](scc) else: raise ValueError("Unknown card type %s" % opts.type) return card | 8d243e884757744af8c4708a1f8b30c2b30d9da8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6730/8d243e884757744af8c4708a1f8b30c2b30d9da8/pySim-prog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5270,
67,
16518,
12,
4952,
16,
888,
71,
4672,
225,
468,
13796,
618,
309,
3577,
5270,
273,
599,
6983,
273,
2065,
3816,
12,
79,
3251,
18,
529,
16,
417,
3251,
13,
364,
417,
3251,
316,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5270,
67,
16518,
12,
4952,
16,
888,
71,
4672,
225,
468,
13796,
618,
309,
3577,
5270,
273,
599,
6983,
273,
2065,
3816,
12,
79,
3251,
18,
529,
16,
417,
3251,
13,
364,
417,
3251,
316,
3... |
if output == 'exported' and path.isfile(svnrevisionfile): | if output.startswith('exported') and path.isfile(svnrevisionfile): | def get_svnversion(dir='ase'): # try to get the last svn revision number from svnversion cmd = popen3('svnversion -n '+dir)[1] # assert that we are in ase project output = cmd.read() cmd.close() svnrevisionfile = path.join(dir, 'svnrevision.py') # we build from exported source (e.g. rpmbuild) if output == 'exported' and path.isfile(svnrevisionfile): # read the last svn revision number output = read_svnrevision(svnrevisionfile) return output | c0c50f00030de94e5468222a31fe4b3e5f327c98 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5735/c0c50f00030de94e5468222a31fe4b3e5f327c98/version.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
31505,
1589,
12,
1214,
2218,
448,
11,
4672,
468,
775,
358,
336,
326,
1142,
5893,
82,
6350,
1300,
628,
5893,
82,
1589,
1797,
273,
30925,
23,
2668,
31505,
1589,
300,
82,
15126,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31505,
1589,
12,
1214,
2218,
448,
11,
4672,
468,
775,
358,
336,
326,
1142,
5893,
82,
6350,
1300,
628,
5893,
82,
1589,
1797,
273,
30925,
23,
2668,
31505,
1589,
300,
82,
15126,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.