rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
def add_nic(help, vlan, model=None, mac=None, netdev_id=None): if has_option(help, "netdev"): cmd = " -net nic,netdev=%s" % netdev_id | def add_nic(help, vlan, model=None, mac=None, netdev_id=None, nic_extra_params=None): if has_option(help, "device"): if model == "virtio": model="virtio-net-pci" if not model: model= "rtl8139" cmd = " -device %s" % model if mac: cmd += ",mac=%s" % mac if has_option(help, "netdev"): cmd += ",netdev=%s" % netdev_id else: cmd += "vlan=%d," % vlan if nic_extra_params: cmd += ",%s" % nic_extra_params | def add_nic(help, vlan, model=None, mac=None, netdev_id=None): if has_option(help, "netdev"): cmd = " -net nic,netdev=%s" % netdev_id else: cmd = " -net nic,vlan=%d" % vlan if model: cmd += ",model=%s" % model if mac: cmd += ",macaddr='%s'" % mac return cmd | b1592f6b43670af6fdd25a9c3a5ceb3324e91a78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/b1592f6b43670af6fdd25a9c3a5ceb3324e91a78/kvm_vm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
18738,
12,
5201,
16,
11954,
16,
938,
33,
7036,
16,
5318,
33,
7036,
16,
2901,
5206,
67,
350,
33,
7036,
16,
11562,
67,
7763,
67,
2010,
33,
7036,
4672,
309,
711,
67,
3482,
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,
527,
67,
18738,
12,
5201,
16,
11954,
16,
938,
33,
7036,
16,
5318,
33,
7036,
16,
2901,
5206,
67,
350,
33,
7036,
16,
11562,
67,
7763,
67,
2010,
33,
7036,
4672,
309,
711,
67,
3482,
12,
... |
UIINFO_ITEM_STOCK('Quit', None, mainquit, STOCK_MENU_QUIT), | UIINFO_ITEM_STOCK('Quit', None, html.mainquit, STOCK_MENU_QUIT), | def do_reload(self, _b): if len(history) == 0: return url = history[-1] del history[-1] self.load_url(html, url) | 0b588b6558655c350e5625a4b6113395b7461e97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10805/0b588b6558655c350e5625a4b6113395b7461e97/gtkhtml_demo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
17517,
12,
2890,
16,
389,
70,
4672,
309,
562,
12,
8189,
13,
422,
374,
30,
327,
880,
273,
4927,
18919,
21,
65,
1464,
4927,
18919,
21,
65,
365,
18,
945,
67,
718,
12,
2620,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
17517,
12,
2890,
16,
389,
70,
4672,
309,
562,
12,
8189,
13,
422,
374,
30,
327,
880,
273,
4927,
18919,
21,
65,
1464,
4927,
18919,
21,
65,
365,
18,
945,
67,
718,
12,
2620,
1... |
foo = self.templates() return self._isDisambig | locdis = self.site().family.disambig( self._site.lang ) for tn in self.templates(): tn = tn[:1].upper() + tn[1:] tn = tn.replace(u'_', u' ') while u" " in tn: tn = tn.replace(u" ", u" ") if tn in locdis: _isDisambig = True break else: _isDisambig = False return _isDisambig | def isDisambig(self): """Return True if this is a disambiguation page, False otherwise. | e209aca4a97685700a9613125cf0216fca9e1b79 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/e209aca4a97685700a9613125cf0216fca9e1b79/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
1669,
2536,
360,
12,
2890,
4672,
3536,
990,
1053,
309,
333,
353,
279,
1015,
26011,
367,
1363,
16,
1083,
3541,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
1669,
2536,
360,
12,
2890,
4672,
3536,
990,
1053,
309,
333,
353,
279,
1015,
26011,
367,
1363,
16,
1083,
3541,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if (ret == cont): | if ret == cont: | def func(self): frameFinished = 0 taskDoneStatus = -1 while (not frameFinished): task = self.taskList[self.index] # If this is a new task, set its start time and frame if (self.index > self.prevIndex): task.setStartTimeFrame(self.time, self.frame) self.prevIndex = self.index # Calculate this task's time since it started task.setCurrentTimeFrame(self.time, self.frame) # Execute the current task ret = task(task) # Check the return value from the task # If this current task wants to continue, # come back to it next frame if (ret == cont): taskDoneStatus = cont frameFinished = 1 # If this task is done, increment the index so that next frame # we will start executing the next task on the list elif (ret == done): self.index = self.index + 1 taskDoneStatus = cont frameFinished = 0 # If this task wants to exit, the sequence exits elif (ret == exit): taskDoneStatus = exit frameFinished = 1 | 1b2218da5bceb1c2d5383a72137ae2bb41972dbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/1b2218da5bceb1c2d5383a72137ae2bb41972dbd/Task.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
2890,
4672,
2623,
10577,
273,
374,
1562,
7387,
1482,
273,
300,
21,
1323,
261,
902,
2623,
10577,
4672,
1562,
273,
365,
18,
4146,
682,
63,
2890,
18,
1615,
65,
468,
971,
333,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
2890,
4672,
2623,
10577,
273,
374,
1562,
7387,
1482,
273,
300,
21,
1323,
261,
902,
2623,
10577,
4672,
1562,
273,
365,
18,
4146,
682,
63,
2890,
18,
1615,
65,
468,
971,
333,
35... |
else: | p0 = p else: p0 = x0 for iter in range(maxiter): p1 = func(p0, *args) p2 = func(p1, *args) d = p2 - 2.0 * p1 + p0 | def fixed_point(func, x0, args=(), xtol=1e-10, maxiter=500): """Find the point where func(x) == x Given a function of one or more variables and a starting point, find a fixed-point of the function: i.e. where func(x)=x. Uses Steffensen's Method using Aitken's Del^2 convergence acceleration. See Burden, Faires, "Numerical Analysis", 5th edition, pg. 80 See also: fmin, fmin_powell, fmin_cg, fmin_bfgs, fmin_ncg -- multivariate local optimizers leastsq -- nonlinear least squares minimizer fmin_l_bfgs_b, fmin_tnc, fmin_cobyla -- constrained multivariate optimizers anneal, brute -- global optimizers fminbound, brent, golden, bracket -- local scalar minimizers fsolve -- n-dimenstional root-finding brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding """ if not isscalar(x0): x0 = asarray(x0) p0 = x0 for iter in range(maxiter): p1 = func(p0, *args) p2 = func(p1, *args) d = p2 - 2.0 * p1 + p0 if isinstance(x0, ndarray): p = where(d == 0, p2, p0 - (p1 - p0)*(p1-p0) / d) if all(abs(p-p0) < xtol): return p else: if d == 0.0: return p2 else: p = p0 - (p1 - p0)*(p1-p0) / d if abs(p-p0) < xtol: return p p0 = p raise RuntimeError, "Failed to converge after %d iterations, value is %f" % (maxiter,p) | 126030232a94ef6039220c1806ee939f288b3c98 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/126030232a94ef6039220c1806ee939f288b3c98/minpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5499,
67,
1153,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
2163,
16,
25743,
33,
12483,
4672,
3536,
3125,
326,
1634,
1625,
1326,
12,
92,
13,
422,
619,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5499,
67,
1153,
12,
644,
16,
619,
20,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
2163,
16,
25743,
33,
12483,
4672,
3536,
3125,
326,
1634,
1625,
1326,
12,
92,
13,
422,
619,
225,
... |
if not UNT.exists(): | if not usertalkpage.exists(): | def DefineSign(welcomesite, SignPage): Page = wikipedia.Page(welcomesite, SignPage) SignText = Page.get() reg = "\* (.*?)\n" list_sign = re.findall(reg, SignText) return list_sign | bf50a20b7e53b37ac1a5a7ffeb2895c56bcf1f38 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/bf50a20b7e53b37ac1a5a7ffeb2895c56bcf1f38/welcome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13184,
2766,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
4672,
3460,
273,
21137,
18,
1964,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
13,
4383,
1528,
273,
3460,
18,
588,
1435,
960,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13184,
2766,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
4672,
3460,
273,
21137,
18,
1964,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
13,
4383,
1528,
273,
3460,
18,
588,
1435,
960,
273,
1... |
ad.auction1 as date, | to_char(ad.auction1, 'YYYY-MM-DD') as date, | def init(self, cr): cr.execute('''create or replace view report_auction_view2 as ( select ad.id as id, ad.auction1 as date, ad.id as "auction", count(al.id) as "obj_number", SUM(al.obj_price) as "sum_adj", SUM(al.gross_revenue) as "gross_revenue", SUM(al.net_revenue) as "net_revenue", avg(al.net_revenue) as "obj_margin", SUM(al.net_revenue)*100/sum(al.obj_price) as "obj_margin_procent" from auction_dates ad left join auction_lots al on (al.auction_id = ad.id) group by ad.id, ad.auction1 having sum(al.obj_price) <> 0 )''') | 75e4b85c0ead2254f26eecf8c127455428d67faf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/75e4b85c0ead2254f26eecf8c127455428d67faf/auction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
4422,
18,
8837,
2668,
6309,
2640,
578,
1453,
1476,
2605,
67,
69,
4062,
67,
1945,
22,
487,
261,
2027,
1261,
18,
350,
487,
612,
16,
358,
67,
3001,
12,
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,
1208,
12,
2890,
16,
4422,
4672,
4422,
18,
8837,
2668,
6309,
2640,
578,
1453,
1476,
2605,
67,
69,
4062,
67,
1945,
22,
487,
261,
2027,
1261,
18,
350,
487,
612,
16,
358,
67,
3001,
12,
3... |
file.write(xmlescape(str(self.pcdata))) | file.write(xmlescape(unicode(self.pcdata))) | def write(self, file = sys.stdout, indent = ""): file.write(self.start_tag(indent) + u"\n") for c in self.childNodes: if c.tagName not in self.validchildren: raise ElementError, "invalid child %s for %s" % (c.tagName, self.tagName) c.write(file, indent + ligolw.Indent) if self.pcdata: # FIXME: does this satisfactorily preserve precision # in floating point values? file.write(indent + ligolw.Indent) file.write(xmlescape(str(self.pcdata))) file.write(u"\n") file.write(self.end_tag(indent) + u"\n") | b46ffe685a1893246de273e2a344d956d4d7925e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/b46ffe685a1893246de273e2a344d956d4d7925e/param.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
585,
273,
2589,
18,
10283,
16,
3504,
273,
1408,
4672,
585,
18,
2626,
12,
2890,
18,
1937,
67,
2692,
12,
9355,
13,
397,
582,
12691,
82,
7923,
364,
276,
316,
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,
1045,
12,
2890,
16,
585,
273,
2589,
18,
10283,
16,
3504,
273,
1408,
4672,
585,
18,
2626,
12,
2890,
18,
1937,
67,
2692,
12,
9355,
13,
397,
582,
12691,
82,
7923,
364,
276,
316,
365,
18... |
def get_message(url): | def get_message(url, credentials=None): | def get_message(url): """Read a single message""" parsedurl = urlparse.urlparse(url) if parsedurl.scheme == 'https': conn = httplib.HTTPSConnection(parsedurl.netloc) else: conn = httplib.HTTPConnection(parsedurl.netloc) headers = {'Accept': 'application/json'} conn.request("GET", parsedurl.path, headers) response = conn.getresponse() print response.status, response.reason conn.close() if response.status != 200: return None return json.load(response) | 4d080ae1179357bf121e7177155d906af75470f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13970/4d080ae1179357bf121e7177155d906af75470f3/recv_fmtp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2150,
12,
718,
16,
4448,
33,
7036,
4672,
3536,
1994,
279,
2202,
883,
8395,
225,
2707,
718,
273,
15185,
18,
718,
2670,
12,
718,
13,
309,
2707,
718,
18,
9068,
422,
296,
4528,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2150,
12,
718,
16,
4448,
33,
7036,
4672,
3536,
1994,
279,
2202,
883,
8395,
225,
2707,
718,
273,
15185,
18,
718,
2670,
12,
718,
13,
309,
2707,
718,
18,
9068,
422,
296,
4528,
... |
SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.rpc_paths = ( '/xmlrpc/db', '/xmlrpc/common', '/xmlrpc/object', '/xmlrpc/report', '/xmlrpc/wizard', ) | SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.rpc_paths = get_rpc_paths() | def _dispatch(self, method, params): import traceback try: n=self.path.split("/")[-1] s=LocalService(n) m=getattr(s,method) s._service._response=None r=m(*params) res=s._service._response if res!=None: r=res return r except Exception, e: tb_s = reduce(lambda x, y: x+y, traceback.format_exception( sys.exc_type, sys.exc_value, sys.exc_traceback)) s=str(e) import tools if tools.config['debug_mode']: import pdb tb = sys.exc_info()[2] pdb.post_mortem(tb) raise xmlrpclib.Fault(s, tb_s) | 09afea13c37f288c97ff54bbf45e16d16d116b71 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/09afea13c37f288c97ff54bbf45e16d16d116b71/netsvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10739,
12,
2890,
16,
707,
16,
859,
4672,
1930,
10820,
775,
30,
290,
33,
2890,
18,
803,
18,
4939,
2932,
4898,
13,
18919,
21,
65,
272,
33,
25635,
12,
82,
13,
312,
33,
588,
1747,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10739,
12,
2890,
16,
707,
16,
859,
4672,
1930,
10820,
775,
30,
290,
33,
2890,
18,
803,
18,
4939,
2932,
4898,
13,
18919,
21,
65,
272,
33,
25635,
12,
82,
13,
312,
33,
588,
1747,
... |
count = count + 1 if(count == 1): parseStamp(line) | line = line.replace('\r\n', '') m = re.match(sysvals.stampfmt, line) if(m): testidx += 1 parseStamp(m, testrun[testidx].data) | def analyzeTraceLog(): global sysvals, data # the ftrace data is tied to the dmesg data if(not data.usedmesg): return # read through the ftrace and parse the data data.vprint("Analyzing the ftrace data...") ftrace_line_fmt = r"^ *(?P<time>[0-9\.]*) *\| *(?P<cpu>[0-9]*)\)"+\ " *(?P<proc>.*)-(?P<pid>[0-9]*) *\|"+\ "[ +!]*(?P<dur>[0-9\.]*) .*\| (?P<msg>.*)" ftemp = dict() inthepipe = False tf = open(sysvals.ftracefile, 'r') count = 0 for line in tf: count = count + 1 # grab the time stamp if it's valid if(count == 1): parseStamp(line) continue # parse only valid lines m = re.match(ftrace_line_fmt, line) if(not m): continue m_time = m.group("time") m_pid = m.group("pid") m_msg = m.group("msg") m_dur = m.group("dur") if(m_time and m_pid and m_msg): t = FTraceLine(m_time, m_msg, m_dur) pid = int(m_pid) else: continue # the line should be a call, return, or event if(not t.fcall and not t.freturn and not t.fevent): continue # only parse the ftrace data during suspend/resume if(not inthepipe): # look for the suspend start marker if(t.fevent): if(t.name == "SUSPEND START"): data.vprint("SUSPEND START %f %s:%d" % (t.time, sysvals.ftracefile, count)) inthepipe = True continue else: # look for the resume end marker if(t.fevent): if(t.name == "RESUME COMPLETE"): data.vprint("RESUME COMPLETE %f %s:%d" % (t.time, sysvals.ftracefile, count)) inthepipe = False break continue # create a callgraph object for the data if(pid not in ftemp): ftemp[pid] = FTraceCallGraph() # when the call is finished, see which device matches it if(ftemp[pid].addLine(t, m)): if(not ftemp[pid].sanityCheck()): id = "task %s cpu %s" % (pid, m.group("cpu")) data.vprint("Sanity check failed for "+id+", ignoring this callback") continue callstart = ftemp[pid].start callend = ftemp[pid].end for p in data.phases: if(data.dmesg[p]['start'] <= callstart and callstart <= data.dmesg[p]['end']): list = data.dmesg[p]['list'] for devname in list: dev = list[devname] if(pid == dev['pid'] and callstart <= dev['start'] and callend >= dev['end']): data.vprint("%15s [%f - %f] %s(%d)" % (p, callstart, callend, devname, pid)) dev['ftrace'] = ftemp[pid] break ftemp[pid] = FTraceCallGraph() tf.close() | 0c52bda8f6c5785b5982bc3636b627b4ccd59c3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/0c52bda8f6c5785b5982bc3636b627b4ccd59c3f/analyze_suspend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
3448,
1343,
13332,
2552,
2589,
4524,
16,
501,
225,
468,
326,
284,
5129,
501,
353,
268,
2092,
358,
326,
9113,
281,
75,
501,
309,
12,
902,
501,
18,
3668,
26244,
75,
4672,
327,
225... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
3448,
1343,
13332,
2552,
2589,
4524,
16,
501,
225,
468,
326,
284,
5129,
501,
353,
268,
2092,
358,
326,
9113,
281,
75,
501,
309,
12,
902,
501,
18,
3668,
26244,
75,
4672,
327,
225... |
f = open(self.dyncfgfile, "w") | f = open("%s/%s" % (self.dir, self.dyncfgfile), "w") | def _transmitDynConfig(self): f = open(self.dyncfgfile, "w") f.write(self.dynCfgText) f.write("\n") f.close() self.cfgModified = False | 33ecbecad68bc4a8b7a89a2c6581bfe454332a74 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2286/33ecbecad68bc4a8b7a89a2c6581bfe454332a74/LocalVermontInstance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2338,
1938,
10419,
809,
12,
2890,
4672,
284,
273,
1696,
27188,
87,
5258,
87,
6,
738,
261,
2890,
18,
1214,
16,
365,
18,
72,
1209,
2137,
768,
3631,
315,
91,
7923,
284,
18,
2626,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2338,
1938,
10419,
809,
12,
2890,
4672,
284,
273,
1696,
27188,
87,
5258,
87,
6,
738,
261,
2890,
18,
1214,
16,
365,
18,
72,
1209,
2137,
768,
3631,
315,
91,
7923,
284,
18,
2626,
1... |
print 'ms', rinfo.geometry() | def restart(self): rinfo = self.ui.rinfo print 'rinfo', rinfo for name, robot in self.game.w.robots.items(): robot.v.kill() | f44045f25eb6b1d7c4e8eb302e648f2bc339ddd3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3801/f44045f25eb6b1d7c4e8eb302e648f2bc339ddd3/qt4view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7870,
12,
2890,
4672,
436,
1376,
273,
365,
18,
4881,
18,
86,
1376,
1172,
296,
86,
1376,
2187,
436,
1376,
364,
508,
16,
14386,
316,
365,
18,
13957,
18,
91,
18,
28870,
87,
18,
3319,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7870,
12,
2890,
4672,
436,
1376,
273,
365,
18,
4881,
18,
86,
1376,
1172,
296,
86,
1376,
2187,
436,
1376,
364,
508,
16,
14386,
316,
365,
18,
13957,
18,
91,
18,
28870,
87,
18,
3319,
13... | |
(2.3561944901923448, 0.70710678118654757), (2.748893571891069, 0.38268343236508989), (3.1415926535897931, 1.2246063538223773e-16)] | (2.3561944901923448, 0.707106781186547...), (2.748893571891069, 0.38268343236508989), (3.1415926535897931, 1.2246...e-16)] | def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize = True): r""" Calculate plot points for a function f in the interval xrange. The adaptive refinement algorithm for plotting a function f. See the docstring for plot for a description of the algorithm. INPUT: f -- a function of one variable p1, p2 -- two points to refine between plot_points -- (default: 5) the minimal number of plot points. adaptive_recursion -- (default: 5) how many levels of recursion to go before giving up when doing adaptive refinement. Setting this to 0 disables adaptive refinement. adaptive_tolerance -- (default: 0.01) how large a difference should be before the adaptive refinement code considers it significant. See the documentation for plot() for more information. OUTPUT: list -- a list of points (x, f(x)) in the interval xrange, which aproximate the function f. TESTS: sage: from sage.plot.plot import generate_plot_points sage: generate_plot_points(sin, (0, pi), plot_points=2, adaptive_recursion=0) [(0.0, 0.0), (3.1415926535897931, 1.2246063538223773e-16)] sage: generate_plot_points(sin(x), (-pi, pi), randomize=False) [(-3.1415926535897931, -1.2246063538223773e-16), (-2.748893571891069, -0.38268343236508989), (-2.3561944901923448, -0.70710678118654757), (-2.1598449493429825, -0.83146961230254546), (-1.9634954084936207, -0.92387953251128674), (-1.7671458676442586, -0.98078528040323043), (-1.5707963267948966, -1.0), (-1.3744467859455345, -0.98078528040323043), (-1.1780972450961724, -0.92387953251128674), (-0.98174770424681035, -0.83146961230254524), (-0.78539816339744828, -0.70710678118654746), (-0.39269908169872414, -0.38268343236508978), (0.0, 0.0), (0.39269908169872414, 0.38268343236508978), (0.78539816339744828, 0.70710678118654746), (0.98174770424681035, 0.83146961230254524), (1.1780972450961724, 0.92387953251128674), (1.3744467859455345, 0.98078528040323043), (1.5707963267948966, 1.0), (1.7671458676442586, 0.98078528040323043), (1.9634954084936207, 0.92387953251128674), (2.1598449493429825, 0.83146961230254546), (2.3561944901923448, 0.70710678118654757), (2.748893571891069, 0.38268343236508989), (3.1415926535897931, 1.2246063538223773e-16)] This shows that lowering adaptive_tolerance and raising adaptive_recursion both increase the number of subdivision points: sage: x = var('x') sage: f = sin(1/x) sage: [len(generate_plot_points(f, (-pi, pi), adaptive_tolerance=i)) for i in [0.01, 0.001, 0.0001]] [42, 67, 104] sage: [len(generate_plot_points(f, (-pi, pi), adaptive_recursion=i)) for i in [5, 10, 15]] [34, 144, 897] """ x, data = var_and_list_of_values(xrange, plot_points) xmin = data[0] xmax = data[-1] delta = float(xmax-xmin) / plot_points random = current_randstate().python_random().random exceptions = 0; msg='' exception_indices = [] for i in range(len(data)): xi = data[i] # Slightly randomize the interior sample points if # randomize is true if randomize and i > 0 and i < plot_points-1: xi += delta*(random() - 0.5) try: data[i] = (float(xi), float(f(xi))) if str(data[i][1]) in ['nan', 'NaN', 'inf', '-inf']: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) exceptions += 1 exception_indices.append(i) except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) if i == 0: for j in range(1, 99): xj = xi + delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) elif i == plot_points-1: for j in range(1, 99): xj = xi - delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) else: exceptions += 1 exception_indices.append(i) exceptions += 1 exception_indices.append(i) data = [data[i] for i in range(len(data)) if i not in exception_indices] # adaptive refinement i, j = 0, 0 adaptive_tolerance = delta * float(adaptive_tolerance) adaptive_recursion = int(adaptive_recursion) while i < len(data) - 1: for p in adaptive_refinement(f, data[i], data[i+1], adaptive_tolerance=adaptive_tolerance, adaptive_recursion=adaptive_recursion): data.insert(i+1, p) i += 1 i += 1 if (len(data) == 0 and exceptions > 0) or exceptions > 10: sage.misc.misc.verbose("WARNING: When plotting, failed to evaluate function at %s points."%exceptions, level=0) sage.misc.misc.verbose("Last error message: '%s'"%msg, level=0) return data | d460fe3470a8ce0486f8ddea6d37bf0a22dcf1c8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/d460fe3470a8ce0486f8ddea6d37bf0a22dcf1c8/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... |
axes.set_ylim(ylim) | axes.set_ylim(map(float, ylim)) | def plot(ctx, f, xlim=[-5,5], ylim=None, points=200, file=None, dpi=None, singularities=[], axes=None): r""" Shows a simple 2D plot of a function `f(x)` or list of functions `[f_0(x), f_1(x), \ldots, f_n(x)]` over a given interval specified by *xlim*. Some examples:: plot(lambda x: exp(x)*li(x), [1, 4]) plot([cos, sin], [-4, 4]) plot([fresnels, fresnelc], [-4, 4]) plot([sqrt, cbrt], [-4, 4]) plot(lambda t: zeta(0.5+t*j), [-20, 20]) plot([floor, ceil, abs, sign], [-5, 5]) Points where the function raises a numerical exception or returns an infinite value are removed from the graph. Singularities can also be excluded explicitly as follows (useful for removing erroneous vertical lines):: plot(cot, ylim=[-5, 5]) # bad plot(cot, ylim=[-5, 5], singularities=[-pi, 0, pi]) # good For parts where the function assumes complex values, the real part is plotted with dashes and the imaginary part is plotted with dots. NOTE: This function requires matplotlib (pylab). """ if file: axes = None fig = None if not axes: import pylab fig = pylab.figure() axes = fig.add_subplot(111) if not isinstance(f, (tuple, list)): f = [f] a, b = xlim colors = ['b', 'r', 'g', 'm', 'k'] for n, func in enumerate(f): x = ctx.arange(a, b, (b-a)/float(points)) segments = [] segment = [] in_complex = False for i in xrange(len(x)): try: if i != 0: for sing in singularities: if x[i-1] <= sing and x[i] >= sing: raise ValueError v = func(x[i]) if ctx.isnan(v) or abs(v) > 1e300: raise ValueError if hasattr(v, "imag") and v.imag: re = float(v.real) im = float(v.imag) if not in_complex: in_complex = True segments.append(segment) segment = [] segment.append((float(x[i]), re, im)) else: if in_complex: in_complex = False segments.append(segment) segment = [] segment.append((float(x[i]), v)) except ctx.plot_ignore: if segment: segments.append(segment) segment = [] if segment: segments.append(segment) for segment in segments: x = [s[0] for s in segment] y = [s[1] for s in segment] if not x: continue c = colors[n % len(colors)] if len(segment[0]) == 3: z = [s[2] for s in segment] axes.plot(x, y, '--'+c, linewidth=3) axes.plot(x, z, ':'+c, linewidth=3) else: axes.plot(x, y, c, linewidth=3) axes.set_xlim(xlim) if ylim: axes.set_ylim(ylim) axes.set_xlabel('x') axes.set_ylabel('f(x)') axes.grid(True) if fig: if file: pylab.savefig(file, dpi=dpi) else: pylab.show() | 578da34327d6618b6ecbea19bf5250b72603e530 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11851/578da34327d6618b6ecbea19bf5250b72603e530/visualization.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
5900,
16,
284,
16,
19744,
33,
18919,
25,
16,
25,
6487,
18447,
33,
7036,
16,
3143,
33,
6976,
16,
585,
33,
7036,
16,
16361,
33,
7036,
16,
10048,
1961,
22850,
6487,
6515,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
5900,
16,
284,
16,
19744,
33,
18919,
25,
16,
25,
6487,
18447,
33,
7036,
16,
3143,
33,
6976,
16,
585,
33,
7036,
16,
16361,
33,
7036,
16,
10048,
1961,
22850,
6487,
6515,
33,
... |
fnode = nodes.node_file(None, None, nctx, fbro) | if not fbro.parent_id: cr.execute("select db_datas from ir_attachment where id = %s" ,(fbro.id,)) res = cr.fetchone() datas = res[0] or '' size = len(datas) else: fnode = nodes.node_file(None, None, nctx, fbro) datas = fnode.get_data(cr, fbro) datas = base64.encodestring(datas or '') size = fnode.get_data_len(cr, fbro) | def _data_get(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} fbrl = self.browse(cr, uid, ids, context=context) nctx = nodes.get_node_context(cr, uid, context={}) # nctx will /not/ inherit the caller's context. Most of # it would be useless, anyway (like active_id, active_model, # bin_size etc.) result = {} bin_size = context.get('bin_size', False) for fbro in fbrl: fnode = nodes.node_file(None, None, nctx, fbro) if not bin_size: data = fnode.get_data(cr, fbro) result[fbro.id] = base64.encodestring(data or '') else: result[fbro.id] = fnode.get_data_len(cr, fbro) | ebd5c62dbc6ffa689ea36b85951c4202e1317dac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ebd5c62dbc6ffa689ea36b85951c4202e1317dac/document.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
892,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
12754,
1321,
273,
365,
18,
25731,
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,
892,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
12754,
1321,
273,
365,
18,
25731,
12,
... |
try: deps = source.get_deps(meta, current) break except: continue | if source.is_pkg(meta, current): try: deps = source.get_deps(meta, current) break except: continue | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | d57ed55d8effce27305e2d5e8fdd99cfe930ac42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/d57ed55d8effce27305e2d5e8fdd99cfe930ac42/Packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
12,
2890,
16,
2191,
16,
810,
67,
16175,
16,
1198,
33,
8381,
4672,
9163,
3116,
326,
30442,
7213,
434,
777,
2181,
5030,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
12,
2890,
16,
2191,
16,
810,
67,
16175,
16,
1198,
33,
8381,
4672,
9163,
3116,
326,
30442,
7213,
434,
777,
2181,
5030,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
raise Exception('Unbound variable %s in template %s' % (e, template_file)) | raise Exception('Unbound var %s in template %s' % (e, template_file)) | def process_template(template_file, variables): class PercentSignTemplate(Template): delimiter = '%' try: template = PercentSignTemplate(slurp_file(template_file)) return template.substitute(variables) except KeyError, e: raise Exception('Unbound variable %s in template %s' % (e, template_file)) | 83f29203e9914995d719535adb4acb85e59d53a7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9556/83f29203e9914995d719535adb4acb85e59d53a7/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
3202,
12,
3202,
67,
768,
16,
3152,
4672,
667,
21198,
2766,
2283,
12,
2283,
4672,
5654,
273,
9089,
225,
775,
30,
1542,
273,
21198,
2766,
2283,
12,
2069,
295,
84,
67,
768,
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,
1207,
67,
3202,
12,
3202,
67,
768,
16,
3152,
4672,
667,
21198,
2766,
2283,
12,
2283,
4672,
5654,
273,
9089,
225,
775,
30,
1542,
273,
21198,
2766,
2283,
12,
2069,
295,
84,
67,
768,
12,
... |
if sys.platform!="win32": try: opts, args = getopt.getopt(sys.argv[1:], "a:dhn:s:v", ["affinity=", "debug", "help", "name=", "sleep=", "verbose"]) if len(args) > 0: serverUrl = args[0] except getopt.GetoptError, err: print str(err) | try: opts, args = getopt.getopt(sys.argv[1:], "a:dhn:s:v", ["affinity=", "debug", "help", "name=", "sleep=", "verbose"]) if len(args) > 0: serverUrl = args[0] except getopt.GetoptError, err: print str(err) usage() sys.exit(2) for o, a in opts: if o in ("-d", "--debug"): debug = True elif o in ("-h", "--help"): | def usage(): print ("Usage: worker [OPTIONS] [SERVER_URL]") print ("Start a Coalition worker using the server located at SERVER_URL.") print ("If no SERVER_URL is specified, the worker will try to locate the server using a broadcast.\n") print ("Options:") print (" -d, --debug\t\tRun without the main try/catch") print (" -h, --help\t\tShow this help") print (" -n, --name=NAME\tWorker name (default: "+name+")") print (" -s, --sleep=SLEEPTIME\tSleep time between two heart beats (default: "+str(sleepTime)+"s)") print (" -a, --affinity=AFFINITY\tAffinity words to jobs (default: \"\"") print (" -v, --verbose\t\tIncrease verbosity") print ("\nExample : worker -s 30 -v http://localhost:8080") | 025790af866b8b72d6a1915839839f93479497b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1233/025790af866b8b72d6a1915839839f93479497b7/worker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
7566,
5357,
30,
4322,
306,
12422,
65,
306,
4370,
67,
1785,
4279,
13,
1172,
7566,
1685,
279,
7695,
287,
608,
4322,
1450,
326,
1438,
13801,
622,
15061,
67,
1785,
1199,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
7566,
5357,
30,
4322,
306,
12422,
65,
306,
4370,
67,
1785,
4279,
13,
1172,
7566,
1685,
279,
7695,
287,
608,
4322,
1450,
326,
1438,
13801,
622,
15061,
67,
1785,
1199,
1... |
return ValueError() | raise ValueError() | def parseIDS(decomposition, index): if index >= len(decomposition): raise ValueError() | a330beae4fe7977ec8ad15d7367562a7a85cb596 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11128/a330beae4fe7977ec8ad15d7367562a7a85cb596/convertdecomposition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
19516,
12,
323,
24388,
16,
770,
4672,
309,
770,
1545,
562,
12,
323,
24388,
4672,
1002,
2068,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
19516,
12,
323,
24388,
16,
770,
4672,
309,
770,
1545,
562,
12,
323,
24388,
4672,
1002,
2068,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
updateItemIdFromFluid(item, fluid) | item.id = target.item.id item.update() | def fillfromitem( target, item, cprops ): if target.item == item: return False if CONTAINERS.has_key(target.item.id): quantity = 0 if target.item.hastag('quantity'): quantity = int(target.item.gettag('quantity')) fluid = '' if target.item.hastag('fluid'): fluid = str(target.item.gettag('fluid')) if quantity > 0 and FLUIDS.has_key(fluid): # completely refill the empty pitcher if not item.hastag('quantity'): item.settag('fluid', fluid) item.settag('quantity', quantity) item.resendtooltip() cprop = CONTAINERS[target.item.id] if cprop[2] == 0: target.item.delete() else: updateItemIdFromFluid(item, fluid) target.item.id = cprop[2] target.item.update() target.item.deltag('quantity') target.item.deltag('fluid') target.item.resendtooltip() # How much can we refill? elif int(item.gettag('quantity')) < cprops[1]: if fluid != item.gettag('fluid'): return False item_quant = int(item.gettag('quantity')) tofill = cprops[1] - item_quant if (quantity - tofill) <= 0: consume_all(target.item, cprops) item.settag('quantity', item_quant + quantity) #updateItemIdFromFluid(item, fluid) else: item.settag('quantity', item_quant + tofill) target.item.settag('quantity', quantity - tofill) target.item.resendtooltip() item.resendtooltip() | b71be6d9e1a36e5a0caaa5a404abf5484a77d357 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/b71be6d9e1a36e5a0caaa5a404abf5484a77d357/beverage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
2080,
1726,
12,
1018,
16,
761,
16,
276,
9693,
262,
30,
309,
1018,
18,
1726,
422,
761,
30,
327,
1083,
225,
309,
8020,
6964,
11367,
18,
5332,
67,
856,
12,
3299,
18,
1726,
18,
350... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
2080,
1726,
12,
1018,
16,
761,
16,
276,
9693,
262,
30,
309,
1018,
18,
1726,
422,
761,
30,
327,
1083,
225,
309,
8020,
6964,
11367,
18,
5332,
67,
856,
12,
3299,
18,
1726,
18,
350... |
if context.get('type') == 'project': | if Transaction().context.get('type') == 'project': | def default_type(self): if context.get('type') == 'project': return 'project' return 'task' | 545e357bc62e47288c1894c81fec5c97add859ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9304/545e357bc62e47288c1894c81fec5c97add859ad/work.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
723,
12,
2890,
4672,
309,
5947,
7675,
2472,
18,
588,
2668,
723,
6134,
422,
296,
4406,
4278,
327,
296,
4406,
11,
327,
296,
4146,
11,
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,
805,
67,
723,
12,
2890,
4672,
309,
5947,
7675,
2472,
18,
588,
2668,
723,
6134,
422,
296,
4406,
4278,
327,
296,
4406,
11,
327,
296,
4146,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
devtl.html['timeline'] = html_timetotal.format(suspend_time, resume_time, "Total") sktime = "%.3f"%((data.dmesg['suspend_cpu']['end'] - data.dmesg['suspend_general']['start'])*1000) sftime = "%.3f"%(data.fwSuspend / 1000000.0) rftime = "%.3f"%(data.fwResume / 1000000.0) rktime = "%.3f"%((data.dmesg['resume_general']['end'] - data.dmesg['resume_cpu']['start'])*1000) devtl.html['timeline'] += html_timegroups.format(sktime, sftime, rftime, rktime) | suspend_time = '%.0f'%((data.tSuspended-data.start)*1000 + \ (data.fwSuspend/1000000.0)) resume_time = '%.0f'%((tEnd-data.tSuspended)*1000 + \ (data.fwResume/1000000.0)) testdesc1 = 'Total' testdesc2 = '' if(len(testruns) > 1): testdesc1 = testdesc2 = textnum[data.testnumber] testdesc2 += ' ' if(data.tLow == 0): thtml = html_timetotal.format(suspend_time, \ resume_time, testdesc1) else: thtml = html_timetotal2.format(suspend_time, low_time, \ resume_time, testdesc1) devtl.html['timeline'] += thtml sktime = '%.3f'%((data.dmesg['suspend_machine']['end'] - \ data.getStart())*1000) sftime = '%.3f'%(data.fwSuspend / 1000000.0) rftime = '%.3f'%(data.fwResume / 1000000.0) rktime = '%.3f'%((data.getEnd() - \ data.dmesg['resume_machine']['start'])*1000) devtl.html['timeline'] += html_timegroups.format(sktime, \ sftime, rftime, rktime, testdesc2) | def createHTML(): global sysvals, data data.normalizeTime() # html function templates headline_stamp = '<div class="stamp">{0} {1} {2} {3}</div>\n' html_zoombox = '<center><button id="zoomin">ZOOM IN</button><button id="zoomout">ZOOM OUT</button><button id="zoomdef">ZOOM 1:1</button></center>\n<div id="dmesgzoombox" class="zoombox">\n' html_timeline = '<div id="{0}" class="timeline" style="height:{1}px">\n' html_device = '<div id="{0}" title="{1}" class="thread" style="left:{2}%;top:{3}%;height:{4}%;width:{5}%;">{6}</div>\n' html_phase = '<div class="phase" style="left:{0}%;width:{1}%;top:{2}%;height:{3}%;background-color:{4}">{5}</div>\n' html_legend = '<div class="square" style="left:{0}%;background-color:{1}"> {2}</div>\n' html_timetotal = '<table class="time1">\n<tr>'\ '<td class="gray">{2} Suspend Time: <b>{0} ms</b></td>'\ '<td class="gray">{2} Resume Time: <b>{1} ms</b></td>'\ '</tr>\n</table>\n' html_timegroups = '<table class="time2">\n<tr>'\ '<td class="green">Kernel Suspend: {0} ms</td>'\ '<td class="purple">Firmware Suspend: {1} ms</td>'\ '<td class="purple">Firmware Resume: {2} ms</td>'\ '<td class="yellow">Kernel Resume: {3} ms</td>'\ '</tr>\n</table>\n' # device timeline (dmesg) if(data.usedmesg): data.vprint("Creating Device Timeline...") devtl = Timeline() # Generate the header for this timeline t0 = data.start tMax = data.end tTotal = tMax - t0 if(tTotal == 0): print("ERROR: No timeline data") sys.exit() suspend_time = "%.0f"%(-data.start*1000) resume_time = "%.0f"%(data.end*1000) if data.fwValid: devtl.html['timeline'] = html_timetotal.format(suspend_time, resume_time, "Total") sktime = "%.3f"%((data.dmesg['suspend_cpu']['end'] - data.dmesg['suspend_general']['start'])*1000) sftime = "%.3f"%(data.fwSuspend / 1000000.0) rftime = "%.3f"%(data.fwResume / 1000000.0) rktime = "%.3f"%((data.dmesg['resume_general']['end'] - data.dmesg['resume_cpu']['start'])*1000) devtl.html['timeline'] += html_timegroups.format(sktime, sftime, rftime, rktime) else: devtl.html['timeline'] = html_timetotal.format(suspend_time, resume_time, "Kernel") # determine the maximum number of rows we need to draw timelinerows = 0 for phase in data.dmesg: list = data.dmesg[phase]['list'] rows = setTimelineRows(list, list) data.dmesg[phase]['row'] = rows if(rows > timelinerows): timelinerows = rows # calculate the timeline height and create its bounding box devtl.setRows(timelinerows + 1) devtl.html['timeline'] += html_zoombox; devtl.html['timeline'] += html_timeline.format("dmesg", devtl.height); # draw the colored boxes for each of the phases for b in data.dmesg: phase = data.dmesg[b] left = "%.3f" % (((phase['start']-data.start)*100)/tTotal) width = "%.3f" % (((phase['end']-phase['start'])*100)/tTotal) devtl.html['timeline'] += html_phase.format(left, width, "%.3f"%devtl.scaleH, "%.3f"%(100-devtl.scaleH), data.dmesg[b]['color'], "") # draw the time scale, try to make the number of labels readable devtl.html['scale'] = createTimeScale(t0, tMax, data.tSuspended) devtl.html['timeline'] += devtl.html['scale'] for b in data.dmesg: phaselist = data.dmesg[b]['list'] for d in phaselist: name = d if(d in data.altdevname): name = data.altdevname[d] dev = phaselist[d] height = (100.0 - devtl.scaleH)/data.dmesg[b]['row'] top = "%.3f" % ((dev['row']*height) + devtl.scaleH) left = "%.3f" % (((dev['start']-data.start)*100)/tTotal) width = "%.3f" % (((dev['end']-dev['start'])*100)/tTotal) len = " (%0.3f ms) " % ((dev['end']-dev['start'])*1000) color = "rgba(204,204,204,0.5)" devtl.html['timeline'] += html_device.format(dev['id'], name+len+b, left, top, "%.3f"%height, width, name) # timeline is finished devtl.html['timeline'] += "</div>\n</div>\n" # draw a legend which describes the phases by color devtl.html['legend'] = "<div class=\"legend\">\n" pdelta = 100.0/data.phases.__len__() pmargin = pdelta / 4.0 for phase in data.phases: order = "%.2f" % ((data.dmesg[phase]['order'] * pdelta) + pmargin) name = string.replace(phase, "_", " ") devtl.html['legend'] += html_legend.format(order, data.dmesg[phase]['color'], name) devtl.html['legend'] += "</div>\n" hf = open(sysvals.htmlfile, 'w') thread_height = 0 # write the html header first (html head, css code, everything up to the start of body) html_header = "<!DOCTYPE html>\n<html>\n<head>\n\ <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n\ <title>AnalyzeSuspend</title>\n\ <style type='text/css'>\n\ body {overflow-y: scroll;}\n\ .stamp {width: 100%;text-align:center;background-color:gray;line-height:30px;color:white;font: 25px Arial;}\n\ .callgraph {margin-top: 30px;box-shadow: 5px 5px 20px black;}\n\ .callgraph article * {padding-left: 28px;}\n\ h1 {color:black;font: bold 30px Times;}\n\ table {width:100%;}\n\ .gray {background-color:rgba(80,80,80,0.1);}\n\ .green {background-color:rgba(204,255,204,0.4);}\n\ .purple {background-color:rgba(128,0,128,0.2);}\n\ .yellow {background-color:rgba(255,255,204,0.4);}\n\ .time1 {font: 22px Arial;border:1px solid;}\n\ .time2 {font: 15px Arial;border-bottom:1px solid;border-left:1px solid;border-right:1px solid;}\n\ td {text-align: center;}\n\ .tdhl {color: red;}\n\ .hide {display: none;}\n\ .pf {display: none;}\n\ .pf:checked + label {background: url(\'data:image/svg+xml;utf,<?xml version=\"1.0\" standalone=\"no\"?><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"18\" width=\"18\" version=\"1.1\"><circle cx=\"9\" cy=\"9\" r=\"8\" stroke=\"black\" stroke-width=\"1\" fill=\"white\"/><rect x=\"4\" y=\"8\" width=\"10\" height=\"2\" style=\"fill:black;stroke-width:0\"/><rect x=\"8\" y=\"4\" width=\"2\" height=\"10\" style=\"fill:black;stroke-width:0\"/></svg>\') no-repeat left center;}\n\ .pf:not(:checked) ~ label {background: url(\'data:image/svg+xml;utf,<?xml version=\"1.0\" standalone=\"no\"?><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"18\" width=\"18\" version=\"1.1\"><circle cx=\"9\" cy=\"9\" r=\"8\" stroke=\"black\" stroke-width=\"1\" fill=\"white\"/><rect x=\"4\" y=\"8\" width=\"10\" height=\"2\" style=\"fill:black;stroke-width:0\"/></svg>\') no-repeat left center;}\n\ .pf:checked ~ *:not(:nth-child(2)) {display: none;}\n\ .zoombox {position: relative; width: 100%; overflow-x: scroll;}\n\ .timeline {position: relative; font-size: 14px;cursor: pointer;width: 100%; overflow: hidden; background-color:#dddddd;}\n\ .thread {position: absolute; height: "+"%.3f"%thread_height+"%; overflow: hidden; line-height: 30px; border:1px solid;text-align:center;white-space:nowrap;background-color:rgba(204,204,204,0.5);}\n\ .thread:hover {background-color:white;border:1px solid red;z-index:10;}\n\ .phase {position: absolute;overflow: hidden;border:0px;text-align:center;}\n\ .t {position: absolute; top: 0%; height: 100%; border-right:1px solid black;}\n\ .legend {position: relative; width: 100%; height: 40px; text-align: center;margin-bottom:20px}\n\ .legend .square {position:absolute;top:10px; width: 0px;height: 20px;border:1px solid;padding-left:20px;}\n\ button {height:40px;width:200px;margin-bottom:20px;margin-top:20px;font-size:24px;}\n\ </style>\n</head>\n<body>\n" hf.write(html_header) # write the test title and general info header if(data.stamp['time'] != ""): hf.write(headline_stamp.format(data.stamp['host'], data.stamp['kernel'], data.stamp['mode'], data.stamp['time'])) # write the dmesg data (device timeline) if(data.usedmesg): hf.write(devtl.html['timeline']) hf.write(devtl.html['legend']) hf.write('<div id="devicedetail"></div>\n') hf.write('<div id="devicetree"></div>\n') # write the ftrace data (callgraph) if(data.useftrace): hf.write('<section id="callgraphs" class="callgraph">\n') # write out the ftrace data converted to html html_func_top = '<article id="{0}" class="atop" style="background-color:{1}">\n<input type="checkbox" class="pf" id="f{2}" checked/><label for="f{2}">{3} {4}</label>\n' html_func_start = '<article>\n<input type="checkbox" class="pf" id="f{0}" checked/><label for="f{0}">{1} {2}</label>\n' html_func_end = '</article>\n' html_func_leaf = '<article>{0} {1}</article>\n' num = 0 for p in data.phases: list = data.dmesg[p]['list'] for devname in data.sortedDevices(p): if('ftrace' not in list[devname]): continue name = devname if(devname in data.altdevname): name = data.altdevname[devname] devid = list[devname]['id'] cg = list[devname]['ftrace'] flen = "(%.3f ms)" % ((cg.end - cg.start)*1000) hf.write(html_func_top.format(devid, data.dmesg[p]['color'], num, name+" "+p, flen)) num += 1 for line in cg.list: if(line.length < 0.000000001): flen = "" else: flen = "(%.3f ms)" % (line.length*1000) if(line.freturn and line.fcall): hf.write(html_func_leaf.format(line.name, flen)) elif(line.freturn): hf.write(html_func_end) else: hf.write(html_func_start.format(num, line.name, flen)) num += 1 hf.write(html_func_end) hf.write("\n\n </section>\n") # write the footer and close addScriptCode(hf) hf.write("</body>\n</html>\n") hf.close() return True | 0c52bda8f6c5785b5982bc3636b627b4ccd59c3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/0c52bda8f6c5785b5982bc3636b627b4ccd59c3f/analyze_suspend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4870,
13332,
2552,
2589,
4524,
16,
501,
225,
501,
18,
12237,
950,
1435,
225,
468,
1729,
445,
5539,
910,
1369,
67,
14317,
273,
2368,
2892,
667,
1546,
14317,
6441,
95,
20,
97,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4870,
13332,
2552,
2589,
4524,
16,
501,
225,
501,
18,
12237,
950,
1435,
225,
468,
1729,
445,
5539,
910,
1369,
67,
14317,
273,
2368,
2892,
667,
1546,
14317,
6441,
95,
20,
97,
288,
... |
logStatusMsg(u"building and installing mechanize opener with cookiefile", 5) opener = mechanize.build_opener(mechanize.HTTPCookieProcessor(cj), mechanize.HTTPRefreshProcessor(), mechanize.HTTPRedirectHandler(), mechanize.HTTPEquivProcessor()) | logStatusMsg(u"building and installing mechanize opener with cookies",5) opener = mechanize.build_opener(mechanize.HTTPCookieProcessor(cj), mechanize.HTTPRefreshProcessor(), mechanize.HTTPRedirectHandler(), mechanize.HTTPEquivProcessor()) | def mechRetrievePage(url, txheaders=(('User-agent', _USER_AGENT),), ): u"""URL is the full path to the resource we are retrieve/Posting txheaders: sequence of tuples of header key, value to manually add to the request object """ global cj, opener urlNotEncoded = url txheadersEncoded = ( (x.encode('utf-8'), y.encode('utf-8') ) for x,y in txheaders ) time.sleep( getConfig()['global']['sleepTime'] ) url = encodeQuoteUrl( url, encoding='utf-8' ) if not url: logStatusMsg(u"utf encoding and quoting url failed, returning false", 1 ) return False cjR = cookieHandler() if cjR == 1: logStatusMsg(u"building and installing mechanize opener with cookiefile", 5) opener = mechanize.build_opener(mechanize.HTTPCookieProcessor(cj), mechanize.HTTPRefreshProcessor(), mechanize.HTTPRedirectHandler(), mechanize.HTTPEquivProcessor()) mechanize.install_opener(opener) elif cjR == 0: logStatusMsg(u"building and installing mechanize opener without cookiefile", 5) opener = mechanize.build_opener(mechanize.HTTPRefreshProcessor(), mechanize.HTTPRedirectHandler(), mechanize.HTTPEquivProcessor()) mechanize.install_opener(opener) cj = 1 logStatusMsg(u"grabbing page at url %s" % urlNotEncoded, 5) return mechanize.urlopen( mechanize.Request( url, headers=dict( txheadersEncoded ) ) ) | 633e00b171a777d923e4aead2f2717108d53a3b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/633e00b171a777d923e4aead2f2717108d53a3b9/rssdler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1791,
343,
5767,
1964,
12,
718,
16,
2229,
2485,
28657,
2668,
1299,
17,
5629,
2187,
389,
4714,
67,
15005,
3631,
3631,
262,
30,
582,
8395,
1785,
353,
326,
1983,
589,
358,
326,
1058,
732,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1791,
343,
5767,
1964,
12,
718,
16,
2229,
2485,
28657,
2668,
1299,
17,
5629,
2187,
389,
4714,
67,
15005,
3631,
3631,
262,
30,
582,
8395,
1785,
353,
326,
1983,
589,
358,
326,
1058,
732,
... |
super(GitTool, cls).check_repository(path, username, password) | def check_repository(cls, path, username=None, password=None): """ Performs checks on a repository to test its validity. | 3ab58883213553277bbd9945d54d9ca83ef403e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/3ab58883213553277bbd9945d54d9ca83ef403e0/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9071,
12,
6429,
16,
589,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
4672,
3536,
27391,
4271,
603,
279,
3352,
358,
1842,
2097,
13800,
18,
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,
866,
67,
9071,
12,
6429,
16,
589,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
4672,
3536,
27391,
4271,
603,
279,
3352,
358,
1842,
2097,
13800,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
if fp not in (sys.stdout, repo.ui): | if hasattr(fp, 'name'): | def single(rev, seqno, fp): ctx = repo.changectx(rev) node = ctx.node() parents = [p.node() for p in ctx.parents() if p] if switch_parent: parents.reverse() prev = (parents and parents[0]) or nullid | f344c710b03370f2260c0d1b86851f0c8b60d246 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/f344c710b03370f2260c0d1b86851f0c8b60d246/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2202,
12,
9083,
16,
30734,
16,
4253,
4672,
1103,
273,
3538,
18,
24083,
386,
92,
12,
9083,
13,
756,
273,
1103,
18,
2159,
1435,
6298,
273,
306,
84,
18,
2159,
1435,
364,
293,
316,
1103,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2202,
12,
9083,
16,
30734,
16,
4253,
4672,
1103,
273,
3538,
18,
24083,
386,
92,
12,
9083,
13,
756,
273,
1103,
18,
2159,
1435,
6298,
273,
306,
84,
18,
2159,
1435,
364,
293,
316,
1103,
... |
('opts', c_uint8, 1)) | ('opts', c_uint8, 1, 0)) | def cfunc(name, dll, result, *args): """Build and apply a ctypes prototype complete with parameter flags e.g. cvMinMaxLoc = cfunc('cvMinMaxLoc', _cxDLL, None, ('image', IplImage_p, 1), ('min_val', c_double_p, 2), ('max_val', c_double_p, 2), ('min_loc', CvPoint_p, 2), ('max_loc', CvPoint_p, 2), ('mask', IplImage_p, 1, None)) Means locate cvMinMaxLoc in dll _cxDLL, it returns nothing. The first argument is an input parameter. The next 4 arguments are output, and the last argument is input with an optional value. A typical call might look like: min_val,max_val,min_loc,max_loc = cvMinMaxLoc(img) """ atypes = [] aflags = [] for arg in args: atypes.append(arg[1]) aflags.append((arg[2], arg[0]) + arg[3:]) return CFUNCTYPE(result, *atypes)((name, dll), tuple(aflags)) | 0d6b60279dbed519580ffe8743a683a13eab3a6b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4926/0d6b60279dbed519580ffe8743a683a13eab3a6b/tc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
644,
12,
529,
16,
302,
2906,
16,
563,
16,
380,
1968,
4672,
3536,
3116,
471,
2230,
279,
6983,
4409,
3912,
598,
1569,
2943,
225,
425,
18,
75,
18,
8951,
17454,
1333,
273,
276,
644,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
644,
12,
529,
16,
302,
2906,
16,
563,
16,
380,
1968,
4672,
3536,
3116,
471,
2230,
279,
6983,
4409,
3912,
598,
1569,
2943,
225,
425,
18,
75,
18,
8951,
17454,
1333,
273,
276,
644,
... |
errorMessage = _("An unknown error occurred.") | errorMessage = constants.UNKNOWN_ERROR | def displaySMTPSendError (self, mailMessage): """ Called when the SMTP Send generated an error. """ if mailMessage is not None and mailMessage.isOutbound: """ Maybe we should select the message in CPIA? """ errorStrings = [] for error in mailMessage.deliveryExtension.deliveryErrors: errorStrings.append(error.errorString) | b73de39521bee8ef4874e4a550496256db00a381 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b73de39521bee8ef4874e4a550496256db00a381/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
55,
14636,
3826,
668,
261,
2890,
16,
4791,
1079,
4672,
3536,
11782,
1347,
326,
18102,
2479,
4374,
392,
555,
18,
3536,
309,
4791,
1079,
353,
486,
599,
471,
4791,
1079,
18,
291,
1787... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
55,
14636,
3826,
668,
261,
2890,
16,
4791,
1079,
4672,
3536,
11782,
1347,
326,
18102,
2479,
4374,
392,
555,
18,
3536,
309,
4791,
1079,
353,
486,
599,
471,
4791,
1079,
18,
291,
1787... |
def __setSiteStatusInMask(self,site,status,authorDN='Unknown',comment='No comment'): | def __setSiteStatusInMask( self, site, status, authorDN = 'Unknown', comment = 'No comment' ): | def __setSiteStatusInMask(self,site,status,authorDN='Unknown',comment='No comment'): """ Set the given site status to 'status' or add a new active site """ | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
4956,
1482,
382,
5796,
12,
365,
16,
2834,
16,
1267,
16,
2869,
8609,
273,
296,
4874,
2187,
2879,
273,
296,
2279,
2879,
11,
262,
30,
3536,
225,
1000,
326,
864,
2834,
1267,
358... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
4956,
1482,
382,
5796,
12,
365,
16,
2834,
16,
1267,
16,
2869,
8609,
273,
296,
4874,
2187,
2879,
273,
296,
2279,
2879,
11,
262,
30,
3536,
225,
1000,
326,
864,
2834,
1267,
358... |
initrd_fetch_cmd = ("cp %s/isolinux/%s %s" % (self.nfs_mount, self.initrd, self.image_path)) | initrd_fetch_cmd = ("cp %s/%s/%s %s" % (self.nfs_mount, self.boot_path, self.initrd, self.image_path)) | def setup_nfs(self): """ Copy the vmlinuz and initrd.img from nfs. """ print "Copying the vmlinuz and initrd.img from nfs" | 05c7b87678411674e1b8b8228fe97a5b64354c3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/05c7b87678411674e1b8b8228fe97a5b64354c3b/unattended.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
82,
2556,
12,
2890,
4672,
3536,
5631,
326,
331,
781,
6860,
94,
471,
1208,
13623,
18,
6081,
628,
290,
2556,
18,
3536,
1172,
315,
2951,
310,
326,
331,
781,
6860,
94,
471,
1208,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3875,
67,
82,
2556,
12,
2890,
4672,
3536,
5631,
326,
331,
781,
6860,
94,
471,
1208,
13623,
18,
6081,
628,
290,
2556,
18,
3536,
1172,
315,
2951,
310,
326,
331,
781,
6860,
94,
471,
1208,... |
info[fields[i]] = escape(row[i]) | info[fields[i]] = row[i] | def get_ticket (self, id): global fields cnx = db.get_connection () cursor = cnx.cursor () | 8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8ed3b4e22773597d1e4623a4cd0ca5dbcc438c8f/Ticket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
16282,
261,
2890,
16,
612,
4672,
2552,
1466,
29492,
273,
1319,
18,
588,
67,
4071,
1832,
3347,
273,
29492,
18,
9216,
1832,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
16282,
261,
2890,
16,
612,
4672,
2552,
1466,
29492,
273,
1319,
18,
588,
67,
4071,
1832,
3347,
273,
29492,
18,
9216,
1832,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
redirect += 1 | if "<ul>" in line: redirect += 1 else: continue | def getReferences(self, follow_redirects=True, withTemplateInclusion=True, onlyTemplateInclusion=False, redirectsOnly=False ): """ Yield all pages that link to the page. If you need a full list of referring pages, use this: | 96ca1cdab3edd4447330ef4bde2b8926043a506e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/96ca1cdab3edd4447330ef4bde2b8926043a506e/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
2980,
12,
2890,
16,
2805,
67,
22715,
33,
5510,
16,
598,
2283,
382,
15335,
33,
5510,
16,
1338,
2283,
382,
15335,
33,
8381,
16,
18064,
3386,
33,
8381,
262,
30,
3536,
31666,
777,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
2980,
12,
2890,
16,
2805,
67,
22715,
33,
5510,
16,
598,
2283,
382,
15335,
33,
5510,
16,
1338,
2283,
382,
15335,
33,
8381,
16,
18064,
3386,
33,
8381,
262,
30,
3536,
31666,
777,
46... |
self.conn.settimeout(1) | self.conn.settimeout(10) | def waitHandshake(self): print 'Waiting for Crossfire handshake...' try: shake = self.conn.recv(25) except socket.error as err: print err if shake == HANDSHAKE_STRING: print 'Received Crossfire handshake.' self.conn.settimeout(1) self.conn.send(HANDSHAKE_STRING) self.socketCondition.acquire() self.writer.start() self.reader.start() self.socketCondition.notifyAll() self.socketCondition.release() | 5ff7b3b6722adf0535960e4a3538deb96c66b426 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11436/5ff7b3b6722adf0535960e4a3538deb96c66b426/crossfire_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
14545,
12,
2890,
4672,
1172,
296,
15946,
364,
19742,
12179,
11942,
7821,
775,
30,
699,
911,
273,
365,
18,
4646,
18,
18334,
12,
2947,
13,
1335,
2987,
18,
1636,
487,
393,
30,
1172,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
14545,
12,
2890,
4672,
1172,
296,
15946,
364,
19742,
12179,
11942,
7821,
775,
30,
699,
911,
273,
365,
18,
4646,
18,
18334,
12,
2947,
13,
1335,
2987,
18,
1636,
487,
393,
30,
1172,
... |
dataString = "".join( file.readlines() ) | dataString = "" while file in select.select( [ file ], [], [], 1 )[0]: nB = file.read() if not nB: break dataString += nB | def __readFromFile( self, file, baseLength, doAll ): try: if doAll: dataString = "".join( file.readlines() ) else: dataString = file.readline() except Exception, v: pass if len( dataString ) + baseLength > self.bufferLimit: gLogger.error( 'Maximum output buffer length reached' ) retDict = S_ERROR( 'Reached maximum allowed length (%d bytes) for called ' 'function return value' % self.bufferLimit ) retDict[ 'Value' ] = dataString return retDict | 98eab470e9d30064f613518b8b9dbf42597e9009 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/98eab470e9d30064f613518b8b9dbf42597e9009/Subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
13087,
12,
365,
16,
585,
16,
1026,
1782,
16,
741,
1595,
262,
30,
775,
30,
309,
741,
1595,
30,
501,
780,
273,
1408,
1323,
585,
316,
2027,
18,
4025,
12,
306,
585,
308,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
13087,
12,
365,
16,
585,
16,
1026,
1782,
16,
741,
1595,
262,
30,
775,
30,
309,
741,
1595,
30,
501,
780,
273,
1408,
1323,
585,
316,
2027,
18,
4025,
12,
306,
585,
308,
16,
... |
register(cmd.lower(), None, GenericBrowser("%s %%s" % cmd.lower())) | register(cmd.lower(), None, GenericBrowser( "%s '%%s'" % cmd.lower())) | def open_new(self, url): self.open(url) | 925f14427416c1c5a8c6e71d17daac20e248c7b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/925f14427416c1c5a8c6e71d17daac20e248c7b0/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'tablib.packages.simplejson' | 'tablib.packages.simplejson', | def publish(): """Publish to PyPi""" os.system("python setup.py sdist upload") | a3c82804cdd7c9f2215b5abd074ca2d166aa1f7c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14944/a3c82804cdd7c9f2215b5abd074ca2d166aa1f7c/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3808,
13332,
3536,
6024,
358,
4707,
16539,
8395,
1140,
18,
4299,
2932,
8103,
3875,
18,
2074,
272,
4413,
3617,
7923,
225,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3808,
13332,
3536,
6024,
358,
4707,
16539,
8395,
1140,
18,
4299,
2932,
8103,
3875,
18,
2074,
272,
4413,
3617,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elif isinstance(d, (tuple,list)): | elif isinstance(d, (tuple, list)): | def polynomial_system(self, P=None, K=None): """ Return a MPolynomialSystem for self for a given plaintext-key pair. | 26b5b14a2a46b23848ccefac3b41425cf353e86a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/26b5b14a2a46b23848ccefac3b41425cf353e86a/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16991,
67,
4299,
12,
2890,
16,
453,
33,
7036,
16,
1475,
33,
7036,
4672,
3536,
2000,
279,
490,
5850,
13602,
3163,
364,
365,
364,
279,
864,
11917,
17,
856,
3082,
18,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16991,
67,
4299,
12,
2890,
16,
453,
33,
7036,
16,
1475,
33,
7036,
4672,
3536,
2000,
279,
490,
5850,
13602,
3163,
364,
365,
364,
279,
864,
11917,
17,
856,
3082,
18,
2,
-100,
-100,
-100,... |
outdir = outdir[ : outdir.rfind('/') ] + '/Submission' \ + str( self.bossJob.runningJob['submission'] ) | def doBOSSSubmit(self): """ _doSubmit_ | 4931c84ae4f8b7d1d709b69e031e6f6306a62735 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/4931c84ae4f8b7d1d709b69e031e6f6306a62735/BossLiteBulkInterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
5315,
1260,
11620,
12,
2890,
4672,
3536,
389,
2896,
11620,
67,
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,
741,
5315,
1260,
11620,
12,
2890,
4672,
3536,
389,
2896,
11620,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
shutil.rmtree(location / 'media' / app) | os.remove(os.path.abspath(location / 'media' / app)) | def syncmedia(self, *args): import os, shutil from glob import glob from omeroweb.settings import INSTALLED_APPS location = self.ctx.dir / "lib" / "python" / "omeroweb" # Targets apps = map(lambda x: x.startswith('omeroweb.') and x[9:] or x, INSTALLED_APPS) apps = filter(lambda x: os.path.exists(location / x), apps) # Destination dir if not os.path.exists(location / 'media'): os.mkdir(location / 'media') # Create app media links for app in apps: media_dir = location / app / 'media' if os.path.exists(media_dir): if os.path.exists(location / 'media' / app): shutil.rmtree(location / 'media' / app) os.symlink(os.path.abspath(media_dir), location / 'media' / app) | d65a996e99513630dd11e6d2d5f19e5be4e7e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/d65a996e99513630dd11e6d2d5f19e5be4e7e540/web.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
5829,
12,
2890,
16,
380,
1968,
4672,
1930,
1140,
16,
11060,
628,
4715,
1930,
4715,
628,
320,
6592,
543,
24008,
18,
4272,
1930,
22880,
27751,
67,
2203,
5857,
2117,
273,
365,
18,
590... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
5829,
12,
2890,
16,
380,
1968,
4672,
1930,
1140,
16,
11060,
628,
4715,
1930,
4715,
628,
320,
6592,
543,
24008,
18,
4272,
1930,
22880,
27751,
67,
2203,
5857,
2117,
273,
365,
18,
590... |
i += 1 | i = i + 1 | def equalkey(self, *greenargs): i = 0 for name in green_args_names: if getattr(self, 'green_' + name) != greenargs[i]: return False i += 1 return True | ba525f352997e20a37e277c10b1ee77d064ab3bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/ba525f352997e20a37e277c10b1ee77d064ab3bd/warmspot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3959,
856,
12,
2890,
16,
380,
11571,
1968,
4672,
277,
273,
374,
364,
508,
316,
10004,
67,
1968,
67,
1973,
30,
309,
3869,
12,
2890,
16,
296,
11571,
4623,
397,
508,
13,
480,
10004,
1968,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3959,
856,
12,
2890,
16,
380,
11571,
1968,
4672,
277,
273,
374,
364,
508,
316,
10004,
67,
1968,
67,
1973,
30,
309,
3869,
12,
2890,
16,
296,
11571,
4623,
397,
508,
13,
480,
10004,
1968,... |
def __registerFile(self,fileTuples,catalog): | def __registerFile( self, fileTuples, catalog ): | def __registerFile(self,fileTuples,catalog): seDict = {} for lfn,physicalFile,fileSize,storageElementName,fileGuid,checksum in fileTuples: if not seDict.has_key(storageElementName): seDict[storageElementName] = [] seDict[storageElementName].append((lfn,physicalFile,fileSize,storageElementName,fileGuid,checksum)) successful = {} failed = {} fileDict = {} for storageElementName,fileTuple in seDict.items(): destStorageElement = StorageElement(storageElementName,overwride=True) res = destStorageElement.isValid() if not res['OK']: errStr = "ReplicaManager.__registerFile: The storage element is not currently valid." gLogger.error(errStr,"%s %s" % (storageElementName,res['Message'])) for lfn,physicalFile,fileSize,storageElementName,fileGuid,checksum in fileTuple: failed[lfn] = errStr else: storageElementName = destStorageElement.getStorageElementName()['Value'] for lfn,physicalFile,fileSize,storageElementName,fileGuid,checksum in fileTuple: res = destStorageElement.getPfnForProtocol(physicalFile,self.registrationProtocol,withPort=False) if not res['OK']: pfn = physicalFile else: pfn = res['Value'] tuple = (lfn,pfn,fileSize,storageElementName,fileGuid,checksum) fileDict[lfn] = {'PFN':pfn,'Size':fileSize,'SE':storageElementName,'GUID':fileGuid,'Checksum':checksum} gLogger.verbose("ReplicaManager.__registerFile: Resolved %s files for registration." % len(fileDict.keys())) if catalog: fileCatalog = FileCatalog(catalog) res = fileCatalog.addFile(fileDict) else: res = self.fileCatalogue.addFile(fileDict) if not res['OK']: errStr = "ReplicaManager.__registerFile: Completely failed to register files." gLogger.error(errStr,res['Message']) return S_ERROR(errStr) failed.update(res['Value']['Failed']) successful = res['Value']['Successful'] resDict = {'Successful':successful,'Failed':failed} return S_OK(resDict) | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4861,
812,
12,
365,
16,
585,
25813,
16,
6222,
262,
30,
695,
5014,
273,
2618,
364,
328,
4293,
16,
20441,
812,
16,
768,
1225,
16,
5697,
30584,
16,
768,
22549,
16,
15149,
316,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4861,
812,
12,
365,
16,
585,
25813,
16,
6222,
262,
30,
695,
5014,
273,
2618,
364,
328,
4293,
16,
20441,
812,
16,
768,
1225,
16,
5697,
30584,
16,
768,
22549,
16,
15149,
316,
585,
... |
name = '<Unkown>' | name = '<Unknown>' | def add_record(self,service_store,rec_path): | 11e210c5d6229842f23f3a930654f5a48731724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/11e210c5d6229842f23f3a930654f5a48731724f/bluetool_browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3366,
12,
2890,
16,
3278,
67,
2233,
16,
3927,
67,
803,
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,
527,
67,
3366,
12,
2890,
16,
3278,
67,
2233,
16,
3927,
67,
803,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
sys.stderr.write('<RTS %s>' % (self.rts_state and 'active' or 'inactive')) | sys.stderr.write('--- RTS %s ---\n' % (self.rts_state and 'active' or 'inactive')) | def writer(self): """loop and copy console->serial until EXITCHARCTER character is found. when MENUCHARACTER is found, interpret the next key locally. """ menu_active = False try: while self.alive: try: c = console.getkey() except KeyboardInterrupt: c = '\x03' if menu_active: if c == MENUCHARACTER or c == EXITCHARCTER: # Menu character again/exit char -> send itself self.serial.write(c) # send character if self.echo: sys.stdout.write(c) elif c == '\x15': # CTRL+U -> upload file sys.stderr.write('\n> File to upload: ') sys.stderr.flush() console.cleanup() filename = sys.stdin.readline().rstrip('\r\n') if filename: try: file = open(filename, 'r') sys.stderr.write('> Sending file %s ' % filename) while True: line = file.readline().rstrip('\r\n') if not line: break self.serial.write(line) self.serial.write('\r\n') # Wait for output buffer to drain. self.serial.flush() sys.stderr.write('.') # Progress indicator. sys.stderr.write('\n> File %s sent.\n' % filename) except IOError, e: sys.stderr.write('> Error opening file %s: %s\n' % (filename, e)) console.setup() elif c in '\x08hH?': # CTRL+H, h, H, ? -> Show help sys.stderr.write(get_help_text()) elif c == '\x12': # CTRL+R -> Toggle RTS self.rts_state = not self.rts_state self.serial.setRTS(self.rts_state) sys.stderr.write('<RTS %s>' % (self.rts_state and 'active' or 'inactive')) elif c == '\x04': # CTRL+D -> Toggle DTR self.dtr_state = not self.dtr_state self.serial.setDTR(self.dtr_state) sys.stderr.write('<DTR %s>' % (self.dtr_state and 'active' or 'inactive')) elif c == '\x02': # CTRL+B -> toggle BREAK condition self.break_state = not self.break_state self.serial.setBreak(self.break_state) sys.stderr.write('<BREAK %s>' % (self.break_state and 'active' or 'inactive')) elif c == '\x05': # CTRL+E -> toggle local echo self.echo = not self.echo sys.stderr.write('<local echo %s>' % (self.echo and 'active' or 'inactive')) elif c == '\x09': # CTRL+I -> info self.dump_port_settings() #~ elif c in 'pP': # P -> change port XXX reader thread would exit elif c in 'bB': # B -> change baudrate sys.stderr.write('\n> Baudrate: ') sys.stderr.flush() console.cleanup() backup = self.serial.baudrate try: self.serial.baudrate = int(sys.stdin.readline().strip()) except ValueError, e: sys.stderr.write('\n> Error setting baudrate: %s' % (e,)) self.serial.baudrate = backup console.setup() self.dump_port_settings() elif c == '8': # 8 -> change to 8 bits self.serial.bytesize = serial.EIGHTBITS self.dump_port_settings() elif c == '7': # 7 -> change to 8 bits self.serial.bytesize = serial.SEVENBITS self.dump_port_settings() elif c in 'eE': # E -> change to even parity self.serial.parity = serial.PARITY_EVEN self.dump_port_settings() elif c in 'oO': # O -> change to odd parity self.serial.parity = serial.PARITY_ODD self.dump_port_settings() elif c in 'mM': # M -> change to mark parity self.serial.parity = serial.PARITY_MARK self.dump_port_settings() elif c in 'sS': # S -> change to space parity self.serial.parity = serial.PARITY_SPACE self.dump_port_settings() elif c in 'nN': # N -> change to no parity self.serial.parity = serial.PARITY_NONE self.dump_port_settings() elif c == '1': # 1 -> change to 1 stop bits self.serial.stopbits = serial.STOPBITS_ONE self.dump_port_settings() elif c == '2': # 2 -> change to 2 stop bits self.serial.stopbits = serial.STOPBITS_TWO self.dump_port_settings() elif c == '3': # 3 -> change to 1.5 stop bits self.serial.stopbits = serial.STOPBITS_ONE_POINT_FIVE self.dump_port_settings() elif c in 'xX': # X -> change software flow control self.serial.xonxoff = (c == 'X') self.dump_port_settings() elif c in 'rR': # R -> change hardware flow control self.serial.rtscts = (c == 'R') self.dump_port_settings() else: sys.stderr.write('<unknown menu character %s>' % key_description(c)) menu_active = False elif c == MENUCHARACTER: # next char will be for menu menu_active = True elif c == EXITCHARCTER: self.stop() break # exit app elif c == '\n': self.serial.write(self.newline) # send newline character(s) if self.echo: sys.stdout.write(c) # local echo is a real newline in any case else: self.serial.write(c) # send character if self.echo: sys.stdout.write(c) except: self.alive = False raise | c61cb24df3b85c0b769f2fa31ac2433f3c0e4b39 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/c61cb24df3b85c0b769f2fa31ac2433f3c0e4b39/miniterm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2633,
12,
2890,
4672,
3536,
6498,
471,
1610,
2983,
2122,
8818,
3180,
28407,
7305,
1268,
654,
3351,
353,
1392,
18,
1347,
490,
1157,
57,
27858,
353,
1392,
16,
10634,
326,
1024,
498,
13760,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2633,
12,
2890,
4672,
3536,
6498,
471,
1610,
2983,
2122,
8818,
3180,
28407,
7305,
1268,
654,
3351,
353,
1392,
18,
1347,
490,
1157,
57,
27858,
353,
1392,
16,
10634,
326,
1024,
498,
13760,
... |
if key not in ['_','PWD','SHLVL']: os.environ[key] = val | if key not in ['_','PWD','SHLVL']: os.environ[key] = val | def setup(self): """Run CMT setup script""" | 17cdd2a6c1d9c0e1cd63bf376b126f6833edc202 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1488/17cdd2a6c1d9c0e1cd63bf376b126f6833edc202/Athena.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
3536,
1997,
385,
6152,
3875,
2728,
8395,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3875,
12,
2890,
4672,
3536,
1997,
385,
6152,
3875,
2728,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Equivalent of `itertool.imap()` -- can be MUCH slower than `Pool.map()` | Equivalent of `itertools.imap()` -- can be MUCH slower than `Pool.map()` | def imap(self, func, iterable, chunksize=1): ''' Equivalent of `itertool.imap()` -- can be MUCH slower than `Pool.map()` ''' assert self._state == RUN if chunksize == 1: result = IMapIterator(self._cache) self._taskqueue.put((((result._job, i, func, (x,), {}) for i, x in enumerate(iterable)), result._set_length)) return result else: assert chunksize > 1 task_batches = Pool._get_tasks(func, iterable, chunksize) result = IMapIterator(self._cache) self._taskqueue.put((((result._job, i, mapstar, (x,), {}) for i, x in enumerate(task_batches)), result._set_length)) return (item for chunk in result for item in chunk) | 9470564363711a8d1d46f7b3470c4333210122ff /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/9470564363711a8d1d46f7b3470c4333210122ff/pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20226,
12,
2890,
16,
1326,
16,
6087,
16,
23256,
33,
21,
4672,
9163,
31208,
434,
1375,
2165,
6642,
18,
12161,
20338,
1493,
848,
506,
490,
57,
1792,
27926,
2353,
1375,
2864,
18,
1458,
2033... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20226,
12,
2890,
16,
1326,
16,
6087,
16,
23256,
33,
21,
4672,
9163,
31208,
434,
1375,
2165,
6642,
18,
12161,
20338,
1493,
848,
506,
490,
57,
1792,
27926,
2353,
1375,
2864,
18,
1458,
2033... |
r'(?P<space>\s\+)', | r'(?P<space>\s+)', | def counter(start): i = int(start) while True: yield i i += 1 | 00b94c3f7bd7373df8799471d1653a60e6f58191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4638/00b94c3f7bd7373df8799471d1653a60e6f58191/cond.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3895,
12,
1937,
4672,
277,
273,
509,
12,
1937,
13,
1323,
1053,
30,
2824,
277,
277,
1011,
404,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3895,
12,
1937,
4672,
277,
273,
509,
12,
1937,
13,
1323,
1053,
30,
2824,
277,
277,
1011,
404,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.cb.action_newterminal(cmd, args) | self.do_action('newterminal', ' '.join([cmd] + args)) | def cb_newcommand(self, menu, cmd, args): args = list(args) args.append(self.word) self.cb.action_newterminal(cmd, args) | b878aee3737f58fa767b3ea1ac8652a782613dc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/b878aee3737f58fa767b3ea1ac8652a782613dc6/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
2704,
3076,
12,
2890,
16,
3824,
16,
1797,
16,
833,
4672,
833,
273,
666,
12,
1968,
13,
833,
18,
6923,
12,
2890,
18,
1095,
13,
365,
18,
7358,
18,
1128,
67,
2704,
15979,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
2704,
3076,
12,
2890,
16,
3824,
16,
1797,
16,
833,
4672,
833,
273,
666,
12,
1968,
13,
833,
18,
6923,
12,
2890,
18,
1095,
13,
365,
18,
7358,
18,
1128,
67,
2704,
15979,
12,
... |
self.page = wikipedia.Page(self.site, self.page.getRedirectTarget()) | self.page = wikipedia.Page(site, self.page.getRedirectTarget()) | def setpage(self, new): """Sets page and pagelink""" pageTitle = self.options.page or wikipedia.input(u"Page to edit:") self.page = wikipedia.Page(self.site, pageTitle) if not self.options.edit_redirect and self.page.isRedirectPage(): self.page = wikipedia.Page(self.site, self.page.getRedirectTarget()) | cce9be524362045c1a52c4540f356d3f3fc47e11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/cce9be524362045c1a52c4540f356d3f3fc47e11/editarticle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2433,
12,
2890,
16,
394,
4672,
3536,
2785,
1363,
471,
4262,
27269,
8395,
1363,
4247,
273,
365,
18,
2116,
18,
2433,
578,
21137,
18,
2630,
12,
89,
6,
1964,
358,
3874,
2773,
13,
365,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2433,
12,
2890,
16,
394,
4672,
3536,
2785,
1363,
471,
4262,
27269,
8395,
1363,
4247,
273,
365,
18,
2116,
18,
2433,
578,
21137,
18,
2630,
12,
89,
6,
1964,
358,
3874,
2773,
13,
365,... |
self.theWidget.set_size_request(self.plotwidth,self.plotheigth) | self.theWidget.set_size_request(self.plotwidth,self.plotheight) | def __init__( self, owner, scale_type, root, width, heigth ): | 2e4e7c5daa9d6b052171f723237d43de6db2f864 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/2e4e7c5daa9d6b052171f723237d43de6db2f864/Plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
3410,
16,
3159,
67,
723,
16,
1365,
16,
1835,
16,
3904,
360,
451,
262,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
3410,
16,
3159,
67,
723,
16,
1365,
16,
1835,
16,
3904,
360,
451,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
a = tcn.shared_constructor(numpy.random.rand(*shape)+0.5, 'a') | a = tcn.shared_constructor(theano._asarray(numpy.random.rand(*shape), dtype='float32')+0.5, 'a') | def test_elemwise1(): """ Several kinds of elemwise expressions with no broadcasting, non power-of-two shape """ shape = (3,4) a = tcn.shared_constructor(numpy.random.rand(*shape)+0.5, 'a') b = tensor.fmatrix() #let debugmode catch any mistakes print >> sys.stdout, "STARTING FUNCTION 1" f = pfunc([b], [], updates=[(a, b**a)], mode=mode_with_gpu) for i, node in enumerate(f.maker.env.toposort()): print i, node f(numpy.random.rand(*shape)+0.3) print >> sys.stdout, "STARTING FUNCTION 2" #let debugmode catch any mistakes f = pfunc([b], [], updates=[(a, tensor.exp(b**a))], mode=mode_with_gpu) for i, node in enumerate(f.maker.env.toposort()): print i, node f(numpy.random.rand(*shape)+0.3) print >> sys.stdout, "STARTING FUNCTION 3" #let debugmode catch any mistakes f = pfunc([b], [], updates=[(a, a+b * tensor.exp(b**a))], mode=mode_with_gpu) f(numpy.random.rand(*shape)+0.3) | 8975b933b1f7fb5791fd7798b5420b449782a292 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/8975b933b1f7fb5791fd7798b5420b449782a292/test_basic_ops.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
10037,
2460,
21,
13332,
3536,
3265,
502,
287,
21961,
434,
3659,
2460,
8041,
598,
1158,
8959,
310,
16,
1661,
7212,
17,
792,
17,
15415,
2179,
3536,
225,
2179,
273,
261,
23,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
10037,
2460,
21,
13332,
3536,
3265,
502,
287,
21961,
434,
3659,
2460,
8041,
598,
1158,
8959,
310,
16,
1661,
7212,
17,
792,
17,
15415,
2179,
3536,
225,
2179,
273,
261,
23,
16,
... |
value = GetDefaultValue(entry, subindex) | raise SyntaxError, "Error on entry 0x%4.4X:\nCan't recompose implemented subindexes in this ARRAY or RECORD entry"%entry | def GenerateNode(filepath, nodeID = 0): global Node # Create a new node Node = node.Node(id = nodeID) try: # Parse file and extract dictionary of EDS entry eds_dict = ParseEDSFile(filepath) # Extract Profile Number from Device Type entry ProfileNb = eds_dict[0x1000]["DEFAULTVALUE"] & 0x0000ffff # If profile is not DS-301 or DS-302 if ProfileNb not in [301, 302]: # Compile Profile name and path to .prf file ProfileName = "DS-%d"%ProfileNb ProfilePath = os.path.join(os.path.split(__file__)[0], "config/%s.prf"%ProfileName) # Verify that profile is available if os.path.isfile(ProfilePath): try: # Load Profile execfile(ProfilePath) Node.SetProfileName(ProfileName) Node.SetProfile(Mapping) Node.SetSpecificMenu(AddMenuEntries) except: pass # Read all entries in the EDS dictionary for entry, values in eds_dict.items(): # All sections with a name in keynames are escaped if entry in SECTION_KEYNAMES: pass else: # Extract informations for the entry entry_infos = Node.GetEntryInfos(entry) # If no informations are available, then we write them if not entry_infos: # First case, entry is a VAR if values["OBJECTTYPE"] == 7: # Add mapping for entry Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 1) # Add mapping for first subindex Node.AddMappingEntry(entry, 0, values = {"name" : values["PARAMETERNAME"], "type" : values["DATATYPE"], "access" : ACCESS_TRANSLATE[values["ACCESSTYPE"]], "pdo" : values.get("PDOMAPPING", 0) == 1}) # Second case, entry is an ARRAY elif values["OBJECTTYPE"] == 8: # Extract maximum subindex number defined try: max_subindex = values["subindexes"][0]["DEFAULTVALUE"] except: raise SyntaxError, "Error on entry 0x%4.4X:\nSubindex 0 must be defined for an ARRAY entry"%entry # Add mapping for entry Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 3) # Add mapping for first subindex Node.AddMappingEntry(entry, 0, values = {"name" : "Number of Entries", "type" : 0x05, "access" : "ro", "pdo" : False}) # Add mapping for other subindexes for subindex in xrange(1, int(max_subindex) + 1): # if subindex is defined if subindex in values["subindexes"]: Node.AddMappingEntry(entry, subindex, values = {"name" : values["subindexes"][subindex]["PARAMETERNAME"], "type" : values["subindexes"][subindex]["DATATYPE"], "access" : ACCESS_TRANSLATE[values["subindexes"][subindex]["ACCESSTYPE"]], "pdo" : values["subindexes"][subindex].get("PDOMAPPING", 0) == 1}) # if not, we add a mapping for compatibility else: Node.AddMappingEntry(entry, subindex, values = {"name" : "Compatibility Entry", "type" : 0x05, "access" : "rw", "pdo" : False}) # Third case, entry is an RECORD elif values["OBJECTTYPE"] == 9: # Verify that the first subindex is defined if 0 not in values["subindexes"]: raise SyntaxError, "Error on entry 0x%4.4X:\nSubindex 0 must be defined for a RECORD entry"%entry # Add mapping for entry Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 7) # Add mapping for first subindex Node.AddMappingEntry(entry, 0, values = {"name" : "Number of Entries", "type" : 0x05, "access" : "ro", "pdo" : False}) # Verify that second subindex is defined if 1 in values: Node.AddMappingEntry(entry, 1, values = {"name" : values["PARAMETERNAME"] + " %d[(sub)]", "type" : values["subindexes"][1]["DATATYPE"], "access" : ACCESS_TRANSLATE[values["subindexes"][1]["ACCESSTYPE"]], "pdo" : values["subindexes"][1].get("PDOMAPPING", 0) == 1}) else: raise SyntaxError, "Error on entry 0x%4.4X:\nA RECORD entry must have at least 2 subindexes"%entry # Define entry for the new node # First case, entry is a VAR if values["OBJECTTYPE"] == 7: # Take default value if it is defined if "DEFAULTVALUE" in values: value = values["DEFAULTVALUE"] # Find default value for value type of the entry else: value = GetDefaultValue(entry) Node.AddEntry(entry, 0, value) # Second case, entry is an ARRAY or a RECORD elif values["OBJECTTYPE"] in (8, 9): # Verify that "Subnumber" attribute is defined and has a valid value if "SUBNUMBER" in values and values["SUBNUMBER"] > 0: # Extract maximum subindex number defined try: max_subindex = values["subindexes"][0]["DEFAULTVALUE"] except: raise SyntaxError, "Error on entry 0x%4.4X:\nSubindex 0 must be defined for an ARRAY or a RECORD entry"%entry Node.AddEntry(entry, value = []) # Define value for all subindexes except the first for subindex in xrange(1, int(max_subindex) + 1): # Take default value if it is defined and entry is defined if subindex in values["subindexes"] and "DEFAULTVALUE" in values["subindexes"][subindex]: value = values["subindexes"][subindex]["DEFAULTVALUE"] # Find default value for value type of the subindex else: value = GetDefaultValue(entry, subindex) Node.AddEntry(entry, subindex, value) else: raise SyntaxError, "Array or Record entry 0x%4.4X must have a \"SubNumber\" attribute"%entry return Node except SyntaxError, message: return "Unable to import EDS file\n%s"%message | b7d273ac1d153daea8944d9456f9d5babd9da1cf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11017/b7d273ac1d153daea8944d9456f9d5babd9da1cf/eds_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
907,
12,
10561,
16,
14871,
273,
374,
4672,
2552,
2029,
468,
1788,
279,
394,
756,
2029,
273,
756,
18,
907,
12,
350,
273,
14871,
13,
775,
30,
468,
2884,
585,
471,
2608,
3880,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
907,
12,
10561,
16,
14871,
273,
374,
4672,
2552,
2029,
468,
1788,
279,
394,
756,
2029,
273,
756,
18,
907,
12,
350,
273,
14871,
13,
775,
30,
468,
2884,
585,
471,
2608,
3880,
434,
... |
raise RuntimeError "Shell command returned error code: %s" % repr(rc) | raise RuntimeError, "Shell command returned error code: %s" % repr(rc) | def runShellCommands(self): # wpbasti: # rename trigger from "shell" to "execute-commands"? # Should contain a list of commands instead if not self._config.get("shell/command"): return | e6f9cd69c5276b072adcd828a559601529a0958d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5718/e6f9cd69c5276b072adcd828a559601529a0958d/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13220,
9127,
12,
2890,
4672,
468,
341,
5733,
689,
77,
30,
468,
6472,
3080,
628,
315,
10304,
6,
358,
315,
8837,
17,
7847,
6,
35,
468,
9363,
912,
279,
666,
434,
4364,
3560,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13220,
9127,
12,
2890,
4672,
468,
341,
5733,
689,
77,
30,
468,
6472,
3080,
628,
315,
10304,
6,
358,
315,
8837,
17,
7847,
6,
35,
468,
9363,
912,
279,
666,
434,
4364,
3560,
309,
... |
else: | elif device.properties["info.bus"]=="block": if device.properties.has_key("info.product"): product.set_label("%s"%device.properties["info.product"]) else: product.set_label("Unknown") if device.properties.has_key("info.vendor"): vendor.set_label("%s"%device.properties["info.vendor"]) else: vendor.set_label("Unknown") else: product.set_label("Unknown") | def update_tab_device(self, device): """Updates the 'Device' tab given a Device object""" bus = self.xml.get_widget("ns_device_bus") #state = self.xml.get_widget("ns_device_status") vendor = self.xml.get_widget("ns_device_vendor") product = self.xml.get_widget("ns_device_name") category = self.xml.get_widget("ns_device_category") capabilities = self.xml.get_widget("ns_device_capabilities") | c3975d1227f16936043d4a4b8043326403620de4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2597/c3975d1227f16936043d4a4b8043326403620de4/DeviceManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
7032,
67,
5964,
12,
2890,
16,
2346,
4672,
3536,
5121,
326,
296,
3654,
11,
3246,
864,
279,
6077,
733,
8395,
5766,
273,
365,
18,
2902,
18,
588,
67,
6587,
2932,
2387,
67,
5964,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
7032,
67,
5964,
12,
2890,
16,
2346,
4672,
3536,
5121,
326,
296,
3654,
11,
3246,
864,
279,
6077,
733,
8395,
5766,
273,
365,
18,
2902,
18,
588,
67,
6587,
2932,
2387,
67,
5964,
... |
"""Write data to the RLE-coder in suitably large chunks""" def __init__(self, ofp): | """Write data to the RLE-coder in suitably large chunks""" def __init__(self, ofp): | def close(self): | cada31e8208b1e7201f5afc9f9782089bec7ebe3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/cada31e8208b1e7201f5afc9f9782089bec7ebe3/binhex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
names = _GenerateUniqueNames(cfg, [".sda", ".sdb"]) | names = _GenerateUniqueNames(lu, [".sda", ".sdb"]) | def _GenerateDiskTemplate(cfg, template_name, instance_name, primary_node, secondary_nodes, disk_sz, swap_sz, file_storage_dir, file_driver): """Generate the entire disk layout for a given template type. """ #TODO: compute space requirements vgname = cfg.GetVGName() if template_name == constants.DT_DISKLESS: disks = [] elif template_name == constants.DT_PLAIN: if len(secondary_nodes) != 0: raise errors.ProgrammerError("Wrong template configuration") names = _GenerateUniqueNames(cfg, [".sda", ".sdb"]) sda_dev = objects.Disk(dev_type=constants.LD_LV, size=disk_sz, logical_id=(vgname, names[0]), iv_name = "sda") sdb_dev = objects.Disk(dev_type=constants.LD_LV, size=swap_sz, logical_id=(vgname, names[1]), iv_name = "sdb") disks = [sda_dev, sdb_dev] elif template_name == constants.DT_DRBD8: if len(secondary_nodes) != 1: raise errors.ProgrammerError("Wrong template configuration") remote_node = secondary_nodes[0] (minor_pa, minor_pb, minor_sa, minor_sb) = cfg.AllocateDRBDMinor( [primary_node, primary_node, remote_node, remote_node], instance_name) names = _GenerateUniqueNames(cfg, [".sda_data", ".sda_meta", ".sdb_data", ".sdb_meta"]) drbd_sda_dev = _GenerateDRBD8Branch(cfg, primary_node, remote_node, disk_sz, names[0:2], "sda", minor_pa, minor_sa) drbd_sdb_dev = _GenerateDRBD8Branch(cfg, primary_node, remote_node, swap_sz, names[2:4], "sdb", minor_pb, minor_sb) disks = [drbd_sda_dev, drbd_sdb_dev] elif template_name == constants.DT_FILE: if len(secondary_nodes) != 0: raise errors.ProgrammerError("Wrong template configuration") file_sda_dev = objects.Disk(dev_type=constants.LD_FILE, size=disk_sz, iv_name="sda", logical_id=(file_driver, "%s/sda" % file_storage_dir)) file_sdb_dev = objects.Disk(dev_type=constants.LD_FILE, size=swap_sz, iv_name="sdb", logical_id=(file_driver, "%s/sdb" % file_storage_dir)) disks = [file_sda_dev, file_sdb_dev] else: raise errors.ProgrammerError("Invalid disk template '%s'" % template_name) return disks | b9bddb6bdf7ac5841c732845ce0122c64bb026b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/b9bddb6bdf7ac5841c732845ce0122c64bb026b1/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4625,
6247,
2283,
12,
7066,
16,
1542,
67,
529,
16,
791,
67,
529,
16,
3354,
67,
2159,
16,
9946,
67,
4690,
16,
4234,
67,
24575,
16,
7720,
67,
24575,
16,
585,
67,
5697,
67,
1214,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4625,
6247,
2283,
12,
7066,
16,
1542,
67,
529,
16,
791,
67,
529,
16,
3354,
67,
2159,
16,
9946,
67,
4690,
16,
4234,
67,
24575,
16,
7720,
67,
24575,
16,
585,
67,
5697,
67,
1214,
... |
(r'[a-zA-Z][a-zA-Z0-9_]*', Name.Variable), | (r'[a-zA-Z][a-zA-Z0-9_-]*', Name.Variable), | def analyse_text(text): rv = VelocityLexer.analyse_text(text) - 0.01 if looks_like_xml(text): rv += 0.5 return rv | eb96c31e420291f7861fa8bb503cf79f322eba34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6148/eb96c31e420291f7861fa8bb503cf79f322eba34/templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
5633,
273,
24561,
13356,
18,
304,
3450,
307,
67,
955,
12,
955,
13,
300,
374,
18,
1611,
309,
10192,
67,
5625,
67,
2902,
12,
955,
4672,
5633,
1011,
374,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
5633,
273,
24561,
13356,
18,
304,
3450,
307,
67,
955,
12,
955,
13,
300,
374,
18,
1611,
309,
10192,
67,
5625,
67,
2902,
12,
955,
4672,
5633,
1011,
374,
... |
vi.startCharOnLine = rawItem.startCharOnLine - self.viewWindow.left vi.visLenInChars = len (rawItem.visiblePart) vi.setStartByte (self.fullTextLines[row]) vi.visLenInBytes = len (rawItem.visiblePart.encode ('utf-8')) vi.fullyInView = True | startCharOnLine = rawItem.startCharOnLine - self.viewWindow.left endCharOnLine = startCharOnLine + len (rawItem.visiblePart) visibleLine = self.GetLine (row) | def createVisualItem (self, rawItem): row = rawItem.coords[1] vi = VisualItem () | 94c1886b22a74c09d75be95009f161fc58142c71 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9028/94c1886b22a74c09d75be95009f161fc58142c71/candy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
25780,
1180,
261,
2890,
16,
1831,
1180,
4672,
1027,
273,
1831,
1180,
18,
9076,
63,
21,
65,
13206,
273,
26832,
1180,
1832,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
25780,
1180,
261,
2890,
16,
1831,
1180,
4672,
1027,
273,
1831,
1180,
18,
9076,
63,
21,
65,
13206,
273,
26832,
1180,
1832,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
log.warn("CONTENT TOO LARGE, WILL NOT FETCH", size, self.url) | log.warn("CONTENT TOO LARGE, WILL NOT FETCH %s %s", size, self.url) | def getContent(self): """Get the actual file at the URL | 21138af2179262fcdd5e86950d233cef346afcd9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14781/21138af2179262fcdd5e86950d233cef346afcd9/pyfibot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5154,
12,
2890,
4672,
3536,
967,
326,
3214,
585,
622,
326,
1976,
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,
5154,
12,
2890,
4672,
3536,
967,
326,
3214,
585,
622,
326,
1976,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for lfn,reason in terminal.items(): for se,replicaID in replicas[lfn].items(): | for lfn, reason in terminal.items(): for se, replicaID in replicas[lfn].items(): | def prepareNewReplicas(self): """ This is the first logical task to be executed and manages the New->Waiting transition of the Replicas """ res = self.__getNewReplicas() if not res['OK']: gLogger.fatal("RequestPreparation.prepareNewReplicas: Failed to get replicas from StagerDB.",res['Message']) return res if not res['Value']: gLogger.info("There were no New replicas found") return res replicas = res['Value']['Replicas'] replicaIDs = res['Value']['ReplicaIDs'] gLogger.info("RequestPreparation.prepareNewReplicas: Obtained %s New replicas for preparation." % len(replicaIDs)) | d68cb60fd991fa9f206177d2794f8d04f940cd00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/d68cb60fd991fa9f206177d2794f8d04f940cd00/RequestPreparationAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1908,
17248,
12,
2890,
4672,
3536,
1220,
353,
326,
1122,
6374,
1562,
358,
506,
7120,
471,
20754,
281,
326,
1166,
2122,
15946,
6007,
434,
326,
31222,
3536,
400,
273,
365,
16186,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1908,
17248,
12,
2890,
4672,
3536,
1220,
353,
326,
1122,
6374,
1562,
358,
506,
7120,
471,
20754,
281,
326,
1166,
2122,
15946,
6007,
434,
326,
31222,
3536,
400,
273,
365,
16186,
588,
... |
self.default_query = {'facet': 'true', | catalog = getToolByName(context, 'portal_catalog') types = [x for x in catalog.uniqueValuesFor('portal_type') if x not in ('Topic', 'Folder', 'Document')] self.default_query = {'portal_type': types, 'facet': 'true', | def __init__(self, context, request): self.default_query = {'facet': 'true', 'facet.field': facet_fields } BrowserView.__init__(self, context, request) | 21913236ebf23071902d8f62b98f60b0b3e78b59 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10561/21913236ebf23071902d8f62b98f60b0b3e78b59/topical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
819,
16,
590,
4672,
6222,
273,
336,
6364,
5911,
12,
2472,
16,
296,
24386,
67,
7199,
6134,
1953,
273,
306,
92,
364,
619,
316,
6222,
18,
6270,
1972,
1290,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
819,
16,
590,
4672,
6222,
273,
336,
6364,
5911,
12,
2472,
16,
296,
24386,
67,
7199,
6134,
1953,
273,
306,
92,
364,
619,
316,
6222,
18,
6270,
1972,
1290,
... |
return self._cursor.fetchmany(size) | return self._cursor.fetchmany(size) | def fetchmany(self, size = None): if size==None: size = self.arraysize | 34c41b6b2a05b0c448580a7fb8f0602d4ac4c768 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8941/34c41b6b2a05b0c448580a7fb8f0602d4ac4c768/informixdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
9353,
12,
2890,
16,
963,
273,
599,
4672,
309,
963,
631,
7036,
30,
963,
273,
365,
18,
1126,
1467,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
9353,
12,
2890,
16,
963,
273,
599,
4672,
309,
963,
631,
7036,
30,
963,
273,
365,
18,
1126,
1467,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if frame.f_exc_traceback is None: | if not frame.f_exc_traceback is arg[2]: | def trace_dispatch(self, frame, event, arg): """ General trace method for thread. """ if (event == 'line'): if frame in self.m_locals_copy: self.update_locals_copy() | af80e327a68dc28aab395f0d188549e79501315e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9402/af80e327a68dc28aab395f0d188549e79501315e/rpdb2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
67,
10739,
12,
2890,
16,
2623,
16,
871,
16,
1501,
4672,
3536,
9544,
2606,
707,
364,
2650,
18,
3536,
225,
309,
261,
2575,
422,
296,
1369,
11,
4672,
309,
2623,
316,
365,
18,
81,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
67,
10739,
12,
2890,
16,
2623,
16,
871,
16,
1501,
4672,
3536,
9544,
2606,
707,
364,
2650,
18,
3536,
225,
309,
261,
2575,
422,
296,
1369,
11,
4672,
309,
2623,
316,
365,
18,
81,
... |
FlagsField("flags", 2, 2, "KR"), | FlagsField("flags", "K", 2, "RK"), | def answers(self, other): if isinstance(other, MIP6MH_BRR): return 1 return 0 | fabfbc997ca82b7cce3df31169b7872ed4490cee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7311/fabfbc997ca82b7cce3df31169b7872ed4490cee/inet6.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12415,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
490,
2579,
26,
49,
44,
67,
7192,
54,
4672,
327,
404,
327,
374,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12415,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
490,
2579,
26,
49,
44,
67,
7192,
54,
4672,
327,
404,
327,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.pi = 3.14 | def __init__(self,jid=''): """ Init internal constants. """ Command_Handler_Prototype.__init__(self,jid) self.pi = 3.14 self.initial = {'execute':self.cmdFirstStage} | 20e0ee4d2947d3c87389d11c8d269bbcd3037b2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/20e0ee4d2947d3c87389d11c8d269bbcd3037b2e/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
18252,
2218,
11,
4672,
3536,
4378,
2713,
6810,
18,
3536,
3498,
67,
1503,
67,
15846,
16186,
2738,
972,
12,
2890,
16,
18252,
13,
365,
18,
6769,
273,
13666,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18252,
2218,
11,
4672,
3536,
4378,
2713,
6810,
18,
3536,
3498,
67,
1503,
67,
15846,
16186,
2738,
972,
12,
2890,
16,
18252,
13,
365,
18,
6769,
273,
13666,
... | |
line = shapes.Arrow if i == len(points)-2 and arrow_head else shapes.LineSegment | line = shapes.arrow3d if i == len(points)-2 and arrow_head else shapes.LineSegment | def line3d(points, thickness=1, radius=None, arrow_head=False, **kwds): """ Draw a 3d line joining a sequence of points. One may specify either a thickness or radius. If a thickness is specified, this line will have a constant diameter regardless of scaling and zooming. If a radius is specified, it will behave as a series of cylinders. INPUT: points -- a list of at least 2 points thickness -- (default: 1) radius -- (default: None) arrow_head -- (default: False) color -- a word that describes a color rgbcolor -- (r,g,b) with r, g, b between 0 and 1 that describes a color opacity -- (default: 1) if less than 1 then is transparent EXAMPLES: A line in 3-space: sage: line3d([(1,2,3), (1,0,-2), (3,1,4), (2,1,-2)]) The same line but red: sage: line3d([(1,2,3), (1,0,-2), (3,1,4), (2,1,-2)], color='red') A transparent thick green line and a little blue line: sage: line3d([(0,0,0), (1,1,1), (1,0,2)], opacity=0.5, radius=0.1, color='green') + line3d([(0,1,0), (1,0,2)]) """ if len(points) < 2: raise ValueError, "there must be at least 2 points" for i in range(len(points)): x, y, z = points[i] points[i] = float(x), float(y), float(z) if radius is None: L = Line(points, thickness=thickness, arrow_head=arrow_head, **kwds) L._set_extra_kwds(kwds) return L else: v = [] texture = Texture(kwds) if kwds.has_key('texture'): kwds = kwds.copy() del kwds['texture'] for i in range(len(points) - 1): line = shapes.Arrow if i == len(points)-2 and arrow_head else shapes.LineSegment v.append(line(points[i], points[i+1], texture=texture, radius=radius, **kwds)) w = sum(v) w._set_extra_kwds(kwds) return w | 517a5d702ff0575bf7c55b68842500b6f2e7e4a2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/517a5d702ff0575bf7c55b68842500b6f2e7e4a2/shapes2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
980,
23,
72,
12,
4139,
16,
27199,
33,
21,
16,
5725,
33,
7036,
16,
12274,
67,
1978,
33,
8381,
16,
2826,
25577,
4672,
3536,
10184,
279,
890,
72,
980,
21239,
279,
3102,
434,
3143,
18,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
980,
23,
72,
12,
4139,
16,
27199,
33,
21,
16,
5725,
33,
7036,
16,
12274,
67,
1978,
33,
8381,
16,
2826,
25577,
4672,
3536,
10184,
279,
890,
72,
980,
21239,
279,
3102,
434,
3143,
18,
2... |
self.vmw.low_score = (int(s[0]), int(s[1])) print "low score is: %d" % (self.vmw.low_score) except: | self.vmw.low_score = [int(s[0].split(':')[1].strip()), int(s[1].split(':')[1].strip())] print "low score is: %s" % (self.vmw.low_score) else: | def load_score(self): try: f = file(os.path.join(os.path.abspath('.'), 'visualmatch.score'), "r") s = [f.read().split(":"), f.read().split(":")] f.close self.vmw.low_score = (int(s[0]), int(s[1])) print "low score is: %d" % (self.vmw.low_score) except: self.vmw.low_score = [-1, -1] | e4a64eca2c257da825c8379d225fa379555ffb85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7609/e4a64eca2c257da825c8379d225fa379555ffb85/visualmatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
6355,
12,
2890,
4672,
775,
30,
284,
273,
585,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
5113,
803,
2668,
1093,
3631,
296,
26671,
1916,
18,
6355,
19899,
315,
86,
792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
6355,
12,
2890,
4672,
775,
30,
284,
273,
585,
12,
538,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
5113,
803,
2668,
1093,
3631,
296,
26671,
1916,
18,
6355,
19899,
315,
86,
792... |
return '"%s"."%s"' % (dest_model._table, m2o_order) | qualify = lambda field: '"%s"."%s"' % (dest_model._table, field) return map(qualify, m2o_order) if isinstance(m2o_order, list) else qualify(m2o_order) | def _generate_m2o_order_by(self, order_field, query): """ Add possibly missing JOIN to ``query`` and generate the ORDER BY clause for m2o fields, either native m2o fields or function/related fields that are stored, including intermediate JOINs for inheritance if required. | 162e988544648771fa1165391e558da862c6af17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/162e988544648771fa1165391e558da862c6af17/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
67,
81,
22,
83,
67,
1019,
67,
1637,
12,
2890,
16,
1353,
67,
1518,
16,
843,
4672,
3536,
1436,
10016,
3315,
7645,
358,
12176,
2271,
10335,
471,
2103,
326,
10205,
6953,
6591,
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,
389,
7163,
67,
81,
22,
83,
67,
1019,
67,
1637,
12,
2890,
16,
1353,
67,
1518,
16,
843,
4672,
3536,
1436,
10016,
3315,
7645,
358,
12176,
2271,
10335,
471,
2103,
326,
10205,
6953,
6591,
3... |
self.execute() | if self.execute: self.execute() | def callback(self, value): self._results.append(value) self.execute() | 0d9b5b3750615f58c2d0f754f5d516173a671ffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0d9b5b3750615f58c2d0f754f5d516173a671ffa/flow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
2890,
16,
460,
4672,
365,
6315,
4717,
18,
6923,
12,
1132,
13,
365,
18,
8837,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
2890,
16,
460,
4672,
365,
6315,
4717,
18,
6923,
12,
1132,
13,
365,
18,
8837,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
memmove (self->buffer, self->buffer + size, self->full - size) | memmove(self->buffer, self->buffer + size, self->full - size) | def land_net_flush(LandNet *self, size_t size): if size == 0: self->full = 0 else: if self->full > size: memmove (self->buffer, self->buffer + size, self->full - size) self->full -= size | 592872e308788b926d7358eb0ec411e83ee451d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/930/592872e308788b926d7358eb0ec411e83ee451d0/net.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19193,
67,
2758,
67,
11330,
12,
29398,
7308,
380,
2890,
16,
963,
67,
88,
963,
4672,
309,
963,
422,
374,
30,
365,
2122,
2854,
273,
374,
469,
30,
309,
365,
2122,
2854,
405,
963,
30,
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,
19193,
67,
2758,
67,
11330,
12,
29398,
7308,
380,
2890,
16,
963,
67,
88,
963,
4672,
309,
963,
422,
374,
30,
365,
2122,
2854,
273,
374,
469,
30,
309,
365,
2122,
2854,
405,
963,
30,
16... |
glob_actions = [x for x in action.modules if not x in self.macro.request.cfg.actions_excluded] | actions_global = ([x for x in action.modules if not x in self.macro.request.cfg.actions_excluded]) | def getValidActions(self): """ lists all valid actions """ from MoinMoin import action # builtin actions = action.names # global glob_actions = [x for x in action.modules if not x in self.macro.request.cfg.actions_excluded] # local loc_actions = [x for x in wikiutil.wikiPlugins('action', self.macro.cfg) if not x in self.macro.request.cfg.actions_excluded] if glob_actions: actions.append(glob_actions) if loc_actions: actions.append(loc_actions) return actions | 77963cf3b7a0cdfa62bc6cddf9e9aae16fa19204 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/77963cf3b7a0cdfa62bc6cddf9e9aae16fa19204/Action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22574,
6100,
12,
2890,
4672,
3536,
6035,
777,
923,
4209,
3536,
628,
490,
885,
49,
885,
1930,
1301,
468,
15273,
4209,
273,
1301,
18,
1973,
468,
2552,
4209,
67,
6347,
273,
23265,
92,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22574,
6100,
12,
2890,
4672,
3536,
6035,
777,
923,
4209,
3536,
628,
490,
885,
49,
885,
1930,
1301,
468,
15273,
4209,
273,
1301,
18,
1973,
468,
2552,
4209,
67,
6347,
273,
23265,
92,
364,
... |
'pkgId': 'pkgid', | def updateSqliteCache(self, db, parser, checksum, cachetype): """Update the sqlite cache by making it fit the packages described in dobj (info that has been read from primary.xml metadata) afterwards update the checksum of the database to checksum""" t = time.time() delcount = 0 newcount = 0 | c8f7b5b5af1f3f47837fb495c7bbb3fc1fbf60f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/c8f7b5b5af1f3f47837fb495c7bbb3fc1fbf60f1/sqlitecache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
5101,
1137,
1649,
12,
2890,
16,
1319,
16,
2082,
16,
6697,
16,
7122,
5872,
4672,
3536,
1891,
326,
16184,
1247,
635,
10480,
518,
4845,
326,
5907,
11893,
316,
741,
441,
261,
1376,
716... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
5101,
1137,
1649,
12,
2890,
16,
1319,
16,
2082,
16,
6697,
16,
7122,
5872,
4672,
3536,
1891,
326,
16184,
1247,
635,
10480,
518,
4845,
326,
5907,
11893,
316,
741,
441,
261,
1376,
716... | |
super(InProgressAny, self).finish((result, args)) | if self._pass_index: data = (result, args) else: data = args super(InProgressAny, self).finish(data) | def finish(self, result, args): """ Invoked when any one of the InProgress objects passed to the constructor have finished. """ super(InProgressAny, self).finish((result, args)) # We're done with the underlying IP objects so unref them. In the # case of InProgressCallbacks connected weakly to signals (which # happens when signals are given to us on the constructor), they'll # get deleted and disconnected from the signals. self._objects = None | 4f1a0f9582274b4652cf9fc2abccc3578776f75b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11722/4f1a0f9582274b4652cf9fc2abccc3578776f75b/async.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
16,
563,
16,
833,
4672,
3536,
5454,
14276,
1347,
1281,
1245,
434,
326,
657,
5491,
2184,
2275,
358,
326,
3885,
1240,
6708,
18,
3536,
309,
365,
6315,
5466,
67,
1615,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
16,
563,
16,
833,
4672,
3536,
5454,
14276,
1347,
1281,
1245,
434,
326,
657,
5491,
2184,
2275,
358,
326,
3885,
1240,
6708,
18,
3536,
309,
365,
6315,
5466,
67,
1615,
30,
... |
now = datetime.utcnow() | nowt = datetime.utcnow() | def check(self): if not self.lock.tryLock(): return try: if self.dirtied: self.refresh_schedule(load_recipes()) self.dirtied = False needs_downloading = set([]) self.debug('Checking...') now = datetime.utcnow() for recipe in self.recipes: if recipe.schedule is None: continue delta = now - recipe.last_downloaded if delta > timedelta(days=recipe.schedule): needs_downloading.add(recipe) self.debug('Needs downloading:', needs_downloading) needs_downloading = [r for r in needs_downloading if r not in self.queue] for recipe in needs_downloading: self.do_download(recipe) finally: self.lock.unlock() | 0bb41a00a5980da0882a88d2286bdcc7eee40e69 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/0bb41a00a5980da0882a88d2286bdcc7eee40e69/scheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
4672,
309,
486,
365,
18,
739,
18,
698,
2531,
13332,
327,
775,
30,
309,
365,
18,
1214,
88,
2092,
30,
365,
18,
9144,
67,
10676,
12,
945,
67,
266,
3449,
281,
10756,
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,
866,
12,
2890,
4672,
309,
486,
365,
18,
739,
18,
698,
2531,
13332,
327,
775,
30,
309,
365,
18,
1214,
88,
2092,
30,
365,
18,
9144,
67,
10676,
12,
945,
67,
266,
3449,
281,
10756,
365,
... |
print(data) | def do_request_(self, request): host = request.host if not host: raise URLError('no host given') | eedd6b303cb6813a05d47559e7d0d97c61e5e679 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/eedd6b303cb6813a05d47559e7d0d97c61e5e679/request.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2293,
67,
12,
2890,
16,
590,
4672,
1479,
273,
590,
18,
2564,
309,
486,
1479,
30,
1002,
1976,
668,
2668,
2135,
1479,
864,
6134,
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,
741,
67,
2293,
67,
12,
2890,
16,
590,
4672,
1479,
273,
590,
18,
2564,
309,
486,
1479,
30,
1002,
1976,
668,
2668,
2135,
1479,
864,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
commit_deleted_edited | commit_deleted_edited, commit_in_dir_scheduled_for_addition, | def commit_deleted_edited(): "commit files that have been deleted, but also edited" # Bootstrap: make independent repo and working copy. sbox = sandbox(commit_deleted_edited) wc_dir = os.path.join(svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make some convenient paths. iota_path = os.path.join(wc_dir, 'iota') mu_path = os.path.join(wc_dir, 'A', 'mu') # Edit the files. svntest.main.file_append(iota_path, "This file has been edited.") svntest.main.file_append(mu_path, "This file has been edited.") # Schedule the files for removal. svntest.main.run_svn(None, 'remove', iota_path) svntest.main.run_svn(None, 'remove', mu_path) # Make our output list output_list = [(iota_path, None, {}, {'verb' : 'Deleting'}), (mu_path, None, {}, {'verb' : 'Deleting'})] expected_output_tree = svntest.tree.build_generic_tree(output_list) # Items in the status list are all at rev 1, except the two things # we changed...but then, they don't exist at all. status_list = svntest.actions.get_virginal_status_list(wc_dir, '2') status_list.pop(path_index(status_list, iota_path)) status_list.pop(path_index(status_list, mu_path)) for item in status_list: item[3]['wc_rev'] = '1' expected_status_tree = svntest.tree.build_generic_tree(status_list) if svntest.actions.run_and_verify_commit (wc_dir, expected_output_tree, expected_status_tree, None, None, None, None, None, wc_dir): return 1 return 0 | da164d67313e981dd3b1ba8e21d954060bce5412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6036/da164d67313e981dd3b1ba8e21d954060bce5412/commit_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
67,
8600,
67,
28752,
13332,
315,
7371,
1390,
716,
1240,
2118,
4282,
16,
1496,
2546,
18532,
6,
225,
468,
11830,
30,
225,
1221,
14807,
3538,
471,
5960,
1610,
18,
272,
2147,
273,
1520... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
67,
8600,
67,
28752,
13332,
315,
7371,
1390,
716,
1240,
2118,
4282,
16,
1496,
2546,
18532,
6,
225,
468,
11830,
30,
225,
1221,
14807,
3538,
471,
5960,
1610,
18,
272,
2147,
273,
1520... |
%s | %(non_whitespace_escape_before)s | def build_table_row(self, rowdata, tableline): row = nodes.row() for cell in rowdata: if cell is None: continue morerows, morecols, offset, cellblock = cell attributes = {} if morerows: attributes['morerows'] = morerows if morecols: attributes['morecols'] = morecols entry = nodes.entry(**attributes) row += entry if ''.join(cellblock): self.nested_parse(cellblock, input_offset=tableline+offset, node=entry) return row | 018a79821ccb1056404d43dbe32e444d1a0e03c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/018a79821ccb1056404d43dbe32e444d1a0e03c1/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2121,
67,
492,
12,
2890,
16,
1027,
892,
16,
3246,
80,
3027,
4672,
1027,
273,
2199,
18,
492,
1435,
364,
2484,
316,
1027,
892,
30,
309,
2484,
353,
599,
30,
1324,
312,
8922,
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,
1361,
67,
2121,
67,
492,
12,
2890,
16,
1027,
892,
16,
3246,
80,
3027,
4672,
1027,
273,
2199,
18,
492,
1435,
364,
2484,
316,
1027,
892,
30,
309,
2484,
353,
599,
30,
1324,
312,
8922,
5... |
self.patch = patch | self.patches = patches | def __init__(self, package, version, sourceurl, sourcesize, patch=None, versioncheck=None): self.package = package self.version = version self.sourceurl = sourceurl self.sourcesize = sourcesize self.patch = patch self.versioncheck = versioncheck | fb3c47fee9dd51cc20d076b14a9af7c453afdb68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4596/fb3c47fee9dd51cc20d076b14a9af7c453afdb68/bootstrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2181,
16,
1177,
16,
1084,
718,
16,
5550,
554,
16,
4729,
33,
7036,
16,
1177,
1893,
33,
7036,
4672,
365,
18,
5610,
273,
2181,
365,
18,
1589,
273,
1177,
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,
1001,
2738,
972,
12,
2890,
16,
2181,
16,
1177,
16,
1084,
718,
16,
5550,
554,
16,
4729,
33,
7036,
16,
1177,
1893,
33,
7036,
4672,
365,
18,
5610,
273,
2181,
365,
18,
1589,
273,
1177,
3... |
Disconnect from the LDRdataFindServer. | Disconnect from the LSCsegFindServer. | def __del__(self): """ Disconnect from the LDRdataFindServer. | 99f3c8a95daab623425a71c7275384312b5fffb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/99f3c8a95daab623425a71c7275384312b5fffb2/LSCsegFindClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
3536,
23957,
628,
326,
511,
6331,
892,
3125,
2081,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
4672,
3536,
23957,
628,
326,
511,
6331,
892,
3125,
2081,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
task_name = _task_params['task_name'] | task_name = _TASK_PARAMS['task_name'] | def _task_submit(argv, authorization_action, authorization_msg): """Submits task to the BibSched task queue. This is what people will be invoking via command line.""" ## check as whom we want to submit? check_running_process_user() ## sanity check: remove eventual "task" option: ## authenticate user: _task_params['user'] = authenticate(_task_params["user"], authorization_action, authorization_msg) ## submit task: if _task_params['task_specific_name']: task_name = '%s:%s' % (_task_params['task_name'], _task_params['task_specific_name']) else: task_name = _task_params['task_name'] write_message("storing task options %s\n" % argv, verbose=9) _task_params['task_id'] = run_sql("""INSERT INTO schTASK (proc,user, runtime,sleeptime,status,progress,arguments,priority) VALUES (%s,%s,%s,%s,'WAITING','',%s, %s)""", (task_name, _task_params['user'], _task_params["runtime"], _task_params["sleeptime"], marshal.dumps(argv), _task_params['priority'])) ## update task number: write_message("Task #%d submitted." % _task_params['task_id']) return _task_params['task_id'] | e9bc8dbefc702ea212bd46520d513f1d8b201695 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/e9bc8dbefc702ea212bd46520d513f1d8b201695/bibtask.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4146,
67,
9297,
12,
19485,
16,
6093,
67,
1128,
16,
6093,
67,
3576,
4672,
3536,
1676,
22679,
1562,
358,
326,
605,
495,
55,
2049,
1562,
2389,
18,
225,
1220,
353,
4121,
16951,
903,
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,
389,
4146,
67,
9297,
12,
19485,
16,
6093,
67,
1128,
16,
6093,
67,
3576,
4672,
3536,
1676,
22679,
1562,
358,
326,
605,
495,
55,
2049,
1562,
2389,
18,
225,
1220,
353,
4121,
16951,
903,
5... |
if scanner.next() == IHREAL: | if scanner.next() == "IHREAL": | def eta(): "Use computer to get estimated time of arrival for a warp jump." w1 = coord(); w2 = coord() prompt = False if damaged(DCOMPTR): prout(_("COMPUTER DAMAGED, USE A POCKET CALCULATOR.")) skip(1) return if scanner.next() != IHREAL: prompt = True scanner.chew() proutn(_("Destination quadrant and/or sector? ")) if scanner.next()!=IHREAL: huh() return w1.j = int(scanner.real-0.5) if scanner.next() != IHREAL: huh() return w1.i = int(scanner.real-0.5) if scanner.next() == IHREAL: w2.j = int(scanner.real-0.5) if scanner.next() != IHREAL: huh() return w2.i = int(scanner.real-0.5) else: if game.quadrant.j>w1.i: w2.i = 0 else: w2.i=QUADSIZE-1 if game.quadrant.i>w1.j: w2.j = 0 else: w2.j=QUADSIZE-1 if not VALID_QUADRANT(w1.i, w1.j) or not VALID_SECTOR(w2.i, w2.j): huh() return game.dist = math.sqrt((w1.j-game.quadrant.j+0.1*(w2.j-game.sector.j))**2+ (w1.i-game.quadrant.i+0.1*(w2.i-game.sector.i))**2) wfl = False if prompt: prout(_("Answer \"no\" if you don't know the value:")) while True: scanner.chew() proutn(_("Time or arrival date? ")) if scanner.next()==IHREAL: ttime = scanner.real if ttime > game.state.date: ttime -= game.state.date # Actually a star date twarp=(math.floor(math.sqrt((10.0*game.dist)/ttime)*10.0)+1.0)/10.0 if ttime <= 1e-10 or twarp > 10: prout(_("We'll never make it, sir.")) scanner.chew() return if twarp < 1.0: twarp = 1.0 break scanner.chew() proutn(_("Warp factor? ")) if scanner.next()== IHREAL: wfl = True twarp = scanner.real if twarp<1.0 or twarp > 10.0: huh() return break prout(_("Captain, certainly you can give me one of these.")) while True: scanner.chew() ttime = (10.0*game.dist)/twarp**2 tpower = game.dist*twarp*twarp*twarp*(game.shldup+1) if tpower >= game.energy: prout(_("Insufficient energy, sir.")) if not game.shldup or tpower > game.energy*2.0: if not wfl: return proutn(_("New warp factor to try? ")) if scanner.next() == IHREAL: wfl = True twarp = scanner.real if twarp<1.0 or twarp > 10.0: huh() return continue else: scanner.chew() skip(1) return prout(_("But if you lower your shields,")) proutn(_("remaining")) tpower /= 2 else: proutn(_("Remaining")) prout(_(" energy will be %.2f.") % (game.energy-tpower)) if wfl: prout(_("And we will arrive at stardate %.2f.") % (game.state.date+ttime)) elif twarp==1.0: prout(_("Any warp speed is adequate.")) else: prout(_("Minimum warp needed is %.2f,") % (twarp)) prout(_("and we will arrive at stardate %.2f.") % (game.state.date+ttime)) if game.state.remtime < ttime: prout(_("Unfortunately, the Federation will be destroyed by then.")) if twarp > 6.0: prout(_("You'll be taking risks at that speed, Captain")) if (game.isatb==1 and game.state.kscmdr == w1 and \ scheduled(FSCDBAS)< ttime+game.state.date) or \ (scheduled(FCDBAS)<ttime+game.state.date and game.battle == w1): prout(_("The starbase there will be destroyed by then.")) proutn(_("New warp factor to try? ")) if scanner.next() == IHREAL: wfl = True twarp = scanner.real if twarp<1.0 or twarp > 10.0: huh() return else: scanner.chew() skip(1) return | af15867a294e48006eba4fd9997cae401ccbfb05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/af15867a294e48006eba4fd9997cae401ccbfb05/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14251,
13332,
315,
3727,
26579,
358,
336,
13137,
813,
434,
2454,
5162,
364,
279,
341,
11441,
11833,
1199,
341,
21,
273,
2745,
5621,
341,
22,
273,
2745,
1435,
6866,
273,
1083,
309,
302,
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,
14251,
13332,
315,
3727,
26579,
358,
336,
13137,
813,
434,
2454,
5162,
364,
279,
341,
11441,
11833,
1199,
341,
21,
273,
2745,
5621,
341,
22,
273,
2745,
1435,
6866,
273,
1083,
309,
302,
3... |
'text_area':fields.text("Text area",select=True), | 'text_area':fields.text("Text area"), | def write(self, cr, uid, ids, vals, context=None): result = super(Wiki,self).write(cr, uid, ids, vals, context) history = self.pool.get('wiki.wiki.history') if vals.get('text_area'): for id in ids: res = { 'minor_edit':vals.get('minor_edit', True), 'text_area':vals.get('text_area',''), 'write_uid':uid, 'wiki_id' : id, 'summary':vals.get('summary','') } history.create(cr, uid, res) return result | 08e60b16bf9e4017250cff6b3f605da4122184cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/08e60b16bf9e4017250cff6b3f605da4122184cb/wiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
563,
273,
2240,
12,
25438,
16,
2890,
2934,
2626,
12,
3353,
16,
4555,
16,
3258,
16,
5773,
16,
819,
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,
1045,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
563,
273,
2240,
12,
25438,
16,
2890,
2934,
2626,
12,
3353,
16,
4555,
16,
3258,
16,
5773,
16,
819,
13,... |
print "Automatic package building is currently disabled. Please use the PackageMaker GUI to build the full installer" os.system("open /Developer/Applications/Utilities/PackageMaker.app") | for pkg in packages: build_package(install_root + "/" + pkg , mw_version, "/", "%s.pkg" % (pkg)) os.system("mv %s.pkg %s/" % (pkg, quote(mw_subcomponent_package_path + "/"))) input_dir = os.path.dirname(__file__) os.system('cp %s %s' % (os.path.join(input_dir, 'Welcome.txt'), install_root)) build_metapackage(os.path.join(input_dir, 'mw_installer.pmdoc'), mw_version, install_root, installer_name) | def build_metapackage(doc, version, output_path, output_name): print("Building: %s" % pkg) filename = output_name + "_" + version + ".pkg" full_output_path = output_path + "/" + filename cmd = "%s --doc %s --id %s --version %s --out %s" % (package_maker, doc, project_id, version, full_output_path) print(cmd) os.system(cmd) os.system("cd %s; zip -r %s %s" % (output_path, filename +".zip", filename)) | f6c290c66df06e0b5739532baf0d9c951c0d0073 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12313/f6c290c66df06e0b5739532baf0d9c951c0d0073/build_installer_package.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
10578,
438,
1270,
12,
2434,
16,
1177,
16,
876,
67,
803,
16,
876,
67,
529,
4672,
1172,
2932,
16713,
30,
738,
87,
6,
738,
3475,
13,
1544,
273,
225,
876,
67,
529,
397,
8802,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
10578,
438,
1270,
12,
2434,
16,
1177,
16,
876,
67,
803,
16,
876,
67,
529,
4672,
1172,
2932,
16713,
30,
738,
87,
6,
738,
3475,
13,
1544,
273,
225,
876,
67,
529,
397,
8802,
... |
name = model.get_value(l_iter, 2) | try: name = model.get_value(l_iter, 2) except TypeError: return | def remove_from_install_queue(self, widget, data=None): tree = self.gld.get_widget("pacs_tree") model, l_iter = tree.get_selection().get_selected() | ea6ae93eb39d190f438ac5155c32698b37671016 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2654/ea6ae93eb39d190f438ac5155c32698b37671016/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
2080,
67,
5425,
67,
4000,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
2151,
273,
365,
18,
75,
1236,
18,
588,
67,
6587,
2932,
84,
28965,
67,
3413,
7923,
938,
16,
328,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
2080,
67,
5425,
67,
4000,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
2151,
273,
365,
18,
75,
1236,
18,
588,
67,
6587,
2932,
84,
28965,
67,
3413,
7923,
938,
16,
328,
67,
... |
def read(self, id): | def read(self, id=None): | def read(self, id): if id: user = model.Session.query(model.User).get(id) else: user = model.User.by_name(c.user) if not user: h.redirect_to(controller='user', action='login', id=None) c.read_user = user.name c.is_myself = user.name == c.user c.about_formatted = self._format_about(user.about) revisions_q = model.Session.query(model.Revision).filter_by(author=user.name) c.num_edits = revisions_q.count() c.num_pkg_admin = model.Session.query(model.PackageRole).filter_by(user=user, role=model.Role.ADMIN).count() c.activity = revisions_q.limit(20).all() return render('user/read.html') | 056d46ff0c9bd8f39aab607bdbd09d830ad39655 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/265/056d46ff0c9bd8f39aab607bdbd09d830ad39655/user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
612,
33,
7036,
4672,
309,
612,
30,
729,
273,
938,
18,
2157,
18,
2271,
12,
2284,
18,
1299,
2934,
588,
12,
350,
13,
469,
30,
729,
273,
938,
18,
1299,
18,
1637,
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,
855,
12,
2890,
16,
612,
33,
7036,
4672,
309,
612,
30,
729,
273,
938,
18,
2157,
18,
2271,
12,
2284,
18,
1299,
2934,
588,
12,
350,
13,
469,
30,
729,
273,
938,
18,
1299,
18,
1637,
67,... |
self.internal_coordinates.append(similar.internal_coordinates) | self.internal_coordinates.extend(similar.internal_coordinates) | def __init__(self, items): self.items = items self.dict_items = dict((item.name, item) for item in items) counter = 0 self.internal_coordinates = [] for similar in self.items: self.internal_coordinates.append(similar.internal_coordinates) similar.indices = [] for internal_coordinate in similar.internal_coordinates: internal_coordinate.index = counter similar.indices.append(counter) counter += 1 | bc3283b9dc3a2142b155c5afa2b60a273e68fe03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11053/bc3283b9dc3a2142b155c5afa2b60a273e68fe03/internal_coordinates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1516,
4672,
365,
18,
3319,
273,
1516,
365,
18,
1576,
67,
3319,
273,
2065,
12443,
1726,
18,
529,
16,
761,
13,
364,
761,
316,
1516,
13,
3895,
273,
374,
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,
1001,
2738,
972,
12,
2890,
16,
1516,
4672,
365,
18,
3319,
273,
1516,
365,
18,
1576,
67,
3319,
273,
2065,
12443,
1726,
18,
529,
16,
761,
13,
364,
761,
316,
1516,
13,
3895,
273,
374,
3... |
} | } | def outParamForm(name, type): type = unaliasType(type) if type.kind == 'builtin': return '&' + name elif type.kind == 'native': if type.modifier == 'ref': return name else: return '&' + name else: return 'getter_AddRefs(%s)' % name | c14e4ffd79d3b97514ad112cb46c7dbd495ad99b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/c14e4ffd79d3b97514ad112cb46c7dbd495ad99b/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
596,
786,
1204,
12,
529,
16,
618,
4672,
618,
273,
640,
4930,
559,
12,
723,
13,
309,
618,
18,
9224,
422,
296,
24553,
4278,
327,
9824,
397,
508,
1327,
618,
18,
9224,
422,
296,
13635,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
596,
786,
1204,
12,
529,
16,
618,
4672,
618,
273,
640,
4930,
559,
12,
723,
13,
309,
618,
18,
9224,
422,
296,
24553,
4278,
327,
9824,
397,
508,
1327,
618,
18,
9224,
422,
296,
13635,
4... |
ParseDbg.add("parse_statement RETURNING") | self.parse_dbg_indent = self.parse_dbg_indent[:-2] self.pdbg("parse_statement RETURNING") | def parse_statement(self, rule, msg, expr): ParseDbg.add("parse_statement(%s, %s, %s)" % (rule, msg, expr)) expr = expr.strip() if msg == "": if expr == "": self.parse_message_block() expr = self.buffer else: self.message = [msg] if expr == "": if not self.readline(): return else: self.buffer = expr msg = "" if self.message == [] else " |" + "\n |".join(self.message) # no ending LF if rule == "CONFLICT": # takes any number of exprs exprs = [] ParseDbg.add("before conflict parse_expr() expr=%s line=%s" % (expr, self.buffer)) (bool, expr) = self.parse_expression() ParseDbg.add("conflict parse_expr()1 bool=%s bool=%s" % (bool, expr)) while bool != None: if bool: exprs.append(expr) (bool, expr) = self.parse_expression() ParseDbg.add("conflict parse_expr()N bool=%s bool=%s" % ("True" if bool else "False", expr)) if len(exprs) > 1: Msg.add("[CONFLICT]") for e in exprs: Msg.add(self.pprint(e, " > ")) if msg != "": Msg.add(msg) elif rule == "NOTE": # takes any number of exprs ParseDbg.add("function NOTE: %s" % msg) exprs = [] (bool, expr) = self.parse_expression(prune=True) while bool != None: if bool: exprs.append(expr) (bool, expr) = self.parse_expression(prune=True) if not Opt.Quiet and len(exprs) > 0: Msg.add("[NOTE]") for e in exprs: Msg.add(self.pprint(e, " > ")) if msg != "": Msg.add(msg) elif rule == "PATCH": # takes 2 exprs (bool1, expr1) = self.parse_expression() if bool1 != None: (bool2, expr2) = self.parse_expression() if bool2 == None: Msg.add(_["Warning: %s: PATCH rule must have 2 conditions"] % (self.where())) return if bool1 and not bool2: # case where the patch is present but the thing to be patched is missing Msg.add(_["[PATCH]\n%s is missing some pre-requisites:\n%s"] % (self.pprint(expr1, " !!"), self.pprint(expr2, " "))) if msg != "": Msg.add(msg) if bool2 and not bool1: # case where the patch is missing for the thing to be patched Msg.add(_["[PATCH]\n%s for:\n%s"] % (self.pprint(expr1, " !!"), self.pprint(expr2, " "))) if msg != "": Msg.add(msg) elif rule == "REQUIRES": # takes 2 exprs (bool1, expr1) = self.parse_expression(prune=True) if bool1 != None: (bool2, expr2) = self.parse_expression() ParseDbg.add("REQ expr2 == %s" % expr2) if bool2 == None: self.parse_error("REQUIRES rule must have 2 conditions") return if bool1 and not bool2: Msg.add(_["[REQUIRES]\n%s Requires:\n%s"] % (self.pprint(expr1, " !!!"), self.pprint(expr2, " > "))) if msg != "": Msg.add(msg) ParseDbg.add("parse_statement RETURNING") | 57b9dbd56a9e011788ef60900e9a91776ddbb48d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2827/57b9dbd56a9e011788ef60900e9a91776ddbb48d/mlox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
11516,
12,
2890,
16,
1720,
16,
1234,
16,
3065,
4672,
2884,
4331,
75,
18,
1289,
2932,
2670,
67,
11516,
9275,
87,
16,
738,
87,
16,
738,
87,
2225,
738,
261,
5345,
16,
1234,
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,
1109,
67,
11516,
12,
2890,
16,
1720,
16,
1234,
16,
3065,
4672,
2884,
4331,
75,
18,
1289,
2932,
2670,
67,
11516,
9275,
87,
16,
738,
87,
16,
738,
87,
2225,
738,
261,
5345,
16,
1234,
16... |
color=OWGraphTools.ColorPaletteHSV(len(self.dist)) | color=OWColorPalette.ColorPaletteHSV(len(self.dist)) | def __init__(self,attrVal,*args): CanvasNode.__init__(self,*args) self.dist=self.tree.distribution self.attrVal=attrVal maxInst=max(self.dist) #self.majClass=ind=list(self.dist).index(maxProb) self.majClass = filter(lambda i, m=maxInst: self.dist[i]==m, range(len(self.dist))) ind=self.majClass[0] self.majClassName=self.dist.items()[ind][0] self.majClassProb=maxInst/self.dist.cases self.tarClassProb=self.dist.items()[0][1]/self.dist.cases self.numInst=self.dist.cases self.title = QGraphicsTextItem(attrVal, self, self.scene()) self.texts=[self.majClassName, "%.3f" % self.majClassProb, "%.3f" % self.tarClassProb, "%.1f" % self.numInst] self.name = (self.tree.branches and self.tree.branchSelector.classVar.name) or self.majClassName self.textAdvance=12 self.addTextLine(attrVal, fitSquare=False) self.addTextLine("", fitSquare=False) self.addTextLine("", fitSquare=False) self.addTextLine(fitSquare=False) self.addTextLine(self.name, fitSquare=False) | 4985a3f0eae9d505e6588b34d6691d7569525adf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/4985a3f0eae9d505e6588b34d6691d7569525adf/OWClassificationTreeGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1747,
3053,
16,
14,
1968,
4672,
20966,
907,
16186,
2738,
972,
12,
2890,
16,
14,
1968,
13,
365,
18,
4413,
33,
2890,
18,
3413,
18,
16279,
365,
18,
1747,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1747,
3053,
16,
14,
1968,
4672,
20966,
907,
16186,
2738,
972,
12,
2890,
16,
14,
1968,
13,
365,
18,
4413,
33,
2890,
18,
3413,
18,
16279,
365,
18,
1747,
... |
def log(self, callable): | def log(self, fault_code, *args): | def log(self, callable): """ Log the transaction """ | b7db2809bc2e85a559ea634f59da2999db4075ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/b7db2809bc2e85a559ea634f59da2999db4075ce/Method.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
12530,
67,
710,
16,
380,
1968,
4672,
3536,
1827,
326,
2492,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
12530,
67,
710,
16,
380,
1968,
4672,
3536,
1827,
326,
2492,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
@type key: C{immutable}, typically C{String} | @type key: C{immutable}, typically C{String} or C{int} | def _index(self, key): """ returns a tuple with the item refered to by the key, and the collection @param key: the key used for lookup into the ref collection. @type key: C{immutable}, typically C{String} @return: a C{Tuple} containing C{(item, collection)} or raises an exception if not found. """ coll = self.getAttributeValue(self.collectionSpecifier()) i = coll.getByAlias(key) return (i, coll) | 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,
389,
1615,
12,
2890,
16,
498,
4672,
3536,
1135,
279,
3193,
598,
326,
761,
8884,
329,
358,
635,
326,
498,
16,
471,
326,
1849,
632,
891,
498,
30,
326,
498,
1399,
364,
3689,
1368,
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,
1615,
12,
2890,
16,
498,
4672,
3536,
1135,
279,
3193,
598,
326,
761,
8884,
329,
358,
635,
326,
498,
16,
471,
326,
1849,
632,
891,
498,
30,
326,
498,
1399,
364,
3689,
1368,
326,
... |
return self.pipelineNumber | return int(self.pipelineNumber) | def getPipelineNumber(self): return self.pipelineNumber | 315fed894682d914284861c750293930dc4c7c5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6549/315fed894682d914284861c750293930dc4c7c5a/killjobs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
3842,
1854,
12,
2890,
4672,
327,
365,
18,
14511,
1854,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1689,
3842,
1854,
12,
2890,
4672,
327,
365,
18,
14511,
1854,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.writeCallbacks, self.removedWriteCallbacks): | self.writeCallbacks, self.removedWriteCallbacks): | def generateEvents(self, readables, writeables): """Generator that creates the list of events that should be dealt with on this iteration of the event loop. This includes all socket read/write callbacks, timeouts and idle calls. "events" are implemented as functions that should be called with no arguments. """ | 188dd78cafac2eb64514bf34f3463877d0d9d7c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/188dd78cafac2eb64514bf34f3463877d0d9d7c5/eventloop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3783,
12,
2890,
16,
855,
1538,
16,
1045,
1538,
4672,
3536,
3908,
716,
3414,
326,
666,
434,
2641,
716,
1410,
506,
443,
2390,
598,
603,
333,
6532,
434,
326,
871,
2798,
18,
225,
122... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3783,
12,
2890,
16,
855,
1538,
16,
1045,
1538,
4672,
3536,
3908,
716,
3414,
326,
666,
434,
2641,
716,
1410,
506,
443,
2390,
598,
603,
333,
6532,
434,
326,
871,
2798,
18,
225,
122... |
approvedStatus = model.StatusTranslation.query.filter_by( statusname='Approved').one() deniedStatus = model.StatusTranslation.query.filter_by( statusname='Denied').one() addedStatus = model.StatusTranslation.query.filter_by(statusname='Added').one() ownedStatus = model.StatusTranslation.query.filter_by(statusname='Owned').one() | def edit_package(self, package, **changes): '''Add a new package to the database. ''' # Check that the tg.identity is allowed to make changes to the package if not identity.in_any_group('cvsadmin'): return dict(status=False, message='User must be in cvsadmin') | 48b4c95df35399b9205c63bf94720f75862df541 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/48b4c95df35399b9205c63bf94720f75862df541/dispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
5610,
12,
2890,
16,
2181,
16,
2826,
6329,
4672,
9163,
986,
279,
394,
2181,
358,
326,
2063,
18,
9163,
468,
2073,
716,
326,
18289,
18,
10781,
353,
2935,
358,
1221,
3478,
358,
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,
3874,
67,
5610,
12,
2890,
16,
2181,
16,
2826,
6329,
4672,
9163,
986,
279,
394,
2181,
358,
326,
2063,
18,
9163,
468,
2073,
716,
326,
18289,
18,
10781,
353,
2935,
358,
1221,
3478,
358,
3... | |
matingScheme=RandomSelection(ops= [CloneGenoTransmitter()] + | initOps=InitSex(), matingScheme=RandomMating(ops= [MendelianGenoTransmitter()] + | def testSubPopsOfDuringMatingOperator(self): 'Testing subPops parameter of during mating operators' pop = Population([100]*10, infoFields='a') pop.evolve( matingScheme=RandomSelection(ops= [CloneGenoTransmitter()] + [InfoExec('a=%d' % i, subPops=i) for i in range(10)]), gen=1 ) print(pop.indInfo('a')) | cce5d124e1db3b5d07ad36209f4f883f29071a2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/cce5d124e1db3b5d07ad36209f4f883f29071a2d/test_03_operator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1676,
52,
4473,
951,
26424,
49,
1776,
5592,
12,
2890,
4672,
296,
22218,
720,
52,
4473,
1569,
434,
4982,
312,
1776,
12213,
11,
1843,
273,
10264,
6234,
3816,
6625,
5772,
2163,
16,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1676,
52,
4473,
951,
26424,
49,
1776,
5592,
12,
2890,
4672,
296,
22218,
720,
52,
4473,
1569,
434,
4982,
312,
1776,
12213,
11,
1843,
273,
10264,
6234,
3816,
6625,
5772,
2163,
16,
11... |
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size, | self.fp.write(struct.pack("<LLL", zinfo.CRC, zinfo.compress_size, | def write(self, filename, arcname=None, compress_type=None): """Put the bytes from filename into the archive under the name arcname.""" if not self.fp: raise RuntimeError( "Attempt to write to ZIP archive that was already closed") | 42282b10b46702cb6d8edce0152e597e44fb6834 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/42282b10b46702cb6d8edce0152e597e44fb6834/zipfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1544,
16,
8028,
529,
33,
7036,
16,
8099,
67,
723,
33,
7036,
4672,
3536,
6426,
326,
1731,
628,
1544,
1368,
326,
5052,
3613,
326,
508,
8028,
529,
12123,
309,
486,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1544,
16,
8028,
529,
33,
7036,
16,
8099,
67,
723,
33,
7036,
4672,
3536,
6426,
326,
1731,
628,
1544,
1368,
326,
5052,
3613,
326,
508,
8028,
529,
12123,
309,
486,
365... |
assert isinstance(record.seq, Seq) | if t_format in possible_None_seq_formats : assert isinstance(record.seq, Seq) or record.seq is None else : assert isinstance(record.seq, Seq) | def check_simple_write_read(records, indent=" ") : #print indent+"Checking we can write and then read back these records" for format in test_write_read_alignment_formats : print indent+"Checking can write/read as '%s' format" % format #Going to write to a handle... handle = StringIO() try : c = SeqIO.write(sequences=records, handle=handle, format=format) assert c == len(records) except ValueError, e : #This is often expected to happen, for example when we try and #write sequences of different lengths to an alignment file. print indent+"Failed: %s" % str(e) assert format != t_format, \ "Should be able to re-write in the original format!" #Carry on to the next format: continue handle.flush() handle.seek(0) #Now ready to read back from the handle... try : records2 = list(SeqIO.parse(handle=handle, format=format)) except ValueError, e : #This is BAD. We can't read our own output. #I want to see the output when called from the test harness, #run_tests.py (which can be funny about new lines on Windows) handle.seek(0) raise ValueError("%s\n\n%s\n\n%s" \ % (str(e), repr(handle.read()), repr(records))) assert len(records2) == t_count for r1, r2 in zip(records, records2) : #Check the bare minimum (ID and sequence) as #many formats can't store more than that. #Check the sequence if format == "genbank" : #The GenBank parser will convert everything to upper case. assert r1.seq.tostring().upper() == r2.seq.tostring() elif format == "qual" : assert r2.seq is None else : assert r1.seq.tostring() == r2.seq.tostring() #Beware of different quirks and limitations in the #valid character sets and the identifier lengths! if format=="phylip" : assert r1.id.replace("[","").replace("]","")[:10] == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="clustal" : assert r1.id.replace(" ","_")[:30] == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="stockholm" : assert r1.id.replace(" ","_") == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="fasta" : assert r1.id.split()[0] == r2.id else : assert r1.id == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) | 37668b69e2513d4fc1251f0c2bfb0b969ef1fdca /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/37668b69e2513d4fc1251f0c2bfb0b969ef1fdca/test_SeqIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
9369,
294,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
1842,
67,
2626,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
9369,
294,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
1842,
67,
2626,... |
self._remove(pkg, cs, lk, _pending, depth) if _pending: self._pending(cs, lk, _pending, depth) | self._remove(pkg, cs, lk, None, depth) | def _upgrade(self, pkgs, changeset, locked, pending, depth=0): #print "[%03d] _upgrade()" % depth #depth += 1 | fa863c9ad9e8fb247c36224ac1e88ebd00689a16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/fa863c9ad9e8fb247c36224ac1e88ebd00689a16/transaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15097,
12,
2890,
16,
16922,
16,
22463,
16,
8586,
16,
4634,
16,
3598,
33,
20,
4672,
468,
1188,
30048,
4630,
72,
65,
389,
15097,
10031,
738,
3598,
468,
5979,
1011,
404,
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,
15097,
12,
2890,
16,
16922,
16,
22463,
16,
8586,
16,
4634,
16,
3598,
33,
20,
4672,
468,
1188,
30048,
4630,
72,
65,
389,
15097,
10031,
738,
3598,
468,
5979,
1011,
404,
2,
-100,
-10... |
raise ValueError, "the modulus must be a positive integer" | raise ValueError, "the modulus must be a positive integer" | def solve_mod(eqns, modulus, solution_dict = False): r""" Return all solutions to an equation or list of equations modulo the given integer modulus. Each equation must involve only polynomials in 1 or many variables. By default the solutions are returned as `n`-tuples, where `n` is the number of variables appearing anywhere in the given equations. The variables are in alphabetical order. INPUT: - ``eqns`` - equation or list of equations - ``modulus`` - an integer - ``solution_dict`` - (default: False) if True, return a list of dictionaries containing the solutions. EXAMPLES:: sage: var('x,y') (x, y) sage: solve_mod([x^2 + 2 == x, x^2 + y == y^2], 14) [(4, 2), (4, 6), (4, 9), (4, 13)] sage: solve_mod([x^2 == 1, 4*x == 11], 15) [(14,)] Fermat's equation modulo 3 with exponent 5:: sage: var('x,y,z') (x, y, z) sage: solve_mod([x^5 + y^5 == z^5], 3) [(0, 0, 0), (0, 1, 1), (0, 2, 2), (1, 0, 1), (1, 1, 2), (1, 2, 0), (2, 0, 2), (2, 1, 0), (2, 2, 1)] We can solve with respect to a bigger modulus if it consists only of small prime factors:: sage: [d] = solve_mod([5*x + y == 3, 2*x - 3*y == 9], 3*5*7*11*19*23*29, solution_dict = True) sage: d[x] 12915279 sage: d[y] 8610183 We solve an simple equation modulo 2:: sage: x,y = var('x,y') sage: solve_mod([x == y], 2) [(0, 0), (1, 1)] .. warning:: The current implementation splits the modulus into prime powers, then naively enumerates all possible solutions and finally combines the solution using the Chinese Remainder Theorem. The interface is good, but the algorithm is horrible if the modulus has some larger prime factors! Sage *does* have the ability to do something much faster in certain cases at least by using Groebner basis, linear algebra techniques, etc. But for a lot of toy problems this function as is might be useful. At least it establishes an interface. """ from sage.rings.all import Integer, Integers, PolynomialRing, factor, crt_basis from sage.misc.all import cartesian_product_iterator from sage.modules.all import vector from sage.matrix.all import matrix if not isinstance(eqns, (list, tuple)): eqns = [eqns] modulus = Integer(modulus) if modulus < 1: raise ValueError, "the modulus must be a positive integer" vars = list(set(sum([list(e.variables()) for e in eqns], []))) vars.sort(cmp = lambda x,y: cmp(repr(x), repr(y))) n = len(vars) factors = [p**i for p,i in factor(modulus)] crt_basis = vector(Integers(modulus), crt_basis(factors)) solutions = [solve_mod_enumerate(eqns, p) for p in factors] ans = [] for solution in cartesian_product_iterator(solutions): solution_mat = matrix(Integers(modulus), solution) ans.append(tuple(c.dot_product(crt_basis) for c in solution_mat.columns())) if solution_dict == True: sol_dict = [dict(zip(vars, solution)) for solution in ans] return sol_dict else: return ans | 289f5b4d9eb95aca379cac874aa709bc2e2631eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/289f5b4d9eb95aca379cac874aa709bc2e2631eb/relation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
67,
1711,
12,
11253,
2387,
16,
24770,
16,
6959,
67,
1576,
273,
1083,
4672,
436,
8395,
2000,
777,
22567,
358,
392,
15778,
578,
666,
434,
30369,
26109,
326,
864,
3571,
24770,
18,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
67,
1711,
12,
11253,
2387,
16,
24770,
16,
6959,
67,
1576,
273,
1083,
4672,
436,
8395,
2000,
777,
22567,
358,
392,
15778,
578,
666,
434,
30369,
26109,
326,
864,
3571,
24770,
18,
83... |
p,s = wait(pid) | p, s = wait(pid) log_pid(p, s) | def run(argv, pidfile=''): if os.environ.has_key('ZDAEMON_MANAGED'): # We're being run by the child. return os.environ['ZDAEMON_MANAGED']='TRUE' if not os.environ.has_key('Z_DEBUG_MODE'): detach() # detach from the controlling terminal while 1: try: pid = os.fork() if pid: # We're the parent (the daemon process) # pass all "normal" signals along to our child, but don't # respond to them ourselves unless they say "die"! interesting = [1, 2, 3, 10, 12, 15] # ie. HUP, INT, QUIT, USR1, USR2, TERM for sig in interesting: signal.signal(sig, SignalPasser(pid)) pstamp('Started subprocess: pid %s' % pid, zLOG.INFO) write_pidfile(pidfile) p,s = wait(pid) # waitpid will block until child exit if s: # continue and restart because our child died # with a nonzero exit code, meaning he bit it in # an unsavory way (likely a segfault or something) log_pid(p, s) continue else: # no need to restart, our child wanted to die. raise DieNow else: # we're the child (Zope/ZEO) args = [pyth] if not __debug__: # we're running in optimized mode args.append('-O') os.execv(pyth, tuple(args) + tuple(argv)) except DieNow: sys.exit() | 3d5400377bb4ae286249bb9a3616e6d725f76c11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9782/3d5400377bb4ae286249bb9a3616e6d725f76c11/Daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
19485,
16,
27656,
2218,
11,
4672,
309,
1140,
18,
28684,
18,
5332,
67,
856,
2668,
62,
9793,
3375,
673,
67,
9560,
29693,
11,
4672,
468,
1660,
4565,
3832,
1086,
635,
326,
1151,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19485,
16,
27656,
2218,
11,
4672,
309,
1140,
18,
28684,
18,
5332,
67,
856,
2668,
62,
9793,
3375,
673,
67,
9560,
29693,
11,
4672,
468,
1660,
4565,
3832,
1086,
635,
326,
1151,
... |
descr, fields = parsed_docstring.split_fields() self._descr = descr | def __parse_docstring(self, docstring): errors = [] parsed_docstring = markup.parse(docstring, self._docformat, errors) self._parse_errors = [e for e in errors if e.is_fatal()] self._parse_warnings = [e for e in errors if not e.is_fatal()] descr, fields = parsed_docstring.split_fields() self._descr = descr | ab822894d6e2a7d6720010ae6c6d714b5b5fea7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/ab822894d6e2a7d6720010ae6c6d714b5b5fea7f/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2670,
67,
24675,
12,
2890,
16,
14525,
4672,
1334,
273,
5378,
2707,
67,
24675,
273,
9813,
18,
2670,
12,
24675,
16,
365,
6315,
2434,
2139,
16,
1334,
13,
365,
6315,
2670,
67,
4324,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2670,
67,
24675,
12,
2890,
16,
14525,
4672,
1334,
273,
5378,
2707,
67,
24675,
273,
9813,
18,
2670,
12,
24675,
16,
365,
6315,
2434,
2139,
16,
1334,
13,
365,
6315,
2670,
67,
4324,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.