rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if group not in self.public: self.logger.error("Failed to set client %s to private group %s" % (client, group)) | if profile not in self.public: self.logger.error("Failed to set client %s to private group %s" % (client, profile)) | def set_group(self, client, group): '''Set group parameter for provided client''' self.logger.info("Asserting client %s profile to %s" % (client, group)) if False in self.states.values(): raise MetadataRuntimeError if group not in self.public: self.logger.error("Failed to set client %s to private group %s" % (client, group)) raise MetadataConsistencyError if self.clients.has_key(client): self.logger.info("Changing %s group from %s to %s" % (client, self.clients[client], group)) cli = self.clientdata.xpath('/Clients/Client[@name="%s"]' % (client)) cli[0].set('group', group) else: lxml.etree.SubElement(self.clientdata.getroot(), 'Client', name=client, profile=group) self.clients[client] = group self.write_back_clients() | 6fc4c7e8366cbf0150a3e9715d2ee80f09d439a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/6fc4c7e8366cbf0150a3e9715d2ee80f09d439a3/Metadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1655,
12,
2890,
16,
1004,
16,
1041,
4672,
9163,
694,
1041,
1569,
364,
2112,
1004,
26418,
365,
18,
4901,
18,
1376,
2932,
8213,
310,
1004,
738,
87,
3042,
358,
738,
87,
6,
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,
444,
67,
1655,
12,
2890,
16,
1004,
16,
1041,
4672,
9163,
694,
1041,
1569,
364,
2112,
1004,
26418,
365,
18,
4901,
18,
1376,
2932,
8213,
310,
1004,
738,
87,
3042,
358,
738,
87,
6,
738,
... |
list.sort(lambda l, r:cmp(key(l), key(r))) | list.sort(lambda l, r: cmp(key(l), key(r))) | def listsort(list, key): "helper to sort by key in Python 2.3" try: list.sort(key=key) except TypeError: list.sort(lambda l, r:cmp(key(l), key(r))) | 4a8d8af9a778314e085474978405a659540b0c1c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/4a8d8af9a778314e085474978405a659540b0c1c/cvsps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
3804,
12,
1098,
16,
498,
4672,
315,
4759,
358,
1524,
635,
498,
316,
6600,
576,
18,
23,
6,
775,
30,
666,
18,
3804,
12,
856,
33,
856,
13,
1335,
3580,
30,
666,
18,
3804,
12,
1466... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
3804,
12,
1098,
16,
498,
4672,
315,
4759,
358,
1524,
635,
498,
316,
6600,
576,
18,
23,
6,
775,
30,
666,
18,
3804,
12,
856,
33,
856,
13,
1335,
3580,
30,
666,
18,
3804,
12,
1466... |
ol.store.indexer = Indexer() | def init_plugin(): """Initialize infobase plugin.""" from infogami.infobase import common, dbstore, server, logger dbstore.default_schema = schema.get_schema() if config.get('errorlog'): common.record_exception = lambda: save_error(config.errorlog, 'infobase') ol = server.get_site('openlibrary.org') ib = server._infobase # install custom indexer ol.store.indexer = Indexer() if config.get('writelog'): ib.add_event_listener(logger.Logger(config.writelog)) ib.add_event_listener(invalidate_most_recent_change) if ol: if config.get('http_listeners'): ol.add_trigger(None, http_notify) if config.get('booklog'): global booklogger booklogger = logger.Logger(config.booklog) ol.add_trigger('/type/edition', write_booklog) ol.add_trigger('/type/author', write_booklog2) # hook to add count functionality server.app.add_mapping("/([^/]*)/count_editions_by_author", __name__ + ".count_editions_by_author") server.app.add_mapping("/([^/]*)/count_editions_by_work", __name__ + ".count_editions_by_work") server.app.add_mapping("/([^/]*)/count_edits_by_user", __name__ + ".count_edits_by_user") server.app.add_mapping("/([^/]*)/most_recent", __name__ + ".most_recent") server.app.add_mapping("/([^/]*)/clear_cache", __name__ + ".clear_cache") server.app.add_mapping("/([^/]*)/stats/(\d\d\d\d-\d\d-\d\d)", __name__ + ".stats") server.app.add_mapping("/([^/]*)/has_user", __name__ + ".has_user") server.app.add_mapping("/([^/]*)/olid_to_key", __name__ + ".olid_to_key") | da7471575aead267f26bde7c7bb7c4db93437775 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/da7471575aead267f26bde7c7bb7c4db93437775/ol_infobase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
4094,
13332,
3536,
7520,
1123,
1969,
1909,
12123,
628,
1123,
75,
26223,
18,
1376,
1969,
1930,
2975,
16,
1319,
2233,
16,
1438,
16,
1194,
1319,
2233,
18,
1886,
67,
4821,
273,
196... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
4094,
13332,
3536,
7520,
1123,
1969,
1909,
12123,
628,
1123,
75,
26223,
18,
1376,
1969,
1930,
2975,
16,
1319,
2233,
16,
1438,
16,
1194,
1319,
2233,
18,
1886,
67,
4821,
273,
196... | |
threading.Thread(target=run).start() | threading.Thread(target=run).start() | def run(): with JSContext(g) as ctxt: ctxt.eval(""" started.wait(); for (i=0; i<10; i++) { sleep(100); } finished.release(); """) | d76ea3f452d147f051e65b20fdab9b87a8b84413 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2065/d76ea3f452d147f051e65b20fdab9b87a8b84413/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13332,
598,
6756,
1042,
12,
75,
13,
487,
14286,
30,
14286,
18,
8622,
2932,
3660,
5746,
18,
7048,
5621,
225,
364,
261,
77,
33,
20,
31,
277,
32,
2163,
31,
277,
27245,
288,
5329,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
13332,
598,
6756,
1042,
12,
75,
13,
487,
14286,
30,
14286,
18,
8622,
2932,
3660,
5746,
18,
7048,
5621,
225,
364,
261,
77,
33,
20,
31,
277,
32,
2163,
31,
277,
27245,
288,
5329,
... |
return read_ptr[0], None | return read_ptr[0], lltype.nullptr(rffi.CCHARP.TO) | def do_recv_string(self, space, maxlength): from pypy.module._multiprocessing.interp_win32 import ( _ReadFile) from pypy.rlib import rwin32 | c8a395526acc384b8abc9423dba4c5bcf6d8e363 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/c8a395526acc384b8abc9423dba4c5bcf6d8e363/interp_connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
18334,
67,
1080,
12,
2890,
16,
3476,
16,
943,
2469,
4672,
628,
18951,
93,
18,
2978,
6315,
5421,
625,
19507,
18,
24940,
67,
8082,
1578,
1930,
261,
389,
1994,
812,
13,
628,
1895... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
67,
18334,
67,
1080,
12,
2890,
16,
3476,
16,
943,
2469,
4672,
628,
18951,
93,
18,
2978,
6315,
5421,
625,
19507,
18,
24940,
67,
8082,
1578,
1930,
261,
389,
1994,
812,
13,
628,
1895... |
'total': fields.float('Sub Total', readonly=True, digits=(16, int(config['price_accuracy']))), | 'total': fields.float('Sub Total', readonly=True, digits=(16, 4)), | def onchange_amount(self, cr, uid, ids, amount, typ): amt = amount if typ and typ == 'per': if int(amt) > 0: amt = amt / 100 return {'value':{'amount':amt}} | 21786ff375c69b960b487a69bd1343b8b77f3dec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/21786ff375c69b960b487a69bd1343b8b77f3dec/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
8949,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
3844,
16,
3815,
4672,
25123,
273,
3844,
309,
3815,
471,
3815,
422,
296,
457,
4278,
309,
509,
12,
301,
88,
13,
405,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
8949,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
3844,
16,
3815,
4672,
25123,
273,
3844,
309,
3815,
471,
3815,
422,
296,
457,
4278,
309,
509,
12,
301,
88,
13,
405,
37... |
'note': line.notes, | 'note': line.notes, | def make_invoice_by_partner(partner, orders, lines_ids): """ create a new invoice for one supplier @param partner : The object partner @param orders : The set of orders to add in the invoice @param lines : The list of line's id """ a = partner.property_account_payable.id if partner and partner.property_payment_term.id: pay_term = partner.property_payment_term.id else: pay_term = False inv = { 'name': multiple_order_invoice_name(orders), 'origin': multiple_order_invoice_name(orders), 'type': 'in_invoice', 'reference': multiple_order_invoice_reference(partner, orders), 'account_id': a, 'partner_id': partner.id, 'address_invoice_id': orders[0].partner_address_id.id, 'address_contact_id': orders[0].partner_address_id.id, 'invoice_line': [(6,0,lines_ids)], 'currency_id' : orders[0].pricelist_id.currency_id.id, 'comment': multiple_order_invoice_notes(orders), 'payment_term': pay_term, 'fiscal_position': partner.property_account_position.id } inv_id = invoice_obj.create(cr, uid, inv) return inv_id | 3f6d20200662753d065a64276225bd8b208f71db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f6d20200662753d065a64276225bd8b208f71db/purchase_line_invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16119,
67,
1637,
67,
31993,
12,
31993,
16,
11077,
16,
2362,
67,
2232,
4672,
3536,
752,
279,
394,
9179,
364,
1245,
17402,
632,
891,
19170,
294,
1021,
733,
19170,
632,
891,
11077... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16119,
67,
1637,
67,
31993,
12,
31993,
16,
11077,
16,
2362,
67,
2232,
4672,
3536,
752,
279,
394,
9179,
364,
1245,
17402,
632,
891,
19170,
294,
1021,
733,
19170,
632,
891,
11077... |
variant = self.model.data(self.model.index(0,0,QtCore.QModelIndex()), QtCore.Qt.WhatsThisRole) | variant = self.model.data(self.model.index(0, 0, QtCore.QModelIndex()), QtCore.Qt.WhatsThisRole) | def data(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::data() """ # Invalid index should return an invalid qvariant assert( not self.model.data(QtCore.QModelIndex(), QtCore.Qt.DisplayRole).isValid()) | ed4ea4fec39587cca2aeb18d36a0fa5f722ca150 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1679/ed4ea4fec39587cca2aeb18d36a0fa5f722ca150/modeltest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
4672,
3536,
7766,
87,
365,
18,
2284,
1807,
4471,
434,
20193,
18,
53,
7469,
1180,
1488,
2866,
892,
1435,
3536,
468,
1962,
770,
1410,
327,
392,
2057,
1043,
8688,
1815,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
4672,
3536,
7766,
87,
365,
18,
2284,
1807,
4471,
434,
20193,
18,
53,
7469,
1180,
1488,
2866,
892,
1435,
3536,
468,
1962,
770,
1410,
327,
392,
2057,
1043,
8688,
1815,
12,
... |
title=title, desc=desc, tags=tags, search_hidden=not visible, safety=safety, is_public=is_public, is_family=is_family, is_friend=is_friend, content_type=content_type) | title=title, desc=desc, tags=tags, search_hidden=not visible, safety=safety, is_public=is_public, is_family=is_family, is_friend=is_friend, content_type=content_type, progress_tracker=self.upload_progress_tracker) | def upload(self, response=None): """Upload worker function, called by the File->Upload callback. As this calls itself in the deferred callback, it takes a response argument.""" | d35662d034077396062db82bd5cff8ad3142aee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11023/d35662d034077396062db82bd5cff8ad3142aee6/postr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
12,
2890,
16,
766,
33,
7036,
4672,
3536,
4777,
4322,
445,
16,
2566,
635,
326,
1387,
2122,
4777,
1348,
18,
225,
2970,
333,
4097,
6174,
316,
326,
7045,
1348,
16,
518,
5530,
279,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3617,
12,
2890,
16,
766,
33,
7036,
4672,
3536,
4777,
4322,
445,
16,
2566,
635,
326,
1387,
2122,
4777,
1348,
18,
225,
2970,
333,
4097,
6174,
316,
326,
7045,
1348,
16,
518,
5530,
279,
76... |
for item in value: self.append(item) | if value: for item in value: self.append(item) pass | def __init__(self, componentType=Asn1Object, value=[]): Sequence.__init__(self) self.componentType = componentType ## Add each item in the list to ourselves, which automatically ## checks each one to ensure it is of the correct type. self.value = [] for item in value: self.append(item) pass return | 641c35fa0811624c987dacde01a02371a9b4848a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3520/641c35fa0811624c987dacde01a02371a9b4848a/rfc1155.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
20065,
33,
1463,
82,
21,
921,
16,
460,
33,
8526,
4672,
8370,
16186,
2738,
972,
12,
2890,
13,
365,
18,
4652,
559,
273,
20065,
225,
7541,
1436,
1517,
761,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20065,
33,
1463,
82,
21,
921,
16,
460,
33,
8526,
4672,
8370,
16186,
2738,
972,
12,
2890,
13,
365,
18,
4652,
559,
273,
20065,
225,
7541,
1436,
1517,
761,
... |
A=self.copy().transitive_closure().am() return len(set(A.nonzero_positions()) & set(A.transpose().nonzero_positions())-set([(i,i) for i in xrange(self.order())]))==0 | if not self.is_directed(): if self.size()-len(self.loop_edges())>0: return False else: return True gpaths=self.copy().multiple_edges(False).loops(False).transitive_closure().edges(labels=False) for e in gpaths: if (e[1],e[0]) in gpaths: return False return True | def antisymmetric(self): r""" Returns True if the relation given by the graph is antisymmetric and False otherwise. | a60690fb8f2dcf9d15bb5fe0588bb32d1d7327bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a60690fb8f2dcf9d15bb5fe0588bb32d1d7327bb/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17841,
291,
2942,
6899,
12,
2890,
4672,
436,
8395,
2860,
1053,
309,
326,
2533,
864,
635,
326,
2667,
353,
17841,
291,
2942,
6899,
471,
1083,
3541,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17841,
291,
2942,
6899,
12,
2890,
4672,
436,
8395,
2860,
1053,
309,
326,
2533,
864,
635,
326,
2667,
353,
17841,
291,
2942,
6899,
471,
1083,
3541,
18,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
'license.txt' | 'license.txt', | def _find_rl_accel(): '''locate where the accelerator code lives''' _ = [] for x in [ './rl_addons/rl_accel', '../rl_addons/rl_accel', '../../rl_addons/rl_accel', './rl_accel', '../rl_accel', '../../rl_accel', './lib'] \ + glob.glob('./rl_accel-*/rl_accel')\ + glob.glob('../rl_accel-*/rl_accel') \ + glob.glob('../../rl_accel-*/rl_accel') \ : fn = pjoin(x,'_rl_accel.c') if isfile(pjoin(x,'_rl_accel.c')): _.append(x) if _: if len(_)>1: _.sort(_cmp_rl_accel_dirs) return abspath(_[0]) return None | ca5ea18795855c1352a5cf1753739ded20b6ea88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ca5ea18795855c1352a5cf1753739ded20b6ea88/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
1321,
67,
30737,
13332,
9163,
25450,
1625,
326,
15153,
7385,
981,
328,
3606,
26418,
389,
273,
5378,
364,
619,
316,
306,
12871,
1321,
67,
1289,
7008,
19,
1321,
67,
30737,
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,
4720,
67,
1321,
67,
30737,
13332,
9163,
25450,
1625,
326,
15153,
7385,
981,
328,
3606,
26418,
389,
273,
5378,
364,
619,
316,
306,
12871,
1321,
67,
1289,
7008,
19,
1321,
67,
30737,
2... |
roundtrip(expr, s) | roundtrip(parser.expr, s) | def test_expr(s): print "expr:", s roundtrip(expr, s) | e3fb18c1c47bda766c8e234368f4884cec1189ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3fb18c1c47bda766c8e234368f4884cec1189ce/test_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8638,
12,
87,
4672,
1172,
315,
8638,
2773,
16,
272,
3643,
25125,
12,
4288,
18,
8638,
16,
272,
13,
225,
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,
1842,
67,
8638,
12,
87,
4672,
1172,
315,
8638,
2773,
16,
272,
3643,
25125,
12,
4288,
18,
8638,
16,
272,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
file.Write("static %s valid_%s_table[] = {\n" % (_ENUM_LISTS[enum]['type'], ToUnderscore(enum))) for value in _ENUM_LISTS[enum]['valid']: file.Write(" %s,\n" % value) file.Write("};\n") file.Write("\n") | if len(_ENUM_LISTS[enum]['valid']) > 0: file.Write("static %s valid_%s_table[] = {\n" % (_ENUM_LISTS[enum]['type'], ToUnderscore(enum))) for value in _ENUM_LISTS[enum]['valid']: file.Write(" %s,\n" % value) file.Write("};\n") file.Write("\n") | def WriteServiceUtilsImplementation(self, filename): """Writes the gles2 auto generated utility implementation.""" file = CHeaderWriter(filename) enums = sorted(_ENUM_LISTS.keys()) for enum in enums: file.Write("static %s valid_%s_table[] = {\n" % (_ENUM_LISTS[enum]['type'], ToUnderscore(enum))) for value in _ENUM_LISTS[enum]['valid']: file.Write(" %s,\n" % value) file.Write("};\n") file.Write("\n") file.Write("Validators::Validators()\n") pre = ': ' post = ',' count = 0 for enum in enums: count += 1 if count == len(enums): post = ' {' code = """ %(pre)s%(name)s( valid_%(name)s_table, arraysize(valid_%(name)s_table))%(post)s | 7488d96ce5234f2e7435017c99a90d54aad7f99d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/7488d96ce5234f2e7435017c99a90d54aad7f99d/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
1989,
13621,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
314,
1040,
22,
3656,
4374,
12788,
4471,
12123,
585,
273,
385,
1864,
2289,
12,
3459,
13,
17922,
273,
3115,
24899,
16509,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
1989,
13621,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
314,
1040,
22,
3656,
4374,
12788,
4471,
12123,
585,
273,
385,
1864,
2289,
12,
3459,
13,
17922,
273,
3115,
24899,
16509,
... |
return errorMsg(msg, req, c, ln) | return errorMsg(str(msg), req, ln) | def getfile(req, form): args = wash_urlargd(form, websubmit_templates.files_default_urlargd) ln = args['ln'] | 382a1f25f9b0d159df208291e44a573986f659ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/382a1f25f9b0d159df208291e44a573986f659ca/websubmit_webinterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
768,
12,
3658,
16,
646,
4672,
833,
273,
341,
961,
67,
718,
3175,
72,
12,
687,
16,
3311,
9297,
67,
8502,
18,
2354,
67,
1886,
67,
718,
3175,
72,
13,
7211,
273,
833,
3292,
2370,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
768,
12,
3658,
16,
646,
4672,
833,
273,
341,
961,
67,
718,
3175,
72,
12,
687,
16,
3311,
9297,
67,
8502,
18,
2354,
67,
1886,
67,
718,
3175,
72,
13,
7211,
273,
833,
3292,
2370,
... |
ids = self.db.data.parse(search) if search and search.strip() else self.db.data.universal_set() | if authorid: authorid=int(authorid) au = self.db.authors(authorid, index_is_id=True) ids = self.db.data.get_matches('authors', au) else: ids = self.db.data.parse(search) if search and search.strip() else self.db.data.universal_set() | def stanza(self, search=None, sortby=None): 'Feeds to read calibre books on a ipod with stanza.' books = [] updated = self.db.last_modified() cherrypy.response.headers['Last-Modified'] = self.last_modified(updated) cherrypy.response.headers['Content-Type'] = 'text/xml' if not sortby and not search: return self.STANZA_MAIN.generate(subtitle='', data=books, FM=FIELD_MAP, updated=updated, id='urn:calibre:main').render('xml') ids = self.db.data.parse(search) if search and search.strip() else self.db.data.universal_set() record_list = list(iter(self.db)) if sortby == "byauthor": record_list.sort(lambda x, y: cmp(x[FIELD_MAP['author_sort']], y[FIELD_MAP['author_sort']])) elif sortby == "bytitle": record_list.sort(lambda x, y: cmp(title_sort(x[FIELD_MAP['title']]), title_sort(y[FIELD_MAP['title']]))) else: record_list = reversed(record_list) for record in record_list: if record[0] not in ids: continue r = record[FIELD_MAP['formats']] r = r.upper() if r else '' if 'EPUB' in r or 'PDB' in r: z = record[FIELD_MAP['authors']] if not z: z = _('Unknown') authors = ' & '.join([i.replace('|', ',') for i in z.split(',')]) extra = [] rating = record[FIELD_MAP['rating']] if rating > 0: rating = ''.join(repeat('★', rating)) extra.append('RATING: %s<br />'%rating) tags = record[FIELD_MAP['tags']] if tags: extra.append('TAGS: %s<br />'%\ prepare_string_for_xml(', '.join(tags.split(',')))) series = record[FIELD_MAP['series']] if series: extra.append('SERIES: %s [%s]<br />'%\ (prepare_string_for_xml(series), fmt_sidx(float(record[FIELD_MAP['series_index']])))) fmt = 'epub' if 'EPUB' in r else 'pdb' mimetype = guess_type('dummy.'+fmt)[0] books.append(self.STANZA_ENTRY.generate( authors=authors, record=record, FM=FIELD_MAP, port=self.opts.port, extra=''.join(extra), mimetype=mimetype, fmt=fmt, timestamp=strftime('%Y-%m-%dT%H:%M:%S+00:00', record[5]), ).render('xml').decode('utf8')) | 69a9eddfeabf848e39d1a6b2049361f916a1fd99 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/69a9eddfeabf848e39d1a6b2049361f916a1fd99/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21650,
12,
2890,
16,
1623,
33,
7036,
16,
1524,
1637,
33,
7036,
4672,
296,
8141,
87,
358,
855,
26139,
266,
6978,
87,
603,
279,
2359,
369,
598,
21650,
1093,
6978,
87,
273,
5378,
3526,
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,
21650,
12,
2890,
16,
1623,
33,
7036,
16,
1524,
1637,
33,
7036,
4672,
296,
8141,
87,
358,
855,
26139,
266,
6978,
87,
603,
279,
2359,
369,
598,
21650,
1093,
6978,
87,
273,
5378,
3526,
27... |
good = spam = unknown = None | good = [] spam = [] unknown = [] | def main(): """Main program; parse options and go.""" try: opts, args = getopt.getopt(sys.argv[1:], 'hdfg:s:p:u:') except getopt.error, msg: usage(2, msg) if not opts: usage(2, "No options given") pck = DEFAULTDB good = spam = unknown = None do_filter = usedb = False for opt, arg in opts: if opt == '-h': usage(0) elif opt == '-g': good = arg elif opt == '-s': spam = arg elif opt == '-p': pck = arg elif opt == "-d": usedb = True elif opt == "-f": do_filter = True elif opt == '-u': unknown = arg if args: usage(2, "Positional arguments not allowed") save = False bayes = createbayes(pck, usedb) if good: print "Training ham:" train(bayes, good, False) save = True if spam: print "Training spam:" train(bayes, spam, True) save = True if save: bayes.update_probabilities() if not usedb and pck: fp = open(pck, 'wb') pickle.dump(bayes, fp, 1) fp.close() if do_filter: filter(bayes, sys.stdin, sys.stdout) if unknown: score(bayes, unknown) | c9870420a64c1bd5a600a2397e137afd48384e63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/c9870420a64c1bd5a600a2397e137afd48384e63/hammie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6376,
5402,
31,
1109,
702,
471,
1960,
12123,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
22057,
2137,
30,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6376,
5402,
31,
1109,
702,
471,
1960,
12123,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
22057,
2137,
30,
87,
... |
box = width - 20, height-35 | box = max(64, width - 20), max(64, height-35) | def get_fitted_map(centre_point, points, min_points, zoom, width, height, filename): # If we haven't been given a zoom, start as close as we can if not zoom: zoom = 18 box = width - 20, height-35 new_points = [] for i, point in enumerate(points): if i>1 and point == new_points[-1][0]: new_points[-1][1].append(i) else: new_points.append( (point, [i]) ) points = [p[0] for p in new_points] if centre_point: points = [centre_point] + list(points) point_set, points = PointSet(points[:min_points+1]), points[min_points+1:] while not point_set.contained_within(box, zoom): zoom -= 1 while point_set.contained_within(box, zoom): if not points: break new_point, points = points[0], points[1:] point_set.add(new_point) else: point_set.remove(new_point) if centre_point: used_points = point_set.ordered[1:] points = [(centre_point[0], centre_point[1], centre_point[2], None)] else: used_points = point_set.ordered[:] points = [] for i, point in enumerate(used_points): points.append( (point[0], point[1], point[2], i+1) ) get_map(points, width, height, filename, zoom) if centre_point: new_points = new_points[:len(point_set)-1] else: new_points = new_points[:len(point_set)] return new_points, zoom | 9584e7362a2b8425f889ee7c14e7bf5943c705b4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14173/9584e7362a2b8425f889ee7c14e7bf5943c705b4/draw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7216,
2344,
67,
1458,
12,
2998,
266,
67,
1153,
16,
3143,
16,
1131,
67,
4139,
16,
7182,
16,
1835,
16,
2072,
16,
1544,
4672,
225,
468,
971,
732,
15032,
1404,
2118,
864,
279,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7216,
2344,
67,
1458,
12,
2998,
266,
67,
1153,
16,
3143,
16,
1131,
67,
4139,
16,
7182,
16,
1835,
16,
2072,
16,
1544,
4672,
225,
468,
971,
732,
15032,
1404,
2118,
864,
279,
7... |
response = resource.delete() | delete_args = getattr(settings, "ROA_CUSTOM_ARGS", {}) response = resource.delete(**delete_args) | def delete(self): assert self._get_pk_val() is not None, "%s object can't be deleted " \ "because its %s attribute is set to None." \ % (self._meta.object_name, self._meta.pk.attname) # Deletion in cascade should be done server side. resource = Resource(self.get_resource_url_detail()) logger.debug("""Deleting : "%s" through %s""" % \ (unicode(self).encode(settings.DEFAULT_CHARSET), resource.uri.encode(settings.DEFAULT_CHARSET))) response = resource.delete() | 4bceab8c69fbeee462b0f98e3ccf5af2704b6992 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8248/4bceab8c69fbeee462b0f98e3ccf5af2704b6992/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
2890,
4672,
1815,
365,
6315,
588,
67,
5465,
67,
1125,
1435,
353,
486,
599,
16,
2213,
87,
733,
848,
1404,
506,
4282,
315,
521,
315,
26274,
2097,
738,
87,
1566,
353,
444,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
12,
2890,
4672,
1815,
365,
6315,
588,
67,
5465,
67,
1125,
1435,
353,
486,
599,
16,
2213,
87,
733,
848,
1404,
506,
4282,
315,
521,
315,
26274,
2097,
738,
87,
1566,
353,
444,
358,
... |
c2pread, c2pwrite = CreatePipe(None, 0) | c2pread, c2pwrite = _subprocess.CreatePipe(None, 0) | def _get_handles(self, stdin, stdout, stderr): """Construct and return tuple with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin is None and stdout is None and stderr is None: return (None, None, None, None, None, None) | a2936cfa0989988f3e9f9ce6aec7d5657a2f73ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/a2936cfa0989988f3e9f9ce6aec7d5657a2f73ba/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
3193,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
896,
1... |
editor.ted.WEUseText(Res.Resource(Text)) editor.ted.WECalText() editor.SetPort() editor.GetWindow().InvalWindowRect(editor._bounds) | editor.set(Text) | def replaceall(self): editor = findeditor(self) if not editor: return if self.visible: self.getparmsfromwindow() W.SetCursor("watch") find = self.parms["find"] if not find: return findlen = len(find) replace = self.parms["replace"] replacelen = len(replace) Text = editor.get() if not self.parms["casesens"]: find = string.lower(find) text = string.lower(Text) else: text = Text newtext = "" pos = 0 counter = 0 while 1: if self.parms["wholeword"]: wholewordRE = _makewholewordpattern(find) match = wholewordRE.search(text, pos) if match: pos = match.start(1) else: pos = -1 else: pos = string.find(text, find, pos) if pos < 0: break counter = counter + 1 text = text[:pos] + replace + text[pos + findlen:] Text = Text[:pos] + replace + Text[pos + findlen:] pos = pos + replacelen W.SetCursor("arrow") if counter: self.hide() import EasyDialogs from Carbon import Res editor.textchanged() editor.selectionchanged() editor.ted.WEUseText(Res.Resource(Text)) editor.ted.WECalText() editor.SetPort() editor.GetWindow().InvalWindowRect(editor._bounds) #editor.ted.WEUpdate(self.w.wid.GetWindowPort().visRgn) EasyDialogs.Message("Replaced %d occurrences" % counter) | 7b0255153f2402d9853b29cc7bd4ea1dce14a997 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7b0255153f2402d9853b29cc7bd4ea1dce14a997/PyEdit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
454,
12,
2890,
4672,
4858,
273,
574,
785,
1811,
12,
2890,
13,
309,
486,
4858,
30,
327,
309,
365,
18,
8613,
30,
365,
18,
588,
29927,
2080,
5668,
1435,
678,
18,
694,
6688,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
454,
12,
2890,
4672,
4858,
273,
574,
785,
1811,
12,
2890,
13,
309,
486,
4858,
30,
327,
309,
365,
18,
8613,
30,
365,
18,
588,
29927,
2080,
5668,
1435,
678,
18,
694,
6688,
2932,
... |
return format(ds) | return ds | def my_getdoc(obj): """ Retrieve the documentation for ``obj``. INPUT: ``obj`` - a Sage object, function, etc. OUTPUT: its documentation (string) EXAMPLES:: sage: from sage.misc.sagedoc import my_getdoc sage: s = my_getdoc(identity_matrix) sage: type(s) <type 'str'> """ try: ds = obj._sage_doc_() except (AttributeError, TypeError): # TypeError for interfaces try: ds = sageinspect.sage_getdoc(obj) except: return None if ds is None: return None return format(ds) | cf5590e9d50d1a183e30f33c1b65598d8b6892e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/cf5590e9d50d1a183e30f33c1b65598d8b6892e7/sagedoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
67,
588,
2434,
12,
2603,
4672,
3536,
10708,
326,
7323,
364,
12176,
2603,
68,
8338,
225,
12943,
30,
12176,
2603,
10335,
300,
279,
348,
410,
733,
16,
445,
16,
5527,
18,
225,
11550,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
67,
588,
2434,
12,
2603,
4672,
3536,
10708,
326,
7323,
364,
12176,
2603,
68,
8338,
225,
12943,
30,
12176,
2603,
10335,
300,
279,
348,
410,
733,
16,
445,
16,
5527,
18,
225,
11550,
... |
sage: h2.is_isomorphic(graphs.ClawGraph()) | sage: I2.is_isomorphic(graphs.ClawGraph()) | def induced_subgraph_search(self, G): r""" Returns an induced copy of `G` in self. | 84286d4be578725f91d534440b316bce27cdde2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/84286d4be578725f91d534440b316bce27cdde2f/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1547,
26372,
67,
1717,
4660,
67,
3072,
12,
2890,
16,
611,
4672,
436,
8395,
2860,
392,
1547,
26372,
1610,
434,
1375,
43,
68,
316,
365,
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,
0,
0,
0,
0,
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,
1547,
26372,
67,
1717,
4660,
67,
3072,
12,
2890,
16,
611,
4672,
436,
8395,
2860,
392,
1547,
26372,
1610,
434,
1375,
43,
68,
316,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
cur.execute("SELECT COUNT(id) FROM points") | cur.execute("SELECT COUNT(uid) FROM points") | def count(): cur = CONN.cursor() cur.execute("SELECT COUNT(id) FROM points") print cur.fetchone()[0] | c28a9e5987b90c243d19a4a6ae53234910c8464d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4641/c28a9e5987b90c243d19a4a6ae53234910c8464d/db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1056,
13332,
662,
273,
3492,
50,
18,
9216,
1435,
662,
18,
8837,
2932,
4803,
12666,
12,
1911,
13,
4571,
3143,
7923,
1172,
662,
18,
5754,
476,
1435,
63,
20,
65,
282,
2,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1056,
13332,
662,
273,
3492,
50,
18,
9216,
1435,
662,
18,
8837,
2932,
4803,
12666,
12,
1911,
13,
4571,
3143,
7923,
1172,
662,
18,
5754,
476,
1435,
63,
20,
65,
282,
2,
-100,
-100,
-100,... |
ring_point_indices= [ inner_point_indices[:radial_subdiv] ] | ring_point_indices= [ inner_point_indices[:radial_subdiv] ] | def make_extrusion_with_fine_core(rz, inner_r, max_volume_inner=1e-4, max_volume_outer=5e-2, radial_subdiv=20): min_z = min(rz_pt[1] for rz_pt in rz) max_z = max(rz_pt[1] for rz_pt in rz) from meshpy.tet import MeshInfo, build from meshpy.geometry import generate_surface_of_revolution MINUS_Z_MARKER = 1 PLUS_Z_MARKER = 2 inner_points, inner_facets, inner_holes, inner_markers = \ generate_surface_of_revolution( [ (0, min_z), (inner_r, min_z), (inner_r, max_z), (0, max_z), ], ring_markers=[ MINUS_Z_MARKER, 0, PLUS_Z_MARKER ], radial_subdiv=radial_subdiv, ) inner_point_indices = tuple(range(len(inner_points))) outer_points, outer_facets, outer_holes, outer_markers = \ generate_surface_of_revolution( [(inner_r,min_z)] + rz + [(inner_r, max_z)], ring_markers=[MINUS_Z_MARKER] + [0]*(len(rz)-1) + [PLUS_Z_MARKER], point_idx_offset=len(inner_points), radial_subdiv=radial_subdiv, ring_point_indices= [ inner_point_indices[:radial_subdiv] ] + [None]*len(rz) + [inner_point_indices[radial_subdiv:]] ) mesh_info = MeshInfo() mesh_info.set_points(inner_points + outer_points) mesh_info.set_facets_ex( inner_facets + outer_facets, inner_holes + outer_holes, inner_markers + outer_markers, ) # set regional max. volume mesh_info.regions.resize(2) mesh_info.regions[0] = [0, 0, (max_z+min_z)/2, 0, max_volume_inner] mesh_info.regions[1] = [inner_r+(rz[0][0]-inner_r)/2, 0, (max_z+min_z)/2, 0, max_volume_outer] # add periodicity mesh_info.pbc_groups.resize(1) pbcg = mesh_info.pbc_groups[0] pbcg.facet_marker_1 = MINUS_Z_MARKER pbcg.facet_marker_2 = PLUS_Z_MARKER pbcg.set_transform(translation=[0,0,max_z-min_z]) mesh = build(mesh_info, verbose=True, volume_constraints=True) #print "%d elements" % len(mesh.elements) #mesh.write_vtk("gun.vtk") fvi2fm = mesh.face_vertex_indices_to_face_marker def zper_boundary_tagger(fvi, el, fn, points): face_marker = fvi2fm[frozenset(fvi)] if face_marker == MINUS_Z_MARKER: return ["minus_z"] elif face_marker == PLUS_Z_MARKER: return ["plus_z"] else: return ["shell"] from hedge.mesh import make_conformal_mesh return make_conformal_mesh(mesh.points, mesh.elements, zper_boundary_tagger, periodicity=[None, None, ("minus_z", "plus_z")]) | 592adeeb615eb5497b4dae9329f92c603720e638 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12869/592adeeb615eb5497b4dae9329f92c603720e638/geometry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
14523,
7063,
67,
1918,
67,
74,
558,
67,
3644,
12,
86,
94,
16,
3443,
67,
86,
16,
943,
67,
9491,
67,
7872,
33,
21,
73,
17,
24,
16,
943,
67,
9491,
67,
14068,
33,
25,
73,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
14523,
7063,
67,
1918,
67,
74,
558,
67,
3644,
12,
86,
94,
16,
3443,
67,
86,
16,
943,
67,
9491,
67,
7872,
33,
21,
73,
17,
24,
16,
943,
67,
9491,
67,
14068,
33,
25,
73,
... |
updatefiledate(dstfile) | def CopyFile(dstfile,srcfile): if (dstfile[-1]=='/'): dstdir = dstfile fnl = srcfile.rfind("/") if (fnl < 0): fn = srcfile else: fn = srcfile[fnl+1:] dstfile = dstdir + fn if (older(dstfile,srcfile)): global VERBOSE if VERBOSE >= 1: print "Copying \"%s\" --> \"%s\""%(srcfile, dstfile) WriteFile(dstfile,ReadFile(srcfile)) updatefiledate(dstfile) ALLTARGETS.append(dstfile) | a7a6d72930ad9abe29a3a3863f5e83ab3573bc1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/a7a6d72930ad9abe29a3a3863f5e83ab3573bc1a/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5631,
812,
12,
11057,
768,
16,
4816,
768,
4672,
309,
261,
11057,
768,
18919,
21,
65,
18920,
2473,
4672,
3046,
1214,
273,
3046,
768,
2295,
80,
273,
1705,
768,
18,
86,
4720,
2932,
4898,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5631,
812,
12,
11057,
768,
16,
4816,
768,
4672,
309,
261,
11057,
768,
18919,
21,
65,
18920,
2473,
4672,
3046,
1214,
273,
3046,
768,
2295,
80,
273,
1705,
768,
18,
86,
4720,
2932,
4898,
... | |
WakeupSignalTests, SiginterruptTest) | WakeupSignalTests, SiginterruptTest, ItimerTest) | def test_main(): test_support.run_unittest(BasicSignalTests, InterProcessSignalTests, WakeupSignalTests, SiginterruptTest) | 311a8954cc942ef88499747ec2ab2847789848f7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/311a8954cc942ef88499747ec2ab2847789848f7/test_signal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
1842,
67,
13261,
18,
2681,
67,
4873,
3813,
12,
8252,
11208,
14650,
16,
5294,
2227,
11208,
14650,
16,
678,
911,
416,
11208,
14650,
16,
21911,
31847,
4709,
16,
2597,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
5254,
13332,
1842,
67,
13261,
18,
2681,
67,
4873,
3813,
12,
8252,
11208,
14650,
16,
5294,
2227,
11208,
14650,
16,
678,
911,
416,
11208,
14650,
16,
21911,
31847,
4709,
16,
2597,
... |
conditions={'e': re.compile('wuzzy').search, 'a': re.compile('^[0-9]+$').match}) | conditions={'e': re.compile(b'wuzzy').search, 'a': re.compile(b'^[0-9]+$').match}) | def test03(self): tabname = "test03" try: self.tdb.Drop(tabname) except dbtables.TableDBError: pass if verbose: print('...before CreateTable...') self.tdb._db_print() self.tdb.CreateTable(tabname, ['a', 'b', 'c', 'd', 'e']) if verbose: print('...after CreateTable...') self.tdb._db_print() self.tdb.Drop(tabname) if verbose: print('...after Drop...') self.tdb._db_print() self.tdb.CreateTable(tabname, ['a', 'b', 'c', 'd', 'e']) | 53a2bb447e3d4b37a128ba62e0a43d720db1d4f7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/53a2bb447e3d4b37a128ba62e0a43d720db1d4f7/test_dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4630,
12,
2890,
4672,
3246,
529,
273,
315,
3813,
4630,
6,
775,
30,
365,
18,
88,
1966,
18,
7544,
12,
7032,
529,
13,
1335,
1319,
9373,
18,
1388,
2290,
668,
30,
1342,
309,
3988,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4630,
12,
2890,
4672,
3246,
529,
273,
315,
3813,
4630,
6,
775,
30,
365,
18,
88,
1966,
18,
7544,
12,
7032,
529,
13,
1335,
1319,
9373,
18,
1388,
2290,
668,
30,
1342,
309,
3988,
3... |
if toktype == token.ERRORTOKEN: log.debug(type(toktext), `toktext`) | def process_file(module_doc): """ Read the given C{ModuleDoc}'s file, and add variables corresponding to any objects defined in that file. In particular, read and tokenize C{module_doc.filename}, and process each logical line using L{process_line()}. """ # Keep track of the current line number: lineno = None # Use this list to collect the tokens on a single logical line: line_toks = [] # This list contains one APIDoc for each indentation level. # The first element is the APIDoc for the module, and each # subsequent element is the APIDoc for the object at that # indentation level. The final element of the list is the # C{APIDoc} for the entity that we're currently processing. parent_docs = [module_doc] # The APIDoc for the object that was defined by the previous # line, if any; or None otherwise. This is used to update # parent_docs when we encounter an indent; and to decide what # object (if any) is described by a docstring. prev_line_doc = module_doc # A list of comments that occur before or on the current # logical line, used to build the comment docstring. Each # element is a tuple (comment_text, comment_lineno). comments = [] # A list of decorator lines that occur before the current # logical line. This is used so we can process a function # declaration line and its decorators all at once. decorators = [] # A list of group names, one for each indentation level. This is # used to keep track groups that are defined by comment markers # START_GROUP_MARKER and END_GROUP_MARKER. groups = [None] # When we encounter a comment start group marker, set this to the # name of the group; but wait until we're ready to process the # next line before we actually set groups[-1] to this value. This # is necessary because at the top of a block, the tokenizer gives # us comments before the INDENT token; but if we encounter a group # start marker at the top of a block, then we want it to apply # inside that block, not outside it. start_group = None # Check if the source file declares an encoding. encoding = get_module_encoding(module_doc.filename) # The token-eating loop: try: module_file = codecs.open(module_doc.filename, 'rU', encoding) except LookupError: log.warning("Unknown encoding %r for %s; using the default" "encoding instead (iso-8859-1)" % (encoding, module_doc.filename)) encoding = 'iso-8859-1' module_file = codecs.open(module_doc.filename, 'rU', encoding) tok_iter = tokenize.generate_tokens(module_file.readline) for toktype, toktext, (srow,scol), (erow,ecol), line_str in tok_iter: # BOM encoding marker: ignore. if toktype == token.ERRORTOKEN: log.debug(type(toktext), `toktext`) if (toktype == token.ERRORTOKEN and (toktext == u'\ufeff' or toktext.encode(encoding) == '\xef\xbb\xbf')): pass # Error token: abort elif toktype == token.ERRORTOKEN: raise ParseError('Error during parsing: invalid syntax ' '(%s, line %d, char %d: %r)' % (module_doc.filename, srow, scol, toktext)) # Indent token: update the parent_doc stack. elif toktype == token.INDENT: if prev_line_doc is None: parent_docs.append(parent_docs[-1]) else: parent_docs.append(prev_line_doc) groups.append(None) # Dedent token: update the parent_doc stack. elif toktype == token.DEDENT: if line_toks == []: parent_docs.pop() groups.pop() else: # This *should* only happen if the file ends on an # indented line, with no final newline. # (otherwise, this is the wrong thing to do.) pass # Line-internal newline token: if we're still at the start of # the logical line, and we've seen one or more comment lines, # then discard them: blank lines are not allowed between a # comment block and the thing it describes. elif toktype == tokenize.NL: if comments and not line_toks: log.warning('Ignoring docstring comment block followed by ' 'a blank line in %r on line %r' % (module_doc.filename, srow-1)) comments = [] # Comment token: add to comments if appropriate. elif toktype == tokenize.COMMENT: if toktext.startswith(COMMENT_DOCSTRING_MARKER): comment_line = toktext[len(COMMENT_DOCSTRING_MARKER):].rstrip() comments.append( [comment_line, srow]) elif toktext.startswith(START_GROUP_MARKER): start_group = toktext[len(START_GROUP_MARKER):].strip() elif toktext.startswith(END_GROUP_MARKER): for i in range(len(groups)-1, -1, -1): if groups[i]: groups[i] = None break else: log.warning("Got group end marker without a corresponding " "start marker in %r on line %r" % (module_doc.filename, srow)) # Normal token: Add it to line_toks. (If it's a non-unicode # string literal, then we need to re-encode using the file's # encoding, to get back to the original 8-bit data; and then # convert that string with 8-bit data to a 7-bit ascii # representation.) elif toktype != token.NEWLINE and toktype != token.ENDMARKER: if lineno is None: lineno = srow if toktype == token.STRING: str_prefixes = re.match('[^\'"]*', toktext).group() if 'u' not in str_prefixes: s = toktext.encode(encoding) toktext = decode_with_backslashreplace(s) line_toks.append( (toktype, toktext) ) # Decorator line: add it to the decorators list. elif line_toks and line_toks[0] == (token.OP, '@'): decorators.append(shallow_parse(line_toks)) line_toks = [] # End of line token, but nothing to do. elif line_toks == []: pass # End of line token: parse the logical line & process it. else: if start_group: groups[-1] = start_group start_group = None if parent_docs[-1] != 'skip_block': try: prev_line_doc = process_line( shallow_parse(line_toks), parent_docs, prev_line_doc, lineno, comments, decorators, encoding) except ParseError, e: raise ParseError('Error during parsing: invalid ' 'syntax (%s, line %d) -- %s' % (module_doc.filename, lineno, e)) except KeyboardError, e: raise except Exception, e: log.error('Internal error during parsing (%s, line ' '%s):\n%s' % (module_doc.filename, lineno, e)) raise # grouping... if groups[-1] and prev_line_doc not in (None, 'skip_block'): if isinstance(prev_line_doc, VariableDoc): # This special case is needed for inst vars, where # parent_docs[-1] is the __init__ function, not the # containing class: add_to_group(prev_line_doc.container, prev_line_doc, groups[-1]) elif isinstance(parent_docs[-1], NamespaceDoc): add_to_group(parent_docs[-1], prev_line_doc, groups[-1]) else: prev_line_doc = None # Reset line contents. line_toks = [] lineno = None comments = [] | 098b9dc3aecc8b3fbf3cb31e9897292b02004396 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/098b9dc3aecc8b3fbf3cb31e9897292b02004396/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
768,
12,
2978,
67,
2434,
4672,
3536,
2720,
326,
864,
385,
95,
3120,
1759,
1713,
87,
585,
16,
471,
527,
3152,
4656,
358,
1281,
2184,
2553,
316,
716,
585,
18,
225,
657,
6826,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
768,
12,
2978,
67,
2434,
4672,
3536,
2720,
326,
864,
385,
95,
3120,
1759,
1713,
87,
585,
16,
471,
527,
3152,
4656,
358,
1281,
2184,
2553,
316,
716,
585,
18,
225,
657,
6826,
... | |
elif (sig.getAppearance() == GREEN) : | elif (sigState == GREEN) : | def cvtAppearanceText(self, sig) : rep = "" if (sig.getHeld()) : rep = rep + "Held " if (sig.getLit()) : rep = rep + "Lit " if (sig.getAppearance() == RED) : rep = rep + "Red " elif (sig.getAppearance() == FLASHRED) : rep = rep + "Flashing Red " elif (sig.getAppearance() == YELLOW) : rep = rep + "Yellow " elif (sig.getAppearance() == FLASHYELLOW) : rep = rep + "Flashing Yellow " elif (sig.getAppearance() == GREEN) : rep = rep + "Green " elif (sig.getAppearance() == FLASHGREEN) : rep = rep + "Flashing Green " elif (sig.getAppearance() == DARK) : rep = rep + "Dark " else : rep = rep + "Unknown " #self.msgText("Found signal " + self.giveSignalName(sig) + " displaying: " + rep + "\n") return rep | 6619b76b28dbc49528bf2dca556859e56cc65d4d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2146/6619b76b28dbc49528bf2dca556859e56cc65d4d/RobotThrottle2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8951,
88,
1294,
27668,
1528,
12,
2890,
16,
3553,
13,
294,
2071,
273,
1408,
309,
261,
7340,
18,
588,
44,
488,
10756,
294,
2071,
273,
2071,
397,
315,
44,
488,
315,
309,
261,
7340,
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,
8951,
88,
1294,
27668,
1528,
12,
2890,
16,
3553,
13,
294,
2071,
273,
1408,
309,
261,
7340,
18,
588,
44,
488,
10756,
294,
2071,
273,
2071,
397,
315,
44,
488,
315,
309,
261,
7340,
18,
... |
if singular.eval('minpoly') != self.__minpoly: | if singular.eval('minpoly') != "(" + self.__minpoly + ")": | def _singular_(self, singular=singular_default, force=False): """ Returns a singular ring for this polynomial ring over a field. Currently QQ, GF(p), and GF(p^n), CC, and RR are supported. | 2c0a43bfa6dc2829ddd314f7b6c1b914bc3b7047 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/2c0a43bfa6dc2829ddd314f7b6c1b914bc3b7047/polynomial_singular_interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
17835,
67,
12,
2890,
16,
10048,
33,
17835,
67,
1886,
16,
2944,
33,
8381,
4672,
3536,
2860,
279,
10048,
9221,
364,
333,
16991,
9221,
1879,
279,
652,
18,
15212,
2238,
53,
16,
611,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
17835,
67,
12,
2890,
16,
10048,
33,
17835,
67,
1886,
16,
2944,
33,
8381,
4672,
3536,
2860,
279,
10048,
9221,
364,
333,
16991,
9221,
1879,
279,
652,
18,
15212,
2238,
53,
16,
611,
4... |
path_info=path_info, match_val=match_val, | path_info=path_info, match_val=match_val, | def register(): config = Configurator(reg, package=_context.package) config.add_view( permission=permission, context=context, view=view, name=name, request_type=request_type, route_name=route_name, request_method=request_method, request_param=request_param, containment=containment, attr=attr, renderer=renderer, wrapper=wrapper, xhr=xhr, accept=accept, header=header, path_info=path_info, match_val=match_val, custom_predicates=custom_predicates, _info=_context.info) | 8e18ea4a560b4456ace86bdef6060304de053238 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/8e18ea4a560b4456ace86bdef6060304de053238/zcml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
13332,
642,
273,
1903,
10662,
12,
1574,
16,
2181,
33,
67,
2472,
18,
5610,
13,
642,
18,
1289,
67,
1945,
12,
4132,
33,
9827,
16,
819,
33,
2472,
16,
1476,
33,
1945,
16,
508,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
13332,
642,
273,
1903,
10662,
12,
1574,
16,
2181,
33,
67,
2472,
18,
5610,
13,
642,
18,
1289,
67,
1945,
12,
4132,
33,
9827,
16,
819,
33,
2472,
16,
1476,
33,
1945,
16,
508,
33,
... |
if len(item.album) > 0: | try: | def browse(self, widget=None, root='/'): # Populates the library list with entries starting at root if not self.conn: return if root == "..": if self.view == self.VIEW_ARTIST: if self.view_artist_album == '': # Revert to top tier root = '/' else: # Revert back to second tier.. root = self.view_artist_artist self.view_artist_artist = '' self.view_artist_album = '' else: root = '/'.join(self.browser.wd.split('/')[:-1]) or '/' | fe9c231b65c1b1888a22da3b07b9d1e84c95641c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/fe9c231b65c1b1888a22da3b07b9d1e84c95641c/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
12,
2890,
16,
3604,
33,
7036,
16,
1365,
2218,
2473,
4672,
468,
10264,
17099,
326,
5313,
666,
598,
3222,
5023,
622,
1365,
309,
486,
365,
18,
4646,
30,
327,
225,
309,
1365,
422,
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,
21670,
12,
2890,
16,
3604,
33,
7036,
16,
1365,
2218,
2473,
4672,
468,
10264,
17099,
326,
5313,
666,
598,
3222,
5023,
622,
1365,
309,
486,
365,
18,
4646,
30,
327,
225,
309,
1365,
422,
3... |
osc.Message(widget.split_path[0][0], widget.split_path[0][1:len(widget.split_path)]).sendlocal(widget.port[0]) | widget.split_path[0][widget.sub_index[0]] = widget.get_value() osc.Message(widget.split_path[0][0], widget.split_path[0][1:len(widget.split_path[0])]).sendlocal(widget.port[0]) print 'osc.Message(', widget.split_path[0][0], widget.split_path[0][1:len(widget.split_path[0])], ').sendlocal(', widget.port[0], ')' | def osc_send_cb(self,widget): | 519576c119f92e6ac065e98706ed8525727550b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2237/519576c119f92e6ac065e98706ed8525727550b6/khagan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31476,
67,
4661,
67,
7358,
12,
2890,
16,
6587,
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,
... | [
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,
31476,
67,
4661,
67,
7358,
12,
2890,
16,
6587,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.assertEqual(self.linter.is_report_enabled('RP0001'), False) | self.assertEqual(self.linter.report_is_enabled('RP0001'), False) | def test_enable_report(self): self.assertEqual(self.linter.is_report_enabled('RP0001'), True) self.linter.disable('RP0001') self.assertEqual(self.linter.is_report_enabled('RP0001'), False) self.linter.enable('RP0001') self.assertEqual(self.linter.is_report_enabled('RP0001'), True) | 7a63f9b28bade89d2c46e6e763455173ab562536 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/928/7a63f9b28bade89d2c46e6e763455173ab562536/unittest_lint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7589,
67,
6006,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2890,
18,
80,
2761,
18,
291,
67,
6006,
67,
5745,
2668,
54,
52,
13304,
19899,
1053,
13,
365,
18,
80,
2761,
18,
8394... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7589,
67,
6006,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2890,
18,
80,
2761,
18,
291,
67,
6006,
67,
5745,
2668,
54,
52,
13304,
19899,
1053,
13,
365,
18,
80,
2761,
18,
8394... |
node = self.map.nearestNode(p) if not self.liveWire: if node.label() != self.startNodeLabel: self.startNodeLabel = node.label() | node = self._map.nearestNode(p) if not self._liveWire: if node.label() != self._startNodeLabel: self._startNodeLabel = node.label() | def mouseMoved(self, x, y): """It the live wire is active, it's end node is set to the nearest node and the display (overlay) is updated. Else, the nearest node is chosen as start node and highlighted.""" | 65254bc446b7c353066fe806e0424030a38d558d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/65254bc446b7c353066fe806e0424030a38d558d/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
25317,
12,
2890,
16,
619,
16,
677,
4672,
3536,
7193,
326,
8429,
6636,
353,
2695,
16,
518,
1807,
679,
756,
353,
444,
358,
326,
11431,
756,
471,
326,
2562,
261,
17312,
13,
353,
352... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
25317,
12,
2890,
16,
619,
16,
677,
4672,
3536,
7193,
326,
8429,
6636,
353,
2695,
16,
518,
1807,
679,
756,
353,
444,
358,
326,
11431,
756,
471,
326,
2562,
261,
17312,
13,
353,
352... |
stdout=subprocess.PIPE, stderr=subprocess.PIPE) | stdout=subprocess.PIPE) | def test_abs_paths(self): # Make sure all imported modules have their __file__ and __cached__ # attributes as absolute paths. Arranging to put the Lib directory on # PYTHONPATH would cause the os module to have a relative path for # __file__ if abs_paths() does not get run. sys and builtins (the # only other modules imported before site.py runs) do not have # __file__ or __cached__ because they are built-in. parent = os.path.relpath(os.path.dirname(os.__file__)) env = os.environ.copy() env['PYTHONPATH'] = parent command = 'import os; print(os.__file__, os.__cached__)' # First, prove that with -S (no 'import site'), the paths are # relative. proc = subprocess.Popen([sys.executable, '-S', '-c', command], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() self.assertEqual(proc.returncode, 0) os__file__, os__cached__ = stdout.split() self.assertFalse(os.path.isabs(os__file__)) self.assertFalse(os.path.isabs(os__cached__)) # Now, with 'import site', it works. proc = subprocess.Popen([sys.executable, '-c', command], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() self.assertEqual(proc.returncode, 0) os__file__, os__cached__ = stdout.split() self.assertTrue(os.path.isabs(os__file__)) self.assertTrue(os.path.isabs(os__cached__)) | 59691bd43e07bf3d34fffef04bd5d09508ed0827 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/59691bd43e07bf3d34fffef04bd5d09508ed0827/test_site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5113,
67,
4481,
12,
2890,
4672,
468,
4344,
3071,
777,
9101,
4381,
1240,
3675,
1001,
768,
972,
471,
1001,
7097,
972,
468,
1677,
487,
4967,
2953,
18,
225,
10371,
18183,
358,
1378... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5113,
67,
4481,
12,
2890,
4672,
468,
4344,
3071,
777,
9101,
4381,
1240,
3675,
1001,
768,
972,
471,
1001,
7097,
972,
468,
1677,
487,
4967,
2953,
18,
225,
10371,
18183,
358,
1378... |
if needsFocusedState and obj.windowClassName.startswith("Mozilla") and obj.IAccessibleRole in (ROLE_SYSTEM_COMBOBOX, ROLE_SYSTEM_DOCUMENT): | if needsFocusedState and obj.windowClassName.startswith("Mozilla") and obj.IAccessibleRole in (ROLE_SYSTEM_COMBOBOX, ROLE_SYSTEM_DOCUMENT, ROLE_SYSTEM_LIST): | def processFocusNVDAEvent(obj,needsFocusedState=True): """Processes a focus NVDA event. If the focus event is valid, it is queued. @param obj: the NVDAObject the focus event is for @type obj: L{NVDAObjects.NVDAObject} @param needsFocusedState: If true then the object or one of its ancestors, for this focus event *must* have state_focused. @type needsFocusedState: boolean @return: C{True} if the focus event is valid and was queued, C{False} otherwise. @rtype: boolean """ #this object, or one of its ancestors *must* have state_focused. Also cache the parents as we do this check if needsFocusedState and obj.windowClassName.startswith("Mozilla") and obj.IAccessibleRole in (ROLE_SYSTEM_COMBOBOX, ROLE_SYSTEM_DOCUMENT): # The focused state is not set on certain Mozilla controls. needsFocusedState=False if needsFocusedState: testObj=obj while testObj: if controlTypes.STATE_FOCUSED in testObj.states: break parent=testObj.parent testObj.parent=parent testObj=parent if not testObj: return False liveNVDAObjectTable['focus']=obj eventHandler.queueEvent('gainFocus',obj) return True | 5e742b03c6c2688566b0193473dd3ec52c3d36b3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9340/5e742b03c6c2688566b0193473dd3ec52c3d36b3/IAccessibleHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
9233,
11679,
9793,
1133,
12,
2603,
16,
20600,
30946,
1119,
33,
5510,
4672,
3536,
10599,
279,
7155,
423,
58,
9793,
871,
18,
971,
326,
7155,
871,
353,
923,
16,
518,
353,
12234,
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,
1207,
9233,
11679,
9793,
1133,
12,
2603,
16,
20600,
30946,
1119,
33,
5510,
4672,
3536,
10599,
279,
7155,
423,
58,
9793,
871,
18,
971,
326,
7155,
871,
353,
923,
16,
518,
353,
12234,
18,
... |
installer = NSISInstaller(APP_TITLE,PY2EXE_DIST, 'distribution') | installer = NSISInstaller(APP_TITLE,APP_VERSION, PY2EXE_DIST, 'distribution') | def build(self): f = open('installer.nsi', 'w') path = f.name f.write(self.installer) f.close() try: subprocess.call('"C:\Program Files\NSIS\makensis.exe" /V2 ' + path, shell=True) except Exception, e: print path traceback.print_exc(e) else: os.remove(path) | 51953b6f227877aa63affb8f5c02deb1c7384cb9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/51953b6f227877aa63affb8f5c02deb1c7384cb9/windows_installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
4672,
284,
273,
1696,
2668,
20163,
18,
2387,
77,
2187,
296,
91,
6134,
589,
273,
284,
18,
529,
284,
18,
2626,
12,
2890,
18,
20163,
13,
284,
18,
4412,
1435,
775,
30,
66... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
4672,
284,
273,
1696,
2668,
20163,
18,
2387,
77,
2187,
296,
91,
6134,
589,
273,
284,
18,
529,
284,
18,
2626,
12,
2890,
18,
20163,
13,
284,
18,
4412,
1435,
775,
30,
66... |
minimumSize=SizeType(30, 17)) | minimumSize=SizeType(30, 18)) | def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Each button just sends this event to itself. buttonPressed = BlockEvent.template('ButtonPressed', 'SendToSender').install(parcel) # The buttons. mailMessageButton = \ MailMessageButtonBlock.template('MailMessageButton', title=messages.STAMP_MAIL, buttonKind="Stamp", icon="MarkupMail", helpString=messages.STAMP_MAIL_HELP, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) taskStamp = \ TaskStampBlock.template('TaskStamp', title=messages.STAMP_TASK, buttonKind="Stamp", icon="MarkupTask", helpString=messages.STAMP_TASK_HELP, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupSpacer1 = ControlBlocks.StaticText.template('MarkupSpacer1', title=u'', stretchFactor=0.0, minimumSize=SizeType(30, 17)) calendarStamp = \ CalendarStampBlock.template('CalendarStamp', title=messages.STAMP_CALENDAR, buttonKind="Stamp", icon="MarkupEvent", helpString=messages.STAMP_CALENDAR_HELP, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupSpacer2 = ControlBlocks.StaticText.template('MarkupSpacer2', title=u'', stretchFactor=1.0) privateSwitchButton = \ PrivateSwitchButtonBlock.template('PrivateSwitchButton', title=messages.PRIVATE, buttonKind="Stamp", icon="MarkupPrivate", helpString=messages.PRIVATE, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) readOnlyIcon = \ ReadOnlyIconBlock.template('ReadOnlyIcon', title=messages.READONLY, buttonKind="Stamp", icon="MarkupReadOnly", helpString=messages.READONLY, event=buttonPressed, stretchFactor=0.0, minimumSize=SizeType(30, 17)) markupBar = ControlBlocks.ContentItemDetail.template('MarkupBar', childrenBlocks=[mailMessageButton, taskStamp, calendarStamp, markupSpacer1, privateSwitchButton, markupSpacer2, readOnlyIcon], position=0.0, toolSize=SizeType(30, 17), separatorWidth=16, stretchFactor=0.0).install(parcel) | c583de0f688a1fe9b66ec33de19d8ab9b84e99d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/c583de0f688a1fe9b66ec33de19d8ab9b84e99d1/detailblocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
13111,
5190,
12,
1065,
2183,
16,
1592,
1444,
4672,
3536,
3998,
326,
9813,
4653,
18,
3536,
225,
468,
8315,
3568,
2537,
9573,
333,
871,
358,
6174,
18,
3568,
24624,
273,
3914,
1133,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13111,
5190,
12,
1065,
2183,
16,
1592,
1444,
4672,
3536,
3998,
326,
9813,
4653,
18,
3536,
225,
468,
8315,
3568,
2537,
9573,
333,
871,
358,
6174,
18,
3568,
24624,
273,
3914,
1133,
1... |
Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, padx, pady, relief, selectbackground, selectborderwidth, selectforeground, setgrid, spacing1, spacing2, spacing3, state, tabs, takefocus, width, wrap, xscrollcommand, yscrollcommand.""" | STANDARD OPTIONS background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, padx, pady, relief, selectbackground, selectborderwidth, selectforeground, setgrid, takefocus, xscrollcommand, yscrollcommand, WIDGET-SPECIFIC OPTIONS autoseparators, height, maxundo, spacing1, spacing2, spacing3, state, tabs, undo, width, wrap, """ | def __init__(self, master=None, cnf={}, **kw): """Construct a text widget with the parent MASTER. | e331108185bb5bbfd356ca11c9a5ae5949021f46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e331108185bb5bbfd356ca11c9a5ae5949021f46/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
16,
23118,
28793,
2826,
9987,
4672,
3536,
7249,
279,
977,
3604,
598,
326,
982,
27312,
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,
0,
0,
0,
0,
0,
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,
4171,
33,
7036,
16,
23118,
28793,
2826,
9987,
4672,
3536,
7249,
279,
977,
3604,
598,
326,
982,
27312,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if not retval: return None | if not retval: return None | def get_image(self, url_only=True): """ Get the URL or actual image object for a user. | be3eac2d7b2b29439afe94f573021a3c421522b2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6270/be3eac2d7b2b29439afe94f573021a3c421522b2/CustomUser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2730,
12,
2890,
16,
880,
67,
3700,
33,
5510,
4672,
3536,
968,
326,
1976,
578,
3214,
1316,
733,
364,
279,
729,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2730,
12,
2890,
16,
880,
67,
3700,
33,
5510,
4672,
3536,
968,
326,
1976,
578,
3214,
1316,
733,
364,
279,
729,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'L,Characteristics')) | 'I,Characteristics')) | def __init__(self, **args): for key, value in args.items(): setattr(self, key, value) | d0ca75794f69f1d09fd6d31d40ba2f1e9b3b7fb4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/213/d0ca75794f69f1d09fd6d31d40ba2f1e9b3b7fb4/pefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
364,
498,
16,
460,
316,
833,
18,
3319,
13332,
9241,
12,
2890,
16,
498,
16,
460,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
364,
498,
16,
460,
316,
833,
18,
3319,
13332,
9241,
12,
2890,
16,
498,
16,
460,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
report = self._sql_query_get(cr, user, [data], 'sql_query', None, ctx, where_plus = wp) sql_query = report[data] cr.execute(sql_query) | cr.execute(data['sql_query']) | def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ overrides orm Read method.Read List of fields for report creator. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param ids: List of report creator's id. @param fields: List of fields. @return: List of Dictionary of form [{‘name_of_the_field’: value, ...}, ...] """ if context is None: context = {} data = context.get('report_id', False) if (not context) or 'report_id' not in context: return super(report_creator, self).read(cr, user, ids, fields, context, load) ctx = context or {} wp = '' if data: if self.model_set_id: wp = [self._id_get(cr, user, data, context) + (' in (%s)' % (','.join(map(lambda x: "'" + str(x) + "'", ids))))] report = self._sql_query_get(cr, user, [data], 'sql_query', None, ctx, where_plus = wp) sql_query = report[data] cr.execute(sql_query) res = cr.dictfetchall() fields_get = self.fields_get(cr, user, None, context) for r in res: for k in r: r[k] = r[k] or False field_dict = fields_get.get(k) field_type = field_dict and field_dict.get('type', False) or False if field_type and field_type == 'many2one': if r[k] == False: continue related_name = self.pool.get(field_dict.get('relation')).name_get(cr, user, [r[k]], context)[0] r[k] = related_name | 40756ba216ab71753ee35852767c991b61c500d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/40756ba216ab71753ee35852767c991b61c500d2/base_report_creator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
1466,
33,
7036,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
3536,
9515,
225,
13969,
2720,
707,
18,
1994,
987,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
1466,
33,
7036,
16,
819,
33,
7036,
16,
1262,
2218,
67,
1106,
335,
67,
896,
11,
4672,
3536,
9515,
225,
13969,
2720,
707,
18,
1994,
987,... |
selectSQL += " WHERE `%s`.`startTime` <= '%s' AND" % ( tableName, timeLimit ) | selectSQL += " WHERE `%s`.`startTime` < '%s' AND" % ( tableName, timeLimit ) | def __selectForCompactBuckets(self, typeName, timeLimit, bucketLength, nextBucketLength, connObj = False ): """ Nasty SQL query to get ideal buckets using grouping by date calculations and adding value contents """ tableName = self.__getTableName( "bucket", typeName ) selectSQL = "SELECT " sqlSelectList = [] for field in self.dbCatalog[ typeName ][ 'keys' ]: sqlSelectList.append( "`%s`.`%s`" % ( tableName, field ) ) for field in self.dbCatalog[ typeName ][ 'values' ]: sqlSelectList.append( "SUM( `%s`.`%s` )" % ( tableName, field ) ) sqlSelectList.append( "SUM( `%s`.`entriesInBucket` )" % ( tableName ) ) sqlSelectList.append( "MIN( `%s`.`startTime` )" % tableName ) sqlSelectList.append( "MAX( `%s`.`startTime` )" % tableName ) selectSQL += ", ".join( sqlSelectList ) selectSQL += " FROM `%s`" % tableName selectSQL += " WHERE `%s`.`startTime` <= '%s' AND" % ( tableName, timeLimit ) selectSQL += " `%s`.`bucketLength` = %s" % ( tableName, bucketLength ) #HACK: Horrible constant to overcome the fact that MySQL defines epoch 0 as 13:00 and *nix define epoch as 01:00 #43200 is half a day sqlGroupList = [ "CONVERT( `%s`.`startTime` / %s, UNSIGNED )" % ( tableName, nextBucketLength ) ] for field in self.dbCatalog[ typeName ][ 'keys' ]: sqlGroupList.append( "`%s`.`%s`" % ( tableName, field ) ) selectSQL += " GROUP BY %s" % ", ".join( sqlGroupList ) return self._query( selectSQL, conn = connObj ) | 13b41032681fed093279f250f41a8f53aa4fff7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/13b41032681fed093279f250f41a8f53aa4fff7b/AccountingDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4025,
1290,
16863,
14517,
12,
2890,
16,
8173,
16,
813,
3039,
16,
2783,
1782,
16,
1024,
4103,
1782,
16,
1487,
2675,
273,
1083,
262,
30,
3536,
423,
689,
93,
3063,
843,
358,
336,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4025,
1290,
16863,
14517,
12,
2890,
16,
8173,
16,
813,
3039,
16,
2783,
1782,
16,
1024,
4103,
1782,
16,
1487,
2675,
273,
1083,
262,
30,
3536,
423,
689,
93,
3063,
843,
358,
336,
23... |
comp_lenghts_pos = _write_extra_fields(output, in_size) | comp_lengths_pos = _write_extra_fields(output, in_size) | def _prepare_header(output, in_size, basename, mtime): """Returns a prepared gzip header StringIO. The gzip header is defined in RFC 1952. """ output.write("\x1f\x8b\x08") # Gzip-deflate identification flags = FEXTRA if basename: flags |= FNAME output.write(chr(flags)) # The mtime will be undefined if it does not fit. if mtime > 0xffffffffL: mtime = 0 _write32(output, mtime) deflate_flags = "\0" if COMPRESSION_LEVEL == zlib.Z_BEST_COMPRESSION: deflate_flags = "\x02" # slowest compression algorithm output.write(deflate_flags) output.write(chr(OS_CODE_UNIX)) comp_lenghts_pos = _write_extra_fields(output, in_size) if basename: output.write(basename + '\0') # original basename return comp_lenghts_pos | 599e1e2a4e20b94572217d36e0d7135c9204a61d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4495/599e1e2a4e20b94572217d36e0d7135c9204a61d/compressor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
67,
3374,
12,
2844,
16,
316,
67,
1467,
16,
4882,
16,
13158,
4672,
3536,
1356,
279,
8208,
10331,
1446,
15777,
18,
1021,
10331,
1446,
353,
2553,
316,
8372,
5342,
9401,
18,
3536,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
67,
3374,
12,
2844,
16,
316,
67,
1467,
16,
4882,
16,
13158,
4672,
3536,
1356,
279,
8208,
10331,
1446,
15777,
18,
1021,
10331,
1446,
353,
2553,
316,
8372,
5342,
9401,
18,
3536,... |
check_qso_status = 0, | is_validated = 1, | def run_stack_ingestion(g, stackFile, user_id): """ Ingestion of Stack image @param g DBGeneric instance @param stackFile full path to file @param user_id current user DB id """ global log duration_stime = time.time() ipath = os.path.dirname(stackFile) fitsNoExt = os.path.basename(stackFile.replace(FITSEXT, NULLSTRING)) debug("Starting ingestion of stack image: %s" % stackFile) res = g.execute("SELECT dflt_group_id, dflt_mode FROM youpi_siteprofile WHERE user_id=%d" % int(user_id)) perms = {'group_id': res[0][0], 'mode': res[0][1]} # First, do some cleanups... res = g.execute("""select name, checksum, id, ingestion_id from youpi_image where name = "%s";""" % fitsNoExt) # Image name found if res: # Do nothing because the same physical image is already ingested fitsNoExt = freshImageName(fitsNoExt, g) debug("[Warning] A stack image with the same name is already ingested. The stack image will be ingested as '%s'" % fitsNoExt) debug("[Warning] The IMAGEOUT_NAME value will be updated to match '%s' and the stack image will be renamed on disk" % fitsNoExt) g.setTableName('youpi_ingestion') g.insert( start_ingestion_date = getNowDateTime(duration_stime), end_ingestion_date = getNowDateTime(duration_stime), # FIXME email = '', user_id = user_id, label = "Stack %s" % os.path.basename(fitsNoExt), check_fitsverify = 0, check_qso_status = 0, check_multiple_ingestion =0, path = ipath, group_id = perms['group_id'], mode = perms['mode'], exit_code = 0 ) ingestionId = g.con.insert_id() # Get instruments res = g.execute("""select id, name from youpi_instrument;""") instruments = {} for inst in res: instruments[inst[1]] = (inst[0], re.compile(inst[1], re.I)) # MD5 sum computation debug("Computing MD5 checksum...") stime = time.time() checksum = md5.md5(open(stackFile,'rb').read()).hexdigest() etime = time.time() debug("MD5 is %s (in %.2fs)" % (checksum, etime-stime)) r = pyfits.open(stackFile) try: header = getFITSheader(r, stackFile) except IngestionError, e: # Do not process this image debug("No header found, skipping ingestion of %s" % stackFile, WARNING) raise # Keywords checks t = getFITSField(header, 'telescop') detector = getFITSField(header, 'detector') o = getFITSField(header, 'object') e = getFITSField(header, 'exptime') eq = getFITSField(header, 'equinox') channel = getFITSField(header, 'filter') debug("%s data detected" % detector) # Instrument matching instrument_id = -1 for val in instruments.values(): # Compiled pattern cp = val[1] if cp.match(detector): instrument_id = val[0] if instrument_id < 0: debug("Matching instrument '%s' not found in DB. Image ingestion skipped." % detector, WARNING) sys.exit(1) # CHANNEL DATABASE INGESTION res = g.execute("""select name from youpi_channel where name="%s";""" % channel) if not res: g.setTableName('youpi_channel') g.insert( name = channel, instrument_id = instrument_id ) else: debug("Channel %s already existing in DB" % channel) # First gets run and channel IDs q = """ SELECT chan.id, i.id FROM youpi_channel AS chan, youpi_instrument AS i WHERE chan.name = '%s' AND i.name = '%s';""" % (channel, detector) res = g.execute(q) # Then insert image into db g.setTableName('youpi_image') g.insert( name = fitsNoExt, object = o, exptime = e, equinox = eq, ingestion_date = getNowDateTime(), checksum = checksum, path = ipath, channel_id = res[0][0], ingestion_id = ingestionId, instrument_id = res[0][1] ) imageId = g.con.insert_id() # Computing image sky footprint footprint_start = time.time() poly = [] total = range(1, len(r)) if not total: total = [0] for i in total: pix1, pix2 = r[i].header['CRPIX1'], r[i].header['CRPIX2'] val1, val2 = r[i].header['CRVAL1'], r[i].header['CRVAL2'] cd11, cd12, cd21, cd22 = r[i].header['CD1_1'], r[i].header['CD1_2'], r[i].header['CD2_1'], r[i].header['CD2_2'] nax1, nax2 = r[i].header['NAXIS1'], r[i].header['NAXIS2'] x1,y1 = 1 - pix1, 1 - pix2 x2,y2 = nax1 - pix1, 1 - pix2 x3,y3 = nax1 - pix1, nax2 - pix2 x4,y4 = 1 - pix1, nax2 - pix2 ra1, dec1, ra2, dec2, ra3, dec3, ra4, dec4 = ( val1+cd11*x1+cd12*y1, val2+cd21*x1+cd22*y1, val1+cd11*x2+cd12*y2, val2+cd21*x2+cd22*y2, val1+cd11*x3+cd12*y3, val2+cd21*x3+cd22*y3, val1+cd11*x4+cd12*y4, val2+cd21*x4+cd22*y4 ) poly.append("(%.20f %.20f, %.20f %.20f, %.20f %.20f, %.20f %.20f, %.20f %.20f)" % (ra1, dec1, ra2, dec2, ra3, dec3, ra4, dec4, ra1, dec1)) q = "GeomFromText(\"MULTIPOLYGON((" for p in poly: q += "%s, " % p q = q[:-2] + "))\")" g.execute("""UPDATE youpi_image SET skyfootprint=%s WHERE name="%s";""" % (q, fitsNoExt)) # Preparing data to insert centerfield point # FIXME ra = de = 0 cf = "GeomFromText('POINT(%s %s)')" % (ra, de) qu = """UPDATE youpi_image SET centerfield=%s WHERE name="%s";""" % (cf, fitsNoExt) g.execute(qu) debug("Sky footprint/centerfield computation took %.3fs" % (time.time()-footprint_start)) debug("Ingested in database as '%s'" % fitsNoExt) # Image tagging: tag the image with a 'Stack' tag debug("Tagging image with the %s keyword" % TAG_STACK) res = g.execute("SELECT id FROM youpi_tag WHERE name='%s'" % TAG_STACK) if not res: # Add new 'STACK' tag g.setTableName('youpi_tag') g.insert(name = TAG_STACK, style = 'background-color: rgb(53, 106, 160); color:white; border:medium none -moz-use-text-color;', date = getNowDateTime(), comment = 'Used to mark stack images', user_id = user_id, group_id = perms['group_id'], mode = perms['mode'] ) tagid = g.con.insert_id() else: tagid = res[0][0] g.setTableName('youpi_rel_tagi') g.insert(image_id = imageId, tag_id = tagid) # Ingestion log duration_etime = time.time() msg = "Stack ingestion done; took %.2fs" % (duration_etime - duration_stime) debug(msg) # Close ingestion g.setTableName('youpi_ingestion') g.update( report = base64.encodestring(zlib.compress(log, 9)).replace('\n', ''), end_ingestion_date = getNowDateTime(duration_etime), wheres = {'id' : ingestionId} ) return fitsNoExt + FITSEXT | 77bc1bab697b9a405a53c05f33cb1b5adbc547da /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11651/77bc1bab697b9a405a53c05f33cb1b5adbc547da/stack_ingestion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
3772,
67,
310,
6868,
12,
75,
16,
2110,
812,
16,
729,
67,
350,
4672,
3536,
657,
75,
6868,
434,
7283,
1316,
632,
891,
314,
2383,
7014,
791,
632,
891,
2110,
812,
1983,
589,
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,
1086,
67,
3772,
67,
310,
6868,
12,
75,
16,
2110,
812,
16,
729,
67,
350,
4672,
3536,
657,
75,
6868,
434,
7283,
1316,
632,
891,
314,
2383,
7014,
791,
632,
891,
2110,
812,
1983,
589,
35... |
for playout in ( BrainDeadPlayout, ): | for playout in ( BrainDeadPlayout, BacklogPlayout ): | def test_playout_packets(self): "Test with RTP Packets" | daa81fd67870f250ea1ccc06a81b713af3f0f0af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1265/daa81fd67870f250ea1ccc06a81b713af3f0f0af/test_playout.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1601,
659,
67,
28717,
12,
2890,
4672,
315,
4709,
598,
534,
11130,
7930,
2413,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
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,
1842,
67,
1601,
659,
67,
28717,
12,
2890,
4672,
315,
4709,
598,
534,
11130,
7930,
2413,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
def should_proceed_with_work_item(self, patch): | def _can_build_and_test(self): try: self.run_bugzilla_tool(["build-and-test", "--force-clean", "--non-interactive", "--build-style=both", "--quiet"]) except ScriptError, e: self._update_status("Unabled to successfully build and test", None) return False return True def _builders_are_green(self): | def should_proceed_with_work_item(self, patch): red_builders_names = self.tool.buildbot.red_core_builders_names() if red_builders_names: red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names. self._update_status("Builders [%s] are red. See http://build.webkit.org" % ", ".join(red_builders_names), None) return False self._update_status("Landing patch", patch) return True | a9b73ae699767fbd4d0dc74cf257c57899b132a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/a9b73ae699767fbd4d0dc74cf257c57899b132a9/queues.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4169,
67,
3510,
67,
464,
67,
3813,
12,
2890,
4672,
775,
30,
365,
18,
2681,
67,
925,
15990,
67,
6738,
3816,
6,
3510,
17,
464,
17,
3813,
3113,
5238,
5734,
17,
6200,
3113,
5238,
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,
389,
4169,
67,
3510,
67,
464,
67,
3813,
12,
2890,
4672,
775,
30,
365,
18,
2681,
67,
925,
15990,
67,
6738,
3816,
6,
3510,
17,
464,
17,
3813,
3113,
5238,
5734,
17,
6200,
3113,
5238,
58... |
p = 0 i = (19 - y2) * 19 + x2 commandoptions = (p << 10) + i | def domove(self, frompos, topos): #(x, y) = frompos (x2, y2) = topos | c79d18b86f21957cf4bae5c10e626824ad3d923e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3479/c79d18b86f21957cf4bae5c10e626824ad3d923e/net_go.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4092,
841,
12,
2890,
16,
628,
917,
16,
358,
917,
4672,
468,
12,
92,
16,
677,
13,
273,
628,
917,
261,
92,
22,
16,
677,
22,
13,
273,
358,
917,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4092,
841,
12,
2890,
16,
628,
917,
16,
358,
917,
4672,
468,
12,
92,
16,
677,
13,
273,
628,
917,
261,
92,
22,
16,
677,
22,
13,
273,
358,
917,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
date = streams[i][0].stats.starttime.date print 'fetching station data from seishub...' lon, lat, ele = getCoord(net, sta) | print "-" * 70 date = self.streams[i][0].stats.starttime.date print 'fetching station metadata from seishub...' try: lon, lat, ele = getCoord(net, sta) except: print 'Error: could not load station metadata. Discarding stream.' self.streams.pop(i) self.dicts.pop(i) continue | def __init__(self, streams = None, options = None): self.streams = streams self.options = options #Define some flags, dictionaries and plotting options self.flagFilt=False #False:no filter True:filter self.flagFiltTyp=0 #0: bandpass 1: bandstop 2:lowpass 3: highpass self.dictFiltTyp={'Bandpass':0, 'Bandstop':1, 'Lowpass':2, 'Highpass':3} self.flagFiltZPH=False #False: no zero-phase True: zero-phase filtering self.valFiltLow=np.NaN # These are overridden with low/high estimated from sampling rate self.valFiltHigh=np.NaN self.flagWheelZoom=True #Switch use of mousewheel for zooming self.flagPhase=0 #0:P 1:S 2:Magnitude self.dictPhase={'P':0, 'S':1, 'Mag':2} self.dictPhaseInverse = {} # We need the reverted dictionary for switching throug the Phase radio button for i in self.dictPhase.items(): self.dictPhaseInverse[i[1]] = i[0] self.dictPhaseColors={'P':'red', 'S':'blue', 'Psynth':'black', 'Ssynth':'black', 'Mag':'green'} self.dictPhaseLinestyles={'P':'-', 'S':'-', 'Psynth':'--', 'Ssynth':'--'} self.pickingColor = self.dictPhaseColors['P'] self.magPickWindow=10 #Estimating the maximum/minimum in a sample-window around click self.magMinMarker='x' self.magMaxMarker='x' self.magMarkerEdgeWidth=1.8 self.magMarkerSize=20 self.axvlinewidths=1.2 #dictionary for key-bindings self.dictKeybindings = {'setPick': 'alt', 'setPickError': ' ', 'delPick': 'escape', 'setMagMin': 'alt', 'setMagMax': ' ', 'switchPhase': 'control', 'delMagMinMax': 'escape', 'switchWheelZoom': 'z', 'switchPan': 'p', 'prevStream': 'y', 'nextStream': 'x', 'setPWeight0': '0', 'setPWeight1': '1', 'setPWeight2': '2', 'setPWeight3': '3', # 'setPWeight4': '4', 'setPWeight5': '5', 'setSWeight0': '0', 'setSWeight1': '1', 'setSWeight2': '2', 'setSWeight3': '3', # 'setSWeight4': '4', 'setSWeight5': '5', 'setPPolUp': 'u', 'setPPolPoorUp': '+', 'setPPolDown': 'd', 'setPPolPoorDown': '-', 'setSPolUp': 'u', 'setSPolPoorUp': '+', 'setSPolDown': 'd', 'setSPolPoorDown': '-', 'setPOnsetImpulsive': 'i', 'setPOnsetEmergent': 'e', 'setSOnsetImpulsive': 'i', 'setSOnsetEmergent': 'e'} self.threeDlocPath = '/baysoft/obspyck/3dloc/' self.threeDlocOutfile = self.threeDlocPath + '3dloc-out' self.threeDlocInfile = self.threeDlocPath + '3dloc-in' self.threeDlocPreCall = 'rm %s %s &> /dev/null' \ % (self.threeDlocOutfile, self.threeDlocInfile) self.threeDlocCall = 'export D3_VELOCITY=/scratch/rh_vel/vp_5836/;' + \ 'export D3_VELOCITY_2=/scratch/rh_vel/vs_32220/;' + \ 'cd %s;' % self.threeDlocPath + \ '3dloc_pitsa' self.hyp2000Path = '/baysoft/obspyck/hyp_2000/' self.hyp2000Controlfile = self.hyp2000Path + 'bay2000.inp' self.hyp2000Phasefile = self.hyp2000Path + 'hyp2000.pha' self.hyp2000Stationsfile = self.hyp2000Path + 'stations.dat' self.hyp2000Summary = self.hyp2000Path + 'hypo.prt' self.hyp2000PreCall = 'rm %s %s %s &> /dev/null' \ % (self.hyp2000Phasefile, self.hyp2000Stationsfile, self.hyp2000Summary) self.hyp2000Call = 'export HYP2000_DATA=%s;' % (self.hyp2000Path) + \ 'cd $HYP2000_DATA;' + \ 'hyp2000 < bay2000.inp &> /dev/null' self.xmlEventID = None self.locationType = None self.flagSpectrogram = False # indicates which of the available events from seishub was loaded self.seishubEventCurrent = None # indicates how many events are available from seishub self.seishubEventCount = None # If keybindings option is set only show keybindings and exit if self.options.keybindings: for k, v in self.dictKeybindings.iteritems(): print "%s: \"%s\"" % (k, v) return | a7ea27b0d88f474941076cae7ab6b09e010a3a46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/a7ea27b0d88f474941076cae7ab6b09e010a3a46/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8205,
273,
599,
16,
702,
273,
599,
4672,
365,
18,
16320,
273,
8205,
365,
18,
2116,
273,
702,
468,
11644,
2690,
2943,
16,
16176,
471,
20947,
702,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8205,
273,
599,
16,
702,
273,
599,
4672,
365,
18,
16320,
273,
8205,
365,
18,
2116,
273,
702,
468,
11644,
2690,
2943,
16,
16176,
471,
20947,
702,
365,
18,... |
self.__domainName = domainName | self.domainName = domainName | def __init__(self, postfixConfigPath, postfixUser, postfixUserGroup, domainName): self.__postfixConfigPath = postfixConfigPath self.__postfixUser = postfixUser self.__postfixUserGroup = postfixUserGroup self.__pathToGroupServer = None self.__domainName = domainName | 9c65d2d39b6aef69f27d2efedb890527d81c1b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6268/9c65d2d39b6aef69f27d2efedb890527d81c1b04/setuppostfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
18923,
22341,
16,
18923,
1299,
16,
18923,
21255,
16,
21044,
4672,
365,
16186,
2767,
904,
22341,
273,
18923,
22341,
365,
16186,
2767,
904,
1299,
273,
18923,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18923,
22341,
16,
18923,
1299,
16,
18923,
21255,
16,
21044,
4672,
365,
16186,
2767,
904,
22341,
273,
18923,
22341,
365,
16186,
2767,
904,
1299,
273,
18923,
1... |
del self.cache[key] | self.cache.pop(key) | def clear(self, dbname, *args, **kwargs): """clear the cache for database dbname if *args and **kwargs are both empty, clear all the keys related to this database """ if not args and not kwargs: keys_to_del = [key for key in self.cache if key[0][1] == dbname] else: kwargs2 = self._unify_args(*args, **kwargs) keys_to_del = [key for key, _ in self._generate_keys(dbname, kwargs2) if key in self.cache] for key in keys_to_del: del self.cache[key] | acdabf76518eaaa6d59076453b1f5fa2fbd535c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/acdabf76518eaaa6d59076453b1f5fa2fbd535c0/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
12,
2890,
16,
18448,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
8507,
326,
1247,
364,
2063,
18448,
309,
380,
1968,
471,
2826,
4333,
854,
3937,
1008,
16,
2424,
777,
326,
1311,
3746,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
12,
2890,
16,
18448,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
8507,
326,
1247,
364,
2063,
18448,
309,
380,
1968,
471,
2826,
4333,
854,
3937,
1008,
16,
2424,
777,
326,
1311,
3746,... |
yield 'metanav', 'register', Markup('<a href="%s">Register</a>', (req.href.register())) | yield 'metanav', 'register', Markup('<a href="%s">Register</a>') % req.href.register() | def get_navigation_items(self, req): if not self._enable_check(): return if req.authname == 'anonymous': yield 'metanav', 'register', Markup('<a href="%s">Register</a>', (req.href.register())) | 49cc168ce5d78a200cf5232b876cfe2108793a99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6208/49cc168ce5d78a200cf5232b876cfe2108793a99/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
19537,
67,
3319,
12,
2890,
16,
1111,
4672,
309,
486,
365,
6315,
7589,
67,
1893,
13332,
327,
309,
1111,
18,
1944,
529,
422,
296,
19070,
4278,
2824,
296,
10578,
304,
842,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19537,
67,
3319,
12,
2890,
16,
1111,
4672,
309,
486,
365,
6315,
7589,
67,
1893,
13332,
327,
309,
1111,
18,
1944,
529,
422,
296,
19070,
4278,
2824,
296,
10578,
304,
842,
2187,
... |
self.connect_to(neighbour.uri) | self.connect_to(neighbour) | def _connect(self, neighbour, p, o): self.connect_to(neighbour.uri) | 0da2b9651dcdac85cdd912f47c4b826e6f932f95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/0da2b9651dcdac85cdd912f47c4b826e6f932f95/neighbour_manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3612,
12,
2890,
16,
16497,
16,
293,
16,
320,
4672,
365,
18,
3612,
67,
869,
12,
11166,
477,
18,
1650,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3612,
12,
2890,
16,
16497,
16,
293,
16,
320,
4672,
365,
18,
3612,
67,
869,
12,
11166,
477,
18,
1650,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
ar rc libmoldnamed.dll.a $OBJS fstat.o | ar rc libmoldnamed.dll.a $OBJS fstat.o _winver.o | --def moldname-msvcrt.def \ | 5ed962a58a84830cbe0f649aee7072426feb4c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/5ed962a58a84830cbe0f649aee7072426feb4c22/msys_link_VC_2008_dlls.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1493,
536,
312,
1673,
529,
17,
959,
90,
3353,
88,
18,
536,
521,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1493,
536,
312,
1673,
529,
17,
959,
90,
3353,
88,
18,
536,
521,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def comment(self, *messages): """Displays the given messages in the log file as keyword arguments. This keyword does nothing with the arguments it receives, but as they are visible in the log, this keyword can be used to display simple messages. In more complicated cases, the `Log` or `Log Many` keywords should be used. """ pass | def comment(self, *messages): """Displays the given messages in the log file as keyword arguments. This keyword does nothing with the arguments it receives, but as they are visible in the log, this keyword can be used to display simple messages. In more complicated cases, the `Log` or `Log Many` keywords should be used. """ pass | 887f5ec9cf0197c08081cfd69d126de1aefa5d04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6988/887f5ec9cf0197c08081cfd69d126de1aefa5d04/BuiltIn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2879,
12,
2890,
16,
380,
6833,
4672,
3536,
16900,
326,
864,
2743,
316,
326,
613,
585,
487,
4932,
1775,
18,
225,
1220,
4932,
1552,
5083,
598,
326,
1775,
518,
17024,
16,
1496,
487,
2898,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2879,
12,
2890,
16,
380,
6833,
4672,
3536,
16900,
326,
864,
2743,
316,
326,
613,
585,
487,
4932,
1775,
18,
225,
1220,
4932,
1552,
5083,
598,
326,
1775,
518,
17024,
16,
1496,
487,
2898,
... | |
if self.verbose>2: | if self.verbose>1: | def c_src_callkernel(self, node, nodename): # # This function serves three main goals: # # The first is stride unpacking: # it accepts input and output arguments as # float * , int* # pairs, and it constructs a kernel function call where inputs and arguments are named # like # float *, int, int, int ... # # The second is to recognize when trailing (right-most in numpy) dimensions can be collapsed as # being contiguous... (confusing... read code) # # The thrid is to make a special case for scalar element. We allow the collapsing of them. # In the ccontiguous and not contiguous case, we use registers to lower the number of memory access. | 36786abeff51a6a0001aa5e3eff879f3e04bfd25 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/36786abeff51a6a0001aa5e3eff879f3e04bfd25/elemwise.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
4816,
67,
1991,
8111,
12,
2890,
16,
756,
16,
14003,
1069,
4672,
468,
468,
1220,
445,
26255,
8925,
2774,
1960,
1031,
30,
468,
468,
1021,
1122,
353,
11084,
6167,
310,
30,
468,
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,
276,
67,
4816,
67,
1991,
8111,
12,
2890,
16,
756,
16,
14003,
1069,
4672,
468,
468,
1220,
445,
26255,
8925,
2774,
1960,
1031,
30,
468,
468,
1021,
1122,
353,
11084,
6167,
310,
30,
468,
5... |
bgimage.save(os.path.join(getTempPath(),"details-%s.png" % itemnum),"PNG",quality=99,optimize=0) | bgimage.save(os.path.join(getTempPath(),"details-%s.png" % itemnum),"PNG",quality=99,optimize=0,dpi=screendpi) | def createDetailsPage(screensize, numberofitems): """Creates all the necessary images and files for the details page.""" write( "Creating details pages") #Get the detailspage node (we must only have 1) detailnode=themeDOM.getElementsByTagName("detailspage") if detailnode.length!=1: fatalError("Cannot find detailspage element in theme file") detailnode=detailnode[0] #Get background image filename backgroundfilename = detailnode.attributes["background"].value if backgroundfilename=="": fatalError("Background image is not set in theme file") backgroundfilename = getThemeFile(themeName,backgroundfilename) write( "Background image file is %s" % backgroundfilename) if not doesFileExist(backgroundfilename): fatalError("Background image not found (%s)" % backgroundfilename) #Get menu music menumusic = "menumusic.mp2" if detailnode.hasAttribute("music"): menumusic = detailnode.attributes["music"].value #Get menu length menulength = 15 if detailnode.hasAttribute("length"): menulength = int(detailnode.attributes["length"].value) write("Music is %s, length is %s seconds" % (menumusic, menulength)) #Item counter to indicate current video item itemnum=1 while itemnum <= numberofitems: write( "Creating details page for %s" % itemnum) #Load background image bgimage=Image.open(backgroundfilename,"r").resize(screensize) draw=ImageDraw.Draw(bgimage) spumuxdom = xml.dom.minidom.parseString('<subpictures><stream><spu force="yes" start="00:00:00.0" highlight="" select="" ></spu></stream></subpictures>') spunode = spumuxdom.documentElement.firstChild.firstChild drawThemeItem(0, 0, itemnum, detailnode, bgimage, draw, None, None, "", spumuxdom, spunode, numberofitems, 0, "") #Save this details image bgimage.save(os.path.join(getTempPath(),"details-%s.png" % itemnum),"PNG",quality=99,optimize=0) #Release large amounts of memory ASAP ! del draw del bgimage #write( spumuxdom.toprettyxml()) WriteXMLToFile (spumuxdom,os.path.join(getTempPath(),"detailsspumux-%s.xml" % itemnum)) write("Encoding Details Page %s" % itemnum) encodeMenu(os.path.join(getTempPath(),"details-%s.png" % itemnum), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), "", os.path.join(getTempPath(),"details-%s.mpg" % itemnum)) #On to the next item itemnum+=1 | 3eb81cae05eb5ed00d1fe854ebd46d195ed14ebf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13713/3eb81cae05eb5ed00d1fe854ebd46d195ed14ebf/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
3790,
1964,
12,
1017,
266,
773,
554,
16,
1300,
792,
3319,
4672,
3536,
2729,
777,
326,
4573,
4602,
471,
1390,
364,
326,
3189,
1363,
12123,
225,
1045,
12,
315,
11092,
3189,
4689,
7923... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3790,
1964,
12,
1017,
266,
773,
554,
16,
1300,
792,
3319,
4672,
3536,
2729,
777,
326,
4573,
4602,
471,
1390,
364,
326,
3189,
1363,
12123,
225,
1045,
12,
315,
11092,
3189,
4689,
7923... |
key_pkl = os.path.join(root, 'key.pkl') | def refresh(self): """Update self.entry_from_key by walking the cache directory structure. | 5229fdba183eb2a3d74c88576e86b2b9e1659987 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/5229fdba183eb2a3d74c88576e86b2b9e1659987/cmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
12,
2890,
4672,
3536,
1891,
365,
18,
4099,
67,
2080,
67,
856,
635,
5442,
310,
326,
1247,
1867,
3695,
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,
4460,
12,
2890,
4672,
3536,
1891,
365,
18,
4099,
67,
2080,
67,
856,
635,
5442,
310,
326,
1247,
1867,
3695,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.timer = QTimer(self) self.connect(self.timer, SIGNAL('timeout()'), self.update) self.timer.start(200) | self.continue_updating = True single_shot(self.update) | def __init__(self, parent, db, callback, rows, path, opts, spare_server=None): QObject.__init__(self, parent) self.pd = ProgressDialog(_('Saving...'), parent=parent) self.spare_server = spare_server self.db = db self.opts = opts self.pd.setModal(True) self.pd.show() self.pd.set_min(0) self._parent = parent self.callback = callback self.callback_called = False self.rq = Queue() self.ids = [x for x in map(db.id, [r.row() for r in rows]) if x is not None] self.pd.set_max(len(self.ids)) self.pd.value = 0 self.failures = set([]) | 6e43796c9d041552a0b1e2191ab6d3a34876d2d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/6e43796c9d041552a0b1e2191ab6d3a34876d2d4/add.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1319,
16,
1348,
16,
2595,
16,
589,
16,
1500,
16,
1694,
834,
67,
3567,
33,
7036,
4672,
2238,
921,
16186,
2738,
972,
12,
2890,
16,
982,
13,
365,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1319,
16,
1348,
16,
2595,
16,
589,
16,
1500,
16,
1694,
834,
67,
3567,
33,
7036,
4672,
2238,
921,
16186,
2738,
972,
12,
2890,
16,
982,
13,
365,... |
sectionR = re.compile(r'\r\n=+ +%s +=+' % section) | sectionR = re.compile(r'\r\n=+ *%s *=+' % section) | def treat(self, page): oldText = page.get() for section in wikipedia.translate(wikipedia.getSite(), placeBeforeSection): sectionR = re.compile(r'\r\n=+ +%s +=+' % section) match = sectionR.search(oldText) if match: wikipedia.output(u'Adding references section...\n') pos = match.start() newSection = wikipedia.translate(wikipedia.getSite(), referencesSection) newText = oldText[:match.start()] + newSection + oldText[match.start():] wikipedia.showDiff(oldText, newText) if not self.always: choice = wikipedia.inputChoice(u'Do you want to accept these changes?', ['Yes', 'No', 'Always yes'], ['y', 'N', 'a'], 'N') if choice == 'n': return elif choice == 'a': self.always = True | 4f9a5c4c9ef35c7118dc79dc3fea9534ca34feaa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/4f9a5c4c9ef35c7118dc79dc3fea9534ca34feaa/noreferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10116,
12,
2890,
16,
1363,
4672,
1592,
1528,
273,
1363,
18,
588,
1435,
364,
2442,
316,
21137,
18,
13929,
12,
11999,
13744,
18,
588,
4956,
9334,
3166,
4649,
5285,
4672,
2442,
54,
273,
283... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10116,
12,
2890,
16,
1363,
4672,
1592,
1528,
273,
1363,
18,
588,
1435,
364,
2442,
316,
21137,
18,
13929,
12,
11999,
13744,
18,
588,
4956,
9334,
3166,
4649,
5285,
4672,
2442,
54,
273,
283... |
self.logger.debug('scheduled function "%s" is canceled' % e.function) | self.logger.debug('scheduled function "%s" is canceled' % e.function.__name__) | def cancel(self, ev): with self.mutex: try: e = self.queue.pop(ev) except KeyError: return False e.cancel() self.logger.debug('scheduled function "%s" is canceled' % e.function) return True | 724b008c4f34b4a005d05d3e65f2be5793dce090 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/724b008c4f34b4a005d05d3e65f2be5793dce090/scheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3755,
12,
2890,
16,
2113,
4672,
598,
365,
18,
29946,
30,
775,
30,
425,
273,
365,
18,
4000,
18,
5120,
12,
14965,
13,
1335,
4999,
30,
327,
1083,
425,
18,
10996,
1435,
365,
18,
4901,
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,
3755,
12,
2890,
16,
2113,
4672,
598,
365,
18,
29946,
30,
775,
30,
425,
273,
365,
18,
4000,
18,
5120,
12,
14965,
13,
1335,
4999,
30,
327,
1083,
425,
18,
10996,
1435,
365,
18,
4901,
18... |
while len(monitor_client.get_connections(sources[i])) == 0 and tries < max_tries: connect(sources[i], targets[i]) | connected=False while connected == False and tries < max_tries: connected = connect(sources[i], targets[i]) | def bus_connect(source, target, wait=max_tries_in_seconds) : """ Connects two lists of ports. The arguments can be a list or a string. If the latter, all the available ports of the client will be used. """ source, sources, target, targets, num_connections = _get_ports_as_list(source, target) print 'Doing %i connections. Client "%s" has %i out ports and "%s" has %i in ports' % \ (num_connections,source,len(sources),target,len(targets)) tries=0 max_tries = float(wait) / run_client_wait_time for i in xrange(num_connections) : while len(monitor_client.get_connections(sources[i])) == 0 and tries < max_tries: connect(sources[i], targets[i]) tries += 1 return num_connections | 62eed61f1b7f712de11332acdb4ed40a461bd757 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1456/62eed61f1b7f712de11332acdb4ed40a461bd757/jack_bus_connect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5766,
67,
3612,
12,
3168,
16,
1018,
16,
2529,
33,
1896,
67,
2007,
67,
267,
67,
7572,
13,
294,
3536,
8289,
87,
2795,
6035,
434,
9048,
18,
1021,
1775,
848,
506,
279,
666,
578,
279,
533... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5766,
67,
3612,
12,
3168,
16,
1018,
16,
2529,
33,
1896,
67,
2007,
67,
267,
67,
7572,
13,
294,
3536,
8289,
87,
2795,
6035,
434,
9048,
18,
1021,
1775,
848,
506,
279,
666,
578,
279,
533... |
Defn: a |--> 1.41421356237309 | Defn: a |--> 1.414213562373... | def period_lattice(self, real_embedding): r""" Returns the period lattice of the elliptic curve for the given real embedding of its base field. | 806bb0bc3b72ba47355081866d1eaf58c98e731e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/806bb0bc3b72ba47355081866d1eaf58c98e731e/ell_number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3879,
67,
80,
24966,
12,
2890,
16,
2863,
67,
23744,
4672,
436,
8395,
2860,
326,
3879,
16690,
434,
326,
415,
549,
21507,
8882,
364,
326,
864,
2863,
15853,
434,
2097,
1026,
652,
18,
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,
3879,
67,
80,
24966,
12,
2890,
16,
2863,
67,
23744,
4672,
436,
8395,
2860,
326,
3879,
16690,
434,
326,
415,
549,
21507,
8882,
364,
326,
864,
2863,
15853,
434,
2097,
1026,
652,
18,
2,
-... |
dbgmsg("subconvert() ==> " + `line[:20]`) | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _comment_rx.match(line) if m: text = m.group(1) if text: self.write("(COMMENT\n- %s \n)COMMENT\n-\\n\n" % encode(text)) line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s %s" % (m.group(1), line[m.end():]) continue m = _end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in self.autoclosing: raise LaTeXFormatError( "open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] self.write(")document\n") elif stack and envname == stack[-1]: self.write(")%s\n" % envname) del stack[-1] popping(envname, "a", len(stack) + depth) else: self.err_write("stack: %s\n" % `stack`) raise LaTeXFormatError( "environment close for %s doesn't match" % envname) line = line[m.end():] continue m = _begin_macro_rx.match(line) if m: # start of macro macroname = m.group(1) if macroname == "verbatim": # really magic case! pos = string.find(line, "\\end{verbatim}") text = line[m.end(1):pos] self.write("(verbatim\n") self.write("-%s\n" % encode(text)) self.write(")verbatim\n") line = line[pos + len("\\end{verbatim}"):] continue numbered = 1 opened = 0 if macroname[-1] == "*": macroname = macroname[:-1] numbered = 0 if macroname in self.autoclosing and macroname in stack: while stack[-1] != macroname: top = stack.pop() if top and top not in self.discards: self.write(")%s\n-\\n\n" % top) popping(top, "b", len(stack) + depth) if macroname not in self.discards: self.write("-\\n\n)%s\n-\\n\n" % macroname) popping(macroname, "c", len(stack) + depth - 1) del stack[-1] # if macroname in self.discards: self.push_output(StringIO.StringIO()) else: self.push_output(self.ofp) # params, optional, empty, environ = self.start_macro(macroname) if not numbered: self.write("Anumbered TOKEN no\n") # rip off the macroname if params: if optional and len(params) == 1: line = line[m.end():] else: line = line[m.end(1):] elif empty: line = line[m.end(1):] else: line = line[m.end():] # # Very ugly special case to deal with \item[]. The catch # is that this needs to occur outside the for loop that # handles attribute parsing so we can 'continue' the outer # loop. # if optional and type(params[0]) is type(()): # the attribute name isn't used in this special case pushing(macroname, "a", depth + len(stack)) stack.append(macroname) self.write("(%s\n" % macroname) m = _start_optional_rx.match(line) if m: self.line = line[m.end():] line = self.subconvert("]", depth + len(stack)) line = "}" + line continue # handle attribute mappings here: for attrname in params: if optional: optional = 0 if type(attrname) is type(""): m = _optional_rx.match(line) if m: line = line[m.end():] self.write("A%s TOKEN %s\n" % (attrname, encode(m.group(1)))) elif type(attrname) is type(()): # This is a sub-element; but don't place the # element we found on the stack (\section-like) pushing(macroname, "b", len(stack) + depth) stack.append(macroname) self.write("(%s\n" % macroname) macroname = attrname[0] m = _start_group_rx.match(line) if m: line = line[m.end():] elif type(attrname) is type([]): # A normal subelement: <macroname><attrname>...</>... attrname = attrname[0] if not opened: opened = 1 self.write("(%s\n" % macroname) pushing(macroname, "c", len(stack) + depth) self.write("(%s\n" % attrname) pushing(attrname, "sub-elem", len(stack) + depth + 1) self.line = skip_white(line)[1:] line = self.subconvert("}", len(stack) + depth + 1)[1:] dbgmsg("subconvert() ==> " + `line[:20]`) popping(attrname, "sub-elem", len(stack) + depth + 1) self.write(")%s\n" % attrname) else: m = _parameter_rx.match(line) if not m: raise LaTeXFormatError( "could not extract parameter %s for %s: %s" % (attrname, macroname, `line[:100]`)) value = m.group(1) if _token_rx.match(value): dtype = "TOKEN" else: dtype = "CDATA" self.write("A%s %s %s\n" % (attrname, dtype, encode(value))) line = line[m.end():] if params and type(params[-1]) is type('') \ and (not empty) and not environ: # attempt to strip off next '{' m = _start_group_rx.match(line) if not m: raise LaTeXFormatError( "non-empty element '%s' has no content: %s" % (macroname, line[:12])) line = line[m.end():] if not opened: self.write("(%s\n" % macroname) pushing(macroname, "d", len(stack) + depth) if empty: line = "}" + line stack.append(macroname) self.pop_output() continue if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line[1:] return self.line if line[0] == "}": # end of macro or group macroname = stack[-1] conversion = self.table.get(macroname) if macroname \ and macroname not in self.discards \ and type(conversion) is not type(""): # otherwise, it was just a bare group self.write(")%s\n" % stack[-1]) popping(macroname, "d", len(stack) + depth - 1) del stack[-1] line = line[1:] continue if line[0] == "{": pushing("", "e", len(stack) + depth) stack.append("") line = line[1:] continue if line[0] == "\\" and line[1] in ESCAPED_CHARS: self.write("-%s\n" % encode(line[1])) line = line[2:] continue if line[:2] == r"\\": self.write("(BREAK\n)BREAK\n") line = line[2:] continue m = _text_rx.match(line) if m: text = encode(m.group()) self.write("-%s\n" % text) line = line[m.end():] continue # special case because of \item[] if line[0] == "]": self.write("-]\n") line = line[1:] continue # avoid infinite loops extra = "" if len(line) > 100: extra = "..." raise LaTeXFormatError("could not identify markup: %s%s" % (`line[:100]`, extra)) while stack and stack[-1] in self.autoclosing: self.write("-\\n\n") self.write(")%s\n" % stack[-1]) popping(stack.pop(), "e", len(stack) + depth - 1) if stack: raise LaTeXFormatError("elements remain on stack: " + string.join(stack, ", ")) # otherwise we just ran out of input here... | 54fb7fb9d0ff1c96849572ff809cc9323e87bfa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54fb7fb9d0ff1c96849572ff809cc9323e87bfa4/latex2esis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... | |
for key in ("connect_time", "compress", "named_pipe", "use_unicode", | for key in ("connect_timeout", "compress", "named_pipe", "use_unicode", | def __init__(self, db, user, password='', host='localhost', port=None, **kw): global MySQLdb if MySQLdb is None: import MySQLdb self.module = MySQLdb self.host = host self.port = port self.db = db self.user = user self.password = password if kw.has_key('client_encoding'): self.client_encoding = col.popKey(kw, 'client_encoding') else: self.client_encoding = None self.kw = {} if MySQLdb.version_info[0] > 1 or (MySQLdb.version_info[0] == 1 and \ (MySQLdb.version_info[1] > 2 or \ (MySQLdb.version_info[1] == 2 and MySQLdb.version_info[2] >= 1))): self.need_unicode = True else: self.need_unicode = False for key in ("unix_socket", "init_command", "read_default_file", "read_default_group", "charset"): if key in kw: self.kw[key] = col.popKey(kw, key) for key in ("connect_time", "compress", "named_pipe", "use_unicode", "client_flag", "local_infile"): if key in kw: self.kw[key] = int(col.popKey(kw, key)) if "sqlobject_encoding" in kw: self.encoding = col.popKey(kw, "sqlobject_encoding") else: self.encoding = 'ascii' DBAPI.__init__(self, **kw) | 2bffb1e4c1566ef9c001cf2c8408a625c3edc039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6718/2bffb1e4c1566ef9c001cf2c8408a625c3edc039/mysqlconnection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1319,
16,
729,
16,
2201,
2218,
2187,
1479,
2218,
13014,
2187,
1756,
33,
7036,
16,
2826,
9987,
4672,
2552,
13485,
1966,
309,
13485,
1966,
353,
599,
30,
1930... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1319,
16,
729,
16,
2201,
2218,
2187,
1479,
2218,
13014,
2187,
1756,
33,
7036,
16,
2826,
9987,
4672,
2552,
13485,
1966,
309,
13485,
1966,
353,
599,
30,
1930... |
self._biasDirection = self.ai.data.get('pipeBiasDirection', None) self._threshold = self.ai.data.get('pipeThresholdDirection', None) | self._biasDirection = self._config.get('pipeBiasDirection', None) self._threshold = self._config.get('pipeThresholdDirection', None) | def enter(self): # Ensure pipe tracking ensurePipeTracking(self.queuedEventHub, self.ai) self._pipe = ram.motion.pipe.Pipe(0, 0, 0) | 620b5ebc7340cc2854fe58c19fb49ec8586071ef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10608/620b5ebc7340cc2854fe58c19fb49ec8586071ef/pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6103,
12,
2890,
4672,
468,
7693,
6010,
11093,
3387,
11546,
12642,
12,
2890,
18,
19499,
1133,
8182,
16,
365,
18,
10658,
13,
225,
365,
6315,
14772,
273,
24975,
18,
81,
8240,
18,
14772,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6103,
12,
2890,
4672,
468,
7693,
6010,
11093,
3387,
11546,
12642,
12,
2890,
18,
19499,
1133,
8182,
16,
365,
18,
10658,
13,
225,
365,
6315,
14772,
273,
24975,
18,
81,
8240,
18,
14772,
18,... |
def run(self, workdir='testing') : | def run(self, workdir='testing', verbose=True) : | def run(self, workdir='testing') : try : startdir = os.getcwd() os.mkdir(self.workdir) os.chdir(self.workdir) startTime = time.time() print self.title + ":" + workdir for mystep in self.steps : print "Processing step: " +mystep for task in eval('self.'+mystep+"['tasks']") : #print " "+ eval('self.'+mystep+"['"+task+"']") mycommand = "self."+mystep+"['"+task+"']" the_args = eval(mycommand) arg_list = '' thecommand=task+'(' count = 0 if(the_args.has_key('args')) : argscount = len(the_args['args'].keys()) argcount = 0 comma = ', ' for key in the_args['args'] : argcount = argcount+1 if(argcount == argscount): comma = '' quoteit = '' if type(the_args['args'][key]) == str : quoteit = "'" arg_list=arg_list+key+'='+quoteit+str(the_args['args'][key])+quoteit+comma thecommand=thecommand+arg_list elif(len(the_args.keys())>1) : argscount = len(the_args[count]['args'].keys()) argcount = 0 comma = ', ' for key in the_args[count]['args'] : argcount = argcount+1 if(argcount == argscount): comma = '' quoteit = '' if type(the_args[count]['args'][key]) == str : quoteit = "'" arg_list=arg_list+key+'='+quoteit+str(the_args[count]['args'][key])+quoteit+comma thecommand=thecommand+arg_list count = count + 1 thecommand=thecommand+')' beginTime = time.time() eval(thecommand) endTime = time.time() print " " + task+': Time to complete was '+str(endTime-beginTime) if (eval("self."+mystep+".has_key('verify')")) : verified = eval('self.'+mystep+"['verify']()") if not verified : print mystep + " has failed verification." return False else : print ' '+mystep+' verified' endTime = time.time() print 'Total time was: '+str(endTime-startTime) os.chdir(startdir) return True except Exception, instance: | 2eebc59ae6fdf89b8bf06912bdb12b288ff388f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/2eebc59ae6fdf89b8bf06912bdb12b288ff388f5/regressframe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
22231,
2218,
3813,
310,
2187,
3988,
33,
5510,
13,
294,
775,
294,
787,
1214,
273,
1140,
18,
588,
11089,
1435,
1140,
18,
26686,
12,
2890,
18,
1252,
1214,
13,
1140,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
22231,
2218,
3813,
310,
2187,
3988,
33,
5510,
13,
294,
775,
294,
787,
1214,
273,
1140,
18,
588,
11089,
1435,
1140,
18,
26686,
12,
2890,
18,
1252,
1214,
13,
1140,
18... |
try: error_type=error_type.__name__ except: pass | if hasattr(error_type, '__name__'): error_type=error_type.__name__ | def raise_standardErrorMessage( self, client=None, REQUEST={}, error_type=None, error_value=None, tb=None, error_tb=None, error_message='', tagSearch=regex.compile('[a-zA-Z]>').search): | 9374afaa368952ac209b2b9c9a69657d9ecd8993 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9374afaa368952ac209b2b9c9a69657d9ecd8993/SimpleItem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1002,
67,
10005,
14935,
12,
365,
16,
1004,
33,
7036,
16,
12492,
28793,
555,
67,
723,
33,
7036,
16,
555,
67,
1132,
33,
7036,
16,
8739,
33,
7036,
16,
555,
67,
18587,
33,
7036,
16,
555,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1002,
67,
10005,
14935,
12,
365,
16,
1004,
33,
7036,
16,
12492,
28793,
555,
67,
723,
33,
7036,
16,
555,
67,
1132,
33,
7036,
16,
8739,
33,
7036,
16,
555,
67,
18587,
33,
7036,
16,
555,... |
cache.findNearest = orange.FindNearestConstructor_BruteForce(cache.data, distanceConstructor=orange.ExamplesDistanceConstructor_Euclidean(), includeSame=False) | cache.findNearest = orange.FindNearestConstructor_BruteForce(cache.data, distanceConstructor=orange.ExamplesDistanceConstructor_Euclidean(), includeSame=True) | def tubedRegression(cache, dimensions, progressCallback = None): if not cache.findNearest: cache.findNearest = orange.FindNearestConstructor_BruteForce(cache.data, distanceConstructor=orange.ExamplesDistanceConstructor_Euclidean(), includeSame=False) if not cache.attrStat: cache.attrStat = orange.DomainBasicAttrStat(cache.data) normalizers = cache.findNearest.distance.normalizers if progressCallback: nExamples = len(cache.data) nPoints = 100.0/nExamples/len(dimensions) for di, d in enumerate(dimensions): contIdx = cache.contIndices[d] minV, maxV = cache.attrStat[contIdx].min, cache.attrStat[contIdx].max if minV == maxV: continue oldNormalizer = normalizers[cache.contIndices[d]] normalizers[cache.contIndices[d]] = 0 for exi, ref_example in enumerate(cache.data): if ref_example[contIdx].isSpecial(): cache.deltas[exi][d] = "?" continue ref_x = float(ref_example[contIdx]) Sx = Sy = Sxx = Syy = Sxy = n = 0.0 nn = cache.findNearest(ref_example, cache.nNeighbours, True) mx = [abs(ex[contIdx] - ref_x) for ex in nn if not ex[contIdx].isSpecial()] # Tole ni prav - samo prevec enakih je... if not mx: cache.deltas[exi][d] = "?" continue kw = math.log(.001) / max(mx)**2 for ex in nn: if ex[contIdx].isSpecial(): continue ex_x = float(ex[contIdx]) ex_y = float(ex.getclass()) w = math.exp(kw*(ex_x-ref_x)**2) Sx += w * ex_x Sy += w * ex_y Sxx += w * ex_x**2 Syy += w * ex_y**2 Sxy += w * ex_x * ex_y n += w div = n*Sxx-Sx**2 if div and n>=3:# and i<40: b = (Sxy*n - Sx*Sy) / div | 838f9279384f7c326a0124c29d31974e232a9521 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/838f9279384f7c326a0124c29d31974e232a9521/orngPade.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
373,
329,
1617,
16345,
12,
2493,
16,
5769,
16,
4007,
2428,
273,
599,
4672,
309,
486,
1247,
18,
4720,
28031,
30,
1247,
18,
4720,
28031,
273,
578,
726,
18,
3125,
28031,
6293,
67,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
373,
329,
1617,
16345,
12,
2493,
16,
5769,
16,
4007,
2428,
273,
599,
4672,
309,
486,
1247,
18,
4720,
28031,
30,
1247,
18,
4720,
28031,
273,
578,
726,
18,
3125,
28031,
6293,
67,
19... |
middle=p64(self._pos)+'\0'*10 here=tfile.tell()+self._pos+self._thl oids=[] appoids=oids.append while srcpos: seek(srcpos) h=read(58) oid=h[:8] if index[oid]==srcpos: tappend((oid,here)) appoids(oid) write(h[:16] + spos + middle + h[-16:-8]) here=here+50 spos=h[-8:] srcpos=u64(spos) self._tvindex[src]=0 return oids finally: self._r() def close(self): self._file.close() def commitVersion(self, src, dest, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._a() try: file=self._file read=file.read seek=file.seek tfile=self._tfile write=tfile.write tappend=self._tappend index=self._index srcpos=self._vindex.get(src, 0) spos=p64(srcpos) | def abortVersion(self, src, transaction): # We are going to abort by simply storing back pointers. | c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6263,
1444,
12,
2890,
16,
1705,
16,
2492,
4672,
468,
1660,
854,
8554,
358,
6263,
635,
8616,
15729,
1473,
13857,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
6263,
1444,
12,
2890,
16,
1705,
16,
2492,
4672,
468,
1660,
854,
8554,
358,
6263,
635,
8616,
15729,
1473,
13857,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
retInfo = 'greylisting in progress: %ss (%s)' % (greylistDelay, greylistExpire) | retInfo = 'greylisting in progress: %ss' % greylistDelay | def check(self, data, *args, **keywords): sender = data.get('sender', '').lower() recipient = data.get('recipient', '').lower() client_name = data.get('client_name', '').lower() client_address = data.get('client_address') | 2b39916674dfcb14ea61bf240a83d61daf31ba90 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5428/2b39916674dfcb14ea61bf240a83d61daf31ba90/Greylist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
501,
16,
380,
1968,
16,
2826,
11771,
4672,
5793,
273,
501,
18,
588,
2668,
15330,
2187,
875,
2934,
8167,
1435,
8027,
273,
501,
18,
588,
2668,
20367,
2187,
875,
2934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
501,
16,
380,
1968,
16,
2826,
11771,
4672,
5793,
273,
501,
18,
588,
2668,
15330,
2187,
875,
2934,
8167,
1435,
8027,
273,
501,
18,
588,
2668,
20367,
2187,
875,
2934,
... |
msg = ts.utranslate(domain='quintagroup.seoptimizer', msgid=_(u'number_keywords'), | msg = ts.utranslate(domain='quintagroup.seoptimizer', msgid=_(u'number_keywords', | def validateKeywords(self, text): """ see interface """ ts = getToolByName(self.context, 'translation_service') # extract keywords from text if text.lower().strip(): keywords = map(lambda x: x.strip(), text.lower().strip().split('\n')) else: return ts.utranslate(domain='quintagroup.seoptimizer', msgid=_(u'Keywords list is empty!'), context=self.context) # request html page of context object url = '%s?without_metatag_keywords=1' % self.context.absolute_url() | eb0de1bd1d7060756f9f2c4c596203c5bf7d85ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10421/eb0de1bd1d7060756f9f2c4c596203c5bf7d85ed/keywords.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
14149,
12,
2890,
16,
977,
4672,
3536,
2621,
1560,
3536,
3742,
273,
336,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
10173,
67,
3278,
6134,
468,
2608,
7093,
628,
977,
309,
977,
18,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
14149,
12,
2890,
16,
977,
4672,
3536,
2621,
1560,
3536,
3742,
273,
336,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
10173,
67,
3278,
6134,
468,
2608,
7093,
628,
977,
309,
977,
18,
8... |
if not character_class: try: group = int(escape[1:]) return GROUP, group except ValueError: pass | code = CATEGORIES.get(escape) if code: return code | def _fixescape(escape, character_class=0): # convert escape to (type, value) if character_class: # inside a character class, we'll look in the character # escapes dictionary first code = ESCAPES.get(escape) if code: return code code = CATEGORIES.get(escape) else: code = CATEGORIES.get(escape) if code: return code code = ESCAPES.get(escape) if code: return code if not character_class: try: group = int(escape[1:]) # FIXME: only valid if group <= current number of groups return GROUP, group except ValueError: pass try: if escape[1:2] == "x": escape = escape[2:] return LITERAL, chr(int(escape[-2:], 16) & 0xff) elif str(escape[1:2]) in DIGITS: return LITERAL, chr(int(escape[1:], 8) & 0xff) elif len(escape) == 2: return LITERAL, escape[1] except ValueError: pass raise SyntaxError, "bogus escape: %s" % repr(escape) | 842e911e887411eb043a164240fdb6b694895e87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/842e911e887411eb043a164240fdb6b694895e87/sre_parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
904,
6939,
12,
6939,
16,
3351,
67,
1106,
33,
20,
4672,
468,
1765,
4114,
358,
261,
723,
16,
460,
13,
309,
3351,
67,
1106,
30,
468,
4832,
279,
3351,
667,
16,
732,
5614,
2324,
316,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
904,
6939,
12,
6939,
16,
3351,
67,
1106,
33,
20,
4672,
468,
1765,
4114,
358,
261,
723,
16,
460,
13,
309,
3351,
67,
1106,
30,
468,
4832,
279,
3351,
667,
16,
732,
5614,
2324,
316,... |
sage: interacts.decorator.demo() | sage: interacts.library.demo() | def demo(n=tuple(range(10)), m=tuple(range(10))): """ This is a demo interact that sums two numbers. INPUT: - `n` -- integer slider - `m` -- integer slider EXAMPLES:: sage: interacts.decorator.demo() <html>...</html> """ print n+m | 3598ee624f06e762d55d69091e970765a6964002 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3598ee624f06e762d55d69091e970765a6964002/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
12,
82,
33,
8052,
12,
3676,
12,
2163,
13,
3631,
312,
33,
8052,
12,
3676,
12,
2163,
3719,
4672,
3536,
1220,
353,
279,
21477,
16592,
716,
26608,
2795,
5600,
18,
225,
12943,
30,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
12,
82,
33,
8052,
12,
3676,
12,
2163,
13,
3631,
312,
33,
8052,
12,
3676,
12,
2163,
3719,
4672,
3536,
1220,
353,
279,
21477,
16592,
716,
26608,
2795,
5600,
18,
225,
12943,
30,
22... |
webPage = fu_Web.WebPage("Plot SNR / CHISQ / PSD for " + ifoName[0] + " @ " + str(trigStart),tableFileName, page) talkBack = fu_Web.talkBack(tableFileName) | webPage = webUtils.WebPage("Plot SNR / CHISQ / PSD for " + ifoName[0] + " @ " + str(trigStart),tableFileName, page+'/'+pageRelPath) talkBack = webUtils.talkBack(tableFileName) | def plotsnrchisq(gpsTime,frameFile,outputPath,pageRelPath,inspProcParams,tableFileName,page): rsqThreshold = 0; for row in inspProcParams: if row.param == "--channel-name": chanStringBase = row.value ifoName = str(row.value).split(":",1) if row.param == "--segment-length": segLen = eval(row.value) if row.param == "--sample-rate": sampleRate = eval(row.value) if row.param == "--segment-overlap": segOverlap = eval(row.value) if (row.param == "--chisq-delta"): chisqDelta = eval(row.value) if row.param =="--chisq-bins": chisqBins = eval(row.value) if row.param == "--snr-threshold": snrThreshold = eval(row.value) if row.param == "--chisq-threshold": chisqThreshold = eval(row.value) if row.param == "--rsq-veto-threshold": rsqThreshold = eval(row.value) if row.param == "--trig-start-time": trigStart = eval(row.value) if row.param == "--gps-start-time": gpsStart = eval(row.value) if row.param == "--low-frequency-cutoff": flow = eval(row.value) if row.param == "--dynamic-range-exponent": dynRange = eval(row.value) webPage = fu_Web.WebPage("Plot SNR / CHISQ / PSD for " + ifoName[0] + " @ " + str(trigStart),tableFileName, page) talkBack = fu_Web.talkBack(tableFileName) segLenSec = segLen / sampleRate segOverlapSec = segOverlap / sampleRate if (trigStart): trigPosition = int((trigStart - gpsStart - segOverlapSec ) / (segLenSec -segOverlapSec)) else: trigPosition = 0 gpsPosition = int((eval(gpsTime) - gpsStart - segOverlapSec/2. ) / (segLenSec -segOverlapSec)) if (trigPosition < 0): trigPosition = 0 position = gpsPosition - trigPosition chanNumber = str(position) chanNamePSD = chanStringBase + "_PSD" # now, read the data !! # The window width should be an input argument maybe ? duration = 2.0 # chanNums = range(16) # figure out what the hell is in this file # for chan in chanNums: # chanNameSnr = chanStringBase + "_SNRSQ_" + str(chan) # try: squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) # except: break # if position == 1: chan -= 1 # if position == 0: chan -= 2 chanNameSnr = chanStringBase + "_SNRSQ_" + chanNumber chanNameChisq = chanStringBase + "_CHISQ_" + chanNumber squareSnr_tuple = Fr.frgetvect(frameFile,chanNameSnr,-1,segLenSec,0) squareChisq_tuple = Fr.frgetvect(frameFile,chanNameChisq,-1,segLenSec,0) PSD_tuple = Fr.frgetvect(frameFile,chanNamePSD,-1,segLenSec*8,0) #print PSD_tuple snr_position = eval(gpsTime) - (gpsStart + gpsPosition* (segLenSec - segOverlapSec) ) chisq_position = snr_position # compute the snr vector snr_vector = sqrt(squareSnr_tuple[0]) # print squareSnr_tuple snr_time = array(range(0, segLen)) * squareSnr_tuple[3][0] - snr_position | c4ff6ebf945ca744caf3430716182afbbb0a2ece /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3592/c4ff6ebf945ca744caf3430716182afbbb0a2ece/plotsnrchisq_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
2844,
743,
16,
2433,
1971,
743,
16,
267,
1752,
15417,
1370,
16,
2121,
4771,
16,
2433,
4672,
225,
3597,
85,
7614,
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,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
2844,
743,
16,
2433,
1971,
743,
16,
267,
1752,
15417,
1370,
16,
2121,
4771,
16,
2433,
4672,
225,
3597,
85,
7614,
2... |
minSize = (2 * width) + (3 * self.grabSize[0]) + self.grabSize[1] self.minSize = minSize | minSize = 3 + (3 * self.grabSize[0]) + self.grabSize[1] self.minSizeLess1 = minSize - 1 | def __init__(self, cnv, x0, y0, x1, y1, tags = None, grabSize = 3, minSize = None, width = 1, fill = "white", | c27501cab7a14477428cf8488de40d84a3a02be0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6236/c27501cab7a14477428cf8488de40d84a3a02be0/ResizableRect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6227,
90,
16,
619,
20,
16,
677,
20,
16,
619,
21,
16,
677,
21,
16,
2342,
273,
599,
16,
11086,
1225,
273,
890,
16,
29343,
273,
599,
16,
1835,
273,
404,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6227,
90,
16,
619,
20,
16,
677,
20,
16,
619,
21,
16,
677,
21,
16,
2342,
273,
599,
16,
11086,
1225,
273,
890,
16,
29343,
273,
599,
16,
1835,
273,
404,... |
self["IPInfo"].setPixmapNum(1) | self["DNSInfo_Text"].setForegroundColorNum(1) self["IPInfo"].setPixmapNum(1) self["IPInfo_Text"].setForegroundColorNum(2) | def setActiveButton(self,button): if button == 1: self["EditSettingsButton"].setPixmapNum(0) self["NetworkInfo"].setPixmapNum(0) self["AdapterInfo"].setPixmapNum(1) if button == 2: self["AdapterInfo"].setPixmapNum(0) self["DhcpInfo"].setPixmapNum(0) self["NetworkInfo"].setPixmapNum(1) if button == 3: self["NetworkInfo"].setPixmapNum(0) self["IPInfo"].setPixmapNum(0) self["DhcpInfo"].setPixmapNum(1) if button == 4: self["DhcpInfo"].setPixmapNum(0) self["DNSInfo"].setPixmapNum(0) self["IPInfo"].setPixmapNum(1) if button == 5: self["IPInfo"].setPixmapNum(0) self["EditSettingsButton"].setPixmapNum(0) self["DNSInfo"].setPixmapNum(1) if button == 6: self["DNSInfo"].setPixmapNum(0) self["EditSettingsButton"].setPixmapNum(1) self["AdapterInfo"].setPixmapNum(0) | 94917f32471fd6fa65d9c014107b849f58bcdd09 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/94917f32471fd6fa65d9c014107b849f58bcdd09/NetworkSetup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20669,
3616,
12,
2890,
16,
5391,
4672,
309,
3568,
422,
404,
30,
365,
9614,
4666,
2628,
3616,
6,
8009,
542,
21816,
1458,
2578,
12,
20,
13,
365,
9614,
3906,
966,
6,
8009,
542,
21816,
145... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20669,
3616,
12,
2890,
16,
5391,
4672,
309,
3568,
422,
404,
30,
365,
9614,
4666,
2628,
3616,
6,
8009,
542,
21816,
1458,
2578,
12,
20,
13,
365,
9614,
3906,
966,
6,
8009,
542,
21816,
145... |
assert g.channels() == [[(3, 3), (4, 4)]] | assert g.channels() == [[(1, 2), (3, 3)]] | def test_zoom_in_on(): import numpy from mock import Mock, Fake sound = Mock({"numchan": 1}) sound.changed = Fake() data = numpy.array([1, 2, 3, 4], DTYPE) sound.frames = data g = Graph(sound) g.set_width(2) g.zoom_in_on(0) assert g.channels() == [[(1, 1), (2, 2)]] g.zoom_out() g.zoom_in_on(1) assert g.channels() == [[(2, 2), (3, 3)]] g.zoom_out() g.zoom_in_on(2) assert g.channels() == [[(3, 3), (4, 4)]] | 69cf4246ab4a3cc586c634937be233514ec08042 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11419/69cf4246ab4a3cc586c634937be233514ec08042/graphmodel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14932,
67,
267,
67,
265,
13332,
1930,
3972,
628,
5416,
1930,
7867,
16,
11551,
14190,
273,
7867,
12590,
6,
2107,
7472,
6877,
404,
6792,
14190,
18,
6703,
273,
11551,
1435,
501,
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,
1842,
67,
14932,
67,
267,
67,
265,
13332,
1930,
3972,
628,
5416,
1930,
7867,
16,
11551,
14190,
273,
7867,
12590,
6,
2107,
7472,
6877,
404,
6792,
14190,
18,
6703,
273,
11551,
1435,
501,
2... |
list.scroller_policy_set(elementary.ELM_SCROLLER_POLICY_OFF, elementary.ELM_SCROLLER_POLICY_ON) list.go() list.show() | self._pop.show() | def _open(self, bt, *args): self._pop = Floater(self.parent, self.obj) self._pop.size_min_set(self.pop_min_w, self.pop_min_h) | a3429e45eb119a0b2cc62e45bfe5570ac203edea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12343/a3429e45eb119a0b2cc62e45bfe5570ac203edea/details_widget_entry_button_list.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3190,
12,
2890,
16,
10921,
16,
380,
1968,
4672,
365,
6315,
5120,
273,
5450,
264,
12,
2890,
18,
2938,
16,
365,
18,
2603,
13,
365,
6315,
5120,
18,
1467,
67,
1154,
67,
542,
12,
289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3190,
12,
2890,
16,
10921,
16,
380,
1968,
4672,
365,
6315,
5120,
273,
5450,
264,
12,
2890,
18,
2938,
16,
365,
18,
2603,
13,
365,
6315,
5120,
18,
1467,
67,
1154,
67,
542,
12,
289... |
""" <text:p text:style-name="Standard"> <draw:image draw:style-name="fr1" draw:name="G2: hedgehog2" text:anchor-type="as-char" svg:width="3.2465inch" svg:height="1.6681inch" draw:z-index="0" xlink:href=" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> </text:p> """ | def unknown_visit(self, node): print "Failure processing at line", node.line print "Failure is", node.astext() raise NotImplementedError('visiting unimplemented node type: %s' % node.__class__.__name__) | 6375238ab8247c4cfacf9efad70324a50b6c7ce8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/6375238ab8247c4cfacf9efad70324a50b6c7ce8/OOwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5917,
67,
11658,
12,
2890,
16,
756,
4672,
1172,
315,
5247,
4929,
622,
980,
3113,
756,
18,
1369,
1172,
315,
5247,
353,
3113,
756,
18,
689,
408,
1435,
1002,
11206,
2668,
11658,
310,
640,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5917,
67,
11658,
12,
2890,
16,
756,
4672,
1172,
315,
5247,
4929,
622,
980,
3113,
756,
18,
1369,
1172,
315,
5247,
353,
3113,
756,
18,
689,
408,
1435,
1002,
11206,
2668,
11658,
310,
640,
... | |
print >> out, ' (relativePath(src, base), lineno + 1, desc) | writeString(out, src, base, lineno + 1, desc) | def layouts_l10n(input_files, output, base): '''Generate pot file from lib/layouts/*.{layout,inc,module}''' out = open(output, 'w') Style = re.compile(r'^Style\s+(.*)') # include ???LabelString???, but exclude comment lines LabelString = re.compile(r'^[^#]*LabelString\S*\s+(.*)') GuiName = re.compile(r'\s*GuiName\s+(.*)') ListName = re.compile(r'\s*ListName\s+(.*)') CategoryName = re.compile(r'\s*Category\s+(.*)') NameRE = re.compile(r'DeclareLyXModule.*{(.*)}') DescBegin = re.compile(r'#+\s*DescriptionBegin\s*$') DescEnd = re.compile(r'#+\s*DescriptionEnd\s*$') for src in input_files: readingDescription = False descStartLine = -1 descLines = [] lineno = 0 for line in open(src).readlines(): lineno += 1 if readingDescription: res = DescEnd.search(line) if res != None: readingDescription = False desc = " ".join(descLines) print >> out, '#: %s:%d\nmsgid "%s"\nmsgstr ""\n' % \ (relativePath(src, base), lineno + 1, desc) continue descLines.append(line[1:].strip()) continue res = DescBegin.search(line) if res != None: readingDescription = True descStartLine = lineno continue res = NameRE.search(line) if res != None: string = res.group(1) string = string.replace('\\', '\\\\').replace('"', '') if string != "": print >> out, '#: %s:%d\nmsgid "%s"\nmsgstr ""\n' % \ (relativePath(src, base), lineno + 1, string) continue res = Style.search(line) if res != None: string = res.group(1) string = string.replace('_', ' ') writeString(out, src, base, lineno, string) continue res = LabelString.search(line) if res != None: string = res.group(1) writeString(out, src, base, lineno, string) continue res = GuiName.search(line) if res != None: string = res.group(1) writeString(out, src, base, lineno, string) continue res = CategoryName.search(line) if res != None: string = res.group(1) writeString(out, src, base, lineno, string) continue res = ListName.search(line) if res != None: string = res.group(1) writeString(out, src, base, lineno, string) continue out.close() | ff0e3cd8b23542694ac5bcd9627968548a39d1fe /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7514/ff0e3cd8b23542694ac5bcd9627968548a39d1fe/lyx_pot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22412,
67,
80,
2163,
82,
12,
2630,
67,
2354,
16,
876,
16,
1026,
4672,
9163,
4625,
5974,
585,
628,
2561,
19,
28283,
30987,
95,
6741,
16,
9523,
16,
2978,
1713,
6309,
596,
273,
1696,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22412,
67,
80,
2163,
82,
12,
2630,
67,
2354,
16,
876,
16,
1026,
4672,
9163,
4625,
5974,
585,
628,
2561,
19,
28283,
30987,
95,
6741,
16,
9523,
16,
2978,
1713,
6309,
596,
273,
1696,
12,
... |
sage: w.suffix_trie() | sage: w.suffix_trie() | def suffix_trie(self): r""" Returns the suffix trie of self. | d93be2fa1dc08064b38a23d28b78345ec199a1fa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/d93be2fa1dc08064b38a23d28b78345ec199a1fa/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3758,
67,
3051,
12,
2890,
4672,
436,
8395,
2860,
326,
3758,
19080,
434,
365,
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,
3758,
67,
3051,
12,
2890,
4672,
436,
8395,
2860,
326,
3758,
19080,
434,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
result.append((u' %s="%s"' % (qname, value), False, None)) | result.append((u' %s="%s"' % (qname, value), False, None)) | def _make_start_format(tag_uri, tag_name, attributes, encoding): # We must search for translatable attributes result = [(u'<%s' % get_qname(tag_uri, tag_name), False, None)] for attr_uri, attr_name in attributes: value = attributes[(attr_uri, attr_name)] qname = get_attribute_qname(attr_uri, attr_name) value = XMLAttribute.encode(value) datatype = get_attr_datatype(tag_uri, tag_name, attr_uri, attr_name, attributes) if issubclass(datatype, Unicode): result.append((u' %s="' % qname, False, None)) context = _get_attr_context(datatype, tag_name, attr_name) value = Unicode.decode(value, encoding=encoding) result.append((u'%s' % value, True, context)) result.append((u'"', False, None)) else: result.append((u' %s="%s"' % (qname, value), False, None)) # Close the start tag if is_empty(tag_uri, tag_name): result.append((u'/>', False, None)) else: result.append((u'>', False, None)) return result | 98e9a7f968fd08b23ff330a2be983ef4af252829 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12681/98e9a7f968fd08b23ff330a2be983ef4af252829/i18n.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
1937,
67,
2139,
12,
2692,
67,
1650,
16,
1047,
67,
529,
16,
1677,
16,
2688,
4672,
468,
1660,
1297,
1623,
364,
21884,
1677,
563,
273,
306,
12,
89,
11,
32,
9,
87,
11,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
1937,
67,
2139,
12,
2692,
67,
1650,
16,
1047,
67,
529,
16,
1677,
16,
2688,
4672,
468,
1660,
1297,
1623,
364,
21884,
1677,
563,
273,
306,
12,
89,
11,
32,
9,
87,
11,
7... |
resultMask = self.getSiteMask('Banned') | resultMask = self.getSiteMask( 'Banned' ) | def getSiteSummaryWeb(self,selectDict, sortList, startItem, maxItems): """ Get the summary of jobs in a given status on all the sites in the standard Web form """ | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11021,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
326,
4916,
434,
6550,
316,
279,
864,
1267,
603,
777,
326,
9180,
316,
326,
452... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11021,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
326,
4916,
434,
6550,
316,
279,
864,
1267,
603,
777,
326,
9180,
316,
326,
452... |
\end{enumerate} \item Currently this function seems to allow you to ask for exp to | -- Currently this function seems to allow you to ask for exp to | def exp(self, prec = infinity): r""" Returns exp of this power series to the indicated precision. | e3da1adc8389e7da0a376ad725e9a58a421ff673 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/e3da1adc8389e7da0a376ad725e9a58a421ff673/power_series_ring_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1329,
12,
2890,
16,
13382,
273,
27272,
4672,
436,
8395,
2860,
1329,
434,
333,
7212,
4166,
358,
326,
17710,
6039,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1329,
12,
2890,
16,
13382,
273,
27272,
4672,
436,
8395,
2860,
1329,
434,
333,
7212,
4166,
358,
326,
17710,
6039,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._datalength = self._datalength / 2 | self._datalength = self._datalength // 2 | def _write_header(self, initlength): if self._aifc and self._comptype != 'NONE': self._init_compression() self._file.write('FORM') if not self._nframes: self._nframes = initlength / (self._nchannels * self._sampwidth) self._datalength = self._nframes * self._nchannels * self._sampwidth if self._datalength & 1: self._datalength = self._datalength + 1 if self._aifc: if self._comptype in ('ULAW', 'ALAW'): self._datalength = self._datalength / 2 if self._datalength & 1: self._datalength = self._datalength + 1 elif self._comptype == 'G722': self._datalength = (self._datalength + 3) / 4 if self._datalength & 1: self._datalength = self._datalength + 1 self._form_length_pos = self._file.tell() commlength = self._write_form_length(self._datalength) if self._aifc: self._file.write('AIFC') self._file.write('FVER') _write_long(self._file, 4) _write_long(self._file, self._version) else: self._file.write('AIFF') self._file.write('COMM') _write_long(self._file, commlength) _write_short(self._file, self._nchannels) self._nframes_pos = self._file.tell() _write_long(self._file, self._nframes) _write_short(self._file, self._sampwidth * 8) _write_float(self._file, self._framerate) if self._aifc: self._file.write(self._comptype) _write_string(self._file, self._compname) self._file.write('SSND') self._ssnd_length_pos = self._file.tell() _write_long(self._file, self._datalength + 8) _write_long(self._file, 0) _write_long(self._file, 0) | bca7b4894a1e338b53bc65b01a09484e5f2da318 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/bca7b4894a1e338b53bc65b01a09484e5f2da318/aifc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
3374,
12,
2890,
16,
1208,
2469,
4672,
309,
365,
6315,
69,
430,
71,
471,
365,
6315,
832,
27672,
480,
296,
9826,
4278,
365,
6315,
2738,
67,
23766,
1435,
365,
6315,
768,
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,
389,
2626,
67,
3374,
12,
2890,
16,
1208,
2469,
4672,
309,
365,
6315,
69,
430,
71,
471,
365,
6315,
832,
27672,
480,
296,
9826,
4278,
365,
6315,
2738,
67,
23766,
1435,
365,
6315,
768,
18... |
cc = self.config.component_section("app2") self.assertEqual(cc, {"type": "app2", "title": "app2", "beginning": "yes", "end": "no"}, "does not correctly configure component with assumed type var and additional vars") | s = self.config.app_section("app2") self.assertEqual(s, {"beginning": "yes", "end": "no"}, "does not correctly configure component additional vars") | def test_component_section(self): cc = self.config.component_section("app1") self.assertEqual(cc, {"type": "app1", "title": "app1"}, "default component config incorrect") cc = self.config.component_section("app2") self.assertEqual(cc, {"type": "app2", "title": "app2", "beginning": "yes", "end": "no"}, "does not correctly configure component with assumed type var and additional vars") cc = self.config.component_section("app3") self.assertEqual(cc, {"type": "testapp", "title": "app3"}, "does not correctly configure component with explicit type variable and no additional vars") cc = self.config.component_section("backend1") self.assertEqual(cc, {"type": "testbackend", "title": "backend1", "beginning": "yes", "end": "no"}, "does not correctly configure component with explicit type var and additional vars") | 7d84db9afebce2b4cad7f26322b096f30ef76005 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/7d84db9afebce2b4cad7f26322b096f30ef76005/test_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4652,
67,
3464,
12,
2890,
4672,
4946,
273,
365,
18,
1425,
18,
4652,
67,
3464,
2932,
2910,
21,
7923,
365,
18,
11231,
5812,
12,
952,
16,
12528,
723,
6877,
315,
2910,
21,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4652,
67,
3464,
12,
2890,
4672,
4946,
273,
365,
18,
1425,
18,
4652,
67,
3464,
2932,
2910,
21,
7923,
365,
18,
11231,
5812,
12,
952,
16,
12528,
723,
6877,
315,
2910,
21,
3113,
... |
task.update(self.db) self.session.commit() | def submit( self, task, jobRange='all', requirements='', jobAttributes=None ): """ works for Task objects just create running instances and submit to the scheduler in case of first submission archive existing submission an create a new entry for the next submission (i.e. duplicate the entry with an incremented submission number) """ | f798d4e7e9d2989decc86587015c35f35e9d23ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/f798d4e7e9d2989decc86587015c35f35e9d23ac/BossLiteAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
12,
365,
16,
1562,
16,
1719,
2655,
2218,
454,
2187,
8433,
2218,
2187,
1719,
2498,
33,
7036,
262,
30,
3536,
6330,
364,
3837,
2184,
225,
2537,
752,
3549,
3884,
471,
4879,
358,
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,
4879,
12,
365,
16,
1562,
16,
1719,
2655,
2218,
454,
2187,
8433,
2218,
2187,
1719,
2498,
33,
7036,
262,
30,
3536,
6330,
364,
3837,
2184,
225,
2537,
752,
3549,
3884,
471,
4879,
358,
326,
... | |
env.history.message("deleted %r" % j.name) for a in j.atoms[:]: self.atoms_of_last_deleted_jig.append(a) | env.history.message("Deleted %r" % j.name) self.atoms_of_last_deleted_jig.extend(j.atoms) | def jigLeftUp(self, j, event): '''Jig <j> was clicked, so select, unselect or delete it based on the current modkey. - If no modkey is pressed, clear the selection and pick jig <j>. - If Shift is pressed, pick <j>, adding it to the current selection. - If Ctrl is pressed, unpick <j>, removing it from the current selection. - If Shift+Control (Delete) is pressed, delete jig <j>. ''' if not self.current_obj_clicked: # Jig was dragged. Nothing to do but return. self.set_cmdname('Move Jig') self.o.assy.changed() return nochange = False if self.o.modkeys is None: self.o.assy.unpickatoms() if j.picked: nochange = True else: j.pick() self.set_cmdname('Select Jig') | f00885ba22f9024d0d0cd8d1b0ee31146a42c403 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/f00885ba22f9024d0d0cd8d1b0ee31146a42c403/selectMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
525,
360,
3910,
1211,
12,
2890,
16,
525,
16,
871,
4672,
9163,
46,
360,
411,
78,
34,
1703,
17688,
16,
1427,
2027,
16,
640,
4025,
578,
1430,
518,
2511,
603,
326,
783,
681,
856,
18,
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,
525,
360,
3910,
1211,
12,
2890,
16,
525,
16,
871,
4672,
9163,
46,
360,
411,
78,
34,
1703,
17688,
16,
1427,
2027,
16,
640,
4025,
578,
1430,
518,
2511,
603,
326,
783,
681,
856,
18,
300... |
''' Parse sort/group options. Append to var ''' | """ Parse sort/group options. Append to var """ | def _parse_sort(self, var, name): ''' Parse sort/group options. Append to var ''' fields = [] dirs = [] for special in '@:': idx = 0 key = '%s%s%d'%(special, name, idx) while key in self.form: self.special_char = special fields.append (self.form[key].value) dirkey = '%s%sdir%d'%(special, name, idx) if dirkey in self.form: dirs.append(self.form[dirkey].value) else: dirs.append(None) idx += 1 key = '%s%s%d'%(special, name, idx) # backward compatible (and query) URL format key = special + name dirkey = key + 'dir' if key in self.form and not fields: fields = handleListCGIValue(self.form[key]) if dirkey in self.form: dirs.append(self.form[dirkey].value) if fields: # only try other special char if nothing found break for f, d in map(None, fields, dirs): if f.startswith('-'): var.append(('-', f[1:])) elif d: var.append(('-', f)) else: var.append(('+', f)) | 16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
3804,
12,
2890,
16,
569,
16,
508,
4672,
3536,
2884,
1524,
19,
1655,
702,
18,
6181,
358,
569,
3536,
1466,
273,
5378,
7717,
273,
5378,
364,
4582,
316,
4622,
2497,
30,
2067... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
3804,
12,
2890,
16,
569,
16,
508,
4672,
3536,
2884,
1524,
19,
1655,
702,
18,
6181,
358,
569,
3536,
1466,
273,
5378,
7717,
273,
5378,
364,
4582,
316,
4622,
2497,
30,
2067... |
print (Y1-Y2).max() | if verbose > 2: print (Y1-Y2).max() | def test_cdist_canberra_random(self): "Tests cdist(X, 'canberra') on random data." eps = 1e-07 # Get the data: the input matrix and the right output. X1 = eo['cdist-X1'] < 0.5 X2 = eo['cdist-X2'] < 0.5 Y1 = cdist(X1, X2, 'canberra') Y2 = cdist(X1, X2, 'test_canberra') print (Y1-Y2).max() self.failUnless(within_tol(Y1, Y2, eps)) | c3d85c07ed380f445f851652c8c4ee87f0b2dc45 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5882/c3d85c07ed380f445f851652c8c4ee87f0b2dc45/test_distance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4315,
376,
67,
4169,
744,
354,
67,
9188,
12,
2890,
4672,
315,
14650,
276,
4413,
12,
60,
16,
296,
4169,
744,
354,
6134,
603,
2744,
501,
1199,
7785,
273,
404,
73,
17,
8642,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4315,
376,
67,
4169,
744,
354,
67,
9188,
12,
2890,
4672,
315,
14650,
276,
4413,
12,
60,
16,
296,
4169,
744,
354,
6134,
603,
2744,
501,
1199,
7785,
273,
404,
73,
17,
8642,
4... |
s += " | s += " | def printout(self, data): """ Returns string with authorized_keys file syntax and some comments """ s = "" for i in data: # append comment with username s += "# added automatically for ganeti web manager user: " + i[1] # append key s += "%s\n" % i[0] return s | ae263e21b38e351617ed180f5d86f57098b98138 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/ae263e21b38e351617ed180f5d86f57098b98138/sshkeys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
659,
12,
2890,
16,
501,
4672,
3536,
2860,
533,
598,
10799,
67,
2452,
585,
6279,
471,
2690,
5678,
3536,
272,
273,
1408,
364,
277,
316,
501,
30,
468,
714,
2879,
598,
2718,
272,
101... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
659,
12,
2890,
16,
501,
4672,
3536,
2860,
533,
598,
10799,
67,
2452,
585,
6279,
471,
2690,
5678,
3536,
272,
273,
1408,
364,
277,
316,
501,
30,
468,
714,
2879,
598,
2718,
272,
101... |
server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) | if options.forking: server_class = ForkingHTTPServer else: server_class = StoppableHTTPServer server = server_class(('127.0.0.1', port), TestPageHandler) | def main(options, args): # redirect output to a log file so it doesn't spam the unit test output logfile = open('testserver.log', 'w') sys.stderr = sys.stdout = logfile port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified cert file not found: ' + options.cert + ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert) print 'HTTPS server started on port %d...' % port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url MakeDumpDir(server.data_dir) # means FTP Server else: my_data_dir = MakeDataDir() def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer pyftpdlib.ftpserver.logline = line_logger # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | b89290213d94169f8293f9bd7668550975281d45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/b89290213d94169f8293f9bd7668550975281d45/testserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
468,
3136,
876,
358,
279,
613,
585,
1427,
518,
3302,
1404,
24824,
326,
2836,
1842,
876,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
468,
3136,
876,
358,
279,
613,
585,
1427,
518,
3302,
1404,
24824,
326,
2836,
1842,
876,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
... |
left += (-xP - xA - w) * scale | left += (-xP - xA) * scale previousXA = xA | def drawRectRightToLeft_(self, rect): self._alternateRects = {} # draw the background bounds = self.bounds() self._backgroundColor.set() NSRectFill(bounds) # create some reusable values scale = self._scale descender = self._descender upm = self._upm scaledBuffer = self._buffer * (1.0 / scale) scrollWidth = bounds.size[0] # offset for the buffer ctx = NSGraphicsContext.currentContext() ctx.saveGraphicsState() aT = NSAffineTransform.transform() aT.translateXBy_yBy_(scrollWidth - self._buffer, self._buffer) aT.concat() # offset for the descender aT = NSAffineTransform.transform() aT.scaleBy_(scale) aT.translateXBy_yBy_(0, descender) aT.concat() # flip flipTransform = NSAffineTransform.transform() flipTransform.translateXBy_yBy_(0, upm) flipTransform.scaleXBy_yBy_(1.0, -1.0) flipTransform.concat() # set the glyph color self._glyphColor.set() # draw the records left = scrollWidth - self._buffer bottom = self._buffer height = upm * scale for recordIndex, glyphRecord in enumerate(self._glyphRecords): glyph = glyphRecord.glyph w = glyph.width xP = glyphRecord.xPlacement yP = glyphRecord.yPlacement xA = glyphRecord.xAdvance yA = glyphRecord.yAdvance path = glyph.getRepresentation("defconAppKit.NSBezierPath") # handle offsets from the record bottom += yP glyphHeight = height + yA glyphLeft = left + ((-xP - xA -w) * scale) glyphWidth = (w + xA) * scale # store the glyph rect for the alternate menu rect = ((glyphLeft, bottom), (glyphWidth, glyphHeight)) self._alternateRects[rect] = recordIndex # fill the glyph rect if glyph glyph is .notdef if glyph.name == ".notdef": self._notdefBackgroundColor.set() rect = ((-w, descender), (w, upm)) NSRectFillUsingOperation(rect, NSCompositeSourceOver) self._glyphColor.set() # shift into place and draw the glyph aT = NSAffineTransform.transform() aT.translateXBy_yBy_(-xP - xA - w, yP) aT.concat() # fill the path, highlighting alternates # if necessary if glyphRecord.alternates: self._alternateHighlightColor.set() path.fill() self._glyphColor.set() else: path.fill() # remove the y placement that was applied # and shift horizontally for the next glyph aT = NSAffineTransform.transform() aT.translateXBy_yBy_(0, -yP) aT.concat() left += (-xP - xA - w) * scale ctx.restoreGraphicsState() | 5a673ffbd30b8726db9034e60dcc25f5cfad6edf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8848/5a673ffbd30b8726db9034e60dcc25f5cfad6edf/glyphLineView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
6120,
4726,
774,
3910,
67,
12,
2890,
16,
4917,
4672,
365,
6315,
16025,
340,
6120,
87,
273,
2618,
468,
3724,
326,
5412,
4972,
273,
365,
18,
10576,
1435,
365,
6315,
9342,
2957,
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,
3724,
6120,
4726,
774,
3910,
67,
12,
2890,
16,
4917,
4672,
365,
6315,
16025,
340,
6120,
87,
273,
2618,
468,
3724,
326,
5412,
4972,
273,
365,
18,
10576,
1435,
365,
6315,
9342,
2957,
18,
... |
newstate = DISABLED | newstate = tk.DISABLED | def enable(self, enabled=True): """Enable or disable all sub-widgets.""" if enabled: newstate = NORMAL else: newstate = DISABLED for widget in self.children.values(): widget.config(state=newstate) | f057996c3a6de2d5fabf3ad7997bbd1f796a9e23 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4675/f057996c3a6de2d5fabf3ad7997bbd1f796a9e23/meta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
12,
2890,
16,
3696,
33,
5510,
4672,
3536,
8317,
578,
4056,
777,
720,
17,
18148,
12123,
309,
3696,
30,
394,
2019,
273,
16362,
469,
30,
394,
2019,
273,
13030,
18,
24493,
364,
3604,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4237,
12,
2890,
16,
3696,
33,
5510,
4672,
3536,
8317,
578,
4056,
777,
720,
17,
18148,
12123,
309,
3696,
30,
394,
2019,
273,
16362,
469,
30,
394,
2019,
273,
13030,
18,
24493,
364,
3604,
... |
[(1, 19, 16, 13, 10, 7, 4), (2, 17, 11, 5, 20, 14, 8), (3, 12, 21, 9, 18, 6, 15)] | [(1, 4, 10, 16, 7, 19, 13), (2, 8, 5, 20, 11, 14, 17), (3, 12, 9, 15, 6, 18, 21)] | def tau123(T1, T2): """ Compute the tau_i representation for a bitrade (T1, T2). See the functions tau1, tau2, and tau3 for the mathematical definitions. RETURNS: (cells_map, t1, t2, t3) where cells_map is a map to/from the filled cells of T1, and t1, t2, t3 are the tau1, tau2, tau3 permutations. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: (a, b, c, G) = pq_group_bitrade_generators(3, 7) sage: (T1, T2) = bitrade_from_group(a, b, c, G) sage: print T1 [0 6 4] [1 0 5] [2 1 6] [3 2 0] [4 3 1] [5 4 2] [6 5 3] sage: print T2 [6 4 0] [0 5 1] [1 6 2] [2 0 3] [3 1 4] [4 2 5] [5 3 6] sage: (cells_map, t1, t2, t3) = tau123(T1, T2) sage: print cells_map {1: (0, 0), 2: (0, 1), 3: (0, 2), 4: (1, 0), 5: (1, 1), 6: (1, 2), 7: (2, 0), 8: (2, 1), 9: (2, 2), 10: (3, 0), 11: (3, 1), 12: (3, 2), 13: (4, 0), (2, 1): 8, 15: (4, 2), 16: (5, 0), 17: (5, 1), 18: (5, 2), 19: (6, 0), 20: (6, 1), 21: (6, 2), (5, 1): 17, (4, 0): 13, (1, 2): 6, (3, 0): 10, (5, 0): 16, (2, 2): 9, (4, 1): 14, (1, 1): 5, (3, 2): 12, (0, 0): 1, (6, 0): 19, 14: (4, 1), (4, 2): 15, (1, 0): 4, (0, 1): 2, (6, 1): 20, (3, 1): 11, (2, 0): 7, (6, 2): 21, (5, 2): 18, (0, 2): 3} sage: print cells_map_as_square(cells_map, max(T1.nrows(), T1.ncols())) [ 1 2 3 -1 -1 -1 -1] [ 4 5 6 -1 -1 -1 -1] [ 7 8 9 -1 -1 -1 -1] [10 11 12 -1 -1 -1 -1] [13 14 15 -1 -1 -1 -1] [16 17 18 -1 -1 -1 -1] [19 20 21 -1 -1 -1 -1] sage: t1 [3, 1, 2, 6, 4, 5, 9, 7, 8, 12, 10, 11, 15, 13, 14, 18, 16, 17, 21, 19, 20] sage: t2 [19, 17, 12, 1, 20, 15, 4, 2, 18, 7, 5, 21, 10, 8, 3, 13, 11, 6, 16, 14, 9] sage: print t3 [5, 9, 13, 8, 12, 16, 11, 15, 19, 14, 18, 1, 17, 21, 4, 20, 3, 7, 2, 6, 10] sage: t1.to_cycles() [(1, 3, 2), (4, 6, 5), (7, 9, 8), (10, 12, 11), (13, 15, 14), (16, 18, 17), (19, 21, 20)] sage: t2.to_cycles() [(1, 19, 16, 13, 10, 7, 4), (2, 17, 11, 5, 20, 14, 8), (3, 12, 21, 9, 18, 6, 15)] sage: t3.to_cycles() [(1, 5, 12), (2, 9, 19), (3, 13, 17), (4, 8, 15), (6, 16, 20), (7, 11, 18), (10, 14, 21)] The product t1*t2*t3 is the identity, i.e. it fixes every point: sage: len((t1*t2*t3).fixed_points()) == T1.nr_filled_cells() True """ assert is_bitrade(T1, T2) cells_map = T1.filled_cells_map() t1 = tau1(T1, T2, cells_map) t2 = tau2(T1, T2, cells_map) t3 = tau3(T1, T2, cells_map) return (cells_map, t1, t2, t3) | 9087d14f978c663baae98e9a365c4a3aa2a6f24c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9087d14f978c663baae98e9a365c4a3aa2a6f24c/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12284,
12936,
12,
56,
21,
16,
399,
22,
4672,
3536,
8155,
326,
12284,
67,
77,
4335,
364,
279,
2831,
354,
323,
261,
56,
21,
16,
399,
22,
2934,
2164,
326,
4186,
12284,
21,
16,
12284,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12284,
12936,
12,
56,
21,
16,
399,
22,
4672,
3536,
8155,
326,
12284,
67,
77,
4335,
364,
279,
2831,
354,
323,
261,
56,
21,
16,
399,
22,
2934,
2164,
326,
4186,
12284,
21,
16,
12284,
22... |
return self(self.hecke_operator(f.qexp(), m)) | return self(self.hecke_operator(f.q_expansion(), m)) | def hecke_operator(self, f, m): r""" Given an element `f` and an integer `m`, calculates the Hecke operator `T_m` acting on `f`. | 838a498abee29f10814d0a05c45a15fbb11d024c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/838a498abee29f10814d0a05c45a15fbb11d024c/genus0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
762,
73,
67,
9497,
12,
2890,
16,
284,
16,
312,
4672,
436,
8395,
16803,
392,
930,
1375,
74,
68,
471,
392,
3571,
1375,
81,
9191,
17264,
326,
670,
762,
73,
3726,
1375,
56,
67,
81,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
762,
73,
67,
9497,
12,
2890,
16,
284,
16,
312,
4672,
436,
8395,
16803,
392,
930,
1375,
74,
68,
471,
392,
3571,
1375,
81,
9191,
17264,
326,
670,
762,
73,
3726,
1375,
56,
67,
81,
... |
cros_build_lib.RunCommand('repo sync', shell=True) cros_build_lib.RunCommand('git push', shell=True) | RevGitPushWithRetry(retries) | def RevGitFile(filename, value): """Update and push the git file. Args: filename: file to modify that is in a git repo already key: board or host package type e.g. x86-dogfood value: string representing the version of the prebuilt that has been uploaded. """ prebuilt_branch = 'prebuilt_branch' old_cwd = os.getcwd() os.chdir(os.path.dirname(filename)) cros_build_lib.RunCommand('repo sync', shell=True) cros_build_lib.RunCommand('repo start %s .' % prebuilt_branch, shell=True) git_ssh_config_cmd = ( 'git config url.ssh://git@gitrw.chromium.org:9222.pushinsteadof ' 'http://git.chromium.org/git') cros_build_lib.RunCommand(git_ssh_config_cmd, shell=True) description = 'Update PORTAGE_BINHOST="%s" in %s' % (value, filename) print description try: UpdateLocalFile(filename, value) cros_build_lib.RunCommand('git config push.default tracking', shell=True) cros_build_lib.RunCommand('git commit -am "%s"' % description, shell=True) cros_build_lib.RunCommand('repo sync', shell=True) cros_build_lib.RunCommand('git push', shell=True) finally: cros_build_lib.RunCommand('repo abandon %s .' % prebuilt_branch, shell=True) os.chdir(old_cwd) | 93954efedac1c697502deae0eedd52eaaae5be36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/93954efedac1c697502deae0eedd52eaaae5be36/prebuilt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14477,
11540,
812,
12,
3459,
16,
460,
4672,
3536,
1891,
471,
1817,
326,
5071,
585,
18,
225,
6634,
30,
1544,
30,
585,
358,
5612,
716,
353,
316,
279,
5071,
3538,
1818,
498,
30,
11094,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14477,
11540,
812,
12,
3459,
16,
460,
4672,
3536,
1891,
471,
1817,
326,
5071,
585,
18,
225,
6634,
30,
1544,
30,
585,
358,
5612,
716,
353,
316,
279,
5071,
3538,
1818,
498,
30,
11094,
57... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.