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 |
|---|---|---|---|---|---|---|
feed = gd_client.GetContactsFeed() | query = gdata.contacts.service.ContactsQuery() query.max_results = 3000 feed = gd_client.GetContactsFeed(query.ToUri()) | def write_feed_to_file(gd_client): jsonFile = open('my/{0}.contacts.json'.format(GetUIDHash(gd_client)), 'w') feed = gd_client.GetContactsFeed() for i, entry in enumerate(feed.entry): jsonObject = {} jsonObject["id"] = entry.id.text[-16:] print '%s %s' % (i+1, entry.title.text) jsonObject["name"] = entry.title.text if entry.nickname: jsonObject["nickname"] = entry.nickname # Display the primary email address for the contact. if entry.email: jsonObject["email"] = [] for email in entry.email: jsonEmail = {} jsonEmail["value"] = email.address label = email.rel or email.label indexOfHash = label.find("#") label = label[indexOfHash+1:] if label != 'other': jsonEmail["type"] = label jsonObject["email"].append(jsonEmail) if entry.phone_number: jsonObject["phone"] = [] for phone in entry.phone_number: jsonPhone = {} jsonPhone["value"] = phone.text label = phone.rel or phone.label indexOfHash = label.find("#") label = label[indexOfHash+1:] if label != 'other': jsonPhone["type"] = label jsonObject["phone"].append(jsonPhone) if entry.postal_address: jsonObject["address"] = [] for postalAddress in entry.postal_address: jsonAddress = {} jsonAddress["value"] = postalAddress.text label = postalAddress.rel or postalAddress.label indexOfHash = label.find("#") label = label[indexOfHash+1:] if label != 'other': jsonAddress["type"] = label jsonObject["address"].append(jsonAddress) | d02c119ac0dc974b4d6ec35770d98124fd8f49ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13639/d02c119ac0dc974b4d6ec35770d98124fd8f49ac/gcontacts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
7848,
67,
869,
67,
768,
12,
19016,
67,
2625,
4672,
1163,
812,
273,
1696,
2668,
4811,
4938,
20,
5496,
20777,
18,
1977,
10332,
2139,
12,
967,
3060,
2310,
12,
19016,
67,
2625,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
7848,
67,
869,
67,
768,
12,
19016,
67,
2625,
4672,
1163,
812,
273,
1696,
2668,
4811,
4938,
20,
5496,
20777,
18,
1977,
10332,
2139,
12,
967,
3060,
2310,
12,
19016,
67,
2625,
1... |
"on_MainWindow_destroy" : self.Close } | "on_MainWindow_destroy" : self.btnClose_clicked } | def __init__(self,proximityObject,configobj,show_window_on_start): #Constructor sets up the GUI and reads the current config #Set the Glade file self.gladefile = dist_path + "proximity.glade" self.wTree = gtk.glade.XML(self.gladefile) | 791241e22d58506105e0800156c4cfb3ef1adccc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/61/791241e22d58506105e0800156c4cfb3ef1adccc/proximity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
20314,
30786,
921,
16,
1425,
2603,
16,
4500,
67,
5668,
67,
265,
67,
1937,
4672,
468,
6293,
1678,
731,
326,
10978,
471,
6838,
326,
783,
642,
225,
468,
694... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20314,
30786,
921,
16,
1425,
2603,
16,
4500,
67,
5668,
67,
265,
67,
1937,
4672,
468,
6293,
1678,
731,
326,
10978,
471,
6838,
326,
783,
642,
225,
468,
694... |
return self.pool.get('sale.order.line').product_uom_change(cursor, user, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False) | return self.pool.get('sale.order.line').product_uom_change(cursor, user, ids, pricelist, product, qty=qty, uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id, lang=lang, update_tax=update_tax, date_order=date_order) | def product_uom_change(self, cursor, user, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False): return self.pool.get('sale.order.line').product_uom_change(cursor, user, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False) | c3ecae300b51b41e529e87af3b8a4554a185c2e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/c3ecae300b51b41e529e87af3b8a4554a185c2e7/hotel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
89,
362,
67,
3427,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
89,
362,
67,
3427,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
5... |
self.file.write('<svg width="%g" height="%g"' % (width, height)) | self.file.write('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="%g" height="%g"' % (width, height)) | def Save(self): self.file.write('<?xml version="1.0" encoding="ISO-8859-1" ' 'standalone="yes"?>\n') | 4163fa2ee2040c566dca43aeb9cbceef6df4d269 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3123/4163fa2ee2040c566dca43aeb9cbceef6df4d269/svgsaver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7074,
12,
2890,
4672,
365,
18,
768,
18,
2626,
2668,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
12609,
17,
17258,
17,
21,
6,
296,
296,
10145,
12451,
1546,
9707,
6,
35,
5333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7074,
12,
2890,
4672,
365,
18,
768,
18,
2626,
2668,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
12609,
17,
17258,
17,
21,
6,
296,
296,
10145,
12451,
1546,
9707,
6,
35,
5333,
... |
${BEGIN} EFI_STATUS ${Function} ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ); ${END} | #ifndef _AUTOGENH_${Guid} | c0df5fc3f54d659cf283e68f6c5e03b271e178cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/914/c0df5fc3f54d659cf283e68f6c5e03b271e178cb/GenC.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
82,
536,
389,
18909,
16652,
44,
67,
18498,
22549,
97,
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,
468,
430,
82,
536,
389,
18909,
16652,
44,
67,
18498,
22549,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
for e in self._backend.iterator_out_edges(vertices, labels): yield e | return self._backend.iterator_out_edges(vertices, labels) | def edge_iterator(self, vertices=None, labels=True, ignore_direction=False): """ Returns an iterator over the edges incident with any vertex given. If the graph is directed, iterates over edges going out only. If vertices is None, then returns an iterator over all edges. If self is directed, returns outgoing edges only. | 7b9afb3b66d010e574487a319d86af01cd22bcc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7b9afb3b66d010e574487a319d86af01cd22bcc7/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
9838,
12,
2890,
16,
6928,
33,
7036,
16,
3249,
33,
5510,
16,
2305,
67,
9855,
33,
8381,
4672,
3536,
2860,
392,
2775,
1879,
326,
5231,
22933,
598,
1281,
5253,
864,
18,
971,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3591,
67,
9838,
12,
2890,
16,
6928,
33,
7036,
16,
3249,
33,
5510,
16,
2305,
67,
9855,
33,
8381,
4672,
3536,
2860,
392,
2775,
1879,
326,
5231,
22933,
598,
1281,
5253,
864,
18,
971,
326,... |
'hr':'R', | def __init__( self, **args): | 131b68a99ed71387e4713fbf673d0f5bcda4a19c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8886/131b68a99ed71387e4713fbf673d0f5bcda4a19c/SchedulerSge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
2826,
1968,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
2826,
1968,
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,... | |
assert(_thePyrexSimulator is None) | assert (_thePyrexSimulator is None) | def __init__(self): global _thePyrexSimulator assert(_thePyrexSimulator is None) _thePyrexSimulator = self import sim self.sim = sim.theSimulator() | 2d7eac8ec906f3128b5fa871dbb9ebba26f88776 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/2d7eac8ec906f3128b5fa871dbb9ebba26f88776/PyrexSimulator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2552,
389,
5787,
9413,
266,
92,
7993,
11775,
1815,
261,
67,
5787,
9413,
266,
92,
7993,
11775,
353,
599,
13,
389,
5787,
9413,
266,
92,
7993,
11775,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2552,
389,
5787,
9413,
266,
92,
7993,
11775,
1815,
261,
67,
5787,
9413,
266,
92,
7993,
11775,
353,
599,
13,
389,
5787,
9413,
266,
92,
7993,
11775,
273,
... |
try: status = os.fstat(fp.fileno()) if stat.S_ISREG(status.st_mode): fp_size = status.st_size else: | if isinstance(fp, gzip.GzipFile): fp_size = None else: try: status = os.fstat(fp.fileno()) if stat.S_ISREG(status.st_mode): fp_size = status.st_size else: fp_size = None except AttributeError: | def do_grep(self, fp): """ Do a full grep. | 73b5557e048342a519cecab38c11b31b4cc2dac6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10903/73b5557e048342a519cecab38c11b31b4cc2dac6/grin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
11556,
84,
12,
2890,
16,
4253,
4672,
3536,
2256,
279,
1983,
23366,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
11556,
84,
12,
2890,
16,
4253,
4672,
3536,
2256,
279,
1983,
23366,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
tmpstack = [] for line_index, text in self.interesting_lines(firstline): while self.info[-1][0] > line_index: del self.info[-1] if self.info[-1][0] == line_index: break tmpstack.append((line_index, text)) while tmpstack: self.info.append(tmpstack.pop()) | def update_label(self): firstline = int(self.text.index("@0,0").split('.')[0]) if self.lastfirstline == firstline: return self.lastfirstline = firstline tmpstack = [] for line_index, text in self.interesting_lines(firstline): # Remove irrelevant self.info items, and when we reach a relevant # item (which must happen because of the dummy element), break. while self.info[-1][0] > line_index: del self.info[-1] if self.info[-1][0] == line_index: break tmpstack.append((line_index, text)) while tmpstack: self.info.append(tmpstack.pop()) lines = [""] * max(0, self.numlines - len(self.info)) + \ [x[1] for x in self.info[-self.numlines:]] self.label["text"] = '\n'.join(lines) | 21b844238224f965dadb523198fd84964956e575 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/21b844238224f965dadb523198fd84964956e575/CodeContext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1925,
12,
2890,
4672,
1122,
1369,
273,
509,
12,
2890,
18,
955,
18,
1615,
2932,
36,
20,
16,
20,
20387,
4939,
2668,
1093,
25146,
20,
5717,
309,
365,
18,
2722,
3645,
1369,
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,
1089,
67,
1925,
12,
2890,
4672,
1122,
1369,
273,
509,
12,
2890,
18,
955,
18,
1615,
2932,
36,
20,
16,
20,
20387,
4939,
2668,
1093,
25146,
20,
5717,
309,
365,
18,
2722,
3645,
1369,
422,
... | |
if os.name !='riscos': TESTFN = '@test' | if os.name == 'java': TESTFN = '$test' elif os.name != 'riscos': TESTFN = '@test' | def fcmp(x, y): # fuzzy comparison function if type(x) == type(0.0) or type(y) == type(0.0): try: x, y = coerce(x, y) fuzz = (abs(x) + abs(y)) * FUZZ if abs(x-y) <= fuzz: return 0 except: pass elif type(x) == type(y) and type(x) in (type(()), type([])): for i in range(min(len(x), len(y))): outcome = fcmp(x[i], y[i]) if outcome != 0: return outcome return cmp(len(x), len(y)) return cmp(x, y) | 559f6680c27f346c89e6dd29ba3235f7719ea6a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/559f6680c27f346c89e6dd29ba3235f7719ea6a7/test_support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8036,
1291,
12,
92,
16,
677,
4672,
468,
21315,
5826,
445,
309,
618,
12,
92,
13,
422,
618,
12,
20,
18,
20,
13,
578,
618,
12,
93,
13,
422,
618,
12,
20,
18,
20,
4672,
775,
30,
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,
8036,
1291,
12,
92,
16,
677,
4672,
468,
21315,
5826,
445,
309,
618,
12,
92,
13,
422,
618,
12,
20,
18,
20,
13,
578,
618,
12,
93,
13,
422,
618,
12,
20,
18,
20,
4672,
775,
30,
619,
... |
while ((tokenType=tokenizer.peek(True)) != CASE && tokenType != DEFAULT && | while ((tokenType=tokenizer.peek(True)) != CASE and tokenType != DEFAULT && | def Statement(tokenizer, compilerContext) { var i, label, node, childNode, ss, tokenType = tokenizer.get(True) var builder = compilerContext.builder | 58afad4d3cade0a037f53f0a04cb23589df417b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/58afad4d3cade0a037f53f0a04cb23589df417b1/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8056,
12,
2316,
1824,
16,
5274,
1042,
13,
288,
569,
277,
16,
1433,
16,
756,
16,
9465,
16,
5202,
16,
22302,
273,
10123,
18,
588,
12,
5510,
13,
569,
2089,
273,
5274,
1042,
18,
9574,
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,
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,
8056,
12,
2316,
1824,
16,
5274,
1042,
13,
288,
569,
277,
16,
1433,
16,
756,
16,
9465,
16,
5202,
16,
22302,
273,
10123,
18,
588,
12,
5510,
13,
569,
2089,
273,
5274,
1042,
18,
9574,
2,... |
By default, smtplib.SMTP_PORT is used. | By default, smtplib.SMTP_PORT is used. An SMTPConnectError is raised if the specified `host' doesn't respond correctly. | def __init__(self, host = '', port = 0): """Initialize a new instance. | df0320a7ccf9b73e33c7b9b5d44674b3de8ddb2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df0320a7ccf9b73e33c7b9b5d44674b3de8ddb2a/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
374,
4672,
3536,
7520,
279,
394,
791,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
374,
4672,
3536,
7520,
279,
394,
791,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.cached = True | print "MAL::list_sms::gen_cache" | def gen_cache(messages): self.cached = True for sms in messages: self._add_sms(sms) | 0df839882452fcc842577820f3437a134890d4e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12036/0df839882452fcc842577820f3437a134890d4e6/sms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
2493,
12,
6833,
4672,
1172,
315,
49,
1013,
2866,
1098,
67,
20984,
2866,
4507,
67,
2493,
6,
364,
16188,
316,
2743,
30,
365,
6315,
1289,
67,
20984,
12,
20984,
13,
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,
3157,
67,
2493,
12,
6833,
4672,
1172,
315,
49,
1013,
2866,
1098,
67,
20984,
2866,
4507,
67,
2493,
6,
364,
16188,
316,
2743,
30,
365,
6315,
1289,
67,
20984,
12,
20984,
13,
2,
-100,
-100... |
s = xmlrpclib.Server("http://%s:%d" % (host, port), allow_none=True) | t = BBTransport() s = xmlrpclib.Server("http://%s:%d/" % (host, port), transport=t, allow_none=True) | def registerEventHandler(self, host, port): """ Register a remote UI Event Handler """ s = xmlrpclib.Server("http://%s:%d" % (host, port), allow_none=True) return bb.event.register_UIHhandler(s) | b9617bf6e15fe75f850fe5644eea4b7f04eed792 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/b9617bf6e15fe75f850fe5644eea4b7f04eed792/xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
16402,
12,
2890,
16,
1479,
16,
1756,
4672,
3536,
5433,
279,
2632,
6484,
2587,
4663,
3536,
268,
273,
21752,
6568,
1435,
272,
273,
2025,
13832,
830,
495,
18,
2081,
2932,
2505,
23155,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
16402,
12,
2890,
16,
1479,
16,
1756,
4672,
3536,
5433,
279,
2632,
6484,
2587,
4663,
3536,
268,
273,
21752,
6568,
1435,
272,
273,
2025,
13832,
830,
495,
18,
2081,
2932,
2505,
23155,
... |
'UNICODE': ('ref/strings', 'encodings unicode TYPES STRING'), | 'UNICODE': ('ref/strings', 'encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES'), | def writedocs(dir, pkgpath='', done=None): """Write out HTML documentation for all modules in a directory tree.""" if done is None: done = {} for file in os.listdir(dir): path = os.path.join(dir, file) if ispackage(path): writedocs(path, pkgpath + file + '.', done) elif os.path.isfile(path): modname = inspect.getmodulename(path) if modname: if modname == '__init__': modname = pkgpath[:-1] # remove trailing period else: modname = pkgpath + modname if modname not in done: done[modname] = 1 writedoc(modname) | 608e36211ec60e3709b8dc3cca74f40cedae1bae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/608e36211ec60e3709b8dc3cca74f40cedae1bae/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
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,
2518,
329,
22280,
12,
1214,
16,
3475,
803,
2218,
2187,
2731,
33,
7036,
4672,
3536,
3067,
596,
3982,
7323,
364,
777,
4381,
316,
279,
1867,
2151,
12123,
309,
2731,
353,
599,
30,
2731,
273,... |
in time. If n stpes is not provided, or evaluates to ``None``, ``inf`` or ``NaN``, ``scan`` will figure out the amount of | in time. If ``n_steps`` is not provided, or evaluates to ``None``, ``inf`` or ``NaN``, then ``scan`` will figure out the amount of | def scan( fn , sequences = None , outputs_info = None , non_sequences = None , n_steps = None , truncate_gradient = -1 , go_backwards = False , mode = None , name = None ): """ This function constructs and applies a Scan op to the provided arguments. :param fn: ``fn`` is a function that describes the operations involved in one step of ``scan``. ``fn`` should construct variables describing the output of one iteration step. It should expect as input theano variables representing all the time slices of the input sequences and outputs, and all other arguments given to scan as ``non_sequences``. The order in which scan passes this variables to ``fn`` is the following : * all time slices of the first sequence * all time slices of the second sequence * ... * all time slices of the last sequence * all time slices of the first output * all time slices of the second otuput * ... * all time slices of the last output * all other arguments (the list given as `non_sequences` to scan) The order of the sequences is the same as the one in the list `sequences` given to scan. The order of the outputs is the sane as the order of ``output_info``. For any sequence or output the order of the time slices is the same as the order of the time taps provided. For example if one writes the following : .. code-block:: python scan(fn, sequences = [ dict( Sequence1, taps = [-3,2,-1]) , Sequence2 , dict( Sequence3, taps = 3) ] , outputs_info = [ dict( Output1, taps = [-3,-5]) , dict( Output2, taps = None) , Output3 ] , non_sequences = [ Argument1, Argument 2]) ``fn`` should expect the following arguments in this given order: #. ``Sequence1[t-3]`` #. ``Sequence1[t+2]`` #. ``Sequence1[t-1]`` #. ``Sequence2[t]`` #. ``Sequence3[t+3]`` #. ``Output1[t-3]`` #. ``Output1[t-5]`` #. ``Output3[t-1]`` #. ``Argument1`` #. ``Argument2`` The list of ``non_sequences`` can also contain shared variables used in the function, though ``scan`` is able to figure those out on its own so they can be skipped. For the clarity of the code we recommand though to provide them to scan. The function is expected to return two things. One is a list of outputs ordered in the same order as ``outputs_info``, with the difference that there should be only one output variable per output initial state (even if no tap value is used). Secondly `fn` should return an update dictionary ( that tells how to update any shared variable after each iteration ste). The dictionary can optionally be given as a list of tuples. There is no constraint on the order of these two list, ``fn`` can return either ``(outputs_list, update_dictionary)`` or ``(update_dictionary, outputs_list)`` or just one of the two (in case the other is empty). :param sequences: ``sequences`` is the list of Theano variables or dictionaries describing the sequences ``scan`` has to iterate over. If a sequence is given as wrapped in a dictionary a set of optional information can be provided about the sequence. The dictionary should have the following keys: * ``input`` (*mandatory*) -- Theano variable representing the sequence. * ``taps`` -- Temporal taps of the sequence required by ``fn``. They are provided as a list of integers, where a value ``k`` impiles that at iteration step ``t`` scan will pass to ``fn`` the slice ``t+k``. Default value is ``[0]`` Any Theano variable in the list ``sequences`` is automatically wrapped into a dictionary where ``taps`` is set to ``[0]`` :param outputs_info: ``outputs_info`` is the list of Theano variables or dictionaries describing the initial state of the outputs computed recurrently. When this initial states are given as dictionary optional information can be provided about the output corresponding to these initial states. The dictionary should have the following keys: * ``initial`` -- Theano variable that represents the initial state of a given output. In case the output is not computed recursively (think of a map) and does not require a initial state this field can be skiped. Given that only the previous time step of the output is used by ``fn`` the initial state should have the same shape as the output. If multiple time taps are used, the initial state should have one extra dimension that should cover all the possible taps. For example if we use ``-5``, ``-2`` and ``-1`` as past taps, at step 0, ``fn`` will require (by an abuse of notation) ``output[-5]``, ``output[-2]`` and ``output[-1]``. This will be given by the initial state, which in this case should have the shape (5,)+output.shape. If this variable containing the initial state is called ``init_y`` then ``init_y[0]`` *corresponds to* ``output[-5]``. ``init_y[1]`` *correponds to* ``output[-4]``, ``init_y[2]`` corresponds to ``output[-3]``, ``init_y[3]`` coresponds to ``output[-2]``, ``init_y[4]`` corresponds to ``output[-1]``. While this order might seem strange, it comes natural from splitting an array at a given point. Assume that we have a array ``x``, and we choose ``k`` to be time step ``0``. Then our initial state would be ``x[:k]``, while the output will be ``x[k:]``. Looking at this split, elements in ``x[:k]`` are ordered exactly like those in ``init_y``. * ``taps`` -- Temporal taps of the output that will be pass to ``fn``. They are provided as a list of *negative* integers, where a value ``k`` implies that at iteration step ``t`` scan will pass to ``fn`` the slice ``t+k``. * ``inplace`` -- One of the Theano variables provided as ``sequences``. ``scan`` will try to compute this output *in place* of the provided input *iff* it respects the following constraints: * There is no other output that is denied to be computed in place for whatever reason. * ``fn`` is not using past taps of the input sequence that will get overwritten by the output * ``return_steps`` -- Integer representing the number of steps to return for the current steps. For example, if ``k`` is provided, ``scan`` will return ``output[-k:]``. This is meant as a hint, based on ``k`` and the past taps of the outputs used, scan can be smart about the amount of memory it requires to store intermidiate results. If not given, or ``0``, ``scan`` will return all computed steps. * ``store_steps`` -- Integer representing the number of intermidiate steps ``scan`` should use for a given output. Use this key only if you really know what you are doing. In general is recommendat to let scan decide for you the ammount of memory it should use. ``scan`` will follow this logic if partial information is given: * If an output is not wrapped in a dictionary, ``scan`` will wrap it in one assuming that you use only the last step of the output (i.e. it makes your tap value list equal to [-1]) and that it is not computed inplace. * If you wrap an output in a dictionary and you do not provide any taps but you provide an initial state it will assume that you are using only a tap value of -1. * If you wrap an output in a dictionary but you do not provide any initial state, it assumes that you are not using any form of taps. * If you provide a ``None`` instead of a variable or a dictionary ``scan`` assumes that you will not use any taps for this output (like for example in case of a map) If ``outputs_info`` is an empty list or None, ``scan`` assumes that no tap is used for any of the otuputs. If information is provided just for a subset of the outputs an exception is raised (because there is no convention on how scan should map the provided information to the outputs of ``fn``) :param non_sequences: ``non_sequences`` is the list of arguments that are passed to ``fn`` at each steps. Once can opt to exclude shared variables used in ``fn`` from this list. :param n_steps: ``n_steps`` is the number of steps to iterate given as an int or Theano scalar. If any of the input sequences do not have enough elements, scan will produce a warning and run only for the maximal amount of steps it can. If the *value is 0* the outputs will have *0 rows*. If the value is negative, ``scan`` run backwards in time. If the ``go_backwards`` flag is already set and also ``n_steps`` is negative, ``scan`` will run forward in time. If n stpes is not provided, or evaluates to ``None``, ``inf`` or ``NaN``, ``scan`` will figure out the amount of steps it should run given its input sequences. :param truncate_gradient: ``truncate_gradient`` is the number of steps to use in truncated BPTT. If you compute gradients through a scan op, they are computed using backpropagation through time. By providing a different value then -1, you choose to use truncated BPTT instead of classical BPTT, where you go for only ``truncate_gradient`` number of steps back in time. :param go_backwards: ``go_backwards`` is a flag indicating if ``scan`` should go backwards through the sequences. If you think of each sequence as indexed by time, making this flag True would mean that ``scan`` goes back in time, namely that for any sequence it starts from the end and goes towards 0. :param name: When profiling ``scan`` it is crucial to provide a name for any instance of ``scan``. The profiler will produce an overall profile of your code as well as profiles for doing one iteration step for each instance of ``scan``. The ``name`` of the instance is how you differentiate between all these profiles. :param mode: It is recommended to leave this argument to None, especially when profiling ``scan`` (otherwise the results are not going to be accurate). If you prefer the computations of one step os ``scan`` to be done differently then the entire function set this parameters (see ``theano.function`` for details about possible values and their meaning). :rtype: tuple :return: tuple of the form (outputs, updates); ``outputs`` is either a Theano variable or a list of Theano variables representing the outputs of ``scan`` (in the same order as in ``outputs_info``). ``updates`` is a dictionary specifying the update rules for all shared variables used in the scan operation. This dictionary should be passed to ``theano.function`` when you compile your function. """ # General observation : this code is executed only once, at creation # of the computational graph, so we don't yet need to be smart about # anything ( to speed things up) # check if inputs are just single variables instead of lists if not (type(sequences) in (list, tuple)) and sequences != None: seqs = [sequences] elif sequences == None: seqs = [] else: seqs = sequences if not (type(outputs_info) in (list,tuple)) and outputs_info != None: outs_info = [outputs_info] elif outputs_info == None: outs_info = [] else: outs_info = outputs_info if ( not (type(non_sequences) in (list,tuple)) and non_sequences != None): non_seqs = [non_sequences] elif non_sequences == None: non_seqs = [] else: non_seqs = non_sequences # If we provided a known number of steps ( before compilation) # and if that number is 1 or -1, then we can skip the Scan Op, # and just apply the inner function once # To do that we check here to see the nature of n_steps if type(n_steps) in (float,int): n_fixed_steps = int(n_steps) else: # also check if this value happens to be a constant, # then we could do the same try : n_fixed_steps = opt.get_constant_value(n_steps) except: n_fixed_steps = None # compute number of sequences and number of outputs n_seqs = len(seqs) n_outs = len(outs_info) # initialize the inplace map, sequences map and # outputs map ''' Details: The scan op identifies different properties attached to input tensors by their order in the input list. These maps ( inplace, sequence_taps, output_taps, store_steps, return_steps) go from the index of an input to its properties. Note that inputs are always first, followed by outputs. Since we always know the number of inputs we index the outputs from 0 ( so sometimes you will need to do something like outputs_taps[i-n_ins] ''' inplace_map = {} sequences_taps = {} outputs_taps = {} # Assume that for any output we want to store everythin that it produces store_steps = [] return_steps = {} # wrap sequences in a dictionary if they are not already dictionaries # in the same pass create a sequences_taps dictionary for i in xrange(n_seqs): if not type(seqs[i]) == dict : # if it is not a dictionary make it into one seqs[i] = dict(input=seqs[i], taps=[0]) # see if taps values are provided as a list elif seqs[i].get('taps',None): # users can optionally provide the past value (if is just # one) as a number instead of a list. Wrap it in a list # to have a uniform way of dealing with inputs later on if not type(seqs[i]['taps']) in (tuple,list): seqs[i]['taps'] = [seqs[i]['taps']] else: # See if the user actually provided the None value to taps, # which would indicate that the sequence was provided but # not used by the internal function; Only if the user has # not provided anything add the defaul [0] # Possible reason to provide a squence and not use it is # if you want to compute the output # inplace of this input; it is a very unlikely behaviour but # we do want to cover it for completeness if not seqs[i].has_key('taps'): seqs[i][taps] = [0] # Now that our input is well behaved, collect the taps in the # sequences_taps map that we will use later in the body of scan # since inputs will be just tensors there if seqs[i].get('taps',None): sequences_taps[i] = seqs[i]['taps'] # wrap outputs info in a dictionary if they are not already # in one and in the same pass create a init_outs_taps dictionary and a inplace map for i in xrange(n_outs): if outs_info[i]: # If output is a dictionary, collect the number of steps the # user would like scan to return if type(outs_info[i]) == dict: if outs_info[i].get('return_steps', None): return_steps[i] = outs_info[i]['return_steps'] # If you provide the number of steps to store internally, # (not advocated in the user documentation), then also # make sure you are returning only those number of steps if outs_info[i].get('store_steps', None): store_steps += [outs_info[i].get('store_steps',None)] return_steps[i] = outs_info[i].get('store_steps',None) else: store_steps += [0] else: store_steps += [0] # trying to collect taps of the output if not type(outs_info[i]) == dict: # by default any output has a tap value of -1 outs_info[i] = dict(initial=outs_info[i], taps = [-1]) # if there is no initial state but there are taps # then return an error because it makes no sense elif (not outs_info[i].get('initial',None)) and \ (outs_info[i].get('taps',None)): raise ValueError('If you are using slices of an output you need to '\ 'provide a initial state for it', outs_info[i]) # if there is an intial state but no tap, we will add the default value # for taps, namely [-1] ( previous value); not that this will happen # even though you have provided for taps the value None, which is a bit # strange (why would one provide an initial state but tell scan not to # use it ? ), just that in that case we will throw in a warning message # pointing out this inconsistency elif outs_info[i].get('initial',None) and \ ( not outs_info[i].get('taps',None)): if outs_info[i].has_key('taps'): warning('You are providing a initial state for an output and then ' 'tell scan not to use it. Why? Scan will overwrite this setting' ' and use the previous value of the provided initial state. If' ' this is not what you wanted, check your code and do not ' 'provide the initial state') outs_info[i]['taps'] = [-1] else: # if the output is a None then replace it with an empty dictionary for # easing up dealing with this case later one ( we can directly call .has_key # and things like this outs_info[i] = dict() store_steps += [0] if outs_info[i].get('taps', None): # Create a separate outputs_taps dictionary with all the outputs taps; This # is how the Scan Op expects this information, separeted from the variables outputs_taps[i] = outs_info[i]['taps'] if outs_info[i].get('inplace', None): # The same is true for the inplace info; it has to go into a separate # dictionary based on index; Note that the input we're replacing should also # come as an index, therefore we have to look for it at this point found = None for k in xrange(n_seqs): if seqs[k].get('input', None) == outs_info[i].get('inplace',None): found = k if found != None: # NOTE : inplace_map is identical to destroy_map, i.e. it tells what # output is computed inplace of what input !! inplace_map[i] = found else: raise ValueError('Asked to compute in place of a non-input variable',\ outs_info[i].get('inplace', None)) # create theano inputs for the recursive function # note : this is a first batch of possible inputs that will # be compiled in a dummy function; we used this dummy # function to detect shared variables and their updates # and to construct a new and complete list of inputs and outputs args = [] # list of arguments dummy_notshared_ins = 0 # number of arguments corresponding to input seqs dummy_notshared_init_outs = 0 # number of arguments corresponding to output seqs slice_to_seqs = [] # for each slice index of the corresponding input # go through sequences picking up time slices as needed for i,seq in enumerate(seqs): # Note that you can have something like no taps for # a sequence, though is highly unlikely in practice if seq.get('taps', None): # go through the indicated slice mintap = numpy.min(seq['taps']) for k in seq['taps']: # create one slice of the input ''' Later on, if we decide not to use scan because we are going for just one step, it makes things easier if we compute the correct outputs here. This way we can use the output of the lambda expression directly to replace the output of scan. If not we need to use copies, that will be replaced at each frame by the corresponding slice ''' if n_fixed_steps not in [1,-1]: nw_slice = seq['input'][0].type() elif n_fixed_steps == 1: nw_slice = seq['input'][k-mintap] else: nw_slice = seq['input'][-1+mintap-k] # Add names to slices for debugging and pretty printing .. # that is if the input already has a name if seq['input'].name: if seq['taps'][k] > 0: nw_slice.name = seq['input'].name + '[t+%d]'%seq['taps'][k] elif seq['taps'][k] == 0: nw_slice.name = seq['input'].name + '[t]' else: nw_slice.name = seq['input'].name + '[t%d]'%seq['taps'][k] args.append(nw_slice) # Specify to whom this slice belongs slice_to_seqs.append(i) # Any slice is not a shared variable, even though the sequence # from where we pick the slices is shared, therefore we should # increase the number of notshared inputs to the dummy function # by the number of slices dummy_notshared_ins += len(seq['taps']) # go through outputs picking up time slices as needed for i,init_out in enumerate(outs_info): # Note that our convention dictates that if an output uses # just the previous time step, as a initial state we will only provide # a tensor of the same dimension as one time step; This makes code # much cleaner for those who do not use taps. Otherwise they would # always had to shape_pad_left the initial state .. which is ugly if init_out.get('taps', None) == [-1]: if n_fixed_steps in [-1,1]: args += [init_out['initial']] else: args += [init_out['initial'].type()] # Added name to slices for debugging and pretty printing if init_out['initial'].name: args[-1].name = init_out['initial'].name+'[t-1]' # we need to specify in slice_seqs to which output this # slice belongs; Because we might get confused afterwards # if a number is an index of a sequence or an output, and # because we do not want to create yet another list, we will # add the number of sequences + the current output. This makes # decoding easy and spares us from writing a lot of lines slice_to_seqs += [ i+n_seqs ] dummy_notshared_init_outs += 1 elif init_out.get('taps',None): if numpy.any(numpy.array(init_out.get('taps',[])) > 0): # Make sure we do not have requests for future values of a sequence # we can not provide such values raise ValueError('Can not use future taps of outputs', init_out) # go through the taps minstep = abs(numpy.min(init_out['taps'])) for k in init_out['taps']: # create a new slice if n_fixed_steps in [1,-1]: nw_slice = init_out['initial'][k+minstep] else: nw_slice = init_out['initial'][0].type() # give it a name or debugging and pretty printing if init_out['initial'].name: if k > 0: nw_slice.name = init_out['initial'].name + '[t+%d]'%k elif k == 0: nw_slice.name = init_out['initial'].name + '[t]' else: nw_slice.name = init_out['initial'].name + '[t%d]'%k args.append(nw_slice) # indicate the output index + n_seqs ( see above why) slice_to_seqs.append(i + n_seqs) # add as many slices as there are taps dummy_notshared_init_outs += len(init_out['taps']) #NOTE: there is another case, in which we do not want to provide any previous # value of the output to the inner case; in this case we do not have to do # anything .. # remove shared variables from the non sequences list # such that we can compile the function ( the user has the option to add them when # writing scan, because in some situations this might make the code more readable) notshared_other_args = [] for non_seq in non_seqs: if not isinstance(non_seq, SharedVariable): notshared_other_args += [non_seq] # add only the not shared variables to the arguments of the dummy # function [ a function should not get shared variables as input ] dummy_args = [] for arg in args: if not isinstance(arg, SharedVariable): dummy_args += [arg] dummy_args += notshared_other_args # arguments for the lambda expression that gives us the output # of the inner function args += non_seqs # when we apply the lambda expression we get a mixture of update rules # and outputs that needs to be separated outputs_updates = fn(*args) # The code that follows tries to be as flexible as possible allowing the # user to return the output and updates in any order, and giving the updates # however he wants ( as a dictionary or a list o pairs ..) # Is there a way to compress all this by writing it in a more python/functional way? outputs = [] updates = {} # we will try now to separate the outputs from the updates if not type(outputs_updates) in (list,tuple): if type(outputs_updates) == dict : # we have just an update dictionary updates = outputs_updates else: outputs = [outputs_updates] else: elem0 = outputs_updates[0] elem1 = outputs_updates[1] t_el0 = type(elem0) t_el1 = type(elem1) if t_el0 == dict or ( t_el0 in (list,tuple) and type(elem0[0]) in (list,tuple)): # elem0 is the updates dictionary / list updates = elem0 outputs = elem1 if not type(outputs) in (list,tuple): outputs = [outputs] elif ( type(elem1) == dict) or \ ( type(elem1) in (list,tuple) and type(elem1[0]) in (list,tuple)): # elem1 is the updates dictionary / list updates = elem1 outputs = elem0 if not type(outputs) in (list,tuple): outputs = [outputs] else : if type(outputs_updates) in (list,tuple) and \ (type(outputs_updates[0]) in (list,tuple)): outputs = [] updates = outputs_updates else: outputs = outputs_updates updates = {} # in case you return a tuple .. convert it to a list (there are certain # operation that are not permited on tuples, like element assignment) outputs = list(outputs) # If you return numbers (highly unlikely) this will not go well for theano # We need to convert them to Theano constants for i,out in enumerate(outputs): outputs[i] = tensor.as_tensor(out) # We can now compile a dummy function just to see what shared variable # we have and what are their update rules (note that the user has # the option not to pass the shared variable to scan, so we need to # pick them manually and add them to scan) # make the compilation as fast as possible by not applying any optimization # or conversion to C [ note this region is not important for performance # so we can do stuff as unoptimal as we wish ] if n_fixed_steps in [-1,1]: ''' We do have a special case here, namely is so might happen that whatever we have in dummy_args is not sufficient to compile the function( i.e. missing inputs). Furthermore we might not even need to compile the function here for this special case. But due to the way I wrote the code is easier to have a compiled function here that I can ignore later. Plus it is easier this way to take care of shared variables with non-default updates. Therefore only for this case I need to use gof.graph.inputs to look for the real inputs so that I can compile the function. RP ''' dummy_f = function(filter(lambda x: isinstance(x, gof.Variable) and \ not isinstance(x,SharedVariable) and not isinstance(x,gof.Constant), \ gof.graph.inputs(dummy_args)), outputs, updates = updates, mode = compile.mode.Mode(linker='py',optimizer=None)) else: dummy_f = function(filter(lambda x: isinstance(x, gof.Variable) and \ not isinstance(x,SharedVariable) and not isinstance(x,gof.Constant), \ dummy_args), outputs, updates = updates, mode = compile.mode.Mode(linker='py',optimizer=None)) # We now look at what outputs our function returns inner_fn_outs = [ out.variable for out in dummy_f.maker.outputs] update_map = {} shared_outs = [] shared_non_seqs = [] givens = {} # if the number of outputs to the function does not match the number of # assumed outputs until now (provided by the initial case) there can be # only one explanation that we now how to deal with. Namely no information # is provided for any outputs which will indicate that we deal with a map, # i.e. we never use previous values of outputs if len(inner_fn_outs) != n_outs: if outs_info == []: # We know how to deal with this case, assume that none of the outputs # are required to have any sort of time taps # we just need to update the number of actual outputs n_outs = len(inner_fn_outs) # other updates : for i in xrange(n_outs): outs_info += [ dict() ] # we also need to re-initialize the store_steps list to match the # number of outputs store_steps = [ 0 for i in xrange(n_outs)] else: # Otherwise there is a bit of confusion, since Scan works on the index of # a sequence /output. There are maybe corner cases that could be added here # or defult behaviour ( like always add the extra outputs at the end !?) # But I did not bother implementing this, I leave it to the user to clearly # express what he/she wants to do raise ValueError('Scan is totally lost. Make sure that you indicate for each' ' output what taps you want to use, or None, if you do not want to' ' use any !') inner_fn_inputs=[input.variable for input in \ dummy_f.maker.expanded_inputs[:dummy_notshared_ins+dummy_notshared_init_outs]] # Keep track of the range (place) where you insert shared variables with updates # Because we will not be able to compute the gradient with respect to those variables # inner_fn_notshared_ins_idx is from where these shared variables with updates start inner_fn_notshared_ins_idx = dummy_notshared_ins + dummy_notshared_init_outs # Because scan is particularly sensitive at the order in which it gets its # arguments, we need to separete the shared variables that act as outputs # from those that are not outputs of the network as well n_extended_outs = n_outs # Skip the slices that we've added to the inner_fn which will be the first elements # of f.maker.epanded_inputs and which we know that are not shared fromIdx = dummy_notshared_ins + dummy_notshared_init_outs copy_map = {} for input in dummy_f.maker.expanded_inputs[fromIdx:] : # If input is a shared variable that gets updated, then # this shared variable will be an output of our inner function if isinstance(input.variable, SharedVariable) and input.update: # Create a copy of it new_var = input.variable.type() if input.variable.name: new_var.name = input.variable.name + '_copy' copy_map[new_var] = input.variable inner_fn_inputs.append(new_var) # add it to the slices at the end slice_to_seqs += [ n_extended_outs ] inner_fn_outs += [input.update] update_map[ input.variable ] = n_extended_outs # We know that we only have access to the last step outputs_taps[ n_extended_outs ] = [-1] n_extended_outs += 1 # we shouldn't try to store more then the last step # this might not even be a tensor ! ( RandomState ) store_steps += [1] return_steps[n_extended_outs -1] = 1 shared_outs += [input.variable] givens[input.variable] = inner_fn_inputs[-1] # inner_fn_shared_ins_idx stores where we stop having shared variables with updates inner_fn_shared_ins_idx = len(inner_fn_inputs) - inner_fn_notshared_ins_idx # Now that we took out the shared variables that have an update rule # we need to take care of all the other shared variables for input in dummy_f.maker.expanded_inputs[fromIdx:] : # make sure that we do not add the same shared variable twice if isinstance(input.variable, SharedVariable) and not input.update: shared_non_seqs += [input.variable] new_var = input.variable.type() if input.variable.name: new_var.name = input.variable.name + '_copy' inner_fn_inputs += [new_var] slice_to_seqs += [ n_extended_outs] givens[input.variable] = inner_fn_inputs[-1] copy_map[inner_fn_inputs[-1]] = input.variable elif not isinstance(input.variable, SharedVariable): # also add the normal tensor that are non sequences at the # end of the inputs intertwingled with the shared variables inner_fn_inputs.append(input.variable) # If we haven't provided a number of steps nor did we provide a sequence # scan will not know how long to iterate if (n_steps == None or n_steps == numpy.inf or n_steps == numpy.nan) and n_seqs == 0 : raise ValueError('Scan does not know for how many steps to iterate. ' 'You need to provide the number of steps through the ' ' ``n_steps`` argument if you do not iterate over any sequence') # We can now create the Scan Op Object if n_fixed_steps not in [1,-1]: if n_steps != None: n_steps = tensor.as_tensor(n_steps) else: n_steps = gof.Constant(gof.generic, 'unknown', '?_steps') local_op = Scan( (inner_fn_inputs,inner_fn_outs, givens, slice_to_seqs ), n_seqs, n_extended_outs, inplace_map, sequences_taps, outputs_taps, n_steps,truncate_gradient, # n_outs, inner_fn_notshared_ins_idx and inner_fn_shared_ins_idx are used by the gradient # to figure out where in the input are shared variables with updates, for whom I can't compute # a gradient n_outs, inner_fn_notshared_ins_idx, inner_fn_shared_ins_idx, go_backwards, store_steps, return_steps, mode, name = name ) # Shortcut for attaching this property to the Scan op local_op.copy_map = copy_map # Call the object on the input sequences, initial values for outs, # and non sequences for seq in seqs : if not seq.get('input', None): raiseValue('All input sequences should provide') unwrapped_seqs = [ seq.get('input',tensor.as_tensor(0.)) for seq in seqs ] unwrapped_outs = [ out.get('initial',tensor.as_tensor(0.)) for out in outs_info ] values = local_op( *( [n_steps] + unwrapped_seqs + unwrapped_outs + shared_outs + notshared_other_args + shared_non_seqs)) else: # If we do not actually need scan for pos, inner_out in enumerate(inner_fn_outs): if isinstance(inner_out.type, tensor.TensorType) and store_steps[pos] != 1: inner_fn_outs[pos] = tensor.unbroadcast( tensor.shape_padleft(inner_out),0) values = inner_fn_outs if not type(values) in (tuple, list): values = [values] # take out the updates of shared variable and build the dictionary # that tells what to update and with what value for val in update_map.keys(): update_map[val] = values [ update_map[val] ] # Now we need to check the values returned # if it just one strip the list around it if n_outs == 1: # if we need to return just one step or several steps # note that when we return one step we have two cases, in # the first one store_steps is set to 1, case in which we don't # need to take a slice of the output (is already of the right # dimension) and case 2 when we store more then one step, # and we actually need to take a slice if return_steps.has_key(0): if return_steps[0] > 1: values = values[0][-return_steps[0]:] else: if store_steps[0] == 1: values = values[0] else: values = values[0][-1] else: values = values[0] else: values = values[:n_outs] for idx,val in enumerate(values): if return_steps.has_key(idx): if return_steps[idx] > 1: values[idx] = val[-return_steps[idx]:] else: if store_steps[idx] == 1: values[idx] = val else: values[idx] = val[-1] return (values, update_map) | f2d65b5f1543549d0ee82f56a5380a255723c639 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/f2d65b5f1543549d0ee82f56a5380a255723c639/scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4135,
12,
2295,
269,
8463,
540,
273,
599,
269,
6729,
67,
1376,
1377,
273,
599,
269,
1661,
67,
17190,
377,
273,
599,
269,
290,
67,
8986,
6647,
273,
599,
269,
10310,
67,
20219,
273,
300,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4135,
12,
2295,
269,
8463,
540,
273,
599,
269,
6729,
67,
1376,
1377,
273,
599,
269,
1661,
67,
17190,
377,
273,
599,
269,
290,
67,
8986,
6647,
273,
599,
269,
10310,
67,
20219,
273,
300,... |
timestamp_file.write( '%f' % time.mktime( timestamp ) ) | timestamp_file.write( '%f' % timestamp ) | def make_tarball( working_dir , tag , user , site_dir ): sources_dir = os.path.join( working_dir, 'boost' ) if os.path.exists( sources_dir ): utils.log( 'Directory "%s" already exists, cleaning it up...' % sources_dir ) rmtree( sources_dir ) try: os.mkdir( sources_dir ) utils.log( 'Exporting files from CVS...' ) cvs_export( working_dir, user, tag ) except: utils.log( 'Cleaning up...' ) rmtree( sources_dir ) raise timestamp = time.gmtime() timestamped_dir_name = 'boost-%s-%s' % ( tag, time.strftime( '%y-%m-%d-%H%M', timestamp ) ) timestamped_dir = os.path.join( working_dir, timestamped_dir_name ) utils.log( 'Renaming "%s" to "%s"...' % ( sources_dir, timestamped_dir ) ) os.rename( sources_dir, timestamped_dir ) tarball_name = 'boost-%s.tar.bz2' % tag tarball_path = os.path.join( working_dir, tarball_name ) utils.log( 'Archiving "%s" to "%s"...' % ( timestamped_dir, tarball_path ) ) tar = tarfile.open( tarball_path, 'w|bz2' ) tar.posix = False # see http://tinyurl.com/4ebd8 tar.add( timestamped_dir, timestamped_dir_name ) tar.close() tarball_timestamp_path = os.path.join( working_dir, 'boost-%s.timestamp' % tag ) timestamp_file = open( tarball_timestamp_path, 'w' ) timestamp_file.write( '%f' % time.mktime( timestamp ) ) timestamp_file.close() if site_dir is not None: utils.log( 'Moving "%s" to the site location "%s"...' % ( tarball_name, site_dir ) ) shutil.move( tarball_path, site_dir ) shutil.move( tarball_timestamp_path, site_dir ) utils.log( 'Removing "%s"...' % timestamped_dir ) rmtree( timestamped_dir ) | 715a04f7e41918ae4542875df1d445989b292a51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/715a04f7e41918ae4542875df1d445989b292a51/make_snapshot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
88,
23846,
12,
5960,
67,
1214,
269,
1047,
269,
729,
269,
2834,
67,
1214,
262,
30,
225,
5550,
67,
1214,
273,
1140,
18,
803,
18,
5701,
12,
5960,
67,
1214,
16,
296,
25018,
11,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
88,
23846,
12,
5960,
67,
1214,
269,
1047,
269,
729,
269,
2834,
67,
1214,
262,
30,
225,
5550,
67,
1214,
273,
1140,
18,
803,
18,
5701,
12,
5960,
67,
1214,
16,
296,
25018,
11,... |
util.format_time(sum([t.get("~ | util.format_time(sum([t("~ | def format(self): return "<b>%s</b>\n<small>%s (%s)</small>" % ( util.escape(self.name), ngettext("%d song", "%d songs", len(self)) % len(self), util.format_time(sum([t.get("~#length") for t in self if isinstance(t, AudioFile)]))) | 81939722ed9c4d581625f426c7279b7f655d4fdb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4764/81939722ed9c4d581625f426c7279b7f655d4fdb/playlists.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
4672,
327,
3532,
70,
9822,
87,
1757,
70,
5333,
82,
32,
12019,
9822,
87,
6142,
87,
13,
1757,
12019,
2984,
738,
261,
1709,
18,
6939,
12,
2890,
18,
529,
3631,
290,
29967,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4672,
327,
3532,
70,
9822,
87,
1757,
70,
5333,
82,
32,
12019,
9822,
87,
6142,
87,
13,
1757,
12019,
2984,
738,
261,
1709,
18,
6939,
12,
2890,
18,
529,
3631,
290,
29967,
... |
authaddr = straddr( ('',authaddr) ) | authaddr = " <%s>" % straddr( ('',authaddr) ) | def send_message(self, nodeid, msgid, note, sendto): '''Actually send the nominated message from this node to the sendto recipients, with the note appended. ''' users = self.db.user messages = self.db.msg files = self.db.file | ead73ce4bcd111ad77f18bada67a079c960a728b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ead73ce4bcd111ad77f18bada67a079c960a728b/roundupdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2150,
12,
2890,
16,
756,
350,
16,
24389,
16,
4721,
16,
1366,
869,
4672,
9163,
2459,
3452,
1366,
326,
12457,
7458,
883,
628,
333,
756,
358,
326,
1366,
869,
12045,
16,
598,
326... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2150,
12,
2890,
16,
756,
350,
16,
24389,
16,
4721,
16,
1366,
869,
4672,
9163,
2459,
3452,
1366,
326,
12457,
7458,
883,
628,
333,
756,
358,
326,
1366,
869,
12045,
16,
598,
326... |
childUpdate=True) | childUpdate=True, connection=dbconn) | def fetchChildren(self): """Prefetch childrens' data | e6ed3a7b59e8061a7eeff9aef351672443b0e00b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6718/e6ed3a7b59e8061a7eeff9aef351672443b0e00b/iteration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
4212,
12,
2890,
4672,
3536,
25591,
2325,
87,
11,
501,
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,
2158,
4212,
12,
2890,
4672,
3536,
25591,
2325,
87,
11,
501,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
x, y = gl.getsize() | format, x, y, qsize, rate = info fps = 59.64 tpf = 1000.0 / fps | def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' + filename) v.StartCapture() t0 = time.millitimer() while not gl.qtest(): if v.GetCaptured() > 2: t = time.millitimer() - t0 cd, st = v.GetCaptureData() data = cd.interleave(x, y) cd.UnlockCaptureData() buffer.append(data, t) else: time.millisleep(10) v.StopCapture() while v.GetCaptured() > 0: t = time.millitimer() - t0 cd, st = v.GetCaptureData() data = cd.interleave(x, y) cd.UnlockCaptureData() buffer.append(data, t) buffer.append(None) # Sentinel gl.wintitle('(done) ' + filename) | 62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1409,
12,
90,
16,
1544,
16,
20232,
77,
792,
2550,
4672,
1930,
2650,
740,
16,
619,
16,
677,
16,
1043,
1467,
16,
4993,
273,
1123,
26067,
273,
14995,
18,
1105,
225,
8071,
74,
273,
4336,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1409,
12,
90,
16,
1544,
16,
20232,
77,
792,
2550,
4672,
1930,
2650,
740,
16,
619,
16,
677,
16,
1043,
1467,
16,
4993,
273,
1123,
26067,
273,
14995,
18,
1105,
225,
8071,
74,
273,
4336,
... |
def sizeof(filename): | def sizeof(filename, lang): | def sizeof(filename): size = os.path.getsize(filename) if size < 1000: return ' %d bytes ' % size elif size < 1000000: return ' %d KB ' % (size / 1000) # GB?? :-) return ' %d MB ' % (size / 1000000) | 3af39c5f05e82fd415c7f13441692ce1fa61bab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/3af39c5f05e82fd415c7f13441692ce1fa61bab9/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
13726,
12,
3459,
16,
3303,
4672,
963,
273,
1140,
18,
803,
18,
588,
1467,
12,
3459,
13,
309,
963,
411,
4336,
30,
327,
296,
738,
72,
1731,
296,
738,
963,
1327,
963,
411,
15088,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
13726,
12,
3459,
16,
3303,
4672,
963,
273,
1140,
18,
803,
18,
588,
1467,
12,
3459,
13,
309,
963,
411,
4336,
30,
327,
296,
738,
72,
1731,
296,
738,
963,
1327,
963,
411,
15088,
30... |
ownNodeName = erl_common.AlignNode(ownNodeName, 1) | ownNodeName = erl_common.AlignNodeName(ownNodeName, 1) | def main(argv): global e try: opts, args = getopt.getopt(argv[1:], "?n:c:d:f:") except getopt.error, info: print info sys.exit(1) hostName = "localhost" ownNodeName = "py_interface_test" cookie = "cookie" ownDistrVersion = 5 ownFlags = 4 for (optchar, optarg) in opts: if optchar == "-?": print "Usage: %s [host] port" % argv[0] sys.exit(1) elif optchar == "-c": cookie = optarg elif optchar == "-n": ownNodeName = optarg elif optchar == "-d": ownDistrVersion = string.atoi(optarg) elif optchar == "-f": ownFlags = string.atoi(optarg) if len(args) >= 2: hostName = args[0] portNum = string.atoi(args[1]) elif len(args) >= 1: portNum = string.atoi(args[0]) else: sys.exit(1) ownNodeName = erl_common.AlignNode(ownNodeName, 1) print "Connecting to %s:%d" print " ownNodeName=\"%s\"" % ownNodeName print " cookie=\"%s\"" % cookie print " ownDistrVersion=%d" % ownDistrVersion print " ownFlags=%d" % ownFlags opts = erl_opts.ErlNodeOpts(cookie=cookie) c = erl_node_conn.ErlNodeOutConnection(ownNodeName, opts) c.InitiateConnection(hostName, portNum, __TestConnectOk, __TestConnectFailed, __TestConnectionBroken, __TestPassThroughMsg) evhandler = erl_eventhandler.GetEventHandler() evhandler.Loop() | 423538ecfb3177f1cb49f99071b851ae2e2d77d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7565/423538ecfb3177f1cb49f99071b851ae2e2d77d6/test_erl_node_conn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
425,
225,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
19485,
63,
21,
30,
6487,
18101,
82,
30,
71,
30,
72,
30,
74,
2773,
13,
1335,
336,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
2552,
425,
225,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
19485,
63,
21,
30,
6487,
18101,
82,
30,
71,
30,
72,
30,
74,
2773,
13,
1335,
336,
3... |
session.execute("SET INFO ON") | session.execute('SET INFO ON') | def __console(self): session.execute("SET INFO ON") while True: com = str(raw_input('> ')).strip() if com == 'exit': break if com: session.execute(com) print session.info() | 2c08272f70137ab264e2522f23535b6805965cfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13081/2c08272f70137ab264e2522f23535b6805965cfd/BaseX.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8698,
12,
2890,
4672,
1339,
18,
8837,
2668,
4043,
9286,
6229,
6134,
1323,
1053,
30,
532,
273,
609,
12,
1899,
67,
2630,
2668,
34,
8624,
2934,
6406,
1435,
309,
532,
422,
296,
8593,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8698,
12,
2890,
4672,
1339,
18,
8837,
2668,
4043,
9286,
6229,
6134,
1323,
1053,
30,
532,
273,
609,
12,
1899,
67,
2630,
2668,
34,
8624,
2934,
6406,
1435,
309,
532,
422,
296,
8593,
... |
nanny.tattle_add_item(tattle_item, identity) | nanny.tattle_add_item("outsockets", identity) | def _bind_udp_socket(localip, localport, tattle_item): # Conrad: entirely stolen from listenforconnection(). Some of this input # verification stuff especially could probably be combined as a shared # function. Even the rest of the functions are similar enough to be worth # consolidating. # Check the input arguments (type) if type(localip) is not str: raise RepyArgumentError("Provided localip must be a string!") if type(localport) is not int: raise RepyArgumentError("Provided localport must be a int!") # Check the input arguments (sanity) if not _is_valid_ip_address(localip): raise RepyArgumentError("Provided localip is not valid! IP: '"+localip+"'") if not _is_valid_network_port(localport): raise RepyArgumentError("Provided localport is not valid! Port: "+str(localport)) # Check the input arguments (permission) update_ip_cache() if not _ip_is_allowed(localip): raise ResourceForbiddenError("Provided localip is not allowed! IP: '"+localip+"'") if not _is_allowed_localport("UDP", localport): raise ResourceForbiddenError("Provided localport is not allowed! Port: "+str(localport)) # Check if the tuple is in use normal_identity = ("UDP", localip, localport, False, None) listen_identity = ("UDP", localip, localport, None, None) if normal_identity in OPEN_SOCKET_INFO or listen_identity in OPEN_SOCKET_INFO: raise AlreadyListeningError("The provided localip and localport are already in use!") is_listensock = tattle_item == "insockets" if is_listensock: identity = listen_identity else: identity = normal_identity # Check if the tuple is pending PENDING_SOCKETS_LOCK.acquire() try: if normal_identity in PENDING_SOCKETS or listen_identity in PENDING_SOCKETS: raise AlreadyListeningError("Concurrent listenformessage with the localip and localport in progress!") else: # No pending operation, add us to the pending list PENDING_SOCKETS.add(identity) finally: PENDING_SOCKETS_LOCK.release() try: # Register this identity with nanny nanny.tattle_add_item(tattle_item, identity) try: # Get the socket sock = _get_udp_socket(localip, localport) except Exception, e: nanny.tattle_remove_item(tattle_item, identity) # Check if this an already in use error if _is_addr_in_use_exception(e): raise DuplicateTupleError("Provided Local IP and Local Port is already in use!") # Check if this is a binding error if _is_addr_unavailable_exception(e): raise AddressBindingError("Cannot bind to the specified local ip, invalid!") # Unknown error... else: raise # Create entry with a lock and the socket object OPEN_SOCKET_INFO[identity] = (threading.Lock(), sock) # Return the identity return identity finally: # Remove us from the pending operations list PENDING_SOCKETS_LOCK.acquire() PENDING_SOCKETS.remove(identity) PENDING_SOCKETS_LOCK.release() | cdc73d35527f2e8ba9aecc2ad1a44f2831f9c68c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/cdc73d35527f2e8ba9aecc2ad1a44f2831f9c68c/emulcomm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4376,
67,
26029,
67,
7814,
12,
3729,
625,
16,
1191,
655,
16,
268,
4558,
298,
67,
1726,
4672,
468,
735,
6012,
30,
21658,
384,
355,
275,
628,
6514,
1884,
4071,
7675,
10548,
434,
333... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4376,
67,
26029,
67,
7814,
12,
3729,
625,
16,
1191,
655,
16,
268,
4558,
298,
67,
1726,
4672,
468,
735,
6012,
30,
21658,
384,
355,
275,
628,
6514,
1884,
4071,
7675,
10548,
434,
333... |
def _escape_cdata(text, encoding=None): | def _escape_cdata(text): | def _escape_cdata(text, encoding=None): # escape character data try: if encoding: try: text = _encode(text, encoding) except UnicodeError: return _encode_entity(text) text = text.replace("&", "&") text = text.replace("<", "<") text = text.replace(">", ">") return text except (TypeError, AttributeError): _raise_serialization_error(text) | e4cfaf8f7bb5d21848fb232e3757979401720c1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/e4cfaf8f7bb5d21848fb232e3757979401720c1d/ElementTree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6939,
67,
71,
892,
12,
955,
4672,
468,
4114,
3351,
501,
775,
30,
309,
2688,
30,
775,
30,
977,
273,
389,
3015,
12,
955,
16,
2688,
13,
1335,
9633,
668,
30,
327,
389,
3015,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6939,
67,
71,
892,
12,
955,
4672,
468,
4114,
3351,
501,
775,
30,
309,
2688,
30,
775,
30,
977,
273,
389,
3015,
12,
955,
16,
2688,
13,
1335,
9633,
668,
30,
327,
389,
3015,
67,
1... |
if profilename == "": | profilename = profilename.strip() if not profilename: | def write_script_ent(prof, script): if not self.config.has_option(prof, script): self.config.set(prof, script, None) | d684bac0ab68cf40a7c8f07850012c0f133cfc78 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12280/d684bac0ab68cf40a7c8f07850012c0f133cfc78/wicd-daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
4263,
67,
319,
12,
16121,
16,
2728,
4672,
309,
486,
365,
18,
1425,
18,
5332,
67,
3482,
12,
16121,
16,
2728,
4672,
365,
18,
1425,
18,
542,
12,
16121,
16,
2728,
16,
599,
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,
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,
67,
4263,
67,
319,
12,
16121,
16,
2728,
4672,
309,
486,
365,
18,
1425,
18,
5332,
67,
3482,
12,
16121,
16,
2728,
4672,
365,
18,
1425,
18,
542,
12,
16121,
16,
2728,
16,
599,
13,
... |
print 'try',directory[:indx2+1]+realfile | def create_parent_path(chroot, path, be_verbose=0, copy_permissions=1, allow_suid=0, copy_ownership=0): """creates the directory and all its parents id needed. copy_ownership can only be used if copy permissions is also used""" directory = path if (directory[-1:] == '/'): directory = directory[:-1] if (os.path.exists(chroot+directory)): return tmp = return_existing_base_directory(chroot+directory) oldindx = len(tmp)-len(chroot) # find the first slash after the existing directories indx = string.find(directory,'/',oldindx+1) if (indx == -1 ): indx=len(directory) while (indx != -1): # avoid the /bla//bla pitfall if (oldindx +1 == indx): oldindx = indx else: try: sb = os.lstat(directory[:indx]) except OSError, (errno,strerror): sys.stderr.write('ERROR: failed to lstat('+directory[:indx]+'):'+strerror+'\n') break if (stat.S_ISLNK(sb.st_mode)): # create the link, create the target, and then continue realfile = os.readlink(directory[:indx]) if (be_verbose): print 'Creating symlink '+chroot+directory[:indx]+' to '+realfile try: os.symlink(realfile, chroot+directory[:indx]) except OSError, (errno,strerror): if (errno == 17): # file exists pass else: sys.stderr.write('ERROR: failed to create symlink '+chroot+directory[:indx]+'\n'); if (realfile[0]=='/'): create_parent_path(chroot, realfile, be_verbose, copy_permissions, allow_suid, copy_ownership) else: indx2 = string.rfind(directory[:indx],'/') print 'try',directory[:indx2+1]+realfile create_parent_path(chroot, directory[:indx2+1]+realfile, be_verbose, copy_permissions, allow_suid, copy_ownership) elif (stat.S_ISDIR(sb.st_mode)): if (be_verbose): print 'Creating directory '+chroot+directory[:indx] os.mkdir(chroot+directory[:indx], 0755) if (copy_permissions): try: copy_time_and_permissions(directory[:indx], chroot+directory[:indx], be_verbose, allow_suid, copy_ownership) except OSError, (errno,strerror): sys.stderr.write('ERROR: failed to copy time/permissions/owner from '+directory[:indx]+' to '+chroot+directory[:indx]+': '+strerror+'\n') oldindx = indx if (indx==len(directory)): indx=-1 else: indx = string.find(directory,'/',oldindx+1) if (indx==-1): indx=len(directory) | 36b98ec2d9922291b519205df3378742931be906 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6201/36b98ec2d9922291b519205df3378742931be906/jk_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2938,
67,
803,
12,
343,
3085,
16,
589,
16,
506,
67,
11369,
33,
20,
16,
1610,
67,
9612,
33,
21,
16,
1699,
67,
87,
1911,
33,
20,
16,
1610,
67,
995,
12565,
33,
20,
4672,
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,
752,
67,
2938,
67,
803,
12,
343,
3085,
16,
589,
16,
506,
67,
11369,
33,
20,
16,
1610,
67,
9612,
33,
21,
16,
1699,
67,
87,
1911,
33,
20,
16,
1610,
67,
995,
12565,
33,
20,
4672,
35... | |
sage: T = _ArbCoordTrans((x + y, x - y, z), x) The independent and dependent variables don't really matter in the case of an arbitrary transformation (since it is already in terms of its own variables), so default values are provided:: sage: T.indep_var 'f' sage: T.dep_vars ['u', 'v'] Finally, an example of gen_transform():: sage: T.gen_transform(f=z) [y + z, -y + z, z] """ return [t.subs({self.fvar: f}) for t in self.custom_trans] class Spherical(_CoordTrans): | sage: T = _ArbitraryCoordinates((x + y, x - y, z), x,[y,z]) sage: T.transform(x=z,y=1) (z + 1, z - 1, z) """ return tuple(t.subs(**kwds) for t in self.custom_trans) class Spherical(_Coordinates): | def gen_transform(self, f=None, u=None, v=None): """ EXAMPLE:: | 85811d8c24ec26acc8a960fadc0b24274c01a5a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/85811d8c24ec26acc8a960fadc0b24274c01a5a8/plot3d.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
6547,
12,
2890,
16,
284,
33,
7036,
16,
582,
33,
7036,
16,
331,
33,
7036,
4672,
3536,
5675,
21373,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
6547,
12,
2890,
16,
284,
33,
7036,
16,
582,
33,
7036,
16,
331,
33,
7036,
4672,
3536,
5675,
21373,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
response = xmlrpclib.dumps(fault) | response = xmlrpclib.dumps(fault, allow_none=self.allow_none, encoding=self.encoding) | def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data. | c1f5320ba578927a5354c476e71e897980966204 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c1f5320ba578927a5354c476e71e897980966204/SimpleXMLRPCServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3108,
329,
67,
10739,
12,
2890,
16,
501,
16,
3435,
67,
2039,
273,
599,
4672,
3536,
5325,
281,
392,
3167,
17,
8087,
707,
628,
10893,
1259,
261,
4201,
13,
501,
18,
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,
389,
3108,
329,
67,
10739,
12,
2890,
16,
501,
16,
3435,
67,
2039,
273,
599,
4672,
3536,
5325,
281,
392,
3167,
17,
8087,
707,
628,
10893,
1259,
261,
4201,
13,
501,
18,
2,
-100,
-100,
... |
results.union(results_for_opft_item) | results_in_any_collection.union(results_for_opft_item) | def search_pattern(req, p=None, f=None, colls=None, m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this kind of matching. If it is not set, then a guess is made. - Calls search_in_bibwords() and/or search_in_bibxxx() functions. - If hit_hints is set, than print lots of hints on current search. Useful for debugging and/or when search gives zero hits. - Called by main().""" ## create result set: results = HitList() results_used = 0 # not-yet-used flag, to be able to circumvent set operations ## if p is not defined, return all hits in given collections: if not p: results_out = {} for coll in colls: results_out[coll] = HitList() results_out[coll]._set = collrecs_cache[coll]._set results_out[coll]._nbhits = collrecs_cache[coll]._nbhits return results_out ## now we are sure to have some p: good. ## create search units: opft_items = create_opft_search_units(req, p, f, m) #req.write("<p>%s" % opft_items) hit_hints_displayed = 0 # did we already displayed some search hint? ## search regardless of collection: for opft_item in opft_items: results_for_opft_item = {} oi, pi, fi, ti = opft_item[0], opft_item[1], opft_item[2], opft_item[3] # firstly, launch search for this pattern item: if ti == 'a' or ti == 'r': # we are doing either direct bibxxx search or phrase search or regexp search results_for_opft_item = search_in_bibxxx(req, pi, fi, ti) elif ti == 'w': # we are doing bibwords search results_for_opft_item = search_in_bibwords(req, pi, fi) else: print_warning(req, "The search type '%s' is not defined." % ti, "Error") return(1) if hit_hints: results_for_opft_item.calculate_nbhits() if results_for_opft_item._nbhits == 0: hit_hints_displayed = 1 text = "Search term <strong>%s</strong>" % pi if fi: text += " inside <em>%s</em> " % fi print_warning(req, "%s did not match any record. Nearest terms are: %s" % (text, create_nearest_words_links(req.args, pi, fi)), "") if dbg: print_warning(req, "Item <strong>%s:%s</strong> gave %d hits." % (fi, pi, results_for_opft_item._nbhits), "") # secondly, apply the set intersect/union/disjunction functions: if dbg: t1 = os.times()[4] if results_used: if oi == '+': results.intersect(results_for_opft_item) elif oi == '-': results.difference(results_for_opft_item) elif oi == '|': results.union(results_for_opft_item) else: print_warning(req, "Invalid set operation %s." % oi, "Error") else: results = results_for_opft_item results_used = 1 if dbg: t2 = os.times()[4] print_warning(req, "Set operation '%s' took %.2f seconds." % (oi, (t2 - t1)), "Profile") ## return all hits if no collection list specified (useful for WebSearch Admin to determine collection ## recID universe): if colls == None: results.calculate_nbhits() return results ## intersect with collection universe: if dbg: t1 = os.times()[4] results_out = {} if colls: for coll in colls: results_out[coll] = HitList() results_out[coll]._set = Numeric.bitwise_and(results._set, collrecs_cache[coll]._set) if dbg: t2 = os.times()[4] print_warning(req, "Intersecting with collection hitlist universe took %.2f seconds." % ((t2 - t1)), "Profile") ## count number of hits: for coll in colls: results_out[coll].calculate_nbhits() if hit_hints and not hit_hints_displayed: if results._nbhits == 0: # pattern not found in any public/private collection: text = """All search terms matched but boolean query returned no hits. Please combine your search terms differently.""" url_args = req.args for opft_item in opft_items: oi, pi, fi, ti = opft_item[0], opft_item[1], opft_item[2], opft_item[3] url_args_new = re.sub(r'(^|\&)p=.*?(\&|$)', r'\1p='+urllib.quote(pi)+r'\2', url_args) url_args_new = re.sub(r'(^|\&)f=.*?(\&|$)', r'\1f='+urllib.quote(fi)+r'\2', url_args_new) text += """<br> <a href="%s/search.py?%s">%s</a> - about %s hits""" % \ (weburl, url_args_new, pi, get_word_nbhits(pi, fi)) print_warning(req, text, "") else: # pattern found but perhaps not in the collections chosen by the user: num = 0 for coll in colls: num += results_out[coll]._nbhits if num == 0: # try to search in Home: results_Home = HitList() results_Home._set = Numeric.bitwise_and(results._set, collrecs_cache[cdsname]._set) results_Home.calculate_nbhits() if results_Home._nbhits > 0: # some hits found in Home, so propose this search: url_args = req.args url_args = re.sub(r'(^|\&)cc=.*?(\&|$)', r'\2', url_args) url_args = re.sub(r'(^|\&)c=.*?(\&[^c]+=|$)', r'\2', url_args) url_args = re.sub(r'^\&+', '', url_args) url_args = re.sub(r'\&+$', '', url_args) print_warning(req, """Matches found in other public collections: <a href="%s/search.py?%s">%d hits</a>.""" % (weburl, url_args, results_Home._nbhits), "") else: # no hits found in Home, recommend different search terms: text = """All search terms matched but boolean query returned no hits. Please combine your search terms differently.""" url_args = req.args for opft_item in opft_items: oi, pi, fi, ti = opft_item[0], opft_item[1], opft_item[2], opft_item[3] url_args_new = re.sub(r'(^|\&)p=.*?(\&|$)', r'\1p='+urllib.quote(pi)+r'\2', url_args) url_args_new = re.sub(r'(^|\&)f=.*?(\&|$)', r'\1f='+urllib.quote(fi)+r'\2', url_args_new) text += """<br> <a href="%s/search.py?%s">%s</a> - about %s hits""" % \ (weburl, url_args_new, pi, get_word_nbhits(pi, fi)) print_warning(req, text, "") return results_out | 0aec736283882ec36ab3010d663d9be625f4d852 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/0aec736283882ec36ab3010d663d9be625f4d852/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
4951,
12,
3658,
16,
293,
33,
7036,
16,
284,
33,
7036,
16,
645,
3251,
33,
7036,
16,
312,
33,
7036,
16,
6800,
67,
24598,
33,
20,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
4951,
12,
3658,
16,
293,
33,
7036,
16,
284,
33,
7036,
16,
645,
3251,
33,
7036,
16,
312,
33,
7036,
16,
6800,
67,
24598,
33,
20,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
... |
def __submitPilots(self,pilots,ce): | def __submitPilots( self, pilots, ce ): | def __submitPilots(self,pilots,ce): resourceJDL = '' while len(pilots) > 0: pilot = pilots.pop(0) ret = ce.submitJob(pilot['pilotFile'],resourceJDL,pilot['proxyString'],'0',[self.diracInstallPath,self.diracPilotPath]) if not ret['OK']: self.log.warn(ret['Message']) return ret self.log.debug("Result of Pilot submission:",ret) | 364464017f61dc703439c7a2235a47d4ba35aafe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/364464017f61dc703439c7a2235a47d4ba35aafe/DiracSiteAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9297,
52,
330,
6968,
12,
365,
16,
24970,
6968,
16,
5898,
262,
30,
1058,
46,
8914,
273,
875,
1323,
562,
12,
84,
330,
6968,
13,
405,
374,
30,
293,
22797,
273,
24970,
6968,
18,
51... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9297,
52,
330,
6968,
12,
365,
16,
24970,
6968,
16,
5898,
262,
30,
1058,
46,
8914,
273,
875,
1323,
562,
12,
84,
330,
6968,
13,
405,
374,
30,
293,
22797,
273,
24970,
6968,
18,
51... |
s.write("error in str() call%s" % os.linesep) | s.write("error in repr() call%s" % os.linesep) | def _stack_format (stack): """ Format a stack trace to a message. @return: formatted stack message @rtype: string """ s = StringIO.StringIO() traceback.print_stack(stack, file=s) if PRINT_LOCALVARS: s.write("Locals by frame, innermost last%s" % os.linesep) for frame in stack: s.write(os.linesep) s.write("Frame %s in %s at line %s%s" % (frame.f_code.co_name, frame.f_code.co_filename, frame.f_lineno, os.linesep)) for key, value in frame.f_locals.items(): s.write("\t%20s = " % key) # be careful not to cause a new error in the error output try: s.write(str(value)) s.write(os.linesep) except: s.write("error in str() call%s" % os.linesep) return s.getvalue() | faf1ea81ce85e52a6f731442dc751ffe1189caab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/faf1ea81ce85e52a6f731442dc751ffe1189caab/log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3772,
67,
2139,
261,
3772,
4672,
3536,
4077,
279,
2110,
2606,
358,
279,
883,
18,
225,
632,
2463,
30,
4955,
2110,
883,
632,
86,
723,
30,
533,
3536,
272,
273,
15777,
18,
780,
4294,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3772,
67,
2139,
261,
3772,
4672,
3536,
4077,
279,
2110,
2606,
358,
279,
883,
18,
225,
632,
2463,
30,
4955,
2110,
883,
632,
86,
723,
30,
533,
3536,
272,
273,
15777,
18,
780,
4294,
... |
if not svn.isSvnFile('.') or not svn.isTrunk(): for i in table_obj: cmd = "eups expandtable -i " if presetup: cmd += presetup + " " cmd += str(i) env.AddPostAction(i, Action("%s" %(cmd), cmd, ENV = os.environ)) | for i in table_obj: cmd = "eups expandtable -i " if presetup: cmd += presetup + " " cmd += str(i) env.AddPostAction(i, Action("%s" %(cmd), cmd, ENV = os.environ)) | def InstallEups(env, dest, files, presetup=""): """Install a ups directory, setting absolute versions as appropriate (unless you're installing from the trunk, in which case no versions are expanded). If presetup is provided, it's expected to be a dictionary with keys product names and values the version that should be installed into the table files, overriding eups expandtable's usual behaviour. E.g. | 3443cee899423ac974afa336b3b952c83fc3cca8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6561/3443cee899423ac974afa336b3b952c83fc3cca8/SConsUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10284,
41,
18294,
12,
3074,
16,
1570,
16,
1390,
16,
12313,
416,
1546,
6,
4672,
3536,
6410,
279,
731,
87,
1867,
16,
3637,
4967,
5244,
487,
5505,
261,
28502,
1846,
4565,
3799,
310,
628,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10284,
41,
18294,
12,
3074,
16,
1570,
16,
1390,
16,
12313,
416,
1546,
6,
4672,
3536,
6410,
279,
731,
87,
1867,
16,
3637,
4967,
5244,
487,
5505,
261,
28502,
1846,
4565,
3799,
310,
628,
... |
extra_objects = [libtraceevent], | extra_objects = [libtraceevent, liblk], | def finalize_options(self): _install_lib.finalize_options(self) self.build_dir = build_lib | 6c5bce87e17d00e2dafaf9e943bfe4c11bf6cb9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/6c5bce87e17d00e2dafaf9e943bfe4c11bf6cb9e/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
12,
2890,
4672,
389,
5425,
67,
2941,
18,
30343,
67,
2116,
12,
2890,
13,
365,
18,
3510,
67,
1214,
273,
1361,
67,
2941,
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,
12409,
67,
2116,
12,
2890,
4672,
389,
5425,
67,
2941,
18,
30343,
67,
2116,
12,
2890,
13,
365,
18,
3510,
67,
1214,
273,
1361,
67,
2941,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
_xmlrpc_service = xmlrpclib.ServerProxy(SERVICE_URL + 'xmlrpc/', | _xmlrpc_service = xmlrpclib.ServerProxy(_server_name + '/xmlrpc/', | def get_xmlrpc_service(): """Create the XMLRPC server proxy and cache it.""" global _xmlrpc_service import xmlrpclib if _xmlrpc_service is None: try: _xmlrpc_service = xmlrpclib.ServerProxy(SERVICE_URL + 'xmlrpc/', allow_none=True) except Exception, err: fail('Could not connect to Pastebin: %s' % err, -1) return _xmlrpc_service | b75206fd8de1f7f74e3150b949de916ec5b50ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11759/b75206fd8de1f7f74e3150b949de916ec5b50ca3/lodgeit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2902,
7452,
67,
3278,
13332,
3536,
1684,
326,
3167,
8087,
1438,
2889,
471,
1247,
518,
12123,
2552,
389,
2902,
7452,
67,
3278,
1930,
2025,
13832,
830,
495,
309,
389,
2902,
7452,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2902,
7452,
67,
3278,
13332,
3536,
1684,
326,
3167,
8087,
1438,
2889,
471,
1247,
518,
12123,
2552,
389,
2902,
7452,
67,
3278,
1930,
2025,
13832,
830,
495,
309,
389,
2902,
7452,
... |
Chatter.write('Migrated %d files from %s to %s' % \ (migrated, directory, self._data_migrate[directory])) | Debug.write('Migrated %d files from %s to %s' % \ (migrated, directory, self._data_migrate[directory])) | def migrate(self, directory): '''Migrate (or not) data to a local directory.''' | 87649edbd1ddaa666b79a997b7f7c4db5d5f7674 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/87649edbd1ddaa666b79a997b7f7c4db5d5f7674/Files.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13187,
12,
2890,
16,
1867,
4672,
9163,
19594,
261,
280,
486,
13,
501,
358,
279,
1191,
1867,
1093,
6309,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13187,
12,
2890,
16,
1867,
4672,
9163,
19594,
261,
280,
486,
13,
501,
358,
279,
1191,
1867,
1093,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.setTitleBarText("Logged as: %s" % username) | window.emit(SIGNAL('updateTitleApp(QString)'),"Logged as: %s" % username) | def login_user(self, username, password): # WARNING: to be used by a thread self.setTitleBarText("Trying to login...") try: if self.OSDBServer._login(username, password) : if not username: username = 'Anonymous' self.setTitleBarText("Logged as: %s" % username) elif username: #We try anonymous login in case the normal user login has failed self.setTitleBarText("Error logging as: %s. Logging anonymously..." % username) if self.OSDBServer._login("", "") : self.setTitleBarText("Logged as: Anonymous") else: self.setTitleBarText("Login: Cannot login.") except: self.setTitleBarText("Login: ERROR") | fa2e031b746e3cb37a398ef782ac5a3d3f3b64cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/fa2e031b746e3cb37a398ef782ac5a3d3f3b64cb/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3925,
67,
1355,
12,
2890,
16,
2718,
16,
2201,
4672,
468,
9744,
30,
358,
506,
1399,
635,
279,
2650,
365,
18,
542,
4247,
5190,
1528,
2932,
18038,
358,
3925,
7070,
13,
775,
30,
309,
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,
3925,
67,
1355,
12,
2890,
16,
2718,
16,
2201,
4672,
468,
9744,
30,
358,
506,
1399,
635,
279,
2650,
365,
18,
542,
4247,
5190,
1528,
2932,
18038,
358,
3925,
7070,
13,
775,
30,
309,
365,
... |
def __iter__(self): return self def next(self): if self.index == len(self): self.index = 0 raise StopIteration self.index += 1 return self[self.index-1] | def __init__(self, marker_elem=None): list.__init__(self) if isinstance(marker_elem, list): self.markers = marker_elem else: self.markers = [] self.index = 0 self.marker = None self.is_truncated = False self.next_token = None self.status = True | 97eaa71c8249452bb0bb14f79d94d5be7d60e8d5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1098/97eaa71c8249452bb0bb14f79d94d5be7d60e8d5/resultset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5373,
67,
10037,
33,
7036,
4672,
666,
16186,
2738,
972,
12,
2890,
13,
309,
1549,
12,
11145,
67,
10037,
16,
666,
4672,
365,
18,
22807,
273,
5373,
67,
1003... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5373,
67,
10037,
33,
7036,
4672,
666,
16186,
2738,
972,
12,
2890,
13,
309,
1549,
12,
11145,
67,
10037,
16,
666,
4672,
365,
18,
22807,
273,
5373,
67,
1003... | |
<input class="admin_wvar" type="text" name="dbquery" value="%s" /><br> | <input class="admin_w200" type="text" name="dbquery" value="%s" /><br> | def perform_modifydbquery(colID, ln=cdslang, dbquery='', callback='yes', confirm=-1): """form to modify the dbquery of the collection. dbquery - the dbquery of the collection.""" subtitle = '' output = "" col_dict = dict(get_current_name('', ln, get_col_nametypes()[0][0], "collection")) if colID and col_dict.has_key(int(colID)): colID = int(colID) subtitle = """<a name="1">1. Modify collection query for collection '%s'</a>   <small>[<a href="%s/admin/websearch/guide.html#3.1">?</a>]</small>""" % (col_dict[colID], weburl) if confirm == -1: res = run_sql("SELECT dbquery FROM collection WHERE id=%s" % colID) dbquery = res[0][0] if not dbquery: dbquery = '' reg_sons = len(get_col_tree(colID, 'r')) vir_sons = len(get_col_tree(colID, 'v')) if reg_sons > 1 or vir_sons > 1: if dbquery: output += "Warning: This collection got subcollections, and should because of this not have a collection query, for further explanation, check the WebSearch Guide<br>" elif reg_sons <= 1 and vir_sons <= 1: if not dbquery: output += "Warning: This collection does not have any subcollections, and should because of this have a collection query, for further explanation, check the WebSearch Guide<br>" text = """ <span class="adminlabel">Query</span> <input class="admin_wvar" type="text" name="dbquery" value="%s" /><br> """ % dbquery output += createhiddenform(action="modifydbquery", text=text, button="Modify", colID=colID, ln=ln, confirm=0) if confirm in ["0", 0]: if dbquery: text = """<b>Change query for this collection to: '%s'.</b>""" % dbquery else: text = """<b>Remove query for this collection.</b>""" output += createhiddenform(action="modifydbquery", text=text, colID=colID, dbquery=dbquery, button="Confirm", confirm=1) elif confirm in ["1", 1]: res = modify_dbquery(colID, dbquery) if res: text = """<b><span class="info">Changed query.</span></b>""" else: text = """<b><span class="info">Sorry, could not change query.</span></b>""" output += text try: body = [output, extra] except NameError: body = [output] if callback: return perform_editcollection(colID, ln, "perform_modifydbquery", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | f6160160ea8915b75fb34d9a1b108d7ad76d9b0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/f6160160ea8915b75fb34d9a1b108d7ad76d9b0c/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
1966,
2271,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1319,
2271,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
29711,
21,
4672,
3536,
687,
358,
5612,
326,
1319,
227... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
1966,
2271,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1319,
2271,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
29711,
21,
4672,
3536,
687,
358,
5612,
326,
1319,
227... |
PeiSize += ImageClass.Size | PeiSize += ImageInfo.Image.Size | def _CollectModuleMapBuffer (self, MapBuffer, ModuleList): sys.stdout.write ("Generate Load Module At Fix Address Map") sys.stdout.flush() PatchEfiImageList = [] PeiModuleList = {} BtModuleList = {} RtModuleList = {} SmmModuleList = {} PeiSize = 0 BtSize = 0 RtSize = 0 # reserve 4K size in SMRAM to make SMM module address not from 0. SmmSize = 0x1000 for Module in ModuleList: GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (Module.MetaFile, Module.Arch, Module.ToolChain, Module.BuildTarget) OutputImageFile = '' for ResultFile in Module.CodaTargetList: if str(ResultFile.Target).endswith('.efi'): # # module list for PEI, DXE, RUNTIME and SMM # OutputImageFile = os.path.join(Module.OutputDir, Module.Name + '.efi') ImageClass = PeImageClass (OutputImageFile) if not ImageClass.IsValid: EdkLogger.error("build", FILE_PARSE_FAILURE, ExtraData=ImageClass.ErrorInfo) ImageInfo = PeImageInfo(Module.Name, Module.Guid, Module.OutputDir, ImageClass) if Module.ModuleType in ['PEI_CORE', 'PEIM', 'COMBINED_PEIM_DRIVER','PIC_PEIM', 'RELOCATABLE_PEIM', 'DXE_CORE']: PeiModuleList[Module.MetaFile] = ImageInfo PeiSize += ImageClass.Size elif Module.ModuleType in ['BS_DRIVER', 'DXE_DRIVER', 'UEFI_DRIVER']: BtModuleList[Module.MetaFile] = ImageInfo BtSize += ImageClass.Size elif Module.ModuleType in ['DXE_RUNTIME_DRIVER', 'RT_DRIVER', 'DXE_SAL_DRIVER', 'SAL_RT_DRIVER']: RtModuleList[Module.MetaFile] = ImageInfo RtSize += ImageClass.Size elif Module.ModuleType in ['SMM_CORE', 'DXE_SMM_DRIVER']: SmmModuleList[Module.MetaFile] = ImageInfo SmmSize += ImageClass.Size if Module.ModuleType == 'DXE_SMM_DRIVER': PiSpecVersion = 0 if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification: PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION'] # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver. if PiSpecVersion < 0x0001000A: BtModuleList[Module.MetaFile] = ImageInfo BtSize += ImageClass.Size break # # EFI image is final target. # Check EFI image contains patchable FixAddress related PCDs. # if OutputImageFile != '': ModuleIsPatch = False for Pcd in Module.ModulePcdList: if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST: ModuleIsPatch = True break if not ModuleIsPatch: for Pcd in Module.LibraryPcdList: if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST: ModuleIsPatch = True break if not ModuleIsPatch: continue # # Module includes the patchable load fix address PCDs. # It will be fixed up later. # PatchEfiImageList.append (OutputImageFile) # # Patch FixAddress related PCDs into EFI image # for EfiImage in PatchEfiImageList: EfiImageMap = EfiImage.replace('.efi', '.map') if not os.path.exists(EfiImageMap): continue # # Get PCD offset in EFI image by GenPatchPcdTable function # PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) # # Patch real PCD value by PatchPcdValue tool # for PcdInfo in PcdTable: ReturnValue = 0 if PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE, str (PeiSize/0x1000)) elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE, str (BtSize/0x1000)) elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE, str (RtSize/0x1000)) elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, str (SmmSize/0x1000)) if ReturnValue != 0: EdkLogger.error("build", PARAMETER_INVALID, "Patch PCD value failed", ExtraData=ErrorInfo) # # Get Top Memory address # TopMemoryAddress = 0 if self.LoadFixAddress == 0xFFFFFFFFFFFFFFFF: TopMemoryAddress = 0 else: TopMemoryAddress = self.LoadFixAddress if TopMemoryAddress < RtSize + BtSize + PeiSize: EdkLogger.error("build", PARAMETER_INVALID, "TopMemoryAddress is too low to load driver") MapBuffer.write('PEI_CODE_PAGE_NUMBER = 0x%x\n' % (PeiSize/0x1000)) MapBuffer.write('BOOT_CODE_PAGE_NUMBER = 0x%x\n' % (BtSize/0x1000)) MapBuffer.write('RUNTIME_CODE_PAGE_NUMBER = 0x%x\n' % (RtSize/0x1000)) MapBuffer.write('SMM_CODE_PAGE_NUMBER = 0x%x\n' % (SmmSize/0x1000)) PeiBaseAddr = TopMemoryAddress - RtSize - BtSize BtBaseAddr = TopMemoryAddress - RtSize RtBaseAddr = TopMemoryAddress | ef3747968bba5f59e31e3a867cfc32eb8a676f78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/914/ef3747968bba5f59e31e3a867cfc32eb8a676f78/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10808,
3120,
863,
1892,
261,
2890,
16,
1635,
1892,
16,
5924,
682,
4672,
2589,
18,
10283,
18,
2626,
7566,
4625,
4444,
5924,
2380,
12139,
5267,
1635,
7923,
2589,
18,
10283,
18,
11330,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10808,
3120,
863,
1892,
261,
2890,
16,
1635,
1892,
16,
5924,
682,
4672,
2589,
18,
10283,
18,
2626,
7566,
4625,
4444,
5924,
2380,
12139,
5267,
1635,
7923,
2589,
18,
10283,
18,
11330,
... |
self.deviceMainProcess = None | self.agencyMainProcess = None | def __init__(self): """ """ self.log = logging.getLogger("director.manager.Manager") self.browserProcess = None self.appProcess = None self.deviceMainProcess = None self.brokerProcess = None self.appPort = '9808' self.appHost = '127.0.0.1' | 89c26ae85ea06431a8c3e18f173500e3bf7a509d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12466/89c26ae85ea06431a8c3e18f173500e3bf7a509d/manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3536,
3536,
365,
18,
1330,
273,
2907,
18,
588,
3328,
2932,
7205,
280,
18,
4181,
18,
1318,
7923,
365,
18,
11213,
2227,
273,
599,
365,
18,
2910,
2227,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3536,
3536,
365,
18,
1330,
273,
2907,
18,
588,
3328,
2932,
7205,
280,
18,
4181,
18,
1318,
7923,
365,
18,
11213,
2227,
273,
599,
365,
18,
2910,
2227,
27... |
self.unit_cell = unit_cell | self.unit_cell = crystal_symmetry.unit_cell() | def __call__(self, option, opt, value, parser): if (opt == "--unit_cell"): unit_cell = None try: unit_cell = uctbx.unit_cell(value) except: pass if (unit_cell is None): crystal_symmetry = crystal_symmetry_from_any.extract_from(value) if ( crystal_symmetry is None or crystal_symmetry.unit_cell() is None): raise OptionError("cannot read parameters: " + value, opt) self.unit_cell = unit_cell elif (opt == "--space_group"): space_group_info = None space_group_info = sgtbx.space_group_info(symbol=value) try: space_group_info = sgtbx.space_group_info(symbol=value) except: pass if (space_group_info is None): crystal_symmetry = crystal_symmetry_from_any.extract_from(value) if ( crystal_symmetry is None or crystal_symmetry.space_group_info() is None): raise OptionError("unknown space group: " + value, opt) self.space_group_info = space_group_info elif (opt == "--symmetry"): crystal_symmetry = crystal_symmetry_from_any.extract_from(value) if ( crystal_symmetry is None or crystal_symmetry.space_group_info() is None): raise OptionError("cannot read symmetry: " + value, opt) if (crystal_symmetry.unit_cell() is not None): self.unit_cell = crystal_symmetry.unit_cell() if (crystal_symmetry.space_group_info() is not None): self.space_group_info = crystal_symmetry.space_group_info() else: raise RuntimeError, "Programming error." | 0699076e2a272a9ff18073de02f0fb2181f091b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/0699076e2a272a9ff18073de02f0fb2181f091b1/option_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1456,
16,
2153,
16,
460,
16,
2082,
4672,
309,
261,
3838,
422,
5238,
4873,
67,
3855,
6,
4672,
2836,
67,
3855,
273,
599,
775,
30,
2836,
67,
3855,
273,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1456,
16,
2153,
16,
460,
16,
2082,
4672,
309,
261,
3838,
422,
5238,
4873,
67,
3855,
6,
4672,
2836,
67,
3855,
273,
599,
775,
30,
2836,
67,
3855,
273,
58... |
header(break_longlines(translate('issue_number', 'Issue | header(break_longlines(translate('issue_number', 'Issue | def getFieldValue(issue, field): v = issue.Schema()[field].get(issue) if isinstance(v, StringType) or isinstance(v, UnicodeType): v = v.replace(chr(13), '') if isinstance(v, StringType): return unicode(v, collector.getSiteEncoding()) return v | 8b7a34b7df3ba93fcdaa50bc9476f36cc59ed981 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/8b7a34b7df3ba93fcdaa50bc9476f36cc59ed981/pdfwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26126,
12,
13882,
16,
652,
4672,
331,
273,
5672,
18,
3078,
1435,
63,
1518,
8009,
588,
12,
13882,
13,
309,
1549,
12,
90,
16,
31570,
13,
578,
1549,
12,
90,
16,
9633,
559,
4672,
331,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26126,
12,
13882,
16,
652,
4672,
331,
273,
5672,
18,
3078,
1435,
63,
1518,
8009,
588,
12,
13882,
13,
309,
1549,
12,
90,
16,
31570,
13,
578,
1549,
12,
90,
16,
9633,
559,
4672,
331,
27... |
str += self._docstring_to_html(var.descr(), var.uid()) | str += self._docstring_to_html(var.descr(), vuid) vtyp = var.type() hasval = var.has_value() | def _var_details_entry(self, var, container): vname = var.name() vtyp = var.type() hasval = var.has_value() | 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,
1401,
67,
6395,
67,
4099,
12,
2890,
16,
569,
16,
1478,
4672,
331,
529,
273,
569,
18,
529,
1435,
7966,
879,
273,
569,
18,
723,
1435,
711,
1125,
273,
569,
18,
5332,
67,
1132,
1435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1401,
67,
6395,
67,
4099,
12,
2890,
16,
569,
16,
1478,
4672,
331,
529,
273,
569,
18,
529,
1435,
7966,
879,
273,
569,
18,
723,
1435,
711,
1125,
273,
569,
18,
5332,
67,
1132,
1435... |
return self.deviceName except: | returnValue(self.deviceName) except Exception: | def identify_device(self, c, server, address, idn=None): try: yield self.client.refresh() p = self.client[server].packet() p.address(address) p.timeout(1) p.write('ES') p.read() resp = yield p.send() return self.deviceName except: pass | 6690b92834f84f93b59f8da71e2869410b65562e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7016/6690b92834f84f93b59f8da71e2869410b65562e/dg535.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9786,
67,
5964,
12,
2890,
16,
276,
16,
1438,
16,
1758,
16,
612,
82,
33,
7036,
4672,
775,
30,
2824,
365,
18,
2625,
18,
9144,
1435,
293,
273,
365,
18,
2625,
63,
3567,
8009,
11482,
1435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9786,
67,
5964,
12,
2890,
16,
276,
16,
1438,
16,
1758,
16,
612,
82,
33,
7036,
4672,
775,
30,
2824,
365,
18,
2625,
18,
9144,
1435,
293,
273,
365,
18,
2625,
63,
3567,
8009,
11482,
1435... |
+--------------+ | 1 2 3 | | 4 top 5 | | 6 7 8 | +--------------+--------------+--------------+--------------+ | 9 10 11 | 17 18 19 | 25 26 27 | 33 34 35 | | 12 left 13 | 20 front 21 | 28 right 29 | 36 rear 37 | | 14 15 16 | 22 23 24 | 30 31 32 | 38 39 40 | +--------------+--------------+--------------+--------------+ | 41 42 43 | | 44 bottom 45 | | 46 47 48 | +--------------+ | +--------------+ | 1 2 3 | | 4 top 5 | | 6 7 8 | +------------+--------------+-------------+------------+ | 9 10 11 | 17 18 19 | 25 26 27 | 33 34 35 | | 12 left 13 | 20 front 21 | 28 right 29 | 36 rear 37 | | 14 15 16 | 22 23 24 | 30 31 32 | 38 39 40 | +------------+--------------+-------------+------------+ | 41 42 43 | | 44 bottom 45 | | 46 47 48 | +--------------+ | def display2d(self,mv): r""" Displays a 2d map of the Rubik's cube after the move mv has been made. Nothing is returned. EXAMPLES: sage: rubik = CubeGroup() sage: rubik.display2d("") +--------------+ | 1 2 3 | | 4 top 5 | | 6 7 8 | +--------------+--------------+--------------+--------------+ | 9 10 11 | 17 18 19 | 25 26 27 | 33 34 35 | | 12 left 13 | 20 front 21 | 28 right 29 | 36 rear 37 | | 14 15 16 | 22 23 24 | 30 31 32 | 38 39 40 | +--------------+--------------+--------------+--------------+ | 41 42 43 | | 44 bottom 45 | | 46 47 48 | +--------------+ | ffecca43e67eb5a268ace7448b4aa9b938a485ff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/ffecca43e67eb5a268ace7448b4aa9b938a485ff/cubegroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
22,
72,
12,
2890,
16,
17509,
4672,
436,
8395,
9311,
87,
279,
576,
72,
852,
434,
326,
534,
373,
1766,
1807,
18324,
1839,
326,
3635,
7701,
711,
2118,
7165,
18,
13389,
353,
2106,
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,
2562,
22,
72,
12,
2890,
16,
17509,
4672,
436,
8395,
9311,
87,
279,
576,
72,
852,
434,
326,
534,
373,
1766,
1807,
18324,
1839,
326,
3635,
7701,
711,
2118,
7165,
18,
13389,
353,
2106,
18... |
self.doclist.Delete(entry.GetEditLink().href) | self.editClient.Delete(entry.GetEditLink().href) | def testUploadAndDeleteDocument(self): ms = gdata.MediaSource(file_path='test.doc', content_type='application/msword') entry = self.doclist.UploadDocument(ms, 'test doc') self.assertEqual(entry.title.text, 'test doc') self.assertEqual(entry.category[0].label, 'document') self.assert_(isinstance(entry, gdata.docs.DocumentListEntry)) self.doclist.Delete(entry.GetEditLink().href) | dcc46816af19bac967f4b588353a3ee4514dd5d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6580/dcc46816af19bac967f4b588353a3ee4514dd5d2/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4777,
1876,
2613,
2519,
12,
2890,
4672,
4086,
273,
314,
892,
18,
5419,
1830,
12,
768,
67,
803,
2218,
3813,
18,
2434,
2187,
913,
67,
723,
2218,
3685,
19,
959,
1095,
6134,
1241,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4777,
1876,
2613,
2519,
12,
2890,
4672,
4086,
273,
314,
892,
18,
5419,
1830,
12,
768,
67,
803,
2218,
3813,
18,
2434,
2187,
913,
67,
723,
2218,
3685,
19,
959,
1095,
6134,
1241,
27... |
image_list = page.image_glob(base_name+'*volume_time.png') | image_list = page.image_glob(base_name+'-*volume_time.png') | def parse_command_line(): parser = OptionParser(version = "%prog CVS $Id$", usage = "%prog [options] [file ...]", description = "%prog computes mass/mass upperlimit") parser.add_option("--webserver", help = "Set the webserver path. Required. Example https://ldas-jobs.ligo.caltech.edu/~channa/highmass_months_23-24_summary_page") parser.add_option("--open-box", action = "store_true", help = "Produce open box page") parser.add_option("--output-name-tag", default = "", metavar = "name", help = "Set the basename for image search") opts, filenames = parser.parse_args() if not opts.webserver: print >>sys.stderr, "must specify a webserver" sys.exit(1) return opts, filenames | b77ba7aef5872e14b48ee71299ce0ae987743808 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/b77ba7aef5872e14b48ee71299ce0ae987743808/make_summary_page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
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,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
273,
... |
if os.path.exists(path): | if os.path.exists( path ): | def fixLDPath( root, ldpath, directory): """ This is a utility to fix the LD_LIBRARY_PATH on Grid WNs. The shared libraries from the original LD_LIBRARY_PATH are linked to the locally specified directory. For Windows (and in general) this needs some refurbishment. """ if os.path.exists(directory): shutil.rmtree(directory) start = os.getcwd() os.mkdir(directory) os.chdir(directory) uniqueLD = uniquePath(ldpath) if DEBUG: print 'Unique LD LIBRARY PATH is:' print uniqueLD sys.stdout.flush() ldlist = string.split(uniqueLD,':') if DEBUG: print '' print 'LD List is:' print ldlist print '' sys.stdout.flush() for path in ldlist: if os.path.exists(path): if DEBUG: print 'Searching for shared libraries in:' print path print '-----------------------------------------------' res = shellCall(0,'ls '+path+'/*.so*') if res['OK']: print res['Value'] else: print res print '-----------------------------------------------' output = shellCall(0,'ls '+path+'/*.so*') #must be tidied for Windows (same below) if DEBUG: if not output['OK']: print '**************************' print 'Warning, problem with ls:' print output print '**************************' if not output['Value'][0]: ldlibs = output['Value'][1].split('\n') for lib in ldlibs: if os.path.exists(lib): filename = os.path.basename(lib) output = shellCall(0,'ln -s '+str(lib)+' '+str(filename)) #N.B. for Windows this should be a copy... if DEBUG: if not output['OK']: print '********************************' print 'Warning, problem creating link:' print 'File: ',filename print 'Path: ',lib print output print '********************************' if DEBUG: print 'Searching for rootmap file in:' print path print '-----------------------------------------------' res = shellCall(0,'ls '+path+'/*rootmap*') if res['OK']: print res['Value'] else: print res print '-----------------------------------------------' output = shellCall(0,'ls '+path+'/*rootmap*') if DEBUG: if not output['OK']: print '**************************' print 'Warning, problem with rootmap:' print output print '**************************' if not output['Value'][0]: ldlibs = output['Value'][1].split('\n') for lib in ldlibs: if os.path.exists(lib): if re.search('RELAX',lib) is not None: filename = os.path.basename(lib) output = shellCall(0,'ln -s '+str(lib)+' '+str(filename)) if DEBUG: if not output['OK']: print '********************************' print 'Warning, problem creating link:' print 'File: ',filename print 'Path: ',lib print output print '********************************' os.chdir(start) sys.stdout.flush() | 9b8eea7ba28a2770fdfbf806c3e35df73cf645a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9b8eea7ba28a2770fdfbf806c3e35df73cf645a1/dirac-fix-ld-library-path.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
12069,
743,
12,
1365,
16,
16916,
803,
16,
1867,
4672,
3536,
1220,
353,
279,
12788,
358,
2917,
326,
28083,
67,
2053,
28254,
67,
4211,
603,
7145,
678,
10386,
18,
1021,
5116,
14732,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
12069,
743,
12,
1365,
16,
16916,
803,
16,
1867,
4672,
3536,
1220,
353,
279,
12788,
358,
2917,
326,
28083,
67,
2053,
28254,
67,
4211,
603,
7145,
678,
10386,
18,
1021,
5116,
14732,
6... |
def write_class_tree(self, out): """ Write HTML code for a nested list showing the base/subclass relationships between all documented classes. Each element of the top-level list is a class with no (documented) bases; and under each class is listed all of its subclasses. Note that in the case of multiple inheritance, a class may appear multiple times. This is used by L{write_trees} to write the class hierarchy. @todo: For multiple inheritance, don't repeat subclasses the second time a class is mentioned; instead, link to the first mention. """ if not self.class_list: return class_set = self.class_set.copy() for doc in self.class_list: if doc.bases != UNKNOWN: for base in doc.bases: if base not in class_set: if isinstance(base, ClassDoc): class_set.update(base.mro()) else: pass out('<ul>\n') for doc in sorted(class_set): if doc.bases != UNKNOWN and len(doc.bases)==0: self.write_class_tree_item(out, doc, class_set) out('</ul>\n') | def write_module_tree_item(self, out, doc, package=None): # If it's a private variable, then mark its <li>. var = package and package.variables.get(doc.canonical_name[-1]) if var is not None: priv = var.is_public is False else: priv = doc.canonical_name[-1].startswith('_') out(' <li%s> <strong class="uidlink">%s</strong>' % (priv and ' class="private"' or '', self.href(doc))) if doc.summary not in (None, UNKNOWN): out(': <em class="summary">'+ self.description(doc.summary, doc, 8)+'</em>') out('</li>\n') if doc.submodules != UNKNOWN and doc.submodules: out(' <ul%s>\n' % (priv and ' class="private"' or '')) for submodule in doc.submodules: self.write_module_tree_item(out, submodule, package=doc) out(' </ul>\n </li>\n') | 5c410b5b6e25df3bdbc6da266f7773518165cb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5c410b5b6e25df3bdbc6da266f7773518165cb02/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2978,
67,
3413,
67,
1726,
12,
2890,
16,
596,
16,
997,
16,
2181,
33,
7036,
4672,
468,
971,
518,
1807,
279,
3238,
2190,
16,
1508,
2267,
2097,
411,
549,
18652,
569,
273,
2181,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2978,
67,
3413,
67,
1726,
12,
2890,
16,
596,
16,
997,
16,
2181,
33,
7036,
4672,
468,
971,
518,
1807,
279,
3238,
2190,
16,
1508,
2267,
2097,
411,
549,
18652,
569,
273,
2181,
... | |
pass | def migrate_project(old, old_parent, new_parent, f): new = None if callable(old.id): obj_id = old.id() else: obj_id = old.id portal_types = parent.portal_types portal_types.constructContent('Project', new_parent, obj_id) print old.Title() new = new_parent[obj_id] # set fields new.update(title=old.title) new.setBasin(old.getBasin() ) new.SetCountry(update_countries(old.getCountry())) new.setEnd_date(old.getEnd_date() ) new.setFocal_area(old.getFocal_area() ) new.setGef_project_allocation(old.getGef_project_allocation() ) new.setGef_project_id(old.getGef_project_id ) new.setGlobalproject('Global' in old.getRegion()) new.setLatitude(old.getLeadagency() ) new.setLongitude(old.getLongitude() ) new.setOperational_programme(old.getOperational_programme() ) new.setProject_status(old.getProject_status() ) new.setProject_summary( '<div class="migration-tbd">' + ', '.join(old.getExecuting_agency()) + '</div> <hr/> <br/>' + old.getSummary_project_description() + '<p><hr/></p>' + old.getProject_results()) new.setProject_type(old.getProject_type() ) new.setRemote_url(old.getProject_website_address() ) new.setStart_date(old.getStart_date() ) new.setStrategic_priority(old.getStrategic_priority() ) new.setTotal_cost(old.getTotal_cost() ) | a7515b372064702005964c649711105373e02dc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6024/a7515b372064702005964c649711105373e02dc7/migrate_projects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13187,
67,
4406,
12,
1673,
16,
1592,
67,
2938,
16,
394,
67,
2938,
16,
284,
4672,
394,
273,
599,
309,
4140,
12,
1673,
18,
350,
4672,
1081,
67,
350,
273,
1592,
18,
350,
1435,
469,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13187,
67,
4406,
12,
1673,
16,
1592,
67,
2938,
16,
394,
67,
2938,
16,
284,
4672,
394,
273,
599,
309,
4140,
12,
1673,
18,
350,
4672,
1081,
67,
350,
273,
1592,
18,
350,
1435,
469,
30,
... | |
def __new__(cls,**kwargs): | def __new__(cls,*args,**kwargs): | def __new__(cls,**kwargs): if 'findBestClass' not in cls.__dict__: raise TypeError("Cannot instanciate class %s as it does not implement findBestClass"%cls.__name__) try: clsList,kwargs=cls.findBestClass([],kwargs) except: log.debugWarning("findBestClass failed",exc_info=True) return None bases=[] for index in xrange(len(clsList)): if index==0 or not issubclass(clsList[index-1],clsList[index]): bases.append(clsList[index]) bases=tuple(bases) newCls=NVDAObject._dynamicClassCache.get(bases,None) if not newCls: name="Dynamic_%s"%"".join([x.__name__ for x in clsList]) newCls=type(name,bases,{}) NVDAObject._dynamicClassCache[bases]=newCls obj=super(NVDAObject,cls).__new__(newCls) obj.factoryClass=cls obj.__init__(**kwargs) return obj | 8c4d5aa8c1cf608f0050b5d5d04d4c7c0250c95a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/8c4d5aa8c1cf608f0050b5d5d04d4c7c0250c95a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
14,
1968,
16,
636,
4333,
4672,
309,
296,
4720,
14173,
797,
11,
486,
316,
2028,
16186,
1576,
972,
30,
1002,
3580,
2932,
4515,
316,
27866,
3840,
667,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
14,
1968,
16,
636,
4333,
4672,
309,
296,
4720,
14173,
797,
11,
486,
316,
2028,
16186,
1576,
972,
30,
1002,
3580,
2932,
4515,
316,
27866,
3840,
667,
738,
... |
""" result = self.jobDB.getJobParameter(jobID,'Pilot_Reference') | """ result = self.jobDB.getJobParameter( jobID, 'Pilot_Reference' ) | def __getJobPilotStatus( self, jobID ): """ Get the job pilot status """ result = self.jobDB.getJobParameter(jobID,'Pilot_Reference') if result['OK']: pilotReference = result['Value'] wmsAdminClient = RPCClient('WorkloadManagement/WMSAdministrator') result = wmsAdminClient.getPilotInfo(pilotReference) if result['OK']: pilotStatus = result['Value'][pilotReference]['Status'] return S_OK(pilotStatus) else: return S_ERROR('Failed to get the pilot status') else: return S_ERROR('Failed to get the pilot reference') | 1bc0d189cfa76ea128be98dcb17942841327a3d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/1bc0d189cfa76ea128be98dcb17942841327a3d2/StalledJobAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2278,
52,
22797,
1482,
12,
365,
16,
28913,
262,
30,
3536,
968,
326,
1719,
293,
22797,
1267,
3536,
563,
273,
365,
18,
4688,
2290,
18,
588,
2278,
1662,
12,
28913,
16,
296,
52,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2278,
52,
22797,
1482,
12,
365,
16,
28913,
262,
30,
3536,
968,
326,
1719,
293,
22797,
1267,
3536,
563,
273,
365,
18,
4688,
2290,
18,
588,
2278,
1662,
12,
28913,
16,
296,
52,... |
davCode, errText = statusValue if davCode == WebDAV.CANT_CONNECT: txt = errText elif davCode == WebDAV.NO_ACCESS: txt = NO_ACCESS else: txt = UNKNOWN | try: davCode, errText = statusValue if davCode == WebDAV.CANT_CONNECT: txt = errText elif davCode == WebDAV.NO_ACCESS: txt = NO_ACCESS else: txt = UNKNOWN except ValueError: txt = statusValue | def getErrorText(self, statusValue): davCode, errText = statusValue | 6721abba911f1a7416a8267b68825c4f60e2fc7e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/6721abba911f1a7416a8267b68825c4f60e2fc7e/AccountPreferencesDialogs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7926,
1528,
12,
2890,
16,
1267,
620,
4672,
302,
842,
1085,
16,
393,
1528,
273,
1267,
620,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7926,
1528,
12,
2890,
16,
1267,
620,
4672,
302,
842,
1085,
16,
393,
1528,
273,
1267,
620,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print('__file__==%r' % __file__) | print('__file__==%a' % __file__) | def f(): result.append('Lower level reference') | ea5b4e536a569fc4fcc34436ce71ec6b5a0ff90d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/ea5b4e536a569fc4fcc34436ce71ec6b5a0ff90d/test_cmd_line_script.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
13332,
563,
18,
6923,
2668,
4070,
1801,
2114,
6134,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
13332,
563,
18,
6923,
2668,
4070,
1801,
2114,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
class SocketCloser: """Helper to manage socket close() logic for makefile(). The OS socket should not be closed until the socket and all of its makefile-children are closed. If the refcount is zero when socket.close() is called, this is easy: Just close the socket. If the refcount is non-zero when socket.close() is called, then the real close should not occur until the last makefile-child is closed. """ def __init__(self, sock): self._sock = sock self._makefile_refs = 0 try: sock.fileno() self._socket_open = True except error: self._socket_open = False def socket_close(self): self._socket_open = False self.close() def makefile_open(self): self._makefile_refs += 1 def makefile_close(self): self._makefile_refs -= 1 self.close() def close(self): if not (self._socket_open or self._makefile_refs): self._sock._real_close() | def fromfd(fd, family=AF_INET, type=SOCK_STREAM, proto=0): nfd = os.dup(fd) return socket(family, type, proto, fileno=nfd) | 86bc33cb7c248ede88ff9bd82775aab818f6224f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/86bc33cb7c248ede88ff9bd82775aab818f6224f/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8313,
12,
8313,
16,
6755,
33,
6799,
67,
18819,
16,
618,
33,
3584,
3507,
67,
13693,
16,
3760,
33,
20,
4672,
290,
8313,
273,
1140,
18,
26427,
12,
8313,
13,
327,
2987,
12,
9309,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8313,
12,
8313,
16,
6755,
33,
6799,
67,
18819,
16,
618,
33,
3584,
3507,
67,
13693,
16,
3760,
33,
20,
4672,
290,
8313,
273,
1140,
18,
26427,
12,
8313,
13,
327,
2987,
12,
9309,
16... | |
if l[6] != "": if len(l[6]) == 3 and l[6].isdigit(): if code == l[6]: match_or = True else: if raw.find(l[6]) > -1: match_or = True | if l[7] != "": if len(l[7]) == 3 and l[7].isdigit(): if code == l[7]: match_and = True else: if raw.find(l[7]) > -1: match_and = True else: match_and = True | def attack(self, urls, forms): for l in self.nikto_db: match = match_or = match_and = False fail = fail_or = False | b6144ce240df2652ce18d1d59359960e7adb197d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6330/b6144ce240df2652ce18d1d59359960e7adb197d/mod_nikto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13843,
12,
2890,
16,
6903,
16,
10138,
4672,
364,
328,
316,
365,
18,
82,
1766,
869,
67,
1966,
30,
845,
273,
845,
67,
280,
273,
845,
67,
464,
273,
1083,
2321,
273,
2321,
67,
280,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13843,
12,
2890,
16,
6903,
16,
10138,
4672,
364,
328,
316,
365,
18,
82,
1766,
869,
67,
1966,
30,
845,
273,
845,
67,
280,
273,
845,
67,
464,
273,
1083,
2321,
273,
2321,
67,
280,
273,
... |
value = re.sub('^"?(.*?)"?$', '\\1', attr.value) | value = re.sub('(\A"|"\Z)', '', attr.value, re.M) | def setAttributes(self, attrs): for attr in attrs: value = re.sub('^"?(.*?)"?$', '\\1', attr.value) if attr.name == 'label': self.label = value elif attr.name == 'color': self.color = value elif attr.name == 'style': style = value.lower() if style in ('solid', 'dotted', 'dashed'): self.style = style else: msg = "WARNING: unknown edge style: %s\n" % style sys.stderr.write(msg) elif attr.name == 'numbered': self.numbered = value elif attr.name == 'background': if os.path.isfile(value): self.background = value else: msg = "WARNING: background image not found: %s\n" % value sys.stderr.write(msg) elif attr.name == 'description': self.description = value elif attr.name == 'width': self.width = int(value) elif attr.name == 'height': self.height = int(value) else: msg = "Unknown node attribute: %s.%s" % (self.id, attr.name) raise AttributeError(msg) | 1aad2ca76e323508be71932a3f5764fbbd47d932 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/81/1aad2ca76e323508be71932a3f5764fbbd47d932/blockdiag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21175,
12,
2890,
16,
3422,
4672,
364,
1604,
316,
3422,
30,
460,
273,
283,
18,
1717,
2668,
4713,
37,
6,
96,
12691,
62,
13,
2187,
10226,
1604,
18,
1132,
16,
283,
18,
49,
13,
309,
1604,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21175,
12,
2890,
16,
3422,
4672,
364,
1604,
316,
3422,
30,
460,
273,
283,
18,
1717,
2668,
4713,
37,
6,
96,
12691,
62,
13,
2187,
10226,
1604,
18,
1132,
16,
283,
18,
49,
13,
309,
1604,... |
self.fileName = fileName | self.fileName = self._image.fileName | def __init__(self, fileName): if isinstance(fileName,ImageReader): self.__dict__ = fileName.__dict__ #borgize return if not haveImages: raise RuntimeError('Imaging Library not available, unable to import bitmaps') #start wih lots of null private fields, to be populated by #the relevant engine. self.fileName = fileName self._image = None self._width = None self._height = None self._transparent = None self._data = None if _isPILImage(fileName): self._image = fileName self.fp = fileName.fp try: self.fileName = fileName except AttributeError: self.fileName = 'PILIMAGE_%d' % id(self) else: try: self.fp = open_for_read(fileName,'b') #detect which library we are using and open the image if sys.platform[0:4] == 'java': from javax.imageio import ImageIO self._image = ImageIO.read(self.fp) else: import PIL.Image self._image = PIL.Image.open(self.fp) if self._image=='JPEG': self.jpeg_fh = self._jpeg_fp except: et,ev,tb = sys.exc_info() if hasattr(ev,'args'): a = str(ev.args[-1])+(' fileName='+fileName) ev.args= ev.args[:-1]+(a,) raise et,ev,tb else: raise | b7399611e74bc35ace592f78da4988876af05ad4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/b7399611e74bc35ace592f78da4988876af05ad4/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3968,
4672,
309,
1549,
12,
17812,
16,
2040,
2514,
4672,
365,
16186,
1576,
972,
273,
3968,
16186,
1576,
972,
282,
468,
70,
3341,
554,
327,
309,
486,
1240,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3968,
4672,
309,
1549,
12,
17812,
16,
2040,
2514,
4672,
365,
16186,
1576,
972,
273,
3968,
16186,
1576,
972,
282,
468,
70,
3341,
554,
327,
309,
486,
1240,
... |
self.tests=findmodules("tests") | def _parseargs(self, args): # Defaults self.setBroker("localhost") self.verbose = 1 self.ignore = [] self.specfile = "0-8" self.errata = [] try: opts, self.tests = getopt(args, "s:b:h?dvi:I:", ["help", "spec", "server", "verbose", "ignore", "ignore-file"]) except GetoptError, e: self._die(str(e)) for opt, value in opts: if opt in ("-?", "-h", "--help"): self._die() if opt in ("-s", "--spec"): self.specfile = value if opt in ("-e", "--errata"): self.errata.append(value) if opt in ("-b", "--broker"): self.setBroker(value) if opt in ("-v", "--verbose"): self.verbose = 2 if opt in ("-d", "--debug"): logging.basicConfig(level=logging.DEBUG) if opt in ("-i", "--ignore"): self.ignore.append(value) if opt in ("-I", "--ignore-file"): self.ignoreFile(value) | 3e2d14e9c92ebd61582ab107b6e83890fec3c270 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/197/3e2d14e9c92ebd61582ab107b6e83890fec3c270/testlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
1968,
12,
2890,
16,
833,
4672,
468,
14159,
365,
18,
542,
11194,
2932,
13014,
7923,
365,
18,
11369,
273,
404,
365,
18,
6185,
273,
5378,
365,
18,
2793,
768,
273,
315,
20,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2670,
1968,
12,
2890,
16,
833,
4672,
468,
14159,
365,
18,
542,
11194,
2932,
13014,
7923,
365,
18,
11369,
273,
404,
365,
18,
6185,
273,
5378,
365,
18,
2793,
768,
273,
315,
20,
17,
... | |
self.logger.info("No failure action to trigger") | pass | def onRuleEnded( self, runner ): """Callback bound to 'Runner.onRunEnded', trigerred once a rule was executed. If the rule failed, actions will be executed.""" # FIXME: Handle exception rule = runner.runnable service = runner.context if isinstance(runner.result, Success): if rule.success: #self.logger.info("Success actions:", ", ".join(rule.success)) for action in rule.success: action_object = service.getAction(action) action_runner = Runner.Create(action_object) if action_runner: action_runner.run(runner, service, rule, runner) else: self.logger.err("Cannot create action runner for: %s" % (action_object)) elif isinstance(runner.result, Failure): self.logger.err("Failure on ", rule, ":", runner.result) if rule.fail: #self.logger.info("Failure actions:", ", ".join(rule.fail)) for action in rule.fail: action_object = service.getAction(action) action_runner = Runner.Create(action_object) if action_runner: action_runner.run(runner, service, rule, runner) else: self.logger.err("Cannot create action runner for: %s" % (action_object)) else: self.logger.info("No failure action to trigger") else: self.logger.err("Rule did not return Success or Failure instance: %s, got %s" % (rule, runner.result)) # We unregister the runnner del self.runners[rule.id] | 7ed6110d37a914d582e30fbe68bf4f3906cfd610 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13002/7ed6110d37a914d582e30fbe68bf4f3906cfd610/watchdog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
2175,
28362,
12,
365,
16,
8419,
262,
30,
3536,
2428,
2489,
358,
296,
9709,
18,
265,
1997,
28362,
2187,
23142,
264,
1118,
3647,
279,
1720,
1703,
7120,
18,
971,
326,
1720,
2535,
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,
603,
2175,
28362,
12,
365,
16,
8419,
262,
30,
3536,
2428,
2489,
358,
296,
9709,
18,
265,
1997,
28362,
2187,
23142,
264,
1118,
3647,
279,
1720,
1703,
7120,
18,
971,
326,
1720,
2535,
16,
... |
print "runopts[1]: ", str(self.runopts[1]), "\n" print "timeout: ", str(self.timeout), "\n" | def Run(self, context, result): """Actually run the StreamIt compiler.""" | b743e4b88b01a9a1e4c96481ee8739b465c0f5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12935/b743e4b88b01a9a1e4c96481ee8739b465c0f5f9/streamit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
12,
2890,
16,
819,
16,
563,
4672,
3536,
2459,
3452,
1086,
326,
3961,
7193,
5274,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
12,
2890,
16,
819,
16,
563,
4672,
3536,
2459,
3452,
1086,
326,
3961,
7193,
5274,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.assertIsInstance(pm, DictProxy) self.assertIsInstance(pm.config, dict) self.assertIsInstance(pm.dict, dict) | def testDefaultType(self): pm = PluginManager() self.assertIsInstance(pm, DictProxy) self.assertIsInstance(pm.config, dict) self.assertIsInstance(pm.dict, dict) | dcf180560aa938d6de9c27482c89df4f17ac6384 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5115/dcf180560aa938d6de9c27482c89df4f17ac6384/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1868,
559,
12,
2890,
4672,
7430,
273,
6258,
1318,
1435,
365,
18,
11231,
2520,
1442,
12,
7755,
16,
9696,
3886,
13,
365,
18,
11231,
2520,
1442,
12,
7755,
18,
1425,
16,
2065,
13,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1868,
559,
12,
2890,
4672,
7430,
273,
6258,
1318,
1435,
365,
18,
11231,
2520,
1442,
12,
7755,
16,
9696,
3886,
13,
365,
18,
11231,
2520,
1442,
12,
7755,
18,
1425,
16,
2065,
13,
36... | |
print e.findGlobalCoord([-2., 0.]) | print e.findGlobalCoord([-0., 0.]) | def setLocalCoord(self, lcoord): """set the local coorinate to |lcoord|""" self.lcoord = lcoord | 6572ce70d7274d9c148a83a321958e32116757e3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7248/6572ce70d7274d9c148a83a321958e32116757e3/Element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27970,
5401,
12,
2890,
16,
328,
5732,
4672,
3536,
542,
326,
1191,
1825,
280,
3322,
358,
571,
80,
5732,
96,
8395,
365,
18,
80,
5732,
273,
328,
5732,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
27970,
5401,
12,
2890,
16,
328,
5732,
4672,
3536,
542,
326,
1191,
1825,
280,
3322,
358,
571,
80,
5732,
96,
8395,
365,
18,
80,
5732,
273,
328,
5732,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
def test_bugzilla_importing_avoids_network_if_urls_are_fresh(self): pass | @mock.patch('mysite.customs.bugtrackers.bugzilla.url2bug_data') def test_bugzilla_importing_avoids_network_if_urls_are_fresh(self, mock_xml_opener): | def test_bugzilla_importing_avoids_network_if_urls_are_fresh(self): pass # Second, in the stale case, show that we do not hit the network! # Jack, could you write this? | ea119acae1bc5490e58f894d4a21399354b897e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/ea119acae1bc5490e58f894d4a21399354b897e3/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
632,
22851,
18,
2272,
2668,
81,
1900,
1137,
18,
3662,
87,
18,
925,
4101,
414,
18,
925,
15990,
18,
718,
22,
925,
67,
892,
6134,
1652,
1842,
67,
925,
15990,
67,
5666,
310,
67,
842,
21061,
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,
632,
22851,
18,
2272,
2668,
81,
1900,
1137,
18,
3662,
87,
18,
925,
4101,
414,
18,
925,
15990,
18,
718,
22,
925,
67,
892,
6134,
1652,
1842,
67,
925,
15990,
67,
5666,
310,
67,
842,
21061,
67... |
self.__doc__ = f.func_doc self.__name__ = f.func_name | if hasattr(f, "func_doc"): self.__doc__ = f.func_doc if hasattr(f, "func_name"): self.__name__ = f.func_name | def f(...): .... | 69594cdc181880586fc828778aebe4f2255e0478 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/69594cdc181880586fc828778aebe4f2255e0478/cachefunc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
5825,
4672,
1372,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
5825,
4672,
1372,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] | menuEventDict[menu[0]][prepstr(item[0])[1]] = item[1] | def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel) | 5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5534,
653,
15863,
12,
2890,
4672,
315,
1891,
326,
498,
15863,
1839,
2898,
854,
3550,
6,
468,
11782,
628,
642,
6353,
18,
2074,
365,
18,
10497,
18,
1886,
67,
856,
12537,
33,
20390,
3976,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5534,
653,
15863,
12,
2890,
4672,
315,
1891,
326,
498,
15863,
1839,
2898,
854,
3550,
6,
468,
11782,
628,
642,
6353,
18,
2074,
365,
18,
10497,
18,
1886,
67,
856,
12537,
33,
20390,
3976,
... |
warning.warn("Cannot add element of type %s to ParserElement" % type(other), | warnings.warn("Cannot add element of type %s to ParserElement" % type(other), | def __add__(self, other ): """Implementation of + operator - returns And""" if isinstance( other, basestring ): other = Literal( other ) if not isinstance( other, ParserElement ): warning.warn("Cannot add element of type %s to ParserElement" % type(other), SyntaxWarning, stacklevel=2) return And( [ self, other ] ) | dda2a500387325587692217da639d3c17f38e5a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12364/dda2a500387325587692217da639d3c17f38e5a1/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
262,
30,
3536,
13621,
434,
397,
3726,
300,
1135,
7835,
8395,
309,
1549,
12,
1308,
16,
10699,
262,
30,
1308,
273,
14392,
12,
1308,
262,
309,
486,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
262,
30,
3536,
13621,
434,
397,
3726,
300,
1135,
7835,
8395,
309,
1549,
12,
1308,
16,
10699,
262,
30,
1308,
273,
14392,
12,
1308,
262,
309,
486,
15... |
sql.append(cls._connection._SO_createJoinTableSQL(join)) | sql.append(conn._SO_createJoinTableSQL(join)) | def createJoinTablesSQL(cls): sql = [] for join in cls._getJoinsToCreate(): sql.append(cls._connection._SO_createJoinTableSQL(join)) return '\n'.join(sql) | 037450d58325667d5fa7c8539afdd8393fe0bff2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6718/037450d58325667d5fa7c8539afdd8393fe0bff2/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4572,
6905,
3997,
12,
6429,
4672,
1847,
273,
5378,
364,
1233,
316,
2028,
6315,
588,
4572,
11634,
1684,
13332,
1847,
18,
6923,
12,
4646,
6315,
3584,
67,
2640,
4572,
1388,
3997,
12,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4572,
6905,
3997,
12,
6429,
4672,
1847,
273,
5378,
364,
1233,
316,
2028,
6315,
588,
4572,
11634,
1684,
13332,
1847,
18,
6923,
12,
4646,
6315,
3584,
67,
2640,
4572,
1388,
3997,
12,
5... |
cmd = "INSERT INTO Music (Path, Artist, Album) VALUES('%s', '%s', '%s')" % (music.file_path.replace("'", "''"), music.artist.replace("'", "''"), music.album.replace("'", "''")) | cmd = "INSERT INTO Music (Path, Artist, Album) VALUES('%s', '%s', '%s')" % ( music.file_path.replace("'", "''"), music.artist.replace("'", "''"), music.album.replace("'", "''")) | def save(self, music): cmd = "INSERT INTO Music (Path, Artist, Album) VALUES('%s', '%s', '%s')" % (music.file_path.replace("'", "''"), music.artist.replace("'", "''"), music.album.replace("'", "''")) result = self.__db_helper.execute_nonquery(cmd) assert result > 0 | 35f9f59cd14aea6e029037d2fdc65879ff743a22 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5169/35f9f59cd14aea6e029037d2fdc65879ff743a22/aspyplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
26225,
4672,
1797,
273,
315,
11356,
12421,
490,
14894,
261,
743,
16,
9042,
376,
16,
2262,
10293,
13,
13477,
29909,
87,
2187,
1995,
87,
2187,
1995,
87,
23291,
738,
261... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
26225,
4672,
1797,
273,
315,
11356,
12421,
490,
14894,
261,
743,
16,
9042,
376,
16,
2262,
10293,
13,
13477,
29909,
87,
2187,
1995,
87,
2187,
1995,
87,
23291,
738,
261... |
if len(args) < 1: | if len( args ) < 1: | def usage(): print 'Usage: %s < ce name> [< ce name>]' %(Script.scriptName) DIRAC.exit(2) | 34fa442d048f1227d559bfc78370585cfba9e77f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/34fa442d048f1227d559bfc78370585cfba9e77f/dirac-admin-ce-info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
5898,
508,
34,
306,
32,
5898,
508,
34,
3864,
8975,
3651,
18,
4263,
461,
13,
18544,
2226,
18,
8593,
12,
22,
13,
225,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
5898,
508,
34,
306,
32,
5898,
508,
34,
3864,
8975,
3651,
18,
4263,
461,
13,
18544,
2226,
18,
8593,
12,
22,
13,
225,
2,
-100,
-100,
-10... |
if not instance in node_instance[node_current]: | if (node_current not in node_instance or not instance in node_instance[node_current]): | def _VerifyInstance(self, instance, node_vol_is, node_instance, feedback_fn): """Verify an instance. | a872dae613f5f734249b4e7233543d9d242e1a9f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/a872dae613f5f734249b4e7233543d9d242e1a9f/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8097,
1442,
12,
2890,
16,
791,
16,
756,
67,
15416,
67,
291,
16,
756,
67,
1336,
16,
10762,
67,
4293,
4672,
3536,
8097,
392,
791,
18,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8097,
1442,
12,
2890,
16,
791,
16,
756,
67,
15416,
67,
291,
16,
756,
67,
1336,
16,
10762,
67,
4293,
4672,
3536,
8097,
392,
791,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def get_last_move(lst_move): if lst_move.move_dest_id: lst_move=get_last_move(lst_move.move_dest_id) | def get_last_move(lst_move): while lst_move.move_dest_id and lst_move.state == 'done': lst_move = lst_move.move_dest_id | def get_last_move(lst_move): if lst_move.move_dest_id: lst_move=get_last_move(lst_move.move_dest_id) return lst_move | 05768e88de92e47c795a44939c49dcfc7429426d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/05768e88de92e47c795a44939c49dcfc7429426d/mrp_repair.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2722,
67,
8501,
12,
16923,
67,
8501,
4672,
1323,
9441,
67,
8501,
18,
8501,
67,
10488,
67,
350,
471,
9441,
67,
8501,
18,
2019,
422,
296,
8734,
4278,
9441,
67,
8501,
273,
9441,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2722,
67,
8501,
12,
16923,
67,
8501,
4672,
1323,
9441,
67,
8501,
18,
8501,
67,
10488,
67,
350,
471,
9441,
67,
8501,
18,
2019,
422,
296,
8734,
4278,
9441,
67,
8501,
273,
9441,
... |
return R(B(self)) | try: return R(B(self)) except TypeError: if len(vars) == 1: sub = [(vars[0], G[0])] else: raise | def _polynomial_(self, R): """ Coerce this symbolic expression to a polynomial in R. | f885afd99fdcf125e45a81ca34e23eb112c72946 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/f885afd99fdcf125e45a81ca34e23eb112c72946/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3915,
13602,
67,
12,
2890,
16,
534,
4672,
3536,
7695,
2765,
333,
16754,
2652,
358,
279,
16991,
316,
534,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3915,
13602,
67,
12,
2890,
16,
534,
4672,
3536,
7695,
2765,
333,
16754,
2652,
358,
279,
16991,
316,
534,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname | def setFont(self, node): from reportlab.pdfbase import pdfmetrics fname = node.get('name') #TODO : other fonts should be supported if fname not in pdfmetrics.standardFonts: fname = self.canvas._fontname return self.canvas.setFont(fname, utils.unit_get(node.get('size'))) | 3e3270264fb49739144e4fefd6a55182ea9900cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e3270264fb49739144e4fefd6a55182ea9900cc/trml2pdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20454,
12,
2890,
16,
756,
4672,
628,
2605,
7411,
18,
7699,
1969,
1930,
8169,
9597,
5299,
273,
756,
18,
588,
2668,
529,
6134,
468,
6241,
294,
1308,
16450,
1410,
506,
3260,
2463,
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,
20454,
12,
2890,
16,
756,
4672,
628,
2605,
7411,
18,
7699,
1969,
1930,
8169,
9597,
5299,
273,
756,
18,
588,
2668,
529,
6134,
468,
6241,
294,
1308,
16450,
1410,
506,
3260,
2463,
365,
18,
... | |
except (socket.error, paramiko.SSHException), e: | except (socket.error, paramiko.SSHException, EOFError), e: | def _open_channel(self, timeout): start_time = time.time() if os.getpid() != self.pid: if self.pid is not None: # HACK: paramiko tries to join() on its worker thread # and this just hangs on linux after a fork() self.transport.join = lambda: None self.transport.atfork() join_hook = lambda cmd: self._close_transport() subcommand.subcommand.register_join_hook(join_hook) logging.debug("Reopening SSH connection after a process fork") self._init_transport() | c3697410f01abac2cdcb00a3dc02f6afdb224568 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/c3697410f01abac2cdcb00a3dc02f6afdb224568/paramiko_host.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3190,
67,
4327,
12,
2890,
16,
2021,
4672,
787,
67,
957,
273,
813,
18,
957,
1435,
309,
1140,
18,
588,
6610,
1435,
480,
365,
18,
6610,
30,
309,
365,
18,
6610,
353,
486,
599,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3190,
67,
4327,
12,
2890,
16,
2021,
4672,
787,
67,
957,
273,
813,
18,
957,
1435,
309,
1140,
18,
588,
6610,
1435,
480,
365,
18,
6610,
30,
309,
365,
18,
6610,
353,
486,
599,
30,
... |
<a href="?VARHELP=contentfilter/convert_html_to_plaintext"</a> is enabled and the site is configured to allow these conversions."""), | <a href="?VARHELP=contentfilter/convert_html_to_plaintext" >convert_html_to_plaintext</a> is enabled and the site is configured to allow these conversions."""), | def GetConfigInfo(self, mlist, category, subcat=None): if category <> 'contentfilter': return None WIDTH = mm_cfg.TEXTFIELDWIDTH | 8affd3598e0f5f73f006482834a6e876e7901b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/8affd3598e0f5f73f006482834a6e876e7901b84/ContentFilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26666,
966,
12,
2890,
16,
312,
1098,
16,
3150,
16,
720,
2574,
33,
7036,
4672,
309,
3150,
2813,
296,
1745,
2188,
4278,
327,
599,
22631,
273,
9740,
67,
7066,
18,
5151,
6776,
10023,
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,
26666,
966,
12,
2890,
16,
312,
1098,
16,
3150,
16,
720,
2574,
33,
7036,
4672,
309,
3150,
2813,
296,
1745,
2188,
4278,
327,
599,
22631,
273,
9740,
67,
7066,
18,
5151,
6776,
10023,
2,
-1... |
m = notSupportedRE.search(exn[0]) return m is not None | try: m = notSupportedRE.search(exn[0]) return m is not None except TypeError, e: return False | def _is_not_supported(exn): m = notSupportedRE.search(exn[0]) return m is not None | b86ae5c2f3706eb360a0fd8110c06f2caf32364c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/b86ae5c2f3706eb360a0fd8110c06f2caf32364c/xmlrpclib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
291,
67,
902,
67,
4127,
12,
338,
82,
4672,
775,
30,
312,
273,
486,
7223,
862,
18,
3072,
12,
338,
82,
63,
20,
5717,
327,
312,
353,
486,
599,
1335,
3580,
16,
425,
30,
327,
1083,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
291,
67,
902,
67,
4127,
12,
338,
82,
4672,
775,
30,
312,
273,
486,
7223,
862,
18,
3072,
12,
338,
82,
63,
20,
5717,
327,
312,
353,
486,
599,
1335,
3580,
16,
425,
30,
327,
1083,... |
def _ToolAppend(tools, tool_name, option, value): | def _ToolAppend(tools, tool_name, setting, value): | def _ToolAppend(tools, tool_name, option, value): if not value: return if not tools.get(tool_name): tools[tool_name] = dict() tool = tools[tool_name] if tool.get(option): if type(tool[option]) == list: tool[option] += value else: # TODO(bradnelson): Pick an exception class. print '@@@', option, tool[option], value raise 'Append to non-list option is invalid' else: tool[option] = value | 5d4328382a6fdbe17089b3cfff76babe72d3e80d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/5d4328382a6fdbe17089b3cfff76babe72d3e80d/msvs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6364,
5736,
12,
6642,
16,
5226,
67,
529,
16,
3637,
16,
460,
4672,
309,
486,
460,
30,
327,
309,
486,
8513,
18,
588,
12,
6738,
67,
529,
4672,
8513,
63,
6738,
67,
529,
65,
273,
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,
389,
6364,
5736,
12,
6642,
16,
5226,
67,
529,
16,
3637,
16,
460,
4672,
309,
486,
460,
30,
327,
309,
486,
8513,
18,
588,
12,
6738,
67,
529,
4672,
8513,
63,
6738,
67,
529,
65,
273,
2... |
typeInfo.constructInstance(self.parent, self.new_id) | typeInfo.constructInstance(self.destination, self.new_id) | def createNew(self): """Create the new object use destination from kwargs """ destination = self.kwargs['destination'] ttool = getToolByName(self.parent, 'portal_types') typeInfo = ttool.getTypeInfo(self.toType) typeInfo.constructInstance(self.parent, self.new_id) | 09e42995b30368f057081068ffdaca044b9dad09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/09e42995b30368f057081068ffdaca044b9dad09/migration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15291,
12,
2890,
4672,
3536,
1684,
326,
394,
733,
225,
999,
2929,
628,
1205,
3536,
2929,
273,
365,
18,
4333,
3292,
10590,
3546,
268,
6738,
273,
336,
6364,
5911,
12,
2890,
18,
2938,
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,
15291,
12,
2890,
4672,
3536,
1684,
326,
394,
733,
225,
999,
2929,
628,
1205,
3536,
2929,
273,
365,
18,
4333,
3292,
10590,
3546,
268,
6738,
273,
336,
6364,
5911,
12,
2890,
18,
2938,
16,
... |
if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl = self.db.classes[propclass.classname] l = [] k = linkcl.labelprop() for optionid in linkcl.list(): option = linkcl.get(optionid, k) if optionid in value or option in value: checked = 'checked' else: checked = '' l.append('%s:<input type="checkbox" %s name="%s" value="%s">'%( option, checked, property, option)) return '\n'.join(l) return '[Checklist: not a link]' | linkcl = self.db.classes[propclass.classname] l = [] k = linkcl.labelprop() for optionid in linkcl.list(): option = linkcl.get(optionid, k) if optionid in value or option in value: checked = 'checked' else: checked = '' l.append('%s:<input type="checkbox" %s name="%s" value="%s">'%( option, checked, property, option)) return '\n'.join(l) | def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl = self.db.classes[propclass.classname] l = [] k = linkcl.labelprop() for optionid in linkcl.list(): option = linkcl.get(optionid, k) if optionid in value or option in value: checked = 'checked' else: checked = '' l.append('%s:<input type="checkbox" %s name="%s" value="%s">'%( option, checked, property, option)) return '\n'.join(l) return '[Checklist: not a link]' | b27451730e44737b39ff26a15c852d028fe9750c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b27451730e44737b39ff26a15c852d028fe9750c/htmltemplate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1272,
16,
2826,
1968,
4672,
2270,
1106,
273,
365,
18,
4738,
63,
4468,
65,
309,
365,
18,
2159,
350,
30,
460,
273,
365,
18,
830,
18,
588,
12,
2890,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1272,
16,
2826,
1968,
4672,
2270,
1106,
273,
365,
18,
4738,
63,
4468,
65,
309,
365,
18,
2159,
350,
30,
460,
273,
365,
18,
830,
18,
588,
12,
2890,
18,
... |
if args: self._report_new_message("No arguments supported") return try: for machine in self._conn.session.stateMachine._machines: machine.reset_timers() | try: args = args.strip().lower() if not args: args = "all" if args == "all": for machine in self._conn.session.stateMachine._machines: machine.reset_timers() elif args == "contacts": self._conn.session.addressbookStateMachine.reset_timers() elif args == "voicemail": self._conn.session.voicemailsStateMachine.reset_timers() elif args == "texts": self._conn.session.textsStateMachine.reset_timers() else: self._report_new_message('Unknown machine "%s"' % (args, )) | def do_reset_state_machine(self, args): if args: self._report_new_message("No arguments supported") return | 7cae4a2705504519915f8249f6f3d1e913de4384 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13096/7cae4a2705504519915f8249f6f3d1e913de4384/debug_prompt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
6208,
67,
2019,
67,
9149,
12,
2890,
16,
833,
4672,
309,
833,
30,
365,
6315,
6006,
67,
2704,
67,
2150,
2932,
2279,
1775,
3260,
7923,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
67,
6208,
67,
2019,
67,
9149,
12,
2890,
16,
833,
4672,
309,
833,
30,
365,
6315,
6006,
67,
2704,
67,
2150,
2932,
2279,
1775,
3260,
7923,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
return redirect(url_for('admin_venue', key=key), code=303) | return redirect(url_for('admin_venue', edition=edition), code=303) | def admin_venue(edition): if request.method == 'GET': if 'email' in request.args: return admin_venue(key, 'venueregemail', request.args['email']) else: return render_template('venuereg.html', key=key) elif request.method =='POST': formid = request.form.get('form.id', formid) if formid == 'venueregemail': email = request.form.get('email', email) if email: p = Participant.query.filter_by(email=email).first() if p is not None: if p.attended: # Already signed in flash("You have already signed in. Next person please.") return redirect(url_for('admin_venue', key=key), code=303) else: return render_template('venueregdetails.html', key=key, p=p) # Unknown email address. Ask for new registration regform = RegisterForm() regform.email.data = email return render_template('venueregnew.html', key=key, regform=regform) elif formid == 'venueregconfirm': id = request.form['id'] subscribe = request.form.get('subscribe') p = Participant.query.get(id) if subscribe: p.subscribe = True else: p.subscribe = False p.attended = True p.attenddate = datetime.utcnow() db.session.commit() flash("You have been signed in. Next person please.", 'info') return redirect(url_for('admin_venueform', key=key), code=303) elif formid == 'venueregform': # Validate form and register regform = RegisterForm() if regform.validate_on_submit(): participant = Participant() regform.populate_obj(participant) participant.ipaddr = request.environ['REMOTE_ADDR'] # TODO: Make user and add to mailchimp db.session.add(participant) db.session.commit() return render_template('venueregsuccess.html', key=key, p=participant) else: return render_template('venueregform.html', key=key, regform=regform, ajax_re_register=True) else: flash("Unknown form submission", 'error') return redirect(url_for('admin_venue', key=key), code=303) | c39abb5ad830344c728adba73719fbcab48a649a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12083/c39abb5ad830344c728adba73719fbcab48a649a/website.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3981,
67,
24612,
12,
329,
608,
4672,
309,
590,
18,
2039,
422,
296,
3264,
4278,
309,
296,
3652,
11,
316,
590,
18,
1968,
30,
327,
3981,
67,
24612,
12,
856,
16,
296,
90,
2104,
11877,
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,
3981,
67,
24612,
12,
329,
608,
4672,
309,
590,
18,
2039,
422,
296,
3264,
4278,
309,
296,
3652,
11,
316,
590,
18,
1968,
30,
327,
3981,
67,
24612,
12,
856,
16,
296,
90,
2104,
11877,
36... |
schedIdList = [] for job in obj.jobs: if job.runningJob is not None \ and job.runningJob['schedulerId'] is not None: | schedIdList = {} for job in obj.jobs: if valid( job.runningJob ): | def kill( self, obj ): """ kill the job instance """ | 37c2f876cfac35d07f26047ffc4b3fc1f1b41055 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/37c2f876cfac35d07f26047ffc4b3fc1f1b41055/Scheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
12,
365,
16,
1081,
262,
30,
3536,
8673,
326,
1719,
791,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
12,
365,
16,
1081,
262,
30,
3536,
8673,
326,
1719,
791,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
_thread_tree = {} _Thread = threading.Thread class TrackableThread(_Thread): """ Monkey patch thread class that records the parent thread in the thread tree E.g. the thread that called this thread object's start() method | class TrackedThread(_Thread): """ | def __exit__(self, *args, **kwargs): self.release() | 797b61863875d6c3189f29d19a7a94cb785840bf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/797b61863875d6c3189f29d19a7a94cb785840bf/thread.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8593,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
365,
18,
9340,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8593,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
365,
18,
9340,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
weather report and the parsed values as soon as they are filled | weather report and the parsed values as soon as they are filled | def parseLatLong(latlong): """ Parse Lat or Long in METAR notation into float values. N and E are +, S and W are -. Expects one positional string and returns one float value. """ # I know, I could invert this if and put # the rest of the function into its block, # but I find it to be more readable this way if latlong is None: return None s = latlong.upper().strip() elms = s.split('-') ud = elms[-1][-1] elms[-1] = elms[-1][:-1] elms = [int(i) for i in elms] coords = 0.0 elen = len(elms) if elen > 2: coords = coords + float(elms[2])/3600.0 if elen > 1: coords = coords + float(elms[1])/60.0 coords = coords + float(elms[0]) if ud in ('W', 'S'): coords = -1.0*coords f, i = math.modf(coords) if elen > 2: f = float(fpformat.sci(f, 4)) elif elen > 1: f = float(fpformat.sci(f, 2)) else: f = 0.0 return f+i | 432e464601ad8d6fd1d2454b664a04836415266c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4602/432e464601ad8d6fd1d2454b664a04836415266c/pymetar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
6607,
3708,
12,
4801,
5748,
4672,
3536,
2884,
11134,
578,
3407,
316,
6791,
985,
12155,
1368,
1431,
924,
18,
423,
471,
512,
854,
397,
16,
348,
471,
678,
854,
300,
18,
15510,
87,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
6607,
3708,
12,
4801,
5748,
4672,
3536,
2884,
11134,
578,
3407,
316,
6791,
985,
12155,
1368,
1431,
924,
18,
423,
471,
512,
854,
397,
16,
348,
471,
678,
854,
300,
18,
15510,
87,
1... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 427) else quickfix.IntField.__init__(self, 427, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
5324,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
5324,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 786) else quickfix.IntField.__init__(self, 786, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
5292,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
5292,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... |
dyn_subs_dict = self.dynamic_substitution_list(ind_0=0,brackets = True,compact=compact_order) | dyn_subs_dict = self.dynamic_substitution_list(brackets = True,compact=compact_order) | def compute_dynamic_pfile(self,max_order=1,compact_order=True,with_parameters=False): | 19f5571064b1debf78ae898a025ca6f56647b1a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10534/19f5571064b1debf78ae898a025ca6f56647b1a4/compiler_python.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
14507,
67,
84,
768,
12,
2890,
16,
1896,
67,
1019,
33,
21,
16,
21038,
67,
1019,
33,
5510,
16,
1918,
67,
3977,
33,
8381,
4672,
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,
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,
3671,
67,
14507,
67,
84,
768,
12,
2890,
16,
1896,
67,
1019,
33,
21,
16,
21038,
67,
1019,
33,
5510,
16,
1918,
67,
3977,
33,
8381,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
for block in chain: contigious = False if not first: first = block contigious = True if previous and block == (previous+1): contigious = True if contigious: previous = block size += blocksize continue | while True: try: block = chain.next() contigious = False if not first: first = block contigious = True if previous and block == (previous+1): contigious = True if contigious: previous = block size += blocksize continue except StopIteration: block = None | def parseProperty(self, property, name_prefix): name = "%s[]" % name_prefix first = None previous = None size = 0 start = property["start"].value if 4096 <= property["size"].value: chain = self.getChain(start) blocksize = self.sector_size seek = self.seekBlock desc_format = "Big blocks %s..%s (%s)" + " of %s bytes" % (blocksize//8) else: chain = self.getChain(start, self.ss_fat) blocksize = self.ss_size seek = self.seekSBlock desc_format = "Small blocks %s..%s (%s)" for block in chain: contigious = False if not first: first = block contigious = True if previous and block == (previous+1): contigious = True if contigious: #self.warning("Root block: %s" % block) previous = block size += blocksize continue seek(first) desc = desc_format % (first, previous, previous-first+1) yield RawBytes(self, name, size//8, desc) first = block previous = block size = self.sector_size seek(first) desc = desc_format % (first, previous, previous-first+1) yield RawBytes(self, name, size//8, desc) | 1187501c091976e1e6c040a77cfe46f572f5e0fb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/1187501c091976e1e6c040a77cfe46f572f5e0fb/ole2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1396,
12,
2890,
16,
1272,
16,
508,
67,
3239,
4672,
508,
273,
2213,
87,
63,
4279,
738,
508,
67,
3239,
1122,
273,
599,
2416,
273,
599,
963,
273,
374,
787,
273,
1272,
9614,
1937,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1396,
12,
2890,
16,
1272,
16,
508,
67,
3239,
4672,
508,
273,
2213,
87,
63,
4279,
738,
508,
67,
3239,
1122,
273,
599,
2416,
273,
599,
963,
273,
374,
787,
273,
1272,
9614,
1937,
... |
s0 = SubByte(kj[0,c-1]) | s0 = SubByte(kj[0, c-1]) | def key_schedule(self, kj, i): """ Return $k_i$ for a given $i$ and $k_j$ with $j = i-1$. TESTS: sage: sr = mq.SR(10,4,4,8, star=True, allow_zero_inversions=True) sage: ki = sr.state_array() sage: for i in range(10): ... ki = sr.key_schedule(ki,i+1) sage: print sr.hex_str_matrix(ki) B4 3E 23 6F EF 92 E9 8F 5B E2 51 18 CB 11 CF 8E """ if i < 0: raise TypeError, "i must be >= i" | e506ccc2459e6e3948659b0d1b28d9d6b70342e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e506ccc2459e6e3948659b0d1b28d9d6b70342e4/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
67,
10676,
12,
2890,
16,
417,
78,
16,
277,
4672,
3536,
2000,
271,
79,
67,
77,
8,
364,
279,
864,
271,
77,
8,
471,
271,
79,
67,
78,
8,
598,
271,
78,
273,
277,
17,
21,
8,
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,
498,
67,
10676,
12,
2890,
16,
417,
78,
16,
277,
4672,
3536,
2000,
271,
79,
67,
77,
8,
364,
279,
864,
271,
77,
8,
471,
271,
79,
67,
78,
8,
598,
271,
78,
273,
277,
17,
21,
8,
18,... |
filename = "0-REGTYPE" | filename = "/0-REGTYPE" | def test_seek(self): """Test seek() method of _FileObject, incl. random reading. """ if self.sep != "|": filename = "0-REGTYPE" self.tar.extract(filename, dirname()) data = file(os.path.join(dirname(), filename), "rb").read() | 17e0b35990981886e883d198e3696cf53a8b312a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/17e0b35990981886e883d198e3696cf53a8b312a/test_tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16508,
12,
2890,
4672,
3536,
4709,
6520,
1435,
707,
434,
389,
21471,
16,
2823,
18,
2744,
6453,
18,
3536,
309,
365,
18,
10814,
480,
11747,
6877,
1544,
273,
2206,
20,
17,
5937,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16508,
12,
2890,
4672,
3536,
4709,
6520,
1435,
707,
434,
389,
21471,
16,
2823,
18,
2744,
6453,
18,
3536,
309,
365,
18,
10814,
480,
11747,
6877,
1544,
273,
2206,
20,
17,
5937,
... |
node.parent = self | self.setup_child(node) | def __iadd__(self, other): """Append a node or a list of nodes to `self.children`.""" if isinstance(other, Node): other.parent = self self.children.append(other) elif other is not None: for node in other: node.parent = self self.children.extend(other) return self | ce302a0be7bbc33d68baaa7a9d7f15c61a340fc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/ce302a0be7bbc33d68baaa7a9d7f15c61a340fc9/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
77,
1289,
972,
12,
2890,
16,
1308,
4672,
3536,
5736,
279,
756,
578,
279,
666,
434,
2199,
358,
1375,
2890,
18,
5906,
68,
12123,
309,
1549,
12,
3011,
16,
2029,
4672,
1308,
18,
2938... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
77,
1289,
972,
12,
2890,
16,
1308,
4672,
3536,
5736,
279,
756,
578,
279,
666,
434,
2199,
358,
1375,
2890,
18,
5906,
68,
12123,
309,
1549,
12,
3011,
16,
2029,
4672,
1308,
18,
2938... |
else if ((unsigned short) val > sptr[mid].high) low = mid + 1; else return 1; | } else { if ((unsigned short) val > sptr[mid].high) { low = mid + 1; } else { return 1; } } | #ifdef __cplusplus | c4b8189aa746926a31722287db10cddc8d89a315 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/c4b8189aa746926a31722287db10cddc8d89a315/genChRanges.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
1001,
71,
10103,
10103,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
1001,
71,
10103,
10103,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if value and not hasattr(value, 'second'): | if value and isinstance(value, datetime.date): | def process(value): if value and not hasattr(value, 'second'): return datetime.datetime(value.year, value.month, value.day) else: return value | 116e19f7f0c9a7c50ea52825a70ac00a83e95fa8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1074/116e19f7f0c9a7c50ea52825a70ac00a83e95fa8/mssql.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
1132,
4672,
309,
460,
471,
1549,
12,
1132,
16,
3314,
18,
712,
4672,
327,
3314,
18,
6585,
12,
1132,
18,
6874,
16,
460,
18,
7496,
16,
460,
18,
2881,
13,
469,
30,
327,
460,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1207,
12,
1132,
4672,
309,
460,
471,
1549,
12,
1132,
16,
3314,
18,
712,
4672,
327,
3314,
18,
6585,
12,
1132,
18,
6874,
16,
460,
18,
7496,
16,
460,
18,
2881,
13,
469,
30,
327,
460,
... |
new_price = new_price / to_uom.factor | new_price = new_price / to_uom.rate | def _compute_price(self, cursor, user, from_uom, price, to_uom=False): """ Convert price for given uom's. from_uom and to_uom should be browse records. """ if not from_uom or not price or not to_uom: return price if from_uom.category.id <> to_uom.category.id: return price if from_uom.factor_data: new_price = float(price) / from_uom.factor_data else: new_price = float(price) * from_uom.factor | 1c3eb8968b62e8d0dd32434c2ed5ad19c170cb2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9285/1c3eb8968b62e8d0dd32434c2ed5ad19c170cb2e/uom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9200,
67,
8694,
12,
2890,
16,
3347,
16,
729,
16,
628,
67,
89,
362,
16,
6205,
16,
358,
67,
89,
362,
33,
8381,
4672,
3536,
4037,
6205,
364,
864,
582,
362,
1807,
18,
628,
67,
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,
389,
9200,
67,
8694,
12,
2890,
16,
3347,
16,
729,
16,
628,
67,
89,
362,
16,
6205,
16,
358,
67,
89,
362,
33,
8381,
4672,
3536,
4037,
6205,
364,
864,
582,
362,
1807,
18,
628,
67,
89,... |
def test_get_cpu_times(self): user_time, kernel_time = psutil.Process(os.getpid()).get_cpu_times() utime, ktime = os.times()[:2] if (max([user_time, utime]) - min([user_time, utime])) > 0.1: self.fail("expected: %s, found: %s" %(utime, user_time)) time.strftime("%H:%M:%S", time.localtime(user_time)) time.strftime("%H:%M:%S", time.localtime(kernel_time)) | if not sys.platform.lower().startswith("darwin") \ and not sys.platform.lower().startswith("freebsd"): def test_get_cpu_times(self): user_time, kernel_time = psutil.Process(os.getpid()).get_cpu_times() utime, ktime = os.times()[:2] if (max([user_time, utime]) - min([user_time, utime])) > 0.1: self.fail("expected: %s, found: %s" %(utime, user_time)) if (max([kernel_time, ktime]) - min([kernel_time, ktime])) > 0.1: self.fail("expected: %s, found: %s" %(ktime, kernel_time)) time.strftime("%H:%M:%S", time.localtime(user_time)) time.strftime("%H:%M:%S", time.localtime(kernel_time)) | def test_get_cpu_times(self): user_time, kernel_time = psutil.Process(os.getpid()).get_cpu_times() utime, ktime = os.times()[:2] | 138adacb57532cc8d3679d45699ec77ea6d1e759 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7296/138adacb57532cc8d3679d45699ec77ea6d1e759/test_psutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
67,
11447,
67,
8293,
12,
2890,
4672,
729,
67,
957,
16,
5536,
67,
957,
273,
27024,
18,
2227,
12,
538,
18,
588,
6610,
1435,
2934,
588,
67,
11447,
67,
8293,
1435,
5218,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
67,
11447,
67,
8293,
12,
2890,
4672,
729,
67,
957,
16,
5536,
67,
957,
273,
27024,
18,
2227,
12,
538,
18,
588,
6610,
1435,
2934,
588,
67,
11447,
67,
8293,
1435,
5218,
4... |
else: r_dev.Close() | def _RecursiveAssembleBD(disk, owner, as_primary): """Activate a block device for an instance. This is run on the primary and secondary nodes for an instance. This function is called recursively. Args: disk: a objects.Disk object as_primary: if we should make the block device read/write Returns: the assembled device or None (in case no device was assembled) If the assembly is not successful, an exception is raised. """ children = [] if disk.children: mcn = disk.ChildrenNeeded() if mcn == -1: mcn = 0 # max number of Nones allowed else: mcn = len(disk.children) - mcn # max number of Nones for chld_disk in disk.children: try: cdev = _RecursiveAssembleBD(chld_disk, owner, as_primary) except errors.BlockDeviceError, err: if children.count(None) >= mcn: raise cdev = None logger.Debug("Error in child activation: %s" % str(err)) children.append(cdev) if as_primary or disk.AssembleOnSecondary(): r_dev = bdev.AttachOrAssemble(disk.dev_type, disk.physical_id, children) r_dev.SetSyncSpeed(constants.SYNC_SPEED) result = r_dev if as_primary or disk.OpenOnSecondary(): r_dev.Open() else: r_dev.Close() DevCacheManager.UpdateCache(r_dev.dev_path, owner, as_primary, disk.iv_name) else: result = True return result | 40a03283a837fd7ec9f60142e620433e82421347 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/40a03283a837fd7ec9f60142e620433e82421347/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10483,
1463,
10045,
18096,
12,
10863,
16,
3410,
16,
487,
67,
8258,
4672,
3536,
21370,
279,
1203,
2346,
364,
392,
791,
18,
225,
1220,
353,
1086,
603,
326,
3354,
471,
9946,
2199,
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,
389,
10483,
1463,
10045,
18096,
12,
10863,
16,
3410,
16,
487,
67,
8258,
4672,
3536,
21370,
279,
1203,
2346,
364,
392,
791,
18,
225,
1220,
353,
1086,
603,
326,
3354,
471,
9946,
2199,
364,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.