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 |
|---|---|---|---|---|---|---|
seh_func = process.read_uint( seh + 4 ) | seh_func = process.read_pointer( seh + 4 ) | def get_seh_chain(self): """ @rtype: list of tuple( int, int ) @return: List of structured exception handlers. Each SEH is represented as a tuple of two addresses: - Address of the SEH block - Address of the SEH callback function | 015d670d265cb2758bfa6d6c506d4c7735582b07 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7261/015d670d265cb2758bfa6d6c506d4c7735582b07/system.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
307,
76,
67,
5639,
12,
2890,
4672,
3536,
632,
86,
723,
30,
225,
666,
434,
3193,
12,
509,
16,
509,
262,
632,
2463,
30,
987,
434,
19788,
1520,
4919,
18,
8315,
3174,
44,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
307,
76,
67,
5639,
12,
2890,
4672,
3536,
632,
86,
723,
30,
225,
666,
434,
3193,
12,
509,
16,
509,
262,
632,
2463,
30,
987,
434,
19788,
1520,
4919,
18,
8315,
3174,
44,
353,
... |
'cpu Mhz': 'cpu_speed', | 'cpu MHz': 'cpu_speed', | def canonical_info(self, platform_host_info): """Standarize host info so we can parse it easily""" | 5f4b23fe65778c1a99fe8c4e6a2e48884ae1ce8e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/5f4b23fe65778c1a99fe8c4e6a2e48884ae1ce8e/hostinfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7378,
67,
1376,
12,
2890,
16,
4072,
67,
2564,
67,
1376,
4672,
3536,
20612,
297,
554,
1479,
1123,
1427,
732,
848,
1109,
518,
17997,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7378,
67,
1376,
12,
2890,
16,
4072,
67,
2564,
67,
1376,
4672,
3536,
20612,
297,
554,
1479,
1123,
1427,
732,
848,
1109,
518,
17997,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rng_state0 = numpy.random.RandomState(55) numpy_rng = numpy.random.RandomState(55) | rng_state0 = numpy.random.RandomState(utt.fetch_seed()) numpy_rng = numpy.random.RandomState(utt.fetch_seed()) | def test_default_shape(self): rng_R = random_state_type() post_r, out = uniform(rng_R) f = compile.function([rng_R], [post_r, out], accept_inplace=True) | d5701303093e5943cc4df89bc18c7fecc19b0be2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/d5701303093e5943cc4df89bc18c7fecc19b0be2/test_raw_random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1886,
67,
4867,
12,
2890,
4672,
11418,
67,
54,
273,
2744,
67,
2019,
67,
723,
1435,
1603,
67,
86,
16,
596,
273,
10823,
12,
86,
3368,
67,
54,
13,
284,
273,
4074,
18,
915,
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,
1842,
67,
1886,
67,
4867,
12,
2890,
4672,
11418,
67,
54,
273,
2744,
67,
2019,
67,
723,
1435,
1603,
67,
86,
16,
596,
273,
10823,
12,
86,
3368,
67,
54,
13,
284,
273,
4074,
18,
915,
3... |
if len(user_absroot) == 0: print "\nCleaning up temporary abs tree(s)..." for path in absroots: if os.path.exists(path): removeall(path) os.rmdir(path) finally: if os.path.exists(fsup): os.remove(fsup) | sys.exit() | def print_usage(): print "" print "Usage: check_archlinux [OPTION]" print "" print "Options:" print " --abs-tree=<path> Check specified tree (assumes the abs tree" print " is i686 unless overridden with --arch)" print " --arch=<arch> Use specified arch (e.g. 'x86_64')" print " -g Generate graphical dependency tree(s)" print " -h, --help Show this help and exit" print "" print "Examples:" print "\n Check all arches and do fresh cvs checkouts:" print " check_archlinux" print "\n Check x_86_64 only and do fresh cvs checkout:" print " check_archlinux --arch=x86_64" print "\n Check existing i686 abs tree:" print " check_archlinux --abs-tree=/var/abs" print "\n Check existing x86_64 abs tree and also generate dep tree image:" print " check_archlinux --abs-tree=/var/abs --arch=x86_64 -g" print "" | 5cf896673b4b73d6591f52acbcba5a1dfc803f6c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3911/5cf896673b4b73d6591f52acbcba5a1dfc803f6c/check_archlinux.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
9167,
13332,
1172,
1408,
1172,
315,
5357,
30,
866,
67,
991,
20132,
306,
7425,
4279,
1172,
1408,
1172,
315,
1320,
2773,
1172,
315,
225,
1493,
5113,
17,
3413,
27127,
803,
34,
664... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
9167,
13332,
1172,
1408,
1172,
315,
5357,
30,
866,
67,
991,
20132,
306,
7425,
4279,
1172,
1408,
1172,
315,
1320,
2773,
1172,
315,
225,
1493,
5113,
17,
3413,
27127,
803,
34,
664... |
prolog="""<table align="right" class="googlebox"><tr><th class="googleboxheader">Try your search on:</th></tr><tr><td class="googleboxbody">""", | prolog="""<table class="googlebox"><tr><th class="googleboxheader">Try your search on:</th></tr><tr><td class="googleboxbody">""", | def create_google_box(p, f, p1, p2, p3, prolog="""<table align="right" class="googlebox"><tr><th class="googleboxheader">Try your search on:</th></tr><tr><td class="googleboxbody">""", separator= """<br>""", epilog="""</td></tr></table>"""): "Creates the box that proposes links to other useful search engines like Google. 'p' is the search pattern." out = "" if not p and (p1 or p2 or p3): p = p1 + " " + p2 + " " + p3 if cfg_google_box == 1: out += prolog if cfg_google_box_cern: # CERN Intranet: out += """<a href="http://search.cern.ch/query.html?qt=%s">CERN Intranet</a>""" % urllib.quote(p) # SPIRES if f == "author": out += separator out += """<a href="http://www.slac.stanford.edu/spires/find/hep/www?AUTHOR=%s">SPIRES</a>""" % urllib.quote(p) elif f == "title": out += separator out += """<a href="http://www.slac.stanford.edu/spires/find/hep/www?TITLE=%s">SPIRES</a>""" % urllib.quote(p) elif f == "reportnumber": out += separator out += """<a href="http://www.slac.stanford.edu/spires/find/hep/www?REPORT-NUM=%s">SPIRES</a>""" % urllib.quote(p) elif f == "keyword": out += separator out += """<a href="http://www.slac.stanford.edu/spires/find/hep/www?k=%s">SPIRES</a>""" % urllib.quote(p) # KEK if f == "author": out += separator out += """<a href="http://www-lib.kek.jp/cgi-bin/kiss_prepri?AU=%s">KEK</a>""" % urllib.quote(p) elif f == "title": out += separator out += """<a href="http://www-lib.kek.jp/cgi-bin/kiss_prepri?TI=%s">KEK</a>""" % urllib.quote(p) elif f == "reportnumber": out += separator out += """<a href="http://www-lib.kek.jp/cgi-bin/kiss_prepri?RP=%s">KEK</a>""" % urllib.quote(p) out += separator # Google: out += """<a href="http://google.com/search?q=%s">Google</a>""" % urllib.quote(p) # AllTheWeb: out += separator out += """<a href="http://alltheweb.com/search?q=%s">AllTheWeb</a>""" % urllib.quote(p) out += epilog return out | 0aec736283882ec36ab3010d663d9be625f4d852 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/0aec736283882ec36ab3010d663d9be625f4d852/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
9536,
67,
2147,
12,
84,
16,
284,
16,
293,
21,
16,
293,
22,
16,
293,
23,
16,
450,
1330,
1546,
3660,
32,
2121,
667,
1546,
9536,
2147,
14050,
313,
4438,
451,
667,
1546,
9536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
9536,
67,
2147,
12,
84,
16,
284,
16,
293,
21,
16,
293,
22,
16,
293,
23,
16,
450,
1330,
1546,
3660,
32,
2121,
667,
1546,
9536,
2147,
14050,
313,
4438,
451,
667,
1546,
9536,
... |
not, an exception is raised :: | not, an exception is raised:: | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 0aa5d0e07206199e4e64708c13056046cecfe083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0aa5d0e07206199e4e64708c13056046cecfe083/huffman.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
12,
2890,
16,
533,
4672,
436,
8395,
2860,
279,
6383,
1177,
434,
326,
864,
533,
4656,
358,
326,
783,
2688,
1014,
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,
2495,
12,
2890,
16,
533,
4672,
436,
8395,
2860,
279,
6383,
1177,
434,
326,
864,
533,
4656,
358,
326,
783,
2688,
1014,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
filename = os.path.join("SPAM", ft.GetExtensions()[0]) | ext = ft.GetExtensions()[0] if ext[0] == ".": ext = ext[1:] filename = "SPAM" + "." + ext | def Update(self, ft): #icon = ft.GetIcon() info = ft.GetIconInfo() if info is None: bmp = MyBitmapsFunc(0) ##print bmp.Ok(), bmp.GetWidth(), bmp.GetHeight() self.GetIconBmp().SetBitmap(bmp) self.GetIconFileTxt().SetValue("") self.GetIconIndexTxt().SetValue("") else: icon, file, idx = info #bmp = wxBitmapFromIcon(icon) #self.GetIconBmp().SetBitmap(bmp) self.GetIconBmp().SetIcon(icon) self.GetIconFileTxt().SetValue(file) self.GetIconIndexTxt().SetValue(str(idx)) | 4c3b4ed07f8d33e70baa4e66ca43dd0ab834578b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/4c3b4ed07f8d33e70baa4e66ca43dd0ab834578b/wxMimeTypesManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
12,
2890,
16,
11038,
4672,
468,
3950,
273,
11038,
18,
967,
5554,
1435,
1123,
273,
11038,
18,
967,
5554,
966,
1435,
309,
1123,
353,
599,
30,
324,
1291,
273,
8005,
5775,
10711,
2622,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
12,
2890,
16,
11038,
4672,
468,
3950,
273,
11038,
18,
967,
5554,
1435,
1123,
273,
11038,
18,
967,
5554,
966,
1435,
309,
1123,
353,
599,
30,
324,
1291,
273,
8005,
5775,
10711,
2622,... |
test_mesg = 'From: %s@localhost\nSubject: IMAP4 test\n\ndata...\n' % USER | test_mesg = 'From: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s' % {'user':USER, 'lf':CRLF} | def print_log(): _mesg('last %d IMAP4 interactions:' % len(_cmd_log)) for secs,line in _cmd_log: _mesg(line, secs) | e02f904cbfd12e5d89b71bc65ed76d5828cb4e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e02f904cbfd12e5d89b71bc65ed76d5828cb4e83/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
1330,
13332,
389,
26244,
75,
2668,
2722,
738,
72,
6246,
2203,
24,
23877,
2497,
738,
562,
24899,
4172,
67,
1330,
3719,
364,
18043,
16,
1369,
316,
389,
4172,
67,
1330,
30,
389,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
1330,
13332,
389,
26244,
75,
2668,
2722,
738,
72,
6246,
2203,
24,
23877,
2497,
738,
562,
24899,
4172,
67,
1330,
3719,
364,
18043,
16,
1369,
316,
389,
4172,
67,
1330,
30,
389,
... |
class ClientDisabledError(Error): | class ClientDisabledError(Exception): | def _canonicalize_hostport(host, port): if port is not None: return host, port elif port is None and ':' in host: host, port = host.split(':') port = int(port) return host, port else: raise ValueError('Invalid host, port pair: %r', (host, port)) | 0b6d310b91b4b6fa422ba429cea92ac7c05501b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14738/0b6d310b91b4b6fa422ba429cea92ac7c05501b4/thrift_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
18288,
554,
67,
2564,
655,
12,
2564,
16,
1756,
4672,
309,
1756,
353,
486,
599,
30,
327,
1479,
16,
1756,
1327,
1756,
353,
599,
471,
3921,
316,
1479,
30,
1479,
16,
1756,
273,
1479,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18288,
554,
67,
2564,
655,
12,
2564,
16,
1756,
4672,
309,
1756,
353,
486,
599,
30,
327,
1479,
16,
1756,
1327,
1756,
353,
599,
471,
3921,
316,
1479,
30,
1479,
16,
1756,
273,
1479,
... |
setattr(values, dest, 1) | setattr(values, dest, True) | def take_action (self, action, dest, opt, value, values, parser): if action == "store": setattr(values, dest, value) elif action == "store_const": setattr(values, dest, self.const) elif action == "store_true": setattr(values, dest, 1) elif action == "store_false": setattr(values, dest, 0) elif action == "append": values.ensure_value(dest, []).append(value) elif action == "count": setattr(values, dest, values.ensure_value(dest, 0) + 1) elif action == "callback": args = self.callback_args or () kwargs = self.callback_kwargs or {} self.callback(self, opt, value, parser, *args, **kwargs) elif action == "help": parser.print_help() sys.exit(0) elif action == "version": parser.print_version() sys.exit(0) else: raise RuntimeError, "unknown action %r" % self.action | cdb9ddb9f396d777ecea5b78113fcc9202879129 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/cdb9ddb9f396d777ecea5b78113fcc9202879129/optparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4862,
67,
1128,
261,
2890,
16,
1301,
16,
1570,
16,
2153,
16,
460,
16,
924,
16,
2082,
4672,
309,
1301,
422,
315,
2233,
6877,
9241,
12,
2372,
16,
1570,
16,
460,
13,
1327,
1301,
422,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4862,
67,
1128,
261,
2890,
16,
1301,
16,
1570,
16,
2153,
16,
460,
16,
924,
16,
2082,
4672,
309,
1301,
422,
315,
2233,
6877,
9241,
12,
2372,
16,
1570,
16,
460,
13,
1327,
1301,
422,
31... |
hdir = os.path.join (os.environ["HOME"], ".config/awn/applets") dirs = ["/usr/lib/awn/applets", "/usr/local/lib/awn/applets", "/usr/lib64/awn/applets", "/usr/local/lib64/awn/applets", hdir] | prefixes = ["/usr/lib", "/usr/local/lib", "/usr/lib64", "/usr/local/lib64", os.path.join(defs.PREFIX, "lib"), os.path.expanduser("~/.config")] dirs = [os.path.join(prefix, "awn", "applets") for prefix in prefixes] | def load_applets (self): self.make_appmodel () model = self.appmodel | 45620a39e26118940962f52e60ed2313f485fb09 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8416/45620a39e26118940962f52e60ed2313f485fb09/awnApplet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
438,
20773,
261,
2890,
4672,
365,
18,
6540,
67,
2910,
2284,
1832,
938,
273,
365,
18,
2910,
2284,
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,
1262,
67,
438,
20773,
261,
2890,
4672,
365,
18,
6540,
67,
2910,
2284,
1832,
938,
273,
365,
18,
2910,
2284,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
deps = terminal_deps[expression.__class__](expression) | h = terminal_deps[expression.__class__] deps = h(expression) | def _split_by_dependencies(expression, codestructure, terminal_deps): if isinstance(expression, Variable): c = expression._count info = codestructure.variableinfo.get(c, None) if info is not None: return info.variable, info.deps #codestructure.stacks[vdeps].append(v) elif isinstance(expression, Terminal): deps = terminal_deps[expression.__class__](expression) if codestructure.stacks: ufl_assert(deps.size() == some_key(codestructure.stacks).size(), "Inconsistency in dependency definitions.") return expression, deps ops = expression.operands() ops2 = [_split_by_dependencies(o, codestructure, terminal_deps) for o in ops] deps = ops2[0][1] for o in ops2[1:]: deps |= o[1] ops3 = [] for (v,vdeps) in ops2: if isinstance(v, Variable): # if this subexpression is a variable, it has already been added to the stack ufl_assert(v._count in codestructure.variableinfo, "") elif not vdeps == deps: # if this subexpression has other dependencies than 'expression', store a variable for it v = Variable(v) vinfo = VariableInfo(v, vdeps) codestructure.variableinfo[v._count] = vinfo codestructure.stacks[vdeps].append(vinfo) ops3.append(v) if isinstance(expression, Variable): c = expression._count ufl_assert(c not in codestructure.variableinfo, "Shouldn't reach this point if the variable was already cached!") vinfo = VariableInfo(expression, deps) codestructure.variableinfo[c] = vinfo codestructure.stacks[deps].append(vinfo) # Try to reuse expression if nothing has changed: if any((o1 is not o3) for (o1,o3) in izip(ops,ops3)): e = expression.__class__(*ops3) else: e = expression return e, deps | b1b48c45bfffb609a40d14125016d63b2899726b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/624/b1b48c45bfffb609a40d14125016d63b2899726b/dependencies.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4939,
67,
1637,
67,
11037,
12,
8692,
16,
6198,
13583,
16,
8651,
67,
14877,
4672,
309,
1549,
12,
8692,
16,
7110,
4672,
276,
273,
2652,
6315,
1883,
1123,
273,
6198,
13583,
18,
6105,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4939,
67,
1637,
67,
11037,
12,
8692,
16,
6198,
13583,
16,
8651,
67,
14877,
4672,
309,
1549,
12,
8692,
16,
7110,
4672,
276,
273,
2652,
6315,
1883,
1123,
273,
6198,
13583,
18,
6105,
... |
if im is None: im = create_mat() | def draw_clay(self, context): global im ok_clay = not bpy.types.Scene.Clay rnd = context.scene.render rnl = rnd.layers.active if im is None: im = create_mat() split = self.layout.split() col = split.column() col.operator(CheckClay.bl_idname, emboss=False, icon='CHECKBOX_HLT' \ if ok_clay else 'CHECKBOX_DEHLT') col = split.column() col.prop(im, "diffuse_color", text="") self.layout.separator() | e6b5c1a3ecbf3cf3e1bff92597f90631a576aa84 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11963/e6b5c1a3ecbf3cf3e1bff92597f90631a576aa84/render_clay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
67,
830,
528,
12,
2890,
16,
819,
4672,
2552,
709,
1529,
67,
830,
528,
273,
486,
324,
2074,
18,
2352,
18,
14370,
18,
2009,
528,
225,
20391,
273,
819,
18,
23694,
18,
5902,
436,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
67,
830,
528,
12,
2890,
16,
819,
4672,
2552,
709,
1529,
67,
830,
528,
273,
486,
324,
2074,
18,
2352,
18,
14370,
18,
2009,
528,
225,
20391,
273,
819,
18,
23694,
18,
5902,
436,
1... | |
def preView(self, file): sys.stdout.write(str(file.toString())) | def preView(self, filename): | def preView(self, file): sys.stdout.write(str(file.toString())) self.clear() if self.item.load(unicode(file.toString()), 1) == -2: return | 1c952f8c4f0b08ff01cccae09b7e430d2744792d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6671/1c952f8c4f0b08ff01cccae09b7e430d2744792d/ItemList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
1767,
12,
2890,
16,
1544,
4672,
365,
18,
8507,
1435,
309,
365,
18,
1726,
18,
945,
12,
9124,
12,
768,
18,
10492,
1435,
3631,
404,
13,
422,
300,
22,
30,
327,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
675,
1767,
12,
2890,
16,
1544,
4672,
365,
18,
8507,
1435,
309,
365,
18,
1726,
18,
945,
12,
9124,
12,
768,
18,
10492,
1435,
3631,
404,
13,
422,
300,
22,
30,
327,
2,
-100,
-100,
-100,
... |
**configuration() | **configuration(top_path='').todict() | def configuration(parent_package='',parent_path=None): from scipy.distutils.system_info import get_info package = 'cluster' local_path = get_path(__name__,parent_path) config = Configuration(package,parent_package) config.add_extension('_vq', sources=[join('src', 'vq_wrap.cpp')]) return config | 64d85ae8d3fb0f7cebd49730623ca86bac49fef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/64d85ae8d3fb0f7cebd49730623ca86bac49fef6/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1664,
12,
2938,
67,
5610,
2218,
2187,
2938,
67,
803,
33,
7036,
4672,
628,
10966,
18,
4413,
5471,
18,
4299,
67,
1376,
1930,
336,
67,
1376,
2181,
273,
296,
7967,
11,
1191,
67,
803,
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,
1664,
12,
2938,
67,
5610,
2218,
2187,
2938,
67,
803,
33,
7036,
4672,
628,
10966,
18,
4413,
5471,
18,
4299,
67,
1376,
1930,
336,
67,
1376,
2181,
273,
296,
7967,
11,
1191,
67,
803,
273,
... |
uchunks = [unicode(s, str(charset)) for s, charset in self._chunks] return u''.join(uchunks) | uchunks = [] lastcs = None for s, charset in self._chunks: nextcs = charset if uchunks: if lastcs is not None: if nextcs is None or nextcs == 'us-ascii': uchunks.append(USPACE) nextcs = None elif nextcs is not None and nextcs <> 'us-ascii': uchunks.append(USPACE) lastcs = nextcs uchunks.append(unicode(s, str(charset))) return UEMPTYSTRING.join(uchunks) | def __unicode__(self): """Helper for the built-in unicode function.""" # charset item is a Charset instance so we need to stringify it. uchunks = [unicode(s, str(charset)) for s, charset in self._chunks] return u''.join(uchunks) | 215c9acdb204958722e25c4e5d42025d0c15916f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/215c9acdb204958722e25c4e5d42025d0c15916f/Header.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
972,
12,
2890,
4672,
3536,
2276,
364,
326,
6650,
17,
267,
5252,
445,
12123,
468,
4856,
761,
353,
279,
12080,
791,
1427,
732,
1608,
358,
7077,
518,
18,
582,
14691,
273,
306,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9124,
972,
12,
2890,
4672,
3536,
2276,
364,
326,
6650,
17,
267,
5252,
445,
12123,
468,
4856,
761,
353,
279,
12080,
791,
1427,
732,
1608,
358,
7077,
518,
18,
582,
14691,
273,
306,
... |
def __init__(self, code, hresult, result): self.code = code | def __init__(self, name, value, parent = None, hresult = 0): self.name = name self.value = value self.parent = parent | def __init__(self, code, hresult, result): self.code = code self.hresult = hresult self.result = result | 11987ba923ad498972ab210ac08a30ffbfe1cb28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/11987ba923ad498972ab210ac08a30ffbfe1cb28/expressions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
460,
16,
982,
273,
599,
16,
366,
2088,
273,
374,
4672,
365,
18,
529,
273,
508,
365,
18,
1132,
273,
460,
365,
18,
2938,
273,
982,
365,
18,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
508,
16,
460,
16,
982,
273,
599,
16,
366,
2088,
273,
374,
4672,
365,
18,
529,
273,
508,
365,
18,
1132,
273,
460,
365,
18,
2938,
273,
982,
365,
18,
76... |
elif objID.is_function() or objID.is_method(): self.data[objID] = FuncDoc(obj, self._verbosity) elif objID.is_builtin_function(): self.data[objID] = FuncDoc(obj, self._verbosity) def add(self, obj): """ Add the documentation for an object, and everything contained by that object, to this documentation map. @param obj: The object whose documentation should be added to this documentation map. @type obj: any @rtype: C{None} """ objID = UID(obj) if self.data.has_key(objID): return self.add_one(obj) if objID.is_module(): for val in obj.__dict__.values(): valID = _makeuid(val) if not valID: continue if valID.is_class() or valID.is_function(): if UID(val).module() != objID: if WARN_SKIPPING: print 'Skipping imported value', val continue if valID.is_class(): self.add(val) elif valID.is_function() or valID.is_builtin_function(): self.add(val) elif objID.is_class(): for val in obj.__dict__.values(): valID = _makeuid(val) if not valID: continue if valID.is_function(): self.add(new.instancemethod(val, None, obj)) elif valID.is_builtin_method(): self.add(val) | def add_one(self, obj): """ Add an object's documentation to this documentation map. If you also want to include the objects contained by C{obj}, then use L{add}. | 065d9e81e0092aa76af93c5f65eb4326d02a3124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/065d9e81e0092aa76af93c5f65eb4326d02a3124/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
476,
12,
2890,
16,
1081,
4672,
3536,
1436,
392,
733,
1807,
7323,
358,
333,
7323,
852,
18,
225,
971,
1846,
2546,
2545,
358,
2341,
326,
2184,
7542,
635,
385,
95,
2603,
5779,
150... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
67,
476,
12,
2890,
16,
1081,
4672,
3536,
1436,
392,
733,
1807,
7323,
358,
333,
7323,
852,
18,
225,
971,
1846,
2546,
2545,
358,
2341,
326,
2184,
7542,
635,
385,
95,
2603,
5779,
150... | |
log.error("Error: %s" % re) systemExit(re.code, re.msg) | print _(" Adding consumer failed ") log.error("Error: %s" % re) sys.exit(-1) | def _add_consumer(self): if not self.options.consumerid: print("consumer id required. Try --help") sys.exit(0) if not self.options.groupid: print("group id required. Try --help") sys.exit(0) try: self.cgconn.add_consumer(self.options.groupid, self.options.consumerid) print _(" Successfully added Consumer [%s] to Group [%s]" % (self.options.consumerid, self.options.groupid)) except RestlibException, re: log.error("Error: %s" % re) systemExit(re.code, re.msg) except Exception, e: log.error("Error: %s" % e) raise | 6b0b4ca97d3579a18fdf98fb7cc2c56a724d726e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/6b0b4ca97d3579a18fdf98fb7cc2c56a724d726e/core_consumergroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
13230,
12,
2890,
4672,
309,
486,
365,
18,
2116,
18,
13230,
350,
30,
1172,
2932,
13230,
612,
1931,
18,
6161,
1493,
5201,
7923,
2589,
18,
8593,
12,
20,
13,
309,
486,
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,
389,
1289,
67,
13230,
12,
2890,
4672,
309,
486,
365,
18,
2116,
18,
13230,
350,
30,
1172,
2932,
13230,
612,
1931,
18,
6161,
1493,
5201,
7923,
2589,
18,
8593,
12,
20,
13,
309,
486,
365,
... |
l.append ((fd, flags)) r = poll.poll (l, timeout) | l.append((fd, flags)) r = poll.poll(l, timeout) | def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.iteritems(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.append ((fd, flags)) r = poll.poll (l, timeout) for fd, flags in r: obj = map.get(fd) if obj is None: continue readwrite(obj, flags) | 79991224d1b5f3a4ab074ddac83ef59addf853be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/79991224d1b5f3a4ab074ddac83ef59addf853be/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
22,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
1930,
7672,
309,
852,
353,
599,
30,
852,
33,
7814,
67,
1458,
309,
2021,
353,
486,
599,
30,
468,
2021,
353,
316,
10993,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
22,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
1930,
7672,
309,
852,
353,
599,
30,
852,
33,
7814,
67,
1458,
309,
2021,
353,
486,
599,
30,
468,
2021,
353,
316,
10993,
... |
sage: from sage.calculus.calculus import maxima as calcmaxima sage: calcmaxima.eval('declare(n,integer)') | sage: sage.calculus.calculus.maxima.eval('declare(n,integer)') | def assume(*args): """ Make the given assumptions. INPUT: *args -- assumptions EXAMPLES: sage: assume(x > 0) sage: bool(sqrt(x^2) == x) True sage: forget() sage: bool(sqrt(x^2) == x) False An integer constraint (todo: this needs to be made possible with just the assume command!): sage: from sage.calculus.calculus import maxima as calcmaxima sage: calcmaxima.eval('declare(n,integer)') 'done' sage: var('n, P, r, r2') (n, P, r, r2) sage: c = P*e^(r*n) sage: d = P*(1+r2)^n sage: solve(c==d,r2) [r2 == e^r - 1] """ for x in args: if isinstance(x, (tuple, list)): for y in x: assume(y) else: try: x.assume() except KeyError: raise TypeError, "assume not defined for objects of type '%s'"%type(x) | a29ebe31d2f06be51bf94592bb756e3abbdda738 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/a29ebe31d2f06be51bf94592bb756e3abbdda738/equations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6750,
30857,
1968,
4672,
3536,
4344,
326,
864,
6287,
573,
18,
225,
12943,
30,
380,
1968,
1493,
6287,
573,
225,
5675,
8900,
11386,
30,
272,
410,
30,
6750,
12,
92,
405,
374,
13,
272,
410... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6750,
30857,
1968,
4672,
3536,
4344,
326,
864,
6287,
573,
18,
225,
12943,
30,
380,
1968,
1493,
6287,
573,
225,
5675,
8900,
11386,
30,
272,
410,
30,
6750,
12,
92,
405,
374,
13,
272,
410... |
swap16(self["d"].value), swap16(self["e"].value), swap32(self["f"].value)) | str2hex(d[:2]), str2hex(d[2:4]), str2hex(d[4:6]),str2hex(d[6:8])) | def createValue(self): return "%08X-%04X-%04X-%04X-%04X%08X" % ( self["a"].value, self["b"].value, self["c"].value, swap16(self["d"].value), swap16(self["e"].value), swap32(self["f"].value)) | 4e2d58125f1278adc31fb77536ee805cd8075760 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/4e2d58125f1278adc31fb77536ee805cd8075760/win32.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
620,
12,
2890,
4672,
327,
2213,
6840,
60,
6456,
3028,
60,
6456,
3028,
60,
6456,
3028,
60,
6456,
3028,
60,
9,
6840,
60,
6,
738,
261,
365,
9614,
69,
6,
8009,
1132,
16,
365,
9614,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
620,
12,
2890,
4672,
327,
2213,
6840,
60,
6456,
3028,
60,
6456,
3028,
60,
6456,
3028,
60,
6456,
3028,
60,
9,
6840,
60,
6,
738,
261,
365,
9614,
69,
6,
8009,
1132,
16,
365,
9614,
... |
if os.path.isdir(os.path.join(dir,elem)): | if os.path.isdir(os.path.join(dir,elem)): | def get_file_listing(dir, mode, pattern=None): """ Returns the file listing of a given directory. It returns only files. Returns a list of [file,/path/to/file] """ filelist = [] if pattern == (None or ''): listaux = dircache.listdir(dir) else: if dir != '/': dir += '/' dir = escape_pattern(dir + pattern) listaux = glob.glob(dir) listaux.sort(key=str.lower) for elem in listaux: if STOP: return filelist if mode == 0: # Get files if not os.path.isdir(os.path.join(dir,elem)): filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) elif mode == 1: # Get directories if os.path.isdir(os.path.join(dir,elem)): filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) elif mode == 2: # Get files and directories filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) else: # Get files if not os.path.isdir(os.path.join(dir,elem)): filelist.append([os.path.basename(elem),os.path.join(dir,elem)]) return filelist | 48fc1c8d86f8cfbba31b22fbb4fd6c28972893ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/735/48fc1c8d86f8cfbba31b22fbb4fd6c28972893ca/pyrenamer_filefuncs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
768,
67,
21228,
12,
1214,
16,
1965,
16,
1936,
33,
7036,
4672,
3536,
2860,
326,
585,
11591,
434,
279,
864,
1867,
18,
2597,
1135,
1338,
1390,
18,
2860,
279,
666,
434,
306,
768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
768,
67,
21228,
12,
1214,
16,
1965,
16,
1936,
33,
7036,
4672,
3536,
2860,
326,
585,
11591,
434,
279,
864,
1867,
18,
2597,
1135,
1338,
1390,
18,
2860,
279,
666,
434,
306,
768,
... |
if result in trues: | if result.lower() in trues: | def getboolean(self, section, option): result = self.get(section, option) try: trues = ["1", "yes", "true", "on"] falses = ["0", "no", "false", "off"] if result in trues: return True if result in falses: return False except AttributeError as err: if str(err) == "\'bool\' object has no attribute \'lower\'": return result raise err | 6b3fa3e06c70a338f1eef5c44d802e586cb99c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8545/6b3fa3e06c70a338f1eef5c44d802e586cb99c22/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
563,
273,
365,
18,
588,
12,
3464,
16,
1456,
13,
775,
30,
433,
3610,
273,
8247,
21,
3113,
315,
9707,
3113,
315,
3767,
3113,
315,
265,
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,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
563,
273,
365,
18,
588,
12,
3464,
16,
1456,
13,
775,
30,
433,
3610,
273,
8247,
21,
3113,
315,
9707,
3113,
315,
3767,
3113,
315,
265,
11... |
self.client.set_list(defs.PANEL, defs.APPLET_LIST, awn.CONFIG_LIST_STRING, l) | self.client.set_list(defs.PANEL, defs.APPLET_LIST, awn.CONFIG_LIST_STRING, applets_list) | def _apply (self): l = [] it = self.active_model.get_iter_first () while (it): path = self.active_model.get_value (it, 1) uid = self.active_model.get_value (it, 2) s = "%s::%s" % (path, uid) l.append (s) it= self.active_model.iter_next (it) | 78ee6ac8bee04c02291714737ad666a3999353a7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/78ee6ac8bee04c02291714737ad666a3999353a7/awnClass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
261,
2890,
4672,
328,
273,
5378,
518,
273,
365,
18,
3535,
67,
2284,
18,
588,
67,
2165,
67,
3645,
1832,
1323,
261,
305,
4672,
589,
273,
365,
18,
3535,
67,
2284,
18,
588,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
261,
2890,
4672,
328,
273,
5378,
518,
273,
365,
18,
3535,
67,
2284,
18,
588,
67,
2165,
67,
3645,
1832,
1323,
261,
305,
4672,
589,
273,
365,
18,
3535,
67,
2284,
18,
588,
67... |
m = self.rfile.read (n) | m = packet.fromClient (n) | def handle (self): """ This is where the action starts. """ self.server.controller.updateProgressInfo ('Idle.', 2) # create a packet structure packet = IIS () packet.datain = self.rfile packet.dataout = self.wfile # decode the header size = struct.calcsize ('8h') line = packet.datain.read (size) n = len (line) if (n < size): return while (n): try: bytes = struct.unpack ('8h', line) except: sys.stderr.write ('PYIMTOOL: error unpacking the data.\n') for exctn in sys.exc_info(): sys.stderr.write (exctn) # verify checksum # DO SOMETHING! # decode the packet fields subunit = bytes[2] subunit077 = subunit & 077 tid = bytes[0] x = bytes[4] & 0177777 y = bytes[5] & 0177777 z = bytes[6] & 0177777 t = bytes[7] & 017777 ndatabytes = - bytes[1] # are the bytes packed? if (not (tid & PACKED)): ndatabytes *= 2 # populate the packet structure packet.subunit = subunit packet.subunit077 = subunit077 packet.tid = tid packet.x = x packet.y = y packet.z = z packet.t = t packet.nbytes = ndatabytes # decide what to do, depending on the # value of subunit if (packet.subunit077 == FEEDBACK): self.handleFeedback (packet) elif (packet.subunit077 == LUT): self.handleLut (packet) # read the next packet line = packet.datain.read (size) n = len (line) continue elif (packet.subunit077 == MEMORY): self.handleMemory (packet) # if (self.needsUpdate): # self.server.controller.animateProgressWeel () # read the next packet line = packet.datain.read (size) n = len (line) continue elif (packet.subunit077 == WCS): self.handleWCS (packet) line = packet.datain.read (size) n = len (line) continue elif (packet.subunit077 == IMCURSOR): self.handleImcursor (packet) line = packet.datain.read (size) n = len (line) continue else: # no-op pass if (not (packet.tid & IIS_READ)): # OK, discard the rest of the data nbytes = packet.nbytes while (nbytes > 0): if (nbytes < SZ_FIFOBUF): n = nbytes else: n = SZ_FIFOBUF m = self.rfile.read (n) if (m <= 0): break nbytes -= n # read the next packet line = packet.datain.read (size) n = len (line) if (n < size): return # <--- end of the while (n) loop self.server.controller.updateProgressInfo ('Done.', 2.0) if (self.needsUpdate): self.server.controller.displayImage () return | eb163fa149dbd928a3fa7b9842edc6170373d658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2360/eb163fa149dbd928a3fa7b9842edc6170373d658/RequestHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
261,
2890,
4672,
3536,
1220,
353,
1625,
326,
1301,
2542,
18,
3536,
365,
18,
3567,
18,
5723,
18,
2725,
5491,
966,
7707,
13834,
1093,
16,
576,
13,
225,
468,
752,
279,
4414,
3695,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
261,
2890,
4672,
3536,
1220,
353,
1625,
326,
1301,
2542,
18,
3536,
365,
18,
3567,
18,
5723,
18,
2725,
5491,
966,
7707,
13834,
1093,
16,
576,
13,
225,
468,
752,
279,
4414,
3695,
4... |
def tearDown( self ) : if os.path.exists( self.outputFileName ) : os.remove( self.outputFileName ) | def tearDown( self ) : if os.path.exists( self.outputFileName ) : os.remove( self.outputFileName ) | def tearDown( self ) : if os.path.exists( self.outputFileName ) : os.remove( self.outputFileName ) | 3226fd684faf050b161b7fec70a80ccf91cb515a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9042/3226fd684faf050b161b7fec70a80ccf91cb515a/CurvesTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
365,
262,
294,
225,
309,
1140,
18,
803,
18,
1808,
12,
365,
18,
2844,
4771,
262,
294,
1140,
18,
4479,
12,
365,
18,
2844,
4771,
262,
225,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
365,
262,
294,
225,
309,
1140,
18,
803,
18,
1808,
12,
365,
18,
2844,
4771,
262,
294,
1140,
18,
4479,
12,
365,
18,
2844,
4771,
262,
225,
2,
-100,
-100,
-100,
-100... |
try: duration = int (self.__metadata["duration"]) / gst.SECOND except KeyError: duration = 0 if duration == -1 or duration == 0: | duration = int(self.__metadata.get("duration", 0)) / gst.SECOND if duration == 0: | def on_finished (self, event): if event.id == operations.ERROR: self._propagate(event) return try: duration = int (self.__metadata["duration"]) / gst.SECOND except KeyError: duration = 0 if duration == -1 or duration == 0: self._send_finished_event(operations.ERROR) return self.__metadata["duration"] = duration evt = operations.Event (self) self._notify ("on_metadata", evt, self.__metadata) self.__metadata = None self.__element = None self._send_finished_event (operations.SUCCESSFUL) | 016aec4a85d3438c0d49f1f8b2012e23eb7805ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2207/016aec4a85d3438c0d49f1f8b2012e23eb7805ec/audio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
13527,
261,
2890,
16,
871,
4672,
309,
871,
18,
350,
422,
5295,
18,
3589,
30,
365,
6315,
5986,
346,
340,
12,
2575,
13,
327,
225,
3734,
273,
509,
12,
2890,
16186,
4165,
18,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
13527,
261,
2890,
16,
871,
4672,
309,
871,
18,
350,
422,
5295,
18,
3589,
30,
365,
6315,
5986,
346,
340,
12,
2575,
13,
327,
225,
3734,
273,
509,
12,
2890,
16186,
4165,
18,
58... |
static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] | static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] | def __init__(self, master=None, cnf={}, **kw): # static seem to be -installcolormap -initwait -statusbar -cursor static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] TixWidget.__init__(self, master, 'tixBalloon', static, cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label', destroy_physically=0) self.subwidget_list['message'] = _dummyLabel(self, 'message', destroy_physically=0) | 2c55b08db886232a6fd7f100f955f541567ab82d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2c55b08db886232a6fd7f100f955f541567ab82d/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
16,
23118,
28793,
2826,
9987,
4672,
468,
760,
19264,
358,
506,
300,
5425,
1293,
18804,
300,
2738,
7048,
300,
2327,
3215,
300,
9216,
760,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
16,
23118,
28793,
2826,
9987,
4672,
468,
760,
19264,
358,
506,
300,
5425,
1293,
18804,
300,
2738,
7048,
300,
2327,
3215,
300,
9216,
760,
27... |
exprn += reqtsDict[name].replace('NAME',name).replace('VALUE',str(value))+plus if len(plus): exprn = exprn[:-len(plus)] | exprn += reqtsDict[name].replace( 'NAME', name ).replace( 'VALUE', str( value ) ) + plus if len( plus ): exprn = exprn[:-len( plus )] | 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,... |
return self.readlines().join('') | return ''.join(self.readlines()) | def read(self): # Note: no size argument -- read until EOF only! return self.readlines().join('') | 0bba6c0ff4e2c058993f80cc13cc5b0a269ce8d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/0bba6c0ff4e2c058993f80cc13cc5b0a269ce8d7/multifile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
4672,
468,
3609,
30,
1158,
963,
1237,
1493,
855,
3180,
6431,
1338,
5,
327,
365,
18,
896,
3548,
7675,
5701,
2668,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
4672,
468,
3609,
30,
1158,
963,
1237,
1493,
855,
3180,
6431,
1338,
5,
327,
365,
18,
896,
3548,
7675,
5701,
2668,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if (len(DATA) != 0 and DATA[0] != ""): | if (len(DATA) != 0): | def create_record(begin_record_header, ending_record_footer, query_string, match_mode, Xcount): "Create output record" global data_parsed out_to_print = "" out = [] field_data_item_LIST = [] ssn5cnt = "%3d" % Xcount sysno = generate("DATE(%w%H%M%S)") sysno500 = generate("XDATE(%w%H%M%S)," + ssn5cnt) for T_tpl_item_LIST in target_tpl_parsed: # the line is printed only if the variables inside are not empty print_line = 0 to_output = [] rows = 1 for field_tpl_item_STRING in T_tpl_item_LIST[1]: DATA = [] if (field_tpl_item_STRING[:2]=="<:"): field_tpl_item_STRING = field_tpl_item_STRING[2:-2] field = field_tpl_item_STRING.split("::")[0] if (len(field_tpl_item_STRING.split("::")) == 1): value = generate(field) to_output.append([value]) else: subfield = field_tpl_item_STRING.split("::")[1] if (field[-1] == "*"): repetitive = 1 field = field[:-1] else: repetitive = 0 if dirmode: DATA = select_line(field, data_parsed) else: DATA = select_line(field, data_parsed) if (repetitive == 0): DATA = [string.join(DATA, " ")] SRC_TPL = select_line(field, source_tpl_parsed) try: if (DATA[0] != ""): DATA = get_subfields(DATA, subfield, SRC_TPL) FF = field_tpl_item_STRING.split("::") if (len(FF) > 2): FF = FF[2:] for fn in FF: | e36e5294ad2d41e928be4bc7f952ea56c88b7b15 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/e36e5294ad2d41e928be4bc7f952ea56c88b7b15/bibconvert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3366,
12,
10086,
67,
3366,
67,
3374,
16,
11463,
67,
3366,
67,
14723,
16,
843,
67,
1080,
16,
845,
67,
3188,
16,
1139,
1883,
4672,
315,
1684,
876,
1409,
6,
225,
2552,
501,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3366,
12,
10086,
67,
3366,
67,
3374,
16,
11463,
67,
3366,
67,
14723,
16,
843,
67,
1080,
16,
845,
67,
3188,
16,
1139,
1883,
4672,
315,
1684,
876,
1409,
6,
225,
2552,
501,
67,... |
tab = [ [self[0]] ] for i in range(1,len(self)): if self[i-1].value > self[i].value: tab.append([self[i]]) else: l = len(tab)-1 tab[l].append(self[i]) return Tableau(tab) | shape = self.parent().shape.conjugate() tab = [] s = 0 for i in range(len(shape)): col = [ self[s+k] for k in range(shape[i]) ] col.reverse() s += shape[i] tab.append(col) tab = Tableau(tab) return(tab.conjugate()) | def to_tableau(self): | 32a3559acd5b97a7ee5e4709552657a21bace556 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/32a3559acd5b97a7ee5e4709552657a21bace556/tensor_product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2121,
8377,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2121,
8377,
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... |
self.label.set_sensitive(False) | def __init__(self, content): gtk.HBox.__init__(self, False, 2) self.set_no_show_all(True) | 337e2628519817abde9df50dbed69c769add8439 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/337e2628519817abde9df50dbed69c769add8439/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
913,
4672,
22718,
18,
44,
3514,
16186,
2738,
972,
12,
2890,
16,
1083,
16,
576,
13,
365,
18,
542,
67,
2135,
67,
4500,
67,
454,
12,
5510,
13,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
913,
4672,
22718,
18,
44,
3514,
16186,
2738,
972,
12,
2890,
16,
1083,
16,
576,
13,
365,
18,
542,
67,
2135,
67,
4500,
67,
454,
12,
5510,
13,
2,
-100,
... | |
exec compile(example.source, filename, "single", compileflags, 1) in test.globs self.debugger.set_continue() | exec(compile(example.source, filename, "single", compileflags, 1), test.globs) self.debugger.set_continue() | def __run(self, test, compileflags, out): SUCCESS, FAILURE, BOOM = range(3) # `outcome` state check = self._checker.check_output | b8f49ac140c4bcdad775a66ec9ed8977bd223553 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12157/b8f49ac140c4bcdad775a66ec9ed8977bd223553/docrunner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2681,
12,
2890,
16,
1842,
16,
4074,
7133,
16,
596,
4672,
16561,
16,
24077,
16,
9784,
1872,
273,
1048,
12,
23,
13,
468,
1375,
21672,
68,
919,
866,
273,
365,
6315,
19243,
18,
1893,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2681,
12,
2890,
16,
1842,
16,
4074,
7133,
16,
596,
4672,
16561,
16,
24077,
16,
9784,
1872,
273,
1048,
12,
23,
13,
468,
1375,
21672,
68,
919,
866,
273,
365,
6315,
19243,
18,
1893,... |
elif type == 'resource/x-bb-announcement': | elif res_type == 'resource/x-bb-announcement': | def convert_resources(self): for resource in self.manifest.iterfind('.//resource'): dat_name = resource.attrib['file'] xml = etree.parse(self.zip.open(dat_name)) | 44d3a90ab51205bf3bce4be15847de4b362fb7c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12927/44d3a90ab51205bf3bce4be15847de4b362fb7c9/bb9_course.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
4683,
12,
2890,
4672,
364,
1058,
316,
365,
18,
14357,
18,
2165,
4720,
2668,
18,
759,
3146,
11,
4672,
1150,
67,
529,
273,
1058,
18,
14588,
3292,
768,
3546,
2025,
273,
12031,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1765,
67,
4683,
12,
2890,
4672,
364,
1058,
316,
365,
18,
14357,
18,
2165,
4720,
2668,
18,
759,
3146,
11,
4672,
1150,
67,
529,
273,
1058,
18,
14588,
3292,
768,
3546,
2025,
273,
12031,
1... |
if type(nb) is int and nb < len(res_comments): first_res_comments = res_comments[:nb] | if type(nb_comments) is int and nb_comments < len(res_comments): first_res_comments = res_comments[:nb_comments] | def get_first_comments_or_remarks(recID=-1, ln=cdslang, nb='all', voted=-1, reported=-1): """ Gets nb number comments/reviews or remarks. In the case of comments, will get both comments and reviews Comments and remarks sorted by most recent date, reviews sorted by highest helpful score @param recID: record id @param ln: language @param nb: number of comment/reviews or remarks to get @param voted: 1 if user has voted for a remark @param reported: 1 if user has reported a comment or review @return if comment, tuple (comments, reviews) both being html of first nb comments/reviews if remark, tuple (remakrs, None) """ warnings = [] errors = [] voted = wash_url_argument(voted, 'int') reported = wash_url_argument(reported, 'int') ## check recID argument if type(recID) is not int: return () if recID >= 1 or recID <= -100: #comment or remark if cfg_webcomment_allow_reviews: res_reviews = query_retrieve_comments_or_remarks(recID=recID, display_order="hh", ranking=1) nb_res_reviews = len(res_reviews) ## check nb argument if type(nb) is int and nb < len(res_reviews): first_res_reviews = res_reviews[:nb] else: if nb_res_reviews > cfg_webcomment_nb_reviews_in_detailed_view: first_res_reviews = res_reviews[:cfg_comment_nb_reports_before_send_email_to_admin] else: first_res_reviews = res_reviews if cfg_webcomment_allow_comments: res_comments = query_retrieve_comments_or_remarks(recID=recID, display_order="od", ranking=0) nb_res_comments = len(res_comments) ## check nb argument if type(nb) is int and nb < len(res_comments): first_res_comments = res_comments[:nb] else: if nb_res_comments > cfg_webcomment_nb_comments_in_detailed_view: first_res_comments = res_comments[:cfg_webcomment_nb_comments_in_detailed_view] else: first_res_comments = res_comments else: #error errors.append(('ERR_WEBCOMMENT_RECID_INVALID', recID)) #!FIXME dont return error anywhere since search page # comment if recID >= 1: comments = reviews = "" if reported > 0: warnings.append(('WRN_WEBCOMMENT_FEEDBACK_RECORDED_GREEN_TEXT',)) elif reported == 0: warnings.append(('WRN_WEBCOMMENT_FEEDBACK_NOT_RECORDED_RED_TEXT',)) if cfg_webcomment_allow_comments: # normal comments comments = webcomment_templates.tmpl_get_first_comments_without_ranking(recID, ln, first_res_comments, nb_res_comments, warnings) if cfg_webcomment_allow_reviews: # ranked comments #calculate average score avg_score = calculate_avg_score(res_reviews) if voted > 0: warnings.append(('WRN_WEBCOMMENT_FEEDBACK_RECORDED_GREEN_TEXT',)) elif voted == 0: warnings.append(('WRN_WEBCOMMENT_FEEDBACK_NOT_RECORDED_RED_TEXT',)) reviews = webcomment_templates.tmpl_get_first_comments_with_ranking(recID, ln, first_res_reviews, nb_res_reviews, avg_score, warnings) return (comments, reviews) # remark else: return(webcomment_templates.tmpl_get_first_remarks(first_res_comments, ln, nb_res_comments), None) | 59b2f46200e058cd5c93d817edb4a6602269fb3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3302/59b2f46200e058cd5c93d817edb4a6602269fb3a/webcomment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3645,
67,
9231,
67,
280,
67,
2764,
27943,
12,
3927,
734,
29711,
21,
16,
7211,
33,
4315,
2069,
539,
16,
4264,
2218,
454,
2187,
331,
16474,
29711,
21,
16,
14010,
29711,
21,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3645,
67,
9231,
67,
280,
67,
2764,
27943,
12,
3927,
734,
29711,
21,
16,
7211,
33,
4315,
2069,
539,
16,
4264,
2218,
454,
2187,
331,
16474,
29711,
21,
16,
14010,
29711,
21,
4672... |
self.definition = definition | self.definition = str(definition) | def __init__(self, parent, title, itemid, definition, amount = 1): MakeAction.__init__(self, parent, title) self.itemid = itemid self.definition = definition self.amount = amount self.otherhtml = '' self.materialshtml = '' self.skillshtml = '' self.hasdetails = 1 | 08fd4d21f876c63596100977b08ed1357780ec09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/08fd4d21f876c63596100977b08ed1357780ec09/makemenus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
16,
16862,
16,
2379,
16,
3844,
273,
404,
4672,
4344,
1803,
16186,
2738,
972,
12,
2890,
16,
982,
16,
2077,
13,
365,
18,
17252,
273,
16862,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
982,
16,
2077,
16,
16862,
16,
2379,
16,
3844,
273,
404,
4672,
4344,
1803,
16186,
2738,
972,
12,
2890,
16,
982,
16,
2077,
13,
365,
18,
17252,
273,
16862,
... |
member = '"mailto:DEV-GROUP@host.com"' | member = 'mailto:DEV-GROUP@host.com' | def test_property(self): """Test to create, access and encode a property with or without parameters. """ # Property without parameter expected = ['SUMMARY:This is the summary\n'] | 4284d14984f2a4b3da93b77281110353f761aa67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12681/4284d14984f2a4b3da93b77281110353f761aa67/test_ical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4468,
12,
2890,
4672,
3536,
4709,
358,
752,
16,
2006,
471,
2017,
279,
1272,
598,
578,
2887,
1472,
18,
3536,
468,
4276,
2887,
1569,
2665,
273,
10228,
14020,
11293,
30,
2503,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4468,
12,
2890,
4672,
3536,
4709,
358,
752,
16,
2006,
471,
2017,
279,
1272,
598,
578,
2887,
1472,
18,
3536,
468,
4276,
2887,
1569,
2665,
273,
10228,
14020,
11293,
30,
2503,
353... |
"""Resets all ID fields.""" | """Reset all ID fields.""" | def _resetID(self): """Resets all ID fields.""" # Dirty.. .=)) self._setID((None,) * len(self._sqlPrimary)) self._new = True | 6f065d7f40e2cd8ad1cba00bf68d639f5bb58726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1051/6f065d7f40e2cd8ad1cba00bf68d639f5bb58726/forgetSQL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6208,
734,
12,
2890,
4672,
3536,
7013,
777,
1599,
1466,
12123,
468,
463,
30012,
838,
1587,
3719,
365,
6315,
542,
734,
12443,
7036,
16,
13,
380,
562,
12,
2890,
6315,
4669,
6793,
3719... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6208,
734,
12,
2890,
4672,
3536,
7013,
777,
1599,
1466,
12123,
468,
463,
30012,
838,
1587,
3719,
365,
6315,
542,
734,
12443,
7036,
16,
13,
380,
562,
12,
2890,
6315,
4669,
6793,
3719... |
self.assertEquals('file', error.type) self.assertEquals('nosuchfile: not found', error.info) | self.assertEquals('file', error.type()) self.assertEquals('nosuchfile: not found', error.info()) | def testError(self): tmpl = template.Template( { 'BLOCKS': { 'badinc': '[% INCLUDE nosuchfile %]' } }) self.assert_(not tmpl.process('badinc')) error = tmpl.error() self.assert_(error) self.assert_(isinstance(error, base.Exception)) self.assertEquals('file', error.type) self.assertEquals('nosuchfile: not found', error.info) | fa79ad39a61af067262479c4a935b54360d58ddd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1390/fa79ad39a61af067262479c4a935b54360d58ddd/error_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
668,
12,
2890,
4672,
10720,
273,
1542,
18,
2283,
12,
288,
296,
11403,
55,
4278,
288,
296,
8759,
9523,
4278,
21848,
28062,
26628,
2648,
768,
738,
3864,
289,
289,
13,
365,
18,
11231,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
668,
12,
2890,
4672,
10720,
273,
1542,
18,
2283,
12,
288,
296,
11403,
55,
4278,
288,
296,
8759,
9523,
4278,
21848,
28062,
26628,
2648,
768,
738,
3864,
289,
289,
13,
365,
18,
11231,... |
'location_dest_id': produc_id | 'location_dest_id': product_id | def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit): """ On change of operation type it sets source location, destination location and to invoice field. @param product: Changed operation type. @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ if not type: return {'value': { 'location_id': False, 'location_dest_id': False } } produc_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0] | be1a8c1e604749abf7ee3480839b37552209b85e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be1a8c1e604749abf7ee3480839b37552209b85e/mrp_repair.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
7624,
67,
723,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
618,
16,
18779,
67,
3595,
4672,
3536,
2755,
2549,
434,
1674,
618,
518,
1678,
1084,
2117,
16,
2929,
2117,
471,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
7624,
67,
723,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
618,
16,
18779,
67,
3595,
4672,
3536,
2755,
2549,
434,
1674,
618,
518,
1678,
1084,
2117,
16,
2929,
2117,
471,
... |
if type(obj) in [str, unicode, int, long, float, complex, bool, types.NoneType, types.FunctionType, types.LambdaType, types.MethodType, types.InstanceType]: | if _is_in(type(obj), [str, unicode, int, long, float, complex, bool, types.NoneType, types.FunctionType, types.LambdaType, types.MethodType, types.InstanceType]): | def _copy(self, obj): """ <Purpose> Create a deep copy of an object without using the python 'copy' module. Using copy.deepcopy() doesn't work because builtins like id and hasattr aren't available when this is called. <Arguments> self obj The object to make a deep copy of. <Exceptions> TypeError If an object is encountered that we don't know how to make a copy of. NamespaceViolationError If an unexpected error occurs while copying. This isn't the greatest solution, but in general the idea is we just need to abort the wrapped function call. <Side Effects> A new reference is created to every non-simple type of object. That is, everything except objects of type str, unicode, int, etc. <Returns> The deep copy of obj. """ try: # types.InstanceType is included because the user can provide an instance # of a class of their own in the list of callback args to settimer. if type(obj) in [str, unicode, int, long, float, complex, bool, types.NoneType, types.FunctionType, types.LambdaType, types.MethodType, types.InstanceType]: return obj elif type(obj) in [tuple, list, set, frozenset]: temp_list = [] for item in obj: temp_list.append(self._copy(item)) if type(obj) is tuple: return tuple(temp_list) elif type(obj) is set: return set(temp_list) elif type(obj) is frozenset: return frozenset(temp_list) else: return temp_list elif type(obj) is dict: temp_dict = {} for key in obj: temp_dict[key] = self._copy(obj[key]) return temp_dict # We don't copy certain objects. This is because copying an emulated file # object, for example, will cause the destructor of the original one to # be invoked, which will close the actual underlying file. As the object # is wrapped and the client does not have access to it, it's safe to not # wrap it. elif isinstance(obj, (NamespaceObjectWrapper, emulfile.emulated_file, emulcomm.emulated_socket, thread.LockType)): return obj else: raise TypeError("_copy is not implemented for objects of type " + str(type(obj))) except Exception, e: self._handle_violation("_copy failed on " + str(obj) + " with message " + str(e)) | 21f3c0e95b7b1702eeb6283f53d4f9d7960179d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/21f3c0e95b7b1702eeb6283f53d4f9d7960179d0/namespace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3530,
12,
2890,
16,
1081,
4672,
3536,
411,
10262,
4150,
34,
1788,
279,
4608,
1610,
434,
392,
733,
2887,
1450,
326,
5790,
296,
3530,
11,
1605,
18,
11637,
1610,
18,
16589,
3530,
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,
389,
3530,
12,
2890,
16,
1081,
4672,
3536,
411,
10262,
4150,
34,
1788,
279,
4608,
1610,
434,
392,
733,
2887,
1450,
326,
5790,
296,
3530,
11,
1605,
18,
11637,
1610,
18,
16589,
3530,
1435,... |
self.prompt=u"[%s]: " % (string.join(prompt,"/")) | self.prompt=u" [%s]: " % (string.join(prompt,"/")) | def __init__(self,abortable,required,default,choice): InputWidget.__init__(self,abortable,required) from input import InputError self.single_choice=[] self.string_choice=[] self.range_choice=[] prompt=[] for c in choice: if type(c) in (StringType,UnicodeType): if len(c)==1: self.single_choice.append(c) else: self.string_choice.append(c) if c==default: prompt.append(c.upper()) else: prompt.append(c) elif type(c) is IntType: self.range_choice.append(xrange(c,c+1)) prompt.append(str(c)) elif type(c) is XRangeType: self.range_choice.append(c) p="%i-%i" % (c[0],c[-1]) if default in c: p+="(%i)" % (default,) prompt.append(p) else: raise InputError,"Bad choice value: %r" % (c,) self.prompt=u"[%s]: " % (string.join(prompt,"/")) self.content=u"" self.default=default self.pos=0 | f9695375f92ac56051eb1897d17f9e4936f27b06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12768/f9695375f92ac56051eb1897d17f9e4936f27b06/choice_input.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
18623,
429,
16,
4718,
16,
1886,
16,
11569,
4672,
2741,
4609,
16186,
2738,
972,
12,
2890,
16,
18623,
429,
16,
4718,
13,
628,
810,
1930,
2741,
668,
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,
1001,
2738,
972,
12,
2890,
16,
18623,
429,
16,
4718,
16,
1886,
16,
11569,
4672,
2741,
4609,
16186,
2738,
972,
12,
2890,
16,
18623,
429,
16,
4718,
13,
628,
810,
1930,
2741,
668,
365,
18... |
def main(instr_path, dir_to_clean): | def clean_folder(instr_path, dir_to_clean): """ <Purpose> Given an instructions file and a directory, it will make sure that the directory matches the instructions, deleting files where necessary, printing errors where files are missing, and printing warnings where unrecognized files exist. <Arguments> instr_path: The location of the instructions file to be used. dir_to_clean: The location of the directory to be cleaned. <Exceptions> IllegalArgError on bad filepaths. ParseError on invalid instructions file. <Side Effects> None. <Returns> None. """ | def main(instr_path, dir_to_clean): # First, get the required files and the files to be deleted (req_files, del_files) = parse_instructions(instr_path) req_files_found = [False for i in range(len(req_files))] unrecognized_files = [] if not os.path.exists(dir_to_clean): raise IllegalArgError("Given directory does not exist: " + dir_to_clean) for filename in os.listdir(dir_to_clean): deleted = False for del_file in del_files: if re.match(del_file, filename): deleted = True try: os.remove(dir_to_clean + "/" + filename) except OSError: # If it can't delete for some reason, move on pass if not deleted: required = False for i in range(len(req_files)): for part in req_files[i].split(","): part = part.strip() if re.match(part, filename): req_files_found[i] = True required = True if not required: unrecognized_files.append(filename) for filename in unrecognized_files: output("Warning: unrecognized file " + filename + " in " + dir_to_clean) for i in range(len(req_files)): if not req_files_found[i]: output("Error: required file " + req_files[i] + " not found in " + dir_to_clean) | 958b93cb1e0f3ea2b72c48a31383e8c4d00d0ec3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7995/958b93cb1e0f3ea2b72c48a31383e8c4d00d0ec3/clean_folder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
67,
5609,
12,
267,
701,
67,
803,
16,
1577,
67,
869,
67,
6200,
4672,
3536,
411,
10262,
4150,
34,
16803,
392,
12509,
585,
471,
279,
1867,
16,
518,
903,
1221,
3071,
716,
326,
1867,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
67,
5609,
12,
267,
701,
67,
803,
16,
1577,
67,
869,
67,
6200,
4672,
3536,
411,
10262,
4150,
34,
16803,
392,
12509,
585,
471,
279,
1867,
16,
518,
903,
1221,
3071,
716,
326,
1867,
... |
"""ButtonBox - A container for pushbuttons""" | """ButtonBox - A container for pushbuttons. Subwidgets are the buttons added with the add method. """ | def unbind_widget(self, widget): self.tk.call(self._w, 'unbind', widget._w) | 48af83dadc128720a7642beb50800c6971404eb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/48af83dadc128720a7642beb50800c6971404eb9/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17449,
67,
6587,
12,
2890,
16,
3604,
4672,
365,
18,
16099,
18,
1991,
12,
2890,
6315,
91,
16,
296,
318,
4376,
2187,
3604,
6315,
91,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17449,
67,
6587,
12,
2890,
16,
3604,
4672,
365,
18,
16099,
18,
1991,
12,
2890,
6315,
91,
16,
296,
318,
4376,
2187,
3604,
6315,
91,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
print "=== Lookup for", start_word, "stopped" return | print "[update_completion_worker] === Lookup for", start_word, "stopped" break | def update_completion_worker(self): while True: print "Waiting for next update completion task" start_word, to_select = self.update_completion_q.get() self.update_completion_stopped = False print "update_completion_worker: will look for", start_word, "in", self.dictionaries.size(), "dictionaries" lang_word_list = {} skipped = util.ListMap() for lang in self.dictionaries.langs(): word_lookups = sdict.WordLookupByWord() for item in self.dictionaries.get_word_list_iter(lang, start_word): if self.update_completion_stopped: print "=== Lookup for", start_word, "stopped" return if isinstance(item, sdict.WordLookup): word_lookups[item.word].add_articles(item) else: skipped[item.dict].append(item) word_list = word_lookups.values() word_list.sort(key=str) if len (word_list) > 0: lang_word_list[lang] = word_list for dict, skipped_words in skipped.iteritems(): print "skipped %d words in %s" % (len(skipped_words), dict) for stats in dict.index(skipped_words): if self.update_completion_stopped: print "=== Indexing of", len(skipped_words), "in",dict, "stopped" break if not self.update_completion_stopped: gobject.idle_add(self.update_completion_callback, lang_word_list, to_select) else: print "=== Word list update finished, but stop request was received, will not update UI" self.update_completion_q.task_done() | 2eaab3657626ca2843fa42964af0e31d029027df /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14305/2eaab3657626ca2843fa42964af0e31d029027df/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
11469,
67,
10124,
12,
2890,
4672,
1323,
1053,
30,
1172,
315,
15946,
364,
1024,
1089,
8364,
1562,
6,
787,
67,
1095,
16,
358,
67,
4025,
273,
365,
18,
2725,
67,
11469,
67,
85,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11469,
67,
10124,
12,
2890,
4672,
1323,
1053,
30,
1172,
315,
15946,
364,
1024,
1089,
8364,
1562,
6,
787,
67,
1095,
16,
358,
67,
4025,
273,
365,
18,
2725,
67,
11469,
67,
85,
... |
d.set_comments('This plugin work as text editor inside PIDA') | d.set_comments('This plugin works as text editor inside PIDA') | def about(self, mi): d = gtk.AboutDialog() d.set_name('Culebra Editor') d.set_version('0.2.3') d.set_copyright('Copyright © 2005 Fernando San Martín Woerner') d.set_comments('This plugin work as text editor inside PIDA') d.set_authors(['Fernando San Martín Woerner (fsmw@gnome.org)']) d.show() | 0f525b61e6243365ac6f2740ddaa0261cedfc786 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/0f525b61e6243365ac6f2740ddaa0261cedfc786/edit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2973,
12,
2890,
16,
12837,
4672,
302,
273,
22718,
18,
24813,
6353,
1435,
302,
18,
542,
67,
529,
2668,
39,
725,
15397,
18451,
6134,
302,
18,
542,
67,
1589,
2668,
20,
18,
22,
18,
23,
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,
2973,
12,
2890,
16,
12837,
4672,
302,
273,
22718,
18,
24813,
6353,
1435,
302,
18,
542,
67,
529,
2668,
39,
725,
15397,
18451,
6134,
302,
18,
542,
67,
1589,
2668,
20,
18,
22,
18,
23,
6... |
print msg break | sys.exit() | def main(options): """ Main execution loop of the server. """ # config = get_conf('server') # LOG_FILE = config['log_file'] # LOG_LEVEL = config['log_level'] # SSL = get_bool(config['ssl']) # SSL_PRIVKEY = config['privkey_file'] # SSL_CERT = config['cert_file'] # CLIENT_PORT = int(config['client_port']) # PUBKEY_DATABASE = os.path.expanduser(config['pubkey_database']) # STATS_FILE = config['stats_file'] LOG_FILE = options.logfile LOG_LEVEL = options.loglevel SSL = get_bool(options.ssl) SSL_PRIVKEY = options.privkey SSL_CERT = options.cert CLIENT_PORT = options.port STATS_FILE = options.statsfile DB_FILE = options.dbfile FAILURE_THRESHOLD = options.job_failure_threshold # start logging startLogging(LOG_FILE) # Job database jobdb = JobDatabaseSQLite(db_file=DB_FILE, job_failure_threshold=FAILURE_THRESHOLD, log_file=LOG_FILE, log_level=LOG_LEVEL) # Worker database monitordb = MonitorDatabase(db_file=DB_FILE, log_file=LOG_FILE, log_level=LOG_LEVEL) # Client database clientdb = ClientDatabase() # Create the main DSage object dsage_server = DSageServer(jobdb, monitordb, clientdb, log_level=LOG_LEVEL) p = _SSHKeyPortalRoot(portal.Portal(Realm(dsage_server))) # Credentials checker p.portal.registerChecker(PublicKeyCredentialsCheckerDB(clientdb)) # HACK: unsafeTracebacks should eventually be TURNED off client_factory = pb.PBServerFactory(p, unsafeTracebacks=True) # Create the looping call that will output the XML file for Dashboard tsk1 = task.LoopingCall(write_stats, dsage_server, STATS_FILE) tsk1.start(5.0, now=False) # Create the PBServerFactory for workers # Use this for unauthorized workers # dsage_worker = DSageWorkerServer(jobdb, log_level=LOG_LEVEL) # worker_factory = WorkerPBServerFactory(dsage_worker) dsage_server.client_factory = client_factory attempts = 0 err_msg = "Could not find an open port after 50 attempts." NEW_CLIENT_PORT = CLIENT_PORT while True: if attempts > 50: log.err(err_msg) log.err('Last attempted port: %s' % (NEW_CLIENT_PORT)) sys.exit(-1) try: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('', NEW_CLIENT_PORT)) port_used = True except socket.error, msg: port_used = False if not port_used: if SSL: ssl_context = ssl.DefaultOpenSSLContextFactory( SSL_PRIVKEY, SSL_CERT) reactor.listenSSL(NEW_CLIENT_PORT, client_factory, contextFactory = ssl_context) break else: reactor.listenTCP(NEW_CLIENT_PORT, client_factory) break else: raise SystemError('Trying to bind to open port: ' + '%s.' % (NEW_CLIENT_PORT)) except (SystemError, error.CannotListenError): attempts += 1 NEW_CLIENT_PORT += 1 except Exception, msg: if SSL: print 'Error starting server with SSL enabled, please ' + \ 'check your configuration' else: print 'Error starting server, please check your configuration' print msg break if CLIENT_PORT != NEW_CLIENT_PORT: log.msg(DELIMITER) log.msg("***NOTICE***") log.msg("Changing listening port in server.conf " + "to %s" % (NEW_CLIENT_PORT)) log.msg(DELIMITER) log.msg(DELIMITER) log.msg('DSAGE Server') log.msg('Started with PID: %s' % (os.getpid())) if SSL: log.msg('Using SSL: True') else: log.msg('Using SSL: False') log.msg('Listening on port: %s' % (NEW_CLIENT_PORT)) log.msg(DELIMITER) # Code below can be turned on to do countrefs # from sage.dsage.misc.countrefs import logInThread # logInThread(n=15) # reactor.callWhenRunning(create_manhole) # import pdb; pdb.set_trace() if options.noblock: reactor.run(installSignalHandlers=0) else: reactor.run(installSignalHandlers=1) | a071b032ff5b433666efb987d420ef707525ccb1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a071b032ff5b433666efb987d420ef707525ccb1/dsage_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
4672,
3536,
12740,
4588,
2798,
434,
326,
1438,
18,
225,
3536,
225,
468,
642,
273,
336,
67,
3923,
2668,
3567,
6134,
468,
2018,
67,
3776,
273,
642,
3292,
1330,
67,
768,
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,
2774,
12,
2116,
4672,
3536,
12740,
4588,
2798,
434,
326,
1438,
18,
225,
3536,
225,
468,
642,
273,
336,
67,
3923,
2668,
3567,
6134,
468,
2018,
67,
3776,
273,
642,
3292,
1330,
67,
768,
3... |
self.count = 0 | def __init__(self, hdf, prefix='changeset.diff'): self.count = 0 self.block = [] self.ttype = None self.p_block = [] self.p_type = None self.hdf = hdf self.prefix = prefix self.changeno = 0 self.blockno = 0 | 5dca6282e50a01de0d2391edf83de1f9e93f7147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5dca6282e50a01de0d2391edf83de1f9e93f7147/Changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
24217,
16,
1633,
2218,
6329,
278,
18,
5413,
11,
4672,
365,
18,
2629,
273,
5378,
365,
18,
88,
723,
225,
273,
599,
365,
18,
84,
67,
2629,
273,
5378,
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,
1001,
2738,
972,
12,
2890,
16,
24217,
16,
1633,
2218,
6329,
278,
18,
5413,
11,
4672,
365,
18,
2629,
273,
5378,
365,
18,
88,
723,
225,
273,
599,
365,
18,
84,
67,
2629,
273,
5378,
365,... | |
%s """ % (start_string_prefix, uric, urilast, uric, urilast, uric, urilast, emailc, emailc, emailc, emailc, urilast, end_string_suffix,), re.VERBOSE)) | %(end_string_suffix)s """ % locals(), re.VERBOSE)) | def parse(self, text, lineno, memo, parent): """ Return 2 lists: nodes (text and inline elements), and system_messages. | a5c0eb6861885d1f50c31667ba475c9c99a4acf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/a5c0eb6861885d1f50c31667ba475c9c99a4acf6/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
977,
16,
7586,
16,
11063,
16,
982,
4672,
3536,
2000,
576,
6035,
30,
2199,
261,
955,
471,
6370,
2186,
3631,
471,
2619,
67,
6833,
18,
2,
-100,
-100,
-100,
-100,
-100,... |
def update_equality_graph(eq_graph_edges, s, t, mat) | def update_equality_graph(eq_graph, s, t, mat, x_vec, y_vec): | def update_equality_graph(eq_graph_edges, s, t, mat) # update the equality graph based on the new labelings # only edges that contain the vertices in s and t need to be # checked. # add equality edges from s for x_el in s: row = y_vec[x_el.index] x_w = x_el.label_weight weight_row = mat[x_el.index] for y_el in row: y_w = y_el.label_weight w = weight_row[y_el.index] if (x_w + y_w) == w: eq_graph.add(x_el, y_el) else: eq_graph.remove(x_el, y_el) # add equality edges from t for y_el in t: offset = y_el.index y_w = y_el.label_weight for x_el, row in itertools.izip(x_vec, mat): x_w = x_el.label_weight w = mat[x_el.index][offset] if (x_w + y_w) == w: eq_graph.add(x_el, y_el) else: eq_graph.remove(x_el, y_el) | a2ad0dee0947cbc68b1113dad3dc27777f909fdb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11717/a2ad0dee0947cbc68b1113dad3dc27777f909fdb/partition_dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
9729,
560,
67,
4660,
12,
11253,
67,
4660,
16,
272,
16,
268,
16,
4834,
16,
619,
67,
8799,
16,
677,
67,
8799,
4672,
468,
1089,
326,
14958,
2667,
2511,
603,
326,
394,
1433,
89... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9729,
560,
67,
4660,
12,
11253,
67,
4660,
16,
272,
16,
268,
16,
4834,
16,
619,
67,
8799,
16,
677,
67,
8799,
4672,
468,
1089,
326,
14958,
2667,
2511,
603,
326,
394,
1433,
89... |
self.selenium.wait_for_condition(self._selenium_page_timeout) | self.selenium.wait_for_condition('window.selenium_ready == true', self._selenium_page_timeout) | def check_result(user): "Check if the user is alone in the result list" #Also check if the the results are right assert self.selenium.get_text(\ "//table[contains(@class, 'datatable')]/tbody/tr[last()]//td[2]") ==\ user | 7686569c6e1eb1b3ab91cb4d767cf5f1ee14324c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/7686569c6e1eb1b3ab91cb4d767cf5f1ee14324c/test_user_management.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2088,
12,
1355,
4672,
315,
1564,
309,
326,
729,
353,
24068,
316,
326,
563,
666,
6,
468,
1067,
2048,
866,
309,
326,
326,
1686,
854,
2145,
1815,
365,
18,
1786,
17327,
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,
2088,
12,
1355,
4672,
315,
1564,
309,
326,
729,
353,
24068,
316,
326,
563,
666,
6,
468,
1067,
2048,
866,
309,
326,
326,
1686,
854,
2145,
1815,
365,
18,
1786,
17327,
18,
588,
... |
self.statement=Redland.librdf_new_statement(__world__.world) def __del__(self): if __debug__: | self.statement=Redland.librdf_new_statement(_world.world) def __del__(self): global _debug if _debug: | def __init__(self, **args): """Create an RDF Statement (constructor).""" if __debug__: print "Creating RDF.statement object args",args self.statement=None self.free_me=1 | 9d200f22543978d0df7fbde12b64052f94f16755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14754/9d200f22543978d0df7fbde12b64052f94f16755/RDF.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
3536,
1684,
392,
13539,
8056,
261,
12316,
13,
12123,
309,
1001,
4148,
972,
30,
1172,
315,
11092,
13539,
18,
11516,
733,
833,
3113,
1968,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
3536,
1684,
392,
13539,
8056,
261,
12316,
13,
12123,
309,
1001,
4148,
972,
30,
1172,
315,
11092,
13539,
18,
11516,
733,
833,
3113,
1968,
... |
“Hyper-Star Graph: A New Interconnection Network Improving the Network Cost of the Hypercube.” In Proceedings of the First EurAsian | "Hyper-Star Graph: A New Interconnection Network Improving the Network Cost of the Hypercube." In Proceedings of the First EurAsian | def HyperStarGraph(self,n,k): r''' Returns the hyper star graph HS(n,k). | 346077e6393b41e1dedbad030afee4bb67844281 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/346077e6393b41e1dedbad030afee4bb67844281/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18274,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
9512,
10443,
2667,
670,
55,
12,
82,
16,
79,
2934,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18274,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
9512,
10443,
2667,
670,
55,
12,
82,
16,
79,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return [('id', 'in', child_ids.get(uid,[]))] | return [('id', 'in', child_ids.get(uid, []))] | def _parent_search(self, cr, uid, obj, name, args, context=None): if context is None: context = {} parent = [] for arg in args: if arg[0] == 'parent_id': parent = arg[2] child_ids = self._child_compute(cr, uid, parent, name, args, context=context) if not child_ids: return [('id', 'in', [0])] return [('id', 'in', child_ids.get(uid,[]))] | 096ec13381cfb6869abdf9d9e6d69469c89d8678 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/096ec13381cfb6869abdf9d9e6d69469c89d8678/hr_department.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2938,
67,
3072,
12,
2890,
16,
4422,
16,
4555,
16,
1081,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
982,
273,
5378,
364,
1501,
316,
833,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2938,
67,
3072,
12,
2890,
16,
4422,
16,
4555,
16,
1081,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
982,
273,
5378,
364,
1501,
316,
833,
... |
if (not match or not match.group(1)) and vc_type in _version_controls: | if (not match or not match.group(1)) and vcs.get_backend(vc_type): | def parse_editable(editable_req): """Parses svn+http://blahblah@rev#egg=Foobar into a requirement (Foobar) and a URL""" url = editable_req if os.path.isdir(url) and os.path.exists(os.path.join(url, 'setup.py')): # Treating it as code that has already been checked out url = filename_to_url(url) if url.lower().startswith('file:'): return None, url for vc_type in _version_controls: if url.lower().startswith('%s:' % vc_type): url = '%s+' % vc_type + url if '+' not in url: if default_vcs: url = default_vcs + '+' + url else: raise InstallationError( '--editable=%s should be formatted with svn+URL, git+URL or hg+URL' % editable_req) vc_type = url.split('+', 1)[0].lower() if vc_type not in _version_controls: raise InstallationError( 'For --editable=%s only svn (svn+URL), Git (git+URL) and Mercurial (hg+URL) is currently supported' % editable_req) match = re.search(r'(?:#|#.*?&)egg=([^&]*)', editable_req) if (not match or not match.group(1)) and vc_type in _version_controls: parts = [p for p in editable_req.split('#', 1)[0].split('/') if p] if parts[-2] in ('tags', 'branches', 'tag', 'branch'): req = parts[-3] elif parts[-1] == 'trunk': req = parts[-2] else: raise InstallationError( '--editable=%s is not the right format; it must have #egg=Package' % editable_req) else: req = match.group(1) ## FIXME: use package_to_requirement? match = re.search(r'^(.*?)(?:-dev|-\d.*)', req) if match: # Strip off -dev, -0.2, etc. req = match.group(1) return req, url | 404ce4d68b7ccae8baf7b8e9c98d76c7210aa5aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/404ce4d68b7ccae8baf7b8e9c98d76c7210aa5aa/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
19653,
12,
19653,
67,
3658,
4672,
3536,
6656,
5893,
82,
15,
2505,
2207,
3083,
9795,
3083,
9795,
36,
9083,
7,
23171,
33,
42,
83,
947,
297,
1368,
279,
12405,
261,
42,
83,
947,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
19653,
12,
19653,
67,
3658,
4672,
3536,
6656,
5893,
82,
15,
2505,
2207,
3083,
9795,
3083,
9795,
36,
9083,
7,
23171,
33,
42,
83,
947,
297,
1368,
279,
12405,
261,
42,
83,
947,
... |
net_count = 0 "8005551213 > llin nets 2001 123 456 78 90" | count = 0 | def testGenerateNetFixture(self): """ This isn't actually a test. It just takes advantage of the test harness to spam a bunch of messages to the supply app and spit out the data in a format that can be sucked into a fixture """ # this is the number of net reports that will be generated net_count = 0 "8005551213 > llin nets 2001 123 456 78 90" # the sender will always be the same, for now phone = "55555" expected_actual_match_percent = .8 # allow specifying the minimum and maximum dates for message generation min_date = datetime(2009,4,1) max_date = datetime(2009,4,30) min_time = time.mktime(min_date.timetuple()) max_time = time.mktime(max_date.timetuple()) # these are the locations that will be chosen. The actual # location will be a distribution point under one of these # wards wards = [200101, 200102, 200103, 200104, 200201] all_net_strings = [] for i in range(net_count): date = datetime.fromtimestamp(random.randint(min_time, max_time)) ward = Location.objects.get(code=random.choice(wards)) dp = random.choice(ward.children.all()) distributed = random.randint(50,500) expected = random.randint(0,2000) # create an actual amount based on the likelihood of match if random.random() < expected_actual_match_percent: actual = expected else: actual = random.randint(0,2000) discrepancy = random.randint(0,distributed/5) net_string = "%s@%s > llin nets %s %s %s %s %s" % (phone, date.strftime("%Y%m%d%H%M"), dp.code, distributed, expected, actual, discrepancy) all_net_strings.append(net_string) script = "\n".join(all_net_strings) self.runScript(script) dumpdata = Command() filename = os.path.abspath(os.path.join(os.path.dirname(__file__),"fixtures/test_net_data.json")) options = { "indent" : 2 } datadump = dumpdata.handle("nigeria", **options) # uncomment these lines to save the fixture #file = open(filename, "w") #file.write(datadump) #file.write(datadump) #file.close() #print "=== Successfully wrote fixtures to %s ===" % filename | da380eee6f7c5d277d18706ac990f23216dcd4f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/da380eee6f7c5d277d18706ac990f23216dcd4f5/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4625,
7308,
26392,
12,
2890,
4672,
3536,
1220,
5177,
1404,
6013,
279,
1842,
18,
225,
2597,
2537,
5530,
1261,
7445,
410,
434,
326,
1842,
366,
1303,
403,
358,
24824,
279,
25606,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4625,
7308,
26392,
12,
2890,
4672,
3536,
1220,
5177,
1404,
6013,
279,
1842,
18,
225,
2597,
2537,
5530,
1261,
7445,
410,
434,
326,
1842,
366,
1303,
403,
358,
24824,
279,
25606,
434,
... |
server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json) | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url listen_port = server.server_port server._device_management_handler = None elif options.server_type == SERVER_SYNC: server = SyncHTTPServer(('127.0.0.1', port), SyncPageHandler) print 'Sync HTTP server started on port %d...' % server.server_port listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: server_data = { 'port': listen_port } server_data_json = simplejson.dumps(server_data) debug('sending server_data: %s' % server_data_json) if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | e98ed6c2044d751b05eace99e5a3cf191ecda36b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e98ed6c2044d751b05eace99e5a3cf191ecda36b/testserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
2589,
18,
10283,
273,
1387,
8438,
92,
264,
12,
9499,
18,
10283,
16,
15204,
13,
2589,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2116,
16,
833,
4672,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
2589,
18,
10283,
273,
1387,
8438,
92,
264,
12,
9499,
18,
10283,
16,
15204,
13,
2589,
1... | |
return f.rhs() - f.lhs() | s = symbolic_expression(f.rhs() - f.lhs()).function(*variables) return s | def equify(f): """ Returns the equation rewritten to give negative values when True, positive when False. EXAMPLES: sage: from sage.plot.contour_plot import equify sage: equify(x^2 < 2) x^2 - 2 sage: equify(x^2 > 2) 2 - x^2 """ import operator op = f.operator() if op is operator.gt or op is operator.ge: return f.rhs() - f.lhs() else: return f.lhs() - f.rhs() | 53e7b825257a4b83d2112766abf7b79749cd0e7f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/53e7b825257a4b83d2112766abf7b79749cd0e7f/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1298,
1164,
12,
74,
4672,
3536,
2860,
326,
15778,
26768,
358,
8492,
6092,
924,
1347,
1053,
16,
6895,
1347,
1083,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
628,
272,
410,
18,
4032,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1298,
1164,
12,
74,
4672,
3536,
2860,
326,
15778,
26768,
358,
8492,
6092,
924,
1347,
1053,
16,
6895,
1347,
1083,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
628,
272,
410,
18,
4032,
... |
else if isinstance(other,tuple): | elif isinstance(other,tuple): | def __mul__(self,other): if isinstance(other,int): minElements, optElements = other,0 else if isinstance(other,tuple): if len(other)==2: if isinstance(other[0],int) and isinstance(other[1],int)): minElements, optElements = other optElements -= minElements else: raise TypeError("cannot multiply 'ParserElement' and ('%s','%s') objects", type(other[0]),type(other[1])) else: raise TypeError("can only multiply 'ParserElement' and int or (int,int) objects") else: raise TypeError("cannot multiply 'ParserElement' and '%s' objects", type(other)) if minElements < 0: raise ValueError("cannot multiply ParserElement by negative value") if optElements < 0: raise ValueError("second tuple value must be greater or equal to first tuple value") if minElements == optElements == 0: raise ValueError("cannot multiply ParserElement by 0 or (0,0)") if (optElements): def makeOptionalList(n): if n>1: return Optional(self + makeOptionalList(n-1)) else: return Optional(self) if minElements: ret = And([self]*minElements)+ makeOptionalList(optElements) else: ret = makeOptionalList(optElements) else: ret = And([self]*minElements) return ret | 67b5974c57a925760ac9dd44e40ea9dbe87e31fb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12364/67b5974c57a925760ac9dd44e40ea9dbe87e31fb/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
3011,
4672,
309,
1549,
12,
3011,
16,
474,
4672,
1131,
3471,
16,
2153,
3471,
273,
1308,
16,
20,
1327,
1549,
12,
3011,
16,
8052,
4672,
309,
562,
12,
3011,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16411,
972,
12,
2890,
16,
3011,
4672,
309,
1549,
12,
3011,
16,
474,
4672,
1131,
3471,
16,
2153,
3471,
273,
1308,
16,
20,
1327,
1549,
12,
3011,
16,
8052,
4672,
309,
562,
12,
3011,... |
def test_triu_indices(): | def test_triu_indices(self): | def test_triu_indices(): iu1 = triu_indices(4) iu2 = triu_indices(4, 2) | 01362e33c84a2fb03d8b6ff66de866c2d1f9da95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/01362e33c84a2fb03d8b6ff66de866c2d1f9da95/test_twodim_base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16857,
89,
67,
6836,
12,
2890,
4672,
277,
89,
21,
273,
6882,
89,
67,
6836,
12,
24,
13,
277,
89,
22,
273,
6882,
89,
67,
6836,
12,
24,
16,
576,
13,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16857,
89,
67,
6836,
12,
2890,
4672,
277,
89,
21,
273,
6882,
89,
67,
6836,
12,
24,
13,
277,
89,
22,
273,
6882,
89,
67,
6836,
12,
24,
16,
576,
13,
2,
-100,
-100,
-100,
-... |
import os | def import_all_modules_cmd(glpane): #bruce 080721 experimental del glpane import os from utilities.constants import CAD_SRC_PATH _original_cwd = os.getcwd() # so we can restore it before returning try: os.chdir(CAD_SRC_PATH) # this doesn't work, don't know why: ## pipe = os.popen("./tools/AllPyFiles.sh") ## modules = pipe.readlines() # IOError: [Errno 4] Interrupted system call ## pipe.close() # so try this instead: from platform_dependent.PlatformDependent import find_or_make_Nanorex_subdir tmpdir = find_or_make_Nanorex_subdir("TemporaryFiles") tmpfile = os.path.join( tmpdir, "_all_modules" ) os.system("./tools/AllPyFiles.sh > '%s'" % tmpfile) file1 = file(tmpfile, "rU") modules = file1.readlines() file1.close os.remove(tmpfile) print "will import %d modules" % len(modules) # 722 modules as of 080721! modules.sort() SKIP_THESE = ("_import_roots", "main", "ExecSubDir") import_these = [] for module in modules: module = module.strip() if module.startswith("./"): module = module[2:] basename = module assert os.path.exists(module), "should exist: %r" % (module,) assert module.endswith(".py"), "should end with .py: %r" % (module,) module = module[:-3] if module in SKIP_THESE or ' ' in module or '-' in module: # those funny chars can happen when developers have junk files lying around # todo: do a real regexp match, permit identifiers and '/' only; # or, only do this for files known to svn? print "skipping import of", basename continue import_these.append(module.replace('/', '.')) continue for module in import_these: statement = "import " + module try: exec statement except: print_compact_traceback("ignoring exception in %r: " % statement) pass print "done importing all modules" except: print_compact_traceback("ignoring exception: ") os.chdir(_original_cwd) return | 8f7c7fd818831bb371b24f22dc79c158cd6b8f82 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/8f7c7fd818831bb371b24f22dc79c158cd6b8f82/debug.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
454,
67,
6400,
67,
4172,
12,
7043,
29009,
4672,
468,
2848,
3965,
374,
3672,
27,
5340,
23070,
1464,
5118,
29009,
225,
628,
22538,
18,
13358,
1930,
385,
1880,
67,
28413,
67,
4211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
454,
67,
6400,
67,
4172,
12,
7043,
29009,
4672,
468,
2848,
3965,
374,
3672,
27,
5340,
23070,
1464,
5118,
29009,
225,
628,
22538,
18,
13358,
1930,
385,
1880,
67,
28413,
67,
4211... | |
asslength = stop - start if step != 1 or len(x) != asslength: sublist = self.tolist() sublist[i] = x.tolist() self._clear() self.fromlist(sublist) return self._data[start * self.itemsize : stop * self.itemsize] = x._data | boundary1 = start * self.itemsize boundary2 = stop * self.itemsize boundary2new = boundary1 + len(x._data) if boundary2 == boundary2new: self._data[boundary1:boundary2] = x._data else: newdata = bytebuffer(len(self._data) + boundary2new-boundary2) newdata[:boundary1] = self._data[:boundary1] newdata[boundary1:boundary2new] = x._data newdata[boundary2new:] = self._data[boundary2:] self._data = newdata | def __setitem__(self, i, x): if isinstance(i, slice): if (not isinstance(x, array) or self.typecode != x.typecode): raise TypeError("can only assign array of same kind" " to array slice") seqlength = len(self) start, stop, step = i.indices(seqlength) if start < 0: start = 0 if stop < start: stop = start assert stop <= seqlength asslength = stop - start if step != 1 or len(x) != asslength: sublist = self.tolist() # fall-back sublist[i] = x.tolist() self._clear() self.fromlist(sublist) return self._data[start * self.itemsize : stop * self.itemsize] = x._data else: seqlength = len(self) if i < 0: i += seqlength if self.typecode == 'c': # speed trick self._data[i] = x return if not (0 <= i < seqlength): raise IndexError(i) boundary = i * self.itemsize pack_into(self.typecode, self._data, boundary, x) | c28499ec7fee86434eb5d6df895c25dbc9db8b2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/c28499ec7fee86434eb5d6df895c25dbc9db8b2e/array.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
277,
16,
619,
4672,
309,
1549,
12,
77,
16,
2788,
4672,
309,
261,
902,
1549,
12,
92,
16,
526,
13,
578,
365,
18,
723,
710,
480,
619,
18,
723,
710,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
1726,
972,
12,
2890,
16,
277,
16,
619,
4672,
309,
1549,
12,
77,
16,
2788,
4672,
309,
261,
902,
1549,
12,
92,
16,
526,
13,
578,
365,
18,
723,
710,
480,
619,
18,
723,
710,... |
copyfile(stdinc_dir, inc_dir, fn) | copyfile(stdinc_dir, inc_dir) | def create_environment(home_dir, site_packages=True, clear=False): """ Creates a new environment in ``home_dir``. If ``site_packages`` is true (the default) then the global ``site-packages/`` directory will be on the path. If ``clear`` is true (default False) then the environment will first be cleared. """ if sys.platform == 'win32': lib_dir = join(home_dir, 'Lib') else: lib_dir = join(home_dir, 'lib', py_version) inc_dir = join(home_dir, 'include', py_version) if sys.platform == 'win32': bin_dir = join(home_dir, 'Scripts') else: bin_dir = join(home_dir, 'bin') if sys.executable.startswith(bin_dir): print 'Please use the *system* python to run this script' return if clear: rmtree(lib_dir) rmtree(inc_dir) ## FIXME: why not delete it? logger.notify('Not deleting %s', bin_dir) prefix = sys.prefix mkdir(lib_dir) fix_lib64(lib_dir) stdlib_dir = os.path.dirname(os.__file__) for fn in os.listdir(stdlib_dir): if fn != 'site-packages' and os.path.splitext(fn)[0] in REQUIRED_MODULES: copyfile(join(stdlib_dir, fn), join(lib_dir, fn)) mkdir(join(lib_dir, 'site-packages')) writefile(join(lib_dir, 'site.py'), SITE_PY) writefile(join(lib_dir, 'orig-prefix.txt'), prefix) site_packages_filename = join(lib_dir, 'no-global-site-packages.txt') if not site_packages: writefile(site_packages_filename, '') else: if os.path.exists(site_packages_filename): logger.info('Deleting %s' % site_packages_filename) os.unlink(site_packages_filename) stdinc_dir = join(prefix, 'include', py_version) if os.path.exists(stdinc_dir): copyfile(stdinc_dir, inc_dir, fn) else: logger.debug('No include dir %s' % stdinc_dir) if sys.exec_prefix != sys.prefix: if sys.platform == 'win32': exec_dir = join(sys.exec_prefix, 'lib') else: exec_dir = join(sys.exec_prefix, 'lib', py_version) for fn in os.listdir(exec_dir): copyfile(join(exec_dir, fn), join(lib_dir, fn)) mkdir(bin_dir) py_executable = join(bin_dir, os.path.basename(sys.executable)) logger.notify('New python executable in %s', py_executable) if sys.executable != py_executable: ## FIXME: could I just hard link? shutil.copyfile(sys.executable, py_executable) make_exe(py_executable) cmd = [py_executable, '-c', 'import sys; print sys.prefix'] logger.info('Testing executable with %s %s "%s"' % tuple(cmd)) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) proc_stdout, proc_stderr = proc.communicate() proc_stdout = os.path.normcase(os.path.abspath(proc_stdout.strip())) if proc_stdout != os.path.normcase(os.path.abspath(home_dir)): logger.fatal( 'ERROR: The executable %s is not functioning' % py_executable) logger.fatal( 'ERROR: It thinks sys.prefix is %r (should be %r)' % (proc_stdout, os.path.normcase(os.path.abspath(home_dir)))) logger.fatal( 'ERROR: virtualenv is not compatible with this system or executable') sys.exit(100) else: logger.info('Got sys.prefix result: %r' % proc_stdout) pydistutils = os.path.expanduser('~/.pydistutils.cfg') if os.path.exists(pydistutils): logger.notify('Please make sure you remove any previous custom paths from ' 'your %s file.' % pydistutils) install_setuptools(py_executable) | 5b1de68d91b6740b4679a9645ada263a166dc964 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12981/5b1de68d91b6740b4679a9645ada263a166dc964/virtualenv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
10274,
12,
8712,
67,
1214,
16,
2834,
67,
10308,
33,
5510,
16,
2424,
33,
8381,
4672,
3536,
10210,
279,
394,
3330,
316,
12176,
8712,
67,
1214,
68,
8338,
225,
971,
12176,
4256,
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,
752,
67,
10274,
12,
8712,
67,
1214,
16,
2834,
67,
10308,
33,
5510,
16,
2424,
33,
8381,
4672,
3536,
10210,
279,
394,
3330,
316,
12176,
8712,
67,
1214,
68,
8338,
225,
971,
12176,
4256,
6... |
event=DataPool.Event(DataPool.Event.updated_value, new_data_name) | event=DataPool.Event(DataPool.Event.updated_value, new_data_name) | def display_source_changed_event(self, widget, data=None): new_data_name = self.source_list_current() if (self.displayed_data[0] is None and new_data_name==u"None"): return if (self.displayed_data[0]==new_data_name): return if self.displayed_data[1] is not None and hasattr(self.displayed_data[1], "unregister_listener"): self.displayed_data[1].unregister_listener(self.datastructures_listener) self.displayed_data[1]=None # register new one if new_data_name==u"None": self.display_source_path_label.set_label(u"") self.displayed_data=[None,None] self.clear_display() elif self.data_pool is None or new_data_name not in self.data_pool: none_iter=self.source_list_find([u'None']) if none_iter is not None: self.display_source_combobox.set_active_iter(none_iter) self.display_source_path_label.set_label(u"") else: new_data_struct=self.data_pool[new_data_name] if hasattr(new_data_struct, "register_listener"): new_data_struct.register_listener(self.datastructures_listener) self.displayed_data=[new_data_name, new_data_struct] dirpart=new_data_name.rfind("/") if dirpart>=0: self.display_source_path_label.set_label(u"in "+new_data_name[:dirpart]) else: self.display_source_path_label.set_label(u"") self.clear_display() # renew display via idle event self.update_counter_lock.acquire() self.update_counter+=1 self.update_counter_lock.release() event=DataPool.Event(DataPool.Event.updated_value, new_data_name) gobject.idle_add(self.datapool_idle_listener,event,priority=gobject.PRIORITY_DEFAULT_IDLE) | 85cb9b4d7b72c3f6f26aa81a84e23575d4d02d97 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2646/85cb9b4d7b72c3f6f26aa81a84e23575d4d02d97/DamarisGUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
3168,
67,
6703,
67,
2575,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
225,
394,
67,
892,
67,
529,
273,
365,
18,
3168,
67,
1098,
67,
2972,
1435,
309,
261,
2890,
18,
5417,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
3168,
67,
6703,
67,
2575,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
225,
394,
67,
892,
67,
529,
273,
365,
18,
3168,
67,
1098,
67,
2972,
1435,
309,
261,
2890,
18,
5417,
... |
print 1 | def parsetext(text): """ parsetext(text) -> dict() Tokenizes a body of text and returns a dictionary containing a set of features located within the text. 'start': the byte offset of '<s>' tags found in the text. 'end': the byte offset of '</s>' tags found in the text. 'email': the byte offset and text of emails found in the text. 'date': the byte offset and text of date like strings found. 'time': the byte offset and text of time like strings found. 'year': the byte offset and text of year like strings found. 'float': the byte offset and text of floating point numbers found. 'copyright':the byte offset and text of copyright strings and symbols. includes 'opyright', '(c)', and the copyright characters. 'tokens': the byte offset and text of white space split tokens. this also includes the characters located between alphanumeric characters. """ stuff = {} print 0 text = RE_ANDOR.sub('and or',text) (temp, text) = findall_erase(RE_COMMENT, text) print 1 (stuff['start'], text) = findall_erase(RE_START, text) print 2 (stuff['end'], text) = findall_erase(RE_END, text) print 3 (stuff['email'], text) = findall_erase(RE_EMAIL, text) print 4 (stuff['url'], text) = findall_erase(RE_URL, text) # (stuff['path'], text) = findall_erase(RE_PATH, text) print 5 #(stuff['date'], text) = findall_erase(RE_DATE, text) print 6 #(stuff['time'], text) = findall_erase(RE_TIME, text) print 7 (stuff['year'], text) = findall_erase(RE_YEAR, text) print 8 (stuff['float'], text) = findall_erase(RE_FLOAT, text) print 9 (stuff['copyright'], text) = findall_erase(RE_COPYRIGHT, text) print 10 (stuff['tokens'], text) = findall_erase(RE_TOKEN, text) print 11 # we replace the original information extracted from the text with place # holders so we can learn a generic trend in the structure of the # documents. stuff['tokens'].extend([['XXXstartXXX', stuff['start'][i][1], stuff['start'][i][2]] for i in range(len(stuff['start']))]) stuff['tokens'].extend([['XXXendXXX', stuff['end'][i][1], stuff['end'][i][2]] for i in range(len(stuff['end']))]) stuff['tokens'].extend([['XXXemailXXX', stuff['email'][i][1], stuff['email'][i][2]] for i in range(len(stuff['email']))]) stuff['tokens'].extend([['XXXurlXXX', stuff['url'][i][1], stuff['url'][i][2]] for i in range(len(stuff['url']))]) # stuff['tokens'].extend([['XXXpathXXX', stuff['path'][i][1], stuff['path'][i][2]] for i in range(len(stuff['path']))]) # stuff['tokens'].extend([['XXXdateXXX', stuff['date'][i][1], stuff['date'][i][2]] for i in range(len(stuff['date']))]) # stuff['tokens'].extend([['XXXtimeXXX', stuff['time'][i][1], stuff['time'][i][2]] for i in range(len(stuff['time']))]) stuff['tokens'].extend([['XXXyearXXX', stuff['year'][i][1], stuff['year'][i][2]] for i in range(len(stuff['year']))]) stuff['tokens'].extend([['XXXfloatXXX', stuff['float'][i][1], stuff['float'][i][2]] for i in range(len(stuff['float']))]) stuff['tokens'].extend([['XXXcopyrightXXX', stuff['copyright'][i][1], stuff['copyright'][i][2]] for i in range(len(stuff['copyright']))]) stuff['tokens'].sort(token_sort) return stuff | c9bff2a47221cbe589c7c2da84104eab2fe9431c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6959/c9bff2a47221cbe589c7c2da84104eab2fe9431c/copyright_library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
779,
542,
408,
12,
955,
4672,
3536,
779,
542,
408,
12,
955,
13,
317,
2065,
1435,
225,
3155,
3128,
279,
1417,
434,
977,
471,
1135,
279,
3880,
4191,
279,
444,
434,
4467,
13801,
3470,
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,
779,
542,
408,
12,
955,
4672,
3536,
779,
542,
408,
12,
955,
13,
317,
2065,
1435,
225,
3155,
3128,
279,
1417,
434,
977,
471,
1135,
279,
3880,
4191,
279,
444,
434,
4467,
13801,
3470,
326... | |
self.done.remove(page) | if page in self.done: self.done.remove(page) | def workDone(self, counter): """ This is called by a worker to tell us that the promised work was completed as far as possible. The only argument is an instance of a counter class, that has methods minus() and plus() to keep counts of the total work todo. """ # Loop over all the pages that should have been taken care of for page in self.pending: # Mark the page as done self.done.append(page) | 10ff301375f1bd347d43a0e412ebd05500fd052a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/10ff301375f1bd347d43a0e412ebd05500fd052a/interwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1440,
7387,
12,
2890,
16,
3895,
4672,
3536,
1220,
353,
2566,
635,
279,
4322,
358,
9276,
584,
716,
326,
3012,
5918,
1440,
1703,
5951,
487,
10247,
487,
3323,
18,
1021,
1338,
1237,
353,
392... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1440,
7387,
12,
2890,
16,
3895,
4672,
3536,
1220,
353,
2566,
635,
279,
4322,
358,
9276,
584,
716,
326,
3012,
5918,
1440,
1703,
5951,
487,
10247,
487,
3323,
18,
1021,
1338,
1237,
353,
392... |
def editwindow_response(self, window, response, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): | self.updating_edit_entries = False for i in range(len(entries)-1): if tag_changed[self.filetagnum][entries_names[i]]: self.edit_entry_changed(entries[i]) else: self.edit_entry_revert_color(entries[i], entries[len(entries)-1]) def editwindow_response(self, window, response, filetags, mpdpaths, savebutton, tag_changed, entries, entries_names): | def editwindow_update(self, window, filetags, titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, mpdpaths, fileentry, savebutton): titleentry.set_text(filetags[self.filetagnum].tag().title) titleentry.select_region(0, len(titleentry.get_text())) artistentry.set_text(filetags[self.filetagnum].tag().artist) albumentry.set_text(filetags[self.filetagnum].tag().album) if filetags[self.filetagnum].tag().year != 0: yearentry.set_text(str(filetags[self.filetagnum].tag().year)) if filetags[self.filetagnum].tag().track != 0: trackentry.set_text(str(filetags[self.filetagnum].tag().track)) genreentry.set_text(filetags[self.filetagnum].tag().genre) commententry.set_text(filetags[self.filetagnum].tag().comment) fileentry.set_text(mpdpaths[self.filetagnum].split('/')[-1]) window.set_title(_("Edit Tags" + " - " + str(self.filetagnum+1) + " " + _("of") + " " + str(len(filetags)))) titleentry.grab_focus() gobject.idle_add(savebutton.set_sensitive, True) | 8e7f75d3649afea0782df60c0cbc0b9c2fb7cc04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/8e7f75d3649afea0782df60c0cbc0b9c2fb7cc04/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
5668,
67,
2725,
12,
2890,
16,
2742,
16,
661,
278,
1341,
16,
2077,
4099,
16,
15469,
4099,
16,
14844,
4099,
16,
677,
73,
7892,
698,
16,
3298,
4099,
16,
3157,
2842,
698,
16,
2879,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
5668,
67,
2725,
12,
2890,
16,
2742,
16,
661,
278,
1341,
16,
2077,
4099,
16,
15469,
4099,
16,
14844,
4099,
16,
677,
73,
7892,
698,
16,
3298,
4099,
16,
3157,
2842,
698,
16,
2879,
... |
numberOfNodes=len(net._nodes) | numberOfNodes=len(net) | def mst_kruskal(net,randomize=True,maximum=False): """Find a minimum/maximum spanning tree using Kruskal's algorithm If random is set to true and the mst is not unique, a random mst is chosen. >>> t=pynet.SymmNet() >>> t[1,2]=1 >>> t[2,3]=2 >>> t[3,1]=3 >>> m=mst_kruskal(t) >>> print m.edges [[1, 2, 1], [2, 3, 2]] """ edges=list(net.edges) if randomize: random.shuffle(edges) #the sort has been stable since python version 2.3 edges.sort(lambda x,y:cmp(x[2],y[2]),reverse=maximum) mst=pynet.SymmNet() numberOfNodes=len(net._nodes) #ktree=percolator.Ktree(numberOfNodes) ktree=percolator.Ktree() #just use dict addedEdges=0 for edge in edges: if ktree.getParent(edge[0])!=ktree.getParent(edge[1]): mst[edge[0],edge[1]]=edge[2] ktree.setParent(edge[0],edge[1]) addedEdges+=1 if addedEdges==numberOfNodes-1: #the mst is a tree return mst #the mst is a forest netext.copyNodeProperties(net,mst) return mst | 22b5baa8ba2d784e6389be4cccba69bbf005ce85 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/768/22b5baa8ba2d784e6389be4cccba69bbf005ce85/transforms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
334,
67,
79,
8010,
79,
287,
12,
2758,
16,
9188,
554,
33,
5510,
16,
15724,
33,
8381,
4672,
3536,
3125,
279,
5224,
19,
15724,
1694,
10903,
2151,
1450,
1475,
8010,
79,
287,
1807,
488... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
334,
67,
79,
8010,
79,
287,
12,
2758,
16,
9188,
554,
33,
5510,
16,
15724,
33,
8381,
4672,
3536,
3125,
279,
5224,
19,
15724,
1694,
10903,
2151,
1450,
1475,
8010,
79,
287,
1807,
488... |
for line in self.browse(cr, uid, ids, context): result[line.id] = line.amount / line.amount_unit.factor | tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id if tm and tm.factor: div = tm.factor else: div = 1.0 for line in self.browse(cr, uid, ids, context): result[line.id] = line.amount / line.amount_unit.factor * div | def _amount_base_uom(self, cr, uid, ids, name, args, context): result = {} for line in self.browse(cr, uid, ids, context): result[line.id] = line.amount / line.amount_unit.factor return result | ae7597596cba3342d97dcae8ae9e8fa1990f86bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/ae7597596cba3342d97dcae8ae9e8fa1990f86bd/report_analytic_planning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8949,
67,
1969,
67,
89,
362,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
4672,
563,
273,
2618,
6118,
273,
365,
18,
6011,
18,
588,
2668,
455,
18,
5577,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8949,
67,
1969,
67,
89,
362,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
4672,
563,
273,
2618,
6118,
273,
365,
18,
6011,
18,
588,
2668,
455,
18,
5577,
1... |
h = {} | h = [] | def warn(msg): self.ui.warn(_("%s, line %s: %s\n") % (fn, count, msg)) | ad764463845d829f6853631904d2d7ea878fc7f4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/ad764463845d829f6853631904d2d7ea878fc7f4/localrepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
12,
3576,
4672,
365,
18,
4881,
18,
8935,
24899,
27188,
87,
16,
980,
738,
87,
30,
738,
87,
64,
82,
7923,
738,
261,
4293,
16,
1056,
16,
1234,
3719,
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,
1894,
12,
3576,
4672,
365,
18,
4881,
18,
8935,
24899,
27188,
87,
16,
980,
738,
87,
30,
738,
87,
64,
82,
7923,
738,
261,
4293,
16,
1056,
16,
1234,
3719,
2,
-100,
-100,
-100,
-100,
-10... |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)[0] for line in (p.stdout, p.stdin): | stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for line in p.stdout: | def commit(self, db): self.file.close() try: os.unlink(self.name+".cab") except OSError: pass for k, v in [(r"Software\Microsoft\VisualStudio\7.1\Setup\VS", "VS7CommonBinDir"), (r"Software\Microsoft\Win32SDK\Directories", "Install Dir")]: try: key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k) except WindowsError: continue cabarc = os.path.join(_winreg.QueryValueEx(key, v)[0], r"Bin", "cabarc.exe") _winreg.CloseKey(key) if not os.path.exists(cabarc):continue break else: print "WARNING: cabarc.exe not found in registry" cabarc = "cabarc.exe" cmd = r'"%s" -m lzx:21 n %s.cab @%s.txt' % (cabarc, self.name, self.name) p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)[0] for line in (p.stdout, p.stdin): if line.startswith(" -- adding "): sys.stdout.write(".") else: sys.stdout.write(line) sys.stdout.flush() if not os.path.exists(self.name+".cab"): raise IOError, "cabarc failed" add_data(db, "Media", [(1, self.index, None, "#"+self.name, None, None)]) add_stream(db, self.name, self.name+".cab") os.unlink(self.name+".txt") os.unlink(self.name+".cab") db.Commit() | ae8a7673374c126c5208591e66df10f3c8536d32 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/ae8a7673374c126c5208591e66df10f3c8536d32/msilib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
12,
2890,
16,
1319,
4672,
365,
18,
768,
18,
4412,
1435,
775,
30,
1140,
18,
318,
1232,
12,
2890,
18,
529,
9078,
18,
71,
378,
7923,
1335,
10002,
30,
1342,
364,
417,
16,
331,
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,
3294,
12,
2890,
16,
1319,
4672,
365,
18,
768,
18,
4412,
1435,
775,
30,
1140,
18,
318,
1232,
12,
2890,
18,
529,
9078,
18,
71,
378,
7923,
1335,
10002,
30,
1342,
364,
417,
16,
331,
316,... |
r"""(?P<begintt>\{\{\{)""", r"""(?P<endtt>\}\}\})""", | r"""(?P<inlinecode>\{\{\{(?P<inline>.*)\}\}\})""", | def populate_page_dict(db): """Extract wiki page names. This is used to detect broken wiki-links""" global page_dict page_dict = {'TitleIndex': 1} cursor = db.cursor() cursor.execute('SELECT DISTINCT name FROM wiki') while 1: row = cursor.fetchone() if not row: break page_dict[row[0]] = 1 | 79f037dc1a45ad31c8543afffec2cc8ebcd5c637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/79f037dc1a45ad31c8543afffec2cc8ebcd5c637/Wiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
2433,
67,
1576,
12,
1966,
4672,
3536,
4976,
9050,
1363,
1257,
18,
1220,
353,
1399,
358,
5966,
12933,
9050,
17,
7135,
8395,
2552,
1363,
67,
1576,
1363,
67,
1576,
273,
13666,
424... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
2433,
67,
1576,
12,
1966,
4672,
3536,
4976,
9050,
1363,
1257,
18,
1220,
353,
1399,
358,
5966,
12933,
9050,
17,
7135,
8395,
2552,
1363,
67,
1576,
1363,
67,
1576,
273,
13666,
424... |
trace=[]): | trace=[], errcompletion=None): | def _executeAndFetchLastRowID(self, stmt, args, completion, priority=None, trace=[]): if priority == None: priority = self._priority trace = extractTraceStack(trace) self._dbThread.executeAndFetchLastRowID(stmt, args, self._completionEvent( completion), priority, trace=trace) | 4c36469fd45745f1611941d2eb0ffe07ddc38123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8545/4c36469fd45745f1611941d2eb0ffe07ddc38123/Database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
1876,
5005,
3024,
1999,
734,
12,
2890,
16,
3480,
16,
833,
16,
8364,
16,
4394,
33,
7036,
16,
2606,
22850,
6487,
393,
11469,
33,
7036,
4672,
309,
4394,
422,
599,
30,
4394,
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,
389,
8837,
1876,
5005,
3024,
1999,
734,
12,
2890,
16,
3480,
16,
833,
16,
8364,
16,
4394,
33,
7036,
16,
2606,
22850,
6487,
393,
11469,
33,
7036,
4672,
309,
4394,
422,
599,
30,
4394,
273... |
<br><br>For more information, please go to the <a href="%s/admin/bibrank/guide.html">BibRank guide</a> and read the section regarding deleting a rank method.</dd> | <br><br>For more information, please go to the <a title="See guide" href="%s/admin/bibrank/guide.html">BibRank guide</a> and read the section regarding deleting a rank method.</dd> | def perform_deleterank(rnkID, ln=cdslang, confirm=0): """form to delete a rank method """ subtitle ='' output = """ <span class="warning"> <strong> <dl> <dt>WARNING:</dt> <dd>When deleting a rank method, you also deletes all data related to the rank method, like translations, which collections it was attached to and the data necessary to rank the searchresults. Any scheduled tasks using the deleted rank method will also stop working. <br><br>For more information, please go to the <a href="%s/admin/bibrank/guide.html">BibRank guide</a> and read the section regarding deleting a rank method.</dd> </dl> </strong> </span> """ % weburl if rnkID: if confirm in ["0", 0]: rnkNAME = get_current_name(rnkID, ln, get_rnk_nametypes()[0][0], "rnkMETHOD")[0][1] subtitle = 'Step 1 - Confirm deletion' text = """Delete rank method '%s'.""" % (rnkNAME) output += createhiddenform(action="deleterank", text=text, rnkID=rnkID, confirm=1) elif confirm in ["1", 1]: try: rnkNAME = get_current_name(rnkID, ln, get_rnk_nametypes()[0][0], "rnkMETHOD")[0][1] rnkcode = get_rnk_code(rnkID)[0][0] result = delete_rnk(rnkID) subtitle = "Step 2 - Result" if result: text = """<b><span class="info">Rank method '%s' deleted</span></b>""" % rnkNAME try: os.remove("%s/bibrank/%s.cfg" % (etcdir, rnkcode)) text += """<br><b><span class="info">Configuration file deleted: '%s/bibrank/%s.cfg'.</span></b>""" % (etcdir, rnkcode) except StandardError, e: text += """<br><b><span class="info">Sorry, could not delete configuration file: '%s/bibrank/%s.cfg'.</span><br>Please delete the file manually.</span></b>""" % (etcdir, rnkcode) else: text = """<b><span class="info">Sorry, could not delete rank method '%s'</span></b>""" % rnkNAME except StandardError, e: text = """<b><span class="info">Sorry, could not delete rank method, most likely already deleted</span></b>""" output = text try: body = [output, extra] except NameError: body = [output] return addadminbox(subtitle + """   <small>[<a href="%s/admin/bibrank/guide.html#dr">?</a>]</small>""" % weburl, body) | a6a2a3f836d914026219bf3610ec841b23ae03ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/a6a2a3f836d914026219bf3610ec841b23ae03ce/bibrankadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
19003,
264,
2304,
12,
27639,
79,
734,
16,
7211,
33,
4315,
2069,
539,
16,
6932,
33,
20,
4672,
3536,
687,
358,
1430,
279,
6171,
707,
3536,
20281,
273,
6309,
876,
225,
273,
3536... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
19003,
264,
2304,
12,
27639,
79,
734,
16,
7211,
33,
4315,
2069,
539,
16,
6932,
33,
20,
4672,
3536,
687,
358,
1430,
279,
6171,
707,
3536,
20281,
273,
6309,
876,
225,
273,
3536... |
return True return '.'.join(tokens[1:]) return name | raise StopIteration('Match found') return (long, '.'.join(tokens[1:])) return (long, long) | def _filter_suite_name(self, name): tokens = name.split('.') if utils.matches(self.name, tokens[0], ignore=['_']): if len(tokens) == 1: return True # match return '.'.join(tokens[1:]) return name | ec4e173743785708e87eff7e6a2e244a52e0b07b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/ec4e173743785708e87eff7e6a2e244a52e0b07b/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
67,
30676,
67,
529,
12,
2890,
16,
508,
4672,
2430,
273,
508,
18,
4939,
2668,
1093,
13,
309,
2990,
18,
8436,
12,
2890,
18,
529,
16,
2430,
63,
20,
6487,
2305,
33,
3292,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
67,
30676,
67,
529,
12,
2890,
16,
508,
4672,
2430,
273,
508,
18,
4939,
2668,
1093,
13,
309,
2990,
18,
8436,
12,
2890,
18,
529,
16,
2430,
63,
20,
6487,
2305,
33,
3292,
67,
... |
timeout=360000) | timeout=360 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND) | def onStateChange(self, web_progress, request, state_flags, status): if state_flags == interfaces.nsIWebProgressListener.STATE_START: self._create_journal_object() self._create_clipboard_object() elif state_flags == interfaces.nsIWebProgressListener.STATE_STOP: if NS_FAILED(status): # download cancelled return | ef7e4fc70eb5cf2b9240b0fc6ad68a7d3298b441 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6905/ef7e4fc70eb5cf2b9240b0fc6ad68a7d3298b441/downloadmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
22505,
12,
2890,
16,
3311,
67,
8298,
16,
590,
16,
919,
67,
7133,
16,
1267,
4672,
309,
919,
67,
7133,
422,
7349,
18,
2387,
45,
4079,
5491,
2223,
18,
7998,
67,
7570,
30,
365,
6315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
22505,
12,
2890,
16,
3311,
67,
8298,
16,
590,
16,
919,
67,
7133,
16,
1267,
4672,
309,
919,
67,
7133,
422,
7349,
18,
2387,
45,
4079,
5491,
2223,
18,
7998,
67,
7570,
30,
365,
6315... |
def fl_get_object_bbox(obj, x, y, w, h): """ fl_get_object_bbox(obj, x, y, w, h) """ _fl_get_object_bbox(obj, x, y, w, h) | def fl_get_object_bbox(pObject, x, y, w, h): """ fl_get_object_bbox(pObject, x, y, w, h) """ _fl_get_object_bbox(pObject, x, y, w, h) | def fl_get_object_bbox(obj, x, y, w, h): """ fl_get_object_bbox(obj, x, y, w, h) """ _fl_get_object_bbox(obj, x, y, w, h) | 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,
1612,
67,
20737,
12,
84,
921,
16,
619,
16,
677,
16,
341,
16,
366,
4672,
3536,
1183,
67,
588,
67,
1612,
67,
20737,
12,
84,
921,
16,
619,
16,
677,
16,
341,
16,
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,
1183,
67,
588,
67,
1612,
67,
20737,
12,
84,
921,
16,
619,
16,
677,
16,
341,
16,
366,
4672,
3536,
1183,
67,
588,
67,
1612,
67,
20737,
12,
84,
921,
16,
619,
16,
677,
16,
341,
16,
3... |
return (beta, coeffs, coeff_names, basis, m, _treshold) | return (beta, coeffs, coeff_names, basis, m, _treshold, flip) | def __call__(self,classifier,examples, buckets): if classifier.model['kernel_type'] != 0: raise "Use SVM with a linear kernel." if classifier.model["svm_type"] != 0: raise "Use ordinary SVM classification." if classifier.model["nr_class"] != 2: raise "This is not SVM with a binary class." | e79ace60fc6ec671079d5cf322daa70694026a6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/e79ace60fc6ec671079d5cf322daa70694026a6f/orngLinVis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1106,
1251,
16,
16858,
16,
9169,
4672,
309,
14622,
18,
2284,
3292,
8111,
67,
723,
3546,
480,
374,
30,
1002,
315,
3727,
348,
7397,
598,
279,
9103,
5536,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1991,
972,
12,
2890,
16,
1106,
1251,
16,
16858,
16,
9169,
4672,
309,
14622,
18,
2284,
3292,
8111,
67,
723,
3546,
480,
374,
30,
1002,
315,
3727,
348,
7397,
598,
279,
9103,
5536,
1... |
Manufacturer=u"Martin v. L\xf6wis") | Manufacturer=u"Python Software Foundation") | def build_database(): """Generate an empty database, with just the schema and the Summary information stream.""" if snapshot: uc = upgrade_code_snapshot else: uc = upgrade_code # schema represents the installer 2.0 database schema. # sequence is the set of standard sequences # (ui/execute, admin/advt/install) db = msilib.init_database("python-%s%s.msi" % (full_current_version, msilib.arch_ext), schema, ProductName="Python "+full_current_version, ProductCode=product_code, ProductVersion=current_version, Manufacturer=u"Martin v. L\xf6wis") # The default sequencing of the RemoveExistingProducts action causes # removal of files that got just installed. Place it after # InstallInitialize, so we first uninstall everything, but still roll # back in case the installation is interrupted msilib.change_sequence(sequence.InstallExecuteSequence, "RemoveExistingProducts", 1510) msilib.add_tables(db, sequence) # We cannot set ALLUSERS in the property table, as this cannot be # reset if the user choses a per-user installation. Instead, we # maintain WhichUsers, which can be "ALL" or "JUSTME". The UI manages # this property, and when the execution starts, ALLUSERS is set # accordingly. add_data(db, "Property", [("UpgradeCode", uc), ("WhichUsers", "ALL"), ("ProductLine", "Python%s%s" % (major, minor)), ]) db.Commit() return db | 88eddbbe1a4742234a9de6f1905d787539f29860 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/88eddbbe1a4742234a9de6f1905d787539f29860/msi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6231,
13332,
3536,
4625,
392,
1008,
2063,
16,
598,
2537,
326,
1963,
471,
326,
17967,
1779,
1407,
12123,
309,
4439,
30,
6232,
273,
8400,
67,
710,
67,
11171,
469,
30,
6232,
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,
1361,
67,
6231,
13332,
3536,
4625,
392,
1008,
2063,
16,
598,
2537,
326,
1963,
471,
326,
17967,
1779,
1407,
12123,
309,
4439,
30,
6232,
273,
8400,
67,
710,
67,
11171,
469,
30,
6232,
273,
... |
sec.setVoltageMode(0) sec.setToneMode(0) | sec.setVoltageMode(switchParam.HV) sec.setToneMode(switchParam.HILO) | def addLNBSimple(self, slotid, diseqcmode, toneburstmode = 0, diseqcpos = 0, orbpos = 0, longitude = 0, latitude = 0, loDirection = 0, laDirection = 0): #simple defaults sec = eDVBSatelliteEquipmentControl.getInstance() sec.addLNB() sec.setLNBTunerMask(1 << slotid) sec.setLNBLOFL(9750000) sec.setLNBLOFH(10600000) sec.setLNBThreshold(11750000) sec.setRepeats(0) sec.setFastDiSEqC(0) sec.setSeqRepeat(0) sec.setVoltageMode(0) #HV sec.setToneMode(0) #HILO sec.setCommandOrder(0) #user values sec.setDiSEqCMode(diseqcmode) sec.setToneburst(toneburstmode) sec.setCommittedCommand(diseqcpos) #print "set orbpos to:" + str(orbpos) | 45b15800295dbe7e8aa64c7c97e62ed7a9f0a137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/45b15800295dbe7e8aa64c7c97e62ed7a9f0a137/NimManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
48,
20626,
5784,
12,
2890,
16,
4694,
350,
16,
302,
784,
30675,
3188,
16,
30600,
70,
18593,
3188,
273,
374,
16,
302,
784,
30675,
917,
273,
374,
16,
16823,
917,
273,
374,
16,
9192,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
48,
20626,
5784,
12,
2890,
16,
4694,
350,
16,
302,
784,
30675,
3188,
16,
30600,
70,
18593,
3188,
273,
374,
16,
302,
784,
30675,
917,
273,
374,
16,
16823,
917,
273,
374,
16,
9192,
... |
if (type(i) is tuple) and (len(i) == 2): | if (type(i) is tuple) and (len(i) == 2) and type(i[0]) is int and type(i[1]) is int: | def __iter__(self): for i in self.set: if (type(i) is tuple) and (len(i) == 2): if (i[0] <= i[1]): j=i[0] while j <= i[1]: yield j j += 1 elif isinstance(i, Gen): for j in i: yield j else: yield i | 2e6cda571e501c15a11465b73809a085df6e617f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/2e6cda571e501c15a11465b73809a085df6e617f/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
364,
277,
316,
365,
18,
542,
30,
309,
261,
723,
12,
77,
13,
353,
3193,
13,
471,
261,
1897,
12,
77,
13,
422,
576,
13,
471,
618,
12,
77,
63,
20,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
364,
277,
316,
365,
18,
542,
30,
309,
261,
723,
12,
77,
13,
353,
3193,
13,
471,
261,
1897,
12,
77,
13,
422,
576,
13,
471,
618,
12,
77,
63,
20,
57... |
if (not os.path.samefile(build_path, os.getcwd())): | if (not op.samefile(build_path, os.getcwd())): | def cold_start(args): cwd_was_empty_at_start = True for file_name in os.listdir("."): if (not file_name.startswith(".")): cwd_was_empty_at_start = False break default_repositories = [] r = os.path.dirname(os.path.dirname(args[0])) b = os.path.basename(r) if (b.lower().startswith("cctbx_project")): default_repositories.append(os.path.dirname(r)) default_repositories.append(r) pre_processed_args = pre_process_args( args=args[1:], default_repositories=default_repositories) build_path=pre_processed_args.command_line.options.current_working_directory if (build_path is None): build_path = os.getcwd() else: if (not os.path.isabs(build_path)): raise Sorry("Not an absolute path name:" " --current_working_directory %s" % show_string(build_path)) if (not os.path.isdir(build_path)): raise Sorry("Not a directory:" " --current_working_directory %s" % show_string(build_path)) if (not os.path.samefile(build_path, os.getcwd())): raise Sorry("Not equivalent to the current working directory:" " --current_working_directory %s" % show_string(build_path)) n = len(os.sep) while (len(build_path) > n and build_path.endswith(os.sep)): build_path = build_path[:-n] set_preferred_sys_prefix_and_sys_executable(build_path=build_path) env = environment(build_path=build_path) env.process_args(pre_processed_args=pre_processed_args) if ( pre_processed_args.command_line.options.clear_scons_memory or cwd_was_empty_at_start): env.clear_scons_memory() env.refresh() | 621ff93ea6f104ac4c6d943d7e9d6c18b1468502 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/621ff93ea6f104ac4c6d943d7e9d6c18b1468502/env_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
645,
72,
67,
1937,
12,
1968,
4672,
7239,
67,
17416,
67,
5531,
67,
270,
67,
1937,
273,
1053,
364,
585,
67,
529,
316,
1140,
18,
1098,
1214,
2932,
1199,
4672,
309,
261,
902,
585,
67,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
645,
72,
67,
1937,
12,
1968,
4672,
7239,
67,
17416,
67,
5531,
67,
270,
67,
1937,
273,
1053,
364,
585,
67,
529,
316,
1140,
18,
1098,
1214,
2932,
1199,
4672,
309,
261,
902,
585,
67,
52... |
col=10; line=375; BGL.glRasterPos2i(col, line); Draw.Text("For exporting bump and normal maps, have the second texture slot (slot 1) name begin with bump or normal") col=10; line=350; BGL.glRasterPos2i(col, line); Draw.Text("Uber: shader name should start with 'sfube' - imports Blender's Col and Spe RGB values") col=10; line=325; BGL.glRasterPos2i(col, line); Draw.Text("\t\tIF Texture Slot 0: diffuse texture(Mapto Col value), else Col RGB values") col=10; line=300; BGL.glRasterPos2i(col, line); Draw.Text("\t\tIF Texture Slot 2: specular texture(Mapto Var value), else Spe RGB values") col=10; line=275; BGL.glRasterPos2i(col, line); Draw.Text("Regarding Textures: Diffuse, shiny, ambocc, phong, and ward materials will use textures as the diffuse channel if the texture is in the first texture slot.") col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Diffuse: shader name should start with 'sfdif' - imports Blender's Col RGB values") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("Shiny: shader name sould start with 'sfshi' - imports Blender's Col RGB and RayMirr values") col=10; line=200; BGL.glRasterPos2i(col, line); Draw.Text("Ambient Occlusion: shader name sould start with 'sfamb' - imports Blender's Col RGB (Bright) and Spe RGB (Dark) values") col=10; line=175; BGL.glRasterPos2i(col, line); Draw.Text("Phong: shader name sould start with 'sfpho' - imports Blender's Col RGB and Spe RGB values") col=10; line=150; BGL.glRasterPos2i(col, line); Draw.Text("Ward: shader name sould start with 'sfwar' - imports Blender's Col RGB and Spe RGB values") col=10; line=125; BGL.glRasterPos2i(col, line); Draw.Text("Mirror: shader name sould start with 'sfmir' - imports Blender's Col RGB values, Ray Mir button must be on") col=10; line=100; BGL.glRasterPos2i(col, line); Draw.Text("Glass: shader name sould start with 'sfgla' - imports Blender's Col RGB and IOR values, Ray Transp button must be on") col=10; line=75; BGL.glRasterPos2i(col, line); Draw.Text("Constant: shader name should start with 'sfcon' - imports Blender's Col RGB values") | col=10; line=375; BGL.glRasterPos2i(col, line); Draw.Text("For exporting bump and normal maps, have the second texture slot (slot 1)") col=10; line=350; BGL.glRasterPos2i(col, line); Draw.Text("name begin with bump or normal") col=10; line=325; BGL.glRasterPos2i(col, line); Draw.Text("Regarding Textures: Diffuse, shiny, ambocc, phong, and ward materials will") col=10; line=300; BGL.glRasterPos2i(col, line); Draw.Text("use textures as the diffuse channel if the texture is in the first texture slot.") col=10; line=275; SHADTYPE=Draw.Menu("%tSelect shader|Uber|Diffuse|Shiny|AO|Phong|Ward|Mirror|Glass|Constant", SHADER_TYPE, col, line, 85, 18, SHADTYPE.val) col=100; SHADOK=Draw.Button("OK", SHAD_OK, col, line, 30, 18, "Print on screen instructions") if SHADTYPE == 1: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Uber: shader name should start with 'sfube' - imports Blender's Col and Spe RGB") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("values") col=10; line=200; BGL.glRasterPos2i(col, line); Draw.Text("\t\tIF Texture Slot 0: diffuse texture(Mapto Col value), else Col RGB values") col=10; line=175; BGL.glRasterPos2i(col, line); Draw.Text("\t\tIF Texture Slot 2: specular texture(Mapto Var value), else Spe RGB values") if SHADTYPE == 2: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Diffuse: shader name should start with 'sfdif' - imports Blender's Col RGB values") if SHADTYPE == 3: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Shiny: shader name sould start with 'sfshi' - imports Blender's Col RGB and") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("RayMirr values") if SHADTYPE == 4: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Ambient Occlusion: shader name sould start with 'sfamb' - imports Blender's") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("Col RGB (Bright) and Spe RGB (Dark) values") if SHADTYPE == 5: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Phong: shader name sould start with 'sfpho' - imports Blender's Col RGB and") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("Spe RGB values") if SHADTYPE == 6: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Ward: shader name sould start with 'sfwar' - imports Blender's Col RGB and") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("Spe RGB values") if SHADTYPE == 7: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Mirror: shader name sould start with 'sfmir' - imports Blender's Col RGB values,") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("Ray Mir button must be on") if SHADTYPE == 8: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Glass: shader name sould start with 'sfgla' - imports Blender's Col RGB and") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("IOR values, Ray Transp button must be on") if SHADTYPE == 9: col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Constant: shader name should start with 'sfcon' - imports Blender's Col RGB values") | def drawShad(): col=10; line=400; BGL.glRasterPos2i(col, line); Draw.Text("Specific instructions for exporting shaders:") col=10; line=375; BGL.glRasterPos2i(col, line); Draw.Text("For exporting bump and normal maps, have the second texture slot (slot 1) name begin with bump or normal") col=10; line=350; BGL.glRasterPos2i(col, line); Draw.Text("Uber: shader name should start with 'sfube' - imports Blender's Col and Spe RGB values") col=10; line=325; BGL.glRasterPos2i(col, line); Draw.Text("\t\tIF Texture Slot 0: diffuse texture(Mapto Col value), else Col RGB values") col=10; line=300; BGL.glRasterPos2i(col, line); Draw.Text("\t\tIF Texture Slot 2: specular texture(Mapto Var value), else Spe RGB values") col=10; line=275; BGL.glRasterPos2i(col, line); Draw.Text("Regarding Textures: Diffuse, shiny, ambocc, phong, and ward materials will use textures as the diffuse channel if the texture is in the first texture slot.") col=10; line=250; BGL.glRasterPos2i(col, line); Draw.Text("Diffuse: shader name should start with 'sfdif' - imports Blender's Col RGB values") col=10; line=225; BGL.glRasterPos2i(col, line); Draw.Text("Shiny: shader name sould start with 'sfshi' - imports Blender's Col RGB and RayMirr values") col=10; line=200; BGL.glRasterPos2i(col, line); Draw.Text("Ambient Occlusion: shader name sould start with 'sfamb' - imports Blender's Col RGB (Bright) and Spe RGB (Dark) values") col=10; line=175; BGL.glRasterPos2i(col, line); Draw.Text("Phong: shader name sould start with 'sfpho' - imports Blender's Col RGB and Spe RGB values") col=10; line=150; BGL.glRasterPos2i(col, line); Draw.Text("Ward: shader name sould start with 'sfwar' - imports Blender's Col RGB and Spe RGB values") col=10; line=125; BGL.glRasterPos2i(col, line); Draw.Text("Mirror: shader name sould start with 'sfmir' - imports Blender's Col RGB values, Ray Mir button must be on") col=10; line=100; BGL.glRasterPos2i(col, line); Draw.Text("Glass: shader name sould start with 'sfgla' - imports Blender's Col RGB and IOR values, Ray Transp button must be on") col=10; line=75; BGL.glRasterPos2i(col, line); Draw.Text("Constant: shader name should start with 'sfcon' - imports Blender's Col RGB values") drawButtons() | ff0c0525f9c6de0fb4c2616a2bdc03109465145c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12400/ff0c0525f9c6de0fb4c2616a2bdc03109465145c/sunflow_export.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1555,
361,
13332,
645,
33,
2163,
31,
980,
33,
16010,
31,
605,
11261,
18,
7043,
18637,
1616,
22,
77,
12,
1293,
16,
980,
1769,
10184,
18,
1528,
2932,
9969,
12509,
364,
3359,
310,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1555,
361,
13332,
645,
33,
2163,
31,
980,
33,
16010,
31,
605,
11261,
18,
7043,
18637,
1616,
22,
77,
12,
1293,
16,
980,
1769,
10184,
18,
1528,
2932,
9969,
12509,
364,
3359,
310,
6... |
result = None | if condition.type != "not": result = None | def __if(node): thenPart = node.thenPart condition = node.condition elsePart = getattr(node, "elsePart", None) # Pre-checks for deeper optimization if thenPart and elsePart: thenContent = thenPart[0] if thenPart.type == "block" and len(thenPart) == 1 else thenPart elseContent = elsePart[0] if elsePart.type == "block" and len(elsePart) == 1 else elsePart # Our strategy for if-else is to use hooks/ternary operators to create # a more compact alternative to the classic if-else construction. # There is only a little limitation that hooks only works with expressions # and not typical statements. Semicolon statements are typically wrappers # around expression, so we directly filter them out here. if thenContent.type == "semicolon": thenContent = thenContent.expression if elseContent.type == "semicolon": elseContent = elseContent.expression # Merge equal types. This works very well for "return" and "assign" statements # and creates even more compact versions than the normal hook translation. if thenContent.type == elseContent.type: # Merge return statements if thenContent.type == "return": return addSemicolon("return %s?%s:%s" % (compress(condition), compress(thenContent.value), compress(elseContent.value))) elif thenContent.type == "assign": operator = assignOperator(thenContent) if operator == assignOperator(elseContent): firstTargetCode = compress(thenContent[0]) if firstTargetCode == compress(elseContent[0]): return addSemicolon("%s%s%s?%s:%s" % (firstTargetCode, operator, compress(condition), compress(thenContent[1]), compress(elseContent[1]))) # Reached the original idea to use hook statements instead of if-else constructs if thenContent.type != "comma" and thenContent.type in expressions and elseContent.type != "comma" and elseContent.type in expressions: return addSemicolon("%s?%s:%s" % (compress(condition), compress(thenContent), compress(elseContent))) else: # Check whether all children are semicolon statements. Their # expressions can be modified safely into the target statement. thenContent = thenPart[0] if thenPart.type == "block" and len(thenPart) == 1 else thenPart # Fast-path for empty block statements if thenContent.type == "block" and len(thenContent) == 0: return addSemicolon(compress(condition)) elif thenContent.type == "semicolon" and not hasattr(thenContent, "expression"): return addSemicolon(compress(condition)) # Pre-flight check to quickly analyse whether our children # are just simple expressions which can be used here. containsOnlyExpressions = True if thenContent.type == "block": for child in thenContent: if child.type != "semicolon": containsOnlyExpressions = False break elif thenContent.type != "semicolon": containsOnlyExpressions = False # If pre-flight check was OK, then continue with # optimized compression. if containsOnlyExpressions: if thenContent.type == "block": result = [] for child in thenContent: # Omit semicolon statements without an actual expression childExpression = getattr(child, "expression", None) if childExpression: result.append(compress(childExpression)) result = "(%s)" % ",".join(result) else: thenContent = thenContent.expression result = compress(thenContent) if thenContent else "" # We need to support the parser here in assing statements and we # need to keep the priority of expressions correctly so we sometimes # need to put the whole statement into parens - even at single # statement scenarios like here. if thenContent.type in ("comma", "assign", "bitwise_and", "bitwise_xor", "bitwise_or", "and", "or"): # result = "(%s)" % result # As this result in no benefit regarding compression size, we just keep # the default behavior so the original developer easier understand # the code because it is more familiar to the orignal one. result = None if result != None: if condition.type == "not": result = "%s||%s" % (compress(condition[0]), result) else: result = "%s&&%s" % (compress(condition), result) return addSemicolon(result) # The normal if-compression result = "if(%s)" % compress(condition) thenCode = compress(thenPart) if elsePart: # Special handling for cascaded if-else-if cases where the else might be # attached to the wrong if in cases where the braces are omitted. if len(thenPart) == 1 and containsIf(thenPart): thenCode = "{%s}" % removeSemicolon(thenCode) # Finally append code result += thenCode # Now process else part if elsePart: result += "else" elseCode = compress(elsePart) # Micro optimization: Don't need a space when the child is a block # At this time the brace could not be part of a map declaration (would be a syntax error) if not elseCode.startswith("{"): result += " " result += elseCode return result | 2417f4b2da17524d247c3b911811df9b81acd346 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/2417f4b2da17524d247c3b911811df9b81acd346/Compressor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
430,
12,
2159,
4672,
1508,
1988,
273,
756,
18,
15991,
1988,
2269,
273,
756,
18,
4175,
469,
1988,
273,
3869,
12,
2159,
16,
315,
12107,
1988,
3113,
599,
13,
225,
468,
2962,
17,
123... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
430,
12,
2159,
4672,
1508,
1988,
273,
756,
18,
15991,
1988,
2269,
273,
756,
18,
4175,
469,
1988,
273,
3869,
12,
2159,
16,
315,
12107,
1988,
3113,
599,
13,
225,
468,
2962,
17,
123... |
"""Assemble document parts and return as string""" head = '\n'.join(self.head_prefix + self.head) | """Assemble document parts and return as string.""" head = '\n'.join(self.head_prefix + self.stylesheet + self.head) | def astext(self): """Assemble document parts and return as string""" head = '\n'.join(self.head_prefix + self.head) body = ''.join(self.body_prefix + self.body + self.body_suffix) return head + '\n' + body | 46a0c8dd14843f2383711724a77c799cd55db324 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1278/46a0c8dd14843f2383711724a77c799cd55db324/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3364,
408,
12,
2890,
4672,
3536,
1463,
10045,
1668,
2140,
471,
327,
487,
533,
12123,
910,
273,
2337,
82,
10332,
5701,
12,
2890,
18,
1978,
67,
3239,
397,
365,
18,
19403,
397,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3364,
408,
12,
2890,
4672,
3536,
1463,
10045,
1668,
2140,
471,
327,
487,
533,
12123,
910,
273,
2337,
82,
10332,
5701,
12,
2890,
18,
1978,
67,
3239,
397,
365,
18,
19403,
397,
365,
18,
1... |
'http://www.isi.edu/in-notes/iana/assignments/media-types/image/png' | 'image/png' | def sniffLanguage(stream, baseURI=ianaBase): """ Return a URI which identifies the stream's formal language, following some experimental rules. May replace stream's internals with a seekable version of the same data. >>> import sniff >>> import urllib >>> f=urllib.urlopen("http://www.w3.org/Icons/w3c_main") >>> sniff.sniffLanguage(f) 'http://www.isi.edu/in-notes/iana/assignments/media-types/image/png' Now let's try it with XML content. Right now at least this is served as text/html, but we'll sniff out the namespace: >>> f=urllib.urlopen("http://www.w3.org") >>> sniff.sniffLanguage(f) 'http://www.w3.org/1999/xhtml#html' Note the first line still appears next... >>> f.readline().strip() '<?xml version="1.0" encoding="UTF-8"?>' Now try a few sniffs of text/plain documents. This one has no override: >>> f=urllib.urlopen("file:test/sniff-1.plain") >>> sniff.sniffLanguage(f) 'http://www.isi.edu/in-notes/iana/assignments/media-types/text/plain' But this one does: >>> f=urllib.urlopen("file:test/sniff-2.plain") >>> sniff.sniffLanguage(f) 'http://www.isi.edu/in-notes/iana/assignments/media-types/application/octet-stream' #>>> f=urllib.urlopen("file:/home/sandro/WWW/2000/10/swap/test/crypto/acc.n3") #>>> sniff.sniffLanguage(f) #'application/vnd.w3c.n3' @@ still needs a way to handle suffixes: n3, nt, etc. http://archive.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/extension-map.html http://web.pydoc.org/2.2/mimetypes.html use .mime.types if still text/plain maybe special case n3? @@ needs preferences to handle content-negotation, both with file: (knowing suffixes) and http: . (open foo when foo.html exists.) """ lang = stream.info().type if lang.find(":") == -1: lang = baseURI + lang if xmlPattern.match(lang): sniffer = sniffXML elif plainPattern.match(lang): sniffer = sniffPlain else: return lang try: stream.fp.seek(0) except IOError: makeSeekable(stream) except AttributeError: makeSeekable(stream) lang = sniffer(stream, lang) stream.fp.seek(0) if lang.find(":") == -1: lang = baseURI + lang # fall back to suffix! if lang == baseURI+"text/plain": uri=stream.info().uri try: suffix = uri[uri.rindex(".")+1:] return baseURI+"application/"+suffix except ValueError: # no period in it?!?! pass return lang | 4bbd28f061930698a51594776087016f74ae39e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/4bbd28f061930698a51594776087016f74ae39e0/sniff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26974,
3779,
12,
3256,
16,
1026,
3098,
33,
2779,
69,
2171,
4672,
3536,
225,
2000,
279,
3699,
1492,
25283,
326,
1407,
1807,
25739,
2653,
16,
3751,
2690,
23070,
2931,
18,
225,
16734,
1453,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26974,
3779,
12,
3256,
16,
1026,
3098,
33,
2779,
69,
2171,
4672,
3536,
225,
2000,
279,
3699,
1492,
25283,
326,
1407,
1807,
25739,
2653,
16,
3751,
2690,
23070,
2931,
18,
225,
16734,
1453,
... |
"error is: %s." % (User.users_file, e)) | "error is: %s." % (user_filename, e)) | def create_user(name): """Creates a new User. Writes an entry in users.txt for the new user. Exceptions: If the specified name contains any characters other than letters, numbers, or spaces, raises an InvalidNameError. If another user exists with this name, raises a TODO. """ # TODO Validate name try: users_file = None users_file = open(User.users_file) except IOError, e: logging.critical("There was an error opening the users file (%s). The " "error is: %s." % (User.users_file, e)) raise UserCreationError() try: lines = users_file.readlines() except IOError, e: logging.critical("There was an error reading the users file (%s). The " "error is: %s." % (User.users_file, e)) raise UserCreationError() users_file.close() ids = [] names = [] for line in lines: entry = line.split(':') if len(entry) != 2: logging.error("There is an invalid entry in the users file: %s. " "Skipping this entry." % line) ids.append(entry[0]) names.append(entry[1]) if name in names: raise NameAlreadyExistsError() id = random.randint(1000, 9999) while str(id) in ids: id = random.randint(1000, 9999) try: file = open(User.users_file, 'a') file.write("%s:%s\n" % (id, name)) except IOError, e: logging.critical("There was an error opening the users file (%s). The " "error is: %s." % (User.users_file, e)) file.close() return User(id) | f42a194fdebca5d19e0277d35955d7040cb0756d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2803/f42a194fdebca5d19e0277d35955d7040cb0756d/user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1355,
12,
529,
4672,
3536,
2729,
279,
394,
2177,
18,
30053,
392,
1241,
316,
3677,
18,
5830,
364,
326,
394,
729,
18,
12781,
30,
971,
326,
1269,
508,
1914,
1281,
3949,
1308,
235... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1355,
12,
529,
4672,
3536,
2729,
279,
394,
2177,
18,
30053,
392,
1241,
316,
3677,
18,
5830,
364,
326,
394,
729,
18,
12781,
30,
971,
326,
1269,
508,
1914,
1281,
3949,
1308,
235... |
fname = Header.Header(m.filename).encode() | fname = Header.Header(attachment.filename).encode() | def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{MailMessage} object @param mailMessage: A C{email.Message} object representation of a mail message @type mailMessage: C{email.Message} @return: C{Message.Message} """ assert has_stamp(mailMessage, MailStamp), \ "mailMessage must have been stamped as a MailStamp" messageObject = Message.Message() stampedMail = MailStamp(mailMessage) # Create a messageId if none exists if not hasValue(stampedMail.messageId): stampedMail.messageId = createMessageID() populateHeader(messageObject, 'Message-ID', stampedMail.messageId) populateHeader(messageObject, 'Date', stampedMail.dateSentString) populateEmailAddresses(stampedMail, messageObject) populateStaticHeaders(messageObject) populateHeaders(stampedMail, messageObject) populateHeader(messageObject, 'Subject', stampedMail.subject, encode=True) if getattr(stampedMail, "inReplyTo", None): populateHeader(messageObject, 'In-Reply-To', stampedMail.inReplyTo, encode=False) if stampedMail.referencesMID and len(stampedMail.referencesMID): messageObject["References"] = " ".join(stampedMail.referencesMID) try: payload = mailMessage.body except AttributeError: payload = u"" isEvent = has_stamp(mailMessage, EventStamp) hasAttachments = stampedMail.getNumberOfAttachments() > 0 if not isEvent and not hasAttachments: # There are no attachments or Ical events so just add the # body text as the payload and return the messageObject messageObject.set_payload(payload.encode("utf-8"), charset="utf-8") return messageObject messageObject.set_type("multipart/mixed") if isEvent: # If this message is an event, prepend the event description to the body, # and add the event data as an attachment. # @@@ This probably isn't the right place to do this (since it couples the # email service to events and ICalendarness), but until we resolve the architectural # questions around stamping, it's good enough. # It's an event - prepend the description to the body, make the # message multipart, and add the body & ICS event as parts. Also, # add a private header telling us how long the description is, so # we'll know what to remove on the receiving end. # @@@ I tried multipart/alternative here, but this hides the attachment # completely on some clients... # @@@ In formatting the prepended description, I'm adding an extra newline # at the end so that Apple Mail will display the .ics attachment on its own line. event = EventStamp(mailMessage) timeDescription = event.getTimeDescription() location = unicode(getattr(event, 'location', u'')) if len(location.strip()) > 0: evtDesc = _(u"When: %(whenValue)s\nWhere: %(locationValue)s") \ % { 'whenValue': timeDescription, 'locationValue': location } else: evtDesc = _(u"When: %(whenValue)s") \ % { 'whenValue': timeDescription } payload = _(u"%(eventDescription)s\n\n%(bodyText)s\n") \ % {'eventDescription': evtDesc, 'bodyText': payload } mt = email.MIMEText.MIMEText(payload.encode('utf-8'), _charset="utf-8") messageObject.attach(mt) messageObject.add_header(createChandlerHeader("EventDescriptionLength"), str(len(evtDesc))) # Format this message as an ICalendar object import osaf.sharing.ICalendar as ICalendar calendar = ICalendar.itemsToVObject(mailMessage.itsItem.itsView, [event], filters=(Remindable.reminders.name,)) calendar.add('method').value="REQUEST" ics = calendar.serialize().encode('utf-8') # Attach the ICalendar object icsPayload = MIMENonMultipart('text', 'calendar', method='REQUEST', _charset="utf-8") fname = Header.Header(_(u"event.ics")).encode() icsPayload.add_header("Content-Disposition", "attachment", filename=fname) icsPayload.set_payload(ics) messageObject.attach(icsPayload) else: mt = email.MIMEText.MIMEText(payload.encode('utf-8'), _charset="utf-8") messageObject.attach(mt) if hasAttachments: attachments = stampedMail.getAttachments() for attachment in attachments: if has_stamp(attachment, MailStamp): # The attachment is another MailMessage try: rfc2822 = binaryToData(MailStamp(attachment).rfc2822Message) except AttributeError: rfc2822 = kindToMessageText(attachment, False) message = email.message_from_string(rfc2822) rfc2822Payload = MIMEMessage(message) messageObject.attach(rfc2822Payload) else: m = email.MIMEText.MIMEText(attachment) if m.mimeType == u"text/calendar": icsPayload = MIMENonMultipart('text', 'calendar', \ method='REQUEST', _charset="utf-8") fname = Header.Header(m.filename).encode() icsPayload.add_header("Content-Disposition", "attachment", filename=fname) icsPayload.set_payload(m.data.encode('utf-8')) messageObject.attach(icsPayload) return messageObject | b824ffaa4bf208ea594a3c9dcb2a3bef9daae3c2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/b824ffaa4bf208ea594a3c9dcb2a3bef9daae3c2/message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3846,
774,
1079,
921,
12,
4408,
1079,
4672,
3536,
1220,
707,
7759,
279,
2699,
883,
533,
358,
279,
1680,
464,
749,
385,
95,
6759,
1079,
97,
733,
225,
632,
891,
4791,
1079,
30,
432,
385,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3846,
774,
1079,
921,
12,
4408,
1079,
4672,
3536,
1220,
707,
7759,
279,
2699,
883,
533,
358,
279,
1680,
464,
749,
385,
95,
6759,
1079,
97,
733,
225,
632,
891,
4791,
1079,
30,
432,
385,... |
output += """ | output += """ | def tmpl_create_multiple_actions_form(self, form_name="", form_action="", method="GET", action_display={}, action_field_name="", button_label="", button_name="", content="", **hidden): """ Creates an HTML form with a multiple choice of actions and a button to select it. @param form_action: link to the receiver of the formular @param form_name: name of the HTML formular @param method: either 'GET' or 'POST' @param action_display: dictionary of actions. action is HTML name (name of action) display is the string provided in the popup @param action_field_name: html name of action field @param button_label: what's written on the button @param button_name: html name of the button @param content: what's inside te formular @param **hidden: dictionary of name/value pairs of hidden fields. """ output = """ | 27d7091bee433f509ff19c7a2e5950fe24ff0eca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3302/27d7091bee433f509ff19c7a2e5950fe24ff0eca/webcomment_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
2640,
67,
9622,
67,
4905,
67,
687,
12,
2890,
16,
646,
67,
529,
1546,
3113,
646,
67,
1128,
1546,
3113,
707,
1546,
3264,
3113,
1301,
67,
5417,
28793,
1301,
67,
1518,
67,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
2640,
67,
9622,
67,
4905,
67,
687,
12,
2890,
16,
646,
67,
529,
1546,
3113,
646,
67,
1128,
1546,
3113,
707,
1546,
3264,
3113,
1301,
67,
5417,
28793,
1301,
67,
1518,
67,
529,
... |
except urllib.HTTPError, e: | except HTTPError, e: | def allow_watcher(watcher): global prules, prules_etag, allow_rule, allow_rule_identities for i in xrange(3): if prules is None: get_prules() if prules is not None: if allow_rule is None: allow_rule_identities = Identity() allow_rule = Rule('pres_whitelist', conditions=Conditions([allow_rule_identities]), actions=Actions([SubHandling('allow')]), transformations=Transformations([ProvideServices([AllServices()]), ProvidePersons([AllPersons()]), ProvideDevices([AllDevices()]), ProvideAllAttributes()])) prules.append(allow_rule) if str(watcher) not in allow_rule_identities: allow_rule_identities.append(IdentityOne(str(watcher))) try: xcap_client.put('pres-rules', prules.toxml(pretty_print=True), etag=prules_etag) except urllib.HTTPError, e: print "Cannot PUT 'pres-rules' document: %s" % str(e) else: print "Watcher %s is now authorized" % watcher break sleep(0.1) else: print "Could not authorized watcher %s" % watcher | fbbc801ff4aa4626209164dd0f4907c6809b6e2a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3449/fbbc801ff4aa4626209164dd0f4907c6809b6e2a/sip_subscribe_winfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1699,
67,
23894,
12,
23894,
4672,
2552,
846,
1513,
16,
846,
1513,
67,
20788,
16,
1699,
67,
5345,
16,
1699,
67,
5345,
67,
6392,
1961,
364,
277,
316,
12314,
12,
23,
4672,
309,
846,
1513,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1699,
67,
23894,
12,
23894,
4672,
2552,
846,
1513,
16,
846,
1513,
67,
20788,
16,
1699,
67,
5345,
16,
1699,
67,
5345,
67,
6392,
1961,
364,
277,
316,
12314,
12,
23,
4672,
309,
846,
1513,... |
required_headers = ('date',) | def location(self): for name, value in self.headers: if name.lower() == 'location': return value else: raise KeyError("No location set for %s" % self) | 4409e3621ec9c4cb235da7e66fb061a9ebfc61da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/4409e3621ec9c4cb235da7e66fb061a9ebfc61da/httpexceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2117,
12,
2890,
4672,
364,
508,
16,
460,
316,
365,
18,
2485,
30,
309,
508,
18,
8167,
1435,
422,
296,
3562,
4278,
327,
460,
469,
30,
1002,
4999,
2932,
2279,
2117,
444,
364,
738,
87,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2117,
12,
2890,
4672,
364,
508,
16,
460,
316,
365,
18,
2485,
30,
309,
508,
18,
8167,
1435,
422,
296,
3562,
4278,
327,
460,
469,
30,
1002,
4999,
2932,
2279,
2117,
444,
364,
738,
87,
6... | |
message['to'] = "jaxemachat@conference.%s" % ( CHATSERVER,) | message['to'] = "jaxemachat@conference.%s" % (secret.CHATSERVER,) | def processMessagePC(self, elem): _from = jid.JID( elem["from"] ) # Intercept private messages via a chatroom, can't do that :) if (_from.host == "conference.%s" % (CHATSERVER,)): self.send_private_request( _from ) return | 24fa6a8a683868db6a24e95e0b656f67ea1dbe8d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11180/24fa6a8a683868db6a24e95e0b656f67ea1dbe8d/iemchatbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1079,
3513,
12,
2890,
16,
3659,
4672,
389,
2080,
273,
14201,
18,
46,
734,
12,
3659,
9614,
2080,
11929,
262,
468,
5294,
956,
3238,
2743,
3970,
279,
7916,
13924,
16,
848,
1404,
741,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1079,
3513,
12,
2890,
16,
3659,
4672,
389,
2080,
273,
14201,
18,
46,
734,
12,
3659,
9614,
2080,
11929,
262,
468,
5294,
956,
3238,
2743,
3970,
279,
7916,
13924,
16,
848,
1404,
741,
... |
def set_message(self, msgid, msgstr=[''], comments=[], references={}): | def set_message(self, msgid, msgstr=[u''], comments=[], references={}): | def set_message(self, msgid, msgstr=[''], comments=[], references={}): self._set_message(msgid, msgstr, comments, references) self.save() | 92fbac2762ad6f7abb01e267b4ed5b254274700f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/92fbac2762ad6f7abb01e267b4ed5b254274700f/PO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2150,
12,
2890,
16,
24389,
16,
8733,
313,
22850,
89,
11,
17337,
5678,
22850,
6487,
5351,
12938,
4672,
365,
6315,
542,
67,
2150,
12,
3576,
350,
16,
8733,
313,
16,
5678,
16,
535... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
67,
2150,
12,
2890,
16,
24389,
16,
8733,
313,
22850,
89,
11,
17337,
5678,
22850,
6487,
5351,
12938,
4672,
365,
6315,
542,
67,
2150,
12,
3576,
350,
16,
8733,
313,
16,
5678,
16,
535... |
post_syncdb.connect(wrap_evolution) mgmt.evolution = wrap_evolution | signal.connect(wrapper_func) dispatcher.connect = custom_connect | def wrap_evolution(app, created_models, verbosity=1, **kwargs): old_evolution(app, created_models, verbosity) | 4be12cee712f5dd9c897c67f2f4f57f46869138f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1600/4be12cee712f5dd9c897c67f2f4f57f46869138f/manage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
67,
14965,
5889,
12,
2910,
16,
2522,
67,
7665,
16,
11561,
33,
21,
16,
2826,
4333,
4672,
1592,
67,
14965,
5889,
12,
2910,
16,
2522,
67,
7665,
16,
11561,
13,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
67,
14965,
5889,
12,
2910,
16,
2522,
67,
7665,
16,
11561,
33,
21,
16,
2826,
4333,
4672,
1592,
67,
14965,
5889,
12,
2910,
16,
2522,
67,
7665,
16,
11561,
13,
2,
-100,
-100,
-100,
... |
'<small>' | '<font size="-3">' | def about(self): QMessageBox.about(self, self.tr("About QReduce"),self.tr( '<center>' '<h3>QReduce 0.2</h3>' '<p>© 2009-2010 T. Sturm, 2010 C. Zengler' '</center>' 'A worksheet-based GUI for the computer algebra system Reduce.' '<p>' '<small>' '<hr>' '<strong>License: </strong>' 'Redistribution and use in source and binary forms, with ' 'or without modification, are permitted provided that the ' 'following conditions are met: ' '(a) Redistributions of source code must retain the relevant ' 'copyright notice, this list of conditions and the following ' 'disclaimer. ' '(b) Redistributions in binary form must reproduce the above ' 'copyright notice, this list of conditions and the following ' 'disclaimer in the documentation and/or other materials ' 'provided with the distribution. ' '</small>' '<p>' '<small>' '<strong>Disclaimer:</strong> ' 'This software is provided by the copyright holders and ' 'contributors "as is" and any express or implied warranties, ' 'including, but not limited to, the implied warranties of ' 'merchantability and fitness for a particular purpose are ' 'disclaimed. In no event shall the copyright owners or ' 'contributors be liable for any direct, indirect, incidental, ' 'special, exemplary, or consequential damages (including, but ' 'not limited to, procurement of substitute goods or services; ' 'loss of use, data, or profits; or business interruption) ' 'however caused and on any theory of liability, whether in ' 'contract, strict liability, or tort (including negligence or ' 'otherwise) arising in any way out of the use of this ' 'software, even if advised of the possibility of such damage.' '</small>')) | 64c03aad72260c69e1fcd6d14f19abc81a6789a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/403/64c03aad72260c69e1fcd6d14f19abc81a6789a2/qrmainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2973,
12,
2890,
4672,
30728,
18,
21071,
12,
2890,
16,
365,
18,
313,
2932,
24813,
2238,
12944,
6,
3631,
2890,
18,
313,
12,
2368,
5693,
1870,
2368,
76,
23,
34,
53,
12944,
374,
18,
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,
2973,
12,
2890,
4672,
30728,
18,
21071,
12,
2890,
16,
365,
18,
313,
2932,
24813,
2238,
12944,
6,
3631,
2890,
18,
313,
12,
2368,
5693,
1870,
2368,
76,
23,
34,
53,
12944,
374,
18,
22,
... |
self.notify.debug("delayDeleteCount for doId %s -- deleteImminent" % (self.doId)) | assert(self.notify.debug("delayDeleteCount for doId %s -- deleteImminent" % (self.doId))) | def delayDelete(self, flag): # Flag should be 0 or 1, meaning increment or decrement count # Also see DelayDelete.py | 4661ac427c38464e5c9cefaa283687baf3f33af3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/4661ac427c38464e5c9cefaa283687baf3f33af3/DistributedObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4624,
2613,
12,
2890,
16,
2982,
4672,
468,
9960,
1410,
506,
374,
578,
404,
16,
12256,
5504,
578,
15267,
1056,
468,
8080,
2621,
20165,
2613,
18,
2074,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4624,
2613,
12,
2890,
16,
2982,
4672,
468,
9960,
1410,
506,
374,
578,
404,
16,
12256,
5504,
578,
15267,
1056,
468,
8080,
2621,
20165,
2613,
18,
2074,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
roundup_server.run(port, success_message) | roundup_server.run(success_message=success_message) def demo_main(): """Run a demo server for users to play with for instant gratification. Sets up the web service on localhost. Disables nosy lists. """ home = os.path.abspath('demo') if not os.path.exists(home) or (sys.argv[-1] == 'nuke'): if len(sys.argv) > 2: backend = sys.argv[-2] else: backend = 'anydbm' install_demo(home, backend, os.path.join('templates', 'classic')) run_demo(home) | def run_demo(): ''' Run a demo server for users to play with for instant gratification. Sets up the web service on localhost. Disables nosy lists. ''' home = os.path.abspath('demo') backend = 'anydbm' if not os.path.exists(home) or sys.argv[-1] == 'nuke': if len(sys.argv) > 2: backend = sys.argv[-2] install_demo(home, backend) cfg = ConfigParser.ConfigParser() cfg.read(os.path.join(home, 'config.ini')) url = cfg.get('tracker', 'web') hostname, port = urlparse.urlparse(url)[1].split(':') port = int(port) # ok, so start up the server from roundup.scripts import roundup_server roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home} success_message = '''Server running - connect to: %s | 4e39cc9c84cb81d6ae66e39468fe97b20a969216 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4e39cc9c84cb81d6ae66e39468fe97b20a969216/demo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
27928,
13332,
9163,
1939,
279,
21477,
1438,
364,
3677,
358,
6599,
598,
364,
5934,
3821,
270,
1480,
18,
225,
11511,
731,
326,
3311,
1156,
603,
17365,
18,
3035,
1538,
26628,
93,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
27928,
13332,
9163,
1939,
279,
21477,
1438,
364,
3677,
358,
6599,
598,
364,
5934,
3821,
270,
1480,
18,
225,
11511,
731,
326,
3311,
1156,
603,
17365,
18,
3035,
1538,
26628,
93,
... |
if alert_device not in engine.output_devices: if 'default' in engine.output_devices: alert_device = 'default' else: alert_device = None | if alert_device not in (None, 'default') and alert_device not in engine.output_devices: alert_device = 'default' | def start(self, config_backend=None): if self.state is not None: raise RuntimeError("SIPApplication cannot be started from '%s' state" % self.state) self.state = 'starting' account_manager = AccountManager() configuration_manager = ConfigurationManager() notification_center = NotificationCenter() session_manager = SessionManager() | a820090ef4574b702ee6770efee9bb4e9f5f382e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/a820090ef4574b702ee6770efee9bb4e9f5f382e/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
642,
67,
9993,
33,
7036,
4672,
309,
365,
18,
2019,
353,
486,
599,
30,
1002,
7265,
2932,
17739,
3208,
2780,
506,
5746,
628,
1995,
87,
11,
919,
6,
738,
365,
18,
2019... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
642,
67,
9993,
33,
7036,
4672,
309,
365,
18,
2019,
353,
486,
599,
30,
1002,
7265,
2932,
17739,
3208,
2780,
506,
5746,
628,
1995,
87,
11,
919,
6,
738,
365,
18,
2019... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.