rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
print 'self.bugs:', self.bugs | def load_bugs(self, filename): # Bug file format: # $(module)/$(checkname) $(bugnumber) # Sample bug file: # evolution/LibGnomeCanvas 571742 # # Alternatively, the $(checkname) can be replaced by a column number, # like: evolution/col:2 543234 # # also, if there is only a single check, the /$(checkname) part # can be skipped. self.bugs = {} if not filename: return if filename.startswith('http://'): if filename.startswith('http://live.gnome.org') and not filename.endswith('?action=raw'): filename += '?action=raw' try: filename = httpcache.load(filename, age=0) except Exception, e: logging.warning('could not download %s: %s' % (filename, e)) return for line in file(filename): line = line.strip() if not line: continue if line.startswith('#'): continue part, bugnumber = line.split() if '/' in part: module_name, check = part.split('/') if check.startswith('col:'): check = self.checks[int(check[4:])-1].__name__ elif len(self.checks) == 1: module_name = part check = self.checks[0].__name__ else: continue self.bugs[(module_name, check)] = bugnumber print 'self.bugs:', self.bugs | 051ead203f1582399a199b0299020ef725c5c954 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4596/051ead203f1582399a199b0299020ef725c5c954/goalreport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
19381,
12,
2890,
16,
1544,
4672,
468,
16907,
585,
740,
30,
468,
225,
27488,
2978,
13,
11141,
12,
1893,
529,
13,
27488,
925,
2696,
13,
468,
11474,
7934,
585,
30,
468,
225,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
19381,
12,
2890,
16,
1544,
4672,
468,
16907,
585,
740,
30,
468,
225,
27488,
2978,
13,
11141,
12,
1893,
529,
13,
27488,
925,
2696,
13,
468,
11474,
7934,
585,
30,
468,
225,
211... | |
"""QueuePage | """Returns the URL of the job_id. | def explore_href(self, job_id): """QueuePage """ jdict = mysql.job_get_dict(job_id) | ebe7911aaa6579796c3b771f64c91ad7ae981d9b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10674/ebe7911aaa6579796c3b771f64c91ad7ae981d9b/webtlsmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15233,
266,
67,
7547,
12,
2890,
16,
1719,
67,
350,
4672,
3536,
1356,
326,
1976,
434,
326,
1719,
67,
350,
18,
3536,
525,
1576,
273,
7219,
18,
4688,
67,
588,
67,
1576,
12,
4688,
67,
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,
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,
15233,
266,
67,
7547,
12,
2890,
16,
1719,
67,
350,
4672,
3536,
1356,
326,
1976,
434,
326,
1719,
67,
350,
18,
3536,
525,
1576,
273,
7219,
18,
4688,
67,
588,
67,
1576,
12,
4688,
67,
35... |
userAgent = "Chandler/%s" % version.version | platformName = Utility.getPlatformName() userAgent = "Chandler/%s (%s)" % (version.version, platformName) | def __init__(self, host=None, port=None, username=None, password=None, useSSL=False, repositoryView=None): self.resourcesByPath = {} # Caches resources indexed by path | 01516cd51d731b219ab87837a50106215becd103 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/01516cd51d731b219ab87837a50106215becd103/WebDAV.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
33,
7036,
16,
1756,
33,
7036,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
16,
999,
6745,
33,
8381,
16,
3352,
1767,
33,
7036,
4672,
225,
365,
18,
4683... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
33,
7036,
16,
1756,
33,
7036,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
16,
999,
6745,
33,
8381,
16,
3352,
1767,
33,
7036,
4672,
225,
365,
18,
4683... |
value = unicode(value[2], value[0]).encode("ascii") | param += '*' value = Utils.encode_rfc2231(value[2], value[0], value[1]) | def _formatparam(param, value=None, quote=1): """Convenience function to format and return a key=value pair. This will quote the value if needed or if quote is true. """ if value is not None and len(value) > 0: # TupleType is used for RFC 2231 encoded parameter values where items # are (charset, language, value). charset is a string, not a Charset # instance. if isinstance(value, TupleType): # Convert to ascii, ignore language value = unicode(value[2], value[0]).encode("ascii") # BAW: Please check this. I think that if quote is set it should # force quoting even if not necessary. if quote or tspecials.search(value): return '%s="%s"' % (param, Utils.quote(value)) else: return '%s=%s' % (param, value) else: return param | 3c25535dc81492b8f703056dbd3b9685db4ca936 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c25535dc81492b8f703056dbd3b9685db4ca936/Message.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2139,
891,
12,
891,
16,
460,
33,
7036,
16,
3862,
33,
21,
4672,
3536,
14700,
445,
358,
740,
471,
327,
279,
498,
33,
1132,
3082,
18,
225,
1220,
903,
3862,
326,
460,
309,
3577,
578... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2139,
891,
12,
891,
16,
460,
33,
7036,
16,
3862,
33,
21,
4672,
3536,
14700,
445,
358,
740,
471,
327,
279,
498,
33,
1132,
3082,
18,
225,
1220,
903,
3862,
326,
460,
309,
3577,
578... |
print "not cacheOnly and troveList" | def getMetadata(self, troveList, label, cacheFile = None, cacheOnly = False, saveOnly = False): metadata = {} if cacheFile and not saveOnly: try: print "opening cache" cacheFp = open(cacheFile, "r") cache = pickle.load(cacheFp) cacheFp.close() except IOError, EOFError: print "got an error, returning" if cacheOnly: return {} else: print "reading cache" print cache lStr = label.asString() | 08f4b50b7b59c04afbfa7e1bc89323cb1d41ea4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/08f4b50b7b59c04afbfa7e1bc89323cb1d41ea4a/conaryclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11159,
12,
2890,
16,
23432,
537,
682,
16,
1433,
16,
18748,
273,
599,
16,
1247,
3386,
273,
1083,
16,
1923,
3386,
273,
1083,
4672,
1982,
273,
2618,
309,
18748,
471,
486,
1923,
3386,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11159,
12,
2890,
16,
23432,
537,
682,
16,
1433,
16,
18748,
273,
599,
16,
1247,
3386,
273,
1083,
16,
1923,
3386,
273,
1083,
4672,
1982,
273,
2618,
309,
18748,
471,
486,
1923,
3386,
30,
... | |
context)[0][1] + \ ' (partner: ' + pline.partner_id.name + ').') continue | context)[0][1] + '\n' \ 'on line: ' + pline.name) | def _create_dta(obj, cr, uid, data, context): v={} v['uid'] = str(uid) v['creation_date']= time.strftime('%y%m%d') log=Log() dta='' pool = pooler.get_pool(cr.dbname) payment_obj = pool.get('payment.order') attachment_obj = pool.get('ir.attachment') payment = payment_obj.browse(cr, uid, data['id'], context=context) if not payment.mode or payment.mode.type.code != 'dta': return {'note':'No payment mode or payment type code invalid.'} bank = payment.mode.bank_id if not bank: return {'note':'No bank account for the company.'} v['comp_bank_name']= bank.bank and bank.bank.name or False v['comp_bank_clearing'] = bank.bank.clearing if not v['comp_bank_clearing']: return {'note': 'You must provide a Clearing Number for your bank account.'} user = pool.get('res.users').browse(cr,uid,[uid])[0] company= user.company_id #XXX dirty code use get_addr co_addr= company.partner_id.address[0] v['comp_country'] = co_addr.country_id and co_addr.country_id.name or '' v['comp_street'] = co_addr.street or '' v['comp_zip'] = co_addr.zip v['comp_city'] = co_addr.city v['comp_name'] = co_addr.name v['comp_dta'] = '' #XXX not mandatory in pratice v['comp_bank_number'] = bank.acc_number or '' v['comp_bank_iban'] = bank.iban or '' if not v['comp_bank_iban'] : return {'note':'No iban number for the company bank account.'} dta_line_obj = pool.get('account.dta.line') res_partner_bank_obj = pool.get('res.partner.bank') seq= 1 amount_tot = 0 amount_currency_tot = 0 for pline in payment.line_ids: if not pline.bank_id: log.add('\nNo partner bank defined. (partner: ' + \ pline.partner_id.name + ', entry:' + \ pline.move_line_id.name + ').') continue if not pline.bank_id.bank: log.add('\nNo bank defined on the bank account. (partner: ' + \ pline.partner_id.name + ', entry:' + \ pline.move_line_id.name + ').') v['sequence'] = str(seq).rjust(5).replace(' ', '0') v['amount_to_pay']= str(pline.amount_currency).replace('.', ',') v['number'] = pline.name v['currency'] = pline.currency.code v['partner_bank_name'] = pline.bank_id.bank and pline.bank_id.bank.name \ or False v['partner_bank_clearing'] = pline.bank_id.bank.clearing or False if not v['partner_bank_name'] : log.add('\nPartner bank account not well defined, please provide a name ' 'for the associated bank (partner: ' + pline.partner_id.name + \ ', bank:' + res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] + ').') continue v['partner_bank_iban']= pline.bank_id.iban or False v['partner_bank_number']= pline.bank_id.acc_number \ and pline.bank_id.acc_number.replace('.','').replace('-','') \ or False v['partner_post_number']= pline.bank_id.post_number \ and pline.bank_id.post_number.replace('.', '').replace('-', '') \ or False v['partner_bvr'] = pline.bank_id.bvr_number or '' if v['partner_bvr']: v['partner_bvr'] = v['partner_bvr'].replace('-','') if len(v['partner_bvr']) < 9: v['partner_bvr'] = v['partner_bvr'][:2] + '0' * \ (9 - len(v['partner_bvr'])) + v['partner_bvr'][2:] if pline.bank_id.bank: v['partner_bank_city'] = pline.bank_id.bank.city or False v['partner_bank_street'] = pline.bank_id.bank.street or '' v['partner_bank_zip'] = pline.bank_id.bank.zip or '' v['partner_bank_country'] = pline.bank_id.bank.country and \ pline.bank_id.bank.country.name or '' v['partner_bank_code'] = pline.bank_id.bank.bic v['reference'] = pline.move_line_id.ref v['partner_name'] = pline.partner_id and pline.partner_id.name or '' if pline.partner_id and pline.partner_id.address \ and pline.partner_id.address[0]: v['partner_street'] = pline.partner_id.address[0].street v['partner_city']= pline.partner_id.address[0].city v['partner_zip']= pline.partner_id.address[0].zip # If iban => country=country code for space reason elec_pay = pline.bank_id.state #Bank type if elec_pay == 'iban': v['partner_country']= pline.partner_id.address[0].country_id \ and pline.partner_id.address[0].country_id.code+'-' \ or '' else: v['partner_country']= pline.partner_id.address[0].country_id \ and pline.partner_id.address[0].country_id.name \ or '' else: v['partner_street'] ='' v['partner_city']= '' v['partner_zip']= '' v['partner_country']= '' log.add('\nNo address for the partner: '+pline.partner_id.name) date_value = mx.DateTime.strptime(pline.value_date, '%Y-%m-%d') \ or mx.DateTime.now() v['date_value'] = date_value.strftime("%y%m%d") # si compte iban -> iban (836) # si payment structure -> bvr (826) # si non -> (827) if elec_pay == 'dta_iban': # If iban => country=country code for space reason v['comp_country'] = co_addr.country_id and co_addr.country_id.code+'-' or '' record_type = record_gt836 if not v['partner_bank_iban']: log.add('\nNo iban number for the partner bank:' + \ res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] + \ ' (partner: ' + pline.partner_id.name + ').') continue if v['partner_bank_code'] : # bank code is swift (BIC address) v['option_id_bank']= 'A' v['partner_bank_ident']= v['partner_bank_code'] elif v['partner_bank_city']: v['option_id_bank']= 'D' v['partner_bank_ident']= v['partner_bank_name'] \ + ' ' + v['partner_bank_street'] \ + ' ' + v['partner_bank_zip'] \ + ' ' + v['partner_bank_city'] \ + ' ' + v['partner_bank_country'] else: log.add("\nYou must provide the bank city " "or the bic code for the partner bank:" + \ res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] + \ ' (partner: ' + pline.partner_id.name + ').') continue elif elec_pay == 'bvrbank' or elec_pay == 'bvrpost': from tools import mod10r if v['reference']: v['reference'] = v['reference'].replace(' ', '').rjust(27).replace(' ', '0') if not v['reference'] \ or mod10r(v['reference'][:-1]) != v['reference']: log.add('\nYou must provide a valid BVR reference number.' ' (payment line ' + pline.name +')') continue if not v['partner_bvr']: log.add("\nYou must provide a BVR number " "on the partner bank:" + \ res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] + \ ' (partner: ' + pline.partner_id.name + ').') continue record_type = record_gt826 elif elec_pay == 'bvbank': if not v['partner_bank_number'] : if v['partner_bank_iban'] : v['partner_bank_number']= v['partner_bank_iban'] else: log.add('\nYou must provide a bank number in the partner bank.' ' (payment line '+ pline.name +')') continue if not v['partner_bank_clearing']: log.add('\nPartner bank must have a Clearing Number' 'for a BV Bank operation. (payment line '+ pline.name +')') continue v['partner_bank_number'] = '/C/'+v['partner_bank_number'] record_type = record_gt827 elif elec_pay == 'bvpost': if not v['partner_post_number']: log.add('\nYou must provide a post number in the partner bank.' ' (payment line '+ pline.name +')') continue v['partner_bank_clearing']= '' v['partner_bank_number'] = '/C/'+v['partner_post_number'] record_type = record_gt827 else: log.add('\nBank type not supported. (partner:'+ pline.partner_id.name + \ ', bank:' + \ res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] + \ ', type:' + elec_pay + ')') continue try: dta_line = record_type(v).generate() except Exception,e : log.add('\nERROR:'+ str(e)+' (payment line '+ pline.name + ')') raise continue #logging log.add('Payment line : %s, Amount paid : %d %s, ' 'Value date : %s, State : Paid.' % \ (pline.name, pline.amount, v['currency'], date_value and \ date_value.strftime("%Y-%m-%d") or 'Empty date'), error=False) dta = dta + dta_line amount_tot += pline.amount amount_currency_tot += pline.amount_currency seq += 1 # segment total v['amount_total'] = str(amount_currency_tot).replace('.',',') v['sequence'] = str(seq).rjust(5).replace(' ','0') try: if dta : dta = dta + record_gt890(v).generate() except Exception,e : log.add('\n'+ str(e) + 'CORRUPTED FILE !\n') raise log.add("\n--\nSummary :\nTotal amount paid : %.2f" \ % (amount_tot,), error=False) if not log.error: dta_data= base64.encodestring(dta) payment_obj.set_done(cr, uid, data['id'], context) attachment_obj.create(cr, uid, { 'name': 'DTA', 'datas': dta_data, 'datas_fname': 'DTA.txt', 'res_model': 'payment.order', 'res_id': data['id'], }, context=context) else: dta_data= False return {'note':log(), 'dta': dta_data} | 37f9126996ca14fd28e570694117dd491f10c960 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7339/37f9126996ca14fd28e570694117dd491f10c960/dta_wizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
72,
2351,
12,
2603,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
331,
12938,
331,
3292,
1911,
3546,
273,
609,
12,
1911,
13,
331,
3292,
17169,
67,
712,
3546,
33,
813,
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,
2640,
67,
72,
2351,
12,
2603,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
331,
12938,
331,
3292,
1911,
3546,
273,
609,
12,
1911,
13,
331,
3292,
17169,
67,
712,
3546,
33,
813,
18... |
'state': fields.selection( (('draft','Draft'),('done','Done')), 'Status', readonly=True), | 'state': fields.selection( (('draft', 'Draft'), ('done', 'Done')), 'Status', readonly=True), | def unlink(self, cr, uid, ids, context=None): for move in self.browse(cr, uid, ids, context=context): if move.state != 'draft': raise osv.except_osv(_('UserError'), _('You can only delete draft moves.')) return super(stock_move, self).unlink( cr, uid, ids, context=context) | 369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
364,
3635,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
16,
819,
33,
2472,
4672,
309,
3635,
18,
2019,
480... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
364,
3635,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
16,
819,
33,
2472,
4672,
309,
3635,
18,
2019,
480... |
command_result = stdout.readlines() | command_output = stdout.readlines() | def attemptConnection(hostname, username, password, timeout=30, command=False, local_filepath=False, remote_filepath='/tmp/', execute=False, remove=False, sudo=False, run_as='root'): """Attempt to login to 'hostname' using 'username'/'password' and execute 'command'. Will excute the command via sudo if 'sudo' is set to True (as root by default) and optionally as a given user (run_as). Returns the command output if everything connected and ran successfully. Returns False if connecting was unsuccessful or an exception was encountered.""" debug("attemptConnection(%s, %s, <password>, %s, %s, %s, %s, %s, %s, %s, %s)" % (hostname, username, timeout, command, local_filepath, remote_filepath, execute, remove, sudo, run_as)) command_result = True # TODO: Add stderr handling if hostname != "": try: ssh = paramikoConnect(hostname, username, password, timeout) if local_filepath: sftpPut(ssh, local_filepath, remote_filepath) if execute: debug("Executing %s on %s" % (filename, hostname)) stdin, stdout, stderr = ssh.exec_command("chmod a+x %s" % remote_filepath) # Make it executable (a+x in case we run as another user via sudo) if sudo: stdout, stderr = sudoExecute(transport=ssh, command=command, password=password, run_as=run_as) else: stdin, stdout, stderr = ssh.exec_command(remote_filepath) command_result = stdout.readlines() if remove: ssh.exec_command("rm -f %s" % remote_filepath) if command: if sudo: stdout, stderr = sudoExecute(transport=ssh, command=command, password=password, run_as=run_as) else: stdin, stdout, stderr = ssh.exec_command(command) command_result = stdout.readlines() elif command is False and execute is False: # If we're not given anything to execute run the uptime command to make sure that we can execute *something* stdin, stdout, stderr = ssh.exec_command('uptime') command_result = stdout.readlines() ssh.close() command_result = "".join(command_result) command_result = normalizeString(command_result) except Exception, detail: # Connection failed traceback.print_exc() print "Exception: %s" % detail command_result = False ssh.close() return command_result | af991bd779b6fc6a4e78f3728de9053171539741 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11566/af991bd779b6fc6a4e78f3728de9053171539741/sshpt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4395,
1952,
12,
10358,
16,
2718,
16,
2201,
16,
2021,
33,
5082,
16,
1296,
33,
8381,
16,
1191,
67,
10561,
33,
8381,
16,
2632,
67,
10561,
2218,
19,
5645,
19,
2187,
1836,
33,
8381,
16,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4395,
1952,
12,
10358,
16,
2718,
16,
2201,
16,
2021,
33,
5082,
16,
1296,
33,
8381,
16,
1191,
67,
10561,
33,
8381,
16,
2632,
67,
10561,
2218,
19,
5645,
19,
2187,
1836,
33,
8381,
16,
1... |
return SVNNOBINDING | return (SVNNOBINDING); | def testWorkingFolder(location, url): client = pysvn.Client() try: if path.isdir(location): locationUrl = client.info(location).url; if url==locationUrl: return SVNURLSAME; else: return SVNURLDIFF, locationurl; elif path.exists(location): return SVNWORKINGFOLDERISFILE; else: return SVNNOWORKINGFOLDER; except pysvn.ClientError, e: return SVNNOBINDING | b661ab25d417b82f5a1c486090432f2d1bdc0c93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4259/b661ab25d417b82f5a1c486090432f2d1bdc0c93/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
14836,
3899,
12,
3562,
16,
880,
4672,
1004,
273,
21027,
25031,
18,
1227,
1435,
775,
30,
309,
589,
18,
291,
1214,
12,
3562,
4672,
2117,
1489,
273,
1004,
18,
1376,
12,
3562,
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,
1842,
14836,
3899,
12,
3562,
16,
880,
4672,
1004,
273,
21027,
25031,
18,
1227,
1435,
775,
30,
309,
589,
18,
291,
1214,
12,
3562,
4672,
2117,
1489,
273,
1004,
18,
1376,
12,
3562,
2934,
... |
def shell(command, input=None, silent=True): """ Run given shell command and return its output as a string. - input='string' to pass standard input into the process. - input=None (default) to use parent's stdin (keyboard) - silent=False to use parent's stdout (i.e. print output as-it-comes instead of returning it) """ | def args_to_list(args): """ Return a flat list of the given arguments for shell(). """ arglist = [] for arg in args: if hasattr(arg, '__iter__'): arglist.extend(arg) else: arglist.append(arg) return arglist def shell(*args, **kwargs): """ Run a command: program name is given in first arg and command line arguments in the rest of the args. Iterables (lists and tuples) in args are converted to separate arguments, so you can do: shell('gcc', '-o', 'program.exe', ['program.o', 'util.o']) Keyword arguments kwargs are interpreted as follows: "input" is a string to pass standard input into the process (or the default of None to use parent's stdin, eg: the keyboard) "silent" is True (default) to return process's standard output as a string, or False to print it as it comes out "shell" set to True will run the command via the shell (/bin/sh or COMSPEC) instead of running the command directly (the default) Raises ExecutionError(message, output, status) if the command returns a non-zero status code. """ return _shell(args, **kwargs) def _shell(args, input=None, silent=True, shell=False): | def shell(command, input=None, silent=True): """ Run given shell command and return its output as a string. - input='string' to pass standard input into the process. - input=None (default) to use parent's stdin (keyboard) - silent=False to use parent's stdout (i.e. print output as-it-comes instead of returning it) """ if input: stdin = subprocess.PIPE else: stdin = None if silent: stdout = subprocess.PIPE else: stdout = None proc = subprocess.Popen(command, shell=True, stdin=stdin, stdout=stdout, stderr=subprocess.STDOUT) if input: proc.stdin.write(input) output = '' if silent: output = proc.stdout.read() status = proc.wait() if status: raise ExecutionError('Command %r terminated with exit status %d' % (command.split(' ')[0], status), output, status) if silent: return output | de8ed355fef3c5fd7a14c435783f5e59145a2f2b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7381/de8ed355fef3c5fd7a14c435783f5e59145a2f2b/fabricate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
833,
67,
869,
67,
1098,
12,
1968,
4672,
3536,
2000,
279,
3569,
666,
434,
326,
864,
1775,
364,
5972,
7675,
3536,
31805,
273,
5378,
364,
1501,
316,
833,
30,
309,
3859,
12,
3175,
16,
4940... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
833,
67,
869,
67,
1098,
12,
1968,
4672,
3536,
2000,
279,
3569,
666,
434,
326,
864,
1775,
364,
5972,
7675,
3536,
31805,
273,
5378,
364,
1501,
316,
833,
30,
309,
3859,
12,
3175,
16,
4940... |
elif not tagele or tagele.value in self.selected_tags or not tagele.value in self.tags: | elif not tagele or (self.selected_tags and tagele.value in self.selected_tags) or not tagele.value in self.tags: | def showTagsN(self, tagele): if not self.tags: self.showTagWarning() elif not tagele or tagele.value in self.selected_tags or not tagele.value in self.tags: self.showTagsMenu(tagele) else: self.selected_tags_ele = tagele self.selected_tags = set([tagele.value]) self.reloadList(home = True) | d2188eb11a8c7663e34b1ab3d343a9981e60da62 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/d2188eb11a8c7663e34b1ab3d343a9981e60da62/MovieSelection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
3453,
50,
12,
2890,
16,
1047,
6516,
4672,
309,
486,
365,
18,
4156,
30,
365,
18,
4500,
1805,
6210,
1435,
1327,
486,
1047,
6516,
578,
261,
2890,
18,
8109,
67,
4156,
471,
1047,
6516... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
3453,
50,
12,
2890,
16,
1047,
6516,
4672,
309,
486,
365,
18,
4156,
30,
365,
18,
4500,
1805,
6210,
1435,
1327,
486,
1047,
6516,
578,
261,
2890,
18,
8109,
67,
4156,
471,
1047,
6516... |
__write_config(cp, override, simple_path, "vo", "default") | __write_config(cp, override, {1: simple_path}, 1, "vo", "default") | def config_compat(cp): """ Currently, all of the configuration information is kept in:: $VDT_LOCATION/monitoring/osg-attributes.conf This function will take in the ConfigParser object `cp` and update it with the configurations found from the OSG monitoring. If gip.override=True, then the config object overrides the OSG settings. If not, then the OSG settings override. If VDT_LOCATION is not defined, this function does nothing. """ if "VDT_LOCATION" not in os.environ: return try: override = cp.getboolean("gip", "override") except: override = False osg = None try: osg = Attributes("$VDT_LOCATION/monitoring/osg-attributes.conf") except Exception, e: log.error("Unable to open OSG attributes: %s" % str(e)) osg = None info = {1: "ldap://is.grid.iu.edu:2170", 2: "True"} __write_config(cp, override, info, 1, "bdii", \ "endpoint") __write_config(cp, override, info, 2, "cluster", "simple") if osg != None: # Write the attributes from the flat attributes file to the # ConfigParser object, which is organized by sections. __write_config(cp, override, osg, "OSG_HOSTNAME", "ce", "name") __write_config(cp, override, osg, "OSG_HOSTNAME", "ce", "unique_name") __write_config(cp, override, osg, "OSG_DEFAULT_SE", "se", "name") __write_config(cp, override, osg, "OSG_SITE_NAME", "site", "name") __write_config(cp, override, osg, "OSG_SITE_CITY", "site", "city") __write_config(cp, override, osg, "OSG_SITE_COUNTRY", "site", "country") __write_config(cp, override, osg, "OSG_CONTACT_NAME", "site", "contact") __write_config(cp, override, osg, "OSG_CONTACT_EMAIL", "site", "email") __write_config(cp, override, osg, "OSG_SITE_LONGITUDE", "site", "longitude") __write_config(cp, override, osg, "OSG_SITE_LATITUDE", "site", "latitude") __write_config(cp, override, osg, "OSG_APP", "osg_dirs", "app") __write_config(cp, override, osg, "OSG_DATA", "osg_dirs", "data") __write_config(cp, override, osg, "OSG_WN_TMP", "osg_dirs", "wn_tmp") __write_config(cp, override, osg, "OSG_JOB_MANAGER", "ce", "job_manager") __write_config(cp, override, osg, "OSG_PBS_LOCATION", "pbs", "pbs_path") __write_config(cp, override, osg, "OSG_SGE_LOCATION", "sge", "sge_path") __write_config(cp, override, osg, "OSG_SGE_ROOT", "sge", "sge_root") __write_config(cp, override, osg, "GRID3_SITE_INFO", "site", \ "sitepolicy") __write_config(cp, override, osg, "GRID3_SPONSOR", "site", "sponsor") # Do the same but with the gip stuff. try: gip = Attributes("$VDT_LOCATION/monitoring/gip-attributes.conf") except Exception, e: log.error("Unable to open GIP attributes: %s" % str(e)) return __write_config(cp, override, gip, "OSG_GIP_SE_HOST", "se", "unique_name") __write_config(cp, override, gip, "OSG_GIP_SE_NAME", "se", "name") if gip.get("OSG_GIP_SIMPLIFIED_SRM", "n").lower() == "y": #simple_path = os.path.join(gip["OSG_GIP_SIMPLIFIED_SRM_PATH"], "$VO") simple_path = gip["OSG_GIP_SIMPLIFIED_SRM_PATH"] __write_config(cp, override, simple_path, "vo", "default") for key in gip.keys(): if key.startswith("OSG_GIP_VO_DIR"): vo, dir = gip[key].split(',') __write_config(cp, override, dir, "vo", vo) | 77fdcbe9f145dca032d131955e0b522b54af4915 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12088/77fdcbe9f145dca032d131955e0b522b54af4915/gip_common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
67,
16239,
12,
4057,
4672,
3536,
15212,
16,
777,
434,
326,
1664,
1779,
353,
16555,
316,
2866,
225,
271,
58,
9081,
67,
15277,
19,
27665,
19,
538,
75,
17,
4350,
18,
3923,
225,
1220,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
67,
16239,
12,
4057,
4672,
3536,
15212,
16,
777,
434,
326,
1664,
1779,
353,
16555,
316,
2866,
225,
271,
58,
9081,
67,
15277,
19,
27665,
19,
538,
75,
17,
4350,
18,
3923,
225,
1220,... |
dsect = coord() | dsect = Coord() | def getcourse(isprobe): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scanner.chew() raise TrekError while navmode == "unspecified": if damaged(DNAVSYS): if isprobe: prout(_("Computer damaged; manual navigation only")) else: prout(_("Computer damaged; manual movement only")) scanner.chew() navmode = "manual" key = "IHEOL" break key = scanner.next() if key == "IHEOL": proutn(_("Manual or automatic- ")) iprompt = True scanner.chew() elif key == "IHALPHA": if scanner.sees("manual"): navmode = "manual" key = scanner.next() break elif scanner.sees("automatic"): navmode = "automatic" key = scanner.next() break else: huh() scanner.chew() raise TrekError else: # numeric if isprobe: prout(_("(Manual navigation assumed.)")) else: prout(_("(Manual movement assumed.)")) navmode = "manual" break delta = coord() if navmode == "automatic": while key == "IHEOL": if isprobe: proutn(_("Target quadrant or quadrant§or- ")) else: proutn(_("Destination sector or quadrant§or- ")) scanner.chew() iprompt = True key = scanner.next() if key != "IHREAL": huh() raise TrekError xi = int(round(scanner.real))-1 key = scanner.next() if key != "IHREAL": huh() raise TrekError xj = int(round(scanner.real))-1 key = scanner.next() if key == "IHREAL": # both quadrant and sector specified xk = int(round(scanner.real))-1 key = scanner.next() if key != "IHREAL": huh() raise TrekError xl = int(round(scanner.real))-1 dquad.i = xi dquad.j = xj dsect.i = xk dsect.j = xl else: # only one pair of numbers was specified if isprobe: # only quadrant specified -- go to center of dest quad dquad.i = xi dquad.j = xj dsect.j = dsect.i = 4 # preserves 1-origin behavior else: # only sector specified dsect.i = xi dsect.j = xj itemp = "normal" if not dquad.valid_quadrant() or not dsect.valid_sector(): huh() raise TrekError skip(1) if not isprobe: if itemp > "curt": if iprompt: prout(_("Helmsman Sulu- \"Course locked in for Sector %s.\"") % dsect) else: prout(_("Ensign Chekov- \"Course laid in, Captain.\"")) # the actual deltas get computed here delta.j = dquad.j-game.quadrant.j + (dsect.j-game.sector.j)/(QUADSIZE*1.0) delta.i = game.quadrant.i-dquad.i + (game.sector.i-dsect.i)/(QUADSIZE*1.0) else: # manual while key == "IHEOL": proutn(_("X and Y displacements- ")) scanner.chew() iprompt = True key = scanner.next() itemp = "verbose" if key != "IHREAL": huh() raise TrekError delta.j = scanner.real key = scanner.next() if key != "IHREAL": huh() raise TrekError delta.i = scanner.real # Check for zero movement if delta.i == 0 and delta.j == 0: scanner.chew() raise TrekError if itemp == "verbose" and not isprobe: skip(1) prout(_("Helmsman Sulu- \"Aye, Sir.\"")) scanner.chew() return course(bearing=delta.bearing(), distance=delta.distance()) | e571d502c19abfb5a3320300c347793da7b43d05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/e571d502c19abfb5a3320300c347793da7b43d05/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5566,
12,
291,
27230,
4672,
315,
967,
279,
4362,
471,
3888,
628,
326,
729,
1199,
498,
273,
374,
302,
21733,
273,
1610,
18,
3530,
12,
13957,
18,
21733,
6890,
13,
8775,
3188,
273,
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,
336,
5566,
12,
291,
27230,
4672,
315,
967,
279,
4362,
471,
3888,
628,
326,
729,
1199,
498,
273,
374,
302,
21733,
273,
1610,
18,
3530,
12,
13957,
18,
21733,
6890,
13,
8775,
3188,
273,
3... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 707) else quickfix.StringField.__init__(self, 707, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
8642,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
8642,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
tbounds = (x-hpadding, y-vpadding, w+hpadding*2, h+vpadding*2) | tbounds = (x-hpadding, y-vpadding, w+hpadding*2+1, h+vpadding*2+1) | def getBounds (self, spot): x, y, type, name, text = spot x, y = self.prcToPix (x, y) if spot == self.hovered: size = dotLarge else: size = dotSmall bounds = (x-size/2.-1, y-size/2.-1, size+2, size+2) if spot == self.hovered: x, y, w, h = self.getTextBounds(spot) tbounds = (x-hpadding, y-vpadding, w+hpadding*2, h+vpadding*2) return self.join(bounds, tbounds) return bounds | 0ea45e240368f710413ae29e2c6985e36931d3be /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5339/0ea45e240368f710413ae29e2c6985e36931d3be/SpotGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22107,
261,
2890,
16,
16463,
4672,
225,
619,
16,
677,
16,
618,
16,
508,
16,
977,
273,
16463,
619,
16,
677,
273,
365,
18,
683,
71,
774,
21816,
261,
92,
16,
677,
13,
225,
309,
16463,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22107,
261,
2890,
16,
16463,
4672,
225,
619,
16,
677,
16,
618,
16,
508,
16,
977,
273,
16463,
619,
16,
677,
273,
365,
18,
683,
71,
774,
21816,
261,
92,
16,
677,
13,
225,
309,
16463,
... |
isogeneous to the curve with given Cremona label. | isogenous to the curve with given Cremona label. | def isogeny_class(self, label): """ Returns the isogeny class of elliptic curves that are isogeneous to the curve with given Cremona label. INPUT: label -- string OUTPUT: list -- list of EllpticCurve objects. """ conductor, iso, num = parse_cremona_label(label) A = self.allcurves(conductor) K = [k for k in A.keys() if k[:len(iso)] == iso and k[len(iso)].isdigit()] return [self.elliptic_curve(str(conductor) + id) for id in K] | 744afc21f8d5aaa26af78f056bca854defd17092 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/744afc21f8d5aaa26af78f056bca854defd17092/cremona.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
19409,
93,
67,
1106,
12,
2890,
16,
1433,
4672,
3536,
2860,
326,
353,
19409,
93,
667,
434,
415,
549,
21507,
24106,
716,
854,
353,
19409,
1481,
358,
326,
8882,
598,
864,
5799,
2586,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
19409,
93,
67,
1106,
12,
2890,
16,
1433,
4672,
3536,
2860,
326,
353,
19409,
93,
667,
434,
415,
549,
21507,
24106,
716,
854,
353,
19409,
1481,
358,
326,
8882,
598,
864,
5799,
2586,
... |
cty.c_int, [cty.POINTER(FL_OBJECT), cty.POINTER(FL_FORM)], | cty.c_int, [cty.POINTER(FL_OBJECT), cty.POINTER(FL_FORM)], | def fl_delete_formbrowser_bynumber(ob, num): """ fl_delete_formbrowser_bynumber(ob, num) -> form """ retval = _fl_delete_formbrowser_bynumber(ob, num) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
3733,
67,
687,
11213,
67,
70,
878,
1226,
12,
947,
16,
818,
4672,
3536,
1183,
67,
3733,
67,
687,
11213,
67,
70,
878,
1226,
12,
947,
16,
818,
13,
317,
646,
3536,
225,
5221,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
3733,
67,
687,
11213,
67,
70,
878,
1226,
12,
947,
16,
818,
4672,
3536,
1183,
67,
3733,
67,
687,
11213,
67,
70,
878,
1226,
12,
947,
16,
818,
13,
317,
646,
3536,
225,
5221,
... |
'type': ObjType(l_('C++ type'), 'type'), 'var': ObjType(l_('C++ variable'), 'data'), | 'type': ObjType(l_('C++ type'), 'type') | def describe_signature(self, signode, (rv, func)): signode += addnodes.desc_type('', '') self.attach_type(signode, rv) signode += nodes.Text(u' ') self._attach_function(signode, func) return func.name | b3a5a84c12f6c8c38e6ccd1253a6601cc217db5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/b3a5a84c12f6c8c38e6ccd1253a6601cc217db5a/cpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6401,
67,
8195,
12,
2890,
16,
1573,
390,
16,
261,
4962,
16,
1326,
3719,
30,
1573,
390,
1011,
527,
4690,
18,
5569,
67,
723,
2668,
2187,
28707,
365,
18,
7331,
67,
723,
12,
2977,
390,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6401,
67,
8195,
12,
2890,
16,
1573,
390,
16,
261,
4962,
16,
1326,
3719,
30,
1573,
390,
1011,
527,
4690,
18,
5569,
67,
723,
2668,
2187,
28707,
365,
18,
7331,
67,
723,
12,
2977,
390,
1... |
base_layout.addWidget(self.loginUser) | base_layout.addWidget(self.dialog.loginUser) | def __init__(self, parent, status_bar, dialog): QtGui.QWidget.__init__(self, parent) self._status_bar = status_bar self.dialog = dialog | 9001cae1a3809039b46aed5d00bc5877b84f3544 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/9001cae1a3809039b46aed5d00bc5877b84f3544/repository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1267,
67,
3215,
16,
6176,
4672,
23425,
18,
53,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
13,
365,
6315,
2327,
67,
3215,
273,
1267,
67,
3215,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1267,
67,
3215,
16,
6176,
4672,
23425,
18,
53,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
13,
365,
6315,
2327,
67,
3215,
273,
1267,
67,
3215,
... |
for targetUID, relationship in refs.get(sourceUID, []): tObj = uc(UID=targetUID)[0].getObject() rc.addReference(sourceObj, tObj, relationship) | sids = rc.uniqueValuesFor('sourceUID') for sid in sids: set = rc(sourceUID=sid) sourceObject = uc(UID=sid)[0].getObject() if not sourceObject: continue annotations = sourceObject._getReferenceAnnotations() for brain in set: path = brain.getPath() ref = getattr(rc, path, None) if ref is None: continue if path.find('ref_') != -1: rc.uncatalog_object(path) uc.uncatalog_object(path) | def toReferenceCatalog(portal, out): if not hasattr(portal, REFERENCE_CATALOG): install_referenceCatalog(portal, out) print >>out, "Added Reference Catalog" rc = getattr(portal, REFERENCE_CATALOG) uc = getattr(portal, UID_CATALOG) #Now map the old references on AT to the RC at = portal.archetype_tool refs = getattr(at, 'refs', None) if not refs: return #we want to # assign new UUIDs # map old refs to new UUIDs in the new catalog # remove the old mappings from the AT # adding new reference using the RC will accomplish our goals # and then we can delete the old '_uid' attr allbrains = portal.portal_catalog() for brain in allbrains: #Get a uid for each thingie sourceObj = brain.getObject() sourceUID = getattr(sourceObj.aq_base, '_uid', None) if not sourceUID: continue rc.registerObject(sourceObj) sourceObj.reindexObject() #try for a UID update for brain in allbrains: sourceObj = brain.getObject() sourceUID = getattr(sourceObj.aq_base, '_uid', None) if not sourceUID: continue for targetUID, relationship in refs.get(sourceUID, []): tObj = uc(UID=targetUID)[0].getObject() rc.addReference(sourceObj, tObj, relationship) #remove all the old UIDs for brain in allbrains: sObject = brain.getObject() if hasattr(sObject, '_uid'): delattr(sObject, '_uid') #Reindex for new UUIDs uc.manage_reindexIndex() rc.manage_reindexIndex() else: # We had a reference catalog, make sure its doing annotation # based references rc = getattr(portal, REFERENCE_CATALOG) uc = getattr(portal, UID_CATALOG) # looks like its a folder with stuff in it.. old style # we want to do this quickly so we will grab all the # objects for each unique source ID and push them into # that source object sids = rc.uniqueValuesFor('sourceUID') for sid in sids: set = rc(sourceUID=sid) sourceObject = uc(UID=sid)[0].getObject() if not sourceObject: continue annotations = sourceObject._getReferenceAnnotations() for brain in set: # we need to uncatalog the ref at its current path # and then stick it on the new object and index it # again under its new relative pseudo path path = brain.getPath() ref = getattr(rc, path, None) if ref is None: continue if path.find('ref_') != -1: rc.uncatalog_object(path) uc.uncatalog_object(path) # make sure id==uid setattr(ref, UUID_ATTR, make_uuid()) ref.id = ref.UID() # now stick this in the annotation # unwrap the ref ref = aq_base(ref) annotations[ref.UID()] = ref rc._delOb(path) # I might have to do this each time (to deal with an # edge case), but I suspect not sourceObject._catalogRefs(portal) print >>out, "Migrated References" | bdd25cc907d9e340c0010c4d89e191f6afdd83c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/bdd25cc907d9e340c0010c4d89e191f6afdd83c6/migrations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
2404,
9769,
12,
24386,
16,
596,
4672,
225,
309,
486,
3859,
12,
24386,
16,
22898,
67,
14130,
18683,
4672,
3799,
67,
6180,
9769,
12,
24386,
16,
596,
13,
1172,
1671,
659,
16,
315,
86... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
2404,
9769,
12,
24386,
16,
596,
4672,
225,
309,
486,
3859,
12,
24386,
16,
22898,
67,
14130,
18683,
4672,
3799,
67,
6180,
9769,
12,
24386,
16,
596,
13,
1172,
1671,
659,
16,
315,
86... |
checklines = self.generate_typechecks(fnargs[nbargs_before:], mrdtable) | checklines = self.generate_typechecks(fnargs[nbargs_before:]) | def make_function(self, fnargs, nbargs_before, mrdtable): if self._function is not None: return self._function name = min(self.possiblenames) # pick a random one, but consistently self.compress_typechecks(mrdtable) checklines = self.generate_typechecks(fnargs[nbargs_before:], mrdtable) if checklines == ['pass']: body = self.body else: checklines.append(self.body) body = '\n '.join(checklines) source = 'def %s(%s):\n %s\n' % (name, ', '.join(fnargs), body) #print '_' * 60 #print source exec compile2(source) in self.miniglobals self._function = self.miniglobals[name] return self._function | 3a0de11b6e5af458d71b4ea4b543412165e5aace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/3a0de11b6e5af458d71b4ea4b543412165e5aace/multimethod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
915,
12,
2890,
16,
2295,
1968,
16,
4264,
1968,
67,
5771,
16,
9752,
72,
2121,
4672,
309,
365,
6315,
915,
353,
486,
599,
30,
327,
365,
6315,
915,
508,
273,
1131,
12,
2890,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
915,
12,
2890,
16,
2295,
1968,
16,
4264,
1968,
67,
5771,
16,
9752,
72,
2121,
4672,
309,
365,
6315,
915,
353,
486,
599,
30,
327,
365,
6315,
915,
508,
273,
1131,
12,
2890,
18... |
signal.alarm(0) | signal_alarm(0) | def tearDown(self): reap_children() | ce684ba4a1333a8efa958e5988fc46265c4d94b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/ce684ba4a1333a8efa958e5988fc46265c4d94b7/test_socketserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
283,
438,
67,
5906,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
283,
438,
67,
5906,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print 'modpath', modpath | def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exception, e: print repr(e), str(e) client.URLProtocol_didFailWithError_( self, NSError.errorWithDomain_code_userInfo_( NSURLErrorDomain, NSURLErrorResourceUnavailable, None, ), ) else: response = NSURLResponse.alloc().initWithURL_MIMEType_expectedContentLength_textEncodingName_( request.URL(), u'text/html', len(data), u'utf-8', ) client.URLProtocol_didReceiveResponse_cacheStoragePolicy_( self, response, NSURLCacheStorageNotAllowed, ) client.URLProtocol_didLoadData_( self, NSData.dataWithBytes_length_(data, len(data)), ) client.URLProtocolDidFinishLoading_(self) | 44b1330be1464a0488be8d1e731921775cdb2c3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/97/44b1330be1464a0488be8d1e731921775cdb2c3d/PyDocURLProtocol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
10515,
12,
2890,
4672,
1172,
315,
1937,
6,
1004,
273,
365,
18,
2625,
1435,
590,
273,
365,
18,
2293,
1435,
880,
803,
273,
590,
18,
1785,
7675,
10005,
1235,
1785,
7675,
803,
1435,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
10515,
12,
2890,
4672,
1172,
315,
1937,
6,
1004,
273,
365,
18,
2625,
1435,
590,
273,
365,
18,
2293,
1435,
880,
803,
273,
590,
18,
1785,
7675,
10005,
1235,
1785,
7675,
803,
1435,
1... | |
def check_status_line(self): code = self.handle.getinfo(pycurl.RESPONSE_CODE) if 300 <= code <= 399 and code != 301: self.saw_temporary_redirect = True self.status_code = code | def on_headers_finished(self): if self.header_callback: eventloop.add_idle(self.header_callback, 'httpclient header callback', args=(self._make_callback_info(),)) | 1e0afed61899e7c177ec41aceb6e8d5ae363ad2c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/1e0afed61899e7c177ec41aceb6e8d5ae363ad2c/httpclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2485,
67,
13527,
12,
2890,
4672,
309,
365,
18,
3374,
67,
3394,
30,
871,
6498,
18,
1289,
67,
20390,
12,
2890,
18,
3374,
67,
3394,
16,
296,
2022,
2436,
676,
1446,
1348,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2485,
67,
13527,
12,
2890,
4672,
309,
365,
18,
3374,
67,
3394,
30,
871,
6498,
18,
1289,
67,
20390,
12,
2890,
18,
3374,
67,
3394,
16,
296,
2022,
2436,
676,
1446,
1348,
2187,
... | |
source = self.open(member, pwd=pwd) | source = zipfile.open(member, pwd=pwd) | def extract_member(zipfile, member, targetpath): """Copied from Python 2.6 stdlib zipfile.py module. Extract the ZipInfo object 'member' to a physical file on the path targetpath. """ import shutil # build the destination pathname, replacing # forward slashes to platform specific separators. if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present if member.filename[0] == '/': targetpath = os.path.join(targetpath, member.filename[1:]) else: targetpath = os.path.join(targetpath, member.filename) targetpath = os.path.normpath(targetpath) # Create all upper directories if necessary. upperdirs = os.path.dirname(targetpath) if upperdirs and not os.path.exists(upperdirs): os.makedirs(upperdirs) if member.filename[-1] == '/': os.mkdir(targetpath) return targetpath source = self.open(member, pwd=pwd) target = file(targetpath, "wb") shutil.copyfileobj(source, target) source.close() target.close() return targetpath | 9ca406a40953783747554d17d97888bfb785b46b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/9ca406a40953783747554d17d97888bfb785b46b/nuwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
5990,
12,
4450,
768,
16,
3140,
16,
1018,
803,
4672,
3536,
28127,
628,
6600,
576,
18,
26,
2044,
2941,
18823,
18,
2074,
1605,
18,
225,
8152,
326,
8603,
966,
733,
296,
5990,
11,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
5990,
12,
4450,
768,
16,
3140,
16,
1018,
803,
4672,
3536,
28127,
628,
6600,
576,
18,
26,
2044,
2941,
18823,
18,
2074,
1605,
18,
225,
8152,
326,
8603,
966,
733,
296,
5990,
11,... |
def _dorewrite(match, connection, sessionDict, replacement): | def _dorewrite(match, connection, sessionDict, replacement, key): | def _dorewrite(match, connection, sessionDict, replacement): if callable(replacement): if isinstance(replacement, DynamicRewriter): replacement.refresh(connection, sessionDict) connection.uri = match.re.sub(replacement, connection.uri) else: connection.uri = match.expand(replacement) groupdict=m.groupdict() if Configuration.rewriteMatchToArgs: connection.args.update(groupdict) sessionDict['rewriteRules'][key].update(groupdict) | ae1490051d781091eac0e7f5ce05375aa481c9d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/ae1490051d781091eac0e7f5ce05375aa481c9d1/rewrite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
72,
479,
2626,
12,
1916,
16,
1459,
16,
1339,
5014,
16,
6060,
16,
498,
4672,
309,
4140,
12,
24394,
4672,
309,
1549,
12,
24394,
16,
12208,
17631,
1091,
4672,
6060,
18,
9144,
12,
407... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
72,
479,
2626,
12,
1916,
16,
1459,
16,
1339,
5014,
16,
6060,
16,
498,
4672,
309,
4140,
12,
24394,
4672,
309,
1549,
12,
24394,
16,
12208,
17631,
1091,
4672,
6060,
18,
9144,
12,
407... |
BtSize += ImageClass.Size | BtSize += ImageInfo.Image.Size | def _CollectModuleMapBuffer (self, MapBuffer, ModuleList): sys.stdout.write ("Generate Load Module At Fix Address Map") sys.stdout.flush() PatchEfiImageList = [] PeiModuleList = {} BtModuleList = {} RtModuleList = {} SmmModuleList = {} PeiSize = 0 BtSize = 0 RtSize = 0 # reserve 4K size in SMRAM to make SMM module address not from 0. SmmSize = 0x1000 for Module in ModuleList: GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (Module.MetaFile, Module.Arch, Module.ToolChain, Module.BuildTarget) OutputImageFile = '' for ResultFile in Module.CodaTargetList: if str(ResultFile.Target).endswith('.efi'): # # module list for PEI, DXE, RUNTIME and SMM # OutputImageFile = os.path.join(Module.OutputDir, Module.Name + '.efi') ImageClass = PeImageClass (OutputImageFile) if not ImageClass.IsValid: EdkLogger.error("build", FILE_PARSE_FAILURE, ExtraData=ImageClass.ErrorInfo) ImageInfo = PeImageInfo(Module.Name, Module.Guid, Module.OutputDir, ImageClass) if Module.ModuleType in ['PEI_CORE', 'PEIM', 'COMBINED_PEIM_DRIVER','PIC_PEIM', 'RELOCATABLE_PEIM', 'DXE_CORE']: PeiModuleList[Module.MetaFile] = ImageInfo PeiSize += ImageClass.Size elif Module.ModuleType in ['BS_DRIVER', 'DXE_DRIVER', 'UEFI_DRIVER']: BtModuleList[Module.MetaFile] = ImageInfo BtSize += ImageClass.Size elif Module.ModuleType in ['DXE_RUNTIME_DRIVER', 'RT_DRIVER', 'DXE_SAL_DRIVER', 'SAL_RT_DRIVER']: RtModuleList[Module.MetaFile] = ImageInfo RtSize += ImageClass.Size elif Module.ModuleType in ['SMM_CORE', 'DXE_SMM_DRIVER']: SmmModuleList[Module.MetaFile] = ImageInfo SmmSize += ImageClass.Size if Module.ModuleType == 'DXE_SMM_DRIVER': PiSpecVersion = 0 if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification: PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION'] # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver. if PiSpecVersion < 0x0001000A: BtModuleList[Module.MetaFile] = ImageInfo BtSize += ImageClass.Size break # # EFI image is final target. # Check EFI image contains patchable FixAddress related PCDs. # if OutputImageFile != '': ModuleIsPatch = False for Pcd in Module.ModulePcdList: if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST: ModuleIsPatch = True break if not ModuleIsPatch: for Pcd in Module.LibraryPcdList: if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST: ModuleIsPatch = True break if not ModuleIsPatch: continue # # Module includes the patchable load fix address PCDs. # It will be fixed up later. # PatchEfiImageList.append (OutputImageFile) # # Patch FixAddress related PCDs into EFI image # for EfiImage in PatchEfiImageList: EfiImageMap = EfiImage.replace('.efi', '.map') if not os.path.exists(EfiImageMap): continue # # Get PCD offset in EFI image by GenPatchPcdTable function # PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) # # Patch real PCD value by PatchPcdValue tool # for PcdInfo in PcdTable: ReturnValue = 0 if PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE, str (PeiSize/0x1000)) elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE, str (BtSize/0x1000)) elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE, str (RtSize/0x1000)) elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE: ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, str (SmmSize/0x1000)) if ReturnValue != 0: EdkLogger.error("build", PARAMETER_INVALID, "Patch PCD value failed", ExtraData=ErrorInfo) # # Get Top Memory address # TopMemoryAddress = 0 if self.LoadFixAddress == 0xFFFFFFFFFFFFFFFF: TopMemoryAddress = 0 else: TopMemoryAddress = self.LoadFixAddress if TopMemoryAddress < RtSize + BtSize + PeiSize: EdkLogger.error("build", PARAMETER_INVALID, "TopMemoryAddress is too low to load driver") MapBuffer.write('PEI_CODE_PAGE_NUMBER = 0x%x\n' % (PeiSize/0x1000)) MapBuffer.write('BOOT_CODE_PAGE_NUMBER = 0x%x\n' % (BtSize/0x1000)) MapBuffer.write('RUNTIME_CODE_PAGE_NUMBER = 0x%x\n' % (RtSize/0x1000)) MapBuffer.write('SMM_CODE_PAGE_NUMBER = 0x%x\n' % (SmmSize/0x1000)) PeiBaseAddr = TopMemoryAddress - RtSize - BtSize BtBaseAddr = TopMemoryAddress - RtSize RtBaseAddr = TopMemoryAddress | ef3747968bba5f59e31e3a867cfc32eb8a676f78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/914/ef3747968bba5f59e31e3a867cfc32eb8a676f78/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10808,
3120,
863,
1892,
261,
2890,
16,
1635,
1892,
16,
5924,
682,
4672,
2589,
18,
10283,
18,
2626,
7566,
4625,
4444,
5924,
2380,
12139,
5267,
1635,
7923,
2589,
18,
10283,
18,
11330,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10808,
3120,
863,
1892,
261,
2890,
16,
1635,
1892,
16,
5924,
682,
4672,
2589,
18,
10283,
18,
2626,
7566,
4625,
4444,
5924,
2380,
12139,
5267,
1635,
7923,
2589,
18,
10283,
18,
11330,
... |
""" INPUT: - ``X`` - list of lists of the same length | r""" Vector form of the Chinese Remainder Theorem: given a list of integer vectors `v_i` and a list of coprime moduli `m_i`, find a vector `w` such that `w = v_i \pmod m_i` for all `i`. This is more efficient than applying :func:`CRT` to each entry. INPUT: - ``X`` - list or tuple, consisting of lists/tuples/vectors/etc of integers of the same length | def CRT_vectors(X, moduli): """ INPUT: - ``X`` - list of lists of the same length - ``moduli`` - list of len(X) moduli OUTPUT: - ``list`` - application of CRT componentwise. EXAMPLES: sage: CRT_vectors([[3,5,7],[3,5,11]], [2,3]) [3, 5, 5] """ # First find the CRT basis: if len(X) == 0 or len(X[0]) == 0: return [] n = len(X) if n != len(moduli): raise ValueError, "number of moduli must equal length of X" a = CRT_basis(moduli) modulus = misc.prod(moduli) return [sum([a[i]*X[i][j] for i in range(n)]) % modulus for j in range(len(X[0]))] | 08206c95546f1db2a947692b19f3ca4ec939d5d9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/08206c95546f1db2a947692b19f3ca4ec939d5d9/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6732,
56,
67,
18535,
12,
60,
16,
13340,
77,
4672,
436,
8395,
5589,
646,
434,
326,
1680,
25331,
2663,
25407,
1021,
479,
81,
30,
864,
279,
666,
434,
3571,
10046,
1375,
90,
67,
77,
68,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6732,
56,
67,
18535,
12,
60,
16,
13340,
77,
4672,
436,
8395,
5589,
646,
434,
326,
1680,
25331,
2663,
25407,
1021,
479,
81,
30,
864,
279,
666,
434,
3571,
10046,
1375,
90,
67,
77,
68,
... |
cmd += ' -cdrom-device %s -dvd-device %s' % \ (self.media.devicename, self.media.devicename) | if self.media: cmd += ' -cdrom-device %s -dvd-device %s' % \ (self.media.devicename, self.media.devicename) | def settings(self, arg=None, menuw=None): if not self.menuw: self.menuw = menuw pop = None if not self.scanned: self.scanned = TRUE # Use the uid to make a user-unique filename uid = os.getuid() | c9987217b0a3654296c92fabcb5a2828b0fe7b1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/c9987217b0a3654296c92fabcb5a2828b0fe7b1b/videoitem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1947,
12,
2890,
16,
1501,
33,
7036,
16,
3824,
91,
33,
7036,
4672,
309,
486,
365,
18,
5414,
91,
30,
365,
18,
5414,
91,
273,
3824,
91,
1843,
273,
599,
309,
486,
365,
18,
1017,
10041,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1947,
12,
2890,
16,
1501,
33,
7036,
16,
3824,
91,
33,
7036,
4672,
309,
486,
365,
18,
5414,
91,
30,
365,
18,
5414,
91,
273,
3824,
91,
1843,
273,
599,
309,
486,
365,
18,
1017,
10041,
... |
return self.normcase(''.join(letters)) | return self.normcase("".join(letters)) | def next(self): c = self.characters choose = self.rng.choice letters = [choose(c) for dummy in "123456"] return self.normcase(''.join(letters)) | 73fe5b4e17300fe703da079a2bdf4fefe1e4ee56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/73fe5b4e17300fe703da079a2bdf4fefe1e4ee56/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
12,
2890,
4672,
276,
273,
365,
18,
20558,
9876,
273,
365,
18,
86,
3368,
18,
11569,
13768,
273,
306,
25777,
12,
71,
13,
364,
9609,
316,
315,
28462,
4313,
11929,
327,
365,
18,
7959... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1024,
12,
2890,
4672,
276,
273,
365,
18,
20558,
9876,
273,
365,
18,
86,
3368,
18,
11569,
13768,
273,
306,
25777,
12,
71,
13,
364,
9609,
316,
315,
28462,
4313,
11929,
327,
365,
18,
7959... |
TODO: We should only return the size of the original image | XXX: We should only return the size of the original image | def get_size(self, instance): """Get size of the stored data used for get_size in BaseObject TODO: We should only return the size of the original image """ sizes = self.getAvailableSizes(instance) original = self.get(instance) size = original and original.get_size() or 0 | 4783b5b4c58776802d846f70518c6480cf67411e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/4783b5b4c58776802d846f70518c6480cf67411e/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1467,
12,
2890,
16,
791,
4672,
3536,
967,
963,
434,
326,
4041,
501,
1399,
364,
336,
67,
1467,
316,
3360,
921,
225,
11329,
30,
1660,
1410,
1338,
327,
326,
963,
434,
326,
2282,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1467,
12,
2890,
16,
791,
4672,
3536,
967,
963,
434,
326,
4041,
501,
1399,
364,
336,
67,
1467,
316,
3360,
921,
225,
11329,
30,
1660,
1410,
1338,
327,
326,
963,
434,
326,
2282,
... |
if rnd is round_nearest: | if rnd == round_nearest: | def mpf_perturb(x, eps_sign, prec, rnd): """ For nonzero x, calculate x + eps with directed rounding, where eps < prec relatively and eps has the given sign (0 for positive, 1 for negative). With rounding to nearest, this is taken to simply normalize x to the given precision. """ if rnd is round_nearest: return mpf_pos(x, prec, rnd) sign, man, exp, bc = x eps = (eps_sign, MPZ_ONE, exp+bc-prec-1, 1) if sign: away = (rnd in (round_down, round_ceiling)) ^ eps_sign else: away = (rnd in (round_up, round_ceiling)) ^ eps_sign if away: return mpf_add(x, eps, prec, rnd) else: return mpf_pos(x, prec, rnd) | 9780c6d916cc9309b6669c056423418d7104c66e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11851/9780c6d916cc9309b6669c056423418d7104c66e/libmpf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6749,
74,
67,
672,
15850,
12,
92,
16,
7785,
67,
2977,
16,
13382,
16,
20391,
4672,
3536,
2457,
16966,
619,
16,
4604,
619,
397,
7785,
598,
20830,
13885,
16,
1625,
7785,
411,
13382,
1279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6749,
74,
67,
672,
15850,
12,
92,
16,
7785,
67,
2977,
16,
13382,
16,
20391,
4672,
3536,
2457,
16966,
619,
16,
4604,
619,
397,
7785,
598,
20830,
13885,
16,
1625,
7785,
411,
13382,
1279,
... |
'output_encoding': 'unicode', | def miss(self, path, mtime): w = NouvelleWriter() core.publish_file(source_path = path, writer = w, destination = NullFile(), settings_overrides = { 'output_encoding': 'unicode', | 8ebefff2e96d24a5398abae1d8aa258ff8dae8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/8ebefff2e96d24a5398abae1d8aa258ff8dae8e9/Doc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12543,
12,
2890,
16,
589,
16,
13158,
4672,
341,
273,
423,
1395,
941,
298,
2289,
1435,
2922,
18,
6543,
67,
768,
12,
3168,
67,
803,
273,
589,
16,
2633,
1377,
273,
341,
16,
2929,
273,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12543,
12,
2890,
16,
589,
16,
13158,
4672,
341,
273,
423,
1395,
941,
298,
2289,
1435,
2922,
18,
6543,
67,
768,
12,
3168,
67,
803,
273,
589,
16,
2633,
1377,
273,
341,
16,
2929,
273,
4... | |
if param == 'instrument': | if param == 'create_instrument': | def index2(request): try: param = request.POST['Param'] value = request.POST['Value'] except Exception, e: return HttpResponseServerError('Incorrect POST data: %s' % e) error = warning = '' try: if param == 'survey': if not Survey.objects.filter(name__iexact = value): if len(value) == 0 : warning = 'Please, enter a non-empty string' else: sur = Survey(name = value) sur.save() m = Rel_us(user_id = request.user.id, survey_id = sur.id) m.save() else: warning = 'Survey already existing' if param == 'instrument': survey = request.POST['Survey'] if not Instrument.objects.filter(name__iexact = value): if len(value) == 0 : warning = 'Please, enter a non-empty string' else: ins = Instrument(name = value) ins.save() g = Survey.objects.filter(name__iexact = survey)[0] i = Rel_si(survey_id = g.id, instrument_id = ins.id) i.save() else: warning = 'Instrument already existing' if param == 'release': instrument = request.POST['Instrument'] if not Release.objects.filter(label__iexact = value): if len(value) == 0 : warning = 'Please, enter a non-empty string' else: rel = Release(label = value,releasedate = getNowDateTime()) rel.save() ins = Instrument.objects.filter(name__iexact = instrument)[0] i = Rel_rinst(release_id =rel.id, instrument_id = ins.id) i.save() else: warning = 'Instrument already existing' except Exception, e: error = e resp = {'Survey' : str(value), 'Error' : str(error),'Warning' : warning} return HttpResponse(str(resp), mimetype = 'text/plain') | e5574271097a9d664dd4273406dd54496b8468d8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11651/e5574271097a9d664dd4273406dd54496b8468d8/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
22,
12,
2293,
4672,
775,
30,
579,
273,
590,
18,
3798,
3292,
786,
3546,
460,
273,
590,
18,
3798,
3292,
620,
3546,
1335,
1185,
16,
425,
30,
327,
9476,
8777,
2668,
16268,
5485,
501,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
22,
12,
2293,
4672,
775,
30,
579,
273,
590,
18,
3798,
3292,
786,
3546,
460,
273,
590,
18,
3798,
3292,
620,
3546,
1335,
1185,
16,
425,
30,
327,
9476,
8777,
2668,
16268,
5485,
501,
... |
try: line = raw_input(self.prompt) except EOFError: line = 'EOF' | if self.use_rawinput: try: line = raw_input(self.prompt) except EOFError: line = 'EOF' else: sys.stdout.write(self.prompt) line = sys.stdin.readline() if not len(line): line = 'EOF' else: line = line[:-1] | def cmdloop(self, intro=None): self.preloop() if intro is not None: self.intro = intro if self.intro: print self.intro stop = None while not stop: if self.cmdqueue: line = self.cmdqueue[0] del self.cmdqueue[0] else: try: line = raw_input(self.prompt) except EOFError: line = 'EOF' line = self.precmd(line) stop = self.onecmd(line) stop = self.postcmd(stop, line) self.postloop() | aa94af8fb0d623d8d611db480d9d184095b9b14d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/aa94af8fb0d623d8d611db480d9d184095b9b14d/cmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
6498,
12,
2890,
16,
13079,
33,
7036,
4672,
365,
18,
1484,
6498,
1435,
309,
13079,
353,
486,
599,
30,
365,
18,
23342,
273,
13079,
309,
365,
18,
23342,
30,
1172,
365,
18,
23342,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
6498,
12,
2890,
16,
13079,
33,
7036,
4672,
365,
18,
1484,
6498,
1435,
309,
13079,
353,
486,
599,
30,
365,
18,
23342,
273,
13079,
309,
365,
18,
23342,
30,
1172,
365,
18,
23342,
21... |
sys.exit(main()) | sys.exit(main()) | def main(argv=None): BASE_URL = "svn://chrome-svn/chrome" TRUNK_URL = BASE_URL + "/trunk/src" BRANCH_URL = None if (len(sys.argv) == 1): print "WARNING: Please use this tool in an empty directory (or at least one" print "that you don't mind clobbering." print "REQUIRES: SVN 1.5+" print "NOTE: NO NEED TO CHECKOUT ANYTHING IN ADVANCE OF USING THIS TOOL." print "\nValid parameters:" print "\n[Merge from trunk to branch]" print "<revision> --merge <branch_num>" print "Example " + sys.argv[0] + " 12345 --merge 187" print "\n[Merge from trunk to branch, ignoring revision history]" print "<revision> --mplus <branch_num>" print "Example " + sys.argv[0] + " 12345 --mplus 187" print "\n[Revert from trunk]" print " <revision> --revert" print "Example " + sys.argv[0] + " 12345 --revert" print "\n[Revert from branch]" print " <revision> --revert <branch_num>" print "Example " + sys.argv[0] + " 12345 --revert 187" sys.exit(0) revision = int(sys.argv[1]) if ((len(sys.argv) >= 4) and (sys.argv[2] in ['--revert','-r'])): BRANCH_URL = BASE_URL + "/branches/" + sys.argv[3] + "/src" url = BRANCH_URL else: url = TRUNK_URL action = "Merge" command = 'svn log ' + url + " -r "+str(revision) + " -v" os.system(command) if not prompt("Is this the correct revision?"): sys.exit(0) if (len(sys.argv) > 1): if sys.argv[2] in ['--merge','-m']: if (len(sys.argv) != 4): print "Please specify the branch # you want (i.e. 182) after --merge" sys.exit(0) branch_url = "svn://chrome-svn/chrome/branches/" + sys.argv[3] + "/src" checkoutRevision(url, revision, branch_url) mergeRevision(url, revision) elif sys.argv[2] in ['--mplus','-p']: if (len(sys.argv) != 4): print "Please specify the branch # you want (i.e. 182) after --merge" sys.exit(0) branch_url = "svn://chrome-svn/chrome/branches/" + sys.argv[3] + "/src" checkoutRevision(url, revision, branch_url) mergeRevision(url, revision, True) elif sys.argv[2] in ['--revert','-r']: if (len(sys.argv) == 4): url = "svn://chrome-svn/chrome/branches/" + sys.argv[3] + "/src" checkoutRevision(url, revision, url) revertRevision(url, revision) action = "Revert" else: print "Unknown parameter " + sys.argv[2] sys.exit(0) os.chdir('./src') #Check the base url so we actually find the author who made the change author = getAuthor(BASE_URL, revision) filename = str(revision)+".txt" out = open(filename,"w") out.write(action +" " + str(revision) + " - ") out.write(getRevisionLog(url, revision)) if (author): out.write("TBR=" + author) out.close() os.system('gcl change ' + str(revision) + " " + filename) os.unlink(filename) print author print revision print "gcl upload " + str(revision) + " --send_mail --no_try --no_presubmit --reviewers=" + author print "gcl commit " + str(revision) + " --no_presubmit --force" print "gcl delete " + str(revision) if prompt("Would you like to upload?"): gclUpload(revision, author) else: print "Deleting the changelist." os.system("gcl delete " + str(revision)) sys.exit(0) if prompt("Would you like to commit?"): os.system("gcl commit " + str(revision) + " --no_presubmit --force") else: sys.exit(0) | 44364270024fa1f0c4c0875635e210722b0d4b26 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/44364270024fa1f0c4c0875635e210722b0d4b26/drover.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
7036,
4672,
10250,
67,
1785,
273,
315,
31505,
2207,
343,
10896,
17,
31505,
19,
343,
10896,
6,
4235,
16141,
67,
1785,
273,
10250,
67,
1785,
397,
2206,
26133,
19,
4816... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
33,
7036,
4672,
10250,
67,
1785,
273,
315,
31505,
2207,
343,
10896,
17,
31505,
19,
343,
10896,
6,
4235,
16141,
67,
1785,
273,
10250,
67,
1785,
397,
2206,
26133,
19,
4816... |
sizer_19.Add(sizer_13, 0, wxALL|wxEXPAND, 4) sizer_19.Add(self.objectsListGrid, 1, wxEXPAND, 4) | sizer_19.Add(sizer_13, 0, wxALL, 4) sizer_19.Add(self.objectsListGrid, 0, 0, 4) | def __do_layout(self): # begin wxGlade: controlFrame.__do_layout sizer_16 = wxBoxSizer(wxVERTICAL) sizer_3 = wxBoxSizer(wxVERTICAL) sizer_20 = wxStaticBoxSizer(wxStaticBox(self.panel_3, -1, "Miscellaneous"), wxVERTICAL) sizer_21 = wxBoxSizer(wxHORIZONTAL) sizer_19 = wxStaticBoxSizer(wxStaticBox(self.panel_3, -1, "Objects"), wxVERTICAL) objectsButtons2Sizer = wxBoxSizer(wxHORIZONTAL) objectsButtons1Sizer = wxBoxSizer(wxHORIZONTAL) sizer_13 = wxBoxSizer(wxHORIZONTAL) sizer_17 = wxStaticBoxSizer(wxStaticBox(self.panel_3, -1, "Selected Points"), wxVERTICAL) selectedPointsButtons1Sizer = wxBoxSizer(wxHORIZONTAL) selectedPointsCursorSizer = wxBoxSizer(wxHORIZONTAL) sizer_18 = wxStaticBoxSizer(wxStaticBox(self.panel_3, -1, "Slices"), wxVERTICAL) slicerButtons2Sizer = wxBoxSizer(wxHORIZONTAL) slicesButtons1Sizer = wxBoxSizer(wxHORIZONTAL) sizer_7 = wxBoxSizer(wxHORIZONTAL) label_2 = wxStaticText(self.panel_3, -1, "New slice name:") sizer_7.Add(label_2, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 3) sizer_7.Add(self.createSliceComboBox, 1, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) sizer_7.Add(self.button_2_2, 0, wxALIGN_CENTER_VERTICAL, 7) sizer_7.Add(100, 20, 0, 0, 0) sizer_18.Add(sizer_7, 0, wxALL|wxEXPAND, 4) sizer_18.Add(self.sliceGrid, 1, wxEXPAND, 4) slicesButtons1Sizer.Add(self.selectAllSlicesButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) slicesButtons1Sizer.Add(self.button_8, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) slicesButtons1Sizer.Add(self.button_14, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) slicesButtons1Sizer.Add(self.button_15, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) slicesButtons1Sizer.Add(self.button_18, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) sizer_18.Add(slicesButtons1Sizer, 0, wxLEFT|wxRIGHT|wxTOP, 4) slicerButtons2Sizer.Add(self.button_12, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) slicerButtons2Sizer.Add(self.acsChoice, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) slicerButtons2Sizer.Add(self.pushSliceSpinCtrl, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) slicerButtons2Sizer.Add(self.button_16, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 7) sizer_18.Add(slicerButtons2Sizer, 0, wxALL, 4) sizer_3.Add(sizer_18, 0, wxLEFT|wxRIGHT|wxTOP, 7) selectedPointsCursorSizer.Add(self.label_1_2, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 3) selectedPointsCursorSizer.Add(self.sliceCursorText, 1, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) selectedPointsCursorSizer.Add(self.label_4_2, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 3) selectedPointsCursorSizer.Add(self.sliceCursorNameCombo, 1, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) selectedPointsCursorSizer.Add(self.button_6_2, 0, wxEXPAND, 0) sizer_17.Add(selectedPointsCursorSizer, 0, wxALL|wxEXPAND, 4) sizer_17.Add(self.pointsGrid, 1, wxEXPAND, 4) selectedPointsButtons1Sizer.Add(self.pointsSelectAllButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) selectedPointsButtons1Sizer.Add(self.pointsDeselectAllButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) selectedPointsButtons1Sizer.Add(self.pointsRemoveButton, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 4) sizer_17.Add(selectedPointsButtons1Sizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 4) sizer_17.Add(self.pointInteractionCheckBox, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4) sizer_3.Add(sizer_17, 0, wxLEFT|wxRIGHT|wxTOP, 7) sizer_13.Add(self.label_5_1, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 3) sizer_13.Add(self.surfacePickActionChoice, 0, wxALIGN_CENTER_VERTICAL, 0) sizer_19.Add(sizer_13, 0, wxALL|wxEXPAND, 4) sizer_19.Add(self.objectsListGrid, 1, wxEXPAND, 4) objectsButtons1Sizer.Add(self.button_9_1, 0, wxRIGHT, 4) objectsButtons1Sizer.Add(self.button_10_1, 0, wxRIGHT, 4) objectsButtons1Sizer.Add(self.button_3_1, 0, wxRIGHT, 4) objectsButtons1Sizer.Add(self.button_2_1, 0, wxRIGHT, 4) objectsButtons1Sizer.Add(self.button_4_1, 0, wxRIGHT, 4) sizer_19.Add(objectsButtons1Sizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 4) objectsButtons2Sizer.Add(self.button_11_1, 0, wxRIGHT, 4) objectsButtons2Sizer.Add(self.button_3, 0, wxRIGHT, 4) objectsButtons2Sizer.Add(self.button_13_1, 0, wxRIGHT, 4) objectsButtons2Sizer.Add(self.button_4, 0, wxRIGHT, 4) sizer_19.Add(objectsButtons2Sizer, 0, wxALL, 4) sizer_3.Add(sizer_19, 0, wxLEFT|wxRIGHT|wxTOP, 7) sizer_21.Add(self.voiEnabledCheckBox, 0, wxALIGN_CENTER_VERTICAL, 0) sizer_21.Add(self.label_7, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2) sizer_21.Add(self.voiBoundsText, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2) sizer_21.Add(self.label_7_1, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2) sizer_21.Add(self.voiExtentText, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2) sizer_20.Add(sizer_21, 0, wxALL|wxEXPAND, 4) sizer_3.Add(sizer_20, 0, wxALL|wxEXPAND, 7) self.panel_3.SetAutoLayout(1) self.panel_3.SetSizer(sizer_3) sizer_3.Fit(self.panel_3) sizer_3.SetSizeHints(self.panel_3) sizer_16.Add(self.panel_3, 0, 0, 0) self.SetAutoLayout(1) self.SetSizer(sizer_16) sizer_16.Fit(self) sizer_16.SetSizeHints(self) self.Layout() # end wxGlade | 5a1be175ea8d188ad99b9ee86080c99184888cea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/5a1be175ea8d188ad99b9ee86080c99184888cea/slice3dVWRFrames.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2896,
67,
6741,
12,
2890,
4672,
468,
2376,
7075,
21308,
2486,
30,
3325,
3219,
16186,
2896,
67,
6741,
272,
1824,
67,
2313,
273,
7075,
3514,
20512,
12,
27226,
21654,
10109,
13,
272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2896,
67,
6741,
12,
2890,
4672,
468,
2376,
7075,
21308,
2486,
30,
3325,
3219,
16186,
2896,
67,
6741,
272,
1824,
67,
2313,
273,
7075,
3514,
20512,
12,
27226,
21654,
10109,
13,
272,
... |
name_load = str(eval(L[5:])) | name_load = _strip_quotes(L[5:]) | def preparse_file(contents, attached={}, magic=True, do_time=False, ignore_prompts=False): if not isinstance(contents, str): raise TypeError, "contents must be a string" assert isinstance(contents, str) # We keep track of which files have been loaded so far # in order to avoid a recursive load that would result # in creating a massive file and crashing. loaded_files = [] F = [] A = contents.splitlines() i = 0 while i < len(A): L = A[i].rstrip() if magic and L[:7] == "attach ": name = os.path.abspath(eval(L[7:])) try: if not attached.has_key(name): t = os.path.getmtime(name) attached[name] = t except IOError, OSError: pass L = 'load ' + L[7:] if magic and L[:5] == "load ": try: name_load = str(eval(L[5:])) except: name_load = L[5:].strip() if name_load in loaded_files: i += 1 continue loaded_files.append(name_load) if name_load[-3:] == '.py': _ip.magic('run -i "%s"'%name_load) L = '' elif name_load[-5:] == '.sage': try: G = open(name_load) except IOError: print "File '%s' not found, so skipping load of %s"%(name_load, name_load) i += 1 continue else: A = A[:i] + G.readlines() + A[i+1:] continue elif name_load[-5:] == '.spyx': import interpreter L = interpreter.load_cython(name_load) else: #print "Loading of '%s' not implemented (load .py, .spyx, and .sage files)"%name_load L = 'load("%s")'%name_load M = preparse(L, reset=(i==0), do_time=do_time, ignore_prompts=ignore_prompts) F.append(M) i += 1 # end while return '\n'.join(F) | a583bf8d5dab4f840b1cf2fac231ded41a214d20 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/a583bf8d5dab4f840b1cf2fac231ded41a214d20/preparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
2670,
67,
768,
12,
3980,
16,
7495,
28793,
8146,
33,
5510,
16,
741,
67,
957,
33,
8381,
16,
2305,
67,
17401,
1092,
33,
8381,
4672,
309,
486,
1549,
12,
3980,
16,
609,
4672,
1002,
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,
675,
2670,
67,
768,
12,
3980,
16,
7495,
28793,
8146,
33,
5510,
16,
741,
67,
957,
33,
8381,
16,
2305,
67,
17401,
1092,
33,
8381,
4672,
309,
486,
1549,
12,
3980,
16,
609,
4672,
1002,
3... |
self.additional_headers = {} if client_id is not None and developer_key is not None: self.additional_headers = {'X-Gdata-Client': client_id, 'X-GData-Key': 'key=%s' % developer_key} elif developer_key and not client_id: | if developer_key and not client_id: | def __init__(self, email=None, password=None, source=None, server=YOUTUBE_SERVER, additional_headers=None, client_id=None, developer_key=None, **kwargs): """Creates a client for the YouTube service. | 46150ccf3975fe4f63a9bf0a262ccbd1624ef5ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10620/46150ccf3975fe4f63a9bf0a262ccbd1624ef5ce/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2699,
33,
7036,
16,
2201,
33,
7036,
16,
1084,
33,
7036,
16,
1438,
33,
61,
5069,
3457,
41,
67,
4370,
16,
3312,
67,
2485,
33,
7036,
16,
1004,
67,
350,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2699,
33,
7036,
16,
2201,
33,
7036,
16,
1084,
33,
7036,
16,
1438,
33,
61,
5069,
3457,
41,
67,
4370,
16,
3312,
67,
2485,
33,
7036,
16,
1004,
67,
350,
... |
if unit[0]=='[' and unit[-1]==']': | if unit in ('','-'): unit = None elif unit[0]=='[' and unit[-1]==']': | def getUnit(self): """Returns the unit of the node; None is returned if the node does not have a unit specified. """ if not self.templatenode.hasAttribute('unit'): return None unit = self.templatenode.getAttribute('unit') if unit[0]=='[' and unit[-1]==']': node = self.parent[unit[1:-1]] if node is None: return None unit = node.getValueAsString(addunit=False,usedefault=True) return unit | 70863b7f16c0263d2226e8fac7b7819dada311d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/70863b7f16c0263d2226e8fac7b7819dada311d7/xmlstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19194,
12,
2890,
4672,
3536,
1356,
326,
2836,
434,
326,
756,
31,
599,
353,
2106,
309,
326,
756,
1552,
486,
1240,
279,
2836,
1269,
18,
3536,
309,
486,
365,
18,
27380,
270,
20680,
18,
53... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19194,
12,
2890,
4672,
3536,
1356,
326,
2836,
434,
326,
756,
31,
599,
353,
2106,
309,
326,
756,
1552,
486,
1240,
279,
2836,
1269,
18,
3536,
309,
486,
365,
18,
27380,
270,
20680,
18,
53... |
old={} try: for pl2 in pl.interwiki(): old[pl2.site()] = pl2 except wikipedia.NoPage: wikipedia.output(u"BUG: %s no longer exists?" % pl.aslink(forceInterwiki = True)) return False | for pl2 in pl.interwiki(): old[pl2.site()] = pl2 except wikipedia.NoPage: wikipedia.output(u"BUG>>> %s no longer exists?" % pl.aslink(forceInterwiki = True)) return False mods, removing = compareLanguages(old, new, insite = pl.site()) if globalvar.autonomous and not globalvar.force and len(removing) > 0: for site in removing: if site != pl.site(): new[site] = old[site] wikipedia.output(u"WARNING: %s appears to be a dead link." % old[site].aslink(forceInterwiki = True)) | def replaceLinks(self, pl, new, bot): """ Returns True if saving was successful. """ if globalvar.localonly: # In this case only continue on the Page we started with if pl != self.pl(): return False | f26dba898937f97d67f00514b2025aca590f3b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/f26dba898937f97d67f00514b2025aca590f3b24/interwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
7100,
12,
2890,
16,
886,
16,
394,
16,
2512,
4672,
3536,
2860,
1053,
309,
12392,
1703,
6873,
18,
3536,
309,
2552,
1401,
18,
3729,
3700,
30,
468,
657,
333,
648,
1338,
1324,
603,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
7100,
12,
2890,
16,
886,
16,
394,
16,
2512,
4672,
3536,
2860,
1053,
309,
12392,
1703,
6873,
18,
3536,
309,
2552,
1401,
18,
3729,
3700,
30,
468,
657,
333,
648,
1338,
1324,
603,
32... |
("content-encoding", self.contentType()), | ("content-encoding", self.contentEncoding()), | def setHeaders(response): for (header, value) in ( ("content-length", self.contentLength()), ("content-type", self.contentType()), ("content-encoding", self.contentType()), ): if value is not None: response.headers.setHeader(header, value) | ece0c354a23e3f6025e539f710dd775b92d0bc29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ece0c354a23e3f6025e539f710dd775b92d0bc29/resource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24359,
12,
2740,
4672,
364,
261,
3374,
16,
460,
13,
316,
261,
7566,
1745,
17,
2469,
3113,
365,
18,
1745,
1782,
1435,
3631,
7566,
1745,
17,
723,
3113,
365,
18,
22194,
1435,
3631,
7566,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24359,
12,
2740,
4672,
364,
261,
3374,
16,
460,
13,
316,
261,
7566,
1745,
17,
2469,
3113,
365,
18,
1745,
1782,
1435,
3631,
7566,
1745,
17,
723,
3113,
365,
18,
22194,
1435,
3631,
7566,
... |
lastNode.parent.childNodes.remove(lastNode) | lastNode.parent.removeChild(lastNode) | def endTagFormatting(self, name): """The much-feared adoption agency algorithm""" # XXX I don't like while True + break... too much # possibility of infinite loops while True: # Step 1 paragraph 1 afeElement = self.parser.elementInActiveFormattingElements(name) if not afeElement or (afeElement in self.parser.openElements and not self.parser.elementInScope(afeElement.name)): self.parser.parseError() return | c884e7829c941ebf20a9cd32d2f4dfde638f64b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/c884e7829c941ebf20a9cd32d2f4dfde638f64b8/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
23974,
12,
2890,
16,
508,
4672,
3536,
1986,
9816,
17,
3030,
2258,
1261,
3482,
1737,
2075,
4886,
8395,
468,
11329,
467,
2727,
1404,
3007,
1323,
1053,
397,
898,
2777,
4885,
9816,
468,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
23974,
12,
2890,
16,
508,
4672,
3536,
1986,
9816,
17,
3030,
2258,
1261,
3482,
1737,
2075,
4886,
8395,
468,
11329,
467,
2727,
1404,
3007,
1323,
1053,
397,
898,
2777,
4885,
9816,
468,... |
noerror=True | noerror=cmor.CMOR_CRITICAL | def checkCMOR(fout,file,table,noerror=cmor.CMOR_CRITICAL,variable=None,from_bounds=None,other_tables=None,dodrs=True): req_glbl_att = ['title','Conventions','source','experiment','source','institution','project_id','table_id','realization',] opt_glbl_att = ['cmor_version','history','references','comment','parent_experiment'] nerr=0 nwarn=0 ncheck=0 IPCC_std_vars=[] IPCC_std_axes=[] tables=[table,] if other_tables is not None: for t in other_tables: if not t in tables and t is not None: tables.append(t) etables = [] for tbl in tables: manageLog(fout,VERBOSE, 'Reading table:',tbl) e=readTable(tbl) etables.append(e) Vars=e['variable'] Axes=e['axis'] extra_req = e['general'].get('required_global_attributes','').split() for ex in extra_req: if not ex in req_glbl_att: req_glbl_att.append(ex) for v in Vars.keys(): IPCC_std_vars.append(Vars[v].get('out_name',v)) for a in Axes.keys(): onm = Axes[a].get('out_name',a) if not onm in IPCC_std_axes: IPCC_std_axes.append(onm) ## if IPCC_std_axes[-1]=='lev' : ## IPCC_std_axes.pop(-1) ## IPCC_std_axes.append('eta') ## Axes[a]['out_name']='eta' ver = e['general'].get('cmor_version',2.0) ver = '%g' % float(ver) spver = ver.split('.') major = int(spver[0]) if major>1: req_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','creation_date','frequency','modeling_realm'] else: opt_glbl_att+=["contact",'experiment_id','physics_version','initialization_method','institute_id','institution','tracking_id','product','frequency','model_id','forcing','creation_date','frequency','modeling_realm'] if isinstance(file,str): fnm=file file=cdms2.open(file) elif isinstance(file,cdms2.dataset.CdmsFile): fnm=str(file).split('file')[1].split(',')[0].strip()[1:-1] else: nerr+=manageLog(fout, noerror, 'You must pass a file name or cdms2 file object') if fnm.split("_")[-1]=="clim.nc": is_clim = True else: is_clim = False pthroot, shrt_fnm = os.path.split(fnm) if variable is None: manageLog(fout,VERBOSE, 'Checking file argument',IPCC_std_axes) manageLog(fout,VERBOSE, 'Checking path structure for path:',pthroot) manageLog(fout,VERBOSE, 'Checking file structure for file:',fnm) print >> fout, 'Checking the file starts with variable name' ok = False for v in IPCC_std_vars: n = len(v) if shrt_fnm[:n] == v and shrt_fnm[n]=='_': ok = True break if not ok: nerr+=manageLog(fout, noerror, ''+shrt_fnm+' does not start with standard %s variable name followed by _' % file.project_id) vf=v #Check the variable is actually in the file if not v in file.variables.keys(): nerr+=manageLog(fout,noerror,"Your file name says it contains variable",v,"but it is not in your file, your file contains:",file.variables.keys()) if hasattr(file,'cmor_version'): up = False rew = False ver = getattr(file,'cmor_version') if isinstance(ver,numpy.ndarray): ver = '%g' % float(ver[0]) spver = ver.split('.') fmajor = int(spver[0]) if len(spver)>1 : minor = int(spver[1]) if len(spver)>2: patch = int(spver[2]) else: patch = 0 else: minor=0 patch=0 if fmajor>cmor.CMOR_VERSION_MAJOR: up = True elif fmajor<cmor.CMOR_VERSION_MAJOR: rew=True else: # Major matches if minor>cmor.CMOR_VERSION_MINOR: up = True elif minor<cmor.CMOR_VERSION_MINOR: rew = True else: # minor matches if patch>cmor.CMOR_VERSION_PATCH: up = True elif patch<cmor.CMOR_VERSION_PATCH: rew = True ncheck+=1 if up: if fmajor==cmor.CMOR_VERSION_MAJOR: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should upgrade your cmor" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) else: nerr+=manageLog(fout,noerror,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you need to upgrade cmor to check these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ncheck+=1 if rew: nwarn+=manageLog(fout,cmor.CMOR_WARNING,"You are using cmor version: %i.%i.%i, these files have been written with version: %i.%i.%i, you should consider rewriting these files" % (cmor.CMOR_VERSION_MAJOR,cmor.CMOR_VERSION_MINOR,cmor.CMOR_VERSION_PATCH,fmajor,minor,patch)) ## 32bit systems only if os.uname()[-1].find("64")==-1: sz=os.path.getsize(fnm) manageLog(fout,VERBOSE, 'Checking file size (32bit systems only):',sz) if sz>2**31: if major>1: ncheck+=1 nwarn+=1 ec =cmor.CMOR_WARNING else: ec=noerror manageLog(fout,ec, 'File size too large',sz,' (>2Gb)!') #nerr+=manageLog(fout, noerror, 'file size too large (>2Gb)!') manageLog(fout,VERBOSE, 'Checking that file contains required global attributes') for att in req_glbl_att: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) if not hasattr(file,att) and not att in shrt_vals: i = req_glbl_att.index(att) if i==0 or req_glbl_att[i-1] not in shrt_vals: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) else: pr = req_gbl_att[i-1] expt = getattr(file,"experiment","") shrt = shrt_vals[long_vals.index(expt)] if shrt == pr: nerr+=manageLog(fout, noerror, 'File must have global attribute: '+att) fval=getattr(file,att,'') if att=='experiment_id': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att=='experiment': ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) for lv in long_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'experiment file attribute must be one of : %s, you have: %s' % (str(long_vals), fval) ) elif att=='parent_experiment_id': if fval == getattr(file,"experiment_id",""): nerr+=manageLog(fout,noerror,"parent_experiment_id and experiment_id cannot be the same you have %s for both" % fval) ok = False for e in etables: val=e['general'].get('expt_id_ok',None) long_vals,shrt_vals = split_expt_ids(val) shrt_vals.append("N/A") for lv in shrt_vals: if fval==lv or (lv[-4:] =='XXXX' and fval[:-4]==lv[:-4]) or (lv[-4:] =='DDHH' and fval[:-10]==lv[:-10]): ok = True break if not ok: nerr+=manageLog(fout, noerror, 'parent_experiment_id file attribute must be one of : %s, you have: %s' % (str(shrt_vals), fval) ) elif att == 'forcing': sp = fval.split(',') forcings=e['general'].get("forcings") for vl in sp: if not vl.strip() in forcings: nerr+=manageLog(fout,noerror,"file attribute forcing must be a comma separated list with values in: %s, yours is: %s (offending value: %s)" % (forcings,fval,vl.strip())) elif att == 'frequency': if not fval in ['yr','mon','day','6hr','3hr','subhr','fx','monClim']: nerr+=manageLog(fout,noerror, 'frequency must be one of:','yr','mon','day','6hr','3hr','subhr','fx','monClim') elif att in ['realization']: if isinstance(fval,numpy.ndarray): if len(fval)>1: nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') fval=fval[0] if not isinstance(fval,(int,numpy.int,numpy.int32)): nerr+=manageLog(fout, noerror, 'realization attribute must be an integer') elif att in ['table_id']: manageLog(fout,VERBOSE, '\ttable_id is: ', fval) elif att == "creation_date": # checks that it matches: YYYY-MM-DDTHH:MM:SSZ fmt = "%Y-%m-%dT%H:%M:%SZ" try: t =time.strptime(fval,fmt) except: nerr+=manageLog(fout, noerror, 'Creation Date must be in format: %s yours is: %s' % (fmt,fval)) elif att == "branch_time": try: myval=float(fval) except: nerr+=manageLog(fout, noerror, 'branch_time must be convertible to float, you have %s' % (fval)) if getattr(file,"parent_experiment_id","").strip()=="N/A": if float(fval)!=0.: nerr+=manageLog(fout, noerror, 'if global attribute parent_experiment_id is N/A then branch_time must be 0., you have %s' % (fval)) elif att == "project_id": if e['general'].get("project_id") != fval: nerr+=manageLog(fout, noerror, 'project_id must be %s' % (e['general'].get("project_id"))) else: val=e['general'].get(att,None) if isinstance(fval,str) : fval=fval.strip().lower() if isinstance(val,str) : val=val.strip().lower() if val is not None: if isinstance(fval,str): res=fval.find(val) if res==-1: res=False else: res=True else: res=fval==val manageLog(fout,VERBOSE, '**************',att,val,fval) if not res: nerr+=manageLog(fout, noerror, 'attribute '+att+' must be set to: -'+val+'- +'+fval+'+ '+str(res)) for att in opt_glbl_att: ncheck+=1 if not hasattr(file,att): nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tIt is often helpful to define the global attribute: ',att) for att in file.attributes.keys(): ncheck+=1 if not att in req_glbl_att and not att in opt_glbl_att: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\tYou have global attribute: %s which is neither required nor optional ' % att) if major>=2: # more file structure there tbl_id = getattr(file,'table_id').split()[1] tbl_date= getattr(file,'table_id').split('(')[1].split(')')[0].strip() ttbl_id = e['general'].get("table_id").split()[1] ttbl_date = e['general'].get("table_date").strip() if tbl_date!=ttbl_date: nwarn+=1 ncheck+=1 manageLog(fout,cmor.CMOR_WARNING,"File says table date was %s, but your table is dated from: %s" %( tbl_date,ttbl_date)) if tbl_id!=ttbl_id: nerr+=manageLog(fout, noerror, 'your file indicates a table id of %s while your table id is %s' % (tbl_id,ttbl_id)) sp = shrt_fnm.split(v)[1].split("_") t = file[v].getTime() if t is not None: n=6 t=t.clone() else: n=4 if is_clim: n+=1 expt = getattr(file,"experiment","") try: shrt = shrt_vals[long_vals.index(expt)] except: #Ok we must be in one of the XXXX or DDHH cases... for i in range(len(long_vals)): if long_vals[i][:-4]==expt[:-4]: shrt=shrt_vals[i][:-4]+expt[-4:] break if long_vals[i][:-10]==expt[:-10]: shrt=shrt_vals[i][:-10]+expt[-10:] break if shrt=="": n-=1 spoffset=-1 else: spoffset=0 print len(sp) if len(sp)<n: nerr+=manageLog(fout, noerror, 'your file name does not seem to match the profile: varid_tableid_modelid_exptid_rid[iid][pid][_startdate-enddate][_suffix][_clim].nc') if sp[1]!=tbl_id: nerr+=manageLog(fout, noerror, 'your file name indicates a table id of %s while your table id should be %s' % (sp[1],tbl_id)) if sp[2]!=getattr(file,'model_id'): fmodid = hyphenize(getattr(file,'model_id')) if sp[2]!=fmodid: nerr+=manageLog(fout, noerror, 'your file name indicates model_id is: %s but your file says it is: %s' % (sp[2],getattr(file,'model_id'))) if shrt!="": if shrt!=sp[3]: nerr+=manageLog(fout, noerror, 'your file name indicates exp_id is: %s but your file says it should be: %s' % (sp[3],shrt)) real = sp[4+spoffset] rsp=real.split("p") if hasattr(file,"physics_version"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate physics_version but your file says it should be: %s' % (file.physics_version)) elif int(rsp[0].split('i')[0][1:])!=int(file.physics_version): nerr+=manageLog(fout, noerror, 'your file name indicates physics_version is: %s but your file says it should be: %s' % (rsp[1],file.physics_version)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates physics_version to be %s but your file says it has not physics: %s' % (rsp[1])) real=rsp[0] rsp=real.split("i") if hasattr(file,"initialization_method"): if len(rsp)==1: nerr+=manageLog(fout, noerror, 'your file name does not indicate initialization_method but your file says it should be: %s' % (file.initialization_method)) elif int(rsp[1])!=int(file.initialization_method): nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method is: %s but your file says it should be: %s' % (rsp[1],file.initialization_method)) elif len(rsp)!=1: nerr+=manageLog(fout, noerror, 'your file name indicates initialization_method to be %s but your file says it has not initialization_method: %s' % (rsp[1])) real=rsp[0] if int(real[1:])!=int(getattr(file,'realization')): nerr+=manageLog(fout, noerror, 'your file name indicates realization is: %s but your file says it is: %i' % (sp[3][3:],int(getattr(file,'realization')))) ## skip the following if it has no time if t is not None: # here we check the clim b4 going further checking into date clim_att = getattr(t,'climatology',None) if clim_att is None: has_clim = False else: has_clim = True if is_clim!=has_clim: if is_clim: nerr+=manageLog(fout, noerror, 'your file name indicates climatology, but the time axis does not have the climatology attribute') else: nerr+=manageLog(fout, noerror, 'your file name does not indicates climatology (_clim.nc), but the time axis has the climatology attribute') if is_clim: tmp = file(t.climatology,slice(0,1)) ft0 = tmp[0][0] tmp = file(t.climatology,slice(-1,None)) ft1 = tmp[-1][1] else: ft0=t[0] ft1=t[-1] ft0= cdtime.reltime(ft0,t.units).tocomp(t.getCalendar()) ft1= cdtime.reltime(ft1,t.units).tocomp(t.getCalendar()) dates = sp[5+spoffset].split("-") # now determines the frequency units = t.units.split("since")[0].strip() interval = float(e['general'].get("approx_interval")) interval = genutil.udunits(interval,units).to("s").value # determine what the frequency drname should be if (interval<2500.) : frequency = "subhr" elif (interval<15000.): frequency = "3hr" elif (interval<30000.): frequency = "6hr" elif (interval<100000.): frequency = "day" elif (interval<3.E6): frequency = "mon" else: frequency = "yr" if (interval == 0.): strcpy(tmp,"fx") #Now checks the frequecny attribute matches the one we just decided if file.frequency[-4:]=='Clim': frequency=frequency+"Clim" if file.frequency!=frequency: nerr+=manageLog(fout, noerror, 'your file indicates a frequency of "%s" but the approximate_interval suggests it should be: "%s"' % (file.frequency,frequency)) try: yr0=int(dates[0][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section start date iun your file',dates[0][:4]) frequency = 'yr' if interval<29.E6: frequency='mon' if len(dates[0])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m0 = int(dates[0][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section start date iun your file',dates[0][4:6]) else: m0=ft0.month if interval < 2E6: frequency='mon' if len(dates[0])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d0 = int(dates[0][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the day section start date iun your file',dates[0][6:8]) else: d0=ft0.day if interval < 86000: if len(dates[0])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours') try: h0 = int(dates[0][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section start date iun your file',dates[0][8:10]) else: h0= ft0.hour if interval < 3000: if len(dates[0])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: mn0 = int(dates[0][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the miuntes section start date iun your file',dates[0][10:12]) else: mn0=ft0.minute if interval < 50: if len(dates[0])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s0 = int(dates[0][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section start date iun your file',dates[0][12:14]) else: s0=ft0.second t0 = cdtime.comptime(yr0,m0,d0,h0,mn0,s0) try: yr1=int(dates[1][:4]) except: nerr+=manageLog(fout, noerror, 'could not convert the years section end date iun your file',dates[1][:4]) if interval<29.E6: if len(dates[1])<6: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years only when the approximate interval says it should have months') try: m1 = int(dates[1][4:6]) except: nerr+=manageLog(fout, noerror, 'could not convert the months section end date iun your file',dates[1][4:6]) else: m1=ft1.month if interval < 2.E6: if len(dates[1])<8: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years and months only when the approximate interval says it should have days') try: d1 = int(dates[1][6:8]) except: nerr+=manageLog(fout, noerror, 'could not convert the days section end date iun your file',dates[1][6:8]) else: d1=ft1.day if interval < 90000: if len(dates[1])<10: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months and days only when the approximate interval says it should have hours') try: h1 = int(dates[1][8:10]) except: nerr+=manageLog(fout, noerror, 'could not convert the hours section end date iun your file',dates[1][8:10]) else: h1=ft1.hour if interval < 4000: if len(dates[1])<12: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days and hours only when the approximate interval says it should have minutes') try: mn1 = int(dates[1][10:12]) except: nerr+=manageLog(fout, noerror, 'could not convert the minutes section end date iun your file',dates[1][10:12]) else: mn1=ft1.minute if interval < 100: if len(dates[1])<14: nerr+=manageLog(fout, noerror, 'your file name indicates a start time with years, months, days, hours and minutes only when the approximate interval says it should have seconds') try: s1 = int(dates[1][12:14]) except: nerr+=manageLog(fout, noerror, 'could not convert the seconds section end date iun your file',dates[1][12:14]) else: s1=ft1.second t1 = cdtime.comptime(yr1,m1,d1,h1,mn1,s1) if (ft0.year!=t0.year) or (ft0.month!=t0.month) or (ft0.day!=t0.day): nerr+=manageLog(fout, noerror, 'your file name indicates a start time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t0.year,t0.month,t0.day,ft0.year,ft0.month,ft0.day)) if (ft1.year!=t1.year) or (ft1.month!=t1.month) or (ft1.day!=t1.day): nerr+=manageLog(fout, noerror, 'your file name indicates an end time of %i-%i-%i but the actual value in the file says: %i-%i-%i' % (t1.year,t1.month,t1.day,ft1.year,ft1.month,ft1.day)) manageLog(fout,VERBOSE, 'Checking that file contains only 1 variable') vars=file.listvariable() ## removes dims and other complementary vars # First bounds ## manageLog(fout,VERBOSE, vars) vars2=file.listvariable() vars3=[] vars4=[] for v in vars2: ## manageLog(fout,VERBOSE, v) V=file[v] b=getattr(V,'bounds',None) if b is not None: vars.pop(vars.index(b)) b=getattr(V,'ancillary_variables',None) if b is not None: for sp in b.split(): if sp.trip() in vars: vars.pop(sp.strip()) for ax in V.getAxisList(): b=getattr(ax,'bounds',None) if b is not None: if b in vars: vars.pop(vars.index(b)) Ab=file[b] # recovers associated bounds with axis f=getattr(Ab,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(True) f=getattr(ax,'formula_terms',None) if f is not None: ## figures out the names of formula_terms sp=f.split(':') ## manageLog(fout,VERBOSE, sp) for t in sp: ## manageLog(fout,VERBOSE, 't is:',t) t=t.split()[-1] ## manageLog(fout,VERBOSE, 'Now it is:',t) sp2=f.split(t+':')[1].split()[0] if sp2 in vars: vars3.append(vars.pop(vars.index(sp2))) vars4.append(False) coords=getattr(V,'coordinates',None) if coords is not None: coords = coords.split() for c in coords: if c in vars: vars.pop(vars.index(c)) if hasattr(V,"grid_mapping"): if V.grid_mapping in vars: vars.pop(vars.index(V.grid_mapping)) manageLog(fout,VERBOSE, "Grid_mapping attribute found, we cannot check these files yet") ncheck+=1 nwarn+=1 return nwarn,ncheck,nerr t = V.getTime() if t is not None and hasattr(t,"climatology"): c = t.climatology if c in vars: vars.pop(vars.index(c)) if len(vars)!=1: nerr+=manageLog(fout, noerror, 'file must contain only 1 variable, you have: '+str(len(vars))+':'+str(vars)) var=vars[0] if major>=2 and dodrs: #Now checks for the DRS file structure prj_id = file.project_id.strip().replace(" ","_") prod = file.product inst = file.institute_id if inst == 'not specified' : inst = "INSTITUTE_ID" mod = file.model_id exp = file.experiment_id #by pass no sht for now... noff=0 fq = file.frequency realm = file.modeling_realm r = str(int(file.realization)) if hasattr(file,"initialization_method"): r+="i"+str(int(file.initialization_method)) if hasattr(file,"physics_version"): r+="p"+str(int(file.physics_version)) path = os.path.dirname(fnm).split("/") nerr += drs_check_pos(1,path,fout,noerror,'r%s' % r, 'realization') nerr += drs_check_pos(2,path,fout,noerror,var, 'variable') nerr += drs_check_pos(3,path,fout,noerror,realm, 'modeling realm') nerr += drs_check_pos(4,path,fout,noerror,fq, 'frequency') if exp == file.experiment: noff=1 else: nerr += drs_check_pos(5,path,fout,noerror,exp, 'experiment id') nerr += drs_check_pos(6-noff,path,fout,noerror,hyphenize(mod), 'model id') nerr += drs_check_pos(7-noff,path,fout,noerror,inst, 'insitution id') nerr += drs_check_pos(8-noff,path,fout,noerror,prod, 'product') nerr += drs_check_pos(9-noff,path,fout,noerror,prj_id, 'project id') fb=False if variable is not None: var=variable fb=from_bounds manageLog(fout,VERBOSE, 'Ok user asked to check the following variable:',variable,'with from bounds =',fb) manageLog(fout,VERBOSE, 'Checking variable name is %s compliant' % file.project_id) if not var in IPCC_std_vars: if var in Vars.keys(): nerr+=manageLog(fout, noerror, var+' is not valid, did you mean :'+Vars[var]['out_name']+' ?') else: nerr+=manageLog(fout, noerror, 'Variable name :'+var+' is not %s compliant' % file.project_id) if variable is None: manageLog(fout,VERBOSE, 'Checking that variable name in file matches file indications') if not var == vf: nerr+=manageLog(fout, noerror, 'File indicates it stores variable:'+vf+' but actually '+var+' is stored in it') V=file[var] axes=V.getAxisList() hasLat=0 hasLon=0 hasTime=0 hasLevel=0 ax_dict_name=[] for ax in axes: manageLog(fout,VERBOSE, 'Checking axis name is valid for:',ax.id,'on var:',V.id) if not ax.id in IPCC_std_axes: if ax.id in Axes.keys(): if major <2: ncheck+=1 nwarn+=1 nerr+=manageLog(fout,cmor.CMOR_WARNING, '\t\t'+ax.id+' is not preferred. We suggest you rename it:'+Axes[ax.id]['out_name']) else: manageLog(fout,noerror, '\t\tAxis name '+ax.id+' is not valid. We require you rename it:'+Axes[ax.id]['out_name']) elif (fb == False) or (fb == True and V.rank()!=2): nerr+=manageLog(fout, noerror, 'axis id: '+ax.id+' is not a valid IPCC name') if ax.isLatitude(): hasLat=1 if ax.isLongitude(): hasLon=1 if ax.isTime(): hasTime=1 if ax.isLevel(): hasLevel=1 old_ordering=0 o=V.getOrder(ids=1) if old_ordering: manageLog(fout,VERBOSE, 'Checking dimensions order') if hasTime: manageLog(fout,VERBOSE, '\tChecking time position') if o[0]=='t': o=o[1:] else: nerr+=manageLog(fout, noerror, 'time must be first dimension your ordering is:'+o) manageLog(fout,VERBOSE, '\tChecking none tzxy dims position') sp=o.split('(') if len(sp)>1: if o[0]!='(': nerr+=manageLog(fout, noerror, 'none zyx dimensions must come right after time dimension, you have:'+o) o=o.split(')')[-1] manageLog(fout,VERBOSE, '\tChecking level position') if hasLevel: if o[0]=='z': o=o[1:] else: nerr+=manageLog(fout, noerror, 'level must be ordered after time your order is:'+o) manageLog(fout,VERBOSE, '\tChecking latitude position') if hasLat: if o[0]=='y': o=o[1:] else: nerr+=manageLog(fout, noerror, 'latitude must be ordered after time and level your order is:'+o) manageLog(fout,VERBOSE, '\tChecking longitude position') if hasLon: if o[0]=='x': o=o[1:] else: nerr+=manageLog(fout, noerror, 'longitude must be ordered after time, level and latitude your order is:'+o) g=None if hasLat and hasLon: manageLog(fout,VERBOSE, 'Checking grid') g=V.getGrid() if not isinstance(g,cdms2.grid.AbstractRectGrid): nerr+=manageLog(fout, noerror, 'lat/lon variable ('+var+') must have Rectilinear grids') axes_nmes=Vars[var].get('dimensions',None) if axes_nmes is not None: manageLog(fout,VERBOSE, 'Checking rest of things on axes') axes_nmes=axes_nmes[::-1] axes_nmes_for_ordering=Vars[var]['dimensions'][::-1] coord=getattr(V,'coordinates',None) for nm in axes_nmes: req_Att=['standard_name','units'] anm = nm if nm in [ 'alevel','olevel','zlevel']: gnm=nm manageLog(fout,VERBOSE, '\tChecking special case %s, i.e' % (nm),'') tmpax=V.getLevel() print>>fout, tmpax.id,tmpax.standard_name for x in Axes.keys(): tmp=Axes[x].get('standard_name',None) if tmp is not None: tmp=tmp.strip() if tmp is not None and tmp==tmpax.standard_name: nm=x Nm=Axes[x]['out_name'] anm=x req_Att.append('formula') req_Att.append('formula_terms') if getattr(tmpax,"formula","")==Axes[x]['formula']: break axes_nmes_for_ordering[axes_nmes_for_ordering.index(gnm)]=nm elif not nm in V.getAxisIds(): try: Nm=Axes[nm]['out_name'] except: nerr+=manageLog(fout, noerror, 'with axis: '+nm+' not found for variable: '+var, noerror) else: Nm=nm if major>1: if Axes[anm].get("must_have_bounds","no")=="yes": req_Att.append("bounds") if Axes[anm].get("axis",None) is not None: req_Att.append("axis") else: req_Att.append("bounds") if nm == 'time' and is_clim: req_Att.pop(req_Att.index("bounds")) manageLog(fout,VERBOSE, '\tChecking',Nm) axindx=V.getAxisIndex(Nm) val=Axes[nm].get('value',None) if val is not None: #singleton dimension ? manageLog(fout,VERBOSE, '\t\tSingleton dimension') if val is None: nerr+=manageLog(fout, noerror, 'cannot retrieve needed axis:'+Nm) else: val=float(val) if axindx!=-1: nerr+=manageLog(fout, noerror, 'singleton dimension '+Nm+' must be defined via coordinates attributes on variable '+var+' not as an axis') else: manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute exists on '+var) aval=getattr(V,'coordinates',None) if aval is None: nerr+=manageLog(fout, noerror, 'singleton dimension must be defined via coordinates attribute') manageLog(fout,VERBOSE, '\t\tChecking coordinates attribute matches for '+var) if not Nm in aval.split(): nerr+=manageLog(fout, noerror, 'coordinates atrtribute on '+var+' should be '+Nm+' it is '+aval) ax=file[Nm] mn,mx=Axes[nm].get('valid_min',None), Axes[nm].get('valid_max',None) manageLog(fout,VERBOSE, '\t\tChecks for value') if ax != val: manageLog(fout,VERBOSE, '\t\t\tNot matching, checking if valid range is defined in table') if mn is None and mx is None: nerr+=manageLog(fout, noerror, 'singleton dimension value for '+Nm+' must be '+str(val)) manageLog(fout,VERBOSE, '\t\t\tChecking if value is within range defined in table') if mn is not None: if mx is not None: if not( float(mn)<ax<float(mx)): nerr+=manageLog(fout, noerror, 'invalid value for singleton dimension '+Nm+': '+str(ax)+' must be between '+mn+' and '+mx) elif ax<float(mn): nerr+=manageLog(fout, noerror, 'invalid min for singleton dimension '+Nm+': '+str(ax)+' must be greater than '+mn) elif ax>float(mx): nerr+=manageLog(fout, noerror, 'invalid max for singleton dimension '+Nm+': '+str(ax)+' must be less than '+mx) manageLog(fout,VERBOSE, '\t\tChecking for bounds information') b=getattr(ax,'bounds',None) bv=Axes[nm].get('bounds_values',None) if bv is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in table, checking vs file') bv=bv.split() bv=float(bv[0]),float(bv[1]) if b is not None: manageLog(fout,VERBOSE, '\t\t\tBounds information defined in file, checking if matches') abv=file[b] ncheck+=1 if abv[0]!=bv[0] or abv[1]!=bv[1]: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tbounds_value for singleton dimension '+Nm+': '+str(abv)+' do not match requested bounds:'+str(bv)) else: nerr+=manageLog(fout, noerror, 'singleton dimension: '+Nm+' bounds required') else: ncheck+=1 if b is not None: nwarn+=1 manageLog(fout,cmor.CMOR_WARNING, '\t\t\t\tSingleton dimension: '+Nm+' bounds should not be included') axes_nmes_for_ordering.pop(0) continue # singleton dimension checked no need to continue further if axindx==-1: nerr+=manageLog(fout, noerror, 'Variable '+var+' should have an axis called '+Axes[Nm]) ax=V.getAxis(axindx) manageLog(fout,VERBOSE, '\t\tChecking that dimension order is positioned:',axes_nmes_for_ordering.index(nm)+1,axes_nmes) if axindx!=axes_nmes_for_ordering.index(nm): nerr+=manageLog(fout, noerror, 'in ordering for dimension '+nm+' position is: '+str(axindx)+' but it should be: '+str(axes_nmes_for_ordering.index(nm))) if ('cell_bounds' in Axes[nm].get('ignored',[])) or ('cell_bounds' in Axes[nm].get('forbidden',[])) or ('cell_bounds' in Axes[nm].get('optional',[])): req_Att.pop(req_Att.index('bounds')) if 'units' in Axes[nm].get('ignored',[]) or 'units' in Axes[nm].get('optional',[]): try: req_Att.pop(req_Att.index('units')) except: pass ## Ok here we're trying to do the region thing, i.e coordinate attribute exist docoord=False if coord is not None: for c in coord.split(): nax=file[c] if ax.id in nax.getAxisIds(): oldax=ax ax=nax docoord=True manageLog(fout,VERBOSE, '\t\tChecking if required attributes are set:','') for r in req_Att: manageLog(fout,VERBOSE, r,'') val=getattr(ax,r,None) if val is None: print >>fout nerr+=manageLog(fout, noerror, 'attribute '+r+' is required for axis '+ax.id) if r!='units': good_val=Axes[nm].get(r,None) if good_val is not None: if val!=good_val: nerr+=manageLog(fout, noerror, 'axis attribute '+r+' should be: '+str(good_val)+' but is:'+str(val)) if r=='formula_terms': print 'Formula:',Axes[anm]['formula'],val print >>fout if not 'units' in Axes[nm].get('ignored',[]): if not 'units' in Axes[nm].get('optional',[]) or ('units' in Axes[nm].get('optional',[]) and hasattr(ax,'units')): if not ax.isTime(): manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major<2: u1=genutil.udunits(1,ax.units) try: u2=u1.to(Axes[nm]['units']) if u2.value!=1: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) except: nerr+=manageLog(fout, noerror, 'units:'+ax.units+' are not compatible with required:'+Axes[nm]['units']) else: if ax.units != Axes[nm]['units']: nerr+=manageLog(fout, noerror, 'units: '+ax.units+' are not the required units:'+Axes[nm]['units']) else: manageLog(fout,VERBOSE, '\t\tChecking units',ax.units) if major>1: if ax.units.lower().find("days since")==-1: nerr+=manageLog(fout,noerror,'Time units must be in "days since", you have:',ax.units) bnds = ax.getBounds() if bnds is not None: for i in range(len(ax)): if ax[i]!=(bnds[i][0]+bnds[i][1])/2.: nerr+=manageLog(fout,noerror,"Time values are not average of time bounds") try: u=cdtime.reltime(1,ax.units) except: nerr+=manageLog(fout, noerror, 'invalid time units:'+ax.units+', should be in the form: "'+Axes[nm]['units']+'"') try: c=ax.calendar except: c='none' if not c in ["gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard"]: nerr+=manageLog(fout,noerror,"calendar must be one of [","gregorian","standard", "proleptic_gregorian","noleap","365_day","360_day","julian","none","non_standard ] yours is",c) if c=='365_day': c=cdtime.NoLeapCalendar else: c=ax.getCalendar() manageLog(fout,VERBOSE, '\t\tView First and Last times:\t',ax.asComponentTime(c)[0],'\t',ax.asComponentTime(c)[-1]) tmpbnds=ax.getBounds() if tmpbnds is not None: manageLog(fout,VERBOSE, '\t\tView Bounds for first time:\t',cdtime.reltime(tmpbnds[0,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[0,1],ax.units).tocomp(c)) manageLog(fout,VERBOSE, '\t\tView Bounds for last time:\t',cdtime.reltime(tmpbnds[-1,0],ax.units).tocomp(c),'\t',cdtime.reltime(tmpbnds[-1,1],ax.units).tocomp(c)) else: manageLog(fout,VERBOSE,'\t\tNo Bounds for time') tp=Axes[nm].get('type','double') manageLog(fout,VERBOSE, '\t\tChecking axis is type',tp) if tp == 'double' : tp='d' elif tp == 'real' : tp='f' elif tp == 'character' : tp='c' elif tp == 'integer' : tp='l' else: nerr+=manageLog(fout, noerror, 'encountered unknown type:'+tp) if ax.typecode()!=tp: nerr+=manageLog(fout, noerror, 'required typecode for '+Nm+' should be '+tp+' not '+ax.typecode()) if ax.isLongitude(): manageLog(fout,VERBOSE, '\t\tChecking for axis attribute') a=getattr(ax,'axis',None) if a is None: nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute') if a!='X': nerr+=manageLog(fout, noerror, 'longitude axis must have associated axis attribute set to X not: '+a) manageLog(fout,VERBOSE, '\t\tChecking name') if not ax.id in ['lon','longitude']: nerr+=manageLog(fout, noerror, 'longitude axis name must be longitude or lon (prefered) not: '+ax.id) | 147b07ceb0a19eed8a8cc3b164ebeadbb3bc2349 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9170/147b07ceb0a19eed8a8cc3b164ebeadbb3bc2349/check_CMOR_compliant.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
9611,
916,
12,
617,
322,
16,
768,
16,
2121,
16,
2135,
1636,
33,
7670,
280,
18,
9611,
916,
67,
5093,
21377,
16,
6105,
33,
7036,
16,
2080,
67,
10576,
33,
7036,
16,
3011,
67,
9373,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9611,
916,
12,
617,
322,
16,
768,
16,
2121,
16,
2135,
1636,
33,
7670,
280,
18,
9611,
916,
67,
5093,
21377,
16,
6105,
33,
7036,
16,
2080,
67,
10576,
33,
7036,
16,
3011,
67,
9373,... |
el4 = etree.SubElement(el3, 'text:p', attrib={ | el4 = SubElement(el3, 'text:p', attrib={ | def visit_option_list(self, node): #self.document.reporter.debug_flag = 1 #self.document.reporter.attach_observer(self.show_message) table_name = 'rststyle-tableoption' # # Generate automatic styles if not self.optiontablestyles_generated: self.optiontablestyles_generated = True el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': table_name, 'style:family': 'table'}) el1 = etree.SubElement(el, 'style:table-properties', attrib={ 'style:width': '17.59cm', 'table:align': 'left', 'style:shadow': 'none'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.A' % table_name, 'style:family': 'table-column'}) el1 = etree.SubElement(el, 'style:table-column-properties', attrib={ 'style:column-width': '4.999cm'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.B' % table_name, 'style:family': 'table-column'}) el1 = etree.SubElement(el, 'style:table-column-properties', attrib={ 'style:column-width': '12.587cm'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.A1' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:background-color': 'transparent', 'fo:padding': '0.097cm', 'fo:border-left': '0.035cm solid #000000', 'fo:border-right': 'none', 'fo:border-top': '0.035cm solid #000000', 'fo:border-bottom': '0.035cm solid #000000'}) el2 = etree.SubElement(el1, 'style:background-image') el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.B1' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:padding': '0.097cm', 'fo:border': '0.035cm solid #000000'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.A2' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:padding': '0.097cm', 'fo:border-left': '0.035cm solid #000000', 'fo:border-right': 'none', 'fo:border-top': 'none', 'fo:border-bottom': '0.035cm solid #000000'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.B2' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:padding': '0.097cm', 'fo:border-left': '0.035cm solid #000000', 'fo:border-right': '0.035cm solid #000000', 'fo:border-top': 'none', 'fo:border-bottom': '0.035cm solid #000000'}) # # Generate table data el = self.append_child('table:table', attrib={ 'table:name': table_name, 'table:style-name': table_name, }) el1 = etree.SubElement(el, 'table:table-column', attrib={ 'table:style-name': '%s.A' % table_name}) el1 = etree.SubElement(el, 'table:table-column', attrib={ 'table:style-name': '%s.B' % table_name}) el1 = etree.SubElement(el, 'table:table-header-rows') el2 = etree.SubElement(el1, 'table:table-row') el3 = etree.SubElement(el2, 'table:table-cell', attrib={ 'table:style-name': '%s.A1' % table_name, 'office:value-type': 'string'}) el4 = etree.SubElement(el3, 'text:p', attrib={ 'text:style-name': 'Table_20_Heading'}) el4.text= 'Option' el3 = etree.SubElement(el2, 'table:table-cell', attrib={ 'table:style-name': '%s.B1' % table_name, 'office:value-type': 'string'}) el4 = etree.SubElement(el3, 'text:p', attrib={ 'text:style-name': 'Table_20_Heading'}) el4.text= 'Description' self.set_current_element(el) | 57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
3482,
67,
1098,
12,
2890,
16,
756,
4672,
468,
2890,
18,
5457,
18,
266,
7988,
18,
4148,
67,
6420,
273,
404,
468,
2890,
18,
5457,
18,
266,
7988,
18,
7331,
67,
30971,
12,
2890... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
3482,
67,
1098,
12,
2890,
16,
756,
4672,
468,
2890,
18,
5457,
18,
266,
7988,
18,
4148,
67,
6420,
273,
404,
468,
2890,
18,
5457,
18,
266,
7988,
18,
7331,
67,
30971,
12,
2890... |
self._assign_canonical_names(val_doc, name) | self._assign_canonical_names(val_doc, val_doc.canonical_name) | def __init__(self, root): """ Create a new documentation index, based on the given root set of C{ValueDoc}s. If any C{APIDoc}s reachable from the root set does not have a canonical name, then it will be assigned one. etc. @param root: A dictionary mapping from names to C{ValueDoc}s. """ #: A list of (name, ValueDoc) pairs. self._root_items = [] self._root_dict = dict(root) #: The set of all C{ValueDoc}s that are directly or indirectly #: reachable from the root set. In particular, this set contains #: all C{ValueDoc}s that can be reached from the root set by #: following I{any} sequence of pointers to C{ValueDoc}s or #: C{VariableDoc}s. self.reachable_valdocs = Set() | b097566987f7c4a1dcccfb72347f754962ebb8b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/b097566987f7c4a1dcccfb72347f754962ebb8b2/docindexer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
4672,
3536,
1788,
279,
394,
7323,
770,
16,
2511,
603,
326,
864,
1365,
444,
434,
385,
95,
620,
1759,
97,
87,
18,
225,
971,
1281,
385,
95,
2203,
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,
1001,
2738,
972,
12,
2890,
16,
1365,
4672,
3536,
1788,
279,
394,
7323,
770,
16,
2511,
603,
326,
864,
1365,
444,
434,
385,
95,
620,
1759,
97,
87,
18,
225,
971,
1281,
385,
95,
2203,
73... |
latest = self._impl.log(self.local_url, limit=1) | try: latest = self._impl.log(self.local_url, limit=1) except pysvn.ClientError: return 0 | def count(self, branch=None): latest = self._impl.log(self.local_url, limit=1) if not latest: return 0 return latest[0].revision.number | 62e1c0a2de22ed610de05f663380f389bf430d53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/62e1c0a2de22ed610de05f663380f389bf430d53/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1056,
12,
2890,
16,
3803,
33,
7036,
4672,
775,
30,
4891,
273,
365,
6315,
11299,
18,
1330,
12,
2890,
18,
3729,
67,
718,
16,
1800,
33,
21,
13,
1335,
21027,
25031,
18,
1227,
668,
30,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1056,
12,
2890,
16,
3803,
33,
7036,
4672,
775,
30,
4891,
273,
365,
6315,
11299,
18,
1330,
12,
2890,
18,
3729,
67,
718,
16,
1800,
33,
21,
13,
1335,
21027,
25031,
18,
1227,
668,
30,
32... |
self.generateImpliedEndTags() | self.parser.generateImpliedEndTags() | def endTagCaption(self, name): if self.parser.elementInScope(name, True): # XXX this code is quite similar to endTagTable in "InTable" self.generateImpliedEndTags() if self.parser.openElements[-1].name == "caption": self.parser.parseError() while self.parser.openElements[-1].name != "caption": self.parser.openElements.pop() self.parser.clearActiveFormattingElements() self.parser.switchInsertionMode("inTable") else: # innerHTML case self.parser.parseError() | a6d74b308ecb57f1058281ac188330f2006b2426 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/a6d74b308ecb57f1058281ac188330f2006b2426/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
21158,
12,
2890,
16,
508,
4672,
309,
365,
18,
4288,
18,
2956,
382,
3876,
12,
529,
16,
1053,
4672,
468,
11329,
333,
981,
353,
25102,
7281,
358,
29765,
1388,
316,
315,
382,
1388,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
21158,
12,
2890,
16,
508,
4672,
309,
365,
18,
4288,
18,
2956,
382,
3876,
12,
529,
16,
1053,
4672,
468,
11329,
333,
981,
353,
25102,
7281,
358,
29765,
1388,
316,
315,
382,
1388,
... |
self.scoreTest(r's1s1s1s1 s2s2s2 wewe S3S3S3 s4s4s4 Msw LS3S3S3S3', | self.scoreTest(r's1s1s1s1 s2s2s2 wewe S3S3S3 s4s4s4 Mswe LS3S3S3S3', | def testRest(self): self.scoreTest(r's1s1s1s1 s2s2s2 wewe S3S3S3 s4s4s4 Msw Ls2s2s2s2', Score(44, 2), rules=['Last Tile Taken from Dead Wall']) self.scoreTest(r's1s1s1s1 s2s2s2 wewe S3S3S3 s4s4s4 Msw LS3S3S3S3', Score(46, 3), rules=['Last Tile Taken from Dead Wall']) self.scoreTest(r'b3B3B3b3 DbDbDb DrDrDr wewewewe s2s2 Mee Ls2s2s2', Score(74, 6)) self.scoreTest(r's1s2s3 s1s2s3 b3b3b3 b4b4b4 B5 fn yn mne', Score(12, 1)) self.scoreTest(r'b3b3b3b3 DbDbDb drdrdr weWeWewe s2s2 Mee Ls2s2s2', Score(78, 5)) self.scoreTest(r's2s2s2 s2s3s4 B1B1B1B1 c9C9C9c9 mes', Score(42)) self.scoreTest(r's2s2s2 DgDg DbDbDb b2b2b2b2 DrDrDr Mee Ls2s2s2s2', Score(48, 4)) self.scoreTest(r's2s2 DgDgDg DbDbDb b2b2b2b2 DrDrDr Mee Ls2s2s2', Score(limits=1)) self.scoreTest(r's2 DgDgDg DbDbDb b2b2b2b2 DrDrDr mee', Score(32, 6)) self.scoreTest(r's1s1s1s1 s2s2s2 s3s3s3 s4s4s4 s5s5 Msww Ls3s3s3s3', Score(42, 4)) self.scoreTest(r'B2C1B2C1B2C1WeWeS4WeS4WeS6 mee', Score(20, 3)) self.scoreTest(r'b6b6b6 B1B1B2B2B3B3B7S7C7B8 mnn', Score(2)) self.scoreTest(r'B1B1B1B1B2B3B4B5B6B7B8B9DrDr fe fs fn fw Mwe LDrDrDr', Score(56, 3)) self.scoreTest(r'B1B1B1B1B2B3B4B5B6B7B8B9DrDr fe fs fn fw Mwee LDrDrDr', Score(56, 4), rules=['Last Tile Taken from Dead Wall']) self.scoreTest(r'B1B1B1B1B2B3B4B5B6B7B8B9DrDr fe fs fn fw Mwez LDrDrDr', Score(56, 4), rules=['Last Tile is Last Tile of Wall']) self.scoreTest(r'B1B1B1B1B2B3B4B5B6B7B8B9DrDr fe fs fn fw MweZ LDrDrDr', Score(56, 3), rules=['Last Tile is Last Tile of Wall Discarded']) self.scoreTest(r'B1B1B1B1B2B3B4B5B6B7B8B9drdr fe fs fn fw MweZ Ldrdrdr', Score(52, 3), rules=['Last Tile is Last Tile of Wall Discarded']) self.scoreTest(r'B1B1B1B1B2B3B4B5B6B7B8B8B2B2 fe fs fn fw mwe', Score()) self.scoreTest(r'B1B1B1B1B2B3B4B5B6B8B8B2B2 fe fs fn fw mwe', Score(28, 1)) self.scoreTest(r'wewe wswsws WnWnWn wwwwwwww b1b1b1 Mnez Lb1b1b1b1', Score(54, 5), rules=['Last Tile is Last Tile of Wall']) self.scoreTest(r'wewe wswsws WnWnWn wwwwwwww b1b1b1 Mnez LB1B1B1B1', Score(56, 6), rules=['Last Tile is Last Tile of Wall']) | 3009d818a612dda60908f48a40fea00a8bfd1c7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1679/3009d818a612dda60908f48a40fea00a8bfd1c7d/scoringtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
5188,
12,
2890,
4672,
365,
18,
6355,
4709,
12,
86,
1807,
21,
87,
21,
87,
21,
87,
21,
272,
22,
87,
22,
87,
22,
341,
359,
73,
348,
23,
55,
23,
55,
23,
272,
24,
87,
24,
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,
1842,
5188,
12,
2890,
4672,
365,
18,
6355,
4709,
12,
86,
1807,
21,
87,
21,
87,
21,
87,
21,
272,
22,
87,
22,
87,
22,
341,
359,
73,
348,
23,
55,
23,
55,
23,
272,
24,
87,
24,
87,
... |
gclient_scm.CreateSCM(self.url, self.root_dir, None).AndReturn(scm_wrapper_src2) | gclient.gclient_scm.CreateSCM(self.url, self.root_dir, None).AndReturn(scm_wrapper_src2) | def OptIsRev333(options): return OptIsRev(options, 333) | 90ba161b70b445eba62b2a376e4fa2f508854e13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/90ba161b70b445eba62b2a376e4fa2f508854e13/gclient_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12056,
2520,
10070,
3707,
23,
12,
2116,
4672,
327,
12056,
2520,
10070,
12,
2116,
16,
890,
3707,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12056,
2520,
10070,
3707,
23,
12,
2116,
4672,
327,
12056,
2520,
10070,
12,
2116,
16,
890,
3707,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
rml2 = rml_parser._parse(rml_dom, objs, data, header=self.header) | rml2 = rml_parser._parse(rml_dom, objs, data, header=want_header) | def create(self, cr, uid, ids, data, context=None): logo = None if not context: context={} context = context.copy() | f16cf978ff88ce3b744db58016d29e38fb92872c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/f16cf978ff88ce3b744db58016d29e38fb92872c/report_sxw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
501,
16,
819,
33,
7036,
4672,
19128,
273,
599,
309,
486,
819,
30,
819,
12938,
819,
273,
819,
18,
3530,
1435,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
501,
16,
819,
33,
7036,
4672,
19128,
273,
599,
309,
486,
819,
30,
819,
12938,
819,
273,
819,
18,
3530,
1435,
2,
-100,
-100,
-100,
-10... |
self._nfacets = len(self._facet_normals) | self._nfacets = self._facet_normals.nrows() | def nfacets(self): r""" Return the number of facets of this polytope. | fbe2415b913b08394923968cdb437aa31fd062bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/fbe2415b913b08394923968cdb437aa31fd062bc/lattice_polytope.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
11639,
2413,
12,
2890,
4672,
436,
8395,
2000,
326,
1300,
434,
21681,
434,
333,
7573,
869,
347,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
11639,
2413,
12,
2890,
4672,
436,
8395,
2000,
326,
1300,
434,
21681,
434,
333,
7573,
869,
347,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
else: return length / 1000.0 | self._duration = length / 1000.0 return self._duration | def get_duration(self): length = libvlc.libvlc_media_player_get_length(self.media_player, self.exc.ref()) try: self.exc.check() except VLCError, e: logging.warn("exception getting time: %s" % e) return None else: return length / 1000.0 | 2934e8b32a8c6a4773091ef2abaa54b3e4f5615d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/2934e8b32a8c6a4773091ef2abaa54b3e4f5615d/vlc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8760,
12,
2890,
4672,
769,
273,
2561,
27362,
18,
2941,
27362,
67,
5829,
67,
14872,
67,
588,
67,
2469,
12,
2890,
18,
5829,
67,
14872,
16,
365,
18,
10075,
18,
1734,
10756,
775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8760,
12,
2890,
4672,
769,
273,
2561,
27362,
18,
2941,
27362,
67,
5829,
67,
14872,
67,
588,
67,
2469,
12,
2890,
18,
5829,
67,
14872,
16,
365,
18,
10075,
18,
1734,
10756,
775,
... |
print "new network magnitude: %.2f (Variance: %.2f)" % (self.dictMagnitude['Magnitude'], self.dictMagnitude['Uncertainty']) | msg = "new network magnitude: %.2f (Variance: %.2f)" % \ (self.dictMagnitude['Magnitude'], self.dictMagnitude['Uncertainty']) appendTextview(self.textviewStdOut, msg) | def updateNetworkMag(self): print "updating network magnitude..." self.dictMagnitude['Station Count'] = 0 self.dictMagnitude['Magnitude'] = 0 staMags = [] for i in range(len(self.streams)): if self.dicts[i]['MagUse'] and self.dicts[i].has_key('Mag'): print self.dicts[i]['Station'] self.dictMagnitude['Station Count'] += 1 self.dictMagnitude['Magnitude'] += self.dicts[i]['Mag'] staMags.append(self.dicts[i]['Mag']) if self.dictMagnitude['Station Count'] == 0: self.dictMagnitude['Magnitude'] = np.nan self.dictMagnitude['Uncertainty'] = np.nan else: self.dictMagnitude['Magnitude'] /= self.dictMagnitude['Station Count'] self.dictMagnitude['Uncertainty'] = np.var(staMags) print "new network magnitude: %.2f (Variance: %.2f)" % (self.dictMagnitude['Magnitude'], self.dictMagnitude['Uncertainty']) self.netMagLabel = '\n\n\n\n %.2f (Var: %.2f)' % (self.dictMagnitude['Magnitude'], self.dictMagnitude['Uncertainty']) try: self.netMagText.set_text(self.netMagLabel) except: pass | b822b77814749ba0fa0b0a638d2c2e8ccf514f6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/b822b77814749ba0fa0b0a638d2c2e8ccf514f6c/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
3906,
11372,
12,
2890,
4672,
1172,
315,
5533,
1776,
2483,
13463,
7070,
365,
18,
1576,
11372,
10754,
3292,
16672,
6974,
3546,
273,
374,
365,
18,
1576,
11372,
10754,
3292,
11372,
10754,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
3906,
11372,
12,
2890,
4672,
1172,
315,
5533,
1776,
2483,
13463,
7070,
365,
18,
1576,
11372,
10754,
3292,
16672,
6974,
3546,
273,
374,
365,
18,
1576,
11372,
10754,
3292,
11372,
10754,
... |
print>>sys.__stderr__, "Idle accepted connection from ", address | def accept(self): working_sock, address = self.listening_sock.accept() if address[0] == '127.0.0.1': print>>sys.__stderr__, "Idle accepted connection from ", address SocketIO.__init__(self, working_sock) else: print>>sys.__stderr__, "Invalid host: ", address raise socket.error | dc571f8715384503214eb63b6ba9ad5129603e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/dc571f8715384503214eb63b6ba9ad5129603e6f/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
12,
2890,
4672,
5960,
67,
15031,
16,
1758,
273,
365,
18,
18085,
310,
67,
15031,
18,
9436,
1435,
309,
1758,
63,
20,
65,
422,
296,
14260,
18,
20,
18,
20,
18,
21,
4278,
8758,
4294... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
12,
2890,
4672,
5960,
67,
15031,
16,
1758,
273,
365,
18,
18085,
310,
67,
15031,
18,
9436,
1435,
309,
1758,
63,
20,
65,
422,
296,
14260,
18,
20,
18,
20,
18,
21,
4278,
8758,
4294... | |
if (type(callable) is not ClassType): if (not safe_constructors.has_key(callable)): | if type(callable) is not ClassType: if not safe_constructors.has_key(callable): | def load_reduce(self): stack = self.stack | 8b78a6a3e44c8494becafd3c7466dbc3de8e04df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8b78a6a3e44c8494becafd3c7466dbc3de8e04df/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
12498,
12,
2890,
4672,
2110,
273,
365,
18,
3772,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
12498,
12,
2890,
4672,
2110,
273,
365,
18,
3772,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if query_results: | if query_results and query_results[0][0]: | def _render_photo(self, query_results, context, result): if query_results: result.callback(tag('image')[ tag('url')[ '/images/db/' + query_results[0][0] ], tag('title')[ place('title') ], tag('link')[ place('link') ], ]) else: result.callback([]) | c06993db81dabf761c359b8cc30f38eb6c09914d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9478/c06993db81dabf761c359b8cc30f38eb6c09914d/Feed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
17232,
12,
2890,
16,
843,
67,
4717,
16,
819,
16,
563,
4672,
309,
843,
67,
4717,
471,
843,
67,
4717,
63,
20,
6362,
20,
14542,
563,
18,
3394,
12,
2692,
2668,
2730,
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,
389,
5902,
67,
17232,
12,
2890,
16,
843,
67,
4717,
16,
819,
16,
563,
4672,
309,
843,
67,
4717,
471,
843,
67,
4717,
63,
20,
6362,
20,
14542,
563,
18,
3394,
12,
2692,
2668,
2730,
6134,... |
BUILD_BASE=os.path.join(os.getcwd(), 'build-base') | BUILD_BASE=os.path.join(os.getcwd(), 'build-base', 'python-%s.%s' % sys.version_info[:2]) | def main(): # below assumes this script is in the BASE_DIR/inst directory global PREFIX BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0]))) BUILD_BASE=os.path.join(os.getcwd(), 'build-base') PYTHON=sys.executable MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read() REQUIRE_LF_ENABLED = 1 REQUIRE_ZLIB = 1 REQUIRE_EXPAT = 1 INSTALL_FLAGS = '' DISTUTILS_OPTS = '' try: longopts = ['help', 'ignore-largefile', 'ignore-zlib', 'ignore-expat', 'prefix=', 'build-base=', 'optimize', 'no-compile', 'quiet'] opts, args = getopt.getopt(sys.argv[1:], 'h', longopts) except getopt.GetoptError, v: print v usage() sys.exit(1) for o, a in opts: if o in ('-h', '--help'): usage() sys.exit() if o == '--prefix': PREFIX=os.path.abspath(os.path.expanduser(a)) if o == '--ignore-largefile': REQUIRE_LF_ENABLED=0 if o == '--ignore-zlib': REQUIRE_ZLIB=0 if o == '--ignore-expat': REQUIRE_EXPAT=0 if o == '--optimize': INSTALL_FLAGS = '--optimize=1 --no-compile' if o == '--no-compile': INSTALL_FLAGS = '--no-compile' if o == '--build-base': BUILD_BASE = a if o == '--quiet': DISTUTILS_OPTS = '-q' global QUIET QUIET = 1 if REQUIRE_LF_ENABLED: test_largefile() if REQUIRE_ZLIB: test_zlib() if REQUIRE_EXPAT: test_expat() out(' - Zope top-level binary directory will be %s.' % PREFIX) if INSTALL_FLAGS: out(' - Distutils install flags will be "%s"' % INSTALL_FLAGS) idata = { '<<PYTHON>>':PYTHON, '<<PREFIX>>':PREFIX, '<<BASE_DIR>>':BASE_DIR, '<<BUILD_BASE>>':BUILD_BASE, '<<INSTALL_FLAGS>>':INSTALL_FLAGS, '<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION, '<<ZOPE_MINOR_VERSION>>':versions.ZOPE_MINOR_VERSION, '<<VERSION_RELEASE_TAG>>':versions.VERSION_RELEASE_TAG, '<<DISTUTILS_OPTS>>':DISTUTILS_OPTS, } for k,v in idata.items(): MAKEFILE = MAKEFILE.replace(k, v) f = open(os.path.join(os.getcwd(), 'makefile'), 'w') f.write(MAKEFILE) out(' - Makefile written.') out('') out(' Next, run %s.' % MAKE_COMMAND) out('') | 4c4e9ebfb122024d2ba9a6fcdfb6d8dbbe22e2b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4c4e9ebfb122024d2ba9a6fcdfb6d8dbbe22e2b5/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
5712,
13041,
333,
2728,
353,
316,
326,
10250,
67,
4537,
19,
8591,
1867,
2552,
17154,
10250,
67,
4537,
33,
538,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
12287,
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,
2774,
13332,
468,
5712,
13041,
333,
2728,
353,
316,
326,
10250,
67,
4537,
19,
8591,
1867,
2552,
17154,
10250,
67,
4537,
33,
538,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
12287,
12... |
ui.write(_('\nWrite the introductory message for the patch series.\n\n')) | def getaddrs(opt, prpt, default = None): addrs = opts[opt] or (ui.config('email', opt) or ui.config('patchbomb', opt) or prompt(prpt, default = default)).split(',') return [a.strip() for a in addrs if a.strip()] | 4e22cb90d3c7236f9f382aaff4f194e4038d8edf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/4e22cb90d3c7236f9f382aaff4f194e4038d8edf/patchbomb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
23305,
12,
3838,
16,
846,
337,
16,
805,
273,
599,
4672,
11755,
273,
1500,
63,
3838,
65,
578,
261,
4881,
18,
1425,
2668,
3652,
2187,
2153,
13,
578,
5915,
18,
1425,
2668,
2272,
70,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23305,
12,
3838,
16,
846,
337,
16,
805,
273,
599,
4672,
11755,
273,
1500,
63,
3838,
65,
578,
261,
4881,
18,
1425,
2668,
3652,
2187,
2153,
13,
578,
5915,
18,
1425,
2668,
2272,
70,
... | |
info['modified_time'] = datetime.datetime.fromtimestamp(at) | info['modified_time'] = datetime.datetime.fromtimestamp(mt) | def getinfo(self, path): npath = self._normpath(path) stats = self.client.stat(npath) info = dict((k, getattr(stats, k)) for k in dir(stats) if not k.startswith('__') ) info['size'] = info['st_size'] ct = info.get('st_ctime', None) if ct is not None: info['created_time'] = datetime.datetime.fromtimestamp(ct) at = info.get('st_atime', None) if at is not None: info['accessed_time'] = datetime.datetime.fromtimestamp(at) mt = info.get('st_mtime', None) if mt is not None: info['modified_time'] = datetime.datetime.fromtimestamp(at) return info | 2a3e147ed90c09b3ba4d348001ae698eaa2f4cbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/2a3e147ed90c09b3ba4d348001ae698eaa2f4cbe/sftpfs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1376,
12,
2890,
16,
589,
4672,
290,
803,
273,
365,
6315,
7959,
803,
12,
803,
13,
3177,
273,
365,
18,
2625,
18,
5642,
12,
82,
803,
13,
1123,
273,
2065,
12443,
79,
16,
3869,
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,
336,
1376,
12,
2890,
16,
589,
4672,
290,
803,
273,
365,
6315,
7959,
803,
12,
803,
13,
3177,
273,
365,
18,
2625,
18,
5642,
12,
82,
803,
13,
1123,
273,
2065,
12443,
79,
16,
3869,
12,
... |
outer_hbox.pack_space(12) | def pack_all(self, layout): outer_vbox = cellpack.VBox() | 617cdf7b89cead6695f9e985859657c3b314a92a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/617cdf7b89cead6695f9e985859657c3b314a92a/style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
67,
454,
12,
2890,
16,
3511,
4672,
6390,
67,
90,
2147,
273,
2484,
2920,
18,
58,
3514,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
67,
454,
12,
2890,
16,
3511,
4672,
6390,
67,
90,
2147,
273,
2484,
2920,
18,
58,
3514,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if options.verbose: print "checking system:", system['name'] | if options.debug: print timestamp(), "DEBUG: Checking system:", system['name'] | def get_action_results(key, systems): '''Gets action results that have been scheduled''' if options.debug: wait = 5 elif options.verbose: wait = 15 else: wait = 30 complete = False while not complete: for system in systems: if system['skip']: continue if not system['complete']: if options.verbose: print "checking system:", system['name'] script_result = client.system.get_script_results(key, system['action_id']) if (options.verbose) and (not script_result == []): print "Script result for %s: %s:" % (system['name'], script_result) if not script_result == []: if options.verbose: print "%s script result:" % (system['name']) if options.debug: print script_result system['output'] = script_result[0]['output'] system['return_code'] = script_result[0]['returnCode'] system['complete'] = True else: system['complete'] = False if options.verbose: print "%s not completed yet." % (system['name']) complete = True for system in systems: if system['skip']: continue if not system['complete']: complete = False if not complete: print "waiting %i seconds for results ..." % (wait) time.sleep(wait) for system in systems: if system['skip']: continue data = system['output'].split('\n') if options.debug: print "DEBUG: Raw output from %s script: %s" %(system['name'], data) for line in data: if options.debug: print "DEBUG: %s checking '%s'" % (system['name'], line) if 'System ID:' in line: if options.verbose: print "Found system_id of:", line.split()[-1] system['system_id'] = line.split()[-1].lower() break else: system['system_id'] = False for system in systems: if system['skip']: continue if options.verbose: print "System ID for %s is: %s" % (system['name'], system['system_id']) new_channel = DELL_INFO['label'] + '-' + SYSTEM_VENDOR_ID + '.dev_' + system['system_id'] + '-' + system['base_channel'] system['system_channel'] = new_channel if options.verbose: print "Subscribing %s to channel %s" % (system['name'], system['system_channel']) if not subscribe(key, system['base_channel'], system['system_channel'], system['id'], system['name']): system['no_child'] = True else: system['no_child'] = False return systems | 07e2421549e748ccb09a392c60834eaea3e54917 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3457/07e2421549e748ccb09a392c60834eaea3e54917/dell-satellite-sync.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1128,
67,
4717,
12,
856,
16,
14908,
4672,
9163,
3002,
1301,
1686,
716,
1240,
2118,
9755,
26418,
309,
702,
18,
4148,
30,
2529,
273,
1381,
1327,
702,
18,
11369,
30,
2529,
273,
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,
336,
67,
1128,
67,
4717,
12,
856,
16,
14908,
4672,
9163,
3002,
1301,
1686,
716,
1240,
2118,
9755,
26418,
309,
702,
18,
4148,
30,
2529,
273,
1381,
1327,
702,
18,
11369,
30,
2529,
273,
4... |
self.object_ids = [person['person']] | self.object_ids = [person['person_id']] | def call(self, auth, first_name, last_name, person_fields = {}): person_fields = dict(filter(can_update, person_fields.items())) person = Person(self.api, person_fields) person['first_name'] = first_name person['last_name'] = last_name person['enabled'] = False person.sync() | ae783f76505e202ac26195d8c234a46a535852dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/ae783f76505e202ac26195d8c234a46a535852dd/AddPerson.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
12,
2890,
16,
1357,
16,
1122,
67,
529,
16,
1142,
67,
529,
16,
6175,
67,
2821,
273,
2618,
4672,
6175,
67,
2821,
273,
2065,
12,
2188,
12,
4169,
67,
2725,
16,
6175,
67,
2821,
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,
745,
12,
2890,
16,
1357,
16,
1122,
67,
529,
16,
1142,
67,
529,
16,
6175,
67,
2821,
273,
2618,
4672,
6175,
67,
2821,
273,
2065,
12,
2188,
12,
4169,
67,
2725,
16,
6175,
67,
2821,
18,
... |
try: frame = id3["TCON"] | try: frame = id3["TCON"] | def genre_set(id3, key, value): try: frame = id3["TCON"] except KeyError: id3.add(mutagen.id3.TCON(encoding=3, text=value)) else: frame.genres = value | db61096ac432693384a902b19de1955cc9871d81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1845/db61096ac432693384a902b19de1955cc9871d81/easyid3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
266,
67,
542,
12,
350,
23,
16,
498,
16,
460,
4672,
775,
30,
2623,
273,
612,
23,
9614,
56,
2248,
11929,
1335,
4999,
30,
612,
23,
18,
1289,
12,
10735,
346,
275,
18,
350,
23,
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,
3157,
266,
67,
542,
12,
350,
23,
16,
498,
16,
460,
4672,
775,
30,
2623,
273,
612,
23,
9614,
56,
2248,
11929,
1335,
4999,
30,
612,
23,
18,
1289,
12,
10735,
346,
275,
18,
350,
23,
18... |
warnings.warn("The default axis of min will change! Now we return the min over the last dimensions. It will change to be the same as numpy: the min over all dimensions. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the futur behavior set axis to range(nb dim), but this don't support the grad. To have the grad, you must flatten the tensor before calling min().") | warnings.warn("The default axis of min will change! Now we return the min over the last dimensions. It will change to be the same as numpy: the min over all dimensions. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the future behavior, set axis to range(x.ndim), but this does not support the grad. To be able to get the grad, you must flatten the tensor before calling min().") | def min(x, axis='DEFAULT'): if x.type.ndim == 1 and axis in ('DEFAULT', None): # The old and new behavior are not different. axis = 0 elif axis=='DEFAULT': axis = x.type.ndim - 1 warnings.warn("The default axis of min will change! Now we return the min over the last dimensions. It will change to be the same as numpy: the min over all dimensions. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the futur behavior set axis to range(nb dim), but this don't support the grad. To have the grad, you must flatten the tensor before calling min().") elif axis is None: axis = x.type.ndim - 1 warnings.warn("The behavior of min when axis==None will change! Now we return the min over the last dimensions. It will change to the min over all dimensions as numpy. To hide this warning and be compatible with the future behavior, set axis to -1 to have the current behavior. To have the futur behavior set axis to range(nb dim), but this don't support the grad. To have the grad, you must flatten the tensor before calling min().") str_x_type = str(x.dtype) if str_x_type.startswith('float') or str_x_type.startswith('int'): return -max(-x, axis=axis) else: #Be careful about unsigned integers, complex raise NotImplementedError() | fe22e38c8a2e5489ad97ff7bb3b53aebeb78dfb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/fe22e38c8a2e5489ad97ff7bb3b53aebeb78dfb3/basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
92,
16,
2654,
2218,
5280,
11,
4672,
309,
619,
18,
723,
18,
82,
3509,
422,
404,
471,
2654,
316,
7707,
5280,
2187,
599,
4672,
468,
1021,
1592,
471,
394,
6885,
854,
486,
3775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
12,
92,
16,
2654,
2218,
5280,
11,
4672,
309,
619,
18,
723,
18,
82,
3509,
422,
404,
471,
2654,
316,
7707,
5280,
2187,
599,
4672,
468,
1021,
1592,
471,
394,
6885,
854,
486,
3775,
... |
Return list of conjugacy polynomials for a given round and name. INPUT: | Return list of conjugacy polynomials for a given round ``i`` and name ``name``. INPUT: | def field_polynomials(self, name, i, l=None): """ Return list of conjugacy polynomials for a given round and name. INPUT: - ``name`` - variable name - ``i`` - round number - ``l`` - r\*c (default:None) EXAMPLE:: sage: sr = mq.SR(3, 1, 1, 8) sage: sr.field_polynomials('x', 2) [x200^2 + x201, x201^2 + x202, x202^2 + x203, x203^2 + x204, x204^2 + x205, x205^2 + x206, x206^2 + x207, x207^2 + x200] """ r = self._r c = self._c e = self._e n = self._n | 64b5e0e9186de5235119791631990329cc9aecfa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/64b5e0e9186de5235119791631990329cc9aecfa/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
67,
3915,
13602,
87,
12,
2890,
16,
508,
16,
277,
16,
328,
33,
7036,
4672,
3536,
2000,
666,
434,
10550,
637,
3505,
16991,
87,
364,
279,
864,
3643,
12176,
77,
10335,
471,
508,
12176... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
67,
3915,
13602,
87,
12,
2890,
16,
508,
16,
277,
16,
328,
33,
7036,
4672,
3536,
2000,
666,
434,
10550,
637,
3505,
16991,
87,
364,
279,
864,
3643,
12176,
77,
10335,
471,
508,
12176... |
"REMOVE_INSTANCE": int(self.remove_instance), | "REMOVE_INSTANCE": str(bool(self.remove_instance)), | def BuildHooksEnv(self): """Build hooks env. | 371f046c3db6e9ba4e1b24301643c3bd7bb18189 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/371f046c3db6e9ba4e1b24301643c3bd7bb18189/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
13620,
3491,
12,
2890,
4672,
3536,
3116,
9153,
1550,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
13620,
3491,
12,
2890,
4672,
3536,
3116,
9153,
1550,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
json = fp.read() | def struct2attrdict(st): """ copy a json structure, turning all dicts into attrdicts. copying descends instances of dict and list, including subclasses. """ if isinstance(st, dict): return attrdict([(k,struct2attrdict(v)) for k,v in st.items()]) if isinstance(st, list): return [struct2attrdict(li) for li in st] return st | 47e6fe17862a5f974e46929577872fc98af8f950 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11603/47e6fe17862a5f974e46929577872fc98af8f950/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1958,
22,
1747,
1576,
12,
334,
4672,
3536,
1610,
279,
1163,
3695,
16,
7005,
310,
777,
15838,
1368,
1604,
16287,
18,
225,
8933,
3044,
5839,
3884,
434,
2065,
471,
666,
16,
6508,
15320,
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,
1958,
22,
1747,
1576,
12,
334,
4672,
3536,
1610,
279,
1163,
3695,
16,
7005,
310,
777,
15838,
1368,
1604,
16287,
18,
225,
8933,
3044,
5839,
3884,
434,
2065,
471,
666,
16,
6508,
15320,
18,... | |
def listFolderContents( self, spec=None, contentFilter=None ): | def listFolderContents( self, spec=None, contentFilter=None ): | def listFolderContents( self, spec=None, contentFilter=None ): # XXX """ Hook around 'contentValues' to let 'folder_contents' be protected. Duplicating skip_unauthorized behavior of dtml-in. """ items = self.contentValues(filter=contentFilter) l = [] for obj in items: id = obj.getId() v = obj # validate() can either raise Unauthorized or return 0 to # mean unauthorized. try: if getSecurityManager().validate(self, self, id, v): l.append(obj) except Unauthorized: pass return l | dbf6df938900261bab88fecb1a4f305c3bd1ccb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/dbf6df938900261bab88fecb1a4f305c3bd1ccb7/PortalFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
3899,
6323,
12,
365,
16,
857,
33,
7036,
16,
913,
1586,
33,
7036,
262,
30,
468,
11329,
3536,
13725,
6740,
296,
1745,
1972,
11,
358,
2231,
296,
5609,
67,
3980,
11,
506,
4750,
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,
666,
3899,
6323,
12,
365,
16,
857,
33,
7036,
16,
913,
1586,
33,
7036,
262,
30,
468,
11329,
3536,
13725,
6740,
296,
1745,
1972,
11,
358,
2231,
296,
5609,
67,
3980,
11,
506,
4750,
18,
... |
''' | """ | def gl_update_duration(self, new_part=False): '''Redraw GLPane and update the repaint duration variable <self._repaint_duration> used by animateToView() to compute the proper number of animation frames. Redraws the GLPane twice if <new_part> is True and only saves the repaint duration of the second redraw. This is needed in the case of drawing a newly opened part, which takes much longer to draw the first time than the second (or thereafter). ''' # The first redraw of a new part takes much longer than the second redraw. if new_part: self.gl_update() env.call_qApp_processEvents() # Required! self._repaint_start_time = time.time() self.gl_update() env.call_qApp_processEvents() # This forces the GLPane to update before executing the next gl_update(). self._repaint_end_time = time.time() self._repaint_duration = max(MIN_REPAINT_TIME, self._repaint_end_time - self._repaint_start_time) # _last_few_repaint_times is currently unused. May need it later. Mark 060116. self._last_few_repaint_times.append( self._repaint_duration) self._last_few_repaint_times = self._last_few_repaint_times[-5:] # keep at most the last five times #if new_part: # print "repaint duration = ", self._repaint_duration #print "repaint duration = ", self._repaint_duration return | 9dc95351096c9deab5f64e3e704bde7a93f95b49 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/9dc95351096c9deab5f64e3e704bde7a93f95b49/GLPane.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5118,
67,
2725,
67,
8760,
12,
2890,
16,
394,
67,
2680,
33,
8381,
4672,
9163,
3715,
1899,
10252,
8485,
471,
1089,
326,
24962,
3734,
2190,
411,
2890,
6315,
14462,
1598,
67,
8760,
34,
1399,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5118,
67,
2725,
67,
8760,
12,
2890,
16,
394,
67,
2680,
33,
8381,
4672,
9163,
3715,
1899,
10252,
8485,
471,
1089,
326,
24962,
3734,
2190,
411,
2890,
6315,
14462,
1598,
67,
8760,
34,
1399,... |
elif event.keyval == gtk.keysyms.ISO_Left_Tab: | elif event.keyval == gtk.keysyms.ISO_Left_Tab \ or (event.keyval == gtk.keysyms.Left and leaving): | def on_keypressed(self, entry, event): path, column = self.get_cursor() store = self.get_model() model = store.get_value(store.get_iter(path), 0) | a5d381587e6c38ffb27f603a5f7d93a471e6d903 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9151/a5d381587e6c38ffb27f603a5f7d93a471e6d903/editabletree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
856,
10906,
12,
2890,
16,
1241,
16,
871,
4672,
589,
16,
1057,
273,
365,
18,
588,
67,
9216,
1435,
1707,
273,
365,
18,
588,
67,
2284,
1435,
938,
273,
1707,
18,
588,
67,
1132,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
603,
67,
856,
10906,
12,
2890,
16,
1241,
16,
871,
4672,
589,
16,
1057,
273,
365,
18,
588,
67,
9216,
1435,
1707,
273,
365,
18,
588,
67,
2284,
1435,
938,
273,
1707,
18,
588,
67,
1132,
... |
errstring = 'Transaction Check Error: ' | errstring = 'Transaction Check Error:\n' | def doTransaction(self): """takes care of package downloading, checking, user confirmation and actually RUNNING the transaction""" | 5c232b380a7e0be8ca6fd764c5d557ad14ed547c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5445/5c232b380a7e0be8ca6fd764c5d557ad14ed547c/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
3342,
12,
2890,
4672,
3536,
88,
3223,
7671,
434,
2181,
23742,
16,
6728,
16,
729,
14296,
471,
6013,
23574,
326,
2492,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
3342,
12,
2890,
4672,
3536,
88,
3223,
7671,
434,
2181,
23742,
16,
6728,
16,
729,
14296,
471,
6013,
23574,
326,
2492,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
input data. For example, for HTTP forms, the widget name is | input data. For example, for HTTP forms, the widget name is | def setPrefix(prefix): """Set the name prefix used for the widget | 7299700a35794e2ed71032b52910b62f8f8c16cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9530/7299700a35794e2ed71032b52910b62f8f8c16cc/interfaces.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2244,
12,
3239,
4672,
3536,
694,
326,
508,
1633,
1399,
364,
326,
3604,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2244,
12,
3239,
4672,
3536,
694,
326,
508,
1633,
1399,
364,
326,
3604,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.name!=None: result.name = '%s[\'%s\']' % (self.name,name) | if self.name!=None: name = '%s[\'%s\']' % (self.name,name) result.name = name | def __getitem__(self,name): result = self.store.getVariable(name) if result==None: result = self.store.children.get(name,None) if result==None: raise KeyError(name) if isinstance(result,common.VariableStore): result = LazyStore(result,name) if self.name!=None: result.name = '%s[\'%s\']' % (self.name,name) else: result = LazyVariable(result) if self.name!=None: result.name = '%s[\'%s\']' % (self.name,name) return result | 9ea383d3931ae4a9f60ca83c4897ac51e8e54f2f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/381/9ea383d3931ae4a9f60ca83c4897ac51e8e54f2f/expressions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
529,
4672,
563,
273,
365,
18,
2233,
18,
588,
3092,
12,
529,
13,
309,
563,
631,
7036,
30,
563,
273,
365,
18,
2233,
18,
5906,
18,
588,
12,
529,
16,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31571,
972,
12,
2890,
16,
529,
4672,
563,
273,
365,
18,
2233,
18,
588,
3092,
12,
529,
13,
309,
563,
631,
7036,
30,
563,
273,
365,
18,
2233,
18,
5906,
18,
588,
12,
529,
16,
70... |
model = action_rule.name.model | model = action_rule.model_id.model | def _register_hook(self, cr, uid, ids, context=None): if not context: context = {} for action_rule in self.browse(cr, uid, ids, context=context): model = action_rule.name.model obj_pool = self.pool.get(model) obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context)) return True | 1d07f4092b58310420993921b0ddeb3ac65bb096 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d07f4092b58310420993921b0ddeb3ac65bb096/base_action_rule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4861,
67,
4476,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
364,
1301,
67,
5345,
316,
365,
18,
25731,
12,
3353,
16,
4555,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4861,
67,
4476,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
364,
1301,
67,
5345,
316,
365,
18,
25731,
12,
3353,
16,
4555,... |
None, [FL_COLOR, FL_COLOR], | None, [FL_COLOR, FL_COLOR], | def fl_setpup_default_cursor(cursor): """ fl_setpup_default_cursor(cursor) -> cursor """ retval = _fl_setpup_default_cursor(cursor) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
84,
416,
67,
1886,
67,
9216,
12,
9216,
4672,
3536,
1183,
67,
542,
84,
416,
67,
1886,
67,
9216,
12,
9216,
13,
317,
3347,
3536,
225,
5221,
273,
389,
2242,
67,
542,
84,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
67,
542,
84,
416,
67,
1886,
67,
9216,
12,
9216,
4672,
3536,
1183,
67,
542,
84,
416,
67,
1886,
67,
9216,
12,
9216,
13,
317,
3347,
3536,
225,
5221,
273,
389,
2242,
67,
542,
84,
... |
return http.Response(stream=s) | return HTMLResponse(stream=s) | def render(self, ctx=None): # Create a live Sage worksheet out of self.path and render it. doc_page_html = open(self.docpath).read() from docHTMLProcessor import SphinxHTMLProcessor doc_page = SphinxHTMLProcessor().process_doc_html(doc_page_html) | 86a4ed9cb0aba48a11523b820246bf1c9d9e7be2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/86a4ed9cb0aba48a11523b820246bf1c9d9e7be2/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
33,
7036,
4672,
468,
1788,
279,
8429,
348,
410,
13622,
596,
434,
365,
18,
803,
471,
1743,
518,
18,
997,
67,
2433,
67,
2620,
273,
1696,
12,
2890,
18,
2434,
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,
1743,
12,
2890,
16,
1103,
33,
7036,
4672,
468,
1788,
279,
8429,
348,
410,
13622,
596,
434,
365,
18,
803,
471,
1743,
518,
18,
997,
67,
2433,
67,
2620,
273,
1696,
12,
2890,
18,
2434,
8... |
length=79 | length=63 | def main(): import sys, getopt, time, string, socket try: opts, args = getopt.getopt(sys.argv[1:], "d:i:h:l:u:r:Rt:DL:", ["date", "indent", "hostname", "length", "user", "rlog_options", #### not yet supported "Recursive", #### not yet supported "tabwidth", "Diffs", #### not yet supported "Logfile"]) except getopt.error, msg: sys.stdout = sys.stderr print msg print "Usage: Options:" print "[-h hostname] [-i indent] [-l length] [-R]" print "[-r rlog_option] [-d rcs date]\n[-t tabwidth] [-u 'login<TAB>fullname<TAB>mailaddr']..." sys.exit(2) # Set up defaults for all of the command line options. cvsrepository=GetCVSRepository() if not cvsrepository: print "cvs2log.py must be executed in a working CVS directory" sys.exit(2) indent=8 hostname=socket.gethostbyaddr(socket.gethostname())[1][0] length=79 user=0 recursive=0 tabwidth=8 rlog_options=0 diffs=1 logfile=None date_option = "" # override defaults if specified on the command line for o, a in opts: if o == '-h' : hostname = a elif o == '-i' : indent = a elif o == '-l' : length = a elif o == '-t' : tabwidth = a elif o == '-u' : user = a elif o == '-r' : rlog_options = a elif o == '-R' : recursive = 1 elif o == '-d' : date_option = "-d " + "'" + a + "'" elif o == '-D' : diffs = 0 elif o == '-L' : logfile = a else: print "getopt should have failed already" # set up the cvs log command arguments. If a logfile is specified # we get all dates later than the logfile. if logfile: date_option = "'" + "-d>" + time.asctime(LastLogDate2CtimeTuple(logfile)) + "'" log_date_command= 'cvs -d ' + GetCVSRepository() + ' -Q log -N ' + date_option # build the logs. log = BuildLog(log_date_command) # chronologically reversed. We reverse everything in the list as # well. log.sort() log.reverse() # Pass through the logs creating new entries based on changing # authors, dates and descriptions. last_date = None last_author = None entry_dict = {} for date, author, description, rcs_file, revision in log: if author != last_author or date != last_date: # clear out any old revisions, descriptions, and filenames # that belong with the last log. if entry_dict: print ChangeLogFileRevDesc(entry_dict, indent, length) # clear the entry log for the next group of changes # if we have a new author or date we print a date, time, # author, and email address. entry_dict = {} print ChangeLogDateNameHeader(date, author, hostname, tabwidth) # build string from description list so we can use it as a key # for the entry dictionary description_data = indent * ' ' for line in description: description_data = description_data + line + indent * ' ' # put the revisions and rcs files in decription-keyed # dictionary. if entry_dict.has_key(description_data): entry_dict[description_data].append(revision, rcs_file) else: entry_dict[description_data] = [(revision, rcs_file)] last_author = author last_date = date last_description = description # print the last entry if there is one (i.e. the last two entries # have the same author and date) if entry_dict: print ChangeLogFileRevDesc(entry_dict, indent, length) | c855779f0af36075bf2fd8360135552b148dfdad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/675/c855779f0af36075bf2fd8360135552b148dfdad/cvs2log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
2589,
16,
336,
3838,
16,
813,
16,
533,
16,
2987,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
72,
30,
77,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1930,
2589,
16,
336,
3838,
16,
813,
16,
533,
16,
2987,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
72,
30,
77,
3... |
for f in dfttyp: | for f in gms_dfttyp_items: | def load_dfttyp_combox(self): '''Load list of DFT function in a combobox widget''' self.dfttyp_combox.clear() # Clear all combo box items if self.gmsver == GAMESS: for f in dfttyp: self.dfttyp_combox.insertItem(f) else: for f in pcgms_dfttyp: self.dfttyp_combox.insertItem(f) | 2713160270f81d2e6dfa1124ca9da1a6bcb3bccb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/2713160270f81d2e6dfa1124ca9da1a6bcb3bccb/GamessProp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2180,
748,
879,
67,
832,
2147,
12,
2890,
4672,
9163,
2563,
666,
434,
463,
4464,
445,
316,
279,
3894,
27570,
3604,
26418,
365,
18,
2180,
748,
879,
67,
832,
2147,
18,
8507,
143... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2180,
748,
879,
67,
832,
2147,
12,
2890,
4672,
9163,
2563,
666,
434,
463,
4464,
445,
316,
279,
3894,
27570,
3604,
26418,
365,
18,
2180,
748,
879,
67,
832,
2147,
18,
8507,
143... |
if callable(file): | if callable(filepat): | def add_data_files(self,*files): """ Add data files to configuration data_files. Argument(s) can be either - 2-sequence (<datadir prefix>,<path to data file(s)>) - paths to data files where python datadir prefix defaults to package dir. | 8680d6f6df88d32e07a25c441fa29ac7a1095919 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/8680d6f6df88d32e07a25c441fa29ac7a1095919/misc_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
892,
67,
2354,
12,
2890,
16,
14,
2354,
4672,
3536,
1436,
501,
1390,
358,
1664,
501,
67,
2354,
18,
5067,
12,
87,
13,
848,
506,
3344,
300,
576,
17,
6178,
261,
32,
3404,
361,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
892,
67,
2354,
12,
2890,
16,
14,
2354,
4672,
3536,
1436,
501,
1390,
358,
1664,
501,
67,
2354,
18,
5067,
12,
87,
13,
848,
506,
3344,
300,
576,
17,
6178,
261,
32,
3404,
361,
... |
sage: print A | sage: A | def gcs(self): """ A greedy critical set of a latin square self is found by successively removing elements in a row-wise (bottom-up) manner, checking for unique completion at each step. | 79588eb9f6225f31a0fe90ef3cb590193d4561c1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/79588eb9f6225f31a0fe90ef3cb590193d4561c1/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24253,
12,
2890,
4672,
3536,
432,
5174,
24009,
11239,
444,
434,
279,
30486,
8576,
365,
353,
1392,
635,
2216,
4492,
9427,
2186,
316,
279,
1027,
17,
2460,
261,
9176,
17,
416,
13,
21296,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24253,
12,
2890,
4672,
3536,
432,
5174,
24009,
11239,
444,
434,
279,
30486,
8576,
365,
353,
1392,
635,
2216,
4492,
9427,
2186,
316,
279,
1027,
17,
2460,
261,
9176,
17,
416,
13,
21296,
16... |
debug("add_cookie_header") | _debug("add_cookie_header") | def add_cookie_header(self, request): """Add correct Cookie: header to request (urllib2.Request object). | 15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81/cookielib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8417,
67,
3374,
12,
2890,
16,
590,
4672,
3536,
986,
3434,
10201,
30,
1446,
358,
590,
261,
718,
2941,
22,
18,
691,
733,
2934,
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,
527,
67,
8417,
67,
3374,
12,
2890,
16,
590,
4672,
3536,
986,
3434,
10201,
30,
1446,
358,
590,
261,
718,
2941,
22,
18,
691,
733,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
print 'Usage: %s <DIRAC site name> <COMMENT>' %(Script.scriptName) | print 'Usage: %s <DIRAC site name> <COMMENT>' % ( Script.scriptName ) | def usage(): print 'Usage: %s <DIRAC site name> <COMMENT>' %(Script.scriptName) print 'Note: emails should only be disabled for bulk operations.' DIRAC.exit(2) | 43bc1428e2c48300c638de896bbd95b498bb1274 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/43bc1428e2c48300c638de896bbd95b498bb1274/dirac-admin-allow-site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
2834,
508,
34,
411,
12200,
1870,
738,
261,
7739,
18,
4263,
461,
262,
1172,
296,
8067,
30,
14255,
1410,
1338,
506,
5673,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
2834,
508,
34,
411,
12200,
1870,
738,
261,
7739,
18,
4263,
461,
262,
1172,
296,
8067,
30,
14255,
1410,
1338,
506,
5673,
364,
... |
print '%s depends on %s, not emitting' % (td.name(), dtd.name()) | def sortByDependency (self, components, dependent_class_filter): """Return the components that belong to this namespace, in order of dependency. | 8958eab7eadbb9f182dec2bde4f8d8ce0ea213ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/8958eab7eadbb9f182dec2bde4f8d8ce0ea213ac/Namespace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14021,
7787,
261,
2890,
16,
4085,
16,
10460,
67,
1106,
67,
2188,
4672,
3536,
990,
326,
4085,
716,
10957,
358,
333,
1981,
16,
316,
1353,
434,
4904,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14021,
7787,
261,
2890,
16,
4085,
16,
10460,
67,
1106,
67,
2188,
4672,
3536,
990,
326,
4085,
716,
10957,
358,
333,
1981,
16,
316,
1353,
434,
4904,
18,
2,
-100,
-100,
-100,
-100,
-100,
... | |
"""Return the sum of the two operands. | """Return the difference between the two operands. | def subtract(self, a, b): """Return the sum of the two operands. | 3450ca587eb1604428189320ebea018a018c43df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3450ca587eb1604428189320ebea018a018c43df/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10418,
12,
2890,
16,
279,
16,
324,
4672,
3536,
990,
326,
2142,
434,
326,
2795,
14883,
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,
... | [
1,
1,
1,
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,
10418,
12,
2890,
16,
279,
16,
324,
4672,
3536,
990,
326,
2142,
434,
326,
2795,
14883,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
@raise raise ProfileError: if length of prof != N_residues | @raise ProfileError: if length of prof != N_residues | def setProfile( self, name, prof, mask=None, default=None, asarray=1, comment=None, **moreInfo ): """ Add/override profile. @param name: profile name @type name: str @param prof: list of values @type prof: [any] @param mask: list 1 x N_items of 0|1, if there are less values than items, provide mask for missing values, N.sum(mask)==N_items @type mask: [0|1] @param default: value for items masked. @type default: any @param asarray: store as list (0), as array (2) or store numbers as array but everything else as list (1) (default: 1) @type asarray: 0|1|2 @param comment: goes into info[name]['comment'] @type comment: str @param moreInfo: additional key-value pairs for info[name] @type moreInfo: @raise raise ProfileError: if length of prof != N_residues """ self.profiles.set( name, prof, mask, default, asarray=asarray, comment=comment, **moreInfo ) | d94a4af3582d8dee98e9e90efc4d479cc6e0d58e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/482/d94a4af3582d8dee98e9e90efc4d479cc6e0d58e/Trajectory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
4029,
12,
365,
16,
508,
16,
9214,
16,
3066,
33,
7036,
16,
805,
33,
7036,
16,
10455,
33,
21,
16,
2879,
33,
7036,
16,
2826,
10161,
966,
262,
30,
3536,
1436,
19,
10601,
3042,
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,
444,
4029,
12,
365,
16,
508,
16,
9214,
16,
3066,
33,
7036,
16,
805,
33,
7036,
16,
10455,
33,
21,
16,
2879,
33,
7036,
16,
2826,
10161,
966,
262,
30,
3536,
1436,
19,
10601,
3042,
18,
... |
elif func.name == 'CompressedTexSubImage2D': | elif name == 'CompressedTexSubImage2D': | def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) for arg in func.GetCmdArgs(): arg.WriteGetCode(file) | 07f54fcc277a2d8fc3e6cecc5df5ea5c3d5ed080 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/07f54fcc277a2d8fc3e6cecc5df5ea5c3d5ed080/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
13621,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
12,
315,
2670,
67,
1636,
2866,
21004,
611,
11386,
22,
7975,
2828,
286... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
13621,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
12,
315,
2670,
67,
1636,
2866,
21004,
611,
11386,
22,
7975,
2828,
286... |
raise self.error('command %s illegal in state %s' % (command, self.state)) | raise self.error("command %s illegal in state %s, " "only allowed in states %s" % (command, self.state, ', '.join(Commands[command]))) | def uid(self, command, *args): """Execute "command arg ..." with messages identified by UID, rather than message number. | 9c70b6994b8957dad886fee25dfcc542a7e0e743 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/9c70b6994b8957dad886fee25dfcc542a7e0e743/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4555,
12,
2890,
16,
1296,
16,
380,
1968,
4672,
3536,
5289,
315,
3076,
1501,
18483,
598,
2743,
9283,
635,
10034,
16,
9178,
2353,
883,
1300,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
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,
4555,
12,
2890,
16,
1296,
16,
380,
1968,
4672,
3536,
5289,
315,
3076,
1501,
18483,
598,
2743,
9283,
635,
10034,
16,
9178,
2353,
883,
1300,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
input_api, output_api, sources)) | input_api, output_api, source_file_filter=sources)) | def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, white_list=white_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, text_files)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results | 6c76dfe417e06961aaf92bb1ec42ffbe50c8d198 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c76dfe417e06961aaf92bb1ec42ffbe50c8d198/PRESUBMIT.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6517,
4081,
12,
2630,
67,
2425,
16,
876,
67,
2425,
4672,
1686,
273,
5378,
468,
18734,
1552,
333,
981,
741,
35,
468,
2597,
6277,
326,
805,
7721,
666,
261,
73,
18,
75,
18,
12126,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6517,
4081,
12,
2630,
67,
2425,
16,
876,
67,
2425,
4672,
1686,
273,
5378,
468,
18734,
1552,
333,
981,
741,
35,
468,
2597,
6277,
326,
805,
7721,
666,
261,
73,
18,
75,
18,
12126,
... |
return FiniteField_ext_pariElement(self.__parent, self.__value * right.__value) | return FiniteField_ext_pariElement(self.__parent, self.__value * right.__value, check=False) | def _mul_(self, right): return FiniteField_ext_pariElement(self.__parent, self.__value * right.__value) | 99f8f4d261745ac6dc3bdcdaa49d15b9651e62e7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/99f8f4d261745ac6dc3bdcdaa49d15b9651e62e7/finite_field_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16411,
67,
12,
2890,
16,
2145,
4672,
327,
9458,
1137,
974,
67,
408,
67,
1065,
77,
1046,
12,
2890,
16186,
2938,
16,
365,
16186,
1132,
380,
2145,
16186,
1132,
13,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16411,
67,
12,
2890,
16,
2145,
4672,
327,
9458,
1137,
974,
67,
408,
67,
1065,
77,
1046,
12,
2890,
16186,
2938,
16,
365,
16186,
1132,
380,
2145,
16186,
1132,
13,
2,
-100,
-100,
-10... |
sqlQuery = sqlQuery + " WHERE to_tsvector(" + tsvector + ") @@ to_tsquery('" + tsquery + "')" | sqlQuery = sqlQuery + " WHERE to_tsvector(" + tsvector + ") @@ to_tsquery('english','" + tsquery + "')" | def fullTextSearch(self,request): # addresses/fullTextSearch?fields=street,city,housenumber&query=ch%20du%2028&tolerance=0.005&easting=6.62379551&northing=46.51687241&limit=20&distinct=true # Read request parameters fields = request.params['fields'] | b5802d22e5d41c8ddbbd831b4bcf601707da23a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b5802d22e5d41c8ddbbd831b4bcf601707da23a8/addresses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1983,
1528,
2979,
12,
2890,
16,
2293,
4672,
468,
225,
6138,
19,
2854,
1528,
2979,
35,
2821,
33,
22424,
16,
14240,
16,
76,
1481,
21998,
10,
2271,
33,
343,
9,
3462,
2544,
9,
18212,
28,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1983,
1528,
2979,
12,
2890,
16,
2293,
4672,
468,
225,
6138,
19,
2854,
1528,
2979,
35,
2821,
33,
22424,
16,
14240,
16,
76,
1481,
21998,
10,
2271,
33,
343,
9,
3462,
2544,
9,
18212,
28,
... |
output, status = self.run('pull %r --all --match="hash %s"' % (self.path, rev), | output, status = self.run('pull', self.path, '--all', '--match', 'hash %s' % rev, | def pull(self, rev): output, status = self.run('pull %r --all --match="hash %s"' % (self.path, rev), '--no-test', '--no-posthook', '--external-merge=/bin/false', repodir=self.tmppath) if status: if output.find('We have conflicts in') == -1: self.checkexit(status, output) output, status = self.run('revert --all', repodir=self.tmppath) self.checkexit(status, output) | ec50e22a4deac6328d1db7ad5a3e5fd370f70050 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/ec50e22a4deac6328d1db7ad5a3e5fd370f70050/darcs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6892,
12,
2890,
16,
5588,
4672,
876,
16,
1267,
273,
365,
18,
2681,
2668,
13469,
2187,
365,
18,
803,
16,
3534,
454,
2187,
3534,
1916,
2187,
296,
2816,
738,
87,
11,
738,
5588,
16,
3534,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6892,
12,
2890,
16,
5588,
4672,
876,
16,
1267,
273,
365,
18,
2681,
2668,
13469,
2187,
365,
18,
803,
16,
3534,
454,
2187,
3534,
1916,
2187,
296,
2816,
738,
87,
11,
738,
5588,
16,
3534,
... |
pass self.body.append('\n.TP\n\B %s\n' % str(self._list_char[-1])) | self.body.append('\n.TP 2\n\\(bu\n') else: self.body.append('\n.TP 2\n%s\n' % str(self._list_char[-1])) | def visit_list_item(self, node): try: self._list_char[-1] += 1 except: pass self.body.append('\n.TP\n\B %s\n' % str(self._list_char[-1])) | 577235fae77f798f5c69e4d6cad5121859482694 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/577235fae77f798f5c69e4d6cad5121859482694/manpage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
1098,
67,
1726,
12,
2890,
16,
756,
4672,
775,
30,
365,
6315,
1098,
67,
3001,
18919,
21,
65,
1011,
404,
1335,
30,
1342,
365,
18,
3432,
18,
6923,
2668,
64,
82,
18,
11130,
64,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
1098,
67,
1726,
12,
2890,
16,
756,
4672,
775,
30,
365,
6315,
1098,
67,
3001,
18919,
21,
65,
1011,
404,
1335,
30,
1342,
365,
18,
3432,
18,
6923,
2668,
64,
82,
18,
11130,
64,... |
imagepath.replace('file://localhost','').strip() | imagepath, headers = urllib.urlretrieve(imagepath) print imagepath | def __init__(self, imagepath, thumbpath=None, tag="img", width=240): markup.page.__init__(self, mode="strict_html") try: os.mkdir('Images') except: pass #So that you can give it a url imagepath.replace('file://localhost','').strip() imgname = os.path.split(imagepath.rstrip('/'))[1] shutil.copy(imagepath, 'Images/') if not thumbpath: thumbname = 'Images/' + "thumb_" + imgname command = 'convert ' + 'Images/' + imgname + ' -resize 300x300 -antialias ' + thumbname popen = subprocess.Popen(command.split()) popen.communicate() status = popen.returncode imgname = 'Images/' + imgname else: thumbpath.replace('file://localhost','').strip() thumbname = os.path.split(thumbpath.rstrip('/'))[1] shutil.copy(thumbpath, 'Images/') thumbname = 'Images/' + thumbname imgname = 'Images/' + imgname self.add('<a href=%s target="_blank"><img src=%s width=%d></a>' % (imgname, thumbname, width)) | 87ffbb6608bdd3d91f74d9e5a7de02376a266245 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/87ffbb6608bdd3d91f74d9e5a7de02376a266245/cbcwebpage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1316,
803,
16,
11156,
803,
33,
7036,
16,
1047,
1546,
6081,
3113,
1835,
33,
28784,
4672,
9813,
18,
2433,
16186,
2738,
972,
12,
2890,
16,
1965,
1546,
13948,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1316,
803,
16,
11156,
803,
33,
7036,
16,
1047,
1546,
6081,
3113,
1835,
33,
28784,
4672,
9813,
18,
2433,
16186,
2738,
972,
12,
2890,
16,
1965,
1546,
13948,
... |
'h5py.tests': ['data/*.hdf5']} | 'h5py.tests': ['data/*.hdf5', 'data/*.h5']} | def run(self): | f144496beb8fb98cf8cb1c7ab3f9723ca36e2860 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10380/f144496beb8fb98cf8cb1c7ab3f9723ca36e2860/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.write('docu') | self.write('header') | def BALL_HEADER_TEST(self): WOERTER=[] while self.getLine() == 1: for i in range(len(self.exp_header)): if self.exp_header[i].search(self.line, 0): self.errors = self.errors + 1 self.write('docu') self.ende() | 86c195c37788a1004b55fdc9a23a6b068464da21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5247/86c195c37788a1004b55fdc9a23a6b068464da21/testfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
4685,
67,
7557,
67,
16961,
12,
2890,
4672,
678,
51,
654,
2560,
33,
8526,
1323,
365,
18,
588,
1670,
1435,
422,
404,
30,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
2749,
67,
337... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
4685,
67,
7557,
67,
16961,
12,
2890,
4672,
678,
51,
654,
2560,
33,
8526,
1323,
365,
18,
588,
1670,
1435,
422,
404,
30,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
2749,
67,
337... |
subsequent_indent=' ').strip() | subsequent_indent=' ') | def notify(self, tktid, newticket=1, modtime=0): | cbcbdcfcb55b8e35144a49215d9efbcfed7d0311 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/cbcbdcfcb55b8e35144a49215d9efbcfed7d0311/Notify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2890,
16,
268,
8629,
350,
16,
394,
16282,
33,
21,
16,
681,
957,
33,
20,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
12,
2890,
16,
268,
8629,
350,
16,
394,
16282,
33,
21,
16,
681,
957,
33,
20,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print "exception raised as expected: " + str(e) | pass | def test_kmeans_lost_cluster(self): """This will cause kmean to have a cluster with no points.""" data = N.fromfile(open(DATAFILE1), sep = ", ") data = data.reshape((200, 2)) initk = N.array([[-1.8127404, -0.67128041], [ 2.04621601, 0.07401111], [-2.31149087,-0.05160469]]) | 9a29078f390bd61db6882c9ee0689bb914523e4e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/9a29078f390bd61db6882c9ee0689bb914523e4e/test_vq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
79,
18408,
67,
383,
334,
67,
7967,
12,
2890,
4672,
3536,
2503,
903,
4620,
417,
7079,
358,
1240,
279,
2855,
598,
1158,
3143,
12123,
501,
273,
423,
18,
2080,
768,
12,
3190,
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,
1842,
67,
79,
18408,
67,
383,
334,
67,
7967,
12,
2890,
4672,
3536,
2503,
903,
4620,
417,
7079,
358,
1240,
279,
2855,
598,
1158,
3143,
12123,
501,
273,
423,
18,
2080,
768,
12,
3190,
12,... |
_distance_wrap.pdist_canberra_wrap(_convert_to_bool(X), dm) | _distance_wrap.pdist_canberra_wrap(_convert_to_double(X), dm) | def pdist(X, metric='euclidean', p=2, V=None, VI=None): """ Y = pdist(X, method='euclidean', p=2) Computes the distance between m original observations in n-dimensional space. Returns a condensed distance matrix Y. For each i and j (i<j), the metric dist(u=X[i], v=X[j]) is computed and stored in the ij'th entry. See squareform to learn how to retrieve this entry. 1. Y = pdist(X) Computes the distance between m points using Euclidean distance (2-norm) as the distance metric between the points. The points are arranged as m n-dimensional row vectors in the matrix X. 2. Y = pdist(X, 'minkowski', p) Computes the distances using the Minkowski distance ||u-v||_p (p-norm) where p>=1. 3. Y = pdist(X, 'cityblock') Computes the city block or Manhattan distance between the points. 4. Y = pdist(X, 'seuclidean', V=None) Computes the standardized Euclidean distance. The standardized Euclidean distance between two n-vectors u and v is sqrt(\sum {(u_i-v_i)^2 / V[x_i]}). V is the variance vector; V[i] is the variance computed over all the i'th components of the points. If not passed, it is automatically computed. 5. Y = pdist(X, 'sqeuclidean') Computes the squared Euclidean distance ||u-v||_2^2 between the vectors. 6. Y = pdist(X, 'cosine') Computes the cosine distance between vectors u and v, 1 - uv^T ----------- |u|_2 |v|_2 where |*|_2 is the 2 norm of its argument *. 7. Y = pdist(X, 'correlation') Computes the correlation distance between vectors u and v. This is 1 - (u - n|u|_1)(v - n|v|_1)^T --------------------------------- , |(u - n|u|_1)|_2 |(v - n|v|_1)|^T where |*|_1 is the Manhattan (or 1-norm) of its argument *, and n is the common dimensionality of the vectors. 8. Y = pdist(X, 'hamming') Computes the normalized Hamming distance, or the proportion of those vector elements between two n-vectors u and v which disagree. To save memory, the matrix X can be of type boolean. 9. Y = pdist(X, 'jaccard') Computes the Jaccard distance between the points. Given two vectors, u and v, the Jaccard distance is the proportion of those elements u_i and v_i that disagree where at least one of them is non-zero. 10. Y = pdist(X, 'chebyshev') Computes the Chebyshev distance between the points. The Chebyshev distance between two n-vectors u and v is the maximum norm-1 distance between their respective elements. More precisely, the distance is given by d(u,v) = max {|u_i-v_i|}. 11. Y = pdist(X, 'canberra') Computes the Canberra distance between the points. The Canberra distance between two points u and v is |u_1-v_1| |u_2-v_2| |u_n-v_n| d(u,v) = ----------- + ----------- + ... + ----------- |u_1|+|v_1| |u_2|+|v_2| |u_n|+|v_n| 12. Y = pdist(X, 'braycurtis') Computes the Bray-Curtis distance between the points. The Bray-Curtis distance between two points u and v is |u_1-v_1| + |u_2-v_2| + ... + |u_n-v_n| d(u,v) = --------------------------------------- |u_1+v_1| + |u_2+v_2| + ... + |u_n+v_n| 13. Y = pdist(X, 'mahalanobis', VI=None) Computes the Mahalanobis distance between the points. The Mahalanobis distance between two points u and v is (u-v)(1/V)(u-v)^T where (1/V) is the inverse covariance. If VI is not None, VI will be used as the inverse covariance matrix. 14. Y = pdist(X, 'yule') Computes the Yule distance between each pair of boolean vectors. (see yule function documentation) 15. Y = pdist(X, 'matching') Computes the matching distance between each pair of boolean vectors. (see matching function documentation) 16. Y = pdist(X, 'dice') Computes the Dice distance between each pair of boolean vectors. (see dice function documentation) 17. Y = pdist(X, 'kulsinski') Computes the Kulsinski distance between each pair of boolean vectors. (see kulsinski function documentation) 17. Y = pdist(X, 'rogerstanimoto') Computes the Rogers-Tanimoto distance between each pair of boolean vectors. (see rogerstanimoto function documentation) 18. Y = pdist(X, 'russellrao') Computes the Russell-Rao distance between each pair of boolean vectors. (see russellrao function documentation) 19. Y = pdist(X, 'sokalmichener') Computes the Sokal-Michener distance between each pair of boolean vectors. (see sokalmichener function documentation) 20. Y = pdist(X, 'sokalsneath') Computes the Sokal-Sneath distance between each pair of boolean vectors. (see sokalsneath function documentation) 21. Y = pdist(X, f) Computes the distance between all pairs of vectors in X using the user supplied 2-arity function f. For example, Euclidean distance between the vectors could be computed as follows, dm = pdist(X, (lambda u, v: np.sqrt(((u-v)*(u-v).T).sum()))) Note that you should avoid passing a reference to one of the distance functions defined in this library. For example, dm = pdist(X, sokalsneath) would calculate the pair-wise distances between the vectors in X using the Python function sokalsneath. This would result in sokalsneath being called {n \choose 2} times, which is inefficient. Instead, the optimized C version is more efficient, and we call it using the following syntax. dm = pdist(X, 'sokalsneath') """ | 270d8f355254535dff52aae26daf555d106c1c11 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5882/270d8f355254535dff52aae26daf555d106c1c11/distance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
4413,
12,
60,
16,
3999,
2218,
73,
22392,
2187,
293,
33,
22,
16,
776,
33,
7036,
16,
12596,
33,
7036,
4672,
3536,
1624,
273,
293,
4413,
12,
60,
16,
707,
2218,
73,
22392,
2187,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
4413,
12,
60,
16,
3999,
2218,
73,
22392,
2187,
293,
33,
22,
16,
776,
33,
7036,
16,
12596,
33,
7036,
4672,
3536,
1624,
273,
293,
4413,
12,
60,
16,
707,
2218,
73,
22392,
2187,
293... |
self.removeCurve(self.zoomKey) self.tempSelectionCurve = None | def onMouseReleased(self, e): self.mouseCurrentlyPressed = 0 self.mouseCurrentButton = 0 | aa74f74783941495449466e664a97111058a5403 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/aa74f74783941495449466e664a97111058a5403/OWVisGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21000,
26363,
12,
2890,
16,
425,
4672,
365,
18,
11697,
3935,
715,
24624,
273,
374,
365,
18,
11697,
3935,
3616,
273,
374,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21000,
26363,
12,
2890,
16,
425,
4672,
365,
18,
11697,
3935,
715,
24624,
273,
374,
365,
18,
11697,
3935,
3616,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.