rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
print (Y1-Y2).max() | if verbose > 2: print (Y1-Y2).max() | def test_cdist_jaccard_double_random(self): "Tests cdist(X, 'jaccard') on random data." eps = 1e-07 # Get the data: the input matrix and the right output. X1 = eo['cdist-X1'] X2 = eo['cdist-X2'] Y1 = cdist(X1, X2, 'jaccard') Y2 = cdist(X1, X2, 'test_jaccard') print (Y1-Y2).max() self.failUnless(within_tol(Y1, Y2, eps)) | c3d85c07ed380f445f851652c8c4ee87f0b2dc45 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5882/c3d85c07ed380f445f851652c8c4ee87f0b2dc45/test_distance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4315,
376,
67,
78,
8981,
1060,
67,
9056,
67,
9188,
12,
2890,
4672,
315,
14650,
276,
4413,
12,
60,
16,
296,
78,
8981,
1060,
6134,
603,
2744,
501,
1199,
7785,
273,
404,
73,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4315,
376,
67,
78,
8981,
1060,
67,
9056,
67,
9188,
12,
2890,
4672,
315,
14650,
276,
4413,
12,
60,
16,
296,
78,
8981,
1060,
6134,
603,
2744,
501,
1199,
7785,
273,
404,
73,
1... |
print("HOSTS %s %s " % (c.remote.hostname, c.local.host) ) | def report_connection(self, i, to, connection_type, anon=False): c = i.con print("HOSTS %s %s " % (c.remote.hostname, c.local.host) ) | aafda75ca94ff8f2803d1d92990754394881af8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/aafda75ca94ff8f2803d1d92990754394881af8a/logxmpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
67,
4071,
12,
2890,
16,
277,
16,
358,
16,
1459,
67,
723,
16,
30637,
33,
8381,
4672,
276,
273,
277,
18,
591,
1172,
2932,
8908,
55,
738,
87,
738,
87,
315,
738,
261,
71,
18,
722... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2605,
67,
4071,
12,
2890,
16,
277,
16,
358,
16,
1459,
67,
723,
16,
30637,
33,
8381,
4672,
276,
273,
277,
18,
591,
1172,
2932,
8908,
55,
738,
87,
738,
87,
315,
738,
261,
71,
18,
722... | |
if not self.bIsDispatch: | if not self.bIsDispatch and not self.type_attr.typekind == pythoncom.TKIND_DISPATCH: | def WriteClass(self, generator): wTypeFlags = self.type_attr.wTypeFlags if not self.bIsDispatch: return # This is pretty screwey - now we have vtable support we # should probably rethink this (ie, maybe write both sides for sinks, etc) if self.bIsSink: self.WriteEventSinkClassHeader(generator) self.WriteCallbackClassBody(generator) else: self.WriteClassHeader(generator) self.WriteClassBody(generator) print self.bWritten = 1 | 2d4835a2a4f8f19592a404b811142a47c0504ebf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/2d4835a2a4f8f19592a404b811142a47c0504ebf/genpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
12,
2890,
16,
4456,
4672,
341,
559,
5094,
273,
365,
18,
723,
67,
1747,
18,
91,
559,
5094,
309,
486,
365,
18,
70,
2520,
5325,
471,
486,
365,
18,
723,
67,
1747,
18,
723,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
12,
2890,
16,
4456,
4672,
341,
559,
5094,
273,
365,
18,
723,
67,
1747,
18,
91,
559,
5094,
309,
486,
365,
18,
70,
2520,
5325,
471,
486,
365,
18,
723,
67,
1747,
18,
723,
9... |
decrement(key_incomplete, len(lostpeers), namespace='S') | decr(key_incomplete, sum(1 for x in lostpeers), namespace='S') | def real_main(): args = parse_qs(environ['QUERY_STRING']) if not args: print "Status: 301 Moved Permanantly\nLocation: /\n\n", return for a in ('info_hash', 'port'): if a not in args or len(args[a]) < 1: if ERRORS: resps(bencode({'failure reason': "You must provide %s!"%a})) return ip = environ['REMOTE_ADDR'] key = args['info_hash'][0] if STATS: key_complete = '%s!complete'%key key_incomplete = '%s!incomplete'%key left = args.pop('left', [None])[0] err = None if(len(key) > 128): err = "Insanely long key!" else: try: port = int(args['port'][0]) except: err = "Invalid port number!" if err: if ERRORS: resps(bencode({'failure reason': err})) return # Crop raises chance of a clash, plausible deniability for the win! phash = md5("%s/%d" % (ip, port)).hexdigest()[:16] # TODO BT: If left=0, the download is done and we should not return any peers. event = args.pop('event', [None])[0] if event == 'stopped': # Maybe we should only remove it from this track, but this is good enough. mdel(phash, namespace='I') if STATS: # XXX Danger of incomplete underflow! if left == '0': decrement(key_complete, namespace='S') else: decrement(key_incomplete, namespace='S') return # They are going away, don't waste bw/cpu on this. resps(bencode({'interval': INTERVAL, 'peers': []})) elif STATS and event == 'completed': decrement(key_incomplete, namespace='S') increment(key_complete, namespace='S') updatetrack = False # Get existing peers r = get(key, namespace='K') if r: s = r.split('|') if len(s) > 32: ks = sample(s, 32) else: ks = s peers = get_multi(ks, namespace='I') lostpeers = (p for p in ks if p not in peers) if lostpeers: # Remove lost peers s = [k for k in s if k not in lostpeers] updatetrack = True if STATS: # XXX If we underflow, should decrement from '!complete' decrement(key_incomplete, len(lostpeers), namespace='S') if phash in peers: peers.pop(phash, None) # Remove self from returned peers # New track! else: s = [] peers = {} if STATS: mset(key_complete, '0', namespace='S') mset(key_incomplete, '0', namespace='S') # Might be redundant, but ensures we update the port number if it has changed. mset(phash, '|'.join((ip, str(port))), namespace='I') if phash not in s: # Assume new peer s.append(phash) updatetrack = True if STATS: # Should we bother to check event == 'started'? Why? if left == '0': increment(key_complete, namespace='S') else: increment(key_incomplete, namespace='S') if updatetrack: mset(key, '|'.join(s), namespace='K') ps = dict((k, peers[k].split('|')) for k in peers) pl = [{'ip': ps[h][0], 'port': ps[h][1]} for h in ps] if STATS: resps(bencode({'interval':INTERVAL, 'peers':pl, 'complete':get(key_complete, namespace='S'), 'incomplete':get(key_incomplete, namespace='S')})) else: resps(bencode({'interval':INTERVAL, 'peers': pl})) | 2fc9438ee448a3f8e5f77c6eab847284091d5fbb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14779/2fc9438ee448a3f8e5f77c6eab847284091d5fbb/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2863,
67,
5254,
13332,
833,
273,
1109,
67,
12926,
12,
28684,
3292,
10753,
67,
5804,
19486,
225,
309,
486,
833,
30,
1172,
315,
1482,
30,
26403,
490,
9952,
13813,
304,
970,
715,
64,
82,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2863,
67,
5254,
13332,
833,
273,
1109,
67,
12926,
12,
28684,
3292,
10753,
67,
5804,
19486,
225,
309,
486,
833,
30,
1172,
315,
1482,
30,
26403,
490,
9952,
13813,
304,
970,
715,
64,
82,
... |
items = [] | items = [] dirname = os.path.dirname(fxd.getattr(None, 'filename', '')) | def fxdhandler(self, fxd, node): """ parse image specific stuff from fxd files | d3f3b88bc7f68f646ee3c54b593f458f3bd4df84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/d3f3b88bc7f68f646ee3c54b593f458f3bd4df84/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
7669,
4176,
12,
2890,
16,
284,
7669,
16,
756,
4672,
3536,
1109,
1316,
2923,
10769,
628,
284,
7669,
1390,
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,
284,
7669,
4176,
12,
2890,
16,
284,
7669,
16,
756,
4672,
3536,
1109,
1316,
2923,
10769,
628,
284,
7669,
1390,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if obtained != valid: | if not expected_result(obtained, valid): | def expand (file, entry): | 2c91226d74c638ff6bcbbbaf53b4a27125f9589b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1356/2c91226d74c638ff6bcbbbaf53b4a27125f9589b/testsuite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
261,
768,
16,
1241,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
261,
768,
16,
1241,
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,
-10... |
'http://www.itunes.com/dtds/podcast-1.0.dtd': 'itunes', 'http://example.com/dtds/podcast-1.0.dtd': 'itunes', 'http://xmlns.com/foaf/0.1/': 'foaf', 'http://freshmeat.net/rss/fm/': 'fm', | 'http://www.itunes.com/DTDs/PodCast-1.0.dtd': 'itunes', 'http://example.com/DTDs/PodCast-1.0.dtd': 'itunes', | def _ebcdic_to_ascii(s): global _ebcdic_to_ascii_map if not _ebcdic_to_ascii_map: emap = ( 0,1,2,3,156,9,134,127,151,141,142,11,12,13,14,15, 16,17,18,19,157,133,8,135,24,25,146,143,28,29,30,31, 128,129,130,131,132,10,23,27,136,137,138,139,140,5,6,7, 144,145,22,147,148,149,150,4,152,153,154,155,20,21,158,26, 32,160,161,162,163,164,165,166,167,168,91,46,60,40,43,33, 38,169,170,171,172,173,174,175,176,177,93,36,42,41,59,94, 45,47,178,179,180,181,182,183,184,185,124,44,37,95,62,63, 186,187,188,189,190,191,192,193,194,96,58,35,64,39,61,34, 195,97,98,99,100,101,102,103,104,105,196,197,198,199,200,201, 202,106,107,108,109,110,111,112,113,114,203,204,205,206,207,208, 209,126,115,116,117,118,119,120,121,122,210,211,212,213,214,215, 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231, 123,65,66,67,68,69,70,71,72,73,232,233,234,235,236,237, 125,74,75,76,77,78,79,80,81,82,238,239,240,241,242,243, 92,159,83,84,85,86,87,88,89,90,244,245,246,247,248,249, 48,49,50,51,52,53,54,55,56,57,250,251,252,253,254,255 ) import string _ebcdic_to_ascii_map = string.maketrans( \ ''.join(map(chr, range(256))), ''.join(map(chr, emap))) return s.translate(_ebcdic_to_ascii_map) | 50cbe5fb44dbff087e8cca95d332bb7b7cc15747 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10695/50cbe5fb44dbff087e8cca95d332bb7b7cc15747/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
24008,
4315,
335,
67,
869,
67,
9184,
12,
87,
4672,
2552,
389,
24008,
4315,
335,
67,
869,
67,
9184,
67,
1458,
309,
486,
389,
24008,
4315,
335,
67,
869,
67,
9184,
67,
1458,
30,
80... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24008,
4315,
335,
67,
869,
67,
9184,
12,
87,
4672,
2552,
389,
24008,
4315,
335,
67,
869,
67,
9184,
67,
1458,
309,
486,
389,
24008,
4315,
335,
67,
869,
67,
9184,
67,
1458,
30,
80... |
def getTrackerVersion(val): val = val.value return "ScreamTracker %X.%02X" % ((val-0x1000)>>8, val&0xFF) | def getTrackerVersion(val): val = val.value return "ScreamTracker %X.%02X" % ((val-0x1000)>>8, val&0xFF) | 28b08c3fa3dd43c3607a6a84b90c5a8aa728365a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/28b08c3fa3dd43c3607a6a84b90c5a8aa728365a/s3m.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
8135,
1444,
12,
1125,
4672,
1244,
273,
1244,
18,
1132,
327,
315,
1541,
793,
8135,
738,
60,
7866,
3103,
60,
6,
738,
14015,
1125,
17,
20,
92,
18088,
13,
9778,
28,
16,
1244,
10,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
8135,
1444,
12,
1125,
4672,
1244,
273,
1244,
18,
1132,
327,
315,
1541,
793,
8135,
738,
60,
7866,
3103,
60,
6,
738,
14015,
1125,
17,
20,
92,
18088,
13,
9778,
28,
16,
1244,
10,
20... | |
rc, out = traceCommand("ip addr show |grep \"inet 169.254\" | grep -v vif") | rc, out = traceCommand("ip addr show |grep \"inet 169.254\" | grep eth0") | def checkZeroconfAddresses(): # Make sure there aren't existing zeroconf addresses. rc, out = traceCommand("ip addr show |grep \"inet 169.254\" | grep -v vif") if rc == 0: raise NetworkError("Zeroconf addresses already used: %s" % out) | 95b400726136220650ac24dee09b2ca9ed78d967 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/95b400726136220650ac24dee09b2ca9ed78d967/NetConfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
62,
264,
16550,
74,
7148,
13332,
468,
4344,
3071,
1915,
11526,
1404,
2062,
24910,
16550,
74,
6138,
18,
4519,
16,
596,
273,
2606,
2189,
2932,
625,
3091,
2405,
571,
11556,
84,
1239,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
62,
264,
16550,
74,
7148,
13332,
468,
4344,
3071,
1915,
11526,
1404,
2062,
24910,
16550,
74,
6138,
18,
4519,
16,
596,
273,
2606,
2189,
2932,
625,
3091,
2405,
571,
11556,
84,
1239,
2... |
"author": "Julien Muchembled and Victor Stinner", | "author": "Cyril Zorin", | def main(): import hachoir_wx install_options = { "name": 'hachoir-wx', "version": hachoir_wx.__version__, "url": URL, "download_url": URL, "author": "Julien Muchembled and Victor Stinner", "description": "hachoir-wx is a wxWidgets GUI that's meant to provide a (more) user-friendly interface to the hachoir binary parsing engine", "long_description": open('README').read(), "classifiers": CLASSIFIERS, "license": 'GNU GPL v2', "scripts": ["hachoir-wx"], "packages": ["hachoir_wx"], "package_dir": {"hachoir_wx": "hachoir_wx"}, } if with_setuptools: install_options["install_requires"] = ( "hachoir-core>=0.7.0", "hachoir-parser>=0.7.0", "wxPython>=2.6.3") install_options["zip_safe"] = True setup(**install_options) | 3d7ceb18bd528983394df48e8d939ccc5bc6f664 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/3d7ceb18bd528983394df48e8d939ccc5bc6f664/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
366,
497,
83,
481,
67,
27226,
3799,
67,
2116,
273,
288,
315,
529,
6877,
296,
76,
497,
83,
481,
17,
27226,
2187,
315,
1589,
6877,
366,
497,
83,
481,
67,
27226,
16186,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
366,
497,
83,
481,
67,
27226,
3799,
67,
2116,
273,
288,
315,
529,
6877,
296,
76,
497,
83,
481,
17,
27226,
2187,
315,
1589,
6877,
366,
497,
83,
481,
67,
27226,
16186,... |
name = `id(self)` | Image._last_id += 1 name = "pyimage" +`Image._last_id` | def __init__(self, imgtype, name=None, cnf={}, master=None, **kw): self.name = None if not master: master = _default_root if not master: raise RuntimeError, 'Too early to create image' self.tk = master.tk if not name: name = `id(self)` # The following is needed for systems where id(x) # can return a negative number, such as Linux/m68k: if name[0] == '-': name = '_' + name[1:] if kw and cnf: cnf = _cnfmerge((cnf, kw)) elif kw: cnf = kw options = () for k, v in cnf.items(): if callable(v): v = self._register(v) options = options + ('-'+k, v) self.tk.call(('image', 'create', imgtype, name,) + options) self.name = name | 6a3e1c36467593ab8624beac93251ba79f586c12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6a3e1c36467593ab8624beac93251ba79f586c12/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3774,
723,
16,
508,
33,
7036,
16,
23118,
28793,
4171,
33,
7036,
16,
2826,
9987,
4672,
365,
18,
529,
273,
599,
309,
486,
4171,
30,
4171,
273,
389,
1886,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3774,
723,
16,
508,
33,
7036,
16,
23118,
28793,
4171,
33,
7036,
16,
2826,
9987,
4672,
365,
18,
529,
273,
599,
309,
486,
4171,
30,
4171,
273,
389,
1886,
... |
if index < itemsInMenu: | if oldItem is not None: assert index < itemsInMenu, "index out of range replacing menu item" | def setMenuItem (self, newItem, oldItem, index): # now set the menu item itemsInMenu = self.GetMenuItemCount() assert (index <= itemsInMenu) if index < itemsInMenu: self.removeItem (index, oldItem) if isinstance (newItem.widget, wxMenuItem): success = self.InsertItem (index, newItem.widget) assert success """ Disable menus by default. If they have an event then they will be enabled by an UpdateUIEvent or out command dispatch in Application.py """ self.Enable (newItem.widget.GetId(), False) else: self.InsertMenu (index, 0, newItem.title, newItem.widget, newItem.helpString) | e3beff8bc3ce2e759a8bb84be125cb87ca4c7260 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/e3beff8bc3ce2e759a8bb84be125cb87ca4c7260/DynamicContainerBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12958,
261,
2890,
16,
26536,
16,
1592,
1180,
16,
770,
4672,
468,
2037,
444,
326,
3824,
761,
1516,
382,
4599,
273,
365,
18,
967,
12958,
1380,
1435,
1815,
261,
1615,
1648,
1516,
382,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12958,
261,
2890,
16,
26536,
16,
1592,
1180,
16,
770,
4672,
468,
2037,
444,
326,
3824,
761,
1516,
382,
4599,
273,
365,
18,
967,
12958,
1380,
1435,
1815,
261,
1615,
1648,
1516,
382,
... |
return S_ERROR(res['Message']) | return S_ERROR( res['Message'] ) | def __addFile(self,lfn,pfn,size,se,guid,checksum): lfc.lfc_umask(0000) bdir = os.path.dirname(lfn) res = self.__executeOperation(bdir,'exists') # If we failed to find out whether the directory exists if not res['OK']: return S_ERROR(res['Message']) # If the directory doesn't exist if not res['Value']: #Make the directories recursively if needed res = self.__makeDirs(bdir) # If we failed to make the directory for the file if not res['OK']: return S_ERROR(res['Message']) #Create a new file fullLfn = '%s%s' % (self.prefix,lfn) value = lfc.lfc_creatg(fullLfn,guid,0664) if value != 0: errStr = lfc.sstrerror(lfc.cvar.serrno) gLogger.error("LcgFileCatalogClient__addFile: Failed to create GUID.", errStr) # Remove the file we just attempted to add res = self.__unlinkPath(lfn) if not res['OK']: gLogger.error("LcgFileCatalogClient.__addFile: Failed to remove file after failure.", res['Message']) return S_ERROR("LcgFileCatalogClient__addFile: Failed to create GUID: %s" % errStr) #Set the checksum and size of the file if not checksum: checksum = '' value = lfc.lfc_setfsizeg(guid,size,'AD',checksum) if value != 0: errStr = lfc.sstrerror(lfc.cvar.serrno) # Remove the file we just attempted to add res = self.__unlinkPath(lfn) if not res['OK']: gLogger.error("LcgFileCatalogClient.__addFile: Failed to remove file after failure to add checksum and size." % res['Message']) return S_ERROR("LcgFileCatalogClient.__addFile: Failed to set file size: %s" % errStr) return S_OK() | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
812,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
16,
15149,
4672,
328,
7142,
18,
80,
7142,
67,
379,
835,
12,
2787,
13,
324,
1214,
273,
1140,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
812,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
16,
15149,
4672,
328,
7142,
18,
80,
7142,
67,
379,
835,
12,
2787,
13,
324,
1214,
273,
1140,
18,
... |
self.tags.append(self.tag_emph) | self.tags.append(parent.tag_emph) | def handle_starttag(self, tag, attrs): self.flush() if tag in ('h1', 'h2', 'h3', 'h4'): self._append(u'\n\n') self.tags.append(self.tag_big) elif tag == 'p' or tag == 'br' or tag == 'div': self.tags = [] self._append(u'\n') self.slurp_space = True elif tag == 'tr': self.tags = [] self._append(u'\n') self.slurp_space = True elif tag == 'td': self._append(u'\t') elif tag == 'i' or tag == 'em': self.tags.append(self.tag_emph) elif tag == 'b' or tag == 'strong' or tag == 'bold': self.tags.append(self.tag_bold) elif tag == 'hr': self._append(u'\n') elif tag == 'body': self.in_body = True elif tag == 'style': self.omit += 1 elif tag == 'meta' and not self.in_body: self.handle_meta(attrs) elif tag == 'img': attrs = dict(attrs) if 'alt' in attrs and attrs['alt'].strip(): self.handle_data(u'[IMAGE: ') self.handle_data(attrs['alt'].strip().upper()) self.handle_data(u']') else: self.handle_data(u'[IMAGE]') | 213738e766cfb357f1771bca6ca20230e5532367 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14744/213738e766cfb357f1771bca6ca20230e5532367/model_text.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1937,
2692,
12,
2890,
16,
1047,
16,
3422,
4672,
365,
18,
11330,
1435,
309,
1047,
316,
7707,
76,
21,
2187,
296,
76,
22,
2187,
296,
76,
23,
2187,
296,
76,
24,
11,
4672,
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,
1640,
67,
1937,
2692,
12,
2890,
16,
1047,
16,
3422,
4672,
365,
18,
11330,
1435,
309,
1047,
316,
7707,
76,
21,
2187,
296,
76,
22,
2187,
296,
76,
23,
2187,
296,
76,
24,
11,
4672,
365,
... |
Rnaive -= xtr - 1.0 | Rnaive = Rnaive + xtr - 1.0 | def pt_bayescount(Pr, Nt): """Compute the support for analytic bias correction Pr - probability Nt - number of trials """ # dimension of space dim = Pr.size # non zero probs only PrNZ = Pr[Pr>eps] Rnaive = PrNZ.size R = Rnaive if Rnaive < dim: Rexpected = Rnaive - ((1.0-Pr)**Nt).sum() deltaR_prev = dim deltaR = np.abs(Rnaive - Rexpected) xtr = 0 while (deltaR < deltaR_prev) and ((Rnaive+xtr)<dim): xtr = xtr+1 Rexpected = 0.0 # occupied bins gamma = xtr*(1.0 - ((Nt/(Nt+Rnaive))**(1.0/Nt))) Pbayes = ((1.0-gamma) / (Nt+Rnaive)) * (Pr*Nt+1.0) Rexpected = (1.0 - (1.0-Pbayes)**Nt).sum() # non-occupied bins Pbayes = gamma / xtr Rexpected = Rexpected + xtr*(1.0 - (1.0 - Pbayes)**Nt) deltaR_prev = deltaR deltaR = np.abs(Rnaive - Rexpected) Rnaive -= xtr - 1.0 if deltaR < deltaR_prev: Rnaive += 1.0 return R | 17db06fa6dd66098d8ed3ec0c9f64188adc11a09 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11824/17db06fa6dd66098d8ed3ec0c9f64188adc11a09/pyentropy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5818,
67,
70,
528,
742,
592,
12,
2050,
16,
423,
88,
4672,
3536,
7018,
326,
2865,
364,
392,
7834,
335,
12005,
15104,
225,
2301,
300,
11331,
423,
88,
300,
1300,
434,
12950,
87,
225,
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,
5818,
67,
70,
528,
742,
592,
12,
2050,
16,
423,
88,
4672,
3536,
7018,
326,
2865,
364,
392,
7834,
335,
12005,
15104,
225,
2301,
300,
11331,
423,
88,
300,
1300,
434,
12950,
87,
225,
3536... |
def _auto_init(self, cursor, module_name): super(SaleLine, self)._auto_init(cursor, module_name) | def init(self, cursor, module_name): super(SaleLine, self).init(cursor, module_name) | def _auto_init(self, cursor, module_name): super(SaleLine, self)._auto_init(cursor, module_name) table = table_handler(cursor, self._table, self._name, module_name) | 3ccfd09d42fb647223e74599341a903500d64525 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9306/3ccfd09d42fb647223e74599341a903500d64525/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
3347,
16,
1605,
67,
529,
4672,
2240,
12,
30746,
1670,
16,
365,
2934,
2738,
12,
9216,
16,
1605,
67,
529,
13,
1014,
273,
1014,
67,
4176,
12,
9216,
16,
365,
6315,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1208,
12,
2890,
16,
3347,
16,
1605,
67,
529,
4672,
2240,
12,
30746,
1670,
16,
365,
2934,
2738,
12,
9216,
16,
1605,
67,
529,
13,
1014,
273,
1014,
67,
4176,
12,
9216,
16,
365,
6315,
21... |
print `info` | def _render_diff(self, req, db, page): req.perm.assert_permission('WIKI_VIEW') | 08151f5358d279402c74a740b5d2327d338534df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/08151f5358d279402c74a740b5d2327d338534df/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
5413,
12,
2890,
16,
1111,
16,
1319,
16,
1363,
4672,
1111,
18,
12160,
18,
11231,
67,
9827,
2668,
23109,
47,
45,
67,
12145,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
5413,
12,
2890,
16,
1111,
16,
1319,
16,
1363,
4672,
1111,
18,
12160,
18,
11231,
67,
9827,
2668,
23109,
47,
45,
67,
12145,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
sage: print is_bitrade(T1, T2) | sage: is_bitrade(T1, T2) | def beta2(rce, T1, T2): """ Find the unique (r, x, e) in T2 such that (r, c, e) is in T1. INPUT: rce -- tuple (or list) (r, c, e) in T1 T1, T2 -- latin bitrade OUTPUT: (r, x, e) in T2. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: T1 = back_circulant(5) sage: x = isotopism( (0,1,2,3,4) ) sage: y = isotopism(5) # identity sage: z = isotopism(5) # identity sage: T2 = T1.apply_isotopism(x, y, z) sage: print is_bitrade(T1, T2) True sage: print beta2([0, 0, 0], T1, T2) (0, 1, 0) """ r = rce[0] c = rce[1] e = rce[2] assert T1[r, c] == e assert e >= 0 for x in range(T1.ncols()): if T2[r, x] == e: return (r, x, e) raise PairNotBitrade | 9087d14f978c663baae98e9a365c4a3aa2a6f24c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9087d14f978c663baae98e9a365c4a3aa2a6f24c/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6796,
22,
12,
86,
311,
16,
399,
21,
16,
399,
22,
4672,
3536,
4163,
326,
3089,
261,
86,
16,
619,
16,
425,
13,
316,
399,
22,
4123,
716,
261,
86,
16,
276,
16,
425,
13,
353,
316,
399... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6796,
22,
12,
86,
311,
16,
399,
21,
16,
399,
22,
4672,
3536,
4163,
326,
3089,
261,
86,
16,
619,
16,
425,
13,
316,
399,
22,
4123,
716,
261,
86,
16,
276,
16,
425,
13,
353,
316,
399... |
return S_ERROR('Failed to set Reserved status for job %d - already Reserved' % int(taskID) ) | return S_ERROR( 'Failed to set Reserved status for job %d - already Reserved' % int( taskID ) ) | def reserveTask(self,transName,taskID,connection=False): """ Reserve the taskID from transformation for submission """ res = self._getConnectionTransID(connection,transName) if not res['OK']: return res connection = res['Value']['Connection'] transID = res['Value']['TransformationID'] res = self.__checkUpdate("TransformationTasks","ExternalStatus","Reserved",{"TransformationID":transID,"TaskID":taskID},connection=connection) if not res['OK']: return res if not res['Value']: return S_ERROR('Failed to set Reserved status for job %d - already Reserved' % int(taskID) ) # The job is reserved, update the time stamp res = self.setTaskStatus(transID,taskID,'Reserved',connection=connection) if not res['OK']: return S_ERROR('Failed to set Reserved status for job %d - failed to update the time stamp' % int(taskID)) return S_OK() | 9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20501,
2174,
12,
2890,
16,
2338,
461,
16,
4146,
734,
16,
4071,
33,
8381,
4672,
3536,
1124,
6527,
326,
29772,
628,
8620,
364,
8515,
3536,
400,
273,
365,
6315,
588,
1952,
1429,
734,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20501,
2174,
12,
2890,
16,
2338,
461,
16,
4146,
734,
16,
4071,
33,
8381,
4672,
3536,
1124,
6527,
326,
29772,
628,
8620,
364,
8515,
3536,
400,
273,
365,
6315,
588,
1952,
1429,
734,
12,
... |
(not port and socket.gethostbyname(host) in self.get_names()): | (not port and _safe_gethostbyname(host) in self.get_names()): | def open_local_file(self, req): import email.utils import mimetypes host = req.get_host() filename = req.get_selector() localfile = url2pathname(filename) try: stats = os.stat(localfile) size = stats.st_size modified = email.utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(filename)[0] headers = mimetools.Message(StringIO( 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) if not host or \ (not port and socket.gethostbyname(host) in self.get_names()): if host: origurl = 'file://' + host + filename else: origurl = 'file://' + filename return addinfourl(open(localfile, 'rb'), headers, origurl) except OSError, msg: # urllib2 users shouldn't expect OSErrors coming from urlopen() raise URLError(msg) raise URLError('file not on local host') | e9cb22a70a157c8b73af579323d7900b3d5e9173 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/e9cb22a70a157c8b73af579323d7900b3d5e9173/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1930,
2699,
18,
5471,
1930,
20369,
15180,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
1544,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1930,
2699,
18,
5471,
1930,
20369,
15180,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
1544,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
7... |
n = self.param(0, args, 0) if n >= 0 and n < len(args): args.goto(n) else: raise FormatError("Index %d is out of bounds." % n) | args.goto(self.param(0, args, 0)) | def format(self, stream, args): if self.atsign: n = self.param(0, args, 0) if n >= 0 and n < len(args): args.goto(n) else: raise FormatError("Index %d is out of bounds." % n) else: for i in range(self.param(0, args, 1)): if self.colon: args.prev() else: args.next() | bbfff1c4b33054f1bbfa967821b6f00b4aa83f31 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2063/bbfff1c4b33054f1bbfa967821b6f00b4aa83f31/format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
1407,
16,
833,
4672,
309,
365,
18,
2323,
724,
30,
833,
18,
75,
6302,
12,
2890,
18,
891,
12,
20,
16,
833,
16,
374,
3719,
469,
30,
364,
277,
316,
1048,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
1407,
16,
833,
4672,
309,
365,
18,
2323,
724,
30,
833,
18,
75,
6302,
12,
2890,
18,
891,
12,
20,
16,
833,
16,
374,
3719,
469,
30,
364,
277,
316,
1048,
12,
2890,
... |
if pipe[0][1] == 'i': | if pipe[0][1] == 'i' and self.trans.endpt != 0: | def parse(self, line, timestamp=None, frame=None): self.lineNumber += 1 tokens = line.split() try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d:" % self.lineNumber return | 9d4f56f70ef56f49c13b983dfed59f2331839b43 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6119/9d4f56f70ef56f49c13b983dfed59f2331839b43/Log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
980,
16,
2858,
33,
7036,
16,
2623,
33,
7036,
4672,
365,
18,
1369,
1854,
1011,
404,
2430,
273,
980,
18,
4939,
1435,
775,
30,
468,
2256,
279,
5264,
384,
416,
350,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
980,
16,
2858,
33,
7036,
16,
2623,
33,
7036,
4672,
365,
18,
1369,
1854,
1011,
404,
2430,
273,
980,
18,
4939,
1435,
775,
30,
468,
2256,
279,
5264,
384,
416,
350,
1... |
util.fix_up_logger(_logger) | def get_logger(): return _logger | 4f5e7ecad4a7f670e4cc954b363ab891a11a900d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/4f5e7ecad4a7f670e4cc954b363ab891a11a900d/mp_distributing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4901,
13332,
327,
389,
4901,
225,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4901,
13332,
327,
389,
4901,
225,
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... | |
cmd = base + "adp.convert_to_iso=true selection='%s'"%str(selection_str) | cmd = base + 'adp.convert_to_iso=true selection="%s"'%str(selection_str) | def run(file_name = "phe_e.pdb"): file_name = libtbx.env.find_in_repositories( relative_path="phenix_regression/pdb/%s"%file_name, test=os.path.isfile) output = "modified.pdb" xrsp_init = xray_structure_plus(file_name = file_name) base = \ "mmtbx.pdbtools %s output.pdb.file_name=%s --quiet "%(file_name, output) for selection_str in [None, "chain A or chain C"]: selection = xrsp_init.selection(selection_strings = selection_str) if(selection_str is None): assert selection.size() == selection.count(True) else: assert selection.size() == 36 and selection.count(True) == 24 # cmd = base + "adp.randomize=true selection='%s'"%str(selection_str) check_adp_rand(cmd, xrsp_init, output, selection, selection_str) # cmd = base + "adp.set_b_iso=10.0 selection='%s'"%str(selection_str) check_adp_set_b_iso(cmd, xrsp_init, output, selection, selection_str) # cmd = base + "adp.shift_b_iso=20.0 selection='%s'"%str(selection_str) check_adp_rand(cmd, xrsp_init, output, selection, selection_str) # cmd = base + "adp.scale_adp=2.0 selection='%s'"%str(selection_str) check_adp_rand(cmd, xrsp_init, output, selection, selection_str) # cmd = base + "adp.convert_to_iso=true selection='%s'"%str(selection_str) check_adp_to_iso(cmd, xrsp_init, output, selection, selection_str) # cmd = base + "adp.convert_to_aniso=true selection='%s'"%str(selection_str) check_adp_to_aniso(cmd, xrsp_init, output, selection, selection_str) # shake = 1.5 cmd = base+"sites.shake=%s selection='%s'"%(str(shake), str(selection_str)) check_sites_shake(cmd, xrsp_init, output, selection, selection_str, shake) # cmd = base+"sites.rotate='1 2 3' sites.translate='4 5 6' selection='%s'"%( str(selection_str)) check_sites_rt(cmd, xrsp_init, output, selection, selection_str) # cmd = base+"occupancies.randomize=true selection='%s'"%(str(selection_str)) check_occ_randomize(cmd, xrsp_init, output, selection, selection_str) # remove_selection_str = "element C" cmd = base+"remove.selection='%s' selection='%s'"%( str(remove_selection_str),str(selection_str)) check_remove_selection(cmd, xrsp_init, output, selection, selection_str, remove_selection_str) # test_quiet(file_name) # cmd = base check_all_none(cmd, xrsp_init, output) | d3b962327f9bfcab4633f0d80f058ec29ecde30b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/d3b962327f9bfcab4633f0d80f058ec29ecde30b/tst_pdbtools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
768,
67,
529,
273,
315,
84,
580,
67,
73,
18,
17414,
6,
4672,
585,
67,
529,
273,
2561,
18587,
92,
18,
3074,
18,
4720,
67,
267,
67,
26626,
12,
3632,
67,
803,
1546,
13819,
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,
1086,
12,
768,
67,
529,
273,
315,
84,
580,
67,
73,
18,
17414,
6,
4672,
585,
67,
529,
273,
2561,
18587,
92,
18,
3074,
18,
4720,
67,
267,
67,
26626,
12,
3632,
67,
803,
1546,
13819,
6... |
WordMorphism: a->ab, b->b WordMorphism: a->ba, b->a WordMorphism: a->ba, b->b | Iterator over all morphisms including erasing morphisms:: sage: W = Words('ab') sage: it = W.iter_morphisms(min_length=0) sage: for _ in range(7): print it.next() WordMorphism: a->, b-> WordMorphism: a->a, b-> WordMorphism: a->b, b-> WordMorphism: a->, b->a WordMorphism: a->, b->b WordMorphism: a->aa, b-> WordMorphism: a->ab, b-> | def iter_morphisms(self, l=None, codomain=None): r""" Returns an iterator over all non erasing morphisms or over all morphisms `\varphi` such that `|\varphi| = l` when ``l`` is given. | e3481015e87ea68f3611f2348ae5c8955e98e96a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/e3481015e87ea68f3611f2348ae5c8955e98e96a/words.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
81,
7657,
23749,
12,
2890,
16,
328,
33,
7036,
16,
11012,
1530,
33,
7036,
4672,
436,
8395,
2860,
392,
2775,
1879,
777,
1661,
6445,
11730,
14354,
23749,
578,
1879,
777,
14354,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
81,
7657,
23749,
12,
2890,
16,
328,
33,
7036,
16,
11012,
1530,
33,
7036,
4672,
436,
8395,
2860,
392,
2775,
1879,
777,
1661,
6445,
11730,
14354,
23749,
578,
1879,
777,
14354,
23... |
if modulepath.endswith(".py"): modulepath = modulepath[:-2] + "pyc" try: os.remove(modulepath) except OSError: pass | def root(): modulepath = unicode(__file__) miscfolder = os.path.dirname(modulepath) toolfolder = os.path.dirname(miscfolder) root = os.path.abspath(toolfolder) # Try to remove bytecode if modulepath.endswith(".py"): modulepath = modulepath[:-2] + "pyc" try: os.remove(modulepath) except OSError: pass return root | 3318a16c780acc644a855037defce9cc213732b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/3318a16c780acc644a855037defce9cc213732b2/filetool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1365,
13332,
1605,
803,
273,
5252,
12,
972,
768,
972,
13,
225,
20448,
5609,
273,
1140,
18,
803,
18,
12287,
12,
2978,
803,
13,
5226,
5609,
273,
1140,
18,
803,
18,
12287,
12,
23667,
5609... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1365,
13332,
1605,
803,
273,
5252,
12,
972,
768,
972,
13,
225,
20448,
5609,
273,
1140,
18,
803,
18,
12287,
12,
2978,
803,
13,
5226,
5609,
273,
1140,
18,
803,
18,
12287,
12,
23667,
5609... | |
go(' n := %d', fixedtotal) | go(' n := %d', fixedsize) | def go_complex_writer(self, name, void): func_name = self.c_request_name param_fields = [] wire_fields = [] for field in self.fields: if field.visible: # _len is taken from the list directly if not field.field_name.endswith("_len"): # The field should appear as a call parameter param_fields.append(field) if field.wire and not field.auto: # We need to set the field up in the structure wire_fields.append(field) if void: go('func (c *Conn) %s(', func_name) go_complex_writer_arguments(param_fields, "{") else: go('func (c *Conn) %sRequest(', func_name) go_complex_writer_arguments(param_fields, "Cookie {") fixedtotal = structsize(self.fields) if fixedtotal <= 32: go(' b := c.scratch[0:%d]', fixedtotal) else: go(' b := make([]byte, %d)', fixedtotal) firstvar = 0 for field in wire_fields: if not field.type.fixed_size(): if not firstvar: firstvar = 1 go(' n := %d', fixedtotal) go(' n += pad(%s * %d)', go_accessor_expr(field.type.expr, '', True), field.type.size) if not firstvar: go(' put16(b[2:], %d)', fixedtotal / 4) else: go(' put16(b[2:], uint16(n / 4))') go(' b[0] = %s', self.opcode) go_complex_writer_help(wire_fields) if not void: if firstvar: go(' cookie := c.sendRequest(b)') else: go(' return c.sendRequest(b)') else: go(' c.sendRequest(b)') # send extra data for field in param_fields: if not field.type.fixed_size(): if field.type.is_list: fieldname = field.c_field_name lenstr = go_accessor_expr(field.type.expr, '', True) if t(field.field_type) == 'byte': if fieldname == 'Name': go(' c.sendString(%s)', fieldname) else: go(' c.sendBytes(%s[0:%s])', fieldname, lenstr) elif t(field.field_type) == 'uint32': go(' c.sendUInt32List(%s[0:%s])', fieldname, lenstr) else: go(' c.send%sList(%s, %s)', t(field.field_type), fieldname, lenstr) if not void and firstvar: go(' return cookie') go('}') go('') if not void: args = go_complex_writer_arguments_names(param_fields) go('func (c *Conn) %s(', func_name) go_complex_writer_arguments(param_fields, '(*%s, os.Error) {' % self.c_reply_type) go(' return c.%sReply(c.%sRequest(%s))', func_name, func_name, args) go('}') go('') | 6b8f7f80f3b8b1415c5593512018b3fc78720d61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5761/6b8f7f80f3b8b1415c5593512018b3fc78720d61/go_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
67,
14259,
67,
6299,
12,
2890,
16,
508,
16,
918,
4672,
1326,
67,
529,
273,
365,
18,
71,
67,
2293,
67,
529,
225,
579,
67,
2821,
273,
5378,
6636,
67,
2821,
273,
5378,
364,
652,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
67,
14259,
67,
6299,
12,
2890,
16,
508,
16,
918,
4672,
1326,
67,
529,
273,
365,
18,
71,
67,
2293,
67,
529,
225,
579,
67,
2821,
273,
5378,
6636,
67,
2821,
273,
5378,
364,
652,
... |
utils.logger.info( 'running query: %s' % str( matcher ) ) | utils.logger.debug( 'running query: %s' % str( matcher ) ) | def __create_matcher( self, match_class, **keywds ): matcher_args = keywds.copy() del matcher_args['function'] del matcher_args['recursive'] if matcher_args.has_key('allow_empty'): del matcher_args['allow_empty'] | 420149f2642ab48ea7ca588594f35e1e04160a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7398/420149f2642ab48ea7ca588594f35e1e04160a38/scopedef.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
67,
22761,
12,
365,
16,
845,
67,
1106,
16,
2826,
856,
91,
2377,
262,
30,
4546,
67,
1968,
273,
498,
91,
2377,
18,
3530,
1435,
1464,
4546,
67,
1968,
3292,
915,
3546,
1464,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
67,
22761,
12,
365,
16,
845,
67,
1106,
16,
2826,
856,
91,
2377,
262,
30,
4546,
67,
1968,
273,
498,
91,
2377,
18,
3530,
1435,
1464,
4546,
67,
1968,
3292,
915,
3546,
1464,
... |
self.color_active = False | def __init__(self, requester, config, logger=None): | 59b6cac24186b5b656a12ffea9d207ff3c9be0ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/59b6cac24186b5b656a12ffea9d207ff3c9be0ea/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
19961,
16,
642,
16,
1194,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
19961,
16,
642,
16,
1194,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
def RunDispatcherHandler(dispatcher, handler): """Handles a single event for an asyncore.dispatcher. | def HandleXmppSocket(fd, socket_map, handler): """Runs the handler for the xmpp connection for fd. | def RunDispatcherHandler(dispatcher, handler): """Handles a single event for an asyncore.dispatcher. | 5b1bf077a7b9ec15911dce368946ffaee00746a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5b1bf077a7b9ec15911dce368946ffaee00746a3/testserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
6681,
1503,
12,
18495,
16,
1838,
4672,
3536,
8788,
279,
2202,
871,
364,
392,
4326,
479,
18,
18495,
18,
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,
1939,
6681,
1503,
12,
18495,
16,
1838,
4672,
3536,
8788,
279,
2202,
871,
364,
392,
4326,
479,
18,
18495,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return '<%s: %s>' % (self.__class__.__name__, _spacejoin(L)) | return '<%s: %s>' % (self.__class__.__name__, _semispacejoin(L)) | def __repr__(self): L = [] items = self.items() items.sort() for K,V in items: L.append( '%s=%s' % (K,repr(V.value) ) ) return '<%s: %s>' % (self.__class__.__name__, _spacejoin(L)) | a5884e244756452a6c5bd600142d210ac0099052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a5884e244756452a6c5bd600142d210ac0099052/Cookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
511,
273,
5378,
1516,
273,
365,
18,
3319,
1435,
1516,
18,
3804,
1435,
364,
1475,
16,
58,
316,
1516,
30,
511,
18,
6923,
12,
1995,
87,
5095,
87,
11,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
511,
273,
5378,
1516,
273,
365,
18,
3319,
1435,
1516,
18,
3804,
1435,
364,
1475,
16,
58,
316,
1516,
30,
511,
18,
6923,
12,
1995,
87,
5095,
87,
11,
7... |
self.dtpPort = tcp.Client(self.peerhost, self.peerport, self.buildProtocol(self.peerport)) | self.dtp = self.buildProtocol(self.peerport) self.dtpPort = tcp.Client(self.peerhost, self.peerport, self.dtp) | def createActiveServer(self): # silly code repeating if self.dtp is not None: if self.dtp.transport is not None: self.dtp.transport.loseConnection() self.dtp = None self.dtpPort = tcp.Client(self.peerhost, self.peerport, self.buildProtocol(self.peerport)) self.dtp.transport = self.dtpPort | 07377cad2b39b3e3d459447a924d1bc82ce72f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07377cad2b39b3e3d459447a924d1bc82ce72f33/ftp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
3896,
2081,
12,
2890,
4672,
468,
17714,
715,
981,
30571,
309,
365,
18,
72,
6834,
353,
486,
599,
30,
309,
365,
18,
72,
6834,
18,
13049,
353,
486,
599,
30,
365,
18,
72,
6834,
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,
752,
3896,
2081,
12,
2890,
4672,
468,
17714,
715,
981,
30571,
309,
365,
18,
72,
6834,
353,
486,
599,
30,
309,
365,
18,
72,
6834,
18,
13049,
353,
486,
599,
30,
365,
18,
72,
6834,
18,
... |
nc = netCDF3.Dataset(makefp(now)) | nc = netCDF3.Dataset(make_fp(now)) | def doday(ts): """ Create a plot of precipitation stage4 estimates for some day """ # First possible file we are interested in.... sts = ts + mx.DateTime.RelativeDateTime(hour=1, minute=0) # Last possible file, base 5 ets = ts - mx.DateTime.RelativeDateTime(minutes= (ts.minute%5)) now = ets total = None lts = None lons = numpy.arange(-110., -89.99, 0.01) lats = numpy.arange(55.0, 39.99, -0.01) ncvar = "rad_hsr_1h" divisor = 1.0 interval = mx.DateTime.RelativeDateTime(minutes=5) while now > sts: if os.path.isfile(makefp(now)): if lts is None: lts = now if now.minute == 0: ncvar = "rad_hsr_1h" divisor = 1.0 interval = mx.DateTime.RelativeDateTime(hours=1) else: ncvar = "preciprate_hsr" divisor = 12.0 #print "USING %s NCVAR %s DIVISOR %s" % (makefp(now), # ncvar, divisor) nc = netCDF3.Dataset(makefp(now)) val = nc.variables[ncvar][:] / divisor if total is None: total = numpy.where(val > 0, val, 0) else: total += numpy.where( val > 0, val, 0) nc.close() now -= interval if total is None: return # Set some bogus values to keep from complaining about all zeros? total[10:20,10:20] = 20. # Now we dance cfg = { 'cnLevelSelectionMode': "ExplicitLevels", 'cnLevels' : [0.01,0.1,0.25,0.5,0.75,1,1.5,2,3,4,5,8,10,15,20], 'wkColorMap': 'BlAqGrYeOrRe', 'nglSpreadColorStart': -1, 'nglSpreadColorEnd' : 2, '_MaskZero' : True, 'lbTitleString' : "[inch]", '_valid' : 'Total up to %s' % ( (lts - mx.DateTime.RelativeDateTime(minutes=1)).strftime("%d %B %Y %I:%M %p %Z"),), '_title' : "NMQ Q2 Today's Precipitation [inch]", } # Scale factor is 10 tmpfp = iemplot.simple_grid_fill(lons, lats, total / 254.0, cfg) pqstr = "plot ac %s00 iowa_q2_1d.png iowa_q2_1d.png png" % ( ts.strftime("%Y%m%d%H"), ) iemplot.postprocess(tmpfp, pqstr) | 7d9ce7d36ea21a62c3c396b9c15d9fbd76009b46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11189/7d9ce7d36ea21a62c3c396b9c15d9fbd76009b46/q2_today_total.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
20136,
12,
3428,
4672,
3536,
1788,
279,
3207,
434,
675,
3449,
8773,
6009,
24,
27585,
364,
2690,
2548,
3536,
468,
5783,
3323,
585,
732,
854,
20506,
316,
6265,
27099,
273,
3742,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
20136,
12,
3428,
4672,
3536,
1788,
279,
3207,
434,
675,
3449,
8773,
6009,
24,
27585,
364,
2690,
2548,
3536,
468,
5783,
3323,
585,
732,
854,
20506,
316,
6265,
27099,
273,
3742,
397,
... |
else | else: | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 722) else quickfix.IntField.__init__(self, 722, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
3787,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
3787,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
27... |
'account_analytic_id': ol.account_analytic_id.id, | 'account_analytic_id': ol.account_analytic_id.id or False, | def inv_line_create(self, cr, uid, a, ol): return (0, False, { 'name': ol.name, 'account_id': a, 'price_unit': ol.price_unit or 0.0, 'quantity': ol.product_qty, 'product_id': ol.product_id.id or False, 'uos_id': ol.product_uom.id or False, 'invoice_line_tax_id': [(6, 0, [x.id for x in ol.taxes_id])], 'account_analytic_id': ol.account_analytic_id.id, }) | 4054773cc71ad9fda46b578cf7362877537be12e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4054773cc71ad9fda46b578cf7362877537be12e/purchase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2198,
67,
1369,
67,
2640,
12,
2890,
16,
4422,
16,
4555,
16,
279,
16,
8793,
4672,
327,
261,
20,
16,
1083,
16,
288,
296,
529,
4278,
8793,
18,
529,
16,
296,
4631,
67,
350,
4278,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2198,
67,
1369,
67,
2640,
12,
2890,
16,
4422,
16,
4555,
16,
279,
16,
8793,
4672,
327,
261,
20,
16,
1083,
16,
288,
296,
529,
4278,
8793,
18,
529,
16,
296,
4631,
67,
350,
4278,
279,
... |
self.body.append(self.defs['option_list'][1]) | self.dedent() | def depart_option_list(self, node): self.body.append(self.defs['option_list'][1]) | 2e86202953f5508878f482543956d988e25d6f8f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1278/2e86202953f5508878f482543956d988e25d6f8f/manpage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
3482,
67,
1098,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
12537,
3292,
3482,
67,
1098,
3546,
63,
21,
5717,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
3482,
67,
1098,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
12537,
3292,
3482,
67,
1098,
3546,
63,
21,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.assertEquals(set(['rospack', 'roslib', 'std_msgs', 'rosgraph_msgs', 'roslang']), set(rospack_depends('rospy'))) | self.assertEquals(set(['rospack', 'roslib', 'std_msgs', 'rosgraph_msgs', 'roslang', 'rosbuild']), set(rospack_depends('rospy'))) | def test_rospack(self): from roslib.rospack import rospackexec, rospack_depends, rospack_depends_1,\ rospack_depends_on, rospack_depends_on_1 val = rospackexec(['list']) self.assertEquals(set(['rospack']), set(rospack_depends('roslib'))) self.assertEquals(set(['rospack']), set(rospack_depends_1('roslib'))) self.assertEquals(set(['roslib', 'roslang', 'std_msgs', 'rosgraph_msgs']), set(rospack_depends_1('rospy'))) self.assertEquals(set(['rospack', 'roslib', 'std_msgs', 'rosgraph_msgs', 'roslang']), set(rospack_depends('rospy'))) | 406d991e943a2f41f0fc2a9b8a9477e751051c89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10596/406d991e943a2f41f0fc2a9b8a9477e751051c89/test_roslib_rospack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
303,
1752,
484,
12,
2890,
4672,
628,
721,
24760,
18,
303,
1752,
484,
1930,
721,
1752,
484,
4177,
16,
721,
1752,
484,
67,
27360,
16,
721,
1752,
484,
67,
27360,
67,
21,
17211,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
303,
1752,
484,
12,
2890,
4672,
628,
721,
24760,
18,
303,
1752,
484,
1930,
721,
1752,
484,
4177,
16,
721,
1752,
484,
67,
27360,
16,
721,
1752,
484,
67,
27360,
67,
21,
17211,
... |
def _company_default_get(self, cr, uid, object=False, context=None): | def _company_default_get(self, cr, uid, object=False, field=False, context=None): | def _company_default_get(self, cr, uid, object=False, context=None): """ Check if the object for this company have a default value """ if not context: context = {} proxy = self.pool.get('multi_company.default') ids = proxy.search(cr, uid, [('object_id.model', '=', object)]) for rule in proxy.browse(cr, uid, ids, context): user = self.pool.get('res.users').browse(cr, uid, uid) if eval(rule.expression, {'context': context, 'user': user}): return rule.company_dest_id.id return self.pool.get('res.users').browse(cr, uid, uid).company_id.id | b8e9dad4931ed75770ee1998448b34dc1818eadf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/b8e9dad4931ed75770ee1998448b34dc1818eadf/res_company.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16840,
67,
1886,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
733,
33,
8381,
16,
652,
33,
8381,
16,
819,
33,
7036,
4672,
3536,
2073,
309,
326,
733,
364,
333,
9395,
1240,
279,
805,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16840,
67,
1886,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
733,
33,
8381,
16,
652,
33,
8381,
16,
819,
33,
7036,
4672,
3536,
2073,
309,
326,
733,
364,
333,
9395,
1240,
279,
805,... |
item = wolfpack.additem(str(arguments[0])) if target.item: if target.item.type == 1: target.item.additem(item, 1, 1, 0) elif target.item.container: target.item.container.additem(item, 1, 1, 0) else: item.moveto(target.item.pos) elif target.char: item.moveto(target.char.pos) else: item.moveto(target.pos) item.update() | item = wolfpack.additem(str(arguments[0])) if target.item: if target.item.type == 1: target.item.additem(item, 1, 1, 0) elif target.item.container: target.item.container.additem(item, 1, 1, 0) else: item.moveto(target.item.pos) elif target.char: item.moveto(target.char.pos) else: item.moveto(target.pos) item.update() | def additem(player, arguments, target): item = wolfpack.additem(str(arguments[0])) if target.item: if target.item.type == 1: target.item.additem(item, 1, 1, 0) elif target.item.container: target.item.container.additem(item, 1, 1, 0) else: item.moveto(target.item.pos) elif target.char: item.moveto(target.char.pos) else: item.moveto(target.pos) item.update() | 626fa489ecaf272e77099cb6a1429cfb12d020c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/626fa489ecaf272e77099cb6a1429cfb12d020c8/add.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
1726,
12,
14872,
16,
1775,
16,
1018,
4672,
761,
273,
341,
355,
74,
2920,
18,
1289,
1726,
12,
701,
12,
7099,
63,
20,
22643,
309,
1018,
18,
1726,
30,
309,
1018,
18,
1726,
18,
723,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1726,
12,
14872,
16,
1775,
16,
1018,
4672,
761,
273,
341,
355,
74,
2920,
18,
1289,
1726,
12,
701,
12,
7099,
63,
20,
22643,
309,
1018,
18,
1726,
30,
309,
1018,
18,
1726,
18,
723,... |
if os.system("%s-config --version &>/dev/null" % name) == 0: | if os.system("pkg-config %s --exists &>/dev/null" % name) == 0: command = "pkg-config %s %%s 2>/dev/null" % name if minver: if not os.system(command % '--atleast-version %s' % minver) == 0: err= 'requires %s version %s' % (name, minver) raise ValueError, err elif os.system("%s-config --version &>/dev/null" % name) == 0: | def check_library(self, name, minver): """ Check dependencies add add the flags to include_dirs, library_dirs and libraries. The basic logic is taken from pygame. """ try: if os.system("%s-config --version &>/dev/null" % name) == 0: # Use foo-config if it exists. command = "%s-config %%s 2>/dev/null" % name version_arg = "--version" elif os.system("pkg-config %s --exists &>/dev/null" % name) == 0: # Otherwise try pkg-config foo. command = "pkg-config %s %%s 2>/dev/null" % name version_arg = "--modversion" else: raise Exception, "not found" | 081fd338dac312d4e4838eecc7c77dfb5661dba8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/081fd338dac312d4e4838eecc7c77dfb5661dba8/distribution.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
12083,
12,
2890,
16,
508,
16,
1131,
502,
4672,
3536,
2073,
5030,
527,
527,
326,
2943,
358,
2341,
67,
8291,
16,
5313,
67,
8291,
471,
14732,
18,
1021,
5337,
4058,
353,
9830,
628... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
12083,
12,
2890,
16,
508,
16,
1131,
502,
4672,
3536,
2073,
5030,
527,
527,
326,
2943,
358,
2341,
67,
8291,
16,
5313,
67,
8291,
471,
14732,
18,
1021,
5337,
4058,
353,
9830,
628... |
params = {} | params = [] | def __unicode__(self): """Produces a static map image url. | d78f8ed791d45e21c4b9eb0aea4988f86dd8a8e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8231/d78f8ed791d45e21c4b9eb0aea4988f86dd8a8e8/maps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
972,
12,
2890,
4672,
3536,
27291,
279,
760,
852,
1316,
880,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
972,
12,
2890,
4672,
3536,
27291,
279,
760,
852,
1316,
880,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
maxima(cmd) | maxima.eval(cmd) | def desolve_system(des,vars,ics=None): """ Solves any size system of 1st order odes using maxima. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["t","x","y"], where t is the independent variable and x,y the dependent variables) ics -- a list of numbers representing initial conditions (eg, x(0)=1, y(0)=2 is ics = [0,1,2]) WARNING: The given ics sets the initial values of the dependent vars in maxima, so subsequent ODEs involving these variables will have these initial conditions automatically imposed. EXAMPLES: sage: from sage.calculus.desolvers import desolve_system sage: t = var('t') sage: x = function('x', t) sage: y = function('y', t) sage: de1 = lambda z: diff(z[0],t) + z[1] - 1 sage: de2 = lambda z: diff(z[1],t) - z[0] + 1 sage: des = [de1([x(t),y(t)]),de2([x(t),y(t)])] sage: vars = ["t","x","y"] sage: desolve_system(des,vars) ['(1-y(0))*sin(t)+(x(0)-1)*cos(t)+1', '(x(0)-1)*sin(t)+(y(0)-1)*cos(t)+1'] sage: ics = [0,1,-1] sage: soln = desolve_system(des,vars,ics); soln ['2*sin(t)+1', '1-2*cos(t)'] sage: solnx = lambda s: RR(eval(soln[0].replace("t","s"))) sage: solnx(3) 1.28224001611973 sage: solny = lambda s: RR(eval(soln[1].replace("t","s"))) sage: P1 = plot([solnx,solny],0,1) sage: P2 = parametric_plot((solnx,solny),0,1) Now type show(P1), show(P2) to view these. AUTHOR: David Joyner (3-2006, 8-2007) """ d = len(des) dess = [de._repr_() + "=0" for de in des] for i in range(d): cmd="de:" + dess[int(i)] + ";" maxima(cmd) desstr = "[" + ",".join(dess) + "]" d = len(vars) varss = list(vars[i] + "(" + vars[0] + ")" for i in range(1,d)) varstr = "[" + ",".join(varss) + "]" if ics!=None: #d = len(ics) ## must be same as len(des) for i in range(1,d): ic = "atvalue(" + vars[int(i)] + "("+vars[0] + ")," + str(vars[0]) + "=" + str(ics[0]) + "," + str(ics[int(i)]) + ")" maxima(ic) cmd = "desolve(" + desstr + "," + varstr + ");" soln = maxima(cmd) return [f.rhs()._maxima_init_() for f in soln] | 0c81ba55ecde6002d7e26a1d317db6f481426f55 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0c81ba55ecde6002d7e26a1d317db6f481426f55/desolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2832,
5390,
67,
4299,
12,
5489,
16,
4699,
16,
2102,
33,
7036,
4672,
3536,
348,
355,
3324,
1281,
963,
2619,
434,
404,
334,
1353,
320,
5489,
1450,
943,
13888,
18,
10188,
87,
4636,
854,
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,
2832,
5390,
67,
4299,
12,
5489,
16,
4699,
16,
2102,
33,
7036,
4672,
3536,
348,
355,
3324,
1281,
963,
2619,
434,
404,
334,
1353,
320,
5489,
1450,
943,
13888,
18,
10188,
87,
4636,
854,
3... |
break | break | def price_get_old(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' price = False item_id = 0 context = context or {} currency_obj = self.pool.get('res.currency') product_obj = self.pool.get('product.product') supplierinfo_obj = self.pool.get('product.supplierinfo') price_type_obj = self.pool.get('product.price.type') | 94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94fb037ba42700d5d1fedf44ce1aeaa61c6ad90a/pricelist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6205,
67,
588,
67,
1673,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10791,
67,
350,
16,
26667,
16,
19170,
33,
7036,
16,
819,
33,
7036,
4672,
9163,
819,
273,
288,
296,
89,
362,
4278,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6205,
67,
588,
67,
1673,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10791,
67,
350,
16,
26667,
16,
19170,
33,
7036,
16,
819,
33,
7036,
4672,
9163,
819,
273,
288,
296,
89,
362,
4278,... |
print("Checked for running processes. %s processes currently running, "%len(processes) + | print("Checked for running processes. %s processes currently running, "%count + | def checkMultiplicity(self): processes = {} my_pid = 1 count = 0 try: f = open('throttle.log','r') except IOError: if not self.pid: pass else: raise else: now = time.time() for line in f.readlines(): line = line.split(' ') pid = int(line[0]) ptime = int(line[1].split('.')[0]) if now - ptime <= self.releasepid: if now - ptime <= self.dropdelay and pid != self.pid: count += 1 processes[pid] = ptime if pid >= my_pid: my_pid = pid+1 if not self.pid: self.pid = my_pid self.checktime = time.time() processes[self.pid] = self.checktime f = open('throttle.log','w') for p in processes.keys(): f.write(str(p)+' '+str(processes[p])+'\n') f.close() self.process_multiplicity = count print("Checked for running processes. %s processes currently running, "%len(processes) + "including the current process.") | 19046c3dd0a7ba189e183a0bc8627c1264ccb688 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/19046c3dd0a7ba189e183a0bc8627c1264ccb688/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
5002,
20458,
12,
2890,
4672,
8488,
273,
2618,
3399,
67,
6610,
273,
404,
1056,
273,
374,
775,
30,
284,
273,
1696,
2668,
27971,
298,
18,
1330,
17023,
86,
6134,
1335,
8340,
30,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
5002,
20458,
12,
2890,
4672,
8488,
273,
2618,
3399,
67,
6610,
273,
404,
1056,
273,
374,
775,
30,
284,
273,
1696,
2668,
27971,
298,
18,
1330,
17023,
86,
6134,
1335,
8340,
30,
309,
... |
resource, maxfixes=maxfixes) | resource, maxfixes) | def show_doc(self): self._check_project() resource, offset = self._get_location() maxfixes = lisp['ropemacs-codeassist-maxfixes'].value() docs = codeassist.get_doc(self.project, self._get_text(), offset, resource, maxfixes=maxfixes) buffer = lisputils.make_buffer('*rope-pydoc*', docs, empty_goto=False) lisp.local_set_key('q', lisp.bury_buffer) | 49d38035696379747d5f51e834c408014f3c4878 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8283/49d38035696379747d5f51e834c408014f3c4878/interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
2434,
12,
2890,
4672,
365,
6315,
1893,
67,
4406,
1435,
1058,
16,
1384,
273,
365,
6315,
588,
67,
3562,
1435,
943,
904,
281,
273,
328,
23831,
3292,
303,
347,
5821,
87,
17,
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,
2405,
67,
2434,
12,
2890,
4672,
365,
6315,
1893,
67,
4406,
1435,
1058,
16,
1384,
273,
365,
6315,
588,
67,
3562,
1435,
943,
904,
281,
273,
328,
23831,
3292,
303,
347,
5821,
87,
17,
710,... |
xPoly = [coeff[k,0] for k in range(4)] | xPoly = [coeff[k,0] for k in range(coeff.width())] | def findZeroCrossingsOnGrid(siv): result = [] # FIXME: why is the order of those loops important?!? for y in range(siv.height()-1): for x in range(siv.width()-1): coeff = siv.coefficients(x, y) xPoly = [coeff[k,0] for k in range(4)] try: for k in polynomialRealRoots(xPoly): if k < 0.0 or k >= 1.0: continue result.append(Vector2(x+k, y)) except Exception, e: sys.stderr.write("WARNING: no convergence in polynomialRealRoots(%s):\n %s\n" % (xPoly, e)) yPoly = [coeff[0,k] for k in range(4)] try: for k in polynomialRealRoots(yPoly): if k < 0.0 or k >= 1.0: continue result.append(Vector2(x, y+k)) except Exception, e: sys.stderr.write("WARNING: no convergence in polynomialRealRoots(%s):\n %s\n" % (yPoly, e)) return result | 06f56e130542a1c91cca5aded8b43db966347318 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/06f56e130542a1c91cca5aded8b43db966347318/levelcontours.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
7170,
13941,
899,
1398,
6313,
12,
87,
427,
4672,
563,
273,
5378,
468,
9852,
30,
11598,
353,
326,
1353,
434,
5348,
14075,
10802,
35,
5,
35,
364,
677,
316,
1048,
12,
87,
427,
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,
1104,
7170,
13941,
899,
1398,
6313,
12,
87,
427,
4672,
563,
273,
5378,
468,
9852,
30,
11598,
353,
326,
1353,
434,
5348,
14075,
10802,
35,
5,
35,
364,
677,
316,
1048,
12,
87,
427,
18,
... |
super(Server, self).__init__( | super(BatchingServer, self).__init__( | def __init__(self, server, metadata_registry=None, resumption_batch_size=10): super(Server, self).__init__( BatchingResumption(server, resumption_batch_size), metadata_registry) | fe65e555244284303829802d4ad635e638c2eeb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14690/fe65e555244284303829802d4ad635e638c2eeb2/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1438,
16,
1982,
67,
9893,
33,
7036,
16,
24632,
375,
67,
5303,
67,
1467,
33,
2163,
4672,
2240,
12,
4497,
310,
2081,
16,
365,
2934,
972,
2738,
972,
12,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1438,
16,
1982,
67,
9893,
33,
7036,
16,
24632,
375,
67,
5303,
67,
1467,
33,
2163,
4672,
2240,
12,
4497,
310,
2081,
16,
365,
2934,
972,
2738,
972,
12,
5... |
if lastcs is not None: if nextcs is None or nextcs == 'us-ascii': | if lastcs not in (None, 'us-ascii'): if nextcs in (None, 'us-ascii'): | def __unicode__(self): """Helper for the built-in unicode function.""" uchunks = [] lastcs = None for s, charset in self._chunks: # We must preserve spaces between encoded and non-encoded word # boundaries, which means for us we need to add a space when we go # from a charset to None/us-ascii, or from None/us-ascii to a # charset. Only do this for the second and subsequent 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) | 6f45d7490a5353484118a8dc5593981ea43589fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6f45d7490a5353484118a8dc5593981ea43589fb/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,
582,
14691,
273,
5378,
1142,
2143,
273,
599,
364,
272,
16,
4856,
316,
365,
6315,
14691,
30,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
582,
14691,
273,
5378,
1142,
2143,
273,
599,
364,
272,
16,
4856,
316,
365,
6315,
14691,
30,
468,
... |
colWidths = "cm,".join(map(str, cols_widhts)) | colWidths = "cm,".join(map(tools.ustr, cols_widhts)) | def divide_list(lst, n): return [lst[i::n] for i in range(n)] | 359c4ac3c3deec88d37b44f93123f5d4ba02f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/359c4ac3c3deec88d37b44f93123f5d4ba02f3b3/survey_form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12326,
67,
1098,
12,
16923,
16,
290,
4672,
327,
306,
16923,
63,
77,
2866,
82,
65,
364,
277,
316,
1048,
12,
82,
25887,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12326,
67,
1098,
12,
16923,
16,
290,
4672,
327,
306,
16923,
63,
77,
2866,
82,
65,
364,
277,
316,
1048,
12,
82,
25887,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print 'Deleted breakpoint %s ' % (i,) | print 'Deleted breakpoint', i | def do_clear(self, arg): """Three possibilities, tried in this order: clear -> clear all breaks, ask for confirmation clear file:lineno -> clear all breaks at file:lineno clear bpno bpno ... -> clear breakpoints by number""" if not arg: try: reply = raw_input('Clear all breaks? ') except EOFError: reply = 'no' reply = reply.strip().lower() if reply in ('y', 'yes'): self.clear_all_breaks() return if ':' in arg: # Make sure it works for "clear C:\foo\bar.py:12" i = arg.rfind(':') filename = arg[:i] arg = arg[i+1:] try: lineno = int(arg) except: err = "Invalid line number (%s)" % arg else: err = self.clear_break(filename, lineno) if err: print '***', err return numberlist = arg.split() for i in numberlist: err = self.clear_bpbynumber(i) if err: print '***', err else: print 'Deleted breakpoint %s ' % (i,) | 6d2b346140ed0f3bc4c67fc33bf69a60c496e6a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6d2b346140ed0f3bc4c67fc33bf69a60c496e6a4/pdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
8507,
12,
2890,
16,
1501,
4672,
3536,
28019,
28550,
16,
12928,
316,
333,
1353,
30,
2424,
317,
2424,
777,
16217,
16,
6827,
364,
14296,
2424,
585,
30,
17782,
317,
2424,
777,
16217... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
8507,
12,
2890,
16,
1501,
4672,
3536,
28019,
28550,
16,
12928,
316,
333,
1353,
30,
2424,
317,
2424,
777,
16217,
16,
6827,
364,
14296,
2424,
585,
30,
17782,
317,
2424,
777,
16217... |
return '''<table bgcolor=" | return '''<table bgcolor=" | def htmlInst(i): if hasattr(i, "__html__"): s = i.__html__() else: s = '<code>'+html.escape(repr(i))+'</code>' return '''<table bgcolor="#cc7777"><tr><td><b>%s</b> instance</td></tr> <tr bgcolor="#ff9999"><td>%s</td></tr> </table> ''' % (i.__class__, s) | 21ae10c6f9b659c182ffdca9f0b1ac1ae00c9bf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/21ae10c6f9b659c182ffdca9f0b1ac1ae00c9bf0/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
10773,
12,
77,
4672,
309,
3859,
12,
77,
16,
10425,
2620,
14437,
4672,
272,
273,
277,
16186,
2620,
972,
1435,
469,
30,
272,
273,
2368,
710,
1870,
15,
2620,
18,
6939,
12,
12715,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
10773,
12,
77,
4672,
309,
3859,
12,
77,
16,
10425,
2620,
14437,
4672,
272,
273,
277,
16186,
2620,
972,
1435,
469,
30,
272,
273,
2368,
710,
1870,
15,
2620,
18,
6939,
12,
12715,
12... |
if passed_tests == total_tests: | if passed_tests + skipped_tests == total_tests: | def run_tests(): # # Run waf to make sure that everything is built, configured and ready to go # unless we are explicitly told not to. We want to be careful about causing # our users pain while waiting for extraneous stuff to compile and link, so # we allow users that know what they''re doing to not invoke waf at all. # if not options.nowaf: # # If the user is running the "kinds" or "list" options, there is an # implied dependency on the test-runner since we call that program # if those options are selected. We will exit after processing those # options, so if we see them, we can safely only build the test-runner. # # If the user has constrained us to running only a particular type of # file, we can only ask waf to build what we know will be necessary. # For example, if the user only wants to run BVT tests, we only have # to build the test-runner and can ignore all of the examples. # if options.kinds or options.list or (len(options.constrain) and options.constrain in core_kinds): proc = subprocess.Popen("./waf --target=test-runner", shell=True) else: proc = subprocess.Popen("./waf", shell=True) proc.communicate() # # Pull some interesting configuration information out of waf, primarily # so we can know where executables can be found, but also to tell us what # pieces of the system have been built. This will tell us what examples # are runnable. # read_waf_active_variant() read_waf_config() make_library_path() # # There are a couple of options that imply we can to exit before starting # up a bunch of threads and running tests. Let's detect these cases and # handle them without doing all of the hard work. # if options.kinds: (rc, standard_out, standard_err) = run_job_synchronously("utils/test-runner --kinds", os.getcwd(), False) print standard_out if options.list: (rc, standard_out, standard_err) = run_job_synchronously("utils/test-runner --list", os.getcwd(), False) print standard_out if options.kinds or options.list: return # # We communicate results in two ways. First, a simple message relating # PASS, FAIL, CRASH or SKIP is always written to the standard output. It # is expected that this will be one of the main use cases. A developer can # just run test.py with no options and see that all of the tests still # pass. # # The second main use case is when detailed status is requested (with the # --text or --html options). Typicall this will be text if a developer # finds a problem, or HTML for nightly builds. In these cases, an # XML file is written containing the status messages from the test suites. # This file is then read and translated into text or HTML. It is expected # that nobody will really be interested in the XML, so we write it to # somewhere in /tmp with a random name to avoid collisions. Just in case # some strange once-in-a-lifetime error occurs, we always write the info # so it can be found, we just may not use it. # # When we run examples as smoke tests, they are going to want to create # lots and lots of trace files. We aren't really interested in the contents # of the trace files, so we also just stash them off in /tmp somewhere. # if not os.path.exists(TMP_OUTPUT_DIR): os.makedirs(TMP_OUTPUT_DIR) if not os.path.exists(TMP_TRACES_DIR): os.makedirs(TMP_TRACES_DIR) # # Create the main output file and start filling it with XML. We need to # do this since the tests will just append individual results to this file. # xml_results_file = TMP_OUTPUT_DIR + "%d.xml" % random.randint(0, sys.maxint) f = open(xml_results_file, 'w') f.write('<?xml version="1.0"?>\n') f.write('<TestResults>\n') f.close() # # We need to figure out what test suites to execute. We are either given one # suite or example explicitly via the --suite or --example option, or we # need to call into the test runner and ask it to list all of the available # test suites. Further, we need to provide the constraint information if it # has been given to us. # # This translates into allowing the following options with respect to the # suites # # ./test,py: run all of the suites and examples # ./test.py --constrain=core: run all of the suites of all kinds # ./test.py --constrain=unit: run all unit suites # ./test,py --suite=some-test-suite: run a single suite # ./test,py --example=udp-echo: run no test suites # ./test,py --suite=some-suite --example=some-example: run the single suite # # We can also use the --constrain option to provide an ordering of test # execution quite easily. # if len(options.suite): suites = options.suite + "\n" elif len(options.example) == 0: if len(options.constrain): (rc, suites, standard_err) = run_job_synchronously("utils/test-runner --list --constrain=%s" % options.constrain, os.getcwd(), False) else: (rc, suites, standard_err) = run_job_synchronously("utils/test-runner --list", os.getcwd(), False) else: suites = "" # # suite_list will either a single test suite name that the user has # indicated she wants to run or a list of test suites provided by # the test-runner possibly according to user provided constraints. # We go through the trouble of setting up the parallel execution # even in the case of a single suite to avoid having two process the # results in two different places. # suite_list = suites.split('\n') # # We now have a possibly large number of test suites to run, so we want to # run them in parallel. We're going to spin up a number of worker threads # that will run our test jobs for us. # input_queue = Queue.Queue(0) output_queue = Queue.Queue(0) jobs = 0 threads=[] # # In Python 2.6 you can just use multiprocessing module, but we don't want # to introduce that dependency yet; so we jump through a few hoops. # processors = 1 if 'SC_NPROCESSORS_ONLN'in os.sysconf_names: processors = os.sysconf('SC_NPROCESSORS_ONLN') else: proc = subprocess.Popen("sysctl -n hw.ncpu", shell = True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout_results, stderr_results = proc.communicate() if len(stderr_results) == 0: processors = int(stdout_results) # # Now, spin up one thread per processor which will eventually mean one test # per processor running concurrently. # for i in range(processors): thread = worker_thread(input_queue, output_queue) threads.append(thread) thread.start() # # Keep track of some summary statistics # total_tests = 0 skipped_tests = 0 # # We now have worker threads spun up, and a list of work to do. So, run # through the list of test suites and dispatch a job to run each one. # # Dispatching will run with unlimited speed and the worker threads will # execute as fast as possible from the queue. # # Note that we actually dispatch tests to be skipped, so all of the # PASS, FAIL, CRASH and SKIP processing is done in the same place. # for test in suite_list: if len(test): job = Job() job.set_is_example(False) job.set_display_name(test) job.set_tmp_file_name(TMP_OUTPUT_DIR + "%d" % random.randint(0, sys.maxint)) job.set_cwd(os.getcwd()) job.set_basedir(os.getcwd()) if (options.multiple): multiple = " --multiple" else: multiple = "" job.set_shell_command("utils/test-runner --suite='%s'%s" % (test, multiple)) if options.valgrind and test in core_valgrind_skip_tests: job.set_is_skip(True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # We've taken care of the discovered or specified test suites. Now we # have to deal with examples run as smoke tests. We have a list of all of # the example programs it makes sense to try and run. Each example will # have a condition associated with it that must evaluate to true for us # to try and execute it. This is used to determine if the example has # a dependency that is not satisfied. For example, if an example depends # on NSC being configured by waf, that example should have a condition # that evaluates to true if NSC is enabled. For example, # # ("tcp-nsc-zoo", "ENABLE_NSC == True"), # # In this case, the example "tcp-nsc-zoo" will only be run if we find the # waf configuration variable "ENABLE_NSC" to be True. # # We don't care at all how the trace files come out, so we just write them # to a single temporary directory. # # XXX As it stands, all of the trace files have unique names, and so file # collisions can only happen if two instances of an example are running in # two versions of the test.py process concurrently. We may want to create # uniquely named temporary traces directories to avoid this problem. # # We need to figure out what examples to execute. We are either given one # suite or example explicitly via the --suite or --example option, or we # need to walk the list of examples looking for available example # conditions. # # This translates into allowing the following options with respect to the # suites # # ./test,py: run all of the examples # ./test.py --constrain=unit run no examples # ./test.py --constrain=example run all of the examples # ./test,py --suite=some-test-suite: run no examples # ./test,py --example=some-example: run the single example # ./test,py --suite=some-suite --example=some-example: run the single example # # XXX could use constrain to separate out examples used for performance # testing # if len(options.suite) == 0 and len(options.example) == 0: if len(options.constrain) == 0 or options.constrain == "example": if ENABLE_EXAMPLES: for test, do_run, do_valgrind_run in example_tests: if eval(do_run): job = Job() job.set_is_example(True) job.set_display_name(test) job.set_tmp_file_name("") job.set_cwd(TMP_TRACES_DIR) job.set_basedir(os.getcwd()) job.set_shell_command("examples/%s" % test) if options.valgrind and not eval(do_valgrind_run): job.set_is_skip (True) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 elif len(options.example): # # If you tell me to run an example, I will try and run the example # irrespective of any condition. # job = Job() job.set_is_example(True) job.set_display_name(options.example) job.set_tmp_file_name("") job.set_cwd(TMP_TRACES_DIR) job.set_basedir(os.getcwd()) job.set_shell_command("examples/%s" % options.example) if options.verbose: print "Queue %s" % test input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 # # Tell the worker threads to pack up and go home for the day. Each one # will exit when they see their is_break task. # for i in range(processors): job = Job() job.set_is_break(True) input_queue.put(job) # # Now all of the tests have been dispatched, so all we have to do here # in the main thread is to wait for them to complete. Keyboard interrupt # handling is broken as mentioned above. We use a signal handler to catch # sigint and set a global variable. When the worker threads sense this # they stop doing real work and will just start throwing jobs back at us # with is_break set to True. In this case, there are no real results so we # ignore them. If there are real results, we always print PASS or FAIL to # standard out as a quick indication of what happened. # passed_tests = 0 failed_tests = 0 crashed_tests = 0 valgrind_errors = 0 for i in range(jobs): job = output_queue.get() if job.is_break: continue if job.is_example: kind = "Example" else: kind = "TestSuite" if job.is_skip: status = "SKIP" skipped_tests = skipped_tests + 1 else: if job.returncode == 0: status = "PASS" passed_tests = passed_tests + 1 elif job.returncode == 1: failed_tests = failed_tests + 1 status = "FAIL" elif job.returncode == 2: valgrind_errors = valgrind_errors + 1 status = "VALGR" else: crashed_tests = crashed_tests + 1 status = "CRASH" print "%s: %s %s" % (status, kind, job.display_name) if job.is_example == True: # # Examples are the odd man out here. They are written without any # knowledge that they are going to be run as a test, so we need to # cook up some kind of output for them. We're writing an xml file, # so we do some simple XML that says we ran the example. # # XXX We could add some timing information to the examples, i.e. run # them through time and print the results here. # f = open(xml_results_file, 'a') f.write('<Example>\n') example_name = " <Name>%s</Name>\n" % job.display_name f.write(example_name) if status == "PASS": f.write(' <Result>PASS</Result>\n') elif status == "FAIL": f.write(' <Result>FAIL</Result>\n') elif status == "VALGR": f.write(' <Result>VALGR</Result>\n') elif status == "SKIP": f.write(' <Result>SKIP</Result>\n') else: f.write(' <Result>CRASH</Result>\n') f.write('</Example>\n') f.close() else: # # If we're not running an example, we're running a test suite. # These puppies are running concurrently and generating output # that was written to a temporary file to avoid collisions. # # Now that we are executing sequentially in the main thread, we can # concatenate the contents of the associated temp file to the main # results file and remove that temp file. # # One thing to consider is that a test suite can crash just as # well as any other program, so we need to deal with that # possibility as well. If it ran correctly it will return 0 # if it passed, or 1 if it failed. In this case, we can count # on the results file it saved being complete. If it crashed, it # will return some other code, and the file should be considered # corrupt and useless. If the suite didn't create any XML, then # we're going to have to do it ourselves. # # Another issue is how to deal with a valgrind error. If we run # a test suite under valgrind and it passes, we will get a return # code of 0 and there will be a valid xml results file since the code # ran to completion. If we get a return code of 1 under valgrind, # the test case failed, but valgrind did not find any problems so the # test case return code was passed through. We will have a valid xml # results file here as well since the test suite ran. If we see a # return code of 2, this means that valgrind found an error (we asked # it to return 2 if it found a problem in run_job_synchronously) but # the suite ran to completion so there is a valid xml results file. # If the suite crashes under valgrind we will see some other error # return code (like 139). If valgrind finds an illegal instruction or # some other strange problem, it will die with its own strange return # code (like 132). However, if the test crashes by itself, not under # valgrind we will also see some other return code. # # If the return code is 0, 1, or 2, we have a valid xml file. If we # get another return code, we have no xml and we can't really say what # happened -- maybe the TestSuite crashed, maybe valgrind crashed due # to an illegal instruction. If we get something beside 0-2, we assume # a crash and fake up an xml entry. After this is all done, we still # need to indicate a valgrind error somehow, so we fake up an xml entry # with a VALGR result. Thus, in the case of a working TestSuite that # fails valgrind, we'll see the PASS entry for the working TestSuite # followed by a VALGR failing test suite of the same name. # if job.is_skip: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>SKIP</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() else: if job.returncode == 0 or job.returncode == 1 or job.returncode == 2: f_to = open(xml_results_file, 'a') f_from = open(job.tmp_file_name, 'r') f_to.write(f_from.read()) f_to.close() f_from.close() else: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>CRASH</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() if job.returncode == 2: f = open(xml_results_file, 'a') f.write("<TestSuite>\n") f.write(" <SuiteName>%s</SuiteName>\n" % job.display_name) f.write(' <SuiteResult>VALGR</SuiteResult>\n') f.write(' <SuiteTime>Execution times not available</SuiteTime>\n') f.write("</TestSuite>\n") f.close() try: os.remove(job.tmp_file_name) except: pass # # We have all of the tests run and the results written out. One final # bit of housekeeping is to wait for all of the threads to close down # so we can exit gracefully. # for thread in threads: thread.join() # # Back at the beginning of time, we started the body of an XML document # since the test suites and examples were going to just write their # individual pieces. So, we need to finish off and close out the XML # document # f = open(xml_results_file, 'a') f.write('</TestResults>\n') f.close() # # Print a quick summary of events # print "%d of %d tests passed (%d passed, %d skipped, %d failed, %d crashed, %d valgrind errors)" % (passed_tests, total_tests, passed_tests, skipped_tests, failed_tests, crashed_tests, valgrind_errors) # # The last things to do are to translate the XML results file to "human # readable form" if the user asked for it (or make an XML file somewhere) # if len(options.html): translate_to_html(xml_results_file, options.html) if len(options.text): translate_to_text(xml_results_file, options.text) if len(options.xml): shutil.copyfile(xml_results_file, options.xml) if passed_tests == total_tests: return 0 # success else: return 1 # catchall for general errors | badd0f84bf2ddaebdd3a3021d3e8f2793aa92f00 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7746/badd0f84bf2ddaebdd3a3021d3e8f2793aa92f00/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
13332,
468,
468,
1939,
24103,
358,
1221,
3071,
716,
7756,
353,
6650,
16,
4351,
471,
5695,
358,
1960,
468,
3308,
732,
854,
8122,
268,
1673,
486,
358,
18,
225,
1660,
2545,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16341,
13332,
468,
468,
1939,
24103,
358,
1221,
3071,
716,
7756,
353,
6650,
16,
4351,
471,
5695,
358,
1960,
468,
3308,
732,
854,
8122,
268,
1673,
486,
358,
18,
225,
1660,
2545,... |
self.init_graphics_state() | def __init__(self,filename, pagesize=None, bottomup = 1, pageCompression=None, invariant = None, verbosity=0): """Create a canvas of a given size. etc. | aacd8f302c8fb1c739677aae438ff324d995b1e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3878/aacd8f302c8fb1c739677aae438ff324d995b1e6/canvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3459,
16,
4689,
554,
33,
7036,
16,
5469,
416,
273,
404,
16,
1363,
15270,
33,
7036,
16,
22514,
273,
599,
16,
11561,
33,
20,
4672,
3536,
1684,
279,
5953,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3459,
16,
4689,
554,
33,
7036,
16,
5469,
416,
273,
404,
16,
1363,
15270,
33,
7036,
16,
22514,
273,
599,
16,
11561,
33,
20,
4672,
3536,
1684,
279,
5953,
... | |
select stock.date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty | select stock.date as date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty | def init(self, cr): tools.drop_view_if_exists(cr, 'report_delivery_products_planned') cr.execute(""" create or replace view report_delivery_products_planned as ( select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty from stock_picking picking inner join stock_move stock on picking.id = stock.picking_id and picking.type = 'out' where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7) group by stock.create_date | bb17e729bfc8340d44fc3ca03151c8abc9ea45b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bb17e729bfc8340d44fc3ca03151c8abc9ea45b9/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
8513,
18,
7285,
67,
1945,
67,
430,
67,
1808,
12,
3353,
16,
296,
6006,
67,
15703,
67,
18736,
67,
412,
10041,
6134,
4422,
18,
8837,
2932,
3660,
752,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
8513,
18,
7285,
67,
1945,
67,
430,
67,
1808,
12,
3353,
16,
296,
6006,
67,
15703,
67,
18736,
67,
412,
10041,
6134,
4422,
18,
8837,
2932,
3660,
752,
578,
... |
if False: print "Iter =", iter import pdb; pdb.set_trace() | def goodPsfCandidate(source, fluxLim=psfPolicy.get("fluxLim")): """Should this object be included in the Ixx v. Iyy image?""" | 801774ea05d2ba1cad9c0cf823d60db16ea4a007 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6523/801774ea05d2ba1cad9c0cf823d60db16ea4a007/Psf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7494,
18124,
74,
11910,
12,
3168,
16,
11772,
48,
381,
33,
1121,
74,
2582,
18,
588,
2932,
7994,
48,
381,
6,
3719,
30,
3536,
14309,
333,
733,
506,
5849,
316,
326,
467,
5279,
331,
18,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7494,
18124,
74,
11910,
12,
3168,
16,
11772,
48,
381,
33,
1121,
74,
2582,
18,
588,
2932,
7994,
48,
381,
6,
3719,
30,
3536,
14309,
333,
733,
506,
5849,
316,
326,
467,
5279,
331,
18,
4... | |
if ModalDialog(_ProgressBar_filterfunc) == 1: raise KeyboardInterrupt | ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 ) if ready : what,msg,when,where,mod = ev part = Win.FindWindow(where)[0] if Dlg.IsDialogEvent(ev): ds = Dlg.DialogSelect(ev) if ds[0] and ds[1] == self.d and ds[-1] == 1: raise KeyboardInterrupt, ev else: if part == 4: self.d.DragWindow(where, screenbounds) else: MacOS.HandleEvent(ev) | def _update(self, value): tp, h, bar_rect = self.d.GetDialogItem(3) Qd.SetPort(self.d) Qd.FrameRect(bar_rect) # Draw outline inner_rect = Qd.InsetRect(bar_rect, 1, 1) l, t, r, b = inner_rect | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
12,
2890,
16,
460,
4672,
8071,
16,
366,
16,
4653,
67,
2607,
273,
365,
18,
72,
18,
967,
6353,
1180,
12,
23,
13,
2238,
72,
18,
694,
2617,
12,
2890,
18,
72,
13,
225,
2238,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
12,
2890,
16,
460,
4672,
8071,
16,
366,
16,
4653,
67,
2607,
273,
365,
18,
72,
18,
967,
6353,
1180,
12,
23,
13,
2238,
72,
18,
694,
2617,
12,
2890,
18,
72,
13,
225,
2238,
... |
raise ValueError("Parsing of db_xref failed: %s; %s" % (key, accession)) | raise ValueError("Parsing of db_xref failed: '%s'" % value) | def _load_seqfeature_dbxref(self, dbxrefs, seqfeature_id): """ _load_seqfeature_dbxref(self, dbxrefs, seqfeature_id) | 3928d6852d58f5ef17da167413d0744b9c823fb1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7167/3928d6852d58f5ef17da167413d0744b9c823fb1/Loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
5436,
7238,
67,
1966,
22044,
12,
2890,
16,
1319,
92,
9316,
16,
3833,
7238,
67,
350,
4672,
3536,
389,
945,
67,
5436,
7238,
67,
1966,
22044,
12,
2890,
16,
1319,
92,
9316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
945,
67,
5436,
7238,
67,
1966,
22044,
12,
2890,
16,
1319,
92,
9316,
16,
3833,
7238,
67,
350,
4672,
3536,
389,
945,
67,
5436,
7238,
67,
1966,
22044,
12,
2890,
16,
1319,
92,
9316,
... |
if os.name == 'nt' and path[0] == '/': | if (path[0] == '/') and path[-3:].lower() not in ('fdb', 'gdb'): | def connectionFromURI(cls, uri): auth, password, host, port, path, args = cls._parseURI(uri) if not password: password = 'masterkey' if not auth: auth='sysdba' if os.name == 'nt' and path[0] == '/': # strip the leading slash off of db name/alias path = path[1:] path = path.replace('/', os.sep) return cls(host, db=path, user=auth, password=password, **args) | cd415ddefadddd72d5d2c665814096072a3fdfd3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8798/cd415ddefadddd72d5d2c665814096072a3fdfd3/firebirdconnection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1459,
1265,
3098,
12,
6429,
16,
2003,
4672,
1357,
16,
2201,
16,
1479,
16,
1756,
16,
589,
16,
833,
273,
2028,
6315,
2670,
3098,
12,
1650,
13,
309,
486,
2201,
30,
2201,
273,
296,
7525,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1459,
1265,
3098,
12,
6429,
16,
2003,
4672,
1357,
16,
2201,
16,
1479,
16,
1756,
16,
589,
16,
833,
273,
2028,
6315,
2670,
3098,
12,
1650,
13,
309,
486,
2201,
30,
2201,
273,
296,
7525,
... |
if fragment[-1] in WHITESPACE: | if fragment[-1] in whitespace: | def handleSpecialCharacters(engine, text, program=None): from paraparser import greeks, symenc from string import whitespace standard={'lt':'<', 'gt':'>', 'amp':'&'} # add space prefix if space here if text[0:1] in whitespace: program.append(" ") #print "handling", repr(text) # shortcut if 0 and "&" not in text: result = [] for x in text.split(): result.append(x+" ") if result: last = result[-1] if text[-1:] not in whitespace: result[-1] = last.strip() program.extend(result) return program if program is None: program = [] amptext = text.split("&") first = 1 lastfrag = amptext[-1] for fragment in amptext: if not first: # check for special chars semi = fragment.find(";") if semi>0: name = fragment[:semi] if name[0]=='#': try: if name[1] == 'x': n = atoi(name[2:], 16) else: n = atoi(name[1:]) except atoi_error: n = -1 if 0<=n<=255: fragment = chr(n)+fragment[semi+1:] elif symenc.has_key(n): fragment = fragment[semi+1:] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(symenc[n]) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: fragment = "&"+fragment elif standard.has_key(name): fragment = standard[name]+fragment[semi+1:] elif greeks.has_key(name): fragment = fragment[semi+1:] greeksub = greeks[name] (f,b,i) = engine.shiftfont(program, face="symbol") program.append(greeksub) engine.shiftfont(program, face=f) if fragment and fragment[0] in WHITESPACE: program.append(" ") # follow with a space else: # add back the & fragment = "&"+fragment else: # add back the & fragment = "&"+fragment # add white separated components of fragment followed by space sfragment = fragment.split() for w in sfragment[:-1]: program.append(w+" ") # does the last one need a space? if sfragment and fragment: # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? if fragment[-1] in WHITESPACE: # or fragment==lastfrag: program.append( sfragment[-1]+" " ) else: last = sfragment[-1].strip() if last: #print "last is", repr(last) program.append( last ) first = 0 #print "HANDLED", program return program | 5f8e526168758dd894a7992058d72c9c74b5ba6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/5f8e526168758dd894a7992058d72c9c74b5ba6e/para.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12193,
11600,
12,
8944,
16,
977,
16,
5402,
33,
7036,
4672,
628,
779,
438,
297,
550,
1930,
314,
992,
7904,
16,
5382,
1331,
628,
533,
1930,
7983,
4529,
5899,
11,
5618,
11,
2497,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12193,
11600,
12,
8944,
16,
977,
16,
5402,
33,
7036,
4672,
628,
779,
438,
297,
550,
1930,
314,
992,
7904,
16,
5382,
1331,
628,
533,
1930,
7983,
4529,
5899,
11,
5618,
11,
2497,
32... |
if self.VERBOSE: | if self.VERBOSE: | def message(self, msg): | 3af39c5f05e82fd415c7f13441692ce1fa61bab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/3af39c5f05e82fd415c7f13441692ce1fa61bab9/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
883,
12,
2890,
16,
1234,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
883,
12,
2890,
16,
1234,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
print "Creating a new build directory if it does not already exist ..." | print "\nCreating a new build directory if it does not already exist ..." | def runTestCase(inOptions, serialOrMpi, buildType, trilinosSrcDir, extraCMakeOptions): success = True startingTime = time.time() baseTestDir = os.getcwd() buildDirName = serialOrMpi+"_"+buildType if not inOptions.rebuild: print "\nRemoving the existing build directory ..." if os.path.exists(buildDirName): echoRunSysCmnd("rm -rf "+buildDirName) if not performAnyActions(inOptions): print "\nNo other actions to perform!\n" return success print "Creating a new build directory if it does not already exist ..." createDir(buildDirName) absBuildDir = os.path.join(baseTestDir, buildDirName) echoChDir(absBuildDir) try: print "" print "A) Get the CMake configure options ..." print "" # A.1) Set the base options cmakeBaseOptions = [ "-DCMAKE_BUILD_TYPE:STRING="+buildType, ] if serialOrMpi == "MPI": cmakeBaseOptions.append("-DTPL_ENABLE_MPI:BOOL=ON") cmakeBaseOptions.append("-DTrilinos_ENABLE_TESTS:BOOL=ON") cmakeBaseOptions.extend(extraCMakeOptions) readAndAppendCMakeOptions( os.path.join("..", getCommonConfigFileName()), cmakeBaseOptions) readAndAppendCMakeOptions( os.path.join("..", getBuildSpecificConfigFileName(serialOrMpi, buildType)), cmakeBaseOptions) print "\ncmakeBaseOptions:", cmakeBaseOptions # A.2) Set the package enable options cmakePkgOptions = [] enablePackagesList = [] if inOptions.enablePackages: print "\nEnabling the specified packages '"+inOptions.enablePackages+"' ...\n" enablePackagesList = inOptions.enablePackages.split(',') else: print "\nDetermining the set of packages to enable by examining update.out ...\n" updateOutFileName = "../"+getUpdateOutputFileName() if os.path.exists(updateOutFileName): updateOutputStr = open(updateOutFileName, 'r').read() extractPackageEnablesFromChangeStatus(updateOutputStr, inOptions, enablePackagesList) else: print "\nThe file "+updateOutFileName+" does not exist!\n" for pkg in enablePackagesList: cmakePkgOptions.append("-DTrilinos_ENABLE_"+pkg+":BOOL=ON") cmakePkgOptions.append("-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON") if inOptions.enableAllPackages == 'on': print "\nEnabling all packages on request ..." cmakePkgOptions.append("-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON") if inOptions.enableFwdPackages: print "\nEnabling forward packages on request ..." cmakePkgOptions.append("-DTrilinos_ENABLE_ALL_FORWARD_DEP_PACKAGES:BOOL=ON") else: cmakePkgOptions.append("-DTrilinos_ENABLE_ALL_FORWARD_DEP_PACKAGES:BOOL=OFF") if inOptions.disablePackages: print "\nDisabling specified packages '"+inOptions.disablePackages+"' ...\n" disablePackagesList = inOptions.disablePackages.split(',') for pkg in disablePackagesList: cmakePkgOptions.append("-DTrilinos_ENABLE_"+pkg+":BOOL=OFF") print "\ncmakePkgOptions:", cmakePkgOptions # A.3) Set the combined options cmakeOptions = cmakeBaseOptions + cmakePkgOptions print "\ncmakeOptions =", cmakeOptions print "Creating base configure file do-configure.base ..." createConfigureFile(cmakeBaseOptions, "cmake", trilinosSrcDir, "do-configure.base") print "Creating package-enabled configure file do-configure ..." createConfigureFile(cmakePkgOptions, "./do-configure.base", None, "do-configure") print "" print "B) Do the configuration with CMake ..." print "" if inOptions.doConfigure: removeIfExists("CMakeCache.txt") cmnd = "./do-configure" if inOptions.extraCmakeOptions: cmnd += " " + inOptions.extraCmakeOptions echoRunSysCmnd(cmnd, outFile=getConfigureOutputFileName(), timeCmnd=True ) echoRunSysCmnd("touch "+getConfigureSuccessFileName()) else: print "\nSkipping configure on request!\n" print "" print "C) Do the build ..." print "" if inOptions.doBuild: cmnd = "make" if inOptions.makeOptions: cmnd += " " + inOptions.makeOptions echoRunSysCmnd(cmnd, outFile=getBuildOutputFileName(), timeCmnd=True ) echoRunSysCmnd("touch "+getBuildSuccessFileName()) else: print "\nSkipping the build on request ...\n" print "" print "D) Run the tests ..." print "" if inOptions.doTest: cmnd = "ctest" if inOptions.ctestOptions: cmnd += " " + inOptions.ctestOptions echoRunSysCmnd(cmnd, outFile=getTestOutputFileName(), timeCmnd=True ) echoRunSysCmnd("touch "+getTestSuccessFileName()) else: print "\nSkipping the testing on request!\n" except Exception, e: success = False traceback.print_exc() print "" print "E) Analyze the overall results and send email notification ..." print "" if performAnyActions(inOptions): result = analyzeResultsSendEmail(inOptions, trilinosSrcDir, buildDirName, enablePackagesList, cmakeOptions, startingTime) if not result: succcess = False else: print "No actions performed, nothing to analyze!" return success | 79082cb65232e0f86deaadbb6226384ade5627bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1130/79082cb65232e0f86deaadbb6226384ade5627bc/CheckinTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4709,
2449,
12,
267,
1320,
16,
2734,
1162,
49,
7259,
16,
1361,
559,
16,
433,
330,
267,
538,
7740,
1621,
16,
2870,
39,
6464,
1320,
4672,
225,
2216,
273,
1053,
225,
5023,
950,
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,
1086,
4709,
2449,
12,
267,
1320,
16,
2734,
1162,
49,
7259,
16,
1361,
559,
16,
433,
330,
267,
538,
7740,
1621,
16,
2870,
39,
6464,
1320,
4672,
225,
2216,
273,
1053,
225,
5023,
950,
273,... |
this = apply(_quickfix.new_TotalAccruedInterestAmt, args) | this = _quickfix.new_TotalAccruedInterestAmt(*args) | def __init__(self, *args): this = apply(_quickfix.new_TotalAccruedInterestAmt, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
5269,
8973,
86,
5957,
29281,
31787,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
5269,
8973,
86,
5957,
29281,
31787,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211... |
proc.interpreters = string.split(value, ',') log.log( "<config>INTERPRETERS(): interpreters defined as '%s'." % (proc.interpreters), 8 ) | try: proc.interpreters = string.split(value, ',') except NameError: log.log( "<config>INTERPRETERS(): interpreters ignored - no proc module.", 5 ) else: log.log( "<config>INTERPRETERS(): interpreters defined as '%s'." % (proc.interpreters), 8 ) | def __init__( self, list, typelist ): | 58eb08b5813eb81d4c5d5d8e555137dd715013cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/58eb08b5813eb81d4c5d5d8e555137dd715013cb/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
666,
16,
3815,
5449,
262,
30,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
666,
16,
3815,
5449,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return self.getOwnerTuple() return aq_base(self.getWrappedOwner()) | owner=aq_get(self, '_owner', None, 1) if info or (owner is None): return owner if owner is UnownableOwner: return None udb, oid = owner root=self.getPhysicalRoot() udb=root.unrestrictedTraverse(udb, None) if udb is None: user = SpecialUsers.nobody else: user = udb.getUserById(oid, None) if user is None: user = SpecialUsers.nobody return user | def getOwner(self, info=0): """Get the owner | 3b3187760f2df80a121aad2531855fc06838c700 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3b3187760f2df80a121aad2531855fc06838c700/Owned.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13782,
12,
2890,
16,
1123,
33,
20,
4672,
3536,
967,
326,
3410,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13782,
12,
2890,
16,
1123,
33,
20,
4672,
3536,
967,
326,
3410,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
""" | """ | def fl_show_oneliner(p1, p2, p3): """ fl_show_oneliner(p1, p2, p3) """ _fl_show_oneliner(p1, p2, p3) | 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,
4500,
67,
265,
292,
14522,
12,
84,
21,
16,
293,
22,
16,
293,
23,
4672,
3536,
1183,
67,
4500,
67,
265,
292,
14522,
12,
84,
21,
16,
293,
22,
16,
293,
23,
13,
3536,
225,
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,
4500,
67,
265,
292,
14522,
12,
84,
21,
16,
293,
22,
16,
293,
23,
4672,
3536,
1183,
67,
4500,
67,
265,
292,
14522,
12,
84,
21,
16,
293,
22,
16,
293,
23,
13,
3536,
225,
3... |
except DBusException: | except dbus.DBusException: | def _advertise_service(self, state=False): """Advertise service via SDP""" if not state and self.advertise_id: if(type(self.advertise_id) != type({})): bluez_db = dinterface(dbus.SystemBus(), 'org.bluez', '/org/bluez', 'org.bluez.Database') self.advertise_id = bluez_db.RemoveServiceRecord(self.advertise_id) else: self.logger.debug("Entered new codepath for new bluez api") manager = dinterface( dbus.SystemBus(), 'org.bluez', '/', 'org.bluez.Manager') active_connectors = manager.ListAdapters(); for connector_object in self.advertise_id: if not connector_object in active_connectors: continue connector_interface = dinterface( dbus.SystemBus(), 'org.bluez', connector_object, 'org.bluez.Service') connector_interface.RemoveRecord(self.advertise_id[connector_object]); self.advertise_id = None; elif state and not self.advertise_id: service_record = \ | cbf3879dae07c69db42acc13f2172ecb172d1215 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2456/cbf3879dae07c69db42acc13f2172ecb172d1215/BTServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
361,
25530,
67,
3278,
12,
2890,
16,
919,
33,
8381,
4672,
3536,
1871,
25530,
1156,
3970,
348,
8640,
8395,
309,
486,
919,
471,
365,
18,
361,
25530,
67,
350,
30,
309,
12,
723,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
361,
25530,
67,
3278,
12,
2890,
16,
919,
33,
8381,
4672,
3536,
1871,
25530,
1156,
3970,
348,
8640,
8395,
309,
486,
919,
471,
365,
18,
361,
25530,
67,
350,
30,
309,
12,
723,
12,
... |
class ColumnList(List): | class ColumnList(Widget): | def _iterateData(self, parentNode, submodel, data): """ """ currentListItem = 0 keys = data.keys() # Keys may be a tuple, if this is not a true dictionary but a dictionary-like object if hasattr(keys, 'sort'): keys.sort() for key in keys: newNode = self.getPattern('keyedListItem') if not newNode: newNode = self.getPattern('item', _RAISE) if newNode: warnings.warn("itemOf= is deprecated, " "please use listItemOf instead", DeprecationWarning) | 11a4cf487f8450446e902d7b8f4b534faffcc0da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/11a4cf487f8450446e902d7b8f4b534faffcc0da/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
18793,
751,
12,
2890,
16,
7234,
16,
720,
2284,
16,
501,
4672,
3536,
3536,
783,
13575,
273,
374,
1311,
273,
501,
18,
2452,
1435,
468,
11432,
2026,
506,
279,
3193,
16,
309,
333,
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,
389,
18793,
751,
12,
2890,
16,
7234,
16,
720,
2284,
16,
501,
4672,
3536,
3536,
783,
13575,
273,
374,
1311,
273,
501,
18,
2452,
1435,
468,
11432,
2026,
506,
279,
3193,
16,
309,
333,
353... |
if filelist[0:14] != host_attribs: | if filelist[0:13] != host_attribs: | def checkformat(values, indices): """Ensures file contains all necessary attributes in order """ filelist = [pair[0] for pair in values] | 7c77da661dd36bc14bbad3aabbca89b0e0b6f299 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11867/7c77da661dd36bc14bbad3aabbca89b0e0b6f299/batchadd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
2139,
12,
2372,
16,
4295,
4672,
3536,
19869,
585,
1914,
777,
4573,
1677,
316,
1353,
3536,
26204,
273,
306,
6017,
63,
20,
65,
364,
3082,
316,
924,
65,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
2139,
12,
2372,
16,
4295,
4672,
3536,
19869,
585,
1914,
777,
4573,
1677,
316,
1353,
3536,
26204,
273,
306,
6017,
63,
20,
65,
364,
3082,
316,
924,
65,
225,
2,
-100,
-100,
-100,
-10... |
AND delDate IS NOT NULL | AND delDate IS NULL | def run(self, pattern): self.connect(self.dbUName, self.dbUPwd) | a52cbe4e1b554d851875ae8e78d5902b5841ec38 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6558/a52cbe4e1b554d851875ae8e78d5902b5841ec38/dropDatabases.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
1936,
4672,
365,
18,
3612,
12,
2890,
18,
1966,
57,
461,
16,
365,
18,
1966,
3079,
3623,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
1936,
4672,
365,
18,
3612,
12,
2890,
18,
1966,
57,
461,
16,
365,
18,
1966,
3079,
3623,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
distros = Distro.query() | distros = Distro.query().join('lab_controller_assocs') | def by_filter(cls, filter): """ <distro> <And> <Require name='ARCH' operator='=' value='i386'/> <Require name='FAMILY' operator='=' value='rhelserver5'/> <Require name='TAG' operator='=' value='released'/> </And> </distro> """ from needpropertyxml import ElementWrapper import xmltramp #FIXME Should validate XML before proceeding. queries = [] joins = [] for child in ElementWrapper(xmltramp.parse(filter)): if callable(getattr(child, 'filter', None)): (join, query) = child.filter() queries.append(query) joins.extend(join) distros = Distro.query() if joins: distros = distros.filter(and_(*joins)) if queries: distros = distros.filter(and_(*queries)) return distros.order_by('-date_created') | 6797e76005efcdaab148c205caf05fd6f5792200 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14755/6797e76005efcdaab148c205caf05fd6f5792200/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
635,
67,
2188,
12,
6429,
16,
1034,
4672,
3536,
411,
4413,
303,
34,
411,
1876,
34,
411,
8115,
508,
2218,
10586,
11,
3726,
2218,
2218,
460,
2218,
77,
23,
5292,
11,
21259,
411,
8115,
508,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
635,
67,
2188,
12,
6429,
16,
1034,
4672,
3536,
411,
4413,
303,
34,
411,
1876,
34,
411,
8115,
508,
2218,
10586,
11,
3726,
2218,
2218,
460,
2218,
77,
23,
5292,
11,
21259,
411,
8115,
508,... |
if save_success: if self.conn: if self.status: while self.status.get('updating_db', 0): gtk.main_iteration() self.conn.do.update(tags[self.tagnum]['mpdpath']) | if save_success and self.conn and self.status: while self.status.get('updating_db', 0): gtk.main_iteration() self.conn.do.update(tags[self.tagnum]['mpdpath']) | def editwindow_response(self, window, response, tags, entries, entries_names): if response == gtk.RESPONSE_REJECT: self.editwindow_hide(window) elif response == gtk.RESPONSE_ACCEPT: window.action_area.set_sensitive(False) while window.action_area.get_property("sensitive") == True or gtk.events_pending(): gtk.main_iteration() filetag = tagpy.FileRef(tags[self.tagnum]['fullpath']) self.tagpy_set_tag(filetag.tag(), 'title', entries[0].get_text()) self.tagpy_set_tag(filetag.tag(), 'artist', entries[1].get_text()) self.tagpy_set_tag(filetag.tag(), 'album', entries[2].get_text()) if len(entries[3].get_text()) > 0: self.tagpy_set_tag(filetag.tag(), 'year', entries[3].get_text()) else: self.tagpy_set_tag(filetag.tag(), 'year', 0) if len(entries[4].get_text()) > 0: self.tagpy_set_tag(filetag.tag(), 'track', entries[4].get_text()) else: self.tagpy_set_tag(filetag.tag(), 'track', 0) self.tagpy_set_tag(filetag.tag(), 'genre', entries[5].get_text()) self.tagpy_set_tag(filetag.tag(), 'comment', entries[6].get_text()) save_success = filetag.save() if save_success: if self.conn: if self.status: while self.status.get('updating_db', 0): gtk.main_iteration() self.conn.do.update(tags[self.tagnum]['mpdpath']) else: error_dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("Unable to save tag to music file.")) error_dialog.set_title(_("Edit Tags")) error_dialog.connect('response', self.choose_image_dialog_response) error_dialog.show() if self.edit_next_tag(tags): # Next file: gobject.timeout_add(250, self.editwindow_update, window, tags, entries, entries_names) else: # No more (valid) files: self.editwindow_hide(window) | 48b67fcc80970d59270b275335d2299d4464b303 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/48b67fcc80970d59270b275335d2299d4464b303/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
5668,
67,
2740,
12,
2890,
16,
2742,
16,
766,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
309,
766,
422,
22718,
18,
14508,
67,
862,
5304,
30,
365,
18,
4619,
5668,
67,
11248,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2740,
12,
2890,
16,
2742,
16,
766,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
309,
766,
422,
22718,
18,
14508,
67,
862,
5304,
30,
365,
18,
4619,
5668,
67,
11248,
1... |
return principalfolder.PrincipalInfo(id, info.title, info.description) | return principalfolder.PrincipalInfo( self.prefix+id, info.title, info.description) | def principalInfo(self, id): if id.startswith(self.prefix): id = id[len(self.prefix):] info = self.get(id) if info is not None: return principalfolder.PrincipalInfo(id, info.title, info.description) | d818fce5ed158e3dc2c96ee2d36cdb2577372ca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9655/d818fce5ed158e3dc2c96ee2d36cdb2577372ca3/groupfolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8897,
966,
12,
2890,
16,
612,
4672,
309,
612,
18,
17514,
1918,
12,
2890,
18,
3239,
4672,
612,
273,
612,
63,
1897,
12,
2890,
18,
3239,
4672,
65,
1123,
273,
365,
18,
588,
12,
350,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8897,
966,
12,
2890,
16,
612,
4672,
309,
612,
18,
17514,
1918,
12,
2890,
18,
3239,
4672,
612,
273,
612,
63,
1897,
12,
2890,
18,
3239,
4672,
65,
1123,
273,
365,
18,
588,
12,
350,
13,
... |
self.cv.coords(item, (x, -y)) | self.cv.coords(item, (x * self.xscale, -y * self.yscale)) | def _drawimage(self, item, (x, y), image): """Configure image item as to draw image object at position (x,y) on canvas) """ self.cv.coords(item, (x, -y)) self.cv.itemconfig(item, image=image) | 021750692ed8f8fbed8610962a7d1f94b04ce289 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/021750692ed8f8fbed8610962a7d1f94b04ce289/turtle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9446,
2730,
12,
2890,
16,
761,
16,
261,
92,
16,
677,
3631,
1316,
4672,
3536,
11207,
1316,
761,
487,
358,
3724,
1316,
733,
622,
1754,
261,
92,
16,
93,
13,
603,
5953,
13,
3536,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9446,
2730,
12,
2890,
16,
761,
16,
261,
92,
16,
677,
3631,
1316,
4672,
3536,
11207,
1316,
761,
487,
358,
3724,
1316,
733,
622,
1754,
261,
92,
16,
93,
13,
603,
5953,
13,
3536,
36... |
self.maxStateVariables*self._maxMaterialModels) | self._maxStateVariables*self._maxMaterialModels) self._memorySize += self._maxStateVariables* \ self._maxMaterialModels*self._intSize | def _init(self, parent): | 03ce7c42cfd763a6f6a747dc75532b3d68be671a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8645/03ce7c42cfd763a6f6a747dc75532b3d68be671a/Lithomop3d_scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
12,
2890,
16,
982,
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,
389,
2738,
12,
2890,
16,
982,
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,... |
store = cls.store_key) | store = cls.store_key, block_auto_load = False) | def __instancemaker(cls, params, instance_data): """ Construct resource from `instance_data`, return it. """ | d541fd4e6d6db6a036edb044a52cc83c9fb21f94 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13812/d541fd4e6d6db6a036edb044a52cc83c9fb21f94/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1336,
29261,
12,
6429,
16,
859,
16,
791,
67,
892,
4672,
3536,
14291,
1058,
628,
1375,
1336,
67,
892,
9191,
327,
518,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1336,
29261,
12,
6429,
16,
859,
16,
791,
67,
892,
4672,
3536,
14291,
1058,
628,
1375,
1336,
67,
892,
9191,
327,
518,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
COMPRESSION_NAME = { 0x30: "Storing", 0x31: "Fastest compression", 0x32: "Fast compression", 0x33: "Normal compression", 0x34: "Good compression", 0x35: "Best compression" } OS_NAME = { 0: "MS DOS", 1: "OS/2", 2: "Win32", 3: "Unix", } | def specialHeader(self, is_file): COMPRESSION_NAME = { 0x30: "Storing", 0x31: "Fastest compression", 0x32: "Fast compression", 0x33: "Normal compression", 0x34: "Good compression", 0x35: "Best compression" } OS_NAME = { 0: "MS DOS", 1: "OS/2", 2: "Win32", 3: "Unix", } yield UInt32(self, "compressed_size", "Compressed size (bytes)", text_handler=humanFilesize) yield UInt32(self, "uncompressed_size", "Uncompressed size (bytes)", text_handler=humanFilesize) yield Enum(UInt8(self, "host_os", "Operating system used for archiving"), OS_NAME) yield UInt32(self, "crc32", "File CRC32", text_handler=hexadecimal) yield UInt32(self, "ftime", "Date and time (MS DOS format)", text_handler=timestampMSDOS) yield UInt8(self, "version", "RAR version needed to extract file", text_handler=formatRARVersion) yield Enum(UInt8(self, "method", "Packing method"), COMPRESSION_NAME) yield UInt16(self, "filename_length", "File name size", text_handler=humanFilesize) if self["host_os"].value in (0, 2): yield MSDOSFileAttr(self, "file_attr", "File attributes") else: yield UInt32(self, "file_attr", "File attributes", text_handler=hexadecimal) flags = self["flags"] # Start additional field from unrar if flags["is_large"].value: val = UInt64(self, "large_size", "Extended 64bits filesize", text_handler=humanFilesize) # End additional field size = self["filename_length"].value if size > 0: if flags["is_unicode"].value: val = String(self, "utf8_filename", size, "UTF-8 filename", charset="UTF-8") else: val = String(self, "filename", size, "ISO-8859-15 filename", charset="ISO-8859-15") yield val #self._name = val.value.replace(" ", '_').replace('/','\\') # Start additional fields from unrar - file only if is_file: if flags["has_salt"].value: yield UInt8(self, "salt", "Salt", text_handler=hexadecimal) if flags["has_ext_time"].value: yield ExtTime(self, "extra_time", "Extra time info") | a9c108cfa3009177581752043b9da12659e5c31a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/a9c108cfa3009177581752043b9da12659e5c31a/rar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4582,
1864,
12,
2890,
16,
353,
67,
768,
4672,
2824,
29810,
1578,
12,
2890,
16,
315,
15385,
67,
1467,
3113,
315,
16841,
963,
261,
3890,
2225,
16,
977,
67,
4176,
33,
24270,
2697,
554,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4582,
1864,
12,
2890,
16,
353,
67,
768,
4672,
2824,
29810,
1578,
12,
2890,
16,
315,
15385,
67,
1467,
3113,
315,
16841,
963,
261,
3890,
2225,
16,
977,
67,
4176,
33,
24270,
2697,
554,
13... | |
elif target[0:1] == '~': target = target[1:] dot = target.rfind('.') if dot != -1: title = target[dot+1:] | def xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): env = inliner.document.settings.env text = utils.unescape(text) # if the first character is a bang, don't cross-reference at all if text[0:1] == '!': text = _fix_parens(typ, text[1:], env) return [innernodetypes.get(typ, nodes.literal)( rawtext, text, classes=['xref'])], [] # we want a cross-reference, create the reference node pnode = addnodes.pending_xref(rawtext, reftype=typ, refcaption=False, modname=env.currmodule, classname=env.currclass) # we may need the line number for warnings pnode.line = lineno # the link title may differ from the target, but by default they are the same title = target = text titleistarget = True # look if explicit title and target are given with `foo <bar>` syntax brace = text.find('<') if brace != -1: titleistarget = False pnode['refcaption'] = True m = caption_ref_re.match(text) if m: target = m.group(2) title = m.group(1) else: # fallback: everything after '<' is the target target = text[brace+1:] title = text[:brace] # special target for Python object cross-references if typ in ('data', 'exc', 'func', 'class', 'const', 'attr', 'meth', 'mod'): # fix-up parentheses in link title if titleistarget: title = _fix_parens(typ, title.lstrip('.~'), env) # remove parentheses from the target too if target.endswith('()'): target = target[:-2] # if the first character is a dot, search more specific namespaces first # else search builtins first if target[0:1] == '.': target = target[1:] pnode['refspecific'] = True # if the first character is a tilde, don't display the module/class parts # of the contents elif target[0:1] == '~': target = target[1:] dot = target.rfind('.') if dot != -1: title = target[dot+1:] # some other special cases for the target elif typ == 'option' and target[0] in '-/': # strip option marker from target target = target[1:] elif typ == 'term': # normalize whitespace in definition terms (if the term reference is # broken over a line, a newline will be in target) target = ws_re.sub(' ', target).lower() else: # remove all whitespace to avoid referencing problems target = ws_re.sub('', target) pnode['reftarget'] = target pnode += innernodetypes.get(typ, nodes.literal)(rawtext, title, classes=['xref']) return [pnode], [] | b015fbbe8df1ca7657065e21939e0c1b9b4843d6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5532/b015fbbe8df1ca7657065e21939e0c1b9b4843d6/roles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
7540,
822,
74,
67,
4615,
12,
12846,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
1550,
273,
316,
7511,
264,
18,
5457,
18,
4272,
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,
619,
7540,
822,
74,
67,
4615,
12,
12846,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
1550,
273,
316,
7511,
264,
18,
5457,
18,
4272,
18,... | |
def __init__(self, build, partner_dir, build_dir, repack_dir, repack_info): | def __init__(self, build, partner_dir, build_dir, working_dir, final_dir, repack_info): | def __init__(self, build, partner_dir, build_dir, repack_dir, repack_info): super(RepackLinux, self).__init__(build, partner_dir, build_dir, repack_dir, repack_info) self.platform = "linux" self.uncompressed_build = build.replace('.bz2','') | e36822b26ce81ba3f89d96443ec62c28dbd6e70f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10262/e36822b26ce81ba3f89d96443ec62c28dbd6e70f/partner-repacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1361,
16,
19170,
67,
1214,
16,
1361,
67,
1214,
16,
5960,
67,
1214,
16,
727,
67,
1214,
16,
2071,
484,
67,
1376,
4672,
2240,
12,
426,
2920,
19475,
16,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1361,
16,
19170,
67,
1214,
16,
1361,
67,
1214,
16,
5960,
67,
1214,
16,
727,
67,
1214,
16,
2071,
484,
67,
1376,
4672,
2240,
12,
426,
2920,
19475,
16,
36... |
dct['interval'] = u"" dct['freq'] = singularFrequencyMap[freq] until = rule.calculatedUntil() if until is None: dct['until'] = u"" else: formatter = DateFormat.createDateInstance(DateFormat.kShort) dct['until'] = _(u"until ") + unicode(formatter.format(until)) return "%(weekdays)severy%(interval)s %(freq)s %(until)s" % dct | index += 's' return descriptionFormat[index] % dct | def getCustomDescription(self): """Return a string describing custom rules. | f54c3f01d59ec14330045b415eecb81a8a76f63c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/f54c3f01d59ec14330045b415eecb81a8a76f63c/Recurrence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12736,
3291,
12,
2890,
4672,
3536,
990,
279,
533,
16868,
1679,
2931,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12736,
3291,
12,
2890,
4672,
3536,
990,
279,
533,
16868,
1679,
2931,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
_USER = 0 | _USER = None | def login(username, password, host, port, database): global _SOCK, _USER, _USERNAME, _SESSION, _DATABASE, _VIEW_CACHE, SECURE _VIEW_CACHE = {} SECURE = False try: _SEMAPHORE.acquire() try: if _SOCK and (_SOCK.hostname != host or _SOCK.port != port): _SOCK.disconnect() if _SOCK is None: _SOCK = pysocket.PySocket() if not _SOCK.connected: _SOCK.connect(host, port) args = (database, username, password, 'common', 'db', 'login') logging.getLogger('rpc.request').info(repr(args)) _SOCK.send(args) res = _SOCK.receive() logging.getLogger('rpc.result').debug(repr(res)) finally: _SEMAPHORE.release() except (socket.error, RuntimeError): try: _SOCK.reconnect() except (socket.error, RuntimeError): pass _USER = 0 _SESSION = '' return -1 if not res: _USER = 0 _SESSION = '' return -2 _USER = res[0] _USERNAME = username _SESSION = res[1] _DATABASE = database SECURE = _SOCK.ssl context_reload() return 1 | 92c76ea05ac98f48b25e166e881fd70ac3180818 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9151/92c76ea05ac98f48b25e166e881fd70ac3180818/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
12,
5053,
16,
2201,
16,
1479,
16,
1756,
16,
2063,
4672,
2552,
389,
3584,
3507,
16,
389,
4714,
16,
389,
21292,
16,
389,
7042,
16,
389,
22366,
16,
389,
12145,
67,
8495,
16,
31418,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
12,
5053,
16,
2201,
16,
1479,
16,
1756,
16,
2063,
4672,
2552,
389,
3584,
3507,
16,
389,
4714,
16,
389,
21292,
16,
389,
7042,
16,
389,
22366,
16,
389,
12145,
67,
8495,
16,
31418,
... |
full = os.path.normpath(os.path.join(self.directory, filename)) | full = os.path.normcase(os.path.normpath( os.path.join(self.directory, filename)))) | def __call__(self, environ, start_response): path_info = environ.get('PATH_INFO', '') if not path_info: return self.add_slash(environ, start_response) if path_info == '/': # @@: This should obviously be configurable filename = 'index.html' else: filename = request.path_info_pop(environ) full = os.path.normpath(os.path.join(self.directory, filename)) if os.path.sep != '/': full = full.replace('/', os.path.sep) if self.root_directory is not None and not full.startswith(self.root_directory): # Out of bounds return self.not_found(environ, start_response) if not os.path.exists(full): return self.not_found(environ, start_response) if os.path.isdir(full): # @@: Cache? child_root = self.root_directory is not None and \ self.root_directory or self.directory return self.__class__(full, root_directory=child_root, cache_max_age=self.cache_max_age)(environ, start_response) if environ.get('PATH_INFO') and environ.get('PATH_INFO') != '/': return self.error_extra_path(environ, start_response) if_none_match = environ.get('HTTP_IF_NONE_MATCH') if if_none_match: mytime = os.stat(full).st_mtime if str(mytime) == if_none_match: headers = [] ETAG.update(headers, mytime) start_response('304 Not Modified', headers) return [''] # empty body fa = self.make_app(full) if self.cache_max_age: fa.cache_control(max_age=self.cache_max_age) return fa(environ, start_response) | 35876f52585996786000c8317ae93b581af3c7a9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11400/35876f52585996786000c8317ae93b581af3c7a9/urlparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
589,
67,
1376,
273,
5473,
18,
588,
2668,
4211,
67,
5923,
2187,
28707,
309,
486,
589,
67,
1376,
30,
327,
365,
18,
1289,
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,
1001,
1991,
972,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
589,
67,
1376,
273,
5473,
18,
588,
2668,
4211,
67,
5923,
2187,
28707,
309,
486,
589,
67,
1376,
30,
327,
365,
18,
1289,
6... |
Q = 1.0 - P**n * 2.0**(Qexp * n) | Q = 1.0 - Q**n * 2.0**(Qexp * n) | def robinson_spamprob(self, wordstream, evidence=False): """Return best-guess probability that wordstream is spam. | aa20026e74a796e88789be8e675b1103ac2fcdd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/aa20026e74a796e88789be8e675b1103ac2fcdd8/classifier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
721,
4757,
816,
67,
1752,
301,
7748,
12,
2890,
16,
2076,
3256,
16,
14481,
33,
8381,
4672,
3536,
990,
3796,
17,
20885,
11331,
716,
2076,
3256,
353,
24824,
18,
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,
0,
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,
721,
4757,
816,
67,
1752,
301,
7748,
12,
2890,
16,
2076,
3256,
16,
14481,
33,
8381,
4672,
3536,
990,
3796,
17,
20885,
11331,
716,
2076,
3256,
353,
24824,
18,
2,
-100,
-100,
-100,
-100,
... |
index = match.start() + len(replace_text) markerpos = match.start() + len(replace_text) | index = match.start() + len(replacement) markerpos = match.start() + len(replacement) | def replaceExcept(text, old, new, exceptions, caseInsensitive = False, allowoverlap = False, marker = ''): """ Replaces old by new in text, skipping occurences of old e.g. within nowiki tags or HTML comments. If caseInsensitive is true, then use case insensitivity in the regex matching. If allowoverlap is true, overlapping occurences are all replaced (watch out when using this, it might lead to infinite loops!). Parameters: text - a string old - a compiled regular expression new - a string exceptList - a list of strings which signal what to leave out, e.g. ['math', 'table', 'template'] caseInsensitive - a boolean marker - a string, it will be added to the last replacement, if nothing is changed, it is added at the end """ exceptionRegexes = { 'comment': re.compile(r'(?s)<!--.*?-->'), 'includeonly': re.compile(r'(?is)<includeonly>.*?</includeonly>'), 'math': re.compile(r'(?is)<math>.*?</math>'), 'noinclude': re.compile(r'(?is)<noinclude>.*?</noinclude>'), # wiki tags are ignored inside nowiki tags. 'nowiki': re.compile(r'(?is)<nowiki>.*?</nowiki>'), # lines that start with a space are shown in a monospace font and # have whitespace preserved, with wiki tags being ignored. 'pre': re.compile(r'(?is)<pre>.*?</pre>'), # lines that start with a space are shown in a monospace font and # have whitespace preserved. 'startspace': re.compile(r'(?m)^ (.*?)$'), # tables often have whitespace that is used to improve wiki # source code readability. 'table': re.compile(r'(?ims)^{\|.*?^\|}|<table>.*?</table>'), # templates with parameters often have whitespace that is used to # improve wiki source code readability. 'template': re.compile(r'(?s)^{{.*?}}'), } # if we got a string, compile it as a regular expression if type(old) == type('') or type(old) == type(u''): if caseInsensitive: old = re.compile(old, re.IGNORECASE) else: old = re.compile(old) #noTouch = '|'.join([exceptions[name] for name in exceptList]) #noTouchR = re.compile(noTouch) # How much of the text we have looked at so far dontTouchRegexes = [exceptionRegexes[name] for name in exceptions] index = 0 markerpos = len(text) while True: match = old.search(text, index) if not match: # nothing left to replace break # check which exception will occur next. nextExceptionMatch = None for dontTouchR in dontTouchRegexes: excMatch = dontTouchR.search(text, index) if excMatch and ( nextExceptionMatch is None or excMatch.start() < nextExceptionMatch.start()): nextExceptionMatch = excMatch if nextExceptionMatch is not None and nextExceptionMatch.start() <= match.start(): # an HTML comment or text in nowiki tags stands before the next valid match. Skip. index = nextExceptionMatch.end() else: # We found a valid match. Replace it. replace_text = old.sub(new, text[match.start():match.end()]) text = text[:match.start()] + replace_text + text[match.end():] # continue the search on the remaining text if allowoverlap: index = match.start() + 1 else: index = match.start() + len(replace_text) markerpos = match.start() + len(replace_text) text = text[:markerpos] + marker + text[markerpos:] return text | 659002c66b72568b90c31a723a15cd8b8030eb42 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/659002c66b72568b90c31a723a15cd8b8030eb42/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
30212,
12,
955,
16,
1592,
16,
394,
16,
4798,
16,
648,
21931,
273,
1083,
16,
1699,
17946,
273,
1083,
16,
5373,
273,
875,
4672,
3536,
868,
11350,
1592,
635,
394,
316,
977,
16,
1419... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
30212,
12,
955,
16,
1592,
16,
394,
16,
4798,
16,
648,
21931,
273,
1083,
16,
1699,
17946,
273,
1083,
16,
5373,
273,
875,
4672,
3536,
868,
11350,
1592,
635,
394,
316,
977,
16,
1419... |
atts['src'] = node['uri'] | uri = node['uri'] issvg = uri.lower().endswith('.svg') if issvg: atts['data'] = uri atts['type'] = 'image/svg+xml' else: atts['src'] = uri | def visit_image(self, node): atts = {} atts['src'] = node['uri'] if 'width' in node: atts['width'] = node['width'] if 'height' in node: atts['height'] = node['height'] if 'scale' in node: if Image and not ('width' in node and 'height' in node): try: im = Image.open(str(atts['src'])) except (IOError, # Source image can't be found or opened UnicodeError): # PIL doesn't like Unicode paths. pass else: if 'width' not in atts: atts['width'] = str(im.size[0]) if 'height' not in atts: atts['height'] = str(im.size[1]) del im for att_name in 'width', 'height': if att_name in atts: match = re.match(r'([0-9.]+)(\S*)$', atts[att_name]) assert match atts[att_name] = '%s%s' % ( float(match.group(1)) * (float(node['scale']) / 100), match.group(2)) style = [] for att_name in 'width', 'height': if att_name in atts: if re.match(r'^[0-9.]+$', atts[att_name]): # Interpret unitless values as pixels. atts[att_name] += 'px' style.append('%s: %s;' % (att_name, atts[att_name])) del atts[att_name] if style: atts['style'] = ' '.join(style) atts['alt'] = node.get('alt', atts['src']) if (isinstance(node.parent, nodes.TextElement) or (isinstance(node.parent, nodes.reference) and not isinstance(node.parent.parent, nodes.TextElement))): # Inline context or surrounded by <a>...</a>. suffix = '' else: suffix = '\n' if 'classes' in node and 'align-center' in node['classes']: node['align'] = 'center' if 'align' in node: if node['align'] == 'center': # "align" attribute is set in surrounding "div" element. self.body.append('<div align="center" class="align-center">') self.context.append('</div>\n') suffix = '' else: # "align" attribute is set in "img" element. atts['align'] = node['align'] self.context.append('') atts['class'] = 'align-%s' % node['align'] else: self.context.append('') self.body.append(self.emptytag(node, 'img', suffix, **atts)) | ea6b383610ea5af63786fc4dc27f33f09f09df07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8194/ea6b383610ea5af63786fc4dc27f33f09f09df07/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
2618,
2003,
273,
756,
3292,
1650,
3546,
3385,
20105,
273,
2003,
18,
8167,
7675,
5839,
1918,
2668,
18,
11451,
6134,
309,
3385,
20105,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
2618,
2003,
273,
756,
3292,
1650,
3546,
3385,
20105,
273,
2003,
18,
8167,
7675,
5839,
1918,
2668,
18,
11451,
6134,
309,
3385,
20105,
... |
self.raise_user_error(cursor, 'reset_invoice') | self.raise_user_error(cursor, 'reset_invoice_sale') | def button_draft(self, cursor, user, ids, context=None): sale_obj = self.pool.get('sale.sale') sale_ids = sale_obj.search( cursor, user, [('invoices', 'in', ids)], context=context) | b1f099b98b678be21a5bda08e1101f919bae9fcf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9306/b1f099b98b678be21a5bda08e1101f919bae9fcf/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3568,
67,
17153,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
272,
5349,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
87,
5349,
18,
87,
5349,
6134,
272,
5349,
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,
3568,
67,
17153,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
819,
33,
7036,
4672,
272,
5349,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
87,
5349,
18,
87,
5349,
6134,
272,
5349,
67,
... |
if isItemInInstallInfo(item_pl, installinfo['managed_installs']): munkicommon.display_debug1( '%s has already been processed for install.' % manifestitemname) return if isItemInInstallInfo(item_pl, installinfo['removals']): munkicommon.display_debug1( '%s has already been processed for removal.' % manifestitemname) return | def processOptionalInstall(manifestitem, cataloglist, installinfo): """Process an optional install item to see if it should be added to the list of optional installs. """ manifestitemname = os.path.split(manifestitem)[1] item_pl = getItemDetail(manifestitem, cataloglist) if not item_pl: munkicommon.display_warning( 'Could not process item %s for optional install: ' % manifestitem) munkicommon.display_warning( 'No pkginfo for %s found in catalogs: %s' % (manifestitem, ', '.join(cataloglist))) return # check to see if item (any version) is already in the installlist: if isItemInInstallInfo(item_pl, installinfo['managed_installs']): munkicommon.display_debug1( '%s has already been processed for install.' % manifestitemname) return # check to see if item (any version) is already in the removallist: if isItemInInstallInfo(item_pl, installinfo['removals']): munkicommon.display_debug1( '%s has already been processed for removal.' % manifestitemname) return # check to see if item (any version) is already in the # optional_install list: for item in installinfo['optional_installs']: if item_pl['name'] == item['name']: munkicommon.display_debug1( '%s has already been processed for optional install.' % manifestitemname) return # if we get to this point we can add this item # to the list of optional installs iteminfo = {} iteminfo['name'] = item_pl.get('name', manifestitemname) iteminfo['manifestitem'] = manifestitemname iteminfo['description'] = item_pl.get('description', '') iteminfo['version_to_install'] = item_pl.get('version', 'UNKNOWN') iteminfo['display_name'] = item_pl.get('display_name', '') iteminfo['installed'] = someVersionInstalled(item_pl) if iteminfo['installed']: iteminfo['needs_update'] = not isInstalled(item_pl) iteminfo['uninstallable'] = item_pl.get('uninstallable', False) if (not iteminfo['installed']) or (iteminfo.get('needs_update')): iteminfo['installer_item_size'] = \ item_pl.get('installer_item_size', 0) iteminfo['installed_size'] = item_pl.get('installer_item_size', iteminfo['installer_item_size']) if not enoughDiskSpace(item_pl, installinfo.get('managed_installs', []), warn=False): iteminfo['note'] = \ 'Insufficient disk space to download and install.' installinfo['optional_installs'].append(iteminfo) | ab2118c3edddc435222f307300f7769e60af7451 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6241/ab2118c3edddc435222f307300f7769e60af7451/updatecheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
6542,
6410,
12,
14357,
1726,
16,
6222,
1098,
16,
3799,
1376,
4672,
3536,
2227,
392,
3129,
3799,
761,
358,
2621,
309,
518,
1410,
506,
3096,
358,
326,
666,
434,
3129,
31011,
18,
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,
1207,
6542,
6410,
12,
14357,
1726,
16,
6222,
1098,
16,
3799,
1376,
4672,
3536,
2227,
392,
3129,
3799,
761,
358,
2621,
309,
518,
1410,
506,
3096,
358,
326,
666,
434,
3129,
31011,
18,
3536... | |
i += 1 | def _identify(self, tokens): '''For a list of tokens, goes through the tree and returns the longest language, country or region name it can find, along the item_type, and the associated list of ISO 639 codes. Normalizes case, becaues the | 2ec4d9ec52a04e7cb905f1aefc022674e8db1db8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8937/2ec4d9ec52a04e7cb905f1aefc022674e8db1db8/iso639_trainer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
31079,
12,
2890,
16,
2430,
4672,
9163,
1290,
279,
666,
434,
2430,
16,
13998,
3059,
326,
2151,
471,
1135,
326,
12163,
2653,
16,
5251,
578,
3020,
508,
518,
848,
1104,
16,
7563,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
31079,
12,
2890,
16,
2430,
4672,
9163,
1290,
279,
666,
434,
2430,
16,
13998,
3059,
326,
2151,
471,
1135,
326,
12163,
2653,
16,
5251,
578,
3020,
508,
518,
848,
1104,
16,
7563,
326,
... | |
if (uri!=self.cache.uri or bool(self.cache.graph)): | if (uri!=self.cache.uri or not bool(self.cache.graph)): | def getPosts(self, uri, min=None, max=None, text=None): """ Get mailing list's posts | 5326848cb18abdcd7ae7dee3eb5e9a9428f6e9b5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2232/5326848cb18abdcd7ae7dee3eb5e9a9428f6e9b5/run.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14150,
87,
12,
2890,
16,
2003,
16,
1131,
33,
7036,
16,
943,
33,
7036,
16,
977,
33,
7036,
4672,
3536,
968,
4791,
310,
666,
1807,
10775,
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,
14150,
87,
12,
2890,
16,
2003,
16,
1131,
33,
7036,
16,
943,
33,
7036,
16,
977,
33,
7036,
4672,
3536,
968,
4791,
310,
666,
1807,
10775,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return rs.relations[:rs.relationCount] def _getJABRelationFirstTarget(self, key): for relation in self._JABRelations: if relation.key == key: return JAB(jabContext=JABHandler.JABContext(self.jabContext.hwnd, self.jabContext.vmID, relation.targets[0])) return None | targetObj=None for relation in rs.relations[:rs.relationCount]: for target in relation.targets[:relation.targetCount]: if not targetObj and relation.key == key: targetObj=JAB(jabContext=JABHandler.JABContext(self.jabContext.hwnd, self.jabContext.vmID, target)) else: JABHandler.bridgeDll.releaseJavaObject(self.jabContext.vmID,target) return targetObj | def _get__JABRelations(self): rs = self.jabContext.getAccessibleRelationSet() return rs.relations[:rs.relationCount] | 54708189be66ab71d02edb73600305e6da0cddb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/54708189be66ab71d02edb73600305e6da0cddb1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
972,
46,
2090,
10666,
12,
2890,
4672,
3597,
273,
365,
18,
78,
378,
1042,
18,
588,
10451,
3963,
694,
1435,
327,
3597,
18,
15018,
10531,
5453,
18,
5488,
1380,
65,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
972,
46,
2090,
10666,
12,
2890,
4672,
3597,
273,
365,
18,
78,
378,
1042,
18,
588,
10451,
3963,
694,
1435,
327,
3597,
18,
15018,
10531,
5453,
18,
5488,
1380,
65,
2,
-100,
-100... |
d.addCallback(_cbRunUploadPhase, fbmirror, client, myC, myCoH) | d.addCallback(_cbRunUploadPhase, fbmirror, client, myC, myCoH, True) | def _runUploadPhaseTestFallbackMirror(result, mirror, fbmirror, client, myC, myCoH): if fbmirror != mirror: # Test the fallback mirror only if the URL is the different than the # primary mirror ma = mmc.plugins.msc.mirror_api.MirrorApi(fbmirror) d = ma.isAvailable(myC.package_id) d.addCallback(_cbRunUploadPhase, fbmirror, client, myC, myCoH) return d else: # Go to upload phase, but pass False to tell that the package is not # available on the fallback mirror too _cbRunUploadPhase(False, mirror, client, myC, myCoH) | 94eba3c32c185e536fb0c9503c0f3514fa2dc0d9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/94eba3c32c185e536fb0c9503c0f3514fa2dc0d9/scheduling.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
4777,
11406,
4709,
12355,
13035,
12,
2088,
16,
15593,
16,
12754,
27197,
16,
1004,
16,
3399,
39,
16,
3399,
4249,
44,
4672,
309,
12754,
27197,
480,
15593,
30,
468,
7766,
326,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2681,
4777,
11406,
4709,
12355,
13035,
12,
2088,
16,
15593,
16,
12754,
27197,
16,
1004,
16,
3399,
39,
16,
3399,
4249,
44,
4672,
309,
12754,
27197,
480,
15593,
30,
468,
7766,
326,
59... |
<frameset rows="10%,90%"> | <frameset rows="20%,80%"> | def _index_page(self, name): return '<html><head><title>' + name + '''</title></head> <frameset cols="20%,80%"> <frameset rows="10%,90%"> <frame src="nav.html" name="GlobalNav"> <frame src="tables-index.html" name="List"> </frameset> <frame src="main.html" name="Main"> </frameset> <noframes> <h2>Frame Alert</h2><p> This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. <br> Link to<a HREF="main.html">Non-frame version.</a></noframes> </html>''' | 2c1349de7b857fb1276f48b4902ee6fc26f31b80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5495/2c1349de7b857fb1276f48b4902ee6fc26f31b80/docwidgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1615,
67,
2433,
12,
2890,
16,
508,
4672,
327,
2368,
2620,
4438,
1978,
4438,
2649,
1870,
397,
508,
397,
9163,
1757,
2649,
4695,
1978,
34,
411,
10278,
278,
5347,
1546,
3462,
9,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1615,
67,
2433,
12,
2890,
16,
508,
4672,
327,
2368,
2620,
4438,
1978,
4438,
2649,
1870,
397,
508,
397,
9163,
1757,
2649,
4695,
1978,
34,
411,
10278,
278,
5347,
1546,
3462,
9,
16,
... |
def addTerTransponder(self, tlist, frequency, symbol_rate, polarisation, fec, inversion, orbital_position): print "Add Sat: frequ: " + str(frequency) + " symbol: " + str(symbol_rate) + " pol: " + str(polarisation) + " fec: " + str(fec) + " inversion: " + str(inversion) print "orbpos: " + str(orbital_position) | def addTerTransponder(self, tlist, frequency): | def addTerTransponder(self, tlist, frequency, symbol_rate, polarisation, fec, inversion, orbital_position): print "Add Sat: frequ: " + str(frequency) + " symbol: " + str(symbol_rate) + " pol: " + str(polarisation) + " fec: " + str(fec) + " inversion: " + str(inversion) print "orbpos: " + str(orbital_position) parm = eDVBFrontendParametersTerrestrial() parm.frequency = frequency * 1000 parm.symbol_rate = symbol_rate * 1000 parm.polarisation = polarisation # eDVBFrontendParametersSatellite.Polarisation.Verti parm.fec = fec # eDVBFrontendParametersSatellite.FEC.f3_4; #parm.fec = 6 # AUTO parm.inversion = inversion #eDVBFrontendParametersSatellite.Inversion.Off; #parm.inversion = 2 #AUTO parm.orbital_position = int(orbital_position) tlist.append(parm) | 33ce69ca1622ce06f00661c5974d2fbb78e0c2d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/33ce69ca1622ce06f00661c5974d2fbb78e0c2d5/ScanSetup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
56,
264,
1429,
17707,
12,
2890,
16,
268,
1098,
16,
8670,
4672,
19924,
273,
425,
30199,
38,
21905,
2402,
56,
264,
455,
17493,
1435,
19924,
18,
14092,
273,
8670,
380,
4336,
19924,
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,
527,
56,
264,
1429,
17707,
12,
2890,
16,
268,
1098,
16,
8670,
4672,
19924,
273,
425,
30199,
38,
21905,
2402,
56,
264,
455,
17493,
1435,
19924,
18,
14092,
273,
8670,
380,
4336,
19924,
18,... |
answer = QMessageBox.warning(self.window,"Replace subtitle","%s already exists.\nWould you like to replace it?" %destinationPath, QMessageBox.Yes | QMessageBox.Default, QMessageBox.YesAll, QMessageBox.No |QMessageBox.Escape) if answer == QMessageBox.YesAll: replace_all = True elif answer == QMessageBox.No: | fileExistsBox = QMessageBox("File already exists","Local: %s \r\n\r\nRemote: %s\r\n\r\nHow would you like to proceed?\r\n" % (destinationPath, QFileInfo(destinationPath).fileName()), QMessageBox.Warning, QMessageBox.NoButton, QMessageBox.NoButton, QMessageBox.NoButton, self.window) skipButton = fileExistsBox.addButton(QString("Skip"), QMessageBox.ActionRole) replaceButton = fileExistsBox.addButton(QString("Replace"), QMessageBox.ActionRole) replaceAllButton = fileExistsBox.addButton(QString("Replace all"), QMessageBox.ActionRole) saveAsButton = fileExistsBox.addButton(QString("Save as..."), QMessageBox.ActionRole) cancelButton = fileExistsBox.addButton(QString("Cancel"), QMessageBox.ActionRole) fileExistsBox.exec_() answer = fileExistsBox.clickedButton() if answer == replaceAllButton: replace_all = True elif answer == saveAsButton: suggBaseName, suggFileExt = os.path.splitext(destinationPath) fNameCtr = 0 suggestedFileName = suggBaseName + '.' + sub.getLanguageXXX() + suggFileExt while (os.path.exists(suggestedFileName)): fNameCtr += 1 suggestedFileName = suggBaseName + '.' + sub.getLanguageXXX() + '-' + str(fNameCtr) + suggFileExt fileName = QFileDialog.getSaveFileName(None, "Save subtitle as...", suggestedFileName, 'All (*.*)') if fileName: destinationPath = fileName else: count += percentage continue elif answer == skipButton: | def onButtonDownload(self): #We download the subtitle in the same folder than the video subs = self.videoModel.getCheckedSubtitles() replace_all = False if not subs: QMessageBox.about(self.window,"Error","No subtitles selected to be downloaded") return total_subs = len(subs) percentage = 100/total_subs count = 0 answer = None success_downloaded = 0 self.status_progress = QProgressDialog("Downloading files...", "&Abort", 0, 100, self.window) self.status_progress.forceShow() for i, sub in enumerate(subs): if not self.progress(): break destinationPath = str(self.getDownloadPath(sub.getVideo(), sub).toUtf8()) if not destinationPath: break log.debug("Trying to download subtitle '%s'" % destinationPath) self.progress(count,"Downloading subtitle %s (%d/%d)" % (QFileInfo(destinationPath).fileName(), i + 1, total_subs)) #Check if we have write permissions, otherwise show warning window while True: #If the file and the folder don't have writte access. if not QFileInfo(destinationPath).isWritable() and not QFileInfo(QFileInfo(destinationPath).absoluteDir().path()).isWritable() : warningBox = QMessageBox("Error write permission", "%s cannot be saved.\nCheck that the folder exists and user has write-access permissions." %destinationPath , QMessageBox.Warning, QMessageBox.Retry | QMessageBox.Default , QMessageBox.Discard | QMessageBox.Escape, QMessageBox.NoButton, self.window) | d90947c926851a5b1e821e85c38a3e1863aebd58 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/d90947c926851a5b1e821e85c38a3e1863aebd58/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3616,
7109,
12,
2890,
4672,
468,
3218,
4224,
326,
20281,
316,
326,
1967,
3009,
2353,
326,
6191,
11630,
273,
365,
18,
9115,
1488,
18,
588,
11454,
1676,
17643,
1435,
1453,
67,
454,
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,
603,
3616,
7109,
12,
2890,
4672,
468,
3218,
4224,
326,
20281,
316,
326,
1967,
3009,
2353,
326,
6191,
11630,
273,
365,
18,
9115,
1488,
18,
588,
11454,
1676,
17643,
1435,
1453,
67,
454,
22... |
""" | r""" | def __iter__(self): """ EXAMPLES:: | d1bfa2893dda8805bd4c6dd2e7784bcbd0f5a99d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/d1bfa2893dda8805bd4c6dd2e7784bcbd0f5a99d/backtrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
436,
8395,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
436,
8395,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
" r.Provides('file: %s')", path, info, info) | " r.Provides('file', '%s')", path, info, info) | def _addRequirement(self, path, info, flags, pkg, depClass): if depClass == deps.FileDependencies: pathMap = self.recipe.autopkg.pathMap if info in pathMap and info not in pkg.providesMap: # if a package requires a file, includes that file, # and does not provide that file, it should error out self.error('%s requires %s, which is included but not' ' provided; use' " r.Provides('file: %s')", path, info, info) return if path not in pkg.requiresMap: # BuildPackage only fills in requiresMap for ELF files; we may # need to create a few more DependencySets. pkg.requiresMap[path] = deps.DependencySet() # in some cases, we get literal "(flags)" from the recipe if '(' in info: flagindex = info.index('(') flags = set(info[flagindex+1:-1].split() + list(flags)) info = info.split('(')[0] if flags: flags = [ (x, deps.FLAG_SENSE_REQUIRED) for x in flags ] pkg.requiresMap[path].addDep(depClass, deps.Dependency(info, flags)) | a65f25fbbe3f829a55cc693491e19f79d9acc678 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/a65f25fbbe3f829a55cc693491e19f79d9acc678/packagepolicy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
18599,
12,
2890,
16,
589,
16,
1123,
16,
2943,
16,
3475,
16,
5993,
797,
4672,
309,
5993,
797,
422,
8740,
18,
812,
8053,
30,
589,
863,
273,
365,
18,
3927,
3151,
18,
5854,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
18599,
12,
2890,
16,
589,
16,
1123,
16,
2943,
16,
3475,
16,
5993,
797,
4672,
309,
5993,
797,
422,
8740,
18,
812,
8053,
30,
589,
863,
273,
365,
18,
3927,
3151,
18,
5854,
55... |
Creates a python file correspond to the repy file, overwriting any file that exists with that name | Creates a python file correspond to the repy file, overwriting previously generated files that exists with that name | def translate(repyfilename): """ <Purpose> Translate a Repy file into a valid python module that can be invoked by the standard "import" statement. Creates a python file correspond to the repy file, with the name format <original name>_repy.py. Performs several checks to only perform a translation when necessary, to prevent accidentally clobbering other files The repyhelper and repyportability modules must be in the module path for the translated files <Arguments> repyfilename: A valid repy file name that exists and ends with a .repy extension. <Exceptions> ValueError if filename doesn't exist or doesn't have a .repy extension TranslationError if there was an error during file generation <Side Effects> Creates a python file correspond to the repy file, overwriting any file that exists with that name <Returns> The name of the Python module that was created in the current directory. This string can be used with __import__ to import the translated module. If there was an error during translation returns the empty string. """ if not os.path.isfile(repyfilename): raise ValueError("File " + repyfilename + " does not exist") modulename = _get_module_name(repyfilename) generatedfilename = modulename + ".py" if _translation_is_needed(repyfilename, generatedfilename): if _generate_python_file_from_repy(repyfilename, generatedfilename): return modulename return "" | e76c7f97a508411c48b24a16e30d7fca507bbde4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/e76c7f97a508411c48b24a16e30d7fca507bbde4/repyhelper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
266,
2074,
3459,
4672,
3536,
411,
10262,
4150,
34,
16820,
279,
868,
2074,
585,
1368,
279,
923,
5790,
1605,
716,
848,
506,
8187,
635,
326,
4529,
315,
5666,
6,
3021,
18,
225,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
266,
2074,
3459,
4672,
3536,
411,
10262,
4150,
34,
16820,
279,
868,
2074,
585,
1368,
279,
923,
5790,
1605,
716,
848,
506,
8187,
635,
326,
4529,
315,
5666,
6,
3021,
18,
225,
1... |
self.assertEquals(b.getvalue(), b"abcdef\n") | self.assertEquals(b.getvalue(), b"abcdef" + os.linesep.encode()) | def testEncodingErrorsWriting(self): # (1) default b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii") self.assertRaises(UnicodeError, t.write, "\xff") # (2) explicit strict b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii", errors="strict") self.assertRaises(UnicodeError, t.write, "\xff") # (3) ignore b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii", errors="ignore") t.write("abc\xffdef\n") t.flush() self.assertEquals(b.getvalue(), b"abcdef\n") # (4) replace b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii", errors="replace") t.write("abc\xffdef\n") t.flush() self.assertEquals(b.getvalue(), b"abc?def\n") | bb5891d24cfe03c62083cdf462d8467c395b331e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/bb5891d24cfe03c62083cdf462d8467c395b331e/test_io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4705,
4229,
18835,
12,
2890,
4672,
468,
261,
21,
13,
805,
324,
273,
2527,
18,
2160,
4294,
1435,
268,
273,
2527,
18,
1528,
4294,
3611,
12,
70,
16,
2688,
1546,
9184,
7923,
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,
1842,
4705,
4229,
18835,
12,
2890,
4672,
468,
261,
21,
13,
805,
324,
273,
2527,
18,
2160,
4294,
1435,
268,
273,
2527,
18,
1528,
4294,
3611,
12,
70,
16,
2688,
1546,
9184,
7923,
365,
18,... |
self.curframe.f_locals) | self.curframe_locals) | def _getval(self, arg): try: return eval(arg, self.curframe.f_globals, self.curframe.f_locals) except: t, v = sys.exc_info()[:2] if isinstance(t, str): exc_type_name = t else: exc_type_name = t.__name__ print >>self.stdout, '***', exc_type_name + ':', repr(v) raise | ccc5a6c58dc9d333fd4d902db7723596f1ceeb1e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/ccc5a6c58dc9d333fd4d902db7723596f1ceeb1e/pdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
1125,
12,
2890,
16,
1501,
4672,
775,
30,
327,
5302,
12,
3175,
16,
365,
18,
1397,
3789,
18,
74,
67,
16227,
16,
365,
18,
1397,
3789,
67,
17977,
13,
1335,
30,
268,
16,
331,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
1125,
12,
2890,
16,
1501,
4672,
775,
30,
327,
5302,
12,
3175,
16,
365,
18,
1397,
3789,
18,
74,
67,
16227,
16,
365,
18,
1397,
3789,
67,
17977,
13,
1335,
30,
268,
16,
331,
... |
cmd = ['python', os.path.join('tools', 'createPot.py'), '-cv'] | def runLocalizationCheck(options): if options.dryrun: failed = False else: # The -v argument tells createPot to only validate the # localizable string and not generate a .pot translation # file. cmd = ['python', os.path.join('tools', 'createPot.py'), '-cv'] result = build_lib.runCommand(cmd, timeout=180) failed = result != 0 if failed: log('Localization Check FAILED (%d)' % result) failedTests.append('Localization Check') log('- + ' * 15) return failed | f10b39e57023b6abe2ce2b12323e345804b40292 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/f10b39e57023b6abe2ce2b12323e345804b40292/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
19157,
1564,
12,
2116,
4672,
309,
702,
18,
25011,
2681,
30,
2535,
273,
1083,
469,
30,
468,
1021,
300,
90,
1237,
24551,
752,
18411,
358,
1338,
1954,
326,
468,
1191,
6934,
533,
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,
1086,
19157,
1564,
12,
2116,
4672,
309,
702,
18,
25011,
2681,
30,
2535,
273,
1083,
469,
30,
468,
1021,
300,
90,
1237,
24551,
752,
18411,
358,
1338,
1954,
326,
468,
1191,
6934,
533,
471,
... | |
np.savetxt(out, outdata, fmt='%.3f %15.5e %15.5e') | fd = open(out, 'w') for row in outdata: fd.write('%.3f %15.5e %15.5e \n' % (row[0], row[1], row[2]) ) fd.close() | def write_spectra(self, out='ir-spectra.dat', start=800, end=4000, npts=None, width=10, type='Gaussian', method='standard', direction='central'): """Write out infrared spectrum to file. | ca58b7198b29208628a3f697fbf8cd0b973c04f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5735/ca58b7198b29208628a3f697fbf8cd0b973c04f0/infrared.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
13234,
354,
12,
2890,
16,
596,
2218,
481,
17,
13234,
354,
18,
3404,
2187,
787,
33,
17374,
16,
679,
33,
24,
3784,
16,
290,
1092,
33,
7036,
16,
1835,
33,
2163,
16,
618,
2218,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
13234,
354,
12,
2890,
16,
596,
2218,
481,
17,
13234,
354,
18,
3404,
2187,
787,
33,
17374,
16,
679,
33,
24,
3784,
16,
290,
1092,
33,
7036,
16,
1835,
33,
2163,
16,
618,
2218,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.