rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
instance_names = self.wanted instance_list = [self.cfg.GetInstanceInfo(iname) for iname in instance_names] | all_info = self.cfg.GetAllInstancesInfo() if self.do_locking: instance_names = self.acquired_locks[locking.LEVEL_INSTANCE] else: instance_names = all_info.keys() instance_list = [all_info[iname] for iname in instance_names] | def Exec(self, feedback_fn): """Computes the list of nodes and their attributes. | 57a2fb91c82b31e727dedd697b564d04e440dcf3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/57a2fb91c82b31e727dedd697b564d04e440dcf3/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3889,
12,
2890,
16,
10762,
67,
4293,
4672,
3536,
10743,
326,
666,
434,
2199,
471,
3675,
1677,
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,
... | [
1,
1,
1,
1,
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,
3889,
12,
2890,
16,
10762,
67,
4293,
4672,
3536,
10743,
326,
666,
434,
2199,
471,
3675,
1677,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.check_loops({'jump': 1, 'merge_point': 1, | self.check_loops({'jump': 1, | def f(i): counter = 20 c = 0 while counter > 0: myjitdriver.can_enter_jit(counter=counter, i=i) myjitdriver.jit_merge_point(counter=counter, i=i) s = lst[i] c = len(s) counter -= 1 return c | e2b9e78dd5310255c0d5e1aaae274854a5f5137f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/e2b9e78dd5310255c0d5e1aaae274854a5f5137f/test_send.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
77,
4672,
3895,
273,
4200,
276,
273,
374,
1323,
3895,
405,
374,
30,
3399,
78,
305,
7407,
18,
4169,
67,
2328,
67,
78,
305,
12,
7476,
33,
7476,
16,
277,
33,
77,
13,
3399,
78... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
77,
4672,
3895,
273,
4200,
276,
273,
374,
1323,
3895,
405,
374,
30,
3399,
78,
305,
7407,
18,
4169,
67,
2328,
67,
78,
305,
12,
7476,
33,
7476,
16,
277,
33,
77,
13,
3399,
78... |
keys = [k for k in keys if k.name.endswith(self._separator)] | keys = ((nm,k) for (nm,k) in keys if k.name.endswith(sep)) | def _filter_keys(self,path,keys,wildcard,full,absolute,dirs_only,files_only): """Filter out keys not matching the given criteria. | 8ef6d26a6a9b6416ad98420a072855a138f4fecc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/8ef6d26a6a9b6416ad98420a072855a138f4fecc/s3fs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
67,
2452,
12,
2890,
16,
803,
16,
2452,
16,
22887,
16,
2854,
16,
12547,
16,
8291,
67,
3700,
16,
2354,
67,
3700,
4672,
3536,
1586,
596,
1311,
486,
3607,
326,
864,
3582,
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,
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,
2188,
67,
2452,
12,
2890,
16,
803,
16,
2452,
16,
22887,
16,
2854,
16,
12547,
16,
8291,
67,
3700,
16,
2354,
67,
3700,
4672,
3536,
1586,
596,
1311,
486,
3607,
326,
864,
3582,
18,
... |
text = publish_string(source = self.raw, writer = MoinWriter(formatter, self.request), enable_exit = None, settings_overrides = {'traceback': 1}) | parts = publish_parts(source = self.raw, writer = MoinWriter(formatter, self.request), settings_overrides = {'traceback': 1}) text = '<h2>' + parts['title'] + '</h2>' text += '<h3>' + parts['subtitle'] + '</h3>' text += parts['fragment'] | def format(self, formatter): text = publish_string(source = self.raw, writer = MoinWriter(formatter, self.request), enable_exit = None, settings_overrides = {'traceback': 1}) self.request.write(html_escape_unicode(text)) | 808a47ec40289463ede8bbc7eb49b0efcce50bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/808a47ec40289463ede8bbc7eb49b0efcce50bb6/rst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
4453,
4672,
2140,
273,
225,
3808,
67,
6019,
12,
3168,
273,
365,
18,
1899,
16,
2633,
273,
490,
885,
2289,
12,
12354,
16,
365,
18,
2293,
3631,
1947,
67,
19775,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
4453,
4672,
2140,
273,
225,
3808,
67,
6019,
12,
3168,
273,
365,
18,
1899,
16,
2633,
273,
490,
885,
2289,
12,
12354,
16,
365,
18,
2293,
3631,
1947,
67,
19775,
273,
... |
- resp: server response if succesful | - resp: server response if successful | def xover(self,start,end): """Process an XOVER command (optional server extension) Arguments: - start: start of range - end: end of range Returns: - resp: server response if succesful - list: list of (art-nr, subject, poster, date, id, references, size, lines)""" | 2b9ab6deeb822299ae8e193ffb4fa9d7bd4be97e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/2b9ab6deeb822299ae8e193ffb4fa9d7bd4be97e/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
1643,
12,
2890,
16,
1937,
16,
409,
4672,
3536,
2227,
392,
1139,
12959,
1296,
261,
10444,
1438,
2710,
13,
13599,
30,
300,
787,
30,
787,
434,
1048,
300,
679,
30,
679,
434,
1048,
286... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
1643,
12,
2890,
16,
1937,
16,
409,
4672,
3536,
2227,
392,
1139,
12959,
1296,
261,
10444,
1438,
2710,
13,
13599,
30,
300,
787,
30,
787,
434,
1048,
300,
679,
30,
679,
434,
1048,
286... |
limit = (readBlockSize(keyRing, packetType & 3) + (packetType & 3) + 1 + startLoc) | readBlockSize(keyRing, packetType) | def getGPGKeyTuple(keyId, keyRing, secret=0, passPhrase=''): startPoint = keyRing.tell() keyRing.seek(0, SEEK_END) limit = keyRing.tell() if limit == 0: # empty file, there can be no keys in it raise KeyNotFound(keyId) if secret: assertSigningKey(keyId, keyRing) keyRing.seek(0) while (keyId not in getKeyId(keyRing)): seekNextKey(keyRing) if keyRing.tell() == limit: raise KeyNotFound(keyId) startLoc=keyRing.tell() packetType=ord(keyRing.read(1)) if secret and (not ((packetType>>2) & 1)): raise IncompatibleKey("Can't get private key from public keyring") limit = (readBlockSize(keyRing, packetType & 3) + (packetType & 3) + 1 + startLoc) if ord(keyRing.read(1)) != 4: raise MalformedKeyRing("Can only read V4 packets") keyRing.seek(4, SEEK_CUR) keyType = ord(keyRing.read(1)) if keyType in PK_ALGO_ALL_RSA: # do RSA stuff # n e n = readMPI(keyRing) e = readMPI(keyRing) if secret: privateMPIs = decryptPrivateKey(keyRing, limit, 4, passPhrase) r = (n, e, privateMPIs[0], privateMPIs[1], privateMPIs[2], privateMPIs[3]) else: r = (n, e) elif keyType in (PK_ALGO_DSA,): p = readMPI(keyRing) q = readMPI(keyRing) g = readMPI(keyRing) y = readMPI(keyRing) if secret: privateMPIs=decryptPrivateKey(keyRing, limit, 1, passPhrase) r = (y, g, p, q, privateMPIs[0]) else: r = (y, g, p, q) elif keyType in PK_ALGO_ALL_ELGAMAL: raise MalformedKeyRing("Can't use El-Gamal keys in current version") p = readMPI(keyRing) g = readMPI(keyRing) y = readMPI(keyRing) if secret: privateMPIs = decryptPrivateKey(keyRing, limit, 1, passPhrase) r = (y, g, p, privateMPIs[0]) else: r = (p, g, y) else: raise MalformedKeyRing("Wrong key type") keyRing.seek(startPoint) return r | b44b5e443cfcd74ac611138e7368458698f50b96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/b44b5e443cfcd74ac611138e7368458698f50b96/openpgpfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7162,
18679,
653,
9038,
12,
856,
548,
16,
498,
10369,
16,
4001,
33,
20,
16,
1342,
12812,
2218,
11,
4672,
787,
2148,
273,
498,
10369,
18,
88,
1165,
1435,
498,
10369,
18,
16508,
12,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7162,
18679,
653,
9038,
12,
856,
548,
16,
498,
10369,
16,
4001,
33,
20,
16,
1342,
12812,
2218,
11,
4672,
787,
2148,
273,
498,
10369,
18,
88,
1165,
1435,
498,
10369,
18,
16508,
12,
20,
... |
""" | """ | def fl_set_glcanvas_defaults(config): """ fl_set_glcanvas_defaults(config): """ _fl_set_glcanvas_defaults(config) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
7043,
15424,
67,
7606,
12,
1425,
4672,
3536,
1183,
67,
542,
67,
7043,
15424,
67,
7606,
12,
1425,
4672,
3536,
225,
389,
2242,
67,
542,
67,
7043,
15424,
67,
7606,
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,
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,
1183,
67,
542,
67,
7043,
15424,
67,
7606,
12,
1425,
4672,
3536,
1183,
67,
542,
67,
7043,
15424,
67,
7606,
12,
1425,
4672,
3536,
225,
389,
2242,
67,
542,
67,
7043,
15424,
67,
7606,
12,
... |
v[0] = tmp_bit | v[0] = tmp_bit | def NKStarGraph(self,n,k): r''' Returns the (n,k)-star graph. The vertices of the (n,k)-star graph are the set of all arangements of n symbols into labels of length k. There are two adjacency rules for the (n,k)-star graph. Frist, two vertices are adjacent if one can be obtained from the other by swapping the first symbol with another symbol. Second, two vertices are adjacent if one can be obtained from the other by swapping the first symbol with an external symbol (a symbol not used in the original label). INPUT:: - ``n`` - ``k`` EXAMPLES:: sage: g = graphs.NKStarGraph(4,2) sage: g.plot() # long time REFERENCES: - Wei-Kuo, Chiang, and Chen Rong-Jaye. "The (n, k)-star graph: A generalized star graph." Information Processing Letters 56, no. 5 (December 8, 1995): 259-264. AUTHORS: - Michael Yurko (2009-09-01) | aa71796c41743b21cf5dd66d16cf6af9c8e363ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/aa71796c41743b21cf5dd66d16cf6af9c8e363ee/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
225,
1021,
6928,
434,
326,
261,
82,
16,
79,
24950,
10983,
2667,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
225,
1021,
6928,
434,
326,
261,
82,
16,
79,
24950,
10983,
2667,
... |
cr.execute('Update crm_meeting set caldav_alarm_id=%s \ where id=%s' % (alarm_id, meeting.id)) | cr.execute('Update crm_meeting set caldav_alarm_id=%s, \ alarm_id=%s where id=%s' % (alarm_id, basic_alarm.id, meeting.id)) | def do_alarm_create(self, cr, uid, ids, context={}): alarm_obj = self.pool.get('calendar.alarm') model_obj = self.pool.get('ir.model') model_id = model_obj.search(cr, uid, [('model', '=', self._name)])[0] | 26cfa4092073a5af135483c80028c6b7529d485f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26cfa4092073a5af135483c80028c6b7529d485f/crm_meeting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
20681,
67,
2640,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
13721,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
11650,
18,
20681,
6134,
938,
67,
2603,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
20681,
67,
2640,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
13721,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
11650,
18,
20681,
6134,
938,
67,
2603,
273,
... |
struct.pack(mask2, self.update, self.btclock, self.timestamp) | struct.pack(self.mask2, self.update, self.btclock, self.timestamp) | def encode(self): return CSPRequest.encode(self) + \ struct.pack(mask2, self.update, self.btclock, self.timestamp) | 5ab73709fd24f71f38fc2ed06c5d1fbb3996f217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8028/5ab73709fd24f71f38fc2ed06c5d1fbb3996f217/mcap_defs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
4672,
327,
385,
3118,
691,
18,
3015,
12,
2890,
13,
397,
521,
1958,
18,
2920,
12,
4455,
22,
16,
365,
18,
2725,
16,
365,
18,
70,
5111,
739,
16,
365,
18,
5508,
13,
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,
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,
2017,
12,
2890,
4672,
327,
385,
3118,
691,
18,
3015,
12,
2890,
13,
397,
521,
1958,
18,
2920,
12,
4455,
22,
16,
365,
18,
2725,
16,
365,
18,
70,
5111,
739,
16,
365,
18,
5508,
13,
2,
... |
body += ' ' + _("Password:") + " %s\n" % ("*" * len(password)) | body += ' ' + _("Password:") + " %s\n" % ("*" * len(str(password))) | def send_new_user_account_warning(new_account_email, send_to, password, ln=CFG_SITE_LANG): """Send an email to the address given by send_to about the new account new_account_email.""" _ = gettext_set_language(ln) sub = _("Account created on '%s'") % CFG_SITE_NAME body = _("An account has been created for you on '%s':") % CFG_SITE_NAME + '\n\n' body += ' ' + _("Username/Email:") + " %s\n" % new_account_email body += ' ' + _("Password:") + " %s\n" % ("*" * len(password)) body += "\n---------------------------------" body += "\n%s" % CFG_SITE_NAME return send_email(CFG_SITE_SUPPORT_EMAIL, send_to, sub, body, header='') | 8810b7577517bd09983e6619dbcc9390f71d279b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1931/8810b7577517bd09983e6619dbcc9390f71d279b/webaccessadmin_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2704,
67,
1355,
67,
4631,
67,
8551,
12,
2704,
67,
4631,
67,
3652,
16,
1366,
67,
869,
16,
2201,
16,
7211,
33,
19727,
67,
20609,
67,
10571,
4672,
3536,
3826,
392,
2699,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2704,
67,
1355,
67,
4631,
67,
8551,
12,
2704,
67,
4631,
67,
3652,
16,
1366,
67,
869,
16,
2201,
16,
7211,
33,
19727,
67,
20609,
67,
10571,
4672,
3536,
3826,
392,
2699,
358,
... |
datas = self.pool.get(model).read(cr, uid, [id], fields, context) | try: datas = self.pool.get(model).read(cr, uid, [id], fields, context) except except_orm: return False | def _result_get(x, keys): if x[1] in keys: return False keys.append(x[1]) if x[3]: model,id = x[2].split(',') id = int(id) fields = self.pool.get(model).fields_get_keys(cr, uid) pos = 0 while pos<len(fields): if fields[pos] in ('report_sxw_content', 'report_rml_content', 'report_sxw', 'report_rml', 'report_sxw_content_data', 'report_rml_content_data'): del fields[pos] else: pos+=1 datas = self.pool.get(model).read(cr, uid, [id], fields, context) datas= datas and datas[0] or None if not datas: #ir_del(cr, uid, x[0]) return False else: datas = pickle.loads(str(x[2])) if meta: meta2 = pickle.loads(x[4]) return (x[0],x[1],datas,meta2) return (x[0],x[1],datas) | 8e7b6c87d6f5371564286e73f3e3459e590f066a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/8e7b6c87d6f5371564286e73f3e3459e590f066a/ir_values.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2088,
67,
588,
12,
92,
16,
1311,
4672,
309,
619,
63,
21,
65,
316,
1311,
30,
327,
1083,
1311,
18,
6923,
12,
92,
63,
21,
5717,
309,
619,
63,
23,
14542,
938,
16,
350,
273,
619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2088,
67,
588,
12,
92,
16,
1311,
4672,
309,
619,
63,
21,
65,
316,
1311,
30,
327,
1083,
1311,
18,
6923,
12,
92,
63,
21,
5717,
309,
619,
63,
23,
14542,
938,
16,
350,
273,
619,
... |
assert s_arg is not None | if s_arg is None: return False | def annotate_hook(self, func, variables, args_s=[], **kwds_s): if func is None: return bk = self.bookkeeper s_func = bk.immutablevalue(func) uniquekey = 'jitdriver.%s' % func.func_name args_s = args_s[:] for name in variables: if '.' not in name: s_arg = kwds_s['s_' + name] else: objname, fieldname = name.split('.') s_instance = kwds_s['s_' + objname] s_arg = s_instance.classdef.about_attribute(fieldname) assert s_arg is not None args_s.append(s_arg) bk.emulate_pbc_call(uniquekey, s_func, args_s) | b12180b5de3f693496ad9c18fa99946ad1883dfb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/b12180b5de3f693496ad9c18fa99946ad1883dfb/jit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13795,
67,
4476,
12,
2890,
16,
1326,
16,
3152,
16,
833,
67,
87,
22850,
6487,
2826,
25577,
67,
87,
4672,
309,
1326,
353,
599,
30,
327,
22723,
273,
365,
18,
3618,
79,
9868,
272,
67,
64... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13795,
67,
4476,
12,
2890,
16,
1326,
16,
3152,
16,
833,
67,
87,
22850,
6487,
2826,
25577,
67,
87,
4672,
309,
1326,
353,
599,
30,
327,
22723,
273,
365,
18,
3618,
79,
9868,
272,
67,
64... |
http_stream.__init__(self, conn = conn) | http_stream.__init__(self, sock = sock) | def __init__(self, conn, handlers, cert = None, key = None, ta = (), dynamic_ta = None): self.log("Starting") self.handlers = handlers http_stream.__init__(self, conn = conn) self.expect_close = not want_persistent_server | 21ba16becd2cacb82de2177f2ccb1780daa110ff /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/119/21ba16becd2cacb82de2177f2ccb1780daa110ff/https.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1487,
16,
4919,
16,
3320,
273,
599,
16,
498,
273,
599,
16,
13561,
273,
1832,
16,
5976,
67,
2351,
273,
599,
4672,
365,
18,
1330,
2932,
11715,
7923,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1487,
16,
4919,
16,
3320,
273,
599,
16,
498,
273,
599,
16,
13561,
273,
1832,
16,
5976,
67,
2351,
273,
599,
4672,
365,
18,
1330,
2932,
11715,
7923,
365,
... |
return "Python Shell" | return self.shell_title | def short_title(self): return "Python Shell" | eeb88076e7f4a89ce76d271379ca0aced0c2d6c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eeb88076e7f4a89ce76d271379ca0aced0c2d6c7/PyShell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3025,
67,
2649,
12,
2890,
4672,
327,
315,
15774,
19433,
6,
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... | [
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,
3025,
67,
2649,
12,
2890,
4672,
327,
315,
15774,
19433,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif name == "index.txt": | elif name.endswith("index.txt"): | def __init__(self, stream, parent, has_name=True, use_bank=False, has_separator=False): OnDemandFilter.__init__(self, "worms2_res", "Worms2 resource", stream, parent, "<") guess = stream.getN(3, False) if guess not in Resource.tag_name: self.name = "Strange chunk!?" self.addPadding() return self.tag = self.doRead("tag", "Type", (EnumChunk, "string[3]", Resource.tag_name)).value self.read("tag_end", "Type end", (FormatChunk, "string[1]")) if self.tag != "DIR": self.read("size", "Size", (FormatChunk, "uint32")) | 6ad82742aeb5ce248df132848aa70c0a386a8d2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2280/6ad82742aeb5ce248df132848aa70c0a386a8d2d/worms2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1407,
16,
982,
16,
711,
67,
529,
33,
5510,
16,
999,
67,
10546,
33,
8381,
16,
711,
67,
11287,
33,
8381,
4672,
2755,
25461,
1586,
16186,
2738,
972,
12,
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,
1001,
2738,
972,
12,
2890,
16,
1407,
16,
982,
16,
711,
67,
529,
33,
5510,
16,
999,
67,
10546,
33,
8381,
16,
711,
67,
11287,
33,
8381,
4672,
2755,
25461,
1586,
16186,
2738,
972,
12,
2... |
+ html_page[match.end():]] | + html_page[match.start():]] | def add_error(self, html_page, html_errors): add_text = ('<pre style="background-color: #ffd; color: #600; ' 'border: 1px solid #000;">%s</pre>' % cgi.escape(html_errors)) match = self._end_body_regex.search(html_page) if match: return [html_page[:match.start()] + add_text + html_page[match.end():]] else: return [html_page + add_text] | 417afb105e3d5d8a57ef013d1cd708b371755855 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11400/417afb105e3d5d8a57ef013d1cd708b371755855/wdg_validate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1636,
12,
2890,
16,
1729,
67,
2433,
16,
1729,
67,
4324,
4672,
527,
67,
955,
273,
7707,
32,
1484,
2154,
1546,
9342,
17,
3266,
30,
468,
1403,
72,
31,
2036,
30,
468,
28133,
31,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1636,
12,
2890,
16,
1729,
67,
2433,
16,
1729,
67,
4324,
4672,
527,
67,
955,
273,
7707,
32,
1484,
2154,
1546,
9342,
17,
3266,
30,
468,
1403,
72,
31,
2036,
30,
468,
28133,
31,... |
elif b == None: | elif not b: | def unidiff(a, ad, b, bd, fn, r=None, text=False, showfunc=False, ignorews=False): if not a and not b: return "" epoch = util.datestr((0, 0)) if not text and (util.binary(a) or util.binary(b)): l = ['Binary file %s has changed\n' % fn] elif a == None: b = b.splitlines(1) l1 = "--- %s\t%s\n" % ("/dev/null", epoch) l2 = "+++ %s\t%s\n" % ("b/" + fn, bd) l3 = "@@ -0,0 +1,%d @@\n" % len(b) l = [l1, l2, l3] + ["+" + e for e in b] elif b == None: a = a.splitlines(1) l1 = "--- %s\t%s\n" % ("a/" + fn, ad) l2 = "+++ %s\t%s\n" % ("/dev/null", epoch) l3 = "@@ -1,%d +0,0 @@\n" % len(a) l = [l1, l2, l3] + ["-" + e for e in a] else: al = a.splitlines(1) bl = b.splitlines(1) l = list(bunidiff(a, b, al, bl, "a/" + fn, "b/" + fn, showfunc=showfunc, ignorews=ignorews)) if not l: return "" # difflib uses a space, rather than a tab l[0] = "%s\t%s\n" % (l[0][:-2], ad) l[1] = "%s\t%s\n" % (l[1][:-2], bd) for ln in xrange(len(l)): if l[ln][-1] != '\n': l[ln] += "\n\ No newline at end of file\n" if r: l.insert(0, "diff %s %s\n" % (' '.join(["-r %s" % rev for rev in r]), fn)) return "".join(l) | 45f39c17b0fb199b95305101fd6c61b0e929f814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/45f39c17b0fb199b95305101fd6c61b0e929f814/mdiff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
350,
3048,
12,
69,
16,
1261,
16,
324,
16,
13837,
16,
2295,
16,
436,
33,
7036,
16,
977,
33,
8381,
16,
2405,
644,
33,
8381,
16,
2305,
4749,
33,
8381,
4672,
225,
309,
486,
279,
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,
640,
350,
3048,
12,
69,
16,
1261,
16,
324,
16,
13837,
16,
2295,
16,
436,
33,
7036,
16,
977,
33,
8381,
16,
2405,
644,
33,
8381,
16,
2305,
4749,
33,
8381,
4672,
225,
309,
486,
279,
4... |
def note_element(line): | def note_element(element): | def note_element(line): """Print the meteorological element we are reading.""" # See ftp://ftp.ncdc.noaa.gov/pub/data/ushcn/v2/monthly/readme.txt element = line[6] assert element in '1234' element = {'1':'mean maximum temperature', '2':'mean minimum temperature', '3':'average temperature', '4':'precipitation', }[element] print "(Reading %s)" % element | a71ab7b92d8043413ba119ed6e49a88e9820a6e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6890/a71ab7b92d8043413ba119ed6e49a88e9820a6e0/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4721,
67,
2956,
12,
2956,
4672,
3536,
5108,
326,
5100,
73,
280,
18224,
930,
732,
854,
6453,
12123,
468,
2164,
13487,
2207,
11727,
18,
82,
4315,
71,
18,
2135,
7598,
18,
75,
1527,
19,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4721,
67,
2956,
12,
2956,
4672,
3536,
5108,
326,
5100,
73,
280,
18224,
930,
732,
854,
6453,
12123,
468,
2164,
13487,
2207,
11727,
18,
82,
4315,
71,
18,
2135,
7598,
18,
75,
1527,
19,
10... |
print 'B' print 'highest_scoring_id', highest_scoring_id print 'highest_scoring_id in nodes:', highest_scoring_id in self._node_pool try: del self._node_pool[highest_scoring_id] except KeyError: print "couldn't delete", highest_scoring_id if self._safe: self.save() logging.debug('Deleting node from node pool') | delete_highest_scoring_id = True | def _resume_populate(self): '''Gather a group of TwitterUsers. Tries to choose a highly interconnected group. Picks up where a previous _populate() call stopped''' while self._node_pool and len(self._community_members) < self._max_population: #choose person on list with highest interconnection #first 0 at end of line is to take first user, second 0 get's user's id from tuple result self._rescore_node_pool() highest_scoring_id = sorted(self._node_pool.items(), key=lambda item: item[1]['score'], reverse=True)[0][0] curr_node = self._node_pool[highest_scoring_id]['user'] print 'A' print 'highest_scoring_id', highest_scoring_id print 'highest_scoring_id in nodes:', highest_scoring_id in self._node_pool #choose friends by rank to add to community, seems to work #better then followers friend_ids = self._sort_by_empty_score(curr_node['friend_ids']) added_count = 0 community_ids = [] for member in self._community_members: community_ids.append(member['uid']) for friend_id in friend_ids: if added_count <= self._max_friends_per_user: try: if friend_id not in community_ids: tu = TwitterUser(friend_id) sleep(1) new_user = tu.get_all_data() #TODO add some sort of conditions for addition to the community self._community_members.append(new_user) logging.debug('TwitterUser accepted to community') new_user_score = self._filled_user_score(new_user) self._node_pool[friend_id] = {'user':new_user, 'score':new_user_score} if self._safe: self.save() print len(self._community_members), "members" added_count += 1 logging.debug('TwitterUser accepted to node_pool') print 'B' print 'highest_scoring_id', highest_scoring_id print 'highest_scoring_id in nodes:', highest_scoring_id in self._node_pool #once a user is chosen for evaluation pop him off the node list try: del self._node_pool[highest_scoring_id] except KeyError: print "couldn't delete", highest_scoring_id if self._safe: self.save() logging.debug('Deleting node from node pool') except TwitterHTTPError as error: logging.debug('Twitter error: %s' % error) self.save() print error print "Number of members: ", len(self._community_members) #rate limiting error if '400' in str(error) or '420' in str(error): logging.debug('Hit rate limit, quitting') return #unauthorized for user error elif '401' in str(error) or '404' in str(error): try: del self._node_pool[highest_scoring_id] except KeyError: print "in 401: couldn't delete", highest_scoring_id if self._safe: self.save() logging.debug('Deleting node from node pool') #otherwise it's probably just a twitter server issue else: logging.debug('Server error, sleeping for 5 secs') sleep(5) except BadUser as error: logging.debug('TwitterUser rejected: %s' % error) except URLError: logging.debug('URLError, sleeping for 5 secs') sleep(5) self.save() print "Maximum community size reached." print "Number of members: ", len(self._community_members) | ef227cdbabff264d1bffcd87491ebedbc8ee1534 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14113/ef227cdbabff264d1bffcd87491ebedbc8ee1534/populate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
25158,
67,
19936,
12,
2890,
4672,
9163,
26092,
279,
1041,
434,
19551,
6588,
18,
10000,
281,
358,
9876,
279,
3551,
715,
1554,
8537,
1041,
18,
453,
20642,
731,
1625,
279,
2416,
389,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
25158,
67,
19936,
12,
2890,
4672,
9163,
26092,
279,
1041,
434,
19551,
6588,
18,
10000,
281,
358,
9876,
279,
3551,
715,
1554,
8537,
1041,
18,
453,
20642,
731,
1625,
279,
2416,
389,
1... |
glyphs_to_append=("_1025", "_2049") | glyphs_to_append=("_1025", "_2561") | def initialize_glyphs(): global initial_glyphs, initialcount, count for number in initial_glyphs: toto="_00%02d" % int(number) initial_glyphs.insert(0,toto) initial_glyphs.remove(number) if font_name=="gregorio": glyphs_to_append=("_1025", "_2049") initialcount=176 elif font_name=="parmesan": glyphs_to_append=("_1025", "_2049") initialcount=176 elif font_name=="greciliae": glyphs_to_append=("_2049", "_1025") initialcount=177 elif font_name=="gregoria": glyphs_to_append=("_2049", "_1025") initialcount=176 for glyphnumber in glyphs_to_append: initial_glyphs.append(glyphnumber) count=initialcount | 5e58ce24f078d67f25368e0eba680cf9c28c8737 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7096/5e58ce24f078d67f25368e0eba680cf9c28c8737/squarize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
19426,
87,
13332,
2552,
2172,
67,
19426,
87,
16,
2172,
1883,
16,
1056,
364,
1300,
316,
2172,
67,
19426,
87,
30,
268,
6302,
1546,
67,
713,
9,
3103,
72,
6,
738,
509,
12,
2696... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
19426,
87,
13332,
2552,
2172,
67,
19426,
87,
16,
2172,
1883,
16,
1056,
364,
1300,
316,
2172,
67,
19426,
87,
30,
268,
6302,
1546,
67,
713,
9,
3103,
72,
6,
738,
509,
12,
2696... |
if __containsIf(node.thenPart): | if len(node.thenPart) == 1 and __containsIf(node.thenPart): | def __if(node): result = "if(%s)" % compress(node.condition) thenCode = compress(node.thenPart) elsePart = getattr(node, "elsePart", None) if elsePart: # Special handling for cascaded if-else-if cases where the else might be # attached to the wrong if in cases where the braces are omitted. if __containsIf(node.thenPart): if thenCode.endswith(__semicolonSymbol): thenCode = "{%s}" % thenCode[:-len(__semicolonSymbol)] else: thenCode = "{%s}" % thenCode # Finally append code result += thenCode # Now process else part if elsePart: result += "else" elseCode = compress(elsePart) # Micro optimization: Don't need a space when the child is a block # At this time the brace could not be part of a map declaration (would be a syntax error) if not elseCode.startswith("{"): result += " " result += elseCode return result | 42c22a0d8da6756694e12aa04e29b74eb46179de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/42c22a0d8da6756694e12aa04e29b74eb46179de/Compressor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
430,
12,
2159,
4672,
563,
273,
315,
430,
9275,
87,
2225,
738,
8099,
12,
2159,
18,
4175,
13,
1508,
1085,
273,
8099,
12,
2159,
18,
15991,
1988,
13,
469,
1988,
273,
3869,
12,
2159,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
430,
12,
2159,
4672,
563,
273,
315,
430,
9275,
87,
2225,
738,
8099,
12,
2159,
18,
4175,
13,
1508,
1085,
273,
8099,
12,
2159,
18,
15991,
1988,
13,
469,
1988,
273,
3869,
12,
2159,
... |
'setup.exe & chrome.7z.') option_parser.add_option('-v', '--last_chrome_version', help='Version of the previous installer. ' + 'Used only for the purpose of naming archive file. Optional.') | 'setup.exe, courgette.exe (if --diff_algorithm is COURGETTE) ' + '& chrome.7z.') option_parser.add_option('-f', '--setup_exe_format', default='COMPRESSED', help='How setup.exe should be included {COMPRESSED|DIFF|FULL}.') option_parser.add_option('-a', '--diff_algorithm', default='BSDIFF', help='Diff algorithm to use when generating differential patches ' + '{BSDIFF|COURGETTE}.') | def main(options): """Main method that reads input file, creates archive file and write resource input file. """ current_version = BuildVersion(options.output_dir) config = Readconfig(options.output_dir, options.input_file, current_version) staging_dir = MakeStagingDirectory(options.output_dir) CopyAllFilesToStagingDir(config, options.distribution, staging_dir, options.output_dir) # Name of the archive file built (for example - chrome.7z or # patch-<old_version>-<new_version>.7z or patch-<new_version>.7z archive_file_name = CreateArchiveFile(options.output_dir, staging_dir, current_version, options.last_chrome_installer, options.last_chrome_version, options.skip_rebuild_archive) CreateResourceInputFile(options.output_dir, options.last_chrome_installer, archive_file_name) | 28937b29b58e9aa1989349335ef83995e008098e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/28937b29b58e9aa1989349335ef83995e008098e/create_installer_archive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
4672,
3536,
6376,
707,
716,
6838,
810,
585,
16,
3414,
5052,
585,
471,
1045,
1058,
810,
585,
18,
3536,
783,
67,
1589,
273,
3998,
1444,
12,
2116,
18,
2844,
67,
1214,
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,
2774,
12,
2116,
4672,
3536,
6376,
707,
716,
6838,
810,
585,
16,
3414,
5052,
585,
471,
1045,
1058,
810,
585,
18,
3536,
783,
67,
1589,
273,
3998,
1444,
12,
2116,
18,
2844,
67,
1214,
13,
... |
filename, extension = os.path.splitext(current_file) | dummy, filename, extension = decompose_file(current_file) if extension: extension = '.' + extension | def Move_Files_to_Storage(parameters, curdir, form, user_info=None): """ The function moves files received from the standard submission's form through file input element(s). Websubmit_engine built the following file organization in the directory curdir/files curdir/files | _______________________________________________________________________________ | | | ./file input 1 element's name ./file input 2 element's name .... | | test1.pdf test2.pdf There is only one instance of all possible extension(pdf, gz...) in each part otherwise we may encount problems when renaming files. +parameters['rename']: if given, all the files in curdir/files are renamed. parameters['rename'] is of the form: <PA>elemfilename[re]</PA>* where re is an regexp to select(using re.sub) what part of the elem file has to be selected.e.g <PA>file:TEST_FILE_RN</PA> +parameters['documenttype']: if given, other formats are created. It has 2 possible values: - if "picture" icon in gif format is created - if "fulltext" ps, gz .... formats are created +parameters['paths_and_suffixes']: directories to look into and corresponding suffix to add to every file inside. It must have the same structure as a python dictionnary of the following form {'FrenchAbstract':'french', 'EnglishAbstract':''} The keys are the file input element name from the form <=> directories in curdir/files The values associated are the suffixes which will be added to all the files in e.g. curdir/files/FrenchAbstract +parameters['iconsize'] need only if "icon" is selected in parameters['documenttype'] """ global sysno paths_and_suffixes = parameters['paths_and_suffixes'] rename = parameters['rename'] documenttype = parameters['documenttype'] iconsize = parameters['iconsize'] ## Create an instance of BibRecDocs for the current recid(sysno) bibrecdocs = BibRecDocs(sysno) paths_and_suffixes = get_dictionary_from_string(paths_and_suffixes) ## Go through all the directory specified in the keys ## of parameters['paths_and_suffixes'] for path in paths_and_suffixes.keys(): ## Check if there is a directory for the current path if os.path.exists("%s/files/%s" % (curdir, path)): mybibdoc = None ## Check if there is no document with the same status (status=path) ## already associated with the current recid existing_with_same_status = bibrecdocs.list_bibdocs(path) ## If yes, use the existing docid if existing_with_same_status: mybibdoc = existing_with_same_status[0] ## Go through all the files in curdir/files/path for current_file in os.listdir("%s/files/%s" % (curdir, path)): ## retrieve filename and extension filename, extension = os.path.splitext(current_file) if len(paths_and_suffixes[path]) != 0: extension = "_%s%s" % (paths_and_suffixes[path], extension) ## Build the new file name if rename paramter has been given if rename: filename = re.sub('<PA>(?P<content>[^<]*)</PA>', \ get_pa_tag_content, \ parameters['rename']) if rename or len(paths_and_suffixes[path]) != 0: ## Rename the file try: # Write the log rename_cmd fd = open("%s/rename_cmd" % curdir, "a+") fd.write("%s/files/%s/%s" % (curdir, path, current_file) + " to " +\ "%s/files/%s/%s%s" % (curdir, path, filename, extension) + "\n\n") ## Rename os.rename("%s/files/%s/%s" % (curdir, path, current_file), \ "%s/files/%s/%s%s" % (curdir, path, filename, extension)) fd.close() ## Save the new name in a text file in curdir so that ## the new filename can be used by templates to created the recmysl fd = open("%s/%s_RENAMED" % (curdir, path), "w") fd.write("%s%s" % (filename, extension)) fd.close() except OSError, err: msg = "Cannot rename the file.[%s]" msg %= str(err) raise InvenioWebSubmitFunctionWarning(msg) fullpath = "%s/files/%s/%s%s" % (curdir, path, filename, extension) ## Check if there is any existing similar file if not bibrecdocs.check_file_exists(fullpath): if not mybibdoc: ## New docid is created mybibdoc = bibrecdocs.add_new_file(fullpath, never_fail=True) else: ## No new docid created but the file ## is archive in /bibdoc ID/ directory mybibdoc = bibrecdocs.add_new_format(fullpath, mybibdoc.get_docname()) ## Create related formats if mybibdoc: ## Fulltext if documenttype == "fulltext": additionalformats = createRelatedFormats(fullpath) if len(additionalformats) > 0: for additionalformat in additionalformats: mybibdoc.add_file_new_format(additionalformat) ## Icon elif documenttype == "picture": iconpath = createIcon(fullpath, iconsize) if iconpath is not None and mybibdoc is not None: mybibdoc.add_icon(iconpath) ## Save the new icon filename in a text file in curdir so that ## it can be used by templates to created the recmysl try: fd = open("%s/%s_ICON" % (curdir, path), "w") fd.write(os.path.basename(iconpath)) fd.close() except OSError, err: msg = "Cannot store icon filename.[%s]" msg %= str(err) raise InvenioWebSubmitFunctionWarning(msg) elif mybibdoc is not None: mybibdoc.delete_icon() return "" | 9996b95382441eecce2da6fd99836417575b1925 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/9996b95382441eecce2da6fd99836417575b1925/Move_Files_to_Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9933,
67,
2697,
67,
869,
67,
3245,
12,
3977,
16,
662,
1214,
16,
646,
16,
729,
67,
1376,
33,
7036,
4672,
3536,
1021,
445,
13934,
1390,
5079,
628,
326,
4529,
8515,
1807,
646,
3059,
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,
9933,
67,
2697,
67,
869,
67,
3245,
12,
3977,
16,
662,
1214,
16,
646,
16,
729,
67,
1376,
33,
7036,
4672,
3536,
1021,
445,
13934,
1390,
5079,
628,
326,
4529,
8515,
1807,
646,
3059,
585,
... |
def __repr__(self): | def _repr_(self): | def __repr__(self): """ EXAMPLES:: | e050660b40043fea1aabd4f39f7277f80dae21b1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/e050660b40043fea1aabd4f39f7277f80dae21b1/element_wrapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12715,
67,
12,
2890,
4672,
3536,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
389,
12715,
67,
12,
2890,
4672,
3536,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if checkProg('DVI to DTL converter', ['dv2dt']) != ['', 'none'] and checkProg('DTL to DVI converter', ['dt2dv']) != ['', 'none']: addToRC(r'\Format dvi2 dvi DraftDVI "" "" "document"') checkProg('a HTML previewer', ['mozilla file://$$p$$i', 'netscape'], rc_entry = [ r'\Format html html HTML H "%%" "" "document"' ]) | addToRC(r'\Format dvi2 dvi DraftDVI "" "" "document"') checkViewer('a HTML previewer', ['mozilla file://$$p$$i', 'netscape'], rc_entry = [r'\Format html html HTML H "%%" "" "document"']) | def checkFormatEntries(): ''' Check all formats (\Format entries) ''' checkProg('a Tgif viewer and editor', ['tgif'], rc_entry = [ r'\Format tgif obj Tgif "" "%%" "%%" ""']) # checkProg('a FIG viewer and editor', ['xfig'], rc_entry = [ r'\Format fig fig FIG "" "%%" "%%" ""'] ) # checkProg('a Grace viewer and editor', ['xmgrace'], rc_entry = [ r'\Format agr agr Grace "" "%%" "%%" ""'] ) # checkProg('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'], rc_entry = [ r'\Format fen fen FEN "" "%%" "%%" ""' ]) # path, iv = checkProg('a raster image viewer', ['xv', 'kview', 'gimp']) path, ie = checkProg('a raster image editor', ['gimp']) addToRC(r'''\Format bmp bmp BMP "" "%s" "%s" "" | d5443737342903de489d527802cd2cdd38987d74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/d5443737342903de489d527802cd2cdd38987d74/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1630,
5400,
13332,
9163,
2073,
777,
6449,
17938,
1630,
3222,
13,
9163,
866,
626,
75,
2668,
69,
399,
13905,
14157,
471,
4858,
2187,
10228,
88,
13905,
17337,
4519,
67,
4099,
273,
306,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1630,
5400,
13332,
9163,
2073,
777,
6449,
17938,
1630,
3222,
13,
9163,
866,
626,
75,
2668,
69,
399,
13905,
14157,
471,
4858,
2187,
10228,
88,
13905,
17337,
4519,
67,
4099,
273,
306,
... |
self._canvas.circle( circle.cx, circle.cy, circle.r) | self._canvas.circle( circle.cx, circle.cy, circle.r, link_info=self._get_link_info_dict(circle)) | def drawCircle(self, circle): self._canvas.circle( circle.cx, circle.cy, circle.r) | 37afe6db14252697b2c6f0bd32cd0cbf4e4ebe03 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3878/37afe6db14252697b2c6f0bd32cd0cbf4e4ebe03/renderSVG.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
19490,
12,
2890,
16,
12470,
4672,
365,
6315,
15424,
18,
18970,
12,
12470,
18,
71,
92,
16,
12470,
18,
2431,
16,
12470,
18,
86,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
19490,
12,
2890,
16,
12470,
4672,
365,
6315,
15424,
18,
18970,
12,
12470,
18,
71,
92,
16,
12470,
18,
2431,
16,
12470,
18,
86,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
gencache.EnsureModule("{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}", 0, 8, 0) | gencache.EnsureDispatch("Access.Application") | def GenerateSupport(): # dao gencache.EnsureModule("{00025E01-0000-0000-C000-000000000046}", 0, 4, 0) # Access gencache.EnsureModule("{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}", 0, 8, 0) | 4ac69dbd825555279fd9e8c310e68e0a8aca54df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/4ac69dbd825555279fd9e8c310e68e0a8aca54df/testAccess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
6289,
13332,
468,
15229,
314,
1331,
807,
18,
12512,
3120,
2932,
95,
3784,
2947,
41,
1611,
17,
2787,
17,
2787,
17,
39,
3784,
17,
2787,
9449,
8749,
1532,
16,
374,
16,
1059,
16,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
6289,
13332,
468,
15229,
314,
1331,
807,
18,
12512,
3120,
2932,
95,
3784,
2947,
41,
1611,
17,
2787,
17,
2787,
17,
39,
3784,
17,
2787,
9449,
8749,
1532,
16,
374,
16,
1059,
16,
374... |
if group_ip.version == 4: | if addrinfo[0] == socket.AF_INET: | def sender(group): group_ip = ipaddr.IP(group) s = socket.socket(_sockfam(group_ip), socket.SOCK_DGRAM) # Set Time-to-live (optional) ttl_bin = struct.pack('@i', MYTTL) if group_ip.version == 4: s.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl_bin) else: s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_HOPS, ttl_bin) while True: data = repr(time.time()) s.sendto(data + '\0', (group_ip.ip_ext_full, MYPORT)) time.sleep(1) | 388637d373807b82cdd4fc04cf46f0b81f162768 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/388637d373807b82cdd4fc04cf46f0b81f162768/mcast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5793,
12,
1655,
4672,
1041,
67,
625,
273,
2359,
4793,
18,
2579,
12,
1655,
13,
225,
272,
273,
2987,
18,
7814,
24899,
15031,
74,
301,
12,
1655,
67,
625,
3631,
2987,
18,
3584,
3507,
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,
5793,
12,
1655,
4672,
1041,
67,
625,
273,
2359,
4793,
18,
2579,
12,
1655,
13,
225,
272,
273,
2987,
18,
7814,
24899,
15031,
74,
301,
12,
1655,
67,
625,
3631,
2987,
18,
3584,
3507,
67,
... |
try: if self.options['direction'] == "" or self.options['direction'] == None: | if self.options.has_key('direction'): if self.options['direction'] == "": | def injectScript(self): """ Returns a string of script to inject in to the page """ | 28b4eb28ad2dfae50793b0a48b1f28a52237851c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5464/28b4eb28ad2dfae50793b0a48b1f28a52237851c/BrowserMediaAnimatedBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4590,
3651,
12,
2890,
4672,
3536,
2860,
279,
533,
434,
2728,
358,
4590,
316,
358,
326,
1363,
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,... | [
1,
1,
1,
1,
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,
4590,
3651,
12,
2890,
4672,
3536,
2860,
279,
533,
434,
2728,
358,
4590,
316,
358,
326,
1363,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
files = subprocess.Popen(cmdline, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE ) | p = subprocess.Popen(cmdline, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE ) | def run_cgi(self): """Execute a CGI script.""" path = self.path dir, rest = self.cgi_info | 074707e14c1bde99dc168e8c2df4e1c4dee1e26d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/074707e14c1bde99dc168e8c2df4e1c4dee1e26d/CGIHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
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,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assert (self.public_key is None and self.private_key_id is None) or \ self.public_key.get_DER() == self.private_key_id.get_public_DER() assert (self.manifest_public_key is None and self.manifest_private_key_id is None) or \ self.manifest_public_key.get_DER() == self.manifest_private_key_id.get_public_DER() | assert self.public_key is None or self.private_key_id is None or self.public_key.get_DER() == self.private_key_id.get_public_DER() assert self.manifest_public_key is None or self.manifest_private_key_id is None or self.manifest_public_key.get_DER() == self.manifest_private_key_id.get_public_DER() | def sql_decode(self, vals): """ Extra assertions for SQL decode of a ca_detail_obj. """ rpki.sql.sql_persistent.sql_decode(self, vals) assert (self.public_key is None and self.private_key_id is None) or \ self.public_key.get_DER() == self.private_key_id.get_public_DER() assert (self.manifest_public_key is None and self.manifest_private_key_id is None) or \ self.manifest_public_key.get_DER() == self.manifest_private_key_id.get_public_DER() | a2385fb6b3d70e5542dc515e48ebc527133ddf2b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/119/a2385fb6b3d70e5542dc515e48ebc527133ddf2b/rpki_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1847,
67,
3922,
12,
2890,
16,
5773,
4672,
3536,
13592,
7820,
364,
3063,
2495,
434,
279,
3474,
67,
8992,
67,
2603,
18,
3536,
436,
5465,
77,
18,
4669,
18,
4669,
67,
19393,
18,
4669,
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,
1847,
67,
3922,
12,
2890,
16,
5773,
4672,
3536,
13592,
7820,
364,
3063,
2495,
434,
279,
3474,
67,
8992,
67,
2603,
18,
3536,
436,
5465,
77,
18,
4669,
18,
4669,
67,
19393,
18,
4669,
67,
... |
line(out_h, indent, 'extern PyTypeObject %sType;', names[-1]) | line(out_h, indent, 'extern PyTypeObject %s$$Type;', names[-1]) | def python(env, out_h, out, cls, superCls, names, superNames, constructors, methods, protectedMethods, fields, instanceFields, mapping, sequence, declares, typeset, excludes, moduleName): line(out_h) line(out_h, 0, '#include <Python.h>') line(out_h) indent = 0 for name in names[:-1]: line(out_h, indent, 'namespace %s {', name) indent += 1 line(out_h, indent, 'extern PyTypeObject %sType;', names[-1]) line(out_h) line(out_h, indent, 'class t_%s {', names[-1]) line(out_h, indent, 'public:') line(out_h, indent + 1, 'PyObject_HEAD') line(out_h, indent + 1, '%s object;', names[-1]) line(out_h, indent + 1, 'static PyObject *wrap_Object(const %s&);', names[-1]) line(out_h, indent + 1, 'static PyObject *wrap_jobject(const jobject&);') line(out_h, indent + 1, 'static void install(PyObject *module);') line(out_h, indent + 1, 'static void initialize(PyObject *module);') line(out_h, indent, '};') iterator = findClass('java/util/Iterator') enumeration = findClass('java/util/Enumeration') while indent: indent -= 1 line(out_h, indent, '}') line(out) line(out, 0, '#include "structmember.h"') line(out, 0, '#include "functions.h"') line(out, 0, '#include "macros.h"') for inner in cls.getDeclaredClasses(): if inner in typeset and not inner in declares: if Modifier.isStatic(inner.getModifiers()): line(out, 0, '#include "%s.h"', inner.getName().replace('.', '/')) for method in methods: if method.getName() == 'pythonExtension': isExtension = True break else: isExtension = False line(out) indent = 0 for name in names[:-1]: line(out, indent, 'namespace %s {', name) indent += 1 if not isExtension: line(out, indent, 'static PyObject *t_%s_cast_(PyTypeObject *type, PyObject *arg);', names[-1]) line(out, indent, 'static PyObject *t_%s_instance_(PyTypeObject *type, PyObject *arg);', names[-1]) if constructors: line(out, indent, 'static int t_%s_init_(t_%s *self, PyObject *args, PyObject *kwds);', names[-1], names[-1]) constructorName = 't_%s_init_' %(names[-1]) else: constructorName = 'abstract_init' if superCls: superMethods = set([method.getName() for method in superCls.getMethods()]) else: superMethods = () allMethods = {} extMethods = {} propMethods = {} if methods: for method in methods: modifiers = method.getModifiers() name = method.getName() params = method.getParameterTypes() superMethod = None isNative = Modifier.isNative(modifiers) isStatic = Modifier.isStatic(modifiers) if (isExtension and not isStatic and superCls and isNative): superMethod = find_method(superCls, name, params) if isExtension and isNative and not isStatic: extMethods.setdefault(name, []).append(method) if superMethod or not (isExtension and isNative and not isStatic): allMethods.setdefault(name, []).append(method) if not (isExtension and isNative): nameLen = len(name) paramsLen = len(params) if nameLen > 3 and paramsLen == 0 and name.startswith('get'): propMethods.setdefault(name[3].lower() + name[4:], []).append(method) elif nameLen > 3 and paramsLen == 1 and name.startswith('set'): propMethods.setdefault(name[3].lower() + name[4:], []).append(method) elif nameLen > 2 and paramsLen == 0 and name.startswith('is'): propMethods.setdefault(name[2].lower() + name[3:], []).append(method) properties = set([name for name in propMethods.iterkeys() if name not in allMethods]) propMethods = [(name, propMethods[name]) for name in properties] sort(propMethods, key=lambda x: x[0]) extMethods = extMethods.items() sort(extMethods, key=lambda x: x[0]) allMethods = allMethods.items() sort(allMethods, key=lambda x: x[0]) iteratorMethod = None iteratorExt = False nextMethod = None nextExt = False nextElementMethod = None nextElementExt = False mappingMethod = None if mapping: mappingName, mappingSig = mapping.split(':') sequenceLenMethod = None sequenceGetMethod = None if sequence: sequenceLenName, sequenceLenSig = sequence[0].split(':') sequenceGetName, sequenceGetSig = sequence[1].split(':') for name, methods in allMethods: args, x, cardinality = methodargs(methods, superMethods) sort(methods, key=lambda x: len(x.getParameterTypes())) method = methods[0] modifiers = method.getModifiers() if name == 'iterator' and iteratorMethod is None: if (not method.getParameterTypes() and iterator.isAssignableFrom(method.getReturnType())): iteratorMethod = method elif name == 'next' and nextMethod is None: if (not method.getParameterTypes() and not method.getReturnType().isPrimitive()): nextMethod = method elif name == 'nextElement' and nextElementMethod is None: if (not method.getParameterTypes() and not method.getReturnType().isPrimitive()): nextElementMethod = method elif mapping and name == mappingName and mappingMethod is None: if signature(method) == mappingSig: mappingMethod = (method, cardinality) elif sequence and name == sequenceLenName and sequenceLenMethod is None: if signature(method) == sequenceLenSig: sequenceLenMethod = (method, cardinality) elif sequence and name == sequenceGetName and sequenceGetMethod is None: if signature(method) == sequenceGetSig: sequenceGetMethod = (method, cardinality) elif isExtension and name == 'clone' and Modifier.isNative(modifiers): args, x, cardinality = ', PyObject *arg', ', arg', 1 if Modifier.isStatic(modifiers): line(out, indent, 'static PyObject *t_%s_%s(PyTypeObject *type%s);', names[-1], name, args) else: line(out, indent, 'static PyObject *t_%s_%s(t_%s *self%s);', names[-1], name, names[-1], args) for name, methods in extMethods: args, x, cardinality = methodargs(methods, superMethods) sort(methods, key=lambda x: len(x.getParameterTypes())) method = methods[0] modifiers = method.getModifiers() if name == 'iterator' and iteratorMethod is None: if (not method.getParameterTypes() and iterator.isAssignableFrom(method.getReturnType())): iteratorMethod = method iteratorExt = True elif name == 'next' and nextMethod is None: if (not method.getParameterTypes() and not method.getReturnType().isPrimitive()): nextMethod = method nextExt = True elif name == 'nextElement' and nextElementMethod is None: if (not method.getParameterTypes() and not method.getReturnType().isPrimitive()): nextElementMethod = method nextElementExt = True if isExtension: count = 0 for name, methods in extMethods: for method in methods: line(out, indent, 'static %s JNICALL t_%s_%s%d(JNIEnv *jenv, jobject jobj%s);', jniname(method.getReturnType()), names[-1], name, count, jniargs(method.getParameterTypes())) count += 1 line(out, indent, 'static PyObject *t_%s_get__self(t_%s *self, void *data);', names[-1], names[-1]) if instanceFields: for field in instanceFields: fieldName = field.getName() if fieldName not in properties: line(out, indent, 'static PyObject *t_%s_get__%s(t_%s *self, void *data);', names[-1], fieldName, names[-1]) if not Modifier.isFinal(field.getModifiers()): line(out, indent, 'static int t_%s_set__%s(t_%s *self, PyObject *arg, void *data);', names[-1], field.getName(), names[-1]) line(out) for fieldName, methods in propMethods: getter = False setter = False for method in methods: methodName = method.getName() if not getter and (methodName.startswith('get') or methodName.startswith('is')): getter = True line(out, indent, 'static PyObject *t_%s_get__%s(t_%s *self, void *data);', names[-1], fieldName, names[-1]) elif not setter and methodName.startswith('set'): setter = True line(out, indent, 'static int t_%s_set__%s(t_%s *self, PyObject *arg, void *data);', names[-1], fieldName, names[-1]) if instanceFields or propMethods or isExtension: line(out, indent, 'static PyGetSetDef t_%s__fields_[] = {', names[-1]) for field in instanceFields: fieldName = field.getName() if fieldName not in properties: if Modifier.isFinal(field.getModifiers()): line(out, indent + 1, 'DECLARE_GET_FIELD(t_%s, %s),', names[-1], fieldName) else: line(out, indent + 1, 'DECLARE_GETSET_FIELD(t_%s, %s),', names[-1], fieldName) for fieldName, methods in propMethods: getter = False setter = False for method in methods: methodName = method.getName() if not getter and (methodName.startswith('get') or methodName.startswith('is')): getter = True elif not setter and methodName.startswith('set'): setter = True if getter and setter: op = 'GETSET' elif getter: op = 'GET' elif setter: op = 'SET' line(out, indent + 1, 'DECLARE_%s_FIELD(t_%s, %s),', op, names[-1], fieldName) if isExtension: line(out, indent + 1, 'DECLARE_GET_FIELD(t_%s, self),', names[-1]) line(out, indent + 1, '{ NULL, NULL, NULL, NULL, NULL }') line(out, indent, '};') line(out) line(out, indent, 'static PyMethodDef t_%s__methods_[] = {', names[-1]) if not isExtension: line(out, indent + 1, 'DECLARE_METHOD(t_%s, cast_, METH_O | METH_CLASS),', names[-1]) line(out, indent + 1, 'DECLARE_METHOD(t_%s, instance_, METH_O | METH_CLASS),', names[-1]) for name, methods in allMethods: modifiers = methods[0].getModifiers() if len(methods) == 1 and not name in superMethods: count = len(methods[0].getParameterTypes()) if count == 0: args = 'METH_NOARGS' elif count == 1: args = 'METH_O' else: args = 'METH_VARARGS' elif isExtension and name == 'clone' and Modifier.isNative(modifiers): args = 'METH_O' else: args = 'METH_VARARGS' if Modifier.isStatic(modifiers): args += ' | METH_CLASS' line(out, indent + 1, 'DECLARE_METHOD(t_%s, %s, %s),', names[-1], name, args) line(out, indent + 1, '{ NULL, NULL, 0, NULL }') line(out, indent, '};') if instanceFields or propMethods or isExtension: tp_getset = 't_%s__fields_' %(names[-1]) else: tp_getset = '0' if iteratorMethod: if iteratorExt: tp_iter = 'get_extension_iterator' else: tp_iter = 'get_iterator<t_%s>' %(names[-1]) tp_iternext = '0' elif nextMethod and iterator.isAssignableFrom(cls): tp_iter = 'PyObject_SelfIter' returnName = typename(nextMethod.getReturnType(), cls, False) ns, sep, n = rpartition(returnName, '::') if nextExt: tp_iternext = 'get_extension_next' else: tp_iternext = '(get_iterator_next<%s%st_%s,%s>)' %(ns, sep, n, returnName) elif nextElementMethod and enumeration.isAssignableFrom(cls): tp_iter = 'PyObject_SelfIter' returnName = typename(nextElementMethod.getReturnType(), cls, False) ns, sep, n = rpartition(returnName, '::') if nextElementExt: tp_iternext = 'get_extension_nextElement' else: tp_iternext = '(get_enumeration_nextElement<%s%st_%s,%s>)' %(ns, sep, n, returnName) elif nextMethod: tp_iter = 'PyObject_SelfIter' returnName = typename(nextMethod.getReturnType(), cls, False) ns, sep, n = rpartition(returnName, '::') if nextExt: tp_iternext = 'get_extension_next' else: tp_iternext = '(get_next<t_%s,%s%st_%s,%s>)' %(names[-1], ns, sep, n, returnName) else: tp_iter = '0' tp_iternext = '0' if mappingMethod: method, cardinality = mappingMethod if cardinality > 1: getName = 't_%s_%s_map_' %(names[-1], method.getName()) line(out, indent, 'static PyObject *%s(t_%s *self, PyObject *key);', getName, names[-1]) else: getName = 't_%s_%s' %(names[-1], method.getName()) line(out) line(out, indent, 'static PyMappingMethods t_%s_as_mapping = {', names[-1]) line(out, indent + 1, '0,') line(out, indent + 1, '(binaryfunc) %s,', getName) line(out, indent + 1, '0,') line(out, indent, '};') tp_as_mapping = '&t_%s_as_mapping' %(names[-1]) else: tp_as_mapping = '0' if sequenceLenMethod or sequenceGetMethod: if sequenceLenMethod: method, cardinality = sequenceLenMethod lenName = 't_%s_%s_seq_' %(names[-1], method.getName()) line(out, indent, 'static int %s(t_%s *self);', lenName, names[-1]) else: lenName = '0' if sequenceGetMethod: method, cardinality = sequenceGetMethod getName = 't_%s_%s_seq_' %(names[-1], method.getName()) line(out, indent, 'static PyObject *%s(t_%s *self, int n);', getName, names[-1]) else: getName = '0' line(out) line(out, indent, 'static PySequenceMethods t_%s_as_sequence = {', names[-1]) if python_ver < '2.5.0': line(out, indent + 1, '(inquiry) %s,', lenName) line(out, indent + 1, '0,') line(out, indent + 1, '0,') line(out, indent + 1, '(intargfunc) %s', getName) line(out, indent, '};') else: line(out, indent + 1, '(lenfunc) %s,', lenName) line(out, indent + 1, '0,') line(out, indent + 1, '0,') line(out, indent + 1, '(ssizeargfunc) %s', getName) line(out, indent, '};') tp_as_sequence = '&t_%s_as_sequence' %(names[-1]) else: tp_as_sequence = '0' line(out) line(out, indent, 'DECLARE_TYPE(%s, t_%s, %s, %s, %s, %s, %s, %s, %s, %s);', names[-1], names[-1], '::'.join(superNames), names[-1], constructorName, tp_iter, tp_iternext, tp_getset, tp_as_mapping, tp_as_sequence) line(out) line(out, indent, 'void t_%s::install(PyObject *module)', names[-1]) line(out, indent, '{') if isExtension: line(out, indent + 1, 'INSTALL_EXTENSION(%s, module);', names[-1]) else: line(out, indent + 1, 'INSTALL_TYPE(%s, module);', names[-1]) for inner in cls.getDeclaredClasses(): if inner in typeset: if Modifier.isStatic(inner.getModifiers()): innerName = inner.getName().split('.')[-1] line(out, indent + 1, 'PyDict_SetItemString(%sType.tp_dict, "%s", make_descriptor(&%sType));', names[-1], innerName[len(names[-1])+1:], innerName) line(out, indent, '}') line(out) line(out, indent, 'void t_%s::initialize(PyObject *module)', names[-1]) line(out, indent, '{') line(out, indent + 1, 'PyDict_SetItemString(%sType.tp_dict, "class_", make_descriptor(%s::initializeClass));', names[-1], names[-1]) line(out, indent + 1, 'PyDict_SetItemString(%sType.tp_dict, "wrapfn_", make_descriptor(t_%s::wrap_jobject));', names[-1], names[-1]) if isExtension: line(out, indent + 1, 'jclass cls = %s::initializeClass();', names[-1]); elif fields: line(out, indent + 1, '%s::initializeClass();', names[-1]); if isExtension: count = 0 line(out, indent + 1, 'JNINativeMethod methods[] = {') for name, methods in extMethods: for method in methods: line(out, indent + 2, '{ "%s", "%s", (void *) t_%s_%s%d },', name, signature(method), names[-1], name, count) count += 1 line(out, indent + 1, '};') line(out, indent + 1, 'env->registerNatives(cls, methods, %d);', count) for field in fields: fieldType = field.getType() fieldName = field.getName() value = '%s::%s' %(names[-1], fieldName) if fieldName in RESERVED: value += '$' value = fieldValue(cls, value, fieldType) line(out, indent + 1, 'PyDict_SetItemString(%sType.tp_dict, "%s", make_descriptor(%s));', names[-1], fieldName, value) line(out, indent, '}') if not isExtension: line(out) line(out, indent, 'static PyObject *t_%s_cast_(PyTypeObject *type, PyObject *arg)', names[-1]) line(out, indent, '{') line(out, indent + 1, 'if (!(arg = castCheck(arg, %s::initializeClass(), 1)))', names[-1]) line(out, indent + 2, 'return NULL;') line(out, indent + 1, 'return t_%s::wrap_Object(%s(((t_%s *) arg)->object.this$));', names[-1], names[-1], names[-1]) line(out, indent, '}') line(out, indent, 'static PyObject *t_%s_instance_(PyTypeObject *type, PyObject *arg)', names[-1]) line(out, indent, '{') line(out, indent + 1, 'if (!castCheck(arg, %s::initializeClass(), 0))', names[-1]) line(out, indent + 2, 'Py_RETURN_FALSE;') line(out, indent + 1, 'Py_RETURN_TRUE;') line(out, indent, '}') if constructors: line(out) line(out, indent, 'static int t_%s_init_(t_%s *self, PyObject *args, PyObject *kwds)', names[-1], names[-1]) line(out, indent, '{') if len(constructors) > 1: currLen = -1 line(out, indent + 1, 'switch (PyTuple_GET_SIZE(args)) {') withErr = False for constructor in constructors: params = constructor.getParameterTypes() if len(params) != currLen: if currLen >= 0: withErr = True line(out, indent + 2, 'goto err;') currLen = len(params) line(out, indent + 1, '%scase %d:', HALF_INDENT, currLen) construct(out, indent + 2, cls, True, constructor, names) line(out, indent + 1, '%sdefault:', HALF_INDENT) if withErr: line(out, indent + 1, '%serr:', HALF_INDENT) line(out, indent + 2, 'PyErr_SetArgsError((PyObject *) self, "__init__", args);') line(out, indent + 2, 'return -1;') line(out, indent + 1, '}') else: construct(out, indent + 1, cls, False, constructors[0], names) if constructors[0].getParameterTypes(): line(out, indent + 1, 'else') line(out, indent + 1, '{') line(out, indent + 2, 'PyErr_SetArgsError((PyObject *) self, "__init__", args);') line(out, indent + 2, 'return -1;') line(out, indent + 1, '}') if isExtension: line(out) line(out, indent + 1, 'Py_INCREF((PyObject *) self);') line(out, indent + 1, 'self->object.pythonExtension((jlong) (Py_intptr_t) (void *) self);') line(out) line(out, indent + 1, 'return 0;') line(out, indent , '}') for name, methods in allMethods: line(out) modifiers = methods[0].getModifiers() if isExtension and name == 'clone' and Modifier.isNative(modifiers): declargs, args, cardinality = ', PyObject *arg', ', arg', 1 else: declargs, args, cardinality = methodargs(methods, superMethods) static = Modifier.isStatic(modifiers) if static: line(out, indent, 'static PyObject *t_%s_%s(PyTypeObject *type%s)', names[-1], name, declargs) else: line(out, indent, 'static PyObject *t_%s_%s(t_%s *self%s)', names[-1], name, names[-1], declargs) line(out, indent, '{') if len(methods) > 1: currLen = -1 line(out, indent + 1, 'switch (PyTuple_GET_SIZE(args)) {') for method in methods: params = method.getParameterTypes() if len(params) != currLen: if currLen >= 0: line(out, indent + 2, 'break;') currLen = len(params) line(out, indent + 1, '%scase %d:', HALF_INDENT, currLen) call(out, indent + 2, cls, True, method, names, cardinality, isExtension) line(out, indent + 1, '}') else: call(out, indent + 1, cls, False, methods[0], names, cardinality, isExtension) if args: line(out) if name in superMethods: if static: line(out, indent + 1, 'return callSuper(type, "%s"%s, %d);', name, args, cardinality) else: line(out, indent + 1, 'return callSuper(&%sType, (PyObject *) self, "%s"%s, %d);', names[-1], name, args, cardinality) else: line(out, indent + 1, 'PyErr_SetArgsError(%s, "%s"%s);', static and 'type' or '(PyObject *) self', name, args) line(out, indent + 1, 'return NULL;') line(out, indent, '}') if isExtension: count = 0 for name, methods in extMethods: for method in methods: line(out) line(out, indent, 'static %s JNICALL t_%s_%s%d(JNIEnv *jenv, jobject jobj%s)', jniname(method.getReturnType()), names[-1], name, count, jniargs(method.getParameterTypes())) count += 1 line(out, indent, '{') extension(env, out, indent + 1, cls, names, name, count, method) line(out, indent, '}') line(out) line(out, indent, 'static PyObject *t_%s_get__self(t_%s *self, void *data)', names[-1], names[-1]) line(out, indent, '{') indent += 1 line(out, indent, 'jlong ptr;') line(out, indent, 'OBJ_CALL(ptr = self->object.pythonExtension());') line(out, indent, 'PyObject *obj = (PyObject *) (Py_intptr_t) ptr;') line(out) line(out, indent, 'if (obj != NULL)') line(out, indent, '{') line(out, indent + 1, 'Py_INCREF(obj);') line(out, indent + 1, 'return obj;') line(out, indent, '}') line(out, indent, 'else') line(out, indent + 1, 'Py_RETURN_NONE;') indent -= 1 line(out, indent, '}') if instanceFields: for field in instanceFields: fieldName = field.getName() if fieldName not in properties: line(out) fieldType = field.getType() typeName = typename(fieldType, cls, False) line(out, indent, 'static PyObject *t_%s_get__%s(t_%s *self, void *data)', names[-1], fieldName, names[-1]) line(out, indent, '{') line(out, indent + 1, '%s value%s;', typeName, not fieldType.isPrimitive() and '((jobject) NULL)' or '') line(out, indent + 1, 'OBJ_CALL(value = self->object._get_%s());', fieldName) line(out, indent + 1, returnValue(cls, fieldType, 'value')) line(out, indent, '}') if not Modifier.isFinal(field.getModifiers()): line(out, indent, 'static int t_%s_set__%s(t_%s *self, PyObject *arg, void *data)', names[-1], fieldName, names[-1]) line(out, indent, '{') line(out, indent + 1, '%s value%s;', typeName, not fieldType.isPrimitive() and '((jobject) NULL)' or '') sig, check, x = parseArgs([fieldType], cls) line(out, indent + 1, 'if (!parseArg(arg, "%s"%s, &value))', sig, check) line(out, indent + 1, '{') line(out, indent + 2, 'INT_CALL(self->object._set_%s(value));', fieldName) line(out, indent + 2, 'return 0;') line(out, indent + 1, '}') line(out, indent + 1, 'PyErr_SetArgsError((PyObject *) self, "%s", arg);', fieldName) line(out, indent + 1, 'return -1;') line(out, indent, '}') if propMethods: for fieldName, methods in propMethods: line(out) getter = None setters = [] sort(methods, key=lambda x: x.getName()) for method in methods: methodName = method.getName() if not getter and (methodName.startswith('get') or methodName.startswith('is')): getter = method elif methodName.startswith('set'): setters.append(method) if getter: methodName = getter.getName() returnType = getter.getReturnType() typeName = typename(returnType, cls, False) line(out, indent, 'static PyObject *t_%s_get__%s(t_%s *self, void *data)', names[-1], fieldName, names[-1]) line(out, indent, '{') line(out, indent + 1, '%s value%s;', typeName, not returnType.isPrimitive() and '((jobject) NULL)' or '') line(out, indent + 1, 'OBJ_CALL(value = self->object.%s());', methodName) line(out, indent + 1, returnValue(cls, returnType, 'value')) line(out, indent, '}') if setters: line(out, indent, 'static int t_%s_set__%s(t_%s *self, PyObject *arg, void *data)', names[-1], fieldName, names[-1]) line(out, indent, '{') methodName = setters[0].getName() for method in setters: argType = method.getParameterTypes()[0] typeName = typename(argType, cls, False) line(out, indent + 1, '{') line(out, indent + 2, '%s value%s;', typeName, not argType.isPrimitive() and '((jobject) NULL)' or '') sig, check, x = parseArgs([argType], cls) line(out, indent + 2, 'if (!parseArg(arg, "%s"%s, &value))', sig, check) line(out, indent + 2, '{') line(out, indent + 3, 'INT_CALL(self->object.%s(value));', methodName) line(out, indent + 3, 'return 0;') line(out, indent + 2, '}') line(out, indent + 1, '}') line(out, indent + 1, 'PyErr_SetArgsError((PyObject *) self, "%s", arg);', fieldName) line(out, indent + 1, 'return -1;') line(out, indent, '}') if mappingMethod: method, cardinality = mappingMethod if cardinality > 1: methodName = method.getName() getName = 't_%s_%s_map_' %(names[-1], methodName) line(out) line(out, indent, 'static PyObject *%s(t_%s *self, PyObject *arg)', getName, names[-1]) line(out, indent, '{') call(out, indent + 1, cls, False, method, names, 1, isExtension) line(out) line(out, indent + 1, 'PyErr_SetArgsError((PyObject *) self, "%s", arg);', methodName) line(out, indent + 1, 'return NULL;') line(out, indent, '}') if sequenceLenMethod: method, cardinality = sequenceLenMethod methodName = method.getName() lenName = 't_%s_%s_seq_' %(names[-1], methodName) line(out) line(out, indent, 'static int %s(t_%s *self)', lenName, names[-1]) line(out, indent, '{') line(out, indent + 1, '%s len;', typename(method.getReturnType(), cls, False)) line(out, indent + 1, 'INT_CALL(len = self->object.%s());', methodName) line(out, indent + 1, 'return (int) len;') line(out, indent, '}') if sequenceGetMethod: method, cardinality = sequenceGetMethod methodName = method.getName() returnType = method.getReturnType() getName = 't_%s_%s_seq_' %(names[-1], methodName) line(out) line(out, indent, 'static PyObject *%s(t_%s *self, int n)', getName, names[-1]) line(out, indent, '{') line(out, indent + 1, '%s result%s;', typename(returnType, cls, False), not returnType.isPrimitive() and '((jobject) NULL)' or '') line(out, indent + 1, 'OBJ_CALL(result = self->object.%s((%s) n));', methodName, typename(method.getParameterTypes()[0], cls, False)) line(out, indent + 1, returnValue(cls, returnType, 'result')) line(out, indent, '}') while indent: indent -= 1 line(out, indent, '}') | 3e61e3b062cf8b7c7651d24ca920d92424ba740f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6913/3e61e3b062cf8b7c7651d24ca920d92424ba740f/python.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5790,
12,
3074,
16,
596,
67,
76,
16,
596,
16,
2028,
16,
2240,
20822,
16,
1257,
16,
2240,
1557,
16,
19874,
16,
2590,
16,
4750,
4712,
16,
1466,
16,
791,
2314,
16,
2874,
16,
3102,
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,
5790,
12,
3074,
16,
596,
67,
76,
16,
596,
16,
2028,
16,
2240,
20822,
16,
1257,
16,
2240,
1557,
16,
19874,
16,
2590,
16,
4750,
4712,
16,
1466,
16,
791,
2314,
16,
2874,
16,
3102,
16,
... |
cmd = "objdump -p -j .dynamic 2>/dev/null " + f | cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ "objdump -p -j .dynamic 2>/dev/null " + f f = os.popen(cmd) dump = f.read() rv = f.close() if rv == 10: raise OSError, 'objdump command not found' | def _get_soname(f): # assuming GNU binutils / ELF if not f: return None cmd = "objdump -p -j .dynamic 2>/dev/null " + f res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) if not res: return None return res.group(1) | 43723e2ad81599b54172a5dcc48790e51ff64f5f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/43723e2ad81599b54172a5dcc48790e51ff64f5f/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
816,
339,
12,
74,
4672,
468,
15144,
611,
50,
57,
4158,
5471,
342,
512,
9105,
309,
486,
284,
30,
327,
599,
1797,
273,
296,
430,
401,
618,
1081,
8481,
405,
19,
5206,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
816,
339,
12,
74,
4672,
468,
15144,
611,
50,
57,
4158,
5471,
342,
512,
9105,
309,
486,
284,
30,
327,
599,
1797,
273,
296,
430,
401,
618,
1081,
8481,
405,
19,
5206,
19,
... |
f = open(srcPref + "../doc/libxml2-api.xml") | f = open(os.path.join(srcPref,"..","doc","libxml2-api.xml")) | def buildStubs(): global py_types global py_return_types global unknown_types try: f = open(srcPref + "libxml2-api.xml") data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: try: f = open(srcPref + "../doc/libxml2-api.xml") data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: print file, ":", msg sys.exit(1) n = len(functions.keys()) print "Found %d functions in libxml2-api.xml" % (n) py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject") try: f = open(srcPref + "libxml2-python-api.xml") data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: print file, ":", msg print "Found %d functions in libxml2-python-api.xml" % ( len(functions.keys()) - n) nb_wrap = 0 failed = 0 skipped = 0 include = open("libxml2-py.h", "w") include.write("/* Generated */\n\n") export = open("libxml2-export.c", "w") export.write("/* Generated */\n\n") wrapper = open("libxml2-py.c", "w") wrapper.write("/* Generated */\n\n") wrapper.write("#include <Python.h>\n") wrapper.write("#include <libxml/xmlversion.h>\n") wrapper.write("#include <libxml/tree.h>\n") wrapper.write("#include <libxml/xmlschemastypes.h>\n") wrapper.write("#include \"libxml_wrap.h\"\n") wrapper.write("#include \"libxml2-py.h\"\n\n") for function in functions.keys(): ret = print_function_wrapper(function, wrapper, export, include) if ret < 0: failed = failed + 1 del functions[function] if ret == 0: skipped = skipped + 1 del functions[function] if ret == 1: nb_wrap = nb_wrap + 1 include.close() export.close() wrapper.close() print "Generated %d wrapper functions, %d failed, %d skipped\n" % (nb_wrap, failed, skipped); print "Missing type converters: " for type in unknown_types.keys(): print "%s:%d " % (type, len(unknown_types[type])), print | 2fc6df95cc021fb16debe942697eda86eeba39ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/2fc6df95cc021fb16debe942697eda86eeba39ae/generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
11974,
87,
13332,
2552,
2395,
67,
2352,
2552,
2395,
67,
2463,
67,
2352,
2552,
5917,
67,
2352,
225,
775,
30,
284,
273,
1696,
12,
4816,
23218,
397,
315,
2941,
2902,
22,
17,
2425,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11974,
87,
13332,
2552,
2395,
67,
2352,
2552,
2395,
67,
2463,
67,
2352,
2552,
5917,
67,
2352,
225,
775,
30,
284,
273,
1696,
12,
4816,
23218,
397,
315,
2941,
2902,
22,
17,
2425,
1... |
elif hasattr(attr, '__call__') and attr(): | elif hasattr(attr, '__call__') and (attr() or (x == 'sizeOverride' and attr() is not None)): | def keys(self): ret = [] for x in self._keys: attr = getattr(self, x) if hasattr(attr, 'keys'): if attr.keys(): ret.append(x) elif hasattr(attr, '__call__') and attr(): ret.append(x) return ret | 2e1a73817fe329e8bd5e8a1caa6db5fb8c3a7863 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/2e1a73817fe329e8bd5e8a1caa6db5fb8c3a7863/trove.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
325,
273,
5378,
364,
619,
316,
365,
6315,
2452,
30,
1604,
273,
3869,
12,
2890,
16,
619,
13,
309,
3859,
12,
1747,
16,
296,
2452,
11,
4672,
309,
1604,
18,
2452,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
325,
273,
5378,
364,
619,
316,
365,
6315,
2452,
30,
1604,
273,
3869,
12,
2890,
16,
619,
13,
309,
3859,
12,
1747,
16,
296,
2452,
11,
4672,
309,
1604,
18,
2452,
1... |
this = apply(_quickfix.new_StandInstDbID, args) | this = _quickfix.new_StandInstDbID(*args) | def __init__(self, *args): this = apply(_quickfix.new_StandInstDbID, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
20612,
10773,
4331,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
20612,
10773,
4331,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,... |
return False | return True | def on_input(self, key): key_commands = { "^J": self.on_enter, "^M": self.on_enter, "\n": self.on_enter, ' ': self.on_space, "/": self.on_slash, "KEY_UP": self.move_cursor_up, "KEY_DOWN": self.move_cursor_down, "o": self.toggle_offline_show, "^F": self.start_search, } res = self.input.do_command(key) if res: return False if key in key_commands: return key_commands[key]() | d0cfb69b02ceda831530c782c15758edb6b9e914 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9814/d0cfb69b02ceda831530c782c15758edb6b9e914/tab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2630,
12,
2890,
16,
498,
4672,
498,
67,
7847,
273,
288,
15017,
46,
6877,
365,
18,
265,
67,
2328,
16,
15017,
49,
6877,
365,
18,
265,
67,
2328,
16,
1548,
82,
6877,
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,
603,
67,
2630,
12,
2890,
16,
498,
4672,
498,
67,
7847,
273,
288,
15017,
46,
6877,
365,
18,
265,
67,
2328,
16,
15017,
49,
6877,
365,
18,
265,
67,
2328,
16,
1548,
82,
6877,
365,
18,
... |
self._write_css(directory) | self._write_docs(directory, verbose) | def write(self, directory=None, verbose=1): """ Write the documentation to the given directory. | 1cbf22bf435c5a597ad3c4c61bb27adb7b7cf726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/1cbf22bf435c5a597ad3c4c61bb27adb7b7cf726/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
3988,
33,
21,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
3988,
33,
21,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
subpackage_name, subpackage_path, | subpackage_name, subpackage_path, parent_name, | def _get_configuration_from_setup_py(self, setup_py, subpackage_name, subpackage_path, caller_level = 1): # In case setup_py imports local modules: sys.path.insert(0,os.path.dirname(setup_py)) try: fo_setup_py = open(setup_py, 'U') setup_name = os.path.splitext(os.path.basename(setup_py))[0] n = dot_join(self.name,subpackage_name,setup_name) setup_module = imp.load_module('_'.join(n.split('.')), fo_setup_py, setup_py, ('.py', 'U', 1)) fo_setup_py.close() if not hasattr(setup_module,'configuration'): if not self.options['assume_default_configuration']: self.warn('Assuming default configuration '\ '(%s does not define configuration())'\ % (setup_module)) config = Configuration(subpackage_name, self.name, self.top_path, subpackage_path, caller_level = caller_level + 1) else: args = (self.name,) if setup_module.configuration.func_code.co_argcount > 1: args = args + (self.top_path,) config = setup_module.configuration(*args) finally: del sys.path[0] return config | 680a44a631b3d039dc63d108274eeeefa062de34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/680a44a631b3d039dc63d108274eeeefa062de34/misc_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7025,
67,
2080,
67,
8401,
67,
2074,
12,
2890,
16,
3875,
67,
2074,
16,
720,
5610,
67,
529,
16,
720,
5610,
67,
803,
16,
982,
67,
529,
16,
4894,
67,
2815,
273,
404,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7025,
67,
2080,
67,
8401,
67,
2074,
12,
2890,
16,
3875,
67,
2074,
16,
720,
5610,
67,
529,
16,
720,
5610,
67,
803,
16,
982,
67,
529,
16,
4894,
67,
2815,
273,
404,
4672... |
self.assertEqual( cl.getclusters(2), [[(0, 0), (2, 6), (3, 6), (2, 5), (3, 5), (3, 4), (1, 5)], [(7, 3), (9, 2), (9, 3), (8, 1), (8, 3)]]) | expected = [[(18,13), (15, 12), (17,12), (18,12), (19,12), (16,11), (18, 11), (19,10)], [(0,0), (1, 4), (1,2), (2,3), (4,1), (5,2), (6,1), (4,3)]] self.assertTrue( compare_list( clusters, expected ), "Elements differ!\n%s\n%s" % (clusters, expected)) | def testPointDoubling(self): "test for bug ?" data = [ (0,0), (7,3), (2,6), (3,5), (3,6), (0,0), (8,1), (3,4), (8,3), (9,2), (2,5), (9,3) ] cl = KMeansClustering(data) clusters = cl.getclusters(2) self.assertEqual( cl.getclusters(2), [[(0, 0), (2, 6), (3, 6), (2, 5), (3, 5), (3, 4), (1, 5)], [(7, 3), (9, 2), (9, 3), (8, 1), (8, 3)]]) | 5ccd132bd7da32723ab337e5a2dc50e962b3fa61 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9551/5ccd132bd7da32723ab337e5a2dc50e962b3fa61/clusterTests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2148,
3244,
440,
310,
12,
2890,
4672,
315,
3813,
364,
7934,
17921,
501,
273,
306,
261,
20,
16,
20,
3631,
261,
27,
16,
23,
3631,
261,
22,
16,
26,
3631,
261,
23,
16,
25,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2148,
3244,
440,
310,
12,
2890,
4672,
315,
3813,
364,
7934,
17921,
501,
273,
306,
261,
20,
16,
20,
3631,
261,
27,
16,
23,
3631,
261,
22,
16,
26,
3631,
261,
23,
16,
25,
3631,
... |
deferred = None | def maybeDeferred(f, *args, **kw): """Invoke a function that may or may not return a deferred. Call the given function with the given arguments. If the returned object is a C{Deferred}, return it. If the returned object is a C{Failure}, wrap it with C{fail} and return it. Otherwise, wrap it in C{succeed} and return it. If an exception is raised, convert it to a C{Failure}, wrap it in C{fail}, and then return it. @type f: Any callable @param f: The callable to invoke @param args: The arguments to pass to C{f} @param kw: The keyword arguments to pass to C{f} @rtype: C{Deferred} @return: The result of the function call, wrapped in a C{Deferred} if necessary. """ deferred = None try: result = f(*args, **kw) except: return fail(failure.Failure()) else: if isinstance(result, Deferred): return result elif isinstance(result, failure.Failure): return fail(result) else: return succeed(result) return deferred | 527ec4e30d23959d4b63c11691f8ad5924e58e8f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12595/527ec4e30d23959d4b63c11691f8ad5924e58e8f/defer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
16886,
12,
74,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
10969,
279,
445,
716,
2026,
578,
2026,
486,
327,
279,
7045,
18,
225,
3049,
326,
864,
445,
598,
326,
864,
1775,
18,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
16886,
12,
74,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
10969,
279,
445,
716,
2026,
578,
2026,
486,
327,
279,
7045,
18,
225,
3049,
326,
864,
445,
598,
326,
864,
1775,
18,
225,
... | |
'present': True, | 'present': self.busmaster[path].get('busmaster',True), | def findsensors(self,path=""): uncachedpath = "/uncached%s" % path mincycle = 600 for sensor in self.owfs.dir(uncachedpath): ## remove /uncached/bus.x from sensorname sensor = sensor.split("/")[-1] ## check if it is really a sensor if self.issensor.match(sensor): self.debug("found Sensor %s at Bus %r" % (sensor,path)) try: ## Check for supported sensor sensortype=self.owfs.read("%s/type" % sensor) except: ## ignore all OWFS Errors continue if 'subtypes' in self.supportedsensors[sensortype]: ##check subtypes try: info = ord(self.owfs.read("%s/pages/page.3" % sensor)[0]) sensortype += self.supportedsensors[sensortype]['subtypes'][info] self.debug("Sensor Subtype %s is used" % sensortype) except: ## nothing found pass | 40318f9db79bb2be8a5d73ce6055b45500583d38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5166/40318f9db79bb2be8a5d73ce6055b45500583d38/OWFS_Connector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13094,
12575,
12,
2890,
16,
803,
1546,
6,
4672,
6301,
2004,
803,
273,
2206,
551,
2004,
9,
87,
6,
738,
589,
1131,
13946,
273,
14707,
364,
10583,
316,
365,
18,
543,
2556,
18,
1214,
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,
13094,
12575,
12,
2890,
16,
803,
1546,
6,
4672,
6301,
2004,
803,
273,
2206,
551,
2004,
9,
87,
6,
738,
589,
1131,
13946,
273,
14707,
364,
10583,
316,
365,
18,
543,
2556,
18,
1214,
12,
... |
(fd, tmpfilename) = mkstemp_file(dirname, basename) | (fd, tmpfilename) = mkstemp_file(dirname, tmpprefix) | def extractCpio(self, filedata, read_data, filenamehash, devinode, filenames): filename = filedata[0] data = read_data(filedata[5]) fileinfo = filenamehash.get(filename) if fileinfo == None: self.printErr("cpio file %s not in rpm header" % filename) return (fn, flag, mode, mtime, dev, inode, user, group, rdev, linkto, i) = fileinfo del filenamehash[filename] uid = gid = None if self.owner: uid = self.uid.ugid[user] gid = self.gid.ugid[group] if self.relocated: filename = self.relocatedFile(filename) filename = "%s%s" % (self.buildroot, filename) (dirname, basename) = os.path.split(filename) makeDirs(dirname) if S_ISREG(mode): di = devinode.get((dev, inode)) if di == None or data: (fd, tmpfilename) = mkstemp_file(dirname, basename) os.write(fd, data) os.close(fd) setPerms(tmpfilename, uid, gid, mode, mtime) os.rename(tmpfilename, filename) if di: di.remove(i) for j in di: if self.relocated: fn2 = "%s%s" % (self.buildroot, self.relocatedFile(filenames[j])) else: fn2 = "%s%s" % (self.buildroot, filenames[j]) (dirname, basename) = os.path.split(fn2) makeDirs(dirname) tmpfilename = mkstemp_link(dirname, basename, filename) if tmpfilename == None: (fd, tmpfilename) = mkstemp_file(dirname, basename) os.write(fd, data) os.close(fd) setPerms(tmpfilename, uid, gid, mode, mtime) os.rename(tmpfilename, fn2) del devinode[(dev, inode)] elif S_ISDIR(mode): makeDirs(filename) setPerms(filename, uid, gid, mode, None) elif S_ISLNK(mode): #if os.path.islink(filename) \ # and os.readlink(filename) == linkto: # return tmpfile = mkstemp_symlink(dirname, basename, linkto) setPerms(tmpfile, uid, gid, None, None) os.rename(tmpfile, filename) elif S_ISFIFO(mode): tmpfile = mkstemp_mkfifo(dirname, basename) setPerms(tmpfile, uid, gid, mode, mtime) os.rename(tmpfile, filename) elif S_ISCHR(mode) or S_ISBLK(mode): if self.owner: tmpfile = mkstemp_mknod(dirname, basename, mode, rdev) setPerms(tmpfile, uid, gid, mode, mtime) os.rename(tmpfile, filename) # if not self.owner: we could give a warning here elif S_ISSOCK(mode): raise ValueError, "UNIX domain sockets can't be packaged." else: raise ValueError, "%s: not a valid filetype" % (oct(mode)) | 73fe5b4e17300fe703da079a2bdf4fefe1e4ee56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/73fe5b4e17300fe703da079a2bdf4fefe1e4ee56/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
28954,
1594,
12,
2890,
16,
585,
892,
16,
855,
67,
892,
16,
1544,
2816,
16,
4461,
267,
390,
16,
9066,
4672,
1544,
273,
585,
892,
63,
20,
65,
501,
273,
855,
67,
892,
12,
768,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
28954,
1594,
12,
2890,
16,
585,
892,
16,
855,
67,
892,
16,
1544,
2816,
16,
4461,
267,
390,
16,
9066,
4672,
1544,
273,
585,
892,
63,
20,
65,
501,
273,
855,
67,
892,
12,
768,
8... |
mdig.repository = ModelRepository.ModelRepository() | mdig.repository = modelrepository.ModelRepository() | def main(argv): global simulations # Do a migration of model repository data if len(argv) > 0 and argv[0] == 'migrate': do_migration(argv[1:]) # Otherwise start up normally mdig_config = config.get_config() logger = setupLogger(mdig_config["LOGGING"]["ansi"]) the_action = process_options(argv) signal.signal(signal.SIGINT, exit_catcher) # Load model repository if the_action.repository is not None: mdig_config["GRASS"]["GISDBASE"] = the_action.repository if the_action.location is not None: mdig_config["GRASS"]["LOCATION_NAME"] = the_action.location if the_action.init_repository: mdig.repository = ModelRepository.ModelRepository() models = mdig.repository.get_models() if the_action.init_grass: # Check for grass environment and set up interface grass_interface = GRASSInterface.get_g() if the_action.preload == True: # Load model definition if the_action.model_names is not None: # check that there is only one model for preload assert(len(the_action.model_names) == 1) m_name = the_action.model_names[0] if m_name not in models: logger.error("Model " + m_name + " doesn't exist in repository") sys.exit(mdig.mdig_exit_codes["model_not_found"]) model_xml_file = models[m_name] exp = DispersalModel.DispersalModel(model_xml_file, the_action) simulations.append(exp) else: logger.error ("No model file specified") sys.exit(mdig.mdig_exit_codes["model_not_found"]) if the_action is not None: the_action.do_me(exp) else: the_action.do_me(None) exit_cleanup() logger.debug("Exiting") | c22a8ac1e03674fc59fdff540e6ae0c2d85dd773 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10332/c22a8ac1e03674fc59fdff540e6ae0c2d85dd773/mdig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
3142,
21011,
225,
468,
2256,
279,
6333,
434,
938,
3352,
501,
309,
562,
12,
19485,
13,
405,
374,
471,
5261,
63,
20,
65,
422,
296,
22083,
4278,
741,
67,
1574... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
3142,
21011,
225,
468,
2256,
279,
6333,
434,
938,
3352,
501,
309,
562,
12,
19485,
13,
405,
374,
471,
5261,
63,
20,
65,
422,
296,
22083,
4278,
741,
67,
1574... |
return self.__porevisiondate @property def translators(self): return self.__translators class Translator(object): def __init__(self, name, mail, ismaintainer): self.name = name self.mail = mail self.ismaintainer = ismaintainer | return self._porevisiondate | def updatedate(self): if self.__template: #if template... return self.__potcreationdate else: #if NOT template... return self.__porevisiondate | 569cb008f201fd5615072299951acfa2ed026f12 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5857/569cb008f201fd5615072299951acfa2ed026f12/GetTranslationsStatus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3526,
340,
12,
2890,
4672,
309,
365,
16186,
3202,
30,
468,
430,
1542,
2777,
327,
365,
16186,
13130,
17169,
712,
469,
30,
468,
430,
4269,
1542,
2777,
327,
365,
16186,
25973,
2820,
712,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3526,
340,
12,
2890,
4672,
309,
365,
16186,
3202,
30,
468,
430,
1542,
2777,
327,
365,
16186,
13130,
17169,
712,
469,
30,
468,
430,
4269,
1542,
2777,
327,
365,
16186,
25973,
2820,
712,
22... |
x_to_p_less_one = x**(p-1) x_to_p = x_to_p_less_one * x x_to_p_cubed = x_to_p.square() * x_to_p r = (base_ring(1) / base_ring(2)) * (x_to_p_cubed + Q[1]*x_to_p + S(Q[0])) | x_to_p_less_one = x**(p-1) x_to_p = x_to_p_less_one * x x_to_p_cubed = x_to_p.square() * x_to_p r = (base_ring(1) / base_ring(2)) * (x_to_p_cubed + Q[1]*x_to_p + S(Q[0])) | def frobenius_expansion_by_newton(Q, p, M): r""" Computes the action of Frobenius on $dx/y$ and on $x dx/y$, using Newton's method (as suggested in Kedlaya's paper). (This function does *not* yet use the cohomology relations -- that happens afterwards in the "reduction" step.) More specifically, it finds $F_0$ and $F_1$ in the quotient ring $R[x, T]/(T - Q(x))$, such that $$ F( dx/y) = T^{-r} F0 dx/y, \text{ and } F(x dx/y) = T^{-r} F1 dx/y $$ where $$ r = ( (2M-3)p - 1 )/2. $$ (Here $T$ is $y^2 = z^{-2}$, and $R$ is the coefficient ring of $Q$.) $F_0$ and $F_1$ are computed in the SpecialCubicQuotientRing associated to $Q$, so all powers of $x^j$ for $j \geq 3$ are reduced to powers of $T$. INPUT: Q -- cubic polynomial of the form Q(x) = x^3 + ax + b, whose coefficient ring is a Z/(p^M)Z-algebra p -- residue characteristic of the p-adic field M -- p-adic precision of the coefficient ring (this will be used to determine the number of Newton iterations) OUTPUT: F0, F1 -- elements of SpecialCubicQuotientRing(Q), as described above r -- non-negative integer, as described above """ S = SpecialCubicQuotientRing(Q) x, _ = S.gens() # T = y^2 base_ring = S.base_ring() # When we compute Frob(1/y) we actually only need precision M-1, since # we're going to multiply by p at the end anyway. M = float(M - 1) # Kedlaya sets s = Q(x^p)/T^p = 1 + p T^{-p} E, where # E = (Q(x^p) - Q(x)^p) / p (has integral coefficients). # Then he computes s^{-1/2} in S, using Newton's method to find # successive approximations. We follow this plan, but we normalise our # approximations so that we only ever need positive powers of T. # Start by setting r = Q(x^p)/2 = 1/2 T^p s. # (The 1/2 is for convenience later on.) x_to_p_less_one = x**(p-1) x_to_p = x_to_p_less_one * x x_to_p_cubed = x_to_p.square() * x_to_p r = (base_ring(1) / base_ring(2)) * (x_to_p_cubed + Q[1]*x_to_p + S(Q[0])) # todo: this next loop would be clearer if it used the newton_method_sizes() # function # We will start with a hard-coded initial approximation, which we provide # up to precision 3. First work out what precision is best to start with. if M <= 3: initial_precision = M elif ceil(log(M/2, 2)) == ceil(log(M/3, 2)): # In this case there's no advantage to starting with precision three, # because we'll overshoot at the end. E.g. suppose the final precision # is 8. If we start with precision 2, we need two iterations to get us # to 8. If we start at precision 3, we will still need two iterations, # but we do more work along the way. So may as well start with only 2. initial_precision = 2 else: initial_precision = 3 # Now compute the first approximation. In the main loop below, X is the # normalised approximation, and k is the precision. More specifically, # X = T^{p(k-1)} x_i, where x_i is an approximation to s^{-1/2}, and the # approximation is correct mod p^k. if initial_precision == 1: k = 1 X = S(1) elif initial_precision == 2: # approximation is 3/2 - 1/2 s k = 2 X = S(base_ring(3) / base_ring(2)).shift(p) - r elif initial_precision == 3: # approximation is (15 - 10 s + 3 s^2) / 8 k = 3 X = (base_ring(1) / base_ring(8)) * ( S(15).shift(2*p) - \ (base_ring(20) * r).shift(p) + \ (base_ring(12) * r.square()) \ ) # The key to the following calculation is that the T^{-m} coefficient # of every x_i is divisible by p^(ceil(m/p)) (for m >= 0). Therefore if # we are only expecting an answer correct mod p^k, we can truncate # beyond the T^{-(k-1)p} term without any problems. # todo: what would be really nice is to be able to work in a lower # precision *coefficient ring* when we start the iteration, and move up to # higher precision rings as the iteration proceeds. This would be feasible # over Integers(p**n), but quite complicated (maybe impossible) over a more # general base ring. This might give a decent constant factor speedup; # or it might not, depending on how much the last iteration dominates the # whole runtime. My guess is that it isn't worth the effort. three_halves = base_ring(3) / base_ring(2) # Newton iteration loop while k < M: # target_k = k' = precision we want our answer to be after this iteration target_k = 2*k # This prevents us overshooting. For example if the current precision # is 3 and we want to get to 10, we're better off going up to 5 # instead of 6, because it's less work to get from 5 to 10 than it # is to get from 6 to 10. if ceil(log(M/target_k, 2)) == ceil(log(M/(target_k-1), 2)): target_k -= 1 # temp = T^{p(3k-2)} 1/2 s x_i^3 temp = X.square() * (X * r) # We know that the final result is only going to be correct mod # p^(target_k), so we might as well truncate the extraneous terms now. # temp = T^{p(k'-1)} 1/2 s x_i^3 temp = temp.shift(-p*(3*k - target_k - 1)) # X = T^{p(k'-1)} (3/2 x_i - 1/2 s x_i^3) # = T^{p(k'-1)} x_{i+1} X = (three_halves * X).shift(p*(target_k - k)) - temp k = target_k # Now k should equal M, since we're up to the correct precision assert k == M, "Oops, something went wrong in the iteration" # We should have s^{-1/2} correct to precision M. # The following line can be uncommented to verify this. # (It's a slow verification though, can double the whole computation time.) #assert (p * X.square() * r * base_ring(2)).coeffs() == \ # R(p).shift(p*(2*M - 1)).coeffs() # Finally incorporate frobenius of dx and x dx, and choose offset that # compensates for our normalisations by powers of T. F0 = base_ring(p) * x_to_p_less_one * X F1 = F0 * x_to_p offset = ((2*k-1)*p - 1)/2 return F0, F1, offset | e8c5dfe629aabf0303b396e56733ea0c7032d92a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e8c5dfe629aabf0303b396e56733ea0c7032d92a/monsky_washnitzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
303,
19425,
8384,
67,
2749,
12162,
67,
1637,
67,
2704,
1917,
12,
53,
16,
293,
16,
490,
4672,
436,
8395,
14169,
281,
326,
1301,
434,
478,
303,
19425,
8384,
603,
271,
13437,
19,
93,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
303,
19425,
8384,
67,
2749,
12162,
67,
1637,
67,
2704,
1917,
12,
53,
16,
293,
16,
490,
4672,
436,
8395,
14169,
281,
326,
1301,
434,
478,
303,
19425,
8384,
603,
271,
13437,
19,
93,... |
`beginchar' is the start character for the fragment. If self is not looking at an instance of `beginchar' then getdelimited returns the empty string. | `beginchar' is the start character for the fragment. If self is not looking at an instance of `beginchar' then getdelimited returns the empty string. | def getdelimited(self, beginchar, endchars, allowcomments = 1): """Parse a header fragment delimited by special characters. | 52d51c96f28f628bf085945df0f7b389d6cbc349 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/52d51c96f28f628bf085945df0f7b389d6cbc349/rfc822.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
3771,
1038,
329,
12,
2890,
16,
2376,
3001,
16,
679,
7549,
16,
1699,
9231,
273,
404,
4672,
3536,
3201,
279,
1446,
5481,
18609,
635,
4582,
3949,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
3771,
1038,
329,
12,
2890,
16,
2376,
3001,
16,
679,
7549,
16,
1699,
9231,
273,
404,
4672,
3536,
3201,
279,
1446,
5481,
18609,
635,
4582,
3949,
18,
2,
-100,
-100,
-100,
-100,
-100,
... |
code, message, environ, self.global_conf, | code, message, environ, self.global_conf, | def change_response(status, headers, exc_info=None): status_code = status.split(' ') try: code = int(status_code[0]) except (ValueError, TypeError): raise Exception( 'StatusBasedForward middleware ' 'received an invalid status code %s'%repr(status_code[0]) ) message = ' '.join(status_code[1:]) new_url = self.mapper( code, message, environ, self.global_conf, **self.params ) if not (new_url == None or isinstance(new_url, str)): raise TypeError( 'Expected the url to internally ' 'redirect to in the StatusBasedForward mapper' 'to be a string or None, not %s'%repr(new_url) ) if new_url: url.append([new_url, status, headers]) else: return start_response(status, headers, exc_info) | ad2b5581c6f72b5cb630b6b63eb84b3414214056 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2097/ad2b5581c6f72b5cb630b6b63eb84b3414214056/errordocument.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
33,
7036,
4672,
1267,
67,
710,
273,
1267,
18,
4939,
2668,
8624,
775,
30,
981,
273,
509,
12,
2327,
67,
710,
63,
20,
5717,
1335,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
33,
7036,
4672,
1267,
67,
710,
273,
1267,
18,
4939,
2668,
8624,
775,
30,
981,
273,
509,
12,
2327,
67,
710,
63,
20,
5717,
1335,... |
raise 'InvalidRequestError', 'No such user' | raise InvalidRequestError('No such user') | def verifyKey(self, key): """Verify a key. Raises an exception if the key is invalid or expired. """ | 489bf001853502ab2475f5de200186dc8fe65457 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12219/489bf001853502ab2475f5de200186dc8fe65457/PasswordResetTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
653,
12,
2890,
16,
498,
4672,
3536,
8097,
279,
498,
18,
20497,
392,
1520,
309,
326,
498,
353,
2057,
578,
7708,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
653,
12,
2890,
16,
498,
4672,
3536,
8097,
279,
498,
18,
20497,
392,
1520,
309,
326,
498,
353,
2057,
578,
7708,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not self.progress.is_running (): | if self.progress.is_running (): | def on_browser_net_stop (self, browser): if not self.progress.is_running (): self.dest_url_box.set_sensitive (True) self.dest_url_box.show () self.dest_url_box.set_visible_window (True) self.stopped () | 07bc990b14fd32166da637b0af70782199803d02 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3179/07bc990b14fd32166da637b0af70782199803d02/translation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
11213,
67,
2758,
67,
5681,
261,
2890,
16,
4748,
4672,
309,
365,
18,
8298,
18,
291,
67,
8704,
1832,
30,
365,
18,
10488,
67,
718,
67,
2147,
18,
542,
67,
23481,
261,
5510,
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,
603,
67,
11213,
67,
2758,
67,
5681,
261,
2890,
16,
4748,
4672,
309,
365,
18,
8298,
18,
291,
67,
8704,
1832,
30,
365,
18,
10488,
67,
718,
67,
2147,
18,
542,
67,
23481,
261,
5510,
13,
... |
def price_get_multi_old(self, cr, uid, product_map, context=None): """multi products 'price_get' @param context: { 'date': Date of the pricelist (%Y-%m-%d), @return: a dict with product_id as key and the product price as value } """ def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst context = context or {} date = time.strftime('%Y-%m-%d') if 'date' in context: date = context['date'] currency_obj = self.pool.get('res.currency') product_obj = self.pool.get('product.product') product_category_obj = self.pool.get('product.category') product_uom_obj = self.pool.get('product.uom') supplierinfo_obj = self.pool.get('product.supplierinfo') price_type_obj = self.pool.get('product.price.type') product_pricelist_version_obj = self.pool.get('product.pricelist.version') pricelist_version_ids = list(set([k[1] for k in product_map.keys()])) plversions_search_args = [ ('pricelist_id', 'in', pricelist_version_ids), '|', ('date_start', '=', False), ('date_start', '<=', date), '|', ('date_end', '=', False), ('date_end', '>=', date), ] plversion_ids = product_pricelist_version_obj.search(cr, uid, plversions_search_args) if len(pricelist_version_ids) != len(plversion_ids): msg = "At least one pricelist has no active version !\nPlease create or activate one." raise osv.except_osv(_('Warning !'), _(msg)) product_ids = list(set([k[0] for k in product_map.keys()])) products = dict([(item['id'], item) for item in product_obj.read(cr, uid, product_ids, ['categ_id', 'product_tmpl_id', 'uos_id', 'uom_id'])]) product_category_ids = product_category_obj.search(cr, uid, []) product_categories = product_category_obj.read(cr, uid, product_category_ids, ['parent_id']) product_category_tree = dict([(item['id'], item['parent_id'][0]) for item in product_categories if item['parent_id']]) results = {} for (product_id, pricelist_id), line in product_map.items(): price = False partner = line['partner_id'] qty = line['qty'] tmpl_id = products[product_id]['product_tmpl_id'] and products[product_id]['product_tmpl_id'][0] or False categ_id = products[product_id]['categ_id'] and products[product_id]['categ_id'][0] or False categ_ids = _create_parent_category_list(categ_id, [categ_id]) if categ_ids: categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))' else: categ_where = '(categ_id IS NULL)' cr.execute( 'SELECT i.*, pl.currency_id ' 'FROM product_pricelist_item AS i, ' 'product_pricelist_version AS v, product_pricelist AS pl ' 'WHERE (product_tmpl_id IS NULL OR product_tmpl_id = %s) ' 'AND (product_id IS NULL OR product_id = %s) ' 'AND (' + categ_where + ' OR (categ_id IS NULL)) ' 'AND price_version_id = %s ' 'AND (min_quantity IS NULL OR min_quantity <= %s) ' 'AND i.price_version_id = v.id AND v.pricelist_id = pl.id ' 'ORDER BY sequence', (tmpl_id, product_id, pricelist_id, qty)) res1 = cr.dictfetchall() for res in res1: if res: if res['base'] == -1: if not res['base_pricelist_id']: price = 0.0 else: price_tmp = self.price_get(cr, uid, [res['base_pricelist_id']], product_id, qty)[res['base_pricelist_id']] ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) break elif res['base'] == -2: where = [] if partner: where = [('name', '=', partner) ] sinfo = supplierinfo_obj.search(cr, uid, [('product_id', '=', tmpl_id)] + where) price = 0.0 if sinfo: cr.execute('SELECT * ' \ 'FROM pricelist_partnerinfo ' \ 'WHERE suppinfo_id IN %s' \ 'AND min_quantity <= %s ' \ 'ORDER BY min_quantity DESC LIMIT 1', (tuple(sinfo),qty,)) res2 = cr.dictfetchone() if res2: price = res2['price'] break else: price_type = price_type_obj.browse(cr, uid, int(res['base'])) price = currency_obj.compute(cr, uid, price_type.currency_id.id, res['currency_id'], product_obj.price_get(cr, uid, [product_id], price_type.field)[product_id], round=False, context=context) if price: price_limit = price price = price * (1.0+(res['price_discount'] or 0.0)) price = rounding(price, res['price_round']) price += (res['price_surcharge'] or 0.0) if res['price_min_margin']: price = max(price, price_limit+res['price_min_margin']) if res['price_max_margin']: price = min(price, price_limit+res['price_max_margin']) break else: price = False if price: p_uom_id = products[product_id]['uos_id'] and products[product_id]['uos_id'][0] or products[product_id]['uom_id'] and products[product_id]['uom_id'][0] or False if p_uom_id: price = product_uom_obj._compute_price(cr, uid, p_uom_id, price, context.get('uom', False)) if results.get(product_id): results[product_id][pricelist_id] = price else: results[product_id] = {pricelist_id: price} return results | def price_get_multi_old(self, cr, uid, product_map, context=None): """multi products 'price_get' @param context: { 'date': Date of the pricelist (%Y-%m-%d), @return: a dict with product_id as key and the product price as value } """ | 1d78ae166ba2ab9323049a83a16e403e5cd4f91c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d78ae166ba2ab9323049a83a16e403e5cd4f91c/pricelist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6205,
67,
588,
67,
7027,
67,
1673,
12,
2890,
16,
4422,
16,
4555,
16,
3017,
67,
1458,
16,
819,
33,
7036,
4672,
3536,
7027,
10406,
296,
8694,
67,
588,
11,
632,
891,
819,
30,
288,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6205,
67,
588,
67,
7027,
67,
1673,
12,
2890,
16,
4422,
16,
4555,
16,
3017,
67,
1458,
16,
819,
33,
7036,
4672,
3536,
7027,
10406,
296,
8694,
67,
588,
11,
632,
891,
819,
30,
288,
296,
... | |
os.unlink(support.TESTFN) | support.unlink(support.TESTFN) | def tearDown(self): os.unlink(support.TESTFN) | 4bc266f6f8d4a579841898968a2ce26b1a66dd17 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/4bc266f6f8d4a579841898968a2ce26b1a66dd17/test_posix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
1140,
18,
318,
1232,
12,
13261,
18,
16961,
19793,
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,
... | [
1,
1,
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,
268,
2091,
4164,
12,
2890,
4672,
1140,
18,
318,
1232,
12,
13261,
18,
16961,
19793,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
nuninst[arch] = [] | nuninst[arch] = set() | def get_nuninst(self, requested_arch=None, build=False): """Return the uninstallability statistic for all the architectures | 469d67fca2e47a8c81512c4f86db64b0f50e5032 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2784/469d67fca2e47a8c81512c4f86db64b0f50e5032/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
82,
318,
8591,
12,
2890,
16,
3764,
67,
991,
33,
7036,
16,
1361,
33,
8381,
4672,
3536,
990,
326,
16577,
2967,
21605,
364,
777,
326,
6637,
15004,
1823,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
82,
318,
8591,
12,
2890,
16,
3764,
67,
991,
33,
7036,
16,
1361,
33,
8381,
4672,
3536,
990,
326,
16577,
2967,
21605,
364,
777,
326,
6637,
15004,
1823,
2,
-100,
-100,
-100,
-100... |
print "downloaded profile", document.get_pseudo() | def get_profile(self, peer_id): print "downloaded profile", document.get_pseudo() self.network.get_profile(peer_id, self._on_new_profile) | abc0f3df001d5dda270799d625ee8cb2469420c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2522/abc0f3df001d5dda270799d625ee8cb2469420c6/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5040,
12,
2890,
16,
4261,
67,
350,
4672,
365,
18,
5185,
18,
588,
67,
5040,
12,
12210,
67,
350,
16,
365,
6315,
265,
67,
2704,
67,
5040,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5040,
12,
2890,
16,
4261,
67,
350,
4672,
365,
18,
5185,
18,
588,
67,
5040,
12,
12210,
67,
350,
16,
365,
6315,
265,
67,
2704,
67,
5040,
13,
2,
-100,
-100,
-100,
-100,
-100,
... | |
def btnScan_clicked(self,widget): | def btnScan_clicked(self,widget, data = None): | def btnScan_clicked(self,widget): # scan the area for bluetooth devices and show the results watch = gtk.gdk.Cursor(gtk.gdk.WATCH) self.window.window.set_cursor(watch) self.model.clear() self.model.append(['...', 'Now scanning...']) gobject.idle_add(self.cb_btnScan_clicked) | 3397f9f1c50ccb125dcd8c579936e104f847d2d3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/61/3397f9f1c50ccb125dcd8c579936e104f847d2d3/proximity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10638,
7972,
67,
7475,
329,
12,
2890,
16,
6587,
16,
501,
273,
599,
4672,
468,
4135,
326,
5091,
364,
2811,
26654,
7166,
471,
2405,
326,
1686,
4267,
273,
22718,
18,
75,
2883,
18,
6688,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10638,
7972,
67,
7475,
329,
12,
2890,
16,
6587,
16,
501,
273,
599,
4672,
468,
4135,
326,
5091,
364,
2811,
26654,
7166,
471,
2405,
326,
1686,
4267,
273,
22718,
18,
75,
2883,
18,
6688,
1... |
this = apply(_quickfix.new_SecurityReqID, args) | this = _quickfix.new_SecurityReqID(*args) | def __init__(self, *args): this = apply(_quickfix.new_SecurityReqID, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
4368,
6113,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
4368,
6113,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
3... |
'\xac\xfa\xfd\xc6\xa7\xe5\x16\x8f\xa2Q\xb8\xb7\xbe\xab' | "t\xb6\xc1'\x83\x17\xae\xc9ZO\x84V\x7fX" | def __call__(self, M, mode = "ECB"): r""" INPUT: - ``M`` - a StringMonoidElement - ``mode`` - ignored (default: 'ECB') EXAMPLES:: sage: FF = FiniteField(2) sage: P.<x> = PolynomialRing(FF) sage: LFSR = LFSRCryptosystem(FF) sage: IS_1 = [ FF(a) for a in [0,1,0,1,0,0,0] ] sage: e1 = LFSR((x^7 + x + 1,IS_1)) sage: IS_2 = [ FF(a) for a in [0,0,1,0,0,0,1,0,1] ] sage: e2 = LFSR((x^9 + x^3 + 1,IS_2)) sage: E = ShrinkingGeneratorCryptosystem() sage: e = E((e1,e2)) sage: B = BinaryStrings() sage: m = B.encoding("THECATINTHEHAT") sage: c = e(m) sage: c.decoding() '\xac\xfa\xfd\xc6\xa7\xe5\x16\x8f\xa2Q\xb8\xb7\xbe\xab' sage: e(e(m)) == m True sage: m.decoding() 'THECATINTHEHAT' """ B = self.domain() # = plaintext_space = ciphertext_space if not isinstance(M, StringMonoidElement) and M.parent() == B: raise TypeError, "Argument M (= %s) must be a string in the plaintext space." % M (e1, e2) = self.key() MStream = M._element_list g1 = e1.connection_polynomial() n1 = g1.degree() IS_1 = e1.initial_state() g2 = e2.connection_polynomial() n2 = g2.degree() IS_2 = e1.initial_state() k = 0 N = len(M) n = max(n1,n2) CStream = [] while k < N: r = max(N-k,2*n) KStream = lfsr_sequence(g1.list(), IS_1, r) DStream = lfsr_sequence(g2.list(), IS_2, r) for i in range(r-n): if DStream[i] != 0: CStream.append(int(MStream[k]+KStream[i])) k += 1 if k == N: break IS_1 = KStream[r-n-1:r-n+n1] IS_2 = KStream[r-n-1:r-n+n2] return B(CStream) | 167bed5ea8e840387fb5e1a1d6d53caebf07e721 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/167bed5ea8e840387fb5e1a1d6d53caebf07e721/stream_cipher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
490,
16,
1965,
273,
315,
7228,
38,
6,
4672,
436,
8395,
12943,
30,
282,
300,
225,
12176,
49,
10335,
300,
279,
514,
11415,
839,
1046,
225,
300,
225,
12176,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
490,
16,
1965,
273,
315,
7228,
38,
6,
4672,
436,
8395,
12943,
30,
282,
300,
225,
12176,
49,
10335,
300,
279,
514,
11415,
839,
1046,
225,
300,
225,
12176,... |
firstPageTitle = str(arg[7:]) | firstPageTitle = arg[7:] | def checkbot(): """ Main function """ # Command line configurable parameters repeat = True # Restart after having check all the images? limit = 80 # How many images check? time_sleep = 30 # How many time sleep after the check? skip_number = 0 # How many images to skip before checking? wait_number = 0 # How many time sleep before the check? commonsActive = False # Check if on commons there's an image with the same name? normal = False # Check the new images or use another generator? urlUsed = False # Use the url-related function instead of the new-pages generator regexGen = False # Use the regex generator untagged = False # Use the untagged generator duplicatesActive = False # Use the duplicate option duplicatesReport = False # Use the duplicate-report option sendemailActive = False # Use the send-email # Here below there are the parameters. for arg in wikipedia.handleArgs(): if arg.startswith('-limit'): if len(arg) == 7: limit = int(wikipedia.input(u'How many images do you want to check?')) else: limit = int(arg[7:]) if arg.startswith('-time'): if len(arg) == 5: time_sleep = int(wikipedia.input(u'How many seconds do you want runs to be apart?')) else: time_sleep = int(arg[6:]) elif arg == '-break': repeat = False elif arg == '-commons': commonsActive = True elif arg.startswith('-duplicates'): duplicatesActive = True if len(arg) == 11: duplicates_rollback = 1 elif len(arg) > 11: duplicates_rollback = int(arg[12:]) elif arg == '-duplicatereport': duplicatesReport = True elif arg == '-sendemail': sendemailActive = True elif arg.startswith('-skip'): if len(arg) == 5: skip = True skip_number = int(wikipedia.input(u'How many images do you want to skip?')) elif len(arg) > 5: skip = True skip_number = int(arg[6:]) elif arg.startswith('-wait'): if len(arg) == 5: wait = True wait_number = int(wikipedia.input(u'How many time do you want to wait before checking the images?')) elif len(arg) > 5: wait = True wait_number = int(arg[6:]) elif arg.startswith('-start'): if len(arg) == 6: firstPageTitle = str(wikipedia.input(u'From witch page do you want to start?')) elif len(arg) > 6: firstPageTitle = str(arg[7:]) generator = wikipedia.getSite().allpages(start=firstPageTitle, namespace=6) repeat = False elif arg.startswith('-page'): if len(arg) == 5: regexPageName = str(wikipedia.input(u'Which page do you want to use for the regex?')) elif len(arg) > 5: regexPageName = str(arg[6:]) repeat = False regexGen = True elif arg.startswith('-url'): if len(arg) == 4: regexPageUrl = str(wikipedia.input(u'Which url do you want to use for the regex?')) elif len(arg) > 4: regexPageUrl = str(arg[5:]) urlUsed = True repeat = False regexGen = True elif arg.startswith('-regex'): if len(arg) == 6: regexpToUse = str(wikipedia.input(u'Which regex do you want to use?')) elif len(arg) > 6: regexpToUse = str(arg[7:]) generator = 'regex' repeat = False elif arg.startswith('-cat'): if len(arg) == 4: catName = str(wikipedia.input(u'In which category do I work?')) elif len(arg) > 4: catName = str(arg[5:]) catSelected = catlib.Category(wikipedia.getSite(), 'Category:%s' % catName) generator = pagegenerators.CategorizedPageGenerator(catSelected) repeat = False elif arg.startswith('-ref'): if len(arg) == 4: refName = str(wikipedia.input(u'The references of what page should I parse?')) elif len(arg) > 4: refName = str(arg[5:]) generator = pagegenerators.ReferringPageGenerator(wikipedia.Page(wikipedia.getSite(), refName)) repeat = False elif arg.startswith('-untagged'): untagged = True if len(arg) == 9: projectUntagged = str(wikipedia.input(u'In which project should I work?')) elif len(arg) > 9: projectUntagged = str(arg[10:]) # Understand if the generator it's the default or not. try: generator except NameError: normal = True # Define the site. site = wikipedia.getSite() # Block of text to translate the parameters set above. image_n = site.image_namespace() image_namespace = u"%s:" % image_n # Example: "User_talk:" # If the images to skip are 0, set the skip variable to False (the same for the wait time) if skip_number == 0: skip = False if wait_number == 0: wait = False # A little block-statement to ensure that the bot will not start with en-parameters if site.lang not in project_inserted: wikipedia.output(u"Your project is not supported by this script. You have to edit the script and add it!") return # Reading the log of the new images if another generator is not given. if normal == True: if limit == 1: wikipedia.output(u"Retrieving the latest file for checking...") else: wikipedia.output(u"Retrieving the latest %d files for checking..." % limit) # Main Loop while 1: # Defing the Main Class. mainClass = main(site, sendemailActive = sendemailActive, duplicatesReport = duplicatesReport) # Untagged is True? Let's take that generator if untagged == True: generator = mainClass.untaggedGenerator(projectUntagged, limit) normal = False # Ensure that normal is False # Normal True? Take the default generator if normal == True: generator = site.newimages(number = limit) # if urlUsed and regexGen, get the source for the generator if urlUsed == True and regexGen == True: textRegex = site.getUrl(regexPageUrl, no_hostname = True) # Not an url but a wiki page as "source" for the regex elif regexGen == True: pageRegex = wikipedia.Page(site, regexPageName) try: textRegex = pageRegex.get() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist!" % page.title()) textRegex = '' # No source, so the bot will quit later. # If generator is the regex' one, use your own Generator using an url or page and a regex. if generator == 'regex' and regexGen == True: generator = mainClass.regexGenerator(regexpToUse, textRegex) # Ok, We (should) have a generator, so let's go on. # Take the additional settings for the Project mainClass.takesettings() # Not the main, but the most important loop. #parsed = False if wait: printWithTimeZone(u'Skipping the images uploaded less than %s seconds ago..' % wait_number) # Let's sleep... generator = mainClass.wait(wait_number, generator, normal, limit) for image in generator: # When you've a lot of image to skip before working use this workaround, otherwise # let this commented, thanks. [ decoment also parsed = False if you want to use it # #if image.title() != u'Immagine:Nytlogo379x64.gif' and not parsed: # wikipedia.output(u"%s already parsed." % image.title()) # continue #else: # parsed = True # If the generator returns something that is not an image, simply skip it. if normal == False and regexGen == False: if image_namespace.lower() not in image.title().lower() and \ 'image:' not in image.title().lower(): wikipedia.output(u'%s seems not an image, skip it...' % image.title()) continue if normal: imageData = image image = imageData[0] timestamp = imageData[1] uploader = imageData[2] comment = imageData[3] # useless, in reality.. else: timestamp = None uploader = None comment = None # useless, also this, let it here for further developments try: imageName = image.title().split(image_namespace)[1] # Deleting the namespace (useless here) except IndexError:# Namespace image not found, that's not an image! Let's skip... wikipedia.output(u"%s is not an image, skipping..." % image.title()) continue mainClass.setParameters(imageName, timestamp, uploader) # Setting the image for the main class # Skip block if skip == True: skip = mainClass.skipImages(skip_number, limit) if skip == True: continue # Check on commons if there's already an image with the same name if commonsActive == True: response = mainClass.checkImageOnCommons() if response == False: continue # Check if there are duplicates of the image on the project selected if duplicatesActive == True: response2 = mainClass.checkImageDuplicated(duplicates_rollback) if response2 == False: continue resultCheck = mainClass.checkStep() if resultCheck: continue # A little block to perform the repeat or to break. if repeat == True: printWithTimeZone(u"Waiting for %s seconds," % time_sleep) time.sleep(time_sleep) elif repeat == False: wikipedia.output(u"\t\t\t>> STOP! <<") break # Exit | d3a2fc48d4e5f9ca045c9ff352693a14beec01b3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/d3a2fc48d4e5f9ca045c9ff352693a14beec01b3/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4819,
13332,
3536,
12740,
445,
3536,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
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,
866,
4819,
13332,
3536,
12740,
445,
3536,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
35,
... |
repo = self.pconn.repository(id) if not repo: system_exit(os.EX_DATAERR, _("Repository with id: [%s] not found") % id) | repo = self.get_repo(id) | def run(self): id = self.get_required_option('id') repo = self.pconn.repository(id) if not repo: system_exit(os.EX_DATAERR, _("Repository with id: [%s] not found") % id) optdict = vars(self.opts) for k, v in optdict.items(): if not v: continue method = self.find(k) if method: # special method stale = method(repo, v) if stale: repo = self.pconn.repository(id) continue if k in repo: repo[k] = v self.pconn.update(repo) print _("Successfully updated repository [ %s ]") % repo['id'] | e0cd776c182b7b15fde52b81f7b354e403cabf32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/e0cd776c182b7b15fde52b81f7b354e403cabf32/repo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
612,
273,
365,
18,
588,
67,
4718,
67,
3482,
2668,
350,
6134,
3538,
273,
365,
18,
588,
67,
7422,
12,
350,
13,
2153,
1576,
273,
4153,
12,
2890,
18,
4952,
13,
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,
1086,
12,
2890,
4672,
612,
273,
365,
18,
588,
67,
4718,
67,
3482,
2668,
350,
6134,
3538,
273,
365,
18,
588,
67,
7422,
12,
350,
13,
2153,
1576,
273,
4153,
12,
2890,
18,
4952,
13,
364,... |
def saveToFileDirect(self, fileName, ext, size = QSize(), overwriteExisting = 0): | def saveToFileDirect(self, fileName, size = None): | def saveToFileDirect(self, fileName, ext, size = QSize(), overwriteExisting = 0): sizeDlg = OWChooseImageSizeDlg(self) sizeDlg.saveToFileDirect(fileName, ext, size, overwriteExisting) | 950f5c32e790bc4cbadc7212208657605f6d8292 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/950f5c32e790bc4cbadc7212208657605f6d8292/OWGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
15450,
5368,
12,
2890,
16,
3968,
16,
963,
273,
599,
4672,
963,
40,
23623,
273,
18233,
24529,
28576,
40,
23623,
12,
2890,
13,
963,
40,
23623,
18,
5688,
15450,
5368,
12,
17812,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
15450,
5368,
12,
2890,
16,
3968,
16,
963,
273,
599,
4672,
963,
40,
23623,
273,
18233,
24529,
28576,
40,
23623,
12,
2890,
13,
963,
40,
23623,
18,
5688,
15450,
5368,
12,
17812,
16,
... |
self._enqueue_message(message_id, content, content_type, failure_report='partial', success_report='no') | self._enqueue_message(message_id, content, IsComposingMessage.content_type, failure_report='partial', success_report='no') | def send_composing_indication(self, state, refresh, last_active=None, remote_identity=None): if self.direction == 'recvonly': raise ChatStreamError('Cannot send message on recvonly stream') content_type = IsComposingMessage.content_type if state not in ('active', 'idle'): raise ValueError('Invalid value for composing indication state') message_id = '%x' % random.getrandbits(64) content = IsComposingMessage(state=State(state), refresh=Refresh(max(refresh, 60)), last_active=LastActive(last_active or datetime.now()), content_type=ContentType('text')).toxml() if self.cpim_enabled: if remote_identity is None: remote_identity = self.remote_identity elif not self.private_messages_allowed and remote_identity != self.remote_identity: raise ChatStreamError('The remote end does not support private messages') dt = datetime.utcnow() msg = MessageCPIM(content, content_type, from_=self.local_identity, to=remote_identity, datetime=dt) self._enqueue_message(message_id, str(msg), 'message/cpim', failure_report='partial', success_report='no') else: if remote_identity is not None and remote_identity != self.remote_identity: raise ChatStreamError('Private messages are not available, because CPIM wrapper is not used') self._enqueue_message(message_id, content, content_type, failure_report='partial', success_report='no') return message_id | 53d8a757b5ad03567337a6d2e9fa055bba0ab4ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/53d8a757b5ad03567337a6d2e9fa055bba0ab4ce/msrp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
832,
24014,
67,
728,
829,
12,
2890,
16,
919,
16,
4460,
16,
1142,
67,
3535,
33,
7036,
16,
2632,
67,
10781,
33,
7036,
4672,
309,
365,
18,
9855,
422,
296,
18334,
3700,
4278,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
832,
24014,
67,
728,
829,
12,
2890,
16,
919,
16,
4460,
16,
1142,
67,
3535,
33,
7036,
16,
2632,
67,
10781,
33,
7036,
4672,
309,
365,
18,
9855,
422,
296,
18334,
3700,
4278,
1... |
def _resolveDependencies(self, uJob, jobSet, split = False): | def _resolveDependencies(self, uJob, jobSet, split = False, resolveDeps = True): | def _resolveDependencies(self, uJob, jobSet, split = False): | b7289c5579f3cce32d9fd4cc35d3bba87e0b8c10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/b7289c5579f3cce32d9fd4cc35d3bba87e0b8c10/conaryclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10828,
8053,
12,
2890,
16,
582,
2278,
16,
1719,
694,
16,
1416,
273,
1083,
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,
... | [
1,
1,
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,
389,
10828,
8053,
12,
2890,
16,
582,
2278,
16,
1719,
694,
16,
1416,
273,
1083,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
from enthought.traits.ui.api import View, VSplit, Item | from enthought.traits.ui.api import View, Group, Item | def on_margin_click(self, event): if self.object.error: print event.GetPosition() #self.object.error.edit_traits() self.control.CallTipShow(self.squiggle_lines[0], self.object.error.traceback) | d95f463ddf373540566a95d0d6b7cd3e1251c72e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13168/d95f463ddf373540566a95d0d6b7cd3e1251c72e/source_editor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
10107,
67,
7475,
12,
2890,
16,
871,
4672,
309,
365,
18,
1612,
18,
1636,
30,
1172,
871,
18,
967,
2555,
1435,
468,
2890,
18,
1612,
18,
1636,
18,
4619,
67,
2033,
1282,
1435,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
10107,
67,
7475,
12,
2890,
16,
871,
4672,
309,
365,
18,
1612,
18,
1636,
30,
1172,
871,
18,
967,
2555,
1435,
468,
2890,
18,
1612,
18,
1636,
18,
4619,
67,
2033,
1282,
1435,
36... |
gLogger.info("SRM2Storage.isFile: Checking whether %s path(s) are file(s)." % len(urls)) | gLogger.debug("SRM2Storage.isFile: Checking whether %s path(s) are file(s)." % len(urls)) | def isFile(self,path): """Check if the given path exists and it is a file """ if type(path) in types.StringTypes: urls = [path] elif type(path) == types.ListType: urls = path else: return S_ERROR("SRM2Storage.isFile: Supplied path must be string or list of strings") | 65f6eeefcc68513bb80614609dded77332a53729 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/65f6eeefcc68513bb80614609dded77332a53729/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11655,
12,
2890,
16,
803,
4672,
3536,
1564,
309,
326,
864,
589,
1704,
471,
518,
353,
279,
585,
3536,
309,
618,
12,
803,
13,
316,
1953,
18,
780,
2016,
30,
6903,
273,
306,
803,
65,
132... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11655,
12,
2890,
16,
803,
4672,
3536,
1564,
309,
326,
864,
589,
1704,
471,
518,
353,
279,
585,
3536,
309,
618,
12,
803,
13,
316,
1953,
18,
780,
2016,
30,
6903,
273,
306,
803,
65,
132... |
<object %(ob_data)s %(ob_type)s %(ob_width)s %(ob_height)s %(ob_align)s> %(quality)s%(wmode)s%(autostart)s%(play)s%(loop)s%(menu)s<p>%(alt)s</p> | <object %(ob_data)s %(ob_type)s %(ob_width)s %(ob_height)s %(ob_align)s> %(movie)s%(quality)s%(wmode)s%(autostart)s%(play)s%(loop)s%(menu)s<p>%(alt)s</p> | def macro_EmbedObject(macro, target=wikiutil.required_arg(unicode), pagename=None, width=wikiutil.UnitArgument(None, float, ['px', 'em', 'mm', '%']), height=wikiutil.UnitArgument(None, float, ['px', 'em', 'mm', '%']), alt=u'', play=False, stop=True, loop=False, quality=(u'high', u'low', u'medium'), op=True, repeat=False, autostart=False, align=(u'middle', u'top', u'bottom'), hidden=False, menu=True, wmode=u'transparent', url_mimetype=None): """ This macro is used to embed an object into a wiki page """ # Join unit arguments with their units if width: if width[1] == 'px': width = '%dpx' % int(width[0]) else: width = '%g%s' % width if height: if height[1] == 'px': height = '%dpx' % int(height[0]) else: height = '%g%s' % height request = macro.request _ = macro.request.getText fmt = macro.formatter # AttachFile calls always with pagename. Users can call the macro from a different page as the attachment is saved. if not pagename: pagename = fmt.page.page_name if not wikiutil.is_URL(target): pagename, fname = AttachFile.absoluteName(target, pagename) if not AttachFile.exists(request, pagename, fname): linktext = _('Upload new attachment "%(filename)s"') % {'filename': fname} target = AttachFile.getAttachUrl(pagename, fname, request, upload=True) return (fmt.url(1, target) + fmt.text(linktext) + fmt.url(0)) url = AttachFile.getAttachUrl(pagename, fname, request) mt = wikiutil.MimeType(filename=fname) else: if not url_mimetype: return fmt.text(_('%(extension_name)s %(extension_type)s: Required argument %(argument_name)s missing.') % { "extension_name": extension_name, "extension_type": extension_type, "argument_name": "url_mimetype", }) else: url = target mt = wikiutil.MimeType() # initialize dict try: mt.major, mt.minor = url_mimetype.split('/') except ValueError: return fmt.text(_('%(extension_name)s %(extension_type)s: Invalid %(argument_name)s=%(argument_value)s!') % { "extension_name": extension_name, "extension_type": extension_type, "argument_name": "url_mimetype", "argument_value": str(url_mimetype), }) mime_type = "%s/%s" % (mt.major, mt.minor, ) dangerous = mime_type in request.cfg.mimetypes_xss_protect if not mime_type in request.cfg.mimetypes_embed or dangerous: return "%s: %s%s%s" % (fmt.text( _("Current configuration does not allow embedding of the file %(file)s because of its mimetype %(mimetype)s.") % { "mimetype": mime_type, "file": target}), fmt.url(1, url), fmt.text(target), fmt.url(0)) if not alt: alt = "%(text)s %(mime_type)s" % {'text': _("Embedded"), 'mime_type': mime_type} embed_src = '' if mt.major == 'video': if not width and not height: width = '400px' height = '400px' embed_src = ''' | e944ad4d26e541d71b3388f7dd10e2a4db7ef0fa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/e944ad4d26e541d71b3388f7dd10e2a4db7ef0fa/EmbedObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
67,
9538,
921,
12,
26448,
16,
1018,
33,
13044,
1367,
18,
4718,
67,
3175,
12,
9124,
3631,
4262,
1069,
33,
7036,
16,
1835,
33,
13044,
1367,
18,
2802,
1379,
12,
7036,
16,
1431,
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,
11522,
67,
9538,
921,
12,
26448,
16,
1018,
33,
13044,
1367,
18,
4718,
67,
3175,
12,
9124,
3631,
4262,
1069,
33,
7036,
16,
1835,
33,
13044,
1367,
18,
2802,
1379,
12,
7036,
16,
1431,
16,... |
this_dep_data = Record(table=table, quantity=quantity, | this_dep_data = Record(name=name, quantity=quantity, agg_func=agg_func, | def __call__(self, lst): return lst[self.n] | b5af14daa2f1967a49e58413cef62b78984573cc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12871/b5af14daa2f1967a49e58413cef62b78984573cc/log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
9441,
4672,
327,
9441,
63,
2890,
18,
82,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
9441,
4672,
327,
9441,
63,
2890,
18,
82,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
res = self.__getDNFromUID(fstat.uid) | res = self.__getDNFromUID( fstat.uid ) | def getFileMetadata(self,lfn,ownership=False): """ Returns the file metadata associated to a supplied LFN """ res = self.__checkArgumentFormat(lfn) if not res['OK']: return res lfns = res['Value'] # If we have less than three lfns to query a session doesn't make sense created = self.__openSession() failed = {} successful = {} for lfn in lfns.keys(): res = self.__getPathStat(lfn) if not res['OK']: failed[lfn] = res['Message'] else: fstat = res['Value'] successful[lfn] = {} successful[lfn]['Size'] = fstat.filesize successful[lfn]['CheckSumType'] = fstat.csumtype successful[lfn]['Checksum'] = fstat.csumvalue successful[lfn]['GUID'] = fstat.guid successful[lfn]['Status'] = fstat.status successful[lfn]['CreationDate'] = fromEpoch(fstat.ctime) successful[lfn]['ModificationDate'] = fromEpoch(fstat.mtime) successful[lfn]['NumberOfLinks'] = fstat.nlink successful[lfn]['Mode'] = S_IMODE(fstat.filemode) if ownership: res = self.__getDNFromUID(fstat.uid) if res['OK']: successful[lfn]['OwnerDN'] = res['Value'] else: successful[lfn]['OwnerDN'] = None res = self.__getRoleFromGID(fstat.gid) if res['OK']: successful[lfn]['OwnerRole'] = res['Value'] else: successful[lfn]['OwnerRole'] = None if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
2277,
12,
2890,
16,
80,
4293,
16,
995,
12565,
33,
8381,
4672,
3536,
2860,
326,
585,
1982,
3627,
358,
279,
4580,
18803,
50,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
80,
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,
6034,
2277,
12,
2890,
16,
80,
4293,
16,
995,
12565,
33,
8381,
4672,
3536,
2860,
326,
585,
1982,
3627,
358,
279,
4580,
18803,
50,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
80,
4... |
'type_id': fields.many2one('crm.case.resource.type', 'Version', domain="[('object_id.model', '=', 'project.issue')]"), | 'type_id': fields.many2one('crm.case.resource.type', 'Version'), | def _get_data(self, cr, uid, ids, field_names, arg, context=None): if context is None: context = {} """ @param cr: the current row, from the database cursor, @param uid: the current users ID for security checks, @param ids: List of case and section Datas IDs @param context: A standard dictionary for contextual values """ | e3c4cb38d8aadc9424cc493b61f386607a0200d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e3c4cb38d8aadc9424cc493b61f386607a0200d4/project_issue_report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
892,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
3536,
632,
891,
4422,
30,
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,
588,
67,
892,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
3536,
632,
891,
4422,
30,
3... |
"""<b> Load Favorite </b> <p> Allows the user to choose a "favorite file" from disk to add to the personal favorites list. File must have a .txt extension. | """<b>Load Favorite </b> <p> <img source=\"ui/actions/Properties Manager/LoadFavorite.png\"><br> Allows the user to load a <i>favorites file</i> from disk to be added to the favorites list. Favorites files must have a .txt extension. | def WhatsThis_EditDnaDisplayStyle_PropertyManager(propMgr): """ Add "What's This" text for widgets in the Edit DNA Display Style Property Manager. """ propMgr.applyFavoriteButton.setWhatsThis( """<b> Apply Favorite </b> <p> Apply the DNA display style settings stored in the current favorite (selected in the combobox) to the current DNA display style settings. """) propMgr.addFavoriteButton.setWhatsThis( """<b> Add Favorite </b> <p> Adds a new favorite to the user's list of favorites.""") propMgr.deleteFavoriteButton.setWhatsThis( """<b> Delete Favorite </b> <p> Deletes the current favorite from the user's personal list of favorites """) propMgr.loadFavoriteButton.setWhatsThis( """<b> Load Favorite </b> <p> Allows the user to choose a "favorite file" from disk to add to the personal favorites list. File must have a .txt extension. """) propMgr.saveFavoriteButton.setWhatsThis( """<b> Save Favorite </b> <p> Writes the current favorite (selected in the combobox) to a file, that can be given to another NE1 user (i.e. as an email attachment). File must be saved with a .txt entension so that it can loaded back later. """) | 87f357202ce4dca36c1dcc7491686a22c7a639d9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/87f357202ce4dca36c1dcc7491686a22c7a639d9/WhatsThisText_for_PropertyManagers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3497,
2323,
2503,
67,
4666,
40,
6582,
4236,
2885,
67,
1396,
1318,
12,
5986,
9455,
4672,
3536,
1436,
315,
23801,
1807,
1220,
6,
977,
364,
10965,
316,
326,
15328,
463,
11277,
9311,
9767,
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,
3497,
2323,
2503,
67,
4666,
40,
6582,
4236,
2885,
67,
1396,
1318,
12,
5986,
9455,
4672,
3536,
1436,
315,
23801,
1807,
1220,
6,
977,
364,
10965,
316,
326,
15328,
463,
11277,
9311,
9767,
4... |
def set_window_height_fixed(self): self.window.set_geometry_hints(self.window, max_width=self.h, max_height=-1) | def on_expander_activate(self, expander): currheight = self.window.get_size()[1] self.expanded = False # Note that get_expanded() will return the state of the expander # before this current click window_about_to_be_expanded = not self.expander.get_expanded() if window_about_to_be_expanded: if self.window.get_size()[1] == self.h: # For WMs like ion3, the app will not actually resize # when in collapsed mode, so prevent the waiting # of the player to expand from happening: skip_size_check = True else: skip_size_check = False if self.show_statusbar: self.statusbar.show() self.notebook.show_all() else: self.statusbar.hide() self.notebook.hide() if not (self.conn and self.status and self.status.state in ['play', 'pause']): if window_about_to_be_expanded: self.cursonglabel2.set_markup('<small>' + _('Click to collapse') + '</small>') else: self.cursonglabel2.set_markup('<small>' + _('Click to expand') + '</small>') # Now we wait for the height of the player to increase, so that # we know the list is visible. This is pretty hacky, but works. if self.window_owner: if window_about_to_be_expanded: if not skip_size_check: while self.window.get_size()[1] == currheight: gtk.main_iteration() # Notebook is visible, now resize: self.window.resize(self.w, self.h) else: self.window.resize(self.w, 1) if window_about_to_be_expanded: self.expanded = True self.tooltips.set_tip(self.expander, _("Click to collapse the player")) if self.status and self.status.state in ['play','pause']: gobject.idle_add(self.keep_song_visible_in_list) self.window.set_geometry_hints(self.window) else: self.tooltips.set_tip(self.expander, _("Click to expand the player")) self.set_window_height_fixed() # Put focus to the notebook: self.on_notebook_page_change(None, None, self.notebook.get_current_page()) return | 153223b666549d0d24eaaef97d7672f05f8e13f3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/153223b666549d0d24eaaef97d7672f05f8e13f3/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
12320,
264,
67,
10014,
12,
2890,
16,
4542,
264,
4672,
4306,
4210,
273,
365,
18,
5668,
18,
588,
67,
1467,
1435,
63,
21,
65,
365,
18,
17336,
273,
1083,
468,
3609,
716,
336,
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,
603,
67,
12320,
264,
67,
10014,
12,
2890,
16,
4542,
264,
4672,
4306,
4210,
273,
365,
18,
5668,
18,
588,
67,
1467,
1435,
63,
21,
65,
365,
18,
17336,
273,
1083,
468,
3609,
716,
336,
67... | |
'ru' : lambda v: dh_yearBC( v, u'%d до н. э.' ), | 'ru' : lambda v: dh_yearBC( v, u'%d год до н. э.' ), | def MakeParameter( decoder, param ): newValue = decoder[1](param) if len(decoder) == 4 and len(newValue) < decoder[3]: # force parameter length by taking the first digit in the list and repeating it required number of times # This converts "205" into "0205" for "%4d" newValue = decoder[0][0] * (decoder[3]-len(newValue)) + newValue return newValue | 0d587fb24710c43da6fbd7dd40eca0304587d218 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/0d587fb24710c43da6fbd7dd40eca0304587d218/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4344,
1662,
12,
8320,
16,
579,
262,
30,
6129,
273,
8320,
63,
21,
29955,
891,
13,
309,
562,
12,
21070,
13,
422,
1059,
471,
562,
12,
2704,
620,
13,
411,
8320,
63,
23,
14542,
468,
2944,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4344,
1662,
12,
8320,
16,
579,
262,
30,
6129,
273,
8320,
63,
21,
29955,
891,
13,
309,
562,
12,
21070,
13,
422,
1059,
471,
562,
12,
2704,
620,
13,
411,
8320,
63,
23,
14542,
468,
2944,... |
def __init__(self, widget, master, valueName, propagateState = 1): self.widget = widget self.master = master self.valueName = valueName self.propagateState = propagateState def __call__(self, *value): if self.widget.isEnabled() or not self.propagateState: if len(value): disabled = not value[0] else: disabled = not getattr(self.master, self.valueName) else: disabled = 1 for w in self.widget.disables: if type(w) == tuple: w[0].setDisabled(disabled) if hasattr(w[0], "makeConsistent"): w[0].makeConsistent() else: w.setDisabled(disabled) | def __init__(self, widget, master, valueName, propagateState = 1): self.widget = widget self.master = master self.valueName = valueName self.propagateState = propagateState def __call__(self, *value): if self.widget.isEnabled() or not self.propagateState: if len(value): disabled = not value[0] else: disabled = not getattr(self.master, self.valueName) else: disabled = 1 for w in self.widget.disables: if type(w) == tuple: w[0].setDisabled(disabled) if hasattr(w[0], "makeConsistent"): w[0].makeConsistent() else: w.setDisabled(disabled) | def __init__(self, widget, master, valueName, propagateState = 1): self.widget = widget self.master = master self.valueName = valueName self.propagateState = propagateState | ec58355f0e4e6cbc25734f2c717e88966d659bd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/ec58355f0e4e6cbc25734f2c717e88966d659bd7/OWGUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3604,
16,
4171,
16,
460,
461,
16,
13551,
1119,
273,
404,
4672,
365,
18,
6587,
273,
3604,
365,
18,
7525,
273,
4171,
365,
18,
1132,
461,
273,
460,
461,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3604,
16,
4171,
16,
460,
461,
16,
13551,
1119,
273,
404,
4672,
365,
18,
6587,
273,
3604,
365,
18,
7525,
273,
4171,
365,
18,
1132,
461,
273,
460,
461,
3... |
print >> pbs, script | print >> pbs, pbs_script | def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names | 3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
7276,
13332,
9163,
666,
777,
6550,
9163,
1257,
273,
5378,
364,
1719,
316,
777,
10088,
30,
1257,
18,
6923,
12,
4688,
3292,
529,
19486,
327,
1257,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
7276,
13332,
9163,
666,
777,
6550,
9163,
1257,
273,
5378,
364,
1719,
316,
777,
10088,
30,
1257,
18,
6923,
12,
4688,
3292,
529,
19486,
327,
1257,
282,
2,
-100,
-100,
-100,
-100,
-100... |
dl.append(self.dispatch(decodeTag(child.tag)[1], child)) return defer.DeferredList(dl) | return self.dispatch(decodeTag(child.tag)[1], child) return defer.fail(ValueError("no acceptable tag found")) | def _messageReceived(self, msg): | f6d6c418060c0f3be704ec36d6b024d507a36a5d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2459/f6d6c418060c0f3be704ec36d6b024d507a36a5d/xsdl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2150,
8872,
12,
2890,
16,
1234,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2150,
8872,
12,
2890,
16,
1234,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def print_doc(self, doc, decor=False): if not doc: return self.print_listing(['Command', 'Description'], doc, ' --', decor) | def print_doc(self, docs): if not docs: return for cmd, doc in docs: print cmd print '\n\t-- %s\n' % doc | def print_doc(self, doc, decor=False): if not doc: return self.print_listing(['Command', 'Description'], doc, ' --', decor) | 0bb2bcbc544c4f40e3722cc8a4dba479c592dff4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/0bb2bcbc544c4f40e3722cc8a4dba479c592dff4/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
2434,
12,
2890,
16,
997,
16,
4839,
33,
8381,
4672,
309,
486,
997,
30,
327,
365,
18,
1188,
67,
21228,
12,
3292,
2189,
2187,
296,
3291,
17337,
997,
16,
296,
225,
1493,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
2434,
12,
2890,
16,
997,
16,
4839,
33,
8381,
4672,
309,
486,
997,
30,
327,
365,
18,
1188,
67,
21228,
12,
3292,
2189,
2187,
296,
3291,
17337,
997,
16,
296,
225,
1493,
2187,
... |
log_filename = ("scp-%s-%s.log" % (self.name, kvm_utils.generate_random_string(4))) | def copy_files_to(self, local_path, remote_path, nic_index=0, timeout=600): """ Transfer files to the guest. | bb7fcce0c60db93e7cf8a1a474bdbec15d253887 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/bb7fcce0c60db93e7cf8a1a474bdbec15d253887/kvm_vm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
2354,
67,
869,
12,
2890,
16,
1191,
67,
803,
16,
2632,
67,
803,
16,
11562,
67,
1615,
33,
20,
16,
2021,
33,
28133,
4672,
3536,
12279,
1390,
358,
326,
13051,
18,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
2354,
67,
869,
12,
2890,
16,
1191,
67,
803,
16,
2632,
67,
803,
16,
11562,
67,
1615,
33,
20,
16,
2021,
33,
28133,
4672,
3536,
12279,
1390,
358,
326,
13051,
18,
2,
-100,
-100... | |
this = apply(_quickfix.new_ReversalIndicator, args) | this = _quickfix.new_ReversalIndicator(*args) | def __init__(self, *args): this = apply(_quickfix.new_ReversalIndicator, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
426,
2496,
287,
13140,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
426,
2496,
287,
13140,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
Ah = self.h | def __mul__(self, other): if isinstance(other, Matrix3): # Caching repeatedly accessed attributes in local variables # apparently increases performance by 20%. Attrib: Will McGugan. Aa = self.a Ab = self.b Ac = self.c Ad = self.d Ae = self.e Af = self.f Ag = self.g Ah = self.h Ai = self.i Aj = self.j Ak = self.k Ba = other.a Bb = other.b Bc = other.c Bd = other.d Be = other.e Bf = other.f Bg = other.g Bh = other.h Bi = other.i Bj = other.j Bk = other.k C = Matrix3() C.a = Aa * Ba + Ab * Be + Ac * Bi C.b = Aa * Bb + Ab * Bf + Ac * Bj C.c = Aa * Bc + Ab * Bg + Ac * Bk C.e = Ae * Ba + Af * Be + Ag * Bi C.f = Ae * Bb + Af * Bf + Ag * Bj C.g = Ae * Bc + Af * Bg + Ag * Bk C.i = Ai * Ba + Aj * Be + Ak * Bi C.j = Ai * Bb + Aj * Bf + Ak * Bj C.k = Ai * Bc + Aj * Bg + Ak * Bk return C elif isinstance(other, Point2): A = self B = other P = Point2(0, 0) P.x = A.a * B.x + A.b * B.y + A.c P.y = A.e * B.x + A.f * B.y + A.g return P elif isinstance(other, Vector2): A = self B = other V = Vector2(0, 0) V.x = A.a * B.x + A.b * B.y V.y = A.e * B.x + A.f * B.y return V else: other = other.copy() other._apply_transform(self) return other | 2151a22e7991fa47eb449b5b47262aeaa758ebff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7978/2151a22e7991fa47eb449b5b47262aeaa758ebff/euclid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
7298,
23,
4672,
468,
23782,
310,
30412,
15539,
1677,
316,
1191,
3152,
468,
29614,
715,
7033,
3304,
9239,
635,
4200,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
7298,
23,
4672,
468,
23782,
310,
30412,
15539,
1677,
316,
1191,
3152,
468,
29614,
715,
7033,
3304,
9239,
635,
4200,
9... | |
return | return new | def deepcopy(self): #bruce 050704; don't know whether this is complete [needs review by Mark; is it ok it only sets .ui? #####@@@@@] "Make a copy of self (a gamessParms object), which shares no mutable state with self. (Used to copy a Gamess Jig containing self.)" newname = self.name + " copy" # copy needs a different name #e could improve this -- see the code used to rename chunk copies new = self.__class__(newname) from files_mmp import mmp_interp_just_for_decode_methods interp = mmp_interp_just_for_decode_methods() #kluge for name, valstring in self.param_names_and_valstrings(): valstring = "%s" % (valstring,) valstring = valstring.strip() # we're too lazy to also check whether valstring is multiline or too long, like writemmp does; # result of this is only that some bugs will show up in writemmp but not in deepcopy (used to copy this kind of jig). new.info_gamess_setitem( name, valstring, interp, error_if_name_not_known = True ) return | fc9b5b0c1e4bcfbe715253fdd9f0953ea2657119 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/fc9b5b0c1e4bcfbe715253fdd9f0953ea2657119/jig_Gamess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7217,
12,
2890,
4672,
468,
2848,
3965,
374,
3361,
27,
3028,
31,
2727,
1404,
5055,
2856,
333,
353,
3912,
306,
20600,
10725,
635,
6622,
31,
353,
518,
1529,
518,
1338,
1678,
263,
4881,
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,
7217,
12,
2890,
4672,
468,
2848,
3965,
374,
3361,
27,
3028,
31,
2727,
1404,
5055,
2856,
333,
353,
3912,
306,
20600,
10725,
635,
6622,
31,
353,
518,
1529,
518,
1338,
1678,
263,
4881,
35,
... |
z = ZipFile(zipstream, 'w') path = os.path.join(tdir, *name.split('/')) shutil.copyfileobj(datastream, open(path, 'wb')) for info in names: current = os.path.join(tdir, *info.filename.split('/')) if os.path.isdir(current): z.writestr(info.filename+'/', '', 0700) else: z.write(current, info.filename, compress_type=info.compress_type) z.close() | with closing(ZipFile(zipstream, 'w')) as z: for info in names: fname = decode_arcname(info.filename) current = os.path.join(tdir, *fname.split('/')) if os.path.isdir(current): z.writestr(info.filename+'/', '', 0700) else: z.write(current, info.filename, compress_type=info.compress_type) | def safe_replace(zipstream, name, datastream): ''' Replace a file in a zip file in a safe manner. This proceeds by extracting and re-creating the zipfile. This is neccessary because :method:`ZipFile.replace` sometimes created corrupted zip files. :param zipstream: Stream from a zip file :param name: The name of the file to replace :param datastream: The data to replace the file with. ''' z = ZipFile(zipstream, 'r') names = z.infolist() with TemporaryDirectory('_zipfile_replace') as tdir: z.extractall(path=tdir) zipstream.seek(0) zipstream.truncate() z = ZipFile(zipstream, 'w') path = os.path.join(tdir, *name.split('/')) shutil.copyfileobj(datastream, open(path, 'wb')) for info in names: current = os.path.join(tdir, *info.filename.split('/')) if os.path.isdir(current): z.writestr(info.filename+'/', '', 0700) else: z.write(current, info.filename, compress_type=info.compress_type) z.close() | 90bf890e10e1b94de2516aed57e6ff57395a5843 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/90bf890e10e1b94de2516aed57e6ff57395a5843/zipfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4183,
67,
2079,
12,
4450,
3256,
16,
508,
16,
27973,
4672,
9163,
6910,
279,
585,
316,
279,
3144,
585,
316,
279,
4183,
21296,
18,
1220,
11247,
87,
635,
27117,
471,
283,
17,
23799,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4183,
67,
2079,
12,
4450,
3256,
16,
508,
16,
27973,
4672,
9163,
6910,
279,
585,
316,
279,
3144,
585,
316,
279,
4183,
21296,
18,
1220,
11247,
87,
635,
27117,
471,
283,
17,
23799,
326,
1... |
s = s[:j] + ' j += len(kwd) + 1 | last_hash = s[:j].rfind(' last_newline = s[:j].rfind('\n') if last_hash > last_newline: j += len(kwd) else: s = s[:j] + ' j += len(kwd) + 1 | def parse_keywords(kwd, s): j = 0 v = [] while True: i = s[j:].find(kwd) if i == -1: break j = i + j s = s[:j] + '#' + s[j:] j += len(kwd) + 1 k = s[j:].find('\n') if k == -1: k = len(s) for X in s[j:j+k].split(): if X[0] == '#': # skip rest of line break v.append(X) return v, s | 23b6f378898290e649fe110303ee89875dd9097a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/23b6f378898290e649fe110303ee89875dd9097a/cython.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
11771,
12,
79,
3623,
16,
272,
4672,
525,
273,
374,
331,
273,
5378,
1323,
1053,
30,
277,
273,
272,
63,
78,
30,
8009,
4720,
12,
79,
3623,
13,
309,
277,
422,
300,
21,
30,
89... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
11771,
12,
79,
3623,
16,
272,
4672,
525,
273,
374,
331,
273,
5378,
1323,
1053,
30,
277,
273,
272,
63,
78,
30,
8009,
4720,
12,
79,
3623,
13,
309,
277,
422,
300,
21,
30,
89... |
<td><para style="answer_left">""" + to_xml(str(que.column_name)) + """</para> | <td><para style="answer_left">""" + to_xml(tools.ustr(que.column_name)) + """</para> | def divide_list(lst, n): return [lst[i::n] for i in range(n)] | 359c4ac3c3deec88d37b44f93123f5d4ba02f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/359c4ac3c3deec88d37b44f93123f5d4ba02f3b3/survey_form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12326,
67,
1098,
12,
16923,
16,
290,
4672,
327,
306,
16923,
63,
77,
2866,
82,
65,
364,
277,
316,
1048,
12,
82,
25887,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12326,
67,
1098,
12,
16923,
16,
290,
4672,
327,
306,
16923,
63,
77,
2866,
82,
65,
364,
277,
316,
1048,
12,
82,
25887,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print city print result | def city_exists(city): print "city exists %s ?" % city try: conn = psycopg2.connect("dbname='%s' user='%s' host='%s' password='%s'" % \ (www.settings.DATABASE_NAME, www.settings.DATABASE_USER, www.settings.DATABASE_HOST, www.settings.DATABASE_PASSWORD)) except psycopg2.OperationalError: return False cursor = conn.cursor() cursor.execute("""select count(*) from planet_osm_line where boundary='administrative' and admin_level='8' and name=%s""", (city,)) result = cursor.fetchall() print city print result return (result[0][0] == 1) | 8a60f68cc76119786c5fa3294a9eda1eb78232e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14904/8a60f68cc76119786c5fa3294a9eda1eb78232e3/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12797,
67,
1808,
12,
14240,
4672,
225,
1172,
315,
14240,
1704,
738,
87,
17921,
738,
12797,
775,
30,
1487,
273,
4250,
93,
22295,
75,
22,
18,
3612,
2932,
20979,
28713,
87,
11,
729,
28713,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12797,
67,
1808,
12,
14240,
4672,
225,
1172,
315,
14240,
1704,
738,
87,
17921,
738,
12797,
775,
30,
1487,
273,
4250,
93,
22295,
75,
22,
18,
3612,
2932,
20979,
28713,
87,
11,
729,
28713,
... | |
pass | meths = [fixfeat(x) for x in meths] | def append_doc(fun, keyword, meths): if keyword == "feature": pass else: meths = [":py:func:`%s`" % x for x in meths] dc = ", ".join(meths) fun.__doc__ += '\n\t:%s: %s' % (keyword, dc) | 37ed8fe750989e519512ed40c97a44a41c9bb2bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/37ed8fe750989e519512ed40c97a44a41c9bb2bb/conf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
67,
2434,
12,
12125,
16,
4932,
16,
7917,
87,
4672,
225,
309,
4932,
422,
315,
7238,
6877,
7917,
87,
273,
306,
904,
29735,
12,
92,
13,
364,
619,
316,
7917,
87,
65,
469,
30,
7917,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
67,
2434,
12,
12125,
16,
4932,
16,
7917,
87,
4672,
225,
309,
4932,
422,
315,
7238,
6877,
7917,
87,
273,
306,
904,
29735,
12,
92,
13,
364,
619,
316,
7917,
87,
65,
469,
30,
7917,
... |
self.newship=faction_ships.getRandomFighter(faction) | self.newship=faction_ships.getRandomFighter(self.faction) | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) return elif (self.arrived==2): if (VS.getSystemFile()==self.adjsys.DestinationSystem()): self.arrived=3 else: VS.ResetTimeCompression() if (self.you.isNull()): Lose(1) return if (self.enemy.isNull()): Win(you,1) return elif (self.arrived==1): significant=self.significant if (significant.isNull ()): print "sig null" VS.terminateMission(0) else: if (you.getSignificantDistance(significant)<10000.0): if (self.newship==""): self.newship=faction_ships.getRandomFighter(faction) self.enemy=launch.launch_wave_around_unit("Base",self.faction,self.newship,"default",1+self.difficulty,3000.0,4000.0,self.significant) if (self.enemy): if (runaway): self.enemy.setTarget(significant) self.enemy.Jump() self.arrived=2 else: self.arrived=3 else: if (self.adjsys.Execute()): self.arrived=1 self.newship=faction_ships.getRandomFighter(faction) localdestination=self.significant.getName() self.adjsys=go_somewhere_significant(self.you,0,500) VS.IOmessage (0,"bounty mission",self.mplay,"You must destroy the %s unit in this system." % (self.newship)) self.obj=VS.addObjective("Destroy the %s unit" % (self.newship)) if (runaway): #ADD OTHER JUMPING IF STATEMENT CODE HERE VS.IOmessage (3,"bounty mission",self.mplay,"He is running towards the jump point. Catch him!") VS.IOmessage (4,"bounty mission",self.mplay,"he is going to %s" % (localdestination)) else: VS.IOmessage (3,"bounty mission",self.mplay,"Scanners are picking up a metallic object!") VS.IOmessage (4,"bounty mission",self.mplay,"Coordinates appear near %s" % (localdestination)) | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2798,
261,
2890,
4672,
353,
8267,
33,
20,
309,
261,
2890,
18,
19940,
18,
291,
2041,
1435,
4672,
365,
18,
1504,
307,
261,
21,
13,
327,
309,
261,
2890,
18,
5399,
2950,
631,
23,
4672,
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,
2798,
261,
2890,
4672,
353,
8267,
33,
20,
309,
261,
2890,
18,
19940,
18,
291,
2041,
1435,
4672,
365,
18,
1504,
307,
261,
21,
13,
327,
309,
261,
2890,
18,
5399,
2950,
631,
23,
4672,
3... |
if d['Status'] == 'install ok installed': | if "ok installed" in d['Status']: | def parse_status(path): control = "" for line in file(path).readlines(): if not line.strip(): yield control control = "" else: control += line | 4d7aa96c98c1aab3b4f61d10ab79b5d10b8cf385 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10616/4d7aa96c98c1aab3b4f61d10ab79b5d10b8cf385/pkgman.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2327,
12,
803,
4672,
3325,
273,
1408,
364,
980,
316,
585,
12,
803,
2934,
896,
3548,
13332,
309,
486,
980,
18,
6406,
13332,
2824,
3325,
3325,
273,
1408,
469,
30,
3325,
1011,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2327,
12,
803,
4672,
3325,
273,
1408,
364,
980,
316,
585,
12,
803,
2934,
896,
3548,
13332,
309,
486,
980,
18,
6406,
13332,
2824,
3325,
3325,
273,
1408,
469,
30,
3325,
1011,
9... |
def search(self, charset, criteria): | def search(self, charset, *criteria): | def search(self, charset, criteria): """Search mailbox for matching messages. | 71a5ba2bad9f65889796d806ddc5f2b241ae229d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/71a5ba2bad9f65889796d806ddc5f2b241ae229d/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4856,
16,
380,
9714,
4672,
3536,
2979,
14187,
364,
3607,
2743,
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,
1623,
12,
2890,
16,
4856,
16,
380,
9714,
4672,
3536,
2979,
14187,
364,
3607,
2743,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
expected_flags.sort() | def test_flags_irrelevant(self): # check that the result (numeric result + flags raised) of an # arithmetic operation doesn't depend on the current flags | f6fcf1773375414de2096c5062c3bbd03540e518 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/f6fcf1773375414de2096c5062c3bbd03540e518/test_decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7133,
67,
481,
27719,
12,
2890,
4672,
468,
866,
716,
326,
563,
261,
5246,
563,
397,
2943,
11531,
13,
434,
392,
468,
30828,
1674,
3302,
1404,
2447,
603,
326,
783,
2943,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7133,
67,
481,
27719,
12,
2890,
4672,
468,
866,
716,
326,
563,
261,
5246,
563,
397,
2943,
11531,
13,
434,
392,
468,
30828,
1674,
3302,
1404,
2447,
603,
326,
783,
2943,
2,
-10... | |
dest = self.findFileInDir(u"%s.%s" % (available_metadata['title'], ext), graphicsdirs, suffix=self.graphic_suffix[graphic_type], fuzzy_match=True) | dest = self.findFileInDir(u"%s.%s" % (sanitiseFileName(available_metadata['title']), ext), graphicsdirs, suffix=self.graphic_suffix[graphic_type], fuzzy_match=True) | def processMythTvMetaData(self): '''Check each video file in the mythvideo directories download graphics files and meta data then update MythTV data base meta data with any new information. ''' # If there were directories specified move them and update the MythTV db meta data accordingly if self.config['video_dir']: if len(self.config['video_dir']) % 2 == 0: validFiles = self._moveVideoFiles(self.config['video_dir']) else: sys.stderr.write(u"\n! Error: When specifying target (file or directory) to move to a destination (directory) they must always be in pairs (target and destination directory).\nYou specified an uneven number of variables (%d) for target and destination pairs.\nVariable count (%s)\n" % (len(self.config['video_dir']), self.config['video_dir'])) sys.exit(False) | f132146d19febfbd3e15736f0f51f9e3d1f72607 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/f132146d19febfbd3e15736f0f51f9e3d1f72607/jamu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12062,
451,
56,
90,
6998,
12,
2890,
4672,
9163,
1564,
1517,
6191,
585,
316,
326,
3399,
451,
9115,
6402,
4224,
17313,
1390,
471,
2191,
501,
1508,
1089,
8005,
451,
15579,
501,
1026,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12062,
451,
56,
90,
6998,
12,
2890,
4672,
9163,
1564,
1517,
6191,
585,
316,
326,
3399,
451,
9115,
6402,
4224,
17313,
1390,
471,
2191,
501,
1508,
1089,
8005,
451,
15579,
501,
1026,
... |
print >> sys.stderr, "Can't find " + single_entry + " in " + EAPDIR | print >> sys.stderr, "Can't find " + single_entry + " in " + APPSDIR | def main(): """ This program is used to generate the menu in enlightenment for the pentoo livecd Future version _might_ support other VM like gnome or others but kde :-) """ if options.listsupported: listdb() return 0 if options.simulate: print star + "Starting simulation" if options.listonly: print star + "Listing supported packages installed" print "Package\t\tIcon file\t\tMenu category" pkginstalled = [] pkginstalled = listpackages(PORTDIR) notthere = [] menu = etree.parse("applications.menu") root_menu = menu.getroot() for y in range(db.__len__()): if pkginstalled.__contains__(db[y][0]): if options.listonly: print db[y][0] + "\t" + db[y][1] + "\t\t" + db[y][2] + "\t" else: # calls makemenuentry file.eap, menu category for single_entry in db[y][1].split(" "): try: make_menu_entry( root_menu, single_entry, db[y][2]) except: print >> sys.stderr, "Can't find " + single_entry + " in " + EAPDIR return -1 else: notthere.append(db[y][0]) # settermenv() if options.verbose: # Final move, show the unfound icons in the db print warn + "Missing applications :" print star + "The following applications are available but not installed" for i in range(notthere.__len__()): print arrow + notthere[i] print etree.tostring(root_menu, pretty_print=True) | 163e5647d94b9b3d2efc08063789b5192703a389 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7161/163e5647d94b9b3d2efc08063789b5192703a389/genmenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
1220,
5402,
353,
1399,
358,
2103,
326,
3824,
316,
570,
5099,
275,
475,
364,
326,
293,
319,
5161,
328,
427,
557,
72,
9108,
1177,
389,
81,
750,
67,
2865,
1308,
8251,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
1220,
5402,
353,
1399,
358,
2103,
326,
3824,
316,
570,
5099,
275,
475,
364,
326,
293,
319,
5161,
328,
427,
557,
72,
9108,
1177,
389,
81,
750,
67,
2865,
1308,
8251,
3... |
self.wave_ringtone = None | def start(self): settings = SIPSimpleSettings() stream = self.session.proposed_streams[0] self.file_selector = stream.file_selector self.filename = filename = os.path.join(settings.file_transfer.directory.normalized, self.file_selector.name) i = 1 while os.path.exists(filename): filename = '%s.%d' % (self.filename, i) i += 1 self.filename = filename try: self.file = open(self.filename, 'w') except Exception, e: send_notice('Failed to open file "%s" for writing: %s' % (self.filename, e)) self.session.reject(486) return self.hash = hashlib.sha1() | a5708954fdf38b67940bec40d73cfdd5517b0122 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/a5708954fdf38b67940bec40d73cfdd5517b0122/sip_session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
1947,
273,
348,
2579,
5784,
2628,
1435,
1407,
273,
365,
18,
3184,
18,
685,
7423,
67,
16320,
63,
20,
65,
365,
18,
768,
67,
9663,
273,
1407,
18,
768,
67,
9663,
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,
787,
12,
2890,
4672,
1947,
273,
348,
2579,
5784,
2628,
1435,
1407,
273,
365,
18,
3184,
18,
685,
7423,
67,
16320,
63,
20,
65,
365,
18,
768,
67,
9663,
273,
1407,
18,
768,
67,
9663,
365... | |
if img_pil.mode in ("RGB", "RGBA"): | if img_pil.mode in ("RGB", "RGBA", "L"): | def notify(self, sender, event): """ Notification sent by node """ img = self.node.get_input(self.param_str) img_pil = img.copy() img_pil.thumbnail((100,100)) if img_pil != None: if img_pil.mode in ("RGB", "RGBA"): img = ImageQt(img_pil) else : img = ImageQt(img.convert("RGBA")) pix=QPixmap.fromImage(img) self.set_image(pix) self.set_scalable(False) else : pix=QPixmap() self.set_image(pix) | 1cbc058212fad93de5a2bb9dc5b058ef42f8ebef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4914/1cbc058212fad93de5a2bb9dc5b058ef42f8ebef/images_wralea.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2890,
16,
5793,
16,
871,
4672,
3536,
8050,
3271,
635,
756,
3536,
3774,
273,
365,
18,
2159,
18,
588,
67,
2630,
12,
2890,
18,
891,
67,
701,
13,
3774,
67,
84,
330,
273,
3774,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2890,
16,
5793,
16,
871,
4672,
3536,
8050,
3271,
635,
756,
3536,
3774,
273,
365,
18,
2159,
18,
588,
67,
2630,
12,
2890,
18,
891,
67,
701,
13,
3774,
67,
84,
330,
273,
3774,
... |
if self.debugging: print '*welcome*', `self.welcome` | if self.debugging: print '*welcome*', self.sanitize(self.welcome) | def getwelcome(self): if self.debugging: print '*welcome*', `self.welcome` return self.welcome | a400852e53478ba4d10fbcf752119754d73c29d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a400852e53478ba4d10fbcf752119754d73c29d3/ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
91,
16312,
12,
2890,
4672,
309,
365,
18,
4148,
1998,
30,
1172,
14609,
91,
16312,
14,
2187,
365,
18,
20266,
12,
2890,
18,
91,
16312,
13,
327,
365,
18,
91,
16312,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
91,
16312,
12,
2890,
4672,
309,
365,
18,
4148,
1998,
30,
1172,
14609,
91,
16312,
14,
2187,
365,
18,
20266,
12,
2890,
18,
91,
16312,
13,
327,
365,
18,
91,
16312,
2,
-100,
-100,
-... |
def endTagTable(self, token): if (self.tree.elementInScope("tbody", variant="table") or self.tree.elementInScope("thead", variant="table") or self.tree.elementInScope("tfoot", variant="table")): self.clearStackToTableBodyContext() self.endTagTableRowGroup( impliedTagToken(self.tree.openElements[-1].name)) | def endTagOther(self, token): self.parser.phases["inTable"].processEndTag(token) class InRowPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), (("td", "th"), self.startTagTableCell), (("caption", "col", "colgroup", "tbody", "tfoot", "thead", "tr"), self.startTagTableOther) ]) self.startTagHandler.default = self.startTagOther self.endTagHandler = utils.MethodDispatcher([ ("tr", self.endTagTr), ("table", self.endTagTable), (("tbody", "tfoot", "thead"), self.endTagTableRowGroup), (("body", "caption", "col", "colgroup", "html", "td", "th"), self.endTagIgnore) ]) self.endTagHandler.default = self.endTagOther def clearStackToTableRowContext(self): while self.tree.openElements[-1].name not in ("tr", "html"): self.parser.parseError("unexpected-implied-end-tag-in-table-row", {"name": self.tree.openElements[-1].name}) self.tree.openElements.pop() def ignoreEndTagTr(self): return not self.tree.elementInScope("tr", variant="table") def processEOF(self): self.parser.phases["inTable"].processEOF() def processSpaceCharacters(self, token): self.parser.phases["inTable"].processSpaceCharacters(token) def processCharacters(self, token): self.parser.phases["inTable"].processCharacters(token) def startTagTableCell(self, token): self.clearStackToTableRowContext() self.tree.insertElement(token) self.parser.phase = self.parser.phases["inCell"] self.tree.activeFormattingElements.append(Marker) def startTagTableOther(self, token): ignoreEndTag = self.ignoreEndTagTr() self.endTagTr(impliedTagToken("tr")) if not ignoreEndTag: self.parser.phase.processStartTag(token) def startTagOther(self, token): self.parser.phases["inTable"].processStartTag(token) def endTagTr(self, token): if not self.ignoreEndTagTr(): self.clearStackToTableRowContext() self.tree.openElements.pop() self.parser.phase = self.parser.phases["inTableBody"] else: assert self.parser.innerHTML self.parser.parseError() def endTagTable(self, token): ignoreEndTag = self.ignoreEndTagTr() self.endTagTr(impliedTagToken("tr")) if not ignoreEndTag: self.parser.phase.processEndTag(token) def endTagTableRowGroup(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.endTagTr(impliedTagToken("tr")) self.parser.phase.processEndTag(token) else: assert self.parser.innerHTML self.parser.parseError() def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag-in-table-row", {"name": token["name"]}) def endTagOther(self, token): self.parser.phases["inTable"].processEndTag(token) class InCellPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), (("caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"), self.startTagTableOther) ]) self.startTagHandler.default = self.startTagOther self.endTagHandler = utils.MethodDispatcher([ (("td", "th"), self.endTagTableCell), (("body", "caption", "col", "colgroup", "html"), self.endTagIgnore), (("table", "tbody", "tfoot", "thead", "tr"), self.endTagImply) ]) self.endTagHandler.default = self.endTagOther def closeCell(self): if self.tree.elementInScope("td", variant="table"): self.endTagTableCell(impliedTagToken("td")) elif self.tree.elementInScope("th", variant="table"): self.endTagTableCell(impliedTagToken("th")) def processEOF(self): self.parser.phases["inBody"].processEOF() def processCharacters(self, token): self.parser.phases["inBody"].processCharacters(token) def startTagTableOther(self, token): if (self.tree.elementInScope("td", variant="table") or self.tree.elementInScope("th", variant="table")): self.closeCell() self.parser.phase.processStartTag(token) else: assert self.parser.innerHTML self.parser.parseError() def startTagOther(self, token): self.parser.phases["inBody"].processStartTag(token) self.startTagHandler.default =\ self.parser.phases["inBody"].processStartTag def endTagTableCell(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.tree.generateImpliedEndTags(token["name"]) if self.tree.openElements[-1].name != token["name"]: self.parser.parseError("unexpected-cell-end-tag", {"name": token["name"]}) while True: node = self.tree.openElements.pop() if node.name == token["name"]: break else: self.tree.openElements.pop() self.tree.clearActiveFormattingElements() self.parser.phase = self.parser.phases["inRow"] else: self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def endTagImply(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.closeCell() self.parser.phase.processEndTag(token) else: self.parser.parseError() def endTagOther(self, token): self.parser.phases["inBody"].processEndTag(token) self.endTagHandler.default = self.parser.phases["inBody"].processEndTag class InSelectPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), ("option", self.startTagOption), ("optgroup", self.startTagOptgroup), ("select", self.startTagSelect), (("input", "keygen", "textarea"), self.startTagInput), ("script", self.startTagScript) ]) self.startTagHandler.default = self.startTagOther self.endTagHandler = utils.MethodDispatcher([ ("option", self.endTagOption), ("optgroup", self.endTagOptgroup), ("select", self.endTagSelect) ]) self.endTagHandler.default = self.endTagOther def processEOF(self): if self.tree.openElements[-1].name != "html": self.parser.parseError("eof-in-select") else: assert self.parser.innerHTML def processCharacters(self, token): self.tree.insertText(token["data"]) def startTagOption(self, token): if self.tree.openElements[-1].name == "option": self.tree.openElements.pop() self.tree.insertElement(token) def startTagOptgroup(self, token): if self.tree.openElements[-1].name == "option": self.tree.openElements.pop() if self.tree.openElements[-1].name == "optgroup": self.tree.openElements.pop() self.tree.insertElement(token) def startTagSelect(self, token): self.parser.parseError("unexpected-select-in-select") self.endTagSelect(impliedTagToken("select")) def startTagInput(self, token): self.parser.parseError("unexpected-input-in-select") if self.tree.elementInScope("select", variant="table"): self.endTagSelect(impliedTagToken("select")) self.parser.phase.processStartTag(token) def startTagScript(self, token): self.parser.phases["inHead"].processStartTag(token) def startTagOther(self, token): self.parser.parseError("unexpected-start-tag-in-select", {"name": token["name"]}) def endTagOption(self, token): if self.tree.openElements[-1].name == "option": self.tree.openElements.pop() else: self.parser.parseError("unexpected-end-tag-in-select", {"name": "option"}) def endTagOptgroup(self, token): if (self.tree.openElements[-1].name == "option" and self.tree.openElements[-2].name == "optgroup"): self.tree.openElements.pop() if self.tree.openElements[-1].name == "optgroup": self.tree.openElements.pop() else: self.parser.parseError("unexpected-end-tag-in-select", {"name": "optgroup"}) def endTagSelect(self, token): if self.tree.elementInScope("select", variant="table"): node = self.tree.openElements.pop() while node.name != "select": node = self.tree.openElements.pop() self.parser.resetInsertionMode() else: assert self.parser.innerHTML self.parser.parseError() def endTagOther(self, token): self.parser.parseError("unexpected-end-tag-in-select", {"name": token["name"]}) class InSelectInTablePhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ (("caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th"), self.startTagTable) ]) self.startTagHandler.default = self.startTagOther self.endTagHandler = utils.MethodDispatcher([ (("caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th"), self.endTagTable) ]) self.endTagHandler.default = self.endTagOther def processEOF(self): self.parser.phases["inSelect"].processEOF() def processCharacters(self, token): self.parser.phases["inSelect"].processCharacters(token) def startTagTable(self, token): self.parser.parseError("unexpected-table-element-start-tag-in-select-in-table", {"name": token["name"]}) self.endTagOther(impliedTagToken("select")) self.parser.phase.processStartTag(token) def startTagOther(self, token): self.parser.phases["inSelect"].processStartTag(token) def endTagTable(self, token): self.parser.parseError("unexpected-table-element-end-tag-in-select-in-table", {"name": token["name"]}) if self.tree.elementInScope(token["name"], variant="table"): self.endTagOther(impliedTagToken("select")) self.parser.phase.processEndTag(token) def endTagOther(self, token): self.parser.phases["inSelect"].processEndTag(token) class InForeignContentPhase(Phase): breakoutElements = frozenset(["b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "font", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"]) def __init__(self, parser, tree): Phase.__init__(self, parser, tree) def nonHTMLElementInScope(self): rv = False for element in self.tree.openElements[::-1]: if element.namespace != self.tree.defaultNamespace: rv = self.tree.elementInScope(element.name) if rv: break return rv def adjustSVGTagNames(self, token): replacements = {"altglyph":"altGlyph", "altglyphdef":"altGlyphDef", "altglyphitem":"altGlyphItem", "animatecolor":"animateColor", "animatemotion":"animateMotion", "animatetransform":"animateTransform", "clippath":"clipPath", "feblend":"feBlend", "fecolormatrix":"feColorMatrix", "fecomponenttransfer":"feComponentTransfer", "fecomposite":"feComposite", "feconvolvematrix":"feConvolveMatrix", "fediffuselighting":"feDiffuseLighting", "fedisplacementmap":"feDisplacementMap", "fedistantlight":"feDistantLight", "feflood":"feFlood", "fefunca":"feFuncA", "fefuncb":"feFuncB", "fefuncg":"feFuncG", "fefuncr":"feFuncR", "fegaussianblur":"feGaussianBlur", "feimage":"feImage", "femerge":"feMerge", "femergenode":"feMergeNode", "femorphology":"feMorphology", "feoffset":"feOffset", "fepointlight":"fePointLight", "fespecularlighting":"feSpecularLighting", "fespotlight":"feSpotLight", "fetile":"feTile", "feturbulence":"feTurbulence", "foreignobject":"foreignObject", "glyphref":"glyphRef", "lineargradient":"linearGradient", "radialgradient":"radialGradient", "textpath":"textPath"} if token["name"] in replacements: token["name"] = replacements[token["name"]] def processCharacters(self, token): self.parser.framesetOK = False Phase.processCharacters(self, token) def processEOF(self): pass def processStartTag(self, token): currentNode = self.tree.openElements[-1] currentNodeNamespace = currentNode.namespace currentNodeName = currentNode.name if (currentNodeNamespace == self.tree.defaultNamespace or (currentNodeNamespace == namespaces["mathml"] and token["name"] not in frozenset(["mglyph", "malignmark"]) and currentNodeName in frozenset(["mi", "mo", "mn", "ms", "mtext"])) or (currentNodeNamespace == namespaces["mathml"] and currentNodeName == "annotation-xml" and token["name"] == "svg") or (currentNode.namespace == namespaces["svg"] and currentNode.name in frozenset(["foreignObject", "desc", "title"]) )): assert self.parser.secondaryPhase != self self.parser.secondaryPhase.processStartTag(token) if self.parser.phase == self and not self.nonHTMLElementInScope(): self.parser.phase = self.parser.secondaryPhase elif token["name"] in self.breakoutElements: self.parser.parseError("unexpected-html-element-in-foreign-content", token["name"]) while (self.tree.openElements[-1].namespace != self.tree.defaultNamespace): self.tree.openElements.pop() self.parser.phase = self.parser.secondaryPhase self.parser.phase.processStartTag(token) else: if currentNode.namespace == namespaces["mathml"]: self.parser.adjustMathMLAttributes(token) elif currentNode.namespace == namespaces["svg"]: self.adjustSVGTagNames(token) self.parser.adjustSVGAttributes(token) self.parser.adjustForeignAttributes(token) token["namespace"] = currentNode.namespace self.tree.insertElement(token) if token["selfClosing"]: self.tree.openElements.pop() token["selfClosingAcknowledged"] = True def processEndTag(self, token): if self.tree.openElements[-1].namespace != self.tree.defaultNamespace: nodeIndex = len(self.tree.openElements) - 1 node = self.tree.openElements[-1] if node.name != token["name"]: self.parser.parseError("unexpected-end-tag", token["name"]) while True: if node.name == token["name"]: popped = self.tree.openElements.pop() while popped != node: popped = self.tree.openElements.pop() assert self.tree.openElements break nodeIndex -= 1 node = self.tree.openElements[nodeIndex] if node.namespace == self.tree.defaultNamespace: assert self.parser.secondaryPhase != self self.parser.secondaryPhase.processEndTag(token) if self.parser.phase == self and not self.nonHTMLElementInScope(): self.parser.phase = self.parser.secondaryPhase break else: assert self.parser.secondaryPhase != self self.parser.secondaryPhase.processEndTag(token) if self.parser.phase == self and not self.nonHTMLElementInScope(): self.parser.phase = self.parser.secondaryPhase class AfterBodyPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml) ]) self.startTagHandler.default = self.startTagOther self.endTagHandler = utils.MethodDispatcher([("html", self.endTagHtml)]) self.endTagHandler.default = self.endTagOther def processEOF(self): pass def processComment(self, token): self.tree.insertComment(token, self.tree.openElements[0]) def processCharacters(self, token): self.parser.parseError("unexpected-char-after-body") self.parser.phase = self.parser.phases["inBody"] self.parser.phase.processCharacters(token) def startTagHtml(self, token): self.parser.phases["inBody"].processStartTag(token) def startTagOther(self, token): self.parser.parseError("unexpected-start-tag-after-body", {"name": token["name"]}) self.parser.phase = self.parser.phases["inBody"] self.parser.phase.processStartTag(token) def endTagHtml(self,name): if self.parser.innerHTML: self.parser.parseError("unexpected-end-tag-after-body-innerhtml") else: self.parser.phase = self.parser.phases["afterAfterBody"] def endTagOther(self, token): self.parser.parseError("unexpected-end-tag-after-body", {"name": token["name"]}) self.parser.phase = self.parser.phases["inBody"] | def endTagTable(self, token): if (self.tree.elementInScope("tbody", variant="table") or self.tree.elementInScope("thead", variant="table") or self.tree.elementInScope("tfoot", variant="table")): self.clearStackToTableBodyContext() self.endTagTableRowGroup( impliedTagToken(self.tree.openElements[-1].name)) self.parser.phase.processEndTag(token) else: # innerHTML case assert self.parser.innerHTML self.parser.parseError() | 5cc56a5db432ce478d90ee0dd744811935854947 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10463/5cc56a5db432ce478d90ee0dd744811935854947/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
8290,
12,
2890,
16,
1147,
4672,
365,
18,
4288,
18,
844,
3304,
9614,
267,
1388,
6,
8009,
2567,
25633,
12,
2316,
13,
282,
667,
657,
1999,
11406,
12,
11406,
4672,
225,
1652,
1001,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
8290,
12,
2890,
16,
1147,
4672,
365,
18,
4288,
18,
844,
3304,
9614,
267,
1388,
6,
8009,
2567,
25633,
12,
2316,
13,
282,
667,
657,
1999,
11406,
12,
11406,
4672,
225,
1652,
1001,
... |
self._write_var_details(public, private, doc.variables(), uid) | self._write_var_details(public, private, doc, doc.variables()) | def _write_module(self, public, private, uid, doc): """ Write an HTML page describing the given module to the given streams. @param public: The output stream for the public version of the page. @param private: The output stream for the private version of the page. @param uid: The UID of the module to document. @param doc: The L{ModuleDoc} of the module to document. """ # Write the header & navigation bar. str = self._header(uid.name()) public.write(str); private.write(str) self._write_navbar(public, private, uid) self._write_breadcrumbs(public, private, uid) | 6ecda71cd0e7e4752ddec3a0c1619699a3092855 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/6ecda71cd0e7e4752ddec3a0c1619699a3092855/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
2978,
12,
2890,
16,
1071,
16,
3238,
16,
4555,
16,
997,
4672,
3536,
2598,
392,
3982,
1363,
16868,
326,
864,
1605,
358,
326,
864,
8205,
18,
632,
891,
1071,
30,
1021,
876,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2626,
67,
2978,
12,
2890,
16,
1071,
16,
3238,
16,
4555,
16,
997,
4672,
3536,
2598,
392,
3982,
1363,
16868,
326,
864,
1605,
358,
326,
864,
8205,
18,
632,
891,
1071,
30,
1021,
876,
... |
verts = data.keys() | verts = set(data.keys()) | def __init__(self, data=None, pos=None, loops=None, format=None, boundary=[], weighted=None, implementation='networkx', sparse=True, vertex_labels=True, **kwds): """ TESTS:: sage: G = Graph() sage: loads(dumps(G)) == G True sage: a = matrix(2,2,[1,0,0,1]) sage: Graph(a).adjacency_matrix() == a True | 4f9c413501b90399eaf8a3c01e52aad1fd917485 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/4f9c413501b90399eaf8a3c01e52aad1fd917485/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
33,
7036,
16,
949,
33,
7036,
16,
14075,
33,
7036,
16,
740,
33,
7036,
16,
7679,
22850,
6487,
13747,
33,
7036,
16,
4471,
2218,
5185,
92,
2187,
9387,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
501,
33,
7036,
16,
949,
33,
7036,
16,
14075,
33,
7036,
16,
740,
33,
7036,
16,
7679,
22850,
6487,
13747,
33,
7036,
16,
4471,
2218,
5185,
92,
2187,
9387,
... |
f=open('/tmp/debug', 'w') f.write(new) f.write(newr) f.close() print newr | def main(argv): recID=0 opts,pargs=getopt.getopt(argv,'i:') for opt, arg in opts: if opt == '-i': recID=arg result=format_record(recID=recID,of='xm') if result: #change the result to MARC by applying a template result = bibconvert_xslt_engine.convert(result, "marcxmltoplain.xsl") #call a sub that changes the stuff to editable form, calls editor, #returns a string new = convert_edit(result) newr = to_marc(new) #debug f=open('/tmp/debug', 'w') f.write(new) f.write(newr) f.close() print newr if raw_input("Save to DB Y/N:") =='Y': recs=xml_marc_to_records(''.join(new)) response=bibupload(recs[0],opt_mode='replace') if response[0]:print "Error updating record: "+response[0] | 1279bffd911eb9ab711b9a977807e811c9a1a6d4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14116/1279bffd911eb9ab711b9a977807e811c9a1a6d4/editor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
225,
1950,
734,
33,
20,
1500,
16,
1065,
564,
33,
588,
3838,
18,
588,
3838,
12,
19485,
11189,
77,
2497,
13,
364,
2153,
16,
1501,
316,
1500,
30,
309,
2153,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
225,
1950,
734,
33,
20,
1500,
16,
1065,
564,
33,
588,
3838,
18,
588,
3838,
12,
19485,
11189,
77,
2497,
13,
364,
2153,
16,
1501,
316,
1500,
30,
309,
2153,
422,
... | |
self.collection.findOne(type = Movie, title = unicode(title)).watched = watched | self.smewtd.collection.findOne(Movie, title = unicode(title)).watched = watched | def updateWatched(self, title, watched): self.collection.findOne(type = Movie, title = unicode(title)).watched = watched | b40935ee44f858d3c15866962fac2e822d407b3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11141/b40935ee44f858d3c15866962fac2e822d407b3b/mainwidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
5234,
329,
12,
2890,
16,
2077,
16,
23135,
4672,
365,
18,
5548,
18,
4720,
3335,
12,
723,
273,
26963,
16,
2077,
273,
5252,
12,
2649,
13,
2934,
7585,
329,
273,
23135,
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,
1089,
5234,
329,
12,
2890,
16,
2077,
16,
23135,
4672,
365,
18,
5548,
18,
4720,
3335,
12,
723,
273,
26963,
16,
2077,
273,
5252,
12,
2649,
13,
2934,
7585,
329,
273,
23135,
2,
-100,
-100,... |
assert self.printInterests() | assert self.printInterestsIfDebug() | def handleInterestDoneMessage(self, di): """ This handles the interest done messages and may dispatch a action based on the ID, Context """ assert self.notify.debugCall() id = di.getUint16() scope = di.getUint32() expect_scope = self.getInterestScopeId(id) print "handleInterestDoneMessage--> Received ID:%s Scope:%s"%(id,scope); if expect_scope == scope: print "handleInterestDoneMessage--> Scope Match:%s Scope:%s"%(id,scope); event = self.getInterestScopeEvent(id) if event is not None: print "handleInterestDoneMessage--> Send Event : %s"%(event); messenger.send(event) else: print "handleInterestDoneMessage--> No Event "; self._ponderRemoveFlaggedInterest(id) else: print "handleInterestDoneMessage--> Scope MisMatch :%s :%s"%(expect_scope,scope); | 89775fc9c26f3ea3b58b50241e39dc1220ecbcf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/89775fc9c26f3ea3b58b50241e39dc1220ecbcf0/DoInterestManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
29281,
7387,
1079,
12,
2890,
16,
4314,
4672,
3536,
1220,
7372,
326,
16513,
2731,
2743,
471,
2026,
3435,
279,
1301,
2511,
603,
326,
1599,
16,
1772,
3536,
1815,
365,
18,
12336,
18,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
29281,
7387,
1079,
12,
2890,
16,
4314,
4672,
3536,
1220,
7372,
326,
16513,
2731,
2743,
471,
2026,
3435,
279,
1301,
2511,
603,
326,
1599,
16,
1772,
3536,
1815,
365,
18,
12336,
18,
4... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.