rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
code = "var expando = 'hello'" disp = self.site.engine_script.GetScriptDispatch(None)
code = "test.expando = 'hello'" disp = self.site.engine_script.GetScriptDispatch('test')
def testDispatchSimple(self): code = "var expando = 'hello'" disp = self.site.engine_script.GetScriptDispatch(None) # name should not exist. if not skip_known_failures: self.assertRaisesCOMError(disp.GetIDsOfNames, 0, 'expando', hresult=winerror.DISP_E_UNKNOWNNAME) # Now execute the script code, which will define the name self.parseScriptText(code) disp.GetIDsOfNames(0, 'expando')
55b25e0f5d9dc05a88006fb263d2d359b9b6608b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13395/55b25e0f5d9dc05a88006fb263d2d359b9b6608b/testEngine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 5325, 5784, 12, 2890, 4672, 981, 273, 315, 3813, 18, 12320, 83, 273, 296, 23711, 4970, 16232, 273, 365, 18, 4256, 18, 8944, 67, 4263, 18, 967, 3651, 5325, 2668, 3813, 6134, 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, 1842, 5325, 5784, 12, 2890, 4672, 981, 273, 315, 3813, 18, 12320, 83, 273, 296, 23711, 4970, 16232, 273, 365, 18, 4256, 18, 8944, 67, 4263, 18, 967, 3651, 5325, 2668, 3813, 6134, 468, ...
print 'procesooo compra:'
def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[prod_id] sml_x_pd_id = product['sml'] no_cump = product['no_cump'] total = product['total'] avg = product['avg'] qda = product['qda'] cont = product['cont'] seq = product['seq'] def_code = self.pool.get('product.product').browse(cr,uid,prod_id).default_code.strip() if pending: print '@'*10 print 'procesando: ',self.pool.get('product.product').browse(cr,uid,prod_id).name #~ time.sleep(10) while sml_x_pd_id: sml_id = sml_x_pd_id.pop(0) value={} if not cont: cont = True q = 0.0 subtotal = 0.0 qda = 0.0 #se debe buscar el costo inicial cr.execute('SELECT standard_price,product_qty FROM lst_cost ' \ 'WHERE default_code=%s', (def_code,)) res = cr.fetchall() if res and res[0][1]: print 'encontre costo inicccc' avg,q = res[0] else: rpp = rpp_obj.browse(cr,uid,sml_id) if rpp.location_dest_id.id == loc_ids and rpp.invoice_id.type == 'in_invoice': q = rpp.picking_qty print 'cantidad inicialxxxxx: ',q avg = rpp.invoice_price_unit else: no_cump.append(sml_id) continue #avg = 1430.96 #q = 5.0 print 'cantidad inicial: ',q print 'costo inicial: ',avg total = avg*q subtotal = avg*q qda = q seq += 1 value = { 'subtotal':subtotal, 'total':total, 'avg':avg, 'stk_bef_cor':0.0, 'stk_aft_cor':qda, 'sequence':seq } scl_id = sc_line_obj.search(cr, uid, [('stk_mov_id','=',sml_id)]) sc_line_obj.write(cr, uid, scl_id, value) print 'q inicial: ',q print 'avg: ',avg print 'qda inicial: ',qda print 'seq inicial: ',seq else: rpp = rpp_obj.browse(cr,uid,sml_id) q = rpp.picking_qty scl_id = sc_line_obj.search(cr, uid, [('stk_mov_id','=',sml_id)]) scl = sc_line_obj.browse(cr,uid,scl_id)[0] print 'viene operac: ',sml_id print 'packing: ',rpp.picking_id.name print 'seq antes operac: ',seq #VENTA if rpp.location_id.id == loc_ids and rpp.invoice_id.type == 'out_invoice': print 'validando VENTA:' qda,total,avg,no_cump,seq= \ self.validate_venta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq #NC COMPRA if rpp.location_id.id == loc_ids and (rpp.invoice_id.type == 'in_refund' or rpp.invoice_id.type == 'in_invoice'): print 'validando NC compra:' qda,total,avg,no_cump,seq= \ self.validate_nc_compra(cr,uid,ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq #COMPRA if rpp.location_dest_id.id == loc_ids and rpp.invoice_id.type == 'in_invoice': print 'procesooo compra:' q_bef = qda qda,subtotal,total,avg = self.compute_compra(cr, uid, ids,scl,q,total,avg,qda) #REALIZAR EL WRITE DE LA LINEA value = { 'subtotal':subtotal, 'total':total, 'avg':avg, 'stk_bef_cor':q_bef, 'stk_aft_cor':qda } seq=self.write_data(cr, uid, ids, scl.id, value, seq) print 'seq despues operac: ',seq if no_cump: print 'agregando nuevamente las vta:' #no_cump.append(sml_id) no_cump.extend(sml_x_pd_id) print 'no cumplioooo: ',no_cump sml_x_pd_id = no_cump print 'nueva listaaa: ',sml_x_pd_id no_cump = [] #NC VENTA if rpp.location_dest_id.id == loc_ids and rpp.invoice_id.type == 'out_refund': print 'validando NC VENTA:' qda,total,avg,no_cump,seq= \ self.validate_nc_vta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq if no_cump and not scl.parent_id: print 'agregando nuevamente los movimientos:' #no_cump.append(sml_id) no_cump.extend(sml_x_pd_id) print 'no cumplioooo: ',no_cump sml_x_pd_id = no_cump print 'nueva listaaa: ',sml_x_pd_id no_cump = [] #DESTINO USO INTERNO if rpp.location_id.id == loc_ids and rpp.location_dest_id.id == inter_loc_ids: print 'validando USO INTERNO:' #fixme blanquear la variables de cuenta #acc_src = None #acc_dest = None qda,total,avg,no_cump,seq= \ self.validate_venta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq valores = {} if not (rpp.aml_cost_id or rpp.aml_inv_id): move = scl.stk_mov_id acc_src = move.product_id.product_tmpl_id.\ property_stock_account_output.id if move.location_dest_id.account_id: acc_dest = move.location_dest_id.account_id.id acc_mov_id = self.write_aml(cr, uid, ids, scl, q, avg, acc_src, acc_dest) acc_mov_obj = self.pool.get('account.move').browse(cr,uid,acc_mov_id) for aml in acc_mov_obj.line_id: valores.update({ 'aml_cost_qty':aml.quantity or 0.0, 'aml_cost_price_unit':avg, 'aml_inv_qty':aml.quantity or 0.0, 'aml_inv_price_unit':avg}) if aml.debit: valores.update({'aml_cost_id':aml.id}) if aml.credit: valores.update({'aml_inv_id':aml.id}) sc_line_obj.write(cr, uid, scl.id, valores) #~ else: #~ id1=scl.aml_cost_id.id #~ id2=scl.aml_inv_id.id #~ if not scl.aml_cost_id.credit: #~ valores.update({'aml_cost_id':id2, 'aml_inv_id':id1}) #~ sc_line_obj.write(cr, uid, scl.id, valores) #~ #DESTINO PROCESAMIENTO if rpp.location_id.id == loc_ids and rpp.location_dest_id.id == prod_loc_ids: print 'validando PROCESAMIENTO:' #fixme blanquear la variables de cuenta #acc_src = None #acc_dest = None qda,total,avg,no_cump,seq= \ self.validate_venta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq valores = {} if not (rpp.aml_cost_id or rpp.aml_inv_id): move = scl.stk_mov_id acc_src = move.product_id.product_tmpl_id.\ property_stock_account_output.id if move.location_dest_id.account_id: acc_dest = move.location_dest_id.account_id.id
62ca858ba796453e95db5d16001d237fb203c2e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7359/62ca858ba796453e95db5d16001d237fb203c2e9/stock_card.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 450, 764, 297, 67, 5896, 83, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 10791, 67, 350, 16, 9696, 16, 1515, 67, 2232, 16, 1554, 67, 1829, 67, 2232, 16, 10791, 67, 1829, 67, 2232, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 450, 764, 297, 67, 5896, 83, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 10791, 67, 350, 16, 9696, 16, 1515, 67, 2232, 16, 1554, 67, 1829, 67, 2232, 16, 10791, 67, 1829, 67, 2232, ...
add_warning(req, _('Tickets must contain a summary.'))
add_warning(req, _("Tickets must contain a summary."))
def _validate_ticket(self, req, ticket, force_collision_check=False): valid = True resource = ticket.resource
a8a6442302dc21bfc63206a71113b0375cb3c946 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/a8a6442302dc21bfc63206a71113b0375cb3c946/web_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5662, 67, 16282, 12, 2890, 16, 1111, 16, 9322, 16, 2944, 67, 12910, 1951, 67, 1893, 33, 8381, 4672, 923, 273, 1053, 1058, 273, 9322, 18, 3146, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5662, 67, 16282, 12, 2890, 16, 1111, 16, 9322, 16, 2944, 67, 12910, 1951, 67, 1893, 33, 8381, 4672, 923, 273, 1053, 1058, 273, 9322, 18, 3146, 2, -100, -100, -100, -100, -100, -10...
last_is_inf = False
def __init__(self, stream, parent, has_name=True, use_bank=False, has_separator=False): OnDemandFilter.__init__(self, "worms2_res", "Worms2 resource", stream, parent, "<") guess = stream.getN(3, False) if guess not in Resource.tag_name: self.name = "Strange chunk!?" self.addPadding() return self.tag = self.doRead("tag", "Type", (EnumChunk, "string[3]", Resource.tag_name)).value self.read("tag_end", "Type end", (FormatChunk, "string[1]")) if self.tag != "DIR": self.read("size", "Size", (FormatChunk, "uint32"))
6ad82742aeb5ce248df132848aa70c0a386a8d2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2280/6ad82742aeb5ce248df132848aa70c0a386a8d2d/worms2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1407, 16, 982, 16, 711, 67, 529, 33, 5510, 16, 999, 67, 10546, 33, 8381, 16, 711, 67, 11287, 33, 8381, 4672, 2755, 25461, 1586, 16186, 2738, 972, 12, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1407, 16, 982, 16, 711, 67, 529, 33, 5510, 16, 999, 67, 10546, 33, 8381, 16, 711, 67, 11287, 33, 8381, 4672, 2755, 25461, 1586, 16186, 2738, 972, 12, 2...
TEST:
TEST::
def get_status(self): """ Return a dictionary to be returned (in JSON format) representing the status of self. TEST: sage: from sage.server.simple.twist import SessionObject sage: s = SessionObject(id=1, username=None, worksheet=None) sage: s.get_status() {'session': 1} """ return { 'session': self.id }
13e64223b2a0aa52bf7316e411b7b18033bd8e63 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/13e64223b2a0aa52bf7316e411b7b18033bd8e63/twist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2327, 12, 2890, 4672, 3536, 2000, 279, 3880, 358, 506, 2106, 261, 267, 1796, 740, 13, 5123, 326, 1267, 434, 365, 18, 225, 22130, 2866, 225, 272, 410, 30, 628, 272, 410, 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, 336, 67, 2327, 12, 2890, 4672, 3536, 2000, 279, 3880, 358, 506, 2106, 261, 267, 1796, 740, 13, 5123, 326, 1267, 434, 365, 18, 225, 22130, 2866, 225, 272, 410, 30, 628, 272, 410, 18, ...
return new_html_output(self, u'<tr><td colspan="2"><table class="plain" width="100%"><tr>', u'<th>%(label)s</th><td width="%(field_width)d%%">%(errors)s%(field)s%(help_text)s</td>', u'<th colspan="2">%(label)s</th></tr><tr><td colspan="2">%(errors)s%(field)s%(help_text)s</td>', u'<td>%s</td>', '</tr></table></td></tr>', u'<br />%s', False)
return mark_safe(new_html_output(self, u'<tr><td colspan="2"><table class="plain" width="100%"><tr>', u'<th>%(label)s</th><td width="%(field_width)d%%">%(errors)s%(field)s%(help_text)s</td>', u'<th colspan="2">%(label)s</th></tr><tr><td colspan="2">%(errors)s%(field)s%(help_text)s</td>', u'<td>%s</td>', '</tr></table></td></tr>', u'<br />%s', False))
def field_compare(field_a, field_b): return line_group_safe(field_a[1]) - line_group_safe(field_b[1])
186c13bf8b7bbe2438dfab0a6df125efd255b958 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/186c13bf8b7bbe2438dfab0a6df125efd255b958/forms.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 652, 67, 9877, 12, 1518, 67, 69, 16, 652, 67, 70, 4672, 327, 980, 67, 1655, 67, 4626, 12, 1518, 67, 69, 63, 21, 5717, 300, 980, 67, 1655, 67, 4626, 12, 1518, 67, 70, 63, 21, 5717...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 652, 67, 9877, 12, 1518, 67, 69, 16, 652, 67, 70, 4672, 327, 980, 67, 1655, 67, 4626, 12, 1518, 67, 69, 63, 21, 5717, 300, 980, 67, 1655, 67, 4626, 12, 1518, 67, 70, 63, 21, 5717...
HTTPError.__init__(self, _("Bad Header Line: %s" % line))
HTTPError.__init__(self, _("Bad Header Line: %s") % line)
def __init__(self, line): HTTPError.__init__(self, _("Bad Header Line: %s" % line))
7cbc779148bbad785116aa6002b8eff24bebc5c4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12354/7cbc779148bbad785116aa6002b8eff24bebc5c4/httpclient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 980, 4672, 14415, 16186, 2738, 972, 12, 2890, 16, 389, 2932, 6434, 4304, 5377, 30, 738, 87, 6, 738, 980, 3719, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 980, 4672, 14415, 16186, 2738, 972, 12, 2890, 16, 389, 2932, 6434, 4304, 5377, 30, 738, 87, 6, 738, 980, 3719, 2, -100, -100, -100, -100, -100, -100, -10...
Debug = _Stream('xia2-debug', None)
Debug = _Stream('xia2-debug', 'debug: ')
def off(self): '''Switch the stream writing off...'''
9e51a2b880cb85396f3904e3ceedcc62c38118fd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/9e51a2b880cb85396f3904e3ceedcc62c38118fd/Streams.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3397, 12, 2890, 4672, 9163, 10200, 326, 1407, 7410, 3397, 7821, 6309, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3397, 12, 2890, 4672, 9163, 10200, 326, 1407, 7410, 3397, 7821, 6309, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
map(set.__setitem__, inseq, [])
for item in inseq: set[item] = None
def unique(inseq): """Returns unique items in 1-dimensional sequence. """ set = {} map(set.__setitem__, inseq, []) return asarray(set.keys())
f8fc8923f2ed8d4da323558092b1307383aa5685 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/f8fc8923f2ed8d4da323558092b1307383aa5685/function_base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3089, 12, 267, 5436, 4672, 3536, 1356, 3089, 1516, 316, 404, 17, 31236, 3102, 18, 3536, 444, 273, 2618, 364, 761, 316, 316, 5436, 30, 444, 63, 1726, 65, 273, 599, 327, 10455, 12, 542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3089, 12, 267, 5436, 4672, 3536, 1356, 3089, 1516, 316, 404, 17, 31236, 3102, 18, 3536, 444, 273, 2618, 364, 761, 316, 316, 5436, 30, 444, 63, 1726, 65, 273, 599, 327, 10455, 12, 542, ...
'u1.id AS user, ' \
'u1.id AS "user", ' \
def init(self, cr): cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \ 'SELECT ' \ '(u.account_id * u.max_user) + u.user AS id, ' \ 'u.account_id AS account_id, ' \ 'u.user AS user, ' \ 'COALESCE(SUM(l.unit_amount), 0.0) AS unit_amount ' \ 'FROM ' \ '(SELECT ' \ 'a.id AS account_id, ' \ 'u1.id AS user, ' \ 'MAX(u2.id) AS max_user ' \ 'FROM ' \ 'res_users AS u1, ' \ 'res_users AS u2, ' \ 'account_analytic_account AS a ' \ 'GROUP BY u1.id, a.id ' \ ') AS u ' \ 'LEFT JOIN ' \ '(SELECT ' \ 'l.account_id AS account_id, ' \ 'l.user_id AS user, ' \ 'SUM(l.unit_amount) AS unit_amount ' \ 'FROM account_analytic_line AS l, ' \ 'account_analytic_journal AS j ' \ 'WHERE j.type = \'general\' ' \ 'GROUP BY l.account_id, l.user_id ' \ ') AS l ' 'ON (' \ 'u.account_id = l.account_id ' \ 'AND u.user = l.user' \ ') ' \ 'GROUP BY u.user, u.account_id, u.max_user' \ ')')
6c53d30bb1bf070e757322245c1f83792fec18bf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8241/6c53d30bb1bf070e757322245c1f83792fec18bf/account_analytic_analysis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 16, 4422, 4672, 4422, 18, 8837, 2668, 9344, 4869, 23679, 21794, 2236, 67, 304, 7834, 335, 67, 12746, 67, 7687, 67, 1355, 5355, 7707, 521, 296, 4803, 296, 521, 7747, 89, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 16, 4422, 4672, 4422, 18, 8837, 2668, 9344, 4869, 23679, 21794, 2236, 67, 304, 7834, 335, 67, 12746, 67, 7687, 67, 1355, 5355, 7707, 521, 296, 4803, 296, 521, 7747, 89, ...
myQ = myQ | Q( group = self.category.group ) monitors = Monitor.objects.filter(myQ)
monitors = monitors | allmonitors.filter( group = self.category.group, category__isnull = True, thread__isnull = True )
def save(self): isnew = not self.id ret = super(Post, self).save()
77203119e748782a5a3b62aaf5ca07d4065a1caf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11563/77203119e748782a5a3b62aaf5ca07d4065a1caf/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 12, 2890, 4672, 353, 2704, 273, 486, 365, 18, 350, 325, 273, 2240, 12, 3349, 16, 365, 2934, 5688, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 12, 2890, 4672, 353, 2704, 273, 486, 365, 18, 350, 325, 273, 2240, 12, 3349, 16, 365, 2934, 5688, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return http.Response(stream='ok' if s else 'failed')
return HTMLResponse(stream='ok' if s else 'failed')
def render(self, ctx): # TODO -- this must not block long (!) s = self.worksheet.interrupt() return http.Response(stream='ok' if s else 'failed')
5da3b1cd72cd4a94421b8bc914d7957cdbe6b56d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/5da3b1cd72cd4a94421b8bc914d7957cdbe6b56d/twist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 468, 2660, 1493, 333, 1297, 486, 1203, 1525, 16051, 13, 272, 273, 365, 18, 1252, 8118, 18, 31847, 1435, 327, 1062, 18, 1064, 12, 3256, 2218, 601, 11, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 468, 2660, 1493, 333, 1297, 486, 1203, 1525, 16051, 13, 272, 273, 365, 18, 1252, 8118, 18, 31847, 1435, 327, 1062, 18, 1064, 12, 3256, 2218, 601, 11, 30...
if got_token and session.has_key('flickr') and session.has_key('dopplr'): return self.redirect("/")
try: if got_token and session['flickr'] and session['dopplr']: return self.redirect("/") except: logging.info("Not yet ready to visit trip list")
def get(self): session = get_session()
483f8044c0c1f14f447b9a414f4588fc3b21d737 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11110/483f8044c0c1f14f447b9a414f4588fc3b21d737/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 1339, 273, 336, 67, 3184, 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, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 1339, 273, 336, 67, 3184, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return self.context.absolute_url() + '/' + view_name else: return self.request['ACTUAL_URL']
base_url = self.context.absolute_url() + '/' + view_name if key: base_url += '?key=%s' % key return base_url
def referer(self): view_name = self.request.get('viewname', None) if view_name: return self.context.absolute_url() + '/' + view_name else: return self.request['ACTUAL_URL']
1cbf687dce335322cdf0c3e2c9b324e9ac478edb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12194/1cbf687dce335322cdf0c3e2c9b324e9ac478edb/editmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18068, 12, 2890, 4672, 1476, 67, 529, 273, 365, 18, 2293, 18, 588, 2668, 1945, 529, 2187, 599, 13, 309, 1476, 67, 529, 30, 1026, 67, 718, 273, 365, 18, 2472, 18, 12547, 67, 718, 1435...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18068, 12, 2890, 4672, 1476, 67, 529, 273, 365, 18, 2293, 18, 588, 2668, 1945, 529, 2187, 599, 13, 309, 1476, 67, 529, 30, 1026, 67, 718, 273, 365, 18, 2472, 18, 12547, 67, 718, 1435...
def _get_start_end(self, start, end):
def _get_start_end(self, start=None, end=None):
def _get_start_end(self, start, end): """Return default values for start and end if they are None """ if start is None: start = min(self._buf.keys()) if end is None: end = max(self._buf.keys()) if start > end: start, end = end, start return start, end
e12e683bfa45bd66d30b06aa07c7b71a83cd0e60 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4361/e12e683bfa45bd66d30b06aa07c7b71a83cd0e60/intelhex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 1937, 67, 409, 12, 2890, 16, 787, 33, 7036, 16, 679, 33, 7036, 4672, 3536, 990, 805, 924, 364, 787, 471, 679, 309, 2898, 854, 599, 3536, 309, 787, 353, 599, 30, 787, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 1937, 67, 409, 12, 2890, 16, 787, 33, 7036, 16, 679, 33, 7036, 4672, 3536, 990, 805, 924, 364, 787, 471, 679, 309, 2898, 854, 599, 3536, 309, 787, 353, 599, 30, 787, ...
binding_key="console.obj.%s" % packageName)
binding_key="console.obj.%s.
def bindPackage(self, packageName): """ """ if not self.userBindings or not self.rcvObjects: raise Exception("userBindings option not set for Session") for broker in self.brokers: broker.amqpSession.exchange_bind(exchange="qpid.management", queue=broker.topicName, binding_key="console.obj.%s" % packageName)
bf691187e1cd8e0e27f21da42a280442195476b0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/197/bf691187e1cd8e0e27f21da42a280442195476b0/qmfconsole.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1993, 2261, 12, 2890, 16, 9929, 4672, 3536, 3536, 309, 486, 365, 18, 1355, 10497, 578, 486, 365, 18, 1310, 90, 4710, 30, 1002, 1185, 2932, 1355, 10497, 1456, 486, 444, 364, 3877, 7923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1993, 2261, 12, 2890, 16, 9929, 4672, 3536, 3536, 309, 486, 365, 18, 1355, 10497, 578, 486, 365, 18, 1310, 90, 4710, 30, 1002, 1185, 2932, 1355, 10497, 1456, 486, 444, 364, 3877, 7923, ...
x=int(i*dx+self.border_left) y=int(j*dy+border_top)
if pdftemplate is not None: x=(self.x+i*dx+self.border_left)*scale y=800-(self.y+j*dy+border_top)*scale pdf.rectangle(x,y,dx*scale,-dy*scale) pdf.fill() else: x=int(i*dx+self.border_left) y=int(j*dy+border_top) w=int(dx)-1 h=int(dy)-1 if w<1: w=1 if h<1: h=1 if w<=1 and h<=1: g.drawLine(x,y,x,y) else: g.fillRect(x,y,w,h)
def paintComponent(self,g): core.DataViewComponent.paintComponent(self,g) if self.usemap and self.map is None: self.initialize_map() border_top = self.border_top + self.label_offset g.color=Color(0.8,0.8,0.8) g.drawLine(self.border_left,self.height-self.border_bottom,self.size.width-self.border_right,self.size.height-self.border_bottom)
9f31917740a85396cd8815f101f84dcf64439ab7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9336/9f31917740a85396cd8815f101f84dcf64439ab7/spike_raster.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12574, 1841, 12, 2890, 16, 75, 4672, 2922, 18, 751, 1767, 1841, 18, 84, 1598, 1841, 12, 2890, 16, 75, 13, 225, 309, 365, 18, 1202, 1458, 471, 365, 18, 1458, 353, 599, 30, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12574, 1841, 12, 2890, 16, 75, 4672, 2922, 18, 751, 1767, 1841, 18, 84, 1598, 1841, 12, 2890, 16, 75, 13, 225, 309, 365, 18, 1202, 1458, 471, 365, 18, 1458, 353, 599, 30, 365, 18, ...
po1 = self._createInstPackage('foo', '1')
po1 = self.instPackage('foo', '1')
def testUpdateRequireBoth(self): ''' install + update skipped, because of missing req. foo-1.0 -> foo-2.0 update, fails because foo-tools-2.0, needed by foo-2.0 is not provided. foo-2.0 update get skip, and the foo-gui install will get skipped too, because it need foo-2.0 there is not longer provided. ''' po1 = self._createInstPackage('foo', '1') po1.addRequires('foo-tools', 'EQ', ('0', '1', '0')) po2 = self._createRepoPackage('foo', '2') po2.addRequires('foo-tools', 'EQ', ('0', '2', '0'))
f29fddfeba059aed51f7896bf712a7e74ea6c59d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5445/f29fddfeba059aed51f7896bf712a7e74ea6c59d/skipbroken-tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1891, 8115, 20240, 12, 2890, 4672, 9163, 3799, 397, 1089, 9700, 16, 2724, 434, 3315, 1111, 18, 8431, 17, 21, 18, 20, 317, 8431, 17, 22, 18, 20, 1089, 16, 6684, 2724, 8431, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1891, 8115, 20240, 12, 2890, 4672, 9163, 3799, 397, 1089, 9700, 16, 2724, 434, 3315, 1111, 18, 8431, 17, 21, 18, 20, 317, 8431, 17, 22, 18, 20, 1089, 16, 6684, 2724, 8431, 17, ...
typemap[name] = fieldtype, 0
typemap[name] = fieldtype, False
def preprocess_fieldtypes(self, types): typemap = {} for fieldtype in types: for name in fieldtype.names: typemap[name] = fieldtype, 0 if fieldtype.is_typed: for name in fieldtype.typenames: typemap[name] = fieldtype, 1 return typemap
7ae812e5cd7f285a0f323bb5daf1d4fdc6ba114f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/7ae812e5cd7f285a0f323bb5daf1d4fdc6ba114f/docfields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17942, 67, 1518, 2352, 12, 2890, 16, 1953, 4672, 618, 1458, 273, 2618, 364, 652, 723, 316, 1953, 30, 364, 508, 316, 652, 723, 18, 1973, 30, 618, 1458, 63, 529, 65, 273, 652, 723, 16,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17942, 67, 1518, 2352, 12, 2890, 16, 1953, 4672, 618, 1458, 273, 2618, 364, 652, 723, 316, 1953, 30, 364, 508, 316, 652, 723, 18, 1973, 30, 618, 1458, 63, 529, 65, 273, 652, 723, 16,...
reply = ector.generateSentence(debug)
(reply, nodes) = ector.generateSentence(debug)
def main(): # Each decay divided by 2 UttererNode.__decay = 5 SentimentNode.__decay = 5 ExpressionNode.__decay = 20 SentenceNode.__decay = 25 TokenNode.__decay = 20 from optparse import OptionParser usage="usage: %prog [-p username][-n botname=Ector][-v|-q][-l logfilepath=ector.log][-s|-g][-h]" parser = OptionParser(usage=usage,version="%prog 0.3") parser.add_option("-p", "--person", dest="username", default="User", help="set the name of the utterer") parser.add_option("-n", "--name", dest="botname", default="Ector", help="set the name of the bot") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=True, help="say all that you can say") parser.add_option("-q", "--quiet", action="store_false", dest="verbose", help="shut up!") parser.add_option("-l", "--log", dest="logname", default="ector.log", help="log the dialogue in log file") parser.add_option("-s", "--sentence", action="store_true", dest="sentence", default=True, help="set sentence reply mode on") parser.add_option("-g", "--generate", action="store_false", dest="sentence", help="set generate reply mode on") parser.add_option("-d", "--debug", action="store_true", dest="debug", default=False, help="set debug mode on") (options, args) = parser.parse_args() license = None stdin = sys.stdin stdout = sys.stdout username = options.username botname = options.botname.capitalize() logfilename = options.logname version = "0.3" sentence_mode = options.sentence generate_mode = not sentence_mode # sentence and generate modes are antagonist verbose = options.verbose debug = options.debug # Quiet mode is above sentence or generate modes if not verbose: sentence_mode = False generate_mode = False ector = Ector(botname, username) previousSentenceNode = None print """pyECTOR version %s, Copyright (C) 2008 Francois PARMENTIER
8e1235056f34134b4407cd34d81f66b1b71e2c24 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13131/8e1235056f34134b4407cd34d81f66b1b71e2c24/Ector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 8315, 22286, 26057, 635, 576, 587, 88, 387, 264, 907, 16186, 26039, 565, 273, 1381, 16695, 5670, 907, 16186, 26039, 225, 273, 1381, 5371, 907, 16186, 26039, 273, 4200, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8315, 22286, 26057, 635, 576, 587, 88, 387, 264, 907, 16186, 26039, 565, 273, 1381, 16695, 5670, 907, 16186, 26039, 225, 273, 1381, 5371, 907, 16186, 26039, 273, 4200, 29...
components = re.match("^(.*?)\t(.*?)\s\((.*?)\)$", line)
components = line.split()
def remote_list(self): """ Return a list of the remote repositories @rtype list @return A list of dicts with keys: remote, url, fetch """ cmd = ["git", "remote", "-v"]
9ece30c78d6f6deef05e555e660d1c88bf154f10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/9ece30c78d6f6deef05e555e660d1c88bf154f10/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2632, 67, 1098, 12, 2890, 4672, 3536, 2000, 279, 666, 434, 326, 2632, 14531, 225, 632, 86, 723, 225, 666, 632, 2463, 432, 666, 434, 15838, 598, 1311, 30, 2632, 16, 880, 16, 2158, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2632, 67, 1098, 12, 2890, 4672, 3536, 2000, 279, 666, 434, 326, 2632, 14531, 225, 632, 86, 723, 225, 666, 632, 2463, 432, 666, 434, 15838, 598, 1311, 30, 2632, 16, 880, 16, 2158, 225, ...
elif tok[0] == '/tell': self.tell(tok[1:])
elif tok[0] == '/tell': self.tell(tok[1:]);self.typing = False;self.announce_players()
def game(self,data): if len(data) == 0: return data = data.decode('utf-8') tok = data.split(' ') if tok[0] == 'TYPING': self.typing = True;self.announce_players() elif tok[0] == 'NOT_TYPING': self.typing = False;self.announce_players() elif tok[0] == '/name': self.setname(" ".join(tok[1:]))#self.name = ;self.regex = re.compile(self.name,re.IGNORECASE) elif tok[0] == '/gm': self.gm = (self.gm+1)%2;self.typing = False;self.announce_players() elif tok[0] == '/tell': self.tell(tok[1:]) else: if data[0] == '*': self.announce('''%s %s'''%(self.name,data[1:])) elif data[0] == '!': self.announce('''(%s: %s)'''%(self.name,data)) elif data[0] == '#': self.announce('''(%s) %s'''%(self.name,data[1:])) elif data[0] == '(': self.announce('''(%s: %s'''%(self.nick,data[1:])) else: self.announce('''%s says, "%s"'''%(self.name,data)) self.typing = False self.announce_players()
ddd5be908c41c60ef7500f2a00504aad74151a00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13227/ddd5be908c41c60ef7500f2a00504aad74151a00/ropeserve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7920, 12, 2890, 16, 892, 4672, 309, 562, 12, 892, 13, 422, 374, 30, 327, 501, 273, 501, 18, 3922, 2668, 3158, 17, 28, 6134, 946, 273, 501, 18, 4939, 2668, 8624, 309, 946, 63, 20, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7920, 12, 2890, 16, 892, 4672, 309, 562, 12, 892, 13, 422, 374, 30, 327, 501, 273, 501, 18, 3922, 2668, 3158, 17, 28, 6134, 946, 273, 501, 18, 4939, 2668, 8624, 309, 946, 63, 20, 6...
print ua
print ua
def main(): mysite = wikipedia.getSite() sa = [] output_directory = "" save_images = False overwrite_images = False overwrite_articles = False for arg in sys.argv[1:]: if arg.startswith("-lang:"): lang = arg[6:] elif arg.startswith("-file:"): for pl in wikipedia.PageLinksFromFile(arg[6:]): sa.append(pl) elif arg.startswith("-o:"): output_directory = arg[3:] elif arg.startswith("-images"): save_images = True elif arg.startswith("-overwrite:"): if arg[11] == "I": overwrite_images = True elif arg[11] == "A": overwrite_articles = True elif arg[11] == "B": overwrite_images = True overwrite_articles = True else: sa.append(arg) headers = {"Content-type": "application/x-www-form-urlencoded", "User-agent": "RobHooftWikiRobot/1.0"} conn = httplib.HTTPConnection(mysite.hostname()) R = re.compile('.*/wiki/(.*)') data = "" for article in sa: if os.path.isfile(output_directory + article + ".txt") and overwrite_articles == False: print "skipping " + article continue data = "" ua = article while len(data) < 2: url = '/wiki/'+ ua conn.request("GET", url, "", headers) response = conn.getresponse() data = response.read() if len(data) < 2: print ua + " failed. reading", result = R.match(response.getheader("Location", )) ua = result.group(1) print ua data = extractArticle(data) f = open (output_directory + article + ".txt", 'w') f.write (data['article'] + '\n' + data['footer']) f.close() print "saved " + article if save_images: images = extractImages(data['article']) for i in images: if overwrite_images == False and os.path.isfile(output_directory + i['image']): print "skipping existing " + i['image'] continue print 'downloading ' + i['image'], uo = wikipedia.MyURLopener() file = uo.open( "http://upload.wikimedia.org/wikipedia/" +mysite.lang + '/' + i['path'] + i['image']) content = file.read() f = open(output_directory + i['image'], "wb") f.write(content) f.close() print 'done'
5ed2134fae03a0e5f020b2340a4c42c4092f6faa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/5ed2134fae03a0e5f020b2340a4c42c4092f6faa/saveHTML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 312, 1900, 1137, 273, 21137, 18, 588, 4956, 1435, 7864, 273, 5378, 876, 67, 5149, 273, 1408, 1923, 67, 7369, 273, 1083, 6156, 67, 7369, 273, 1083, 6156, 67, 16462, 273, 1083...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 312, 1900, 1137, 273, 21137, 18, 588, 4956, 1435, 7864, 273, 5378, 876, 67, 5149, 273, 1408, 1923, 67, 7369, 273, 1083, 6156, 67, 7369, 273, 1083, 6156, 67, 16462, 273, 1083...
self.fields['ship_country'] = forms.ChoiceField(choices=countries)
self.fields['ship_country'] = forms.ChoiceField(choices=countries, required=False)
def __init__(self, countries, areas, contact, *args, **kwargs): self.shippable = True if kwargs.has_key('shippable'): self.shippable = kwargs['shippable'] del(kwargs['shippable']) super(ContactInfoForm, self).__init__(*args, **kwargs) if areas is not None and countries is None: self.fields['state'] = forms.ChoiceField(choices=areas, initial=selection) self.fields['ship_state'] = forms.ChoiceField(choices=areas, initial=selection, required=False) if countries is not None: self.fields['country'] = forms.ChoiceField(choices=countries) if self.shippable: self.fields['ship_country'] = forms.ChoiceField(choices=countries)
697bfb34c3fab43ebee5b4879c19a921a5f2de8f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13656/697bfb34c3fab43ebee5b4879c19a921a5f2de8f/forms.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 17603, 16, 15586, 16, 5388, 16, 380, 1968, 16, 2826, 4333, 4672, 365, 18, 3261, 19586, 273, 1053, 309, 1205, 18, 5332, 67, 856, 2668, 3261, 19586, 11, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 17603, 16, 15586, 16, 5388, 16, 380, 1968, 16, 2826, 4333, 4672, 365, 18, 3261, 19586, 273, 1053, 309, 1205, 18, 5332, 67, 856, 2668, 3261, 19586, 11, 46...
retval = url
retval = uri
def sanitise_uri(uri): '''Sanitise URI Description ----------- Adds the ``http://`` scheme (alias protocol, alias method) to the URI if none is provided. Arguments --------- ``uri`` The string containing the URI to be sanitised. Returns ------- A string containing the sanitised URI. Side Effects ------------ None.''' retval = url if not(urlparse(uri)[0]): retval = 'http://%s' % uri return retval
e32b3c6231fdbe37252e60e735a36062c381224b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6273/e32b3c6231fdbe37252e60e735a36062c381224b/saneuri.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6764, 784, 67, 1650, 12, 1650, 4672, 9163, 26131, 784, 3699, 225, 6507, 300, 15392, 225, 15605, 326, 12176, 2505, 2207, 10335, 4355, 261, 4930, 1771, 16, 2308, 707, 13, 358, 326, 3699, 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, 6764, 784, 67, 1650, 12, 1650, 4672, 9163, 26131, 784, 3699, 225, 6507, 300, 15392, 225, 15605, 326, 12176, 2505, 2207, 10335, 4355, 261, 4930, 1771, 16, 2308, 707, 13, 358, 326, 3699, 3...
name = cls._name or cls._inherit
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: for parent_name in ((type(parent_names)==list) and parent_names or [parent_names]): parent_class = pool.get(parent_name).__class__ assert pool.get(parent_name), "parent class %s does not exist in module %s !" % (parent_name, module) nattr = {} for s in ('_columns', '_defaults', '_inherits', '_constraints', '_sql_constraints'): new = copy.copy(getattr(pool.get(parent_name), s)) if hasattr(new, 'update'): new.update(cls.__dict__.get(s, {})) else: if s=='_constraints': for c in cls.__dict__.get(s, []): exist = False for c2 in range(len(new)): if new[c2][2]==c[2]: new[c2] = c exist = True break if not exist: new.append(c) else: new.extend(cls.__dict__.get(s, [])) nattr[s] = new name = cls._name or cls._inherit cls = type(name, (cls, parent_class), nattr) obj = object.__new__(cls) obj.__init__(pool, cr) return obj
e5af7c9c7364d03b834b40a8db9c862fcec1b270 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e5af7c9c7364d03b834b40a8db9c862fcec1b270/osv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20075, 12, 6429, 16, 2845, 16, 1605, 16, 4422, 4672, 982, 67, 1973, 273, 3869, 12, 6429, 16, 2070, 6018, 2187, 599, 13, 309, 982, 67, 1973, 30, 364, 982, 67, 529, 316, 14015, 723, 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, 20075, 12, 6429, 16, 2845, 16, 1605, 16, 4422, 4672, 982, 67, 1973, 273, 3869, 12, 6429, 16, 2070, 6018, 2187, 599, 13, 309, 982, 67, 1973, 30, 364, 982, 67, 529, 316, 14015, 723, 12...
with open(fullpath, 'wb') as filename:
filename = open(fullpath, 'wb') if filename is not None:
def newconfig(req): config = ConfigParser.ConfigParser() for (key, val) in req.form.items(): if len(key.split('/')) < 2: continue section = key.split('/')[0] option = key.split('/')[1] if section not in config.sections(): config.add_section(section) config.set(section, option, val) fullpath = os.path.join(os.path.dirname(__file__), 'pylxr.ini') with open(fullpath, 'wb') as filename: config.write(filename) return admin(req)
33fbfa9ea545404d829fff84c82ff33ab3a098c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8874/33fbfa9ea545404d829fff84c82ff33ab3a098c6/index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 1425, 12, 3658, 4672, 642, 273, 25076, 18, 809, 2678, 1435, 364, 261, 856, 16, 1244, 13, 316, 1111, 18, 687, 18, 3319, 13332, 309, 562, 12, 856, 18, 4939, 2668, 2473, 3719, 411, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 1425, 12, 3658, 4672, 642, 273, 25076, 18, 809, 2678, 1435, 364, 261, 856, 16, 1244, 13, 316, 1111, 18, 687, 18, 3319, 13332, 309, 562, 12, 856, 18, 4939, 2668, 2473, 3719, 411, ...
try:
if sys.version_info >= (2, 5):
def _fastsha1(s): # This function will import sha1 from hashlib or sha (whichever is # available) and overwrite itself with it on the first call. # Subsequent calls will go directly to the imported function. try: from hashlib import sha1 as _sha1 except ImportError: from sha import sha as _sha1 global _fastsha1, sha1 _fastsha1 = sha1 = _sha1 return _sha1(s)
b42f992325bd0dc976a0759d3fea7caa41e93c50 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/b42f992325bd0dc976a0759d3fea7caa41e93c50/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8076, 7819, 21, 12, 87, 4672, 468, 1220, 445, 903, 1930, 6056, 21, 628, 15956, 578, 6056, 261, 3350, 335, 580, 502, 353, 468, 2319, 13, 471, 6156, 6174, 598, 518, 603, 326, 1122, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8076, 7819, 21, 12, 87, 4672, 468, 1220, 445, 903, 1930, 6056, 21, 628, 15956, 578, 6056, 261, 3350, 335, 580, 502, 353, 468, 2319, 13, 471, 6156, 6174, 598, 518, 603, 326, 1122, ...
else: state = Size
else: if state: state = Size
def read(self, bs=-1, to=-1, state=False): # read until timeout if to < 0: # use regular sync I/O buff = self.reads(bs) if state: return (buff, Size) if len(buff) == bs else (buff, End) # "Size" might mean "Size | End" here else: return buff try: flags = fcntl.fcntl(self._fd, fcntl.F_GETFL) fcntl.fcntl(self._fd, fcntl.F_SETFL, flags | os.O_NONBLOCK) deadline = time() + to buff = buffer('') while bs: try: fd, event = self._poll_in.poll(to, 1)[0] # get first event, fd should be eq self._fd except IndexError: if state: state = Time break if event != EPOLLHUP: # some data or error present ext = self.reads(min(bs, self.bs_max) if bs > 0 else self.bs_default) # min() for G+ reads buff += ext if event & EPOLLHUP: # socket is closed on the other end if state: state = End break to = deadline - time() if to < 0: if state: state = Time break bs -= len(ext) else: state = Size # got bs bytes finally: try: fcntl.fcntl(self._fd, fcntl.F_SETFL, flags) # restore blocking state except: pass # in case there was an error, caused by wrong fd/pipe (not to raise another one) return buff if not state else (buff, state)
487542494589ee4f4c27b3e6eed87e04a39a5c58 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11594/487542494589ee4f4c27b3e6eed87e04a39a5c58/aexec.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 7081, 29711, 21, 16, 358, 29711, 21, 16, 919, 33, 8381, 4672, 468, 855, 3180, 2021, 309, 358, 411, 374, 30, 468, 999, 6736, 3792, 467, 19, 51, 6139, 273, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 7081, 29711, 21, 16, 358, 29711, 21, 16, 919, 33, 8381, 4672, 468, 855, 3180, 2021, 309, 358, 411, 374, 30, 468, 999, 6736, 3792, 467, 19, 51, 6139, 273, 365, 18, ...
a = np.empty((2,1), dtype=[(n, object) for n in ['one', 'two']]) a[0,0]['one'] = array(1) a[0,0]['two'] = array(2) a[1,0]['one'] = u'number 1' a[1,0]['two'] = u'number 2'
a = np.empty((1,2), dtype=[(n, object) for n in ['one', 'two']]) a[0,0]['one'] = mlarr(1) a[0,0]['two'] = mlarr(2) a[0,1]['one'] = array(u'number 1') a[0,1]['two'] = array(u'number 2')
def _rt_check_case(name, expected, format): mat_stream = StringIO() savemat(mat_stream, expected, format=format) mat_stream.seek(0) _check_case(name, [mat_stream], expected)
fe9ca17b08307388f64d4152ff758a527f5587c8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/fe9ca17b08307388f64d4152ff758a527f5587c8/test_mio.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3797, 67, 1893, 67, 3593, 12, 529, 16, 2665, 16, 740, 4672, 4834, 67, 3256, 273, 15777, 1435, 4087, 351, 270, 12, 7373, 67, 3256, 16, 2665, 16, 740, 33, 2139, 13, 4834, 67, 3256...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3797, 67, 1893, 67, 3593, 12, 529, 16, 2665, 16, 740, 4672, 4834, 67, 3256, 273, 15777, 1435, 4087, 351, 270, 12, 7373, 67, 3256, 16, 2665, 16, 740, 33, 2139, 13, 4834, 67, 3256...
elif layer_type == 'markers':
elif layer_type == 'collection':
def remove_layer(self,layer,raise_exception=True): ''' Remove a layer Required Arguments: *layer*: [ string ] The name of the layer to remove ''' if layer in self._layers: layer_type = self._layer_type(layer) if layer_type == 'contour': for contour in self._layers[layer].collections: contour.remove() self._layers.pop(layer) elif layer_type == 'markers': self._layers[layer].remove() else: if raise_exception: raise Exception("Layer "+layer+" does not exist") self.refresh()
4be50b8f84c7dc259a6bf5a0e76f94a71ee2c49b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13232/4be50b8f84c7dc259a6bf5a0e76f94a71ee2c49b/layers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 6363, 12, 2890, 16, 6363, 16, 11628, 67, 4064, 33, 5510, 4672, 9163, 3581, 279, 3018, 225, 10647, 13599, 30, 225, 380, 6363, 14, 30, 306, 533, 308, 1021, 508, 434, 326, 3018,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 6363, 12, 2890, 16, 6363, 16, 11628, 67, 4064, 33, 5510, 4672, 9163, 3581, 279, 3018, 225, 10647, 13599, 30, 225, 380, 6363, 14, 30, 306, 533, 308, 1021, 508, 434, 326, 3018,...
print "* som+som :", rebin_monitor(som1, som2, type="linint") print "* som+som :", rebin_monitor(som1, som2, type="frac")
print "* som+som :", rebin_monitor(som1, som2, rtype="linint") print "* som+som :", rebin_monitor(som1, som2, rtype="frac")
def rebin_monitor(obj1, obj2, **kwargs): """ This function takes objects (1st is the monitor, 2nd is the detector data) and rebins the data for obj1 onto the axis provided by obj2. The pixel ID can be transferred as the pixel ID of the rebinned monitor histogram. A prefix is placed on the bank ID to dilineate that this is a rebinned monitor spectrum for that pixel. @param obj1: Monitor object that will be rebinned @type obj1: C{SOM.SOM} or C{SOM.SO} @param obj2: Detector data object that will provide the axis for rebinning @type obj2: C{SOM.SOM} or C{SOM.SO} @param kwargs: A list of keyword arguments that the function accepts @keyword use_pix_id: A flag that specifies if the pixel ID is to be used in the rebinned monitor spectrum. The default is I{False}. @type use_pix_id: C{boolean} @keyword prefix: Allows one to specify a prefix for the bank ID. The default is I{m}. @type prefix: C{string} @keyword interpolate: A flag to use linear interpolation during rebinning. The default is I{False}. @type interpolate: C{boolean} @return: Object that has been rebinned @rtype: C{SOM.SOM} or C{SOM.SO} @raise TypeError: The C{SOM}-C{SO} operation is attempted @raise TypeError: The C{SO}-C{SOM} operation is attempted @raise TypeError: obj1 not a C{SOM} or C{SO} @raise TypeError: obj2 not a C{SOM} or C{SO} """ # import the helper functions import hlr_utils # Kickout if monitor object is None if obj1 is None: return obj1 # set up for working through data (result, res_descr) = hlr_utils.empty_result(obj1, obj2) (o1_descr, o2_descr) = hlr_utils.get_descr(obj1, obj2) # error checking for types if o1_descr == "SOM" and o2_descr == "SO": raise TypeError, "SOM-SO operation not supported" elif o1_descr == "SO" and o2_descr == "SOM": raise TypeError("SO-SOM operation not supported") # Have the right object combination, go on else: pass # Check for keywords try: prefix = kwargs["prefix"] except KeyError: prefix = "m" try: use_pix_id = kwargs["use_pix_id"] except KeyError: use_pix_id = False try: type = kwargs["type"] except KeyError: type = None # Set the name of the rebinning function rebin_function_name = "rebin_axis_1D" if type is not None: rebin_function_name += "_" + str(type) # Get function pointer import common_lib rebin_function = common_lib.__getattribute__(rebin_function_name) result = hlr_utils.copy_som_attr(result, res_descr, obj1, o1_descr) # iterate through the values val1 = hlr_utils.get_value(obj1, 0, o1_descr, "all") # Cache length len_obj2 = hlr_utils.get_length(obj2) for i in xrange(len_obj2): val2 = hlr_utils.get_value(obj2, i, o2_descr, "x") value = rebin_function(val1, val2) if use_pix_id: # Set the pixel ID to the spectrum with modified bank ID try: value.id = (prefix+obj2[i].id[0], (obj2[i].id[1][0], obj2[i].id[1][1])) except TypeError: value.id = prefix+str(obj2[i].id) hlr_utils.result_insert(result, res_descr, value, None, "all") return result
bbfa4f6aa6e8c2caf972878eed3bcef594b43d30 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/763/bbfa4f6aa6e8c2caf972878eed3bcef594b43d30/hlr_rebin_monitor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 283, 4757, 67, 10259, 12, 2603, 21, 16, 1081, 22, 16, 2826, 4333, 4672, 3536, 1220, 445, 5530, 2184, 261, 21, 334, 353, 326, 6438, 16, 576, 4880, 353, 326, 13826, 501, 13, 471, 283, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 283, 4757, 67, 10259, 12, 2603, 21, 16, 1081, 22, 16, 2826, 4333, 4672, 3536, 1220, 445, 5530, 2184, 261, 21, 334, 353, 326, 6438, 16, 576, 4880, 353, 326, 13826, 501, 13, 471, 283, ...
else: cwd = os.getcwd() if cwd not in sys.path: sys.path.insert(0, cwd)
def StartServer(args, fchdir, pwd, fAllowUnencrypted, fAllowRemote, rid): global g_server global g_debugger try: ExpandedFilename = FindFile(args[0]) except IOError: print 'File', args[0], ' not found.' if fchdir: # # Insert script directory in front of file search path # sys.path.insert(0, os.path.dirname(ExpandedFilename)) os.chdir(os.path.dirname(ExpandedFilename)) else: cwd = os.getcwd() if cwd not in sys.path: sys.path.insert(0, cwd) sys.argv = args d = {} d['__builtins__'] = __main__.__dict__['__builtins__'] d['__name__'] = '__main__' d['__file__'] = ExpandedFilename d['__doc__'] = None g_debugger = CDebuggerEngine() g_server = CDebuggeeServer(ExpandedFilename, g_debugger, pwd, fAllowUnencrypted, fAllowRemote, rid) g_server.start() g_debugger.m_bp_manager.set_temp_breakpoint(ExpandedFilename, '', 1, fhard = True) g_debugger.settrace() execfile(ExpandedFilename, d, d) #g_debugger.stoptrace() #g_server.stop()
e58ec14488106ff6eaa496be0292371256110444 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9402/e58ec14488106ff6eaa496be0292371256110444/rpdb2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3603, 2081, 12, 1968, 16, 284, 343, 1214, 16, 14720, 16, 284, 7009, 984, 18702, 16, 284, 7009, 5169, 16, 10911, 4672, 2552, 314, 67, 3567, 2552, 314, 67, 4148, 693, 225, 775, 30, 7784,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3603, 2081, 12, 1968, 16, 284, 343, 1214, 16, 14720, 16, 284, 7009, 984, 18702, 16, 284, 7009, 5169, 16, 10911, 4672, 2552, 314, 67, 3567, 2552, 314, 67, 4148, 693, 225, 775, 30, 7784,...
_logger.debug("set cloud for %s" % job.taskID)
_logger.debug("%s set cloud for %s" % (self.timestamp,job.taskID))
def _correctLFN(self): lfnMap = {} valMap = {} prodError = {} missingDS = {} jobsWaiting = [] jobsFailed = [] jobsProcessed = [] allLFNs = {} allGUIDs = {} cloudMap = {} replicaMap = {} for job in self.jobs: if self.onlyTA: _logger.debug("%s start TA session %s" % (self.timestamp,job.taskID)) # check if sitename is known if job.computingSite != 'NULL' and (not job.computingSite in self.siteMapper.siteSpecList.keys()): job.jobStatus = 'failed' job.ddmErrorCode = ErrorCode.EC_Setupper job.ddmErrorDiag = "computingSite:%s is unknown" % job.computingSite # append job for downstream process jobsProcessed.append(job) # error message for TA if self.onlyTA: _logger.error("%s %s" % (self.timestamp,job.ddmErrorDiag)) continue # ignore no prodDBlock jobs or container dataset if job.prodDBlock == 'NULL': # set cloud if panda_config.enableDynamicTA and job.prodSourceLabel in ['managed','validation'] \ and job.cloud in ['NULL',''] and (not job.taskID in [None,'NULL',0]): # look into map to check if it is already gotten if not cloudMap.has_key(job.taskID): # instantiate TaskAssigner cloudResolver = TaskAssigner.TaskAssigner(self.taskBuffer,self.siteMapper, job.taskID,job.prodSourceLabel) # check cloud _logger.debug("check cloud for %s" % job.taskID) retCloud = cloudResolver.checkCloud() _logger.debug("checkCloud() -> %s" % retCloud) # failed if retCloud == None: _logger.error("failed to check cloud for %s" % job.taskID) # append job to waiting list jobsWaiting.append(job) continue # to be set elif retCloud == "": # collect LFN/GUID tmpLFNs = [] tmpGUIDs = [] # set cloud _logger.debug("set cloud for %s" % job.taskID) retCloud = cloudResolver.setCloud(tmpLFNs,tmpGUIDs,metadata=job.metadata) _logger.debug("setCloud() -> %s" % retCloud) if retCloud == None: _logger.error("failed to set cloud for %s" % job.taskID) # append job to waiting list jobsWaiting.append(job) continue # append to map cloudMap[job.taskID] = retCloud # set cloud job.cloud = cloudMap[job.taskID] # message for TA if self.onlyTA: _logger.debug("%s set %s:%s" % (self.timestamp,job.taskID,job.cloud)) # append job to processed list jobsProcessed.append(job) continue # collect datasets datasets = [] for file in job.Files: if file.type == 'input' and file.dispatchDBlock == 'NULL' \ and file.GUID == 'NULL': #and (file.GUID == 'NULL' or re.search('\.(\d+)$',file.lfn) == None): datasets.append(file.dataset) # get LFN list for dataset in datasets: if not dataset in lfnMap.keys(): prodError[dataset] = '' lfnMap[dataset] = {} # get LFNs time.sleep(1) for iDDMTry in range(3): _logger.debug(('listFilesInDataset',dataset)) status,out = ddm.DQ2.main('listFilesInDataset',dataset) if out.find("DQUnknownDatasetException") != -1: break elif status != 0 or out.find("DQ2 internal server exception") != -1 \ or out.find("An error occurred on the central catalogs") != -1 \ or out.find("MySQL server has gone away") != -1 \ or out == '()': time.sleep(60) else: break if status != 0 or out.startswith('Error'): _logger.error(out) prodError[dataset] = 'could not get file list of prodDBlock %s' % dataset _logger.error(prodError[dataset]) # doesn't exist in DQ2 if out.find('DQUnknownDatasetException') != -1: missingDS[dataset] = "DS:%s not found in DQ2" % dataset else: # make map (key: LFN w/o attemptNr, value: LFN with attemptNr) items = {} try: exec "items = %s[0]" % out for guid,vals in items.iteritems(): valMap[vals['lfn']] = {'guid' : guid, 'fsize' : vals['filesize'], 'md5sum' : vals['checksum'], 'chksum' : vals['checksum']} genLFN = re.sub('\.\d+$','',vals['lfn']) if lfnMap[dataset].has_key(genLFN): # get attemptNr newAttNr = 0 newMat = re.search('\.(\d+)$',vals['lfn']) if newMat != None: newAttNr = int(newMat.group(1)) oldAttNr = 0 oldMat = re.search('\.(\d+)$',lfnMap[dataset][genLFN]) if oldMat != None: oldAttNr = int(oldMat.group(1)) # compare if newAttNr > oldAttNr: lfnMap[dataset][genLFN] = vals['lfn'] else: lfnMap[dataset][genLFN] = vals['lfn'] except: prodError[dataset] = 'could not convert HTTP-res to map for prodDBlock %s' % dataset _logger.error(prodError[dataset]) _logger.error(out) # get replica locations if self.onlyTA and prodError[dataset] == '' and (not replicaMap.has_key(dataset)): for iDDMTry in range(3): _logger.debug(('listDatasetReplicas',dataset)) status,out = ddm.DQ2.main('listDatasetReplicas',dataset,0,None,False) if status != 0 or out.find("DQ2 internal server exception") != -1 \ or out.find("An error occurred on the central catalogs") != -1 \ or out.find("MySQL server has gone away") != -1 \ or out == '()': time.sleep(60) else: break if status != 0 or out.startswith('Error'): prodError[dataset] = 'could not get locations for %s' % dataset _logger.error(prodError[dataset]) _logger.error(out) else: tmpRepSites = {} try: # convert res to map exec "tmpRepSites = %s" % out replicaMap[dataset] = tmpRepSites except: prodError[dataset] = 'could not convert HTTP-res to replica map for %s' % dataset _logger.error(prodError[dataset]) _logger.error(out) # error isFailed = False # check for failed for dataset in datasets: if missingDS.has_key(dataset): job.jobStatus = 'failed' job.ddmErrorCode = ErrorCode.EC_GUID job.ddmErrorDiag = missingDS[dataset] # set missing for tmpFile in job.Files: if tmpFile.dataset == dataset: tmpFile.status = 'missing' # append jobsFailed.append(job) isFailed = True # message for TA if self.onlyTA: _logger.error("%s %s" % (self.timestamp,missingDS[dataset])) else: _logger.debug("%s %s failed with %s" % (self.timestamp,job.PandaID,missingDS[dataset])) break if isFailed: continue # check for waiting for dataset in datasets: if prodError[dataset] != '': # append job to waiting list jobsWaiting.append(job) isFailed = True # message for TA if self.onlyTA: _logger.error("%s %s" % (self.timestamp,prodError[dataset])) break if isFailed: continue # set cloud if panda_config.enableDynamicTA and job.prodSourceLabel in ['managed','validation'] \ and job.cloud in ['NULL',''] and (not job.taskID in [None,'NULL',0]): # look into map to check if it is already gotten if not cloudMap.has_key(job.taskID): # instantiate TaskAssigner cloudResolver = TaskAssigner.TaskAssigner(self.taskBuffer,self.siteMapper, job.taskID,job.prodSourceLabel) # check cloud _logger.debug("check cloud for %s" % job.taskID) retCloud = cloudResolver.checkCloud() _logger.debug("checkCloud() -> %s" % retCloud) # failed if retCloud == None: _logger.error("failed to check cloud for %s" % job.taskID) # append job to waiting list jobsWaiting.append(job) continue # to be set elif retCloud == "": # collect LFN/GUID tmpLFNs = [] tmpGUIDs = [] tmpReLoc = {} for dataset in datasets: # get LFNs eachDSLFNs = lfnMap[dataset].values() tmpLFNs += eachDSLFNs # get GUIDs for oneLFN in eachDSLFNs: tmpGUIDs.append(valMap[oneLFN]['guid']) # locations tmpReLoc[dataset] = replicaMap[dataset] # set cloud _logger.debug("set cloud for %s" % job.taskID) retCloud = cloudResolver.setCloud(tmpLFNs,tmpGUIDs,tmpReLoc,metadata=job.metadata) _logger.debug("setCloud() -> %s" % retCloud) if retCloud == None: _logger.error("failed to set cloud for %s" % job.taskID) # append job to waiting list jobsWaiting.append(job) continue # append to map cloudMap[job.taskID] = retCloud # set cloud job.cloud = cloudMap[job.taskID] # message for TA if self.onlyTA: _logger.debug("%s set %s:%s" % (self.timestamp,job.taskID,job.cloud)) # replace generic LFN with real LFN replaceList = [] isFailed = False for file in job.Files: if file.type == 'input' and file.dispatchDBlock == 'NULL' \ and file.GUID == 'NULL': #and (file.GUID == 'NULL' or re.search('\.(\d+)$',file.lfn) == None): # get LFN w/o attemptNr basename = re.sub('\.\d+$','',file.lfn) if basename == file.lfn: # replace if basename in lfnMap[file.dataset].keys(): file.lfn = lfnMap[file.dataset][basename] replaceList.append((basename,file.lfn)) # set GUID if file.lfn in valMap: file.GUID = valMap[file.lfn]['guid'] file.fsize = valMap[file.lfn]['fsize'] file.md5sum = valMap[file.lfn]['md5sum'] file.checksum = valMap[file.lfn]['chksum'] # remove white space if file.md5sum != None: file.md5sum = file.md5sum.strip() if file.checksum != None: file.checksum = file.checksum.strip() else: # append job to waiting list errMsg = "GUID for %s not found in DQ2" % file.lfn _logger.debug(errMsg) file.status = 'missing' job.jobStatus = 'failed' job.ddmErrorCode = ErrorCode.EC_GUID job.ddmErrorDiag = errMsg jobsFailed.append(job) isFailed = True break # add to allLFNs/allGUIDs if not allLFNs.has_key(job.cloud): allLFNs[job.cloud] = [] if not allGUIDs.has_key(job.cloud): allGUIDs[job.cloud] = [] allLFNs[job.cloud].append(file.lfn) allGUIDs[job.cloud].append(file.GUID) # modify jobParameters if not isFailed: for patt,repl in replaceList: job.jobParameters = re.sub('%s ' % patt, '%s ' % repl, job.jobParameters) # append job to processed list jobsProcessed.append(job) # return if TA only if self.onlyTA: _logger.debug("%s end TA sessions" % self.timestamp) return # get missing LFNs from source LRC/LFC missLFNs = {} for cloudKey in allLFNs.keys(): # use BNL by default dq2URL = self.siteMapper.getSite('BNL_ATLAS_1').dq2url dq2SE = [] # use cloud's source if self.siteMapper.checkCloud(cloudKey): tmpSrcID = self.siteMapper.getCloud(cloudKey)['source'] tmpSrcSite = self.siteMapper.getSite(tmpSrcID) # get LRC/LFC URL if not tmpSrcSite.lfchost in [None,'']: # LFC dq2URL = 'lfc://'+tmpSrcSite.lfchost+':/grid/atlas/' if tmpSrcSite.se != None: for tmpSrcSiteSE in tmpSrcSite.se.split(','): match = re.search('.+://([^:/]+):*\d*/*',tmpSrcSiteSE) if match != None: dq2SE.append(match.group(1)) else: # LRC dq2URL = tmpSrcSite.dq2url dq2SE = [] # get missing files tmpMissLFNs = brokerage.broker_util.getMissLFNsFromLRC(allLFNs[cloudKey],dq2URL,allGUIDs[cloudKey],dq2SE) # append if not missLFNs.has_key(cloudKey): missLFNs[cloudKey] = [] missLFNs[cloudKey] += tmpMissLFNs _logger.debug('missLFNs %s' % missLFNs) # check if files in source LRC/LFC tmpJobList = tuple(jobsProcessed) for job in tmpJobList: # check only production/test jobs if not job.prodSourceLabel in ['managed','test','software']: continue missingFlag = False for file in job.Files: if file.type == 'input': if missLFNs.has_key(job.cloud) and file.lfn in missLFNs[job.cloud]: # set file status file.status = 'missing' # remove job not to process further if not missingFlag: missingFlag = True jobsProcessed.remove(job) # revert for oJob in self.jobs: if oJob.PandaID == job.PandaID: jobsWaiting.append(oJob) break # send jobs to jobsWaiting self.taskBuffer.keepJobs(jobsWaiting) # update failed job self.taskBuffer.updateJobs(jobsFailed,True) # remove waiting/failed jobs self.jobs = jobsProcessed # delete huge variables del lfnMap del valMap del prodError del jobsWaiting del jobsProcessed del allLFNs del allGUIDs del cloudMap del missLFNs
4e25ff459b78e50b61ea2614281204d0c39c6fc9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7525/4e25ff459b78e50b61ea2614281204d0c39c6fc9/Setupper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6746, 9105, 50, 12, 2890, 4672, 328, 4293, 863, 273, 2618, 1244, 863, 273, 2618, 10791, 668, 273, 2618, 3315, 3948, 273, 2618, 6550, 15946, 282, 273, 5378, 6550, 2925, 565, 273, 537...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6746, 9105, 50, 12, 2890, 4672, 328, 4293, 863, 273, 2618, 1244, 863, 273, 2618, 10791, 668, 273, 2618, 3315, 3948, 273, 2618, 6550, 15946, 282, 273, 5378, 6550, 2925, 565, 273, 537...
elif f in ["pre-upgrade", "pre-install", "post-upgrade", "post-install"]: files.append((f, self.packageInfo["Title"]+"."+f)) elif f[-8:] == "-upgrade":
elif basename(f) in ["pre_upgrade", "pre_install", "post_upgrade", "post_install"]: files.append((f, packageName+"."+basename(f))) elif basename(f) in ["preflight", "postflight"]: files.append((f, f)) elif f[-8:] == "_upgrade":
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
3bd8d0fb9c153552cd2593ecdeb80023b7776930 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3bd8d0fb9c153552cd2593ecdeb80023b7776930/buildpkg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 3805, 12, 2890, 4672, 315, 986, 678, 16312, 19, 1994, 4667, 19, 13211, 1390, 16, 263, 80, 17995, 9907, 471, 8873, 1199, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 3805, 12, 2890, 4672, 315, 986, 678, 16312, 19, 1994, 4667, 19, 13211, 1390, 16, 263, 80, 17995, 9907, 471, 8873, 1199, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100...
script +='. ${LHCBSCRIPTS}/SetupProject.sh %s %s %s\n'\ % (opts, pack, ver)
useflag = '' try: if(gaudiapp.masterpackage): (mpack, malg, mver) = parse_master_package(gaudiapp.masterpackage) useflag = '\"--use %s %s %s\"' % (malg, mver, mpack) except AttributeError: pass script +='. ${LHCBSCRIPTS}/SetupProject.sh %s %s %s %s\n'\ % (useflag, opts, pack, ver)
def gaudishell_setenv(gaudiapp): # generate shell script ver=gaudiapp.version pack=gaudiapp.appname opts = gaudiapp.setupProjectOptions import tempfile fd=tempfile.NamedTemporaryFile() script = '#!/bin/sh\n' try: script +='User_release_area=%s; export User_release_area\n' % \ expandfilename(gaudiapp.user_release_area) except AttributeError: pass script +='. ${LHCBSCRIPTS}/SetupProject.sh %s %s %s\n'\ % (opts, pack, ver) fd.write(script) fd.flush() logger.debug(script) s = Shell(setup=fd.name) logger.debug(pprint.pformat(s.env)) return s
768aad10b42b5ebeb7f42a3213fad1e652165f0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/768aad10b42b5ebeb7f42a3213fad1e652165f0d/GaudiUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18812, 1100, 1468, 1165, 67, 542, 3074, 12, 15833, 1100, 77, 2910, 4672, 468, 2103, 5972, 2728, 1924, 33, 15833, 1100, 77, 2910, 18, 1589, 2298, 33, 15833, 1100, 77, 2910, 18, 2910, 529,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18812, 1100, 1468, 1165, 67, 542, 3074, 12, 15833, 1100, 77, 2910, 4672, 468, 2103, 5972, 2728, 1924, 33, 15833, 1100, 77, 2910, 18, 1589, 2298, 33, 15833, 1100, 77, 2910, 18, 2910, 529,...
return LicornWarningsDB.__warningsdb.keys()
return LicornWarningsDB.warnings.keys() __warningsdb = LicornWarningsDB()
def keys(self): return LicornWarningsDB.__warningsdb.keys()
d8c442069578889b69b79afa468b9dad5c33eb87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/d8c442069578889b69b79afa468b9dad5c33eb87/logging.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1311, 12, 2890, 4672, 327, 511, 335, 14245, 4312, 2290, 16186, 12103, 1966, 18, 2452, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1311, 12, 2890, 4672, 327, 511, 335, 14245, 4312, 2290, 16186, 12103, 1966, 18, 2452, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
try:
if old:
def __calc_date_time(self): # Set self.__date_time, self.__date, & self.__time by using # time.strftime().
62fe75509c905bee1181fed9b6714e0de27ff5d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62fe75509c905bee1181fed9b6714e0de27ff5d4/_strptime.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12448, 67, 712, 67, 957, 12, 2890, 4672, 468, 1000, 365, 16186, 712, 67, 957, 16, 365, 16186, 712, 16, 473, 365, 16186, 957, 635, 1450, 468, 813, 18, 701, 9982, 7675, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12448, 67, 712, 67, 957, 12, 2890, 4672, 468, 1000, 365, 16186, 712, 67, 957, 16, 365, 16186, 712, 16, 473, 365, 16186, 957, 635, 1450, 468, 813, 18, 701, 9982, 7675, 2, -100, ...
company = user_obj.browse(cursor, user, user, context=context) self.write(cursor, user, res, { 'company': company.id,
user = user_obj.browse(cursor, user_id, user_id, context=context) self.write(cursor, user_id, res, { 'company': user.company.id,
def set(self, cursor, user, name, model, res_id, val, context=None): res = super(Property, self).set(cursor, user, name, model, res_id, val, context=context) if res: user_obj = self.pool.get('res.user') company = user_obj.browse(cursor, user, user, context=context) self.write(cursor, user, res, { 'company': company.id, }, context=context) return res
1fc1f8bc7d5cb40353357ee0ce725855e61b6391 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9291/1fc1f8bc7d5cb40353357ee0ce725855e61b6391/company.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12, 2890, 16, 3347, 16, 729, 16, 508, 16, 938, 16, 400, 67, 350, 16, 1244, 16, 819, 33, 7036, 4672, 400, 273, 2240, 12, 1396, 16, 365, 2934, 542, 12, 9216, 16, 729, 16, 508, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 16, 3347, 16, 729, 16, 508, 16, 938, 16, 400, 67, 350, 16, 1244, 16, 819, 33, 7036, 4672, 400, 273, 2240, 12, 1396, 16, 365, 2934, 542, 12, 9216, 16, 729, 16, 508, ...
except ProgrammerError, err: raise xmlrpclib.Fault(100, "GENIOpError: Internal GENI Error! Recieved a ProgrammerError while calling interface.acquire_vessels. Details: " + str(err))
def acquire_resources(auth, rspec): """ <Purpose> Acquires resources for users over XMLRPC. <Arguments> auth An authorization dict of the form {'username':username, 'password':password} rspec A resource specificiation dict of the form {'rspec_type':type, 'number_of_nodes':num} <Exceptions> Raises xmlrpclib Fault objects: 100, "GENIOpError" for internal errors. 103, "GENINotEnoughCredits" if user has insufficient vessel credits to complete request. <Returns> A list of 'info' dictionaries, each 'infodict' contains acquired vessel info. """ geni_user = _auth(auth) resource_type = rspec['rspec_type'] num_vessels = rspec['number_of_nodes'] acquired_vessels = [] # validate rspec data if not isinstance(resource_type, str) or not isinstance(num_vessels, int): raise xmlrpclib.Fault(102, "GENIInvalidUserInput: rspec has invalid data types.") if (resource_type != "lan" and resource_type != "wan" and \ resource_type != "random") or num_vessels < 1: raise xmlrpclib.Fault(102, "GENIInvalidUserInput: rspec has invalid values.") # since acquired_vessels expects rand instead of random if resource_type == 'random': resource_type = 'rand' try: acquired_vessels = interface.acquire_vessels(geni_user, num_vessels, resource_type) except DoesNotExistError: raise xmlrpclib.Fault(100, "GENIOpError: Internal GENI Error! Recieved a DoesNotExistError while calling interface.acquire_vessels") except UnableToAcquireResourcesError, err: raise xmlrpclib.Fault(100, "GENIOpError: Internal GENI Error! Unable to fulfill vessel acquire request at this given time. Please try again later.") except InsufficientUserResourcesError, err: raise xmlrpclib.Fault(103, "GENINotEnoughCredits: You do not have enough vessel credits to acquire the number of vessels requested.") except ProgrammerError, err: raise xmlrpclib.Fault(100, "GENIOpError: Internal GENI Error! Recieved a ProgrammerError while calling interface.acquire_vessels. Details: " + str(err)) # since acquire_vessels returns a list of Vessel objects, we # need to convert them into a list of 'info' dictionaries. return interface.get_vessel_infodict_list(acquired_vessels)
f18ee9fdda2c7ff2bc524b991ff88cb6c55b98e8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/f18ee9fdda2c7ff2bc524b991ff88cb6c55b98e8/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10533, 67, 4683, 12, 1944, 16, 436, 2793, 4672, 3536, 411, 10262, 4150, 34, 12848, 4138, 2703, 364, 3677, 1879, 3167, 8087, 18, 411, 4628, 34, 1357, 1922, 6093, 2065, 434, 326, 646, 1366...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10533, 67, 4683, 12, 1944, 16, 436, 2793, 4672, 3536, 411, 10262, 4150, 34, 12848, 4138, 2703, 364, 3677, 1879, 3167, 8087, 18, 411, 4628, 34, 1357, 1922, 6093, 2065, 434, 326, 646, 1366...
(os.getenv('APPDATA', ''), 'Microsoft', 'Windows', 'History', 'Low',
(os.getenv('APPDATA', False), 'Microsoft', 'Windows', 'History', 'Low',
def InternetExplorerHistoryPath(self): paths = ( # XP (os.getenv('USERPROFILE', ''), 'Local Settings', 'History', 'History.IE5', 'index.dat'), (os.getenv('APPDATA', ''), 'Microsoft', 'Windows', 'History', 'History.IE5', 'index.dat'), (os.getenv('APPDATA', ''), 'Microsoft', 'Windows', 'History', 'Low', 'History.IE5', 'index.dat'), ) return paths
1647d5424a70f624d0cd52eb19742058f6087530 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4170/1647d5424a70f624d0cd52eb19742058f6087530/history_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21352, 20938, 5623, 743, 12, 2890, 4672, 2953, 273, 261, 468, 1139, 52, 261, 538, 18, 588, 3074, 2668, 4714, 22462, 2187, 875, 3631, 296, 2042, 8709, 2187, 296, 5623, 2187, 296, 5623, 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, 21352, 20938, 5623, 743, 12, 2890, 4672, 2953, 273, 261, 468, 1139, 52, 261, 538, 18, 588, 3074, 2668, 4714, 22462, 2187, 875, 3631, 296, 2042, 8709, 2187, 296, 5623, 2187, 296, 5623, 18...
release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
if (major, minor) >= (10, 4): major,minor,patch = _mac_ver_lookup(('sys1','sys2','sys3')) release = '%i.%i.%i' %(major, minor, patch) else: release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
def mac_ver(release='',versioninfo=('','',''),machine=''): """ Get MacOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the paramter values which default to ''. All tuple entries are strings. Thanks to Mark R. Levinson for mailing documentation links and code examples for this function. Documentation for the gestalt() API is available online at: http://www.rgaros.nl/gestalt/ """ # Check whether the version info module is available try: import gestalt import MacOS except ImportError: return release,versioninfo,machine # Get the infos sysv,sysu,sysa = _mac_ver_lookup(('sysv','sysu','sysa')) # Decode the infos if sysv: major = (sysv & 0xFF00) >> 8 minor = (sysv & 0x00F0) >> 4 patch = (sysv & 0x000F) release = '%s.%i.%i' % (_bcd2str(major),minor,patch) if sysu: major = int((sysu & 0xFF000000L) >> 24) minor = (sysu & 0x00F00000) >> 20 bugfix = (sysu & 0x000F0000) >> 16 stage = (sysu & 0x0000FF00) >> 8 nonrel = (sysu & 0x000000FF) version = '%s.%i.%i' % (_bcd2str(major),minor,bugfix) nonrel = _bcd2str(nonrel) stage = {0x20:'development', 0x40:'alpha', 0x60:'beta', 0x80:'final'}.get(stage,'') versioninfo = (version,stage,nonrel) if sysa: machine = {0x1: '68k', 0x2: 'PowerPC', 0xa: 'i386'}.get(sysa,'') return release,versioninfo,machine
c27b8b88e33e392444a05cce74da9080e3ae5b5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/c27b8b88e33e392444a05cce74da9080e3ae5b5b/platform.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5318, 67, 502, 12, 9340, 2218, 2187, 1589, 1376, 33, 2668, 17023, 2187, 6309, 3631, 9149, 2218, 11, 4672, 225, 3536, 968, 13217, 4618, 1177, 1779, 471, 327, 518, 487, 3193, 261, 9340, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5318, 67, 502, 12, 9340, 2218, 2187, 1589, 1376, 33, 2668, 17023, 2187, 6309, 3631, 9149, 2218, 11, 4672, 225, 3536, 968, 13217, 4618, 1177, 1779, 471, 327, 518, 487, 3193, 261, 9340, 16...
self.failUnless(c >= 0)
self.failUnless(c >= 0 or c == -1)
def test_get_default_input_id(self):
0d0cca67108feaa7810ce5497797000d19f5b226 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1298/0d0cca67108feaa7810ce5497797000d19f5b226/midi_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 67, 1886, 67, 2630, 67, 350, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 67, 1886, 67, 2630, 67, 350, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
snoozeButton = wx.Button(self, -1, _(u"Snooze 5 minutes"))
snoozeButton = wx.Button(panel, -1, _(u"Snooze 5 minutes"))
def __init__(self, parent, ID, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP):
174f25b0a73f7ac1ec721bddd40bc7cb00ac6fe1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/174f25b0a73f7ac1ec721bddd40bc7cb00ac6fe1/ReminderDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 1599, 16, 963, 33, 27226, 18, 1868, 1225, 16, 949, 33, 27226, 18, 1868, 2555, 16, 2154, 33, 27226, 18, 5280, 67, 2565, 18683, 67, 15066, 571, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 1599, 16, 963, 33, 27226, 18, 1868, 1225, 16, 949, 33, 27226, 18, 1868, 2555, 16, 2154, 33, 27226, 18, 5280, 67, 2565, 18683, 67, 15066, 571, ...
self._do_permission_list()
user = None if len(arg) > 1: user = arg[1] self._do_permission_list(user)
def do_permission(self, line): arg = self.arg_tokenize(line) try: if arg[0] == 'list': self._do_permission_list() elif arg[0] == 'add' and len(arg) >= 3: user = arg[1] for action in arg[2:]: self._do_permission_add(user, action) elif arg[0] == 'remove' and len(arg) >= 3: user = arg[1] for action in arg[2:]: self._do_permission_remove(user, action) else: self.do_help ('permission') except Exception, e: print 'Permission %s failed:' % arg[0], e
f0b94a4d6118ce9fb52cb80a33011939295ee5ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f0b94a4d6118ce9fb52cb80a33011939295ee5ef/admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 9827, 12, 2890, 16, 980, 4672, 1501, 273, 365, 18, 3175, 67, 2316, 554, 12, 1369, 13, 775, 30, 309, 1501, 63, 20, 65, 225, 422, 296, 1098, 4278, 729, 273, 599, 309, 562, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 9827, 12, 2890, 16, 980, 4672, 1501, 273, 365, 18, 3175, 67, 2316, 554, 12, 1369, 13, 775, 30, 309, 1501, 63, 20, 65, 225, 422, 296, 1098, 4278, 729, 273, 599, 309, 562, 1...
def testReenderingConcatenatesInline(self):
def testRenderingConcatenatesInline(self):
def testReenderingConcatenatesInline(self): self.tool.registerStylesheet('test_rr_1.css', rendering='inline') self.tool.registerStylesheet('test_rr_2.css', rendering='inline') view = self.portal.restrictedTraverse('@@plone') viewletmanager = getMultiAdapter((self.portal, self.portal.REQUEST, view), IContentProvider, name = u'plone.resourceregistries.styles') viewletmanager.update() all = viewletmanager.render() self.failUnless('background-color' in all) self.failUnless('blue' in all)
d6ab487f5e0841e6fa7c20e359f94d88f51c4fef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12274/d6ab487f5e0841e6fa7c20e359f94d88f51c4fef/testCSSRegistry.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 14261, 21432, 815, 10870, 12, 2890, 4672, 365, 18, 6738, 18, 4861, 24656, 2668, 3813, 67, 523, 67, 21, 18, 5212, 2187, 9782, 2218, 10047, 6134, 365, 18, 6738, 18, 4861, 24656, 2668...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14261, 21432, 815, 10870, 12, 2890, 4672, 365, 18, 6738, 18, 4861, 24656, 2668, 3813, 67, 523, 67, 21, 18, 5212, 2187, 9782, 2218, 10047, 6134, 365, 18, 6738, 18, 4861, 24656, 2668...
if el < 0: el=t32-el
def history(self, oid, version=None, length=1, filter=None): self._lock_acquire() try: r=[] file=self._file seek=file.seek read=file.read pos=self._index[oid] wantver=version
e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 12, 2890, 16, 7764, 16, 1177, 33, 7036, 16, 769, 33, 21, 16, 1034, 33, 7036, 4672, 365, 6315, 739, 67, 1077, 1039, 1435, 775, 30, 436, 33, 8526, 585, 33, 2890, 6315, 768, 6520,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 12, 2890, 16, 7764, 16, 1177, 33, 7036, 16, 769, 33, 21, 16, 1034, 33, 7036, 4672, 365, 6315, 739, 67, 1077, 1039, 1435, 775, 30, 436, 33, 8526, 585, 33, 2890, 6315, 768, 6520,...
if not self.frame.IsShown(): self.frame.Show(True) else: self.frame.Show(False)
if self.frame.IsShown(): self.frame.Show(False)
def onCancelTaskBarActivate(self, evt): if self.frame.IsIconized(): self.frame.Iconize(False) else: self.frame.Iconize(True) if not self.frame.IsShown(): self.frame.Show(True) else: self.frame.Show(False) self.frame.Raise()
fb2463a9b2a875dc99ba4d4005ce70152f6cbab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3004/fb2463a9b2a875dc99ba4d4005ce70152f6cbab9/TrayIcon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 6691, 2174, 5190, 21370, 12, 2890, 16, 6324, 4672, 309, 365, 18, 3789, 18, 2520, 5554, 1235, 13332, 365, 18, 3789, 18, 5554, 554, 12, 8381, 13, 469, 30, 365, 18, 3789, 18, 5554, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 6691, 2174, 5190, 21370, 12, 2890, 16, 6324, 4672, 309, 365, 18, 3789, 18, 2520, 5554, 1235, 13332, 365, 18, 3789, 18, 5554, 554, 12, 8381, 13, 469, 30, 365, 18, 3789, 18, 5554, ...
self.path.pop()
if name=="alternate_names": for alt in self.altlist.split(', '): if alt: self.model.add_lang(self.curr_iso,Lang(alt,False)) self.altlist = '' self.path.pop()
def handleEndElement(self, name): self.path.pop() # presumably, the XML is well-formed and an end element is obligatorily the closets preceding unclosed begin tag.
680a1970ded88c9b811352ffe3294937ba89f6e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8937/680a1970ded88c9b811352ffe3294937ba89f6e6/iso_extract_modeler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 1638, 1046, 12, 2890, 16, 508, 4672, 309, 508, 31713, 16025, 340, 67, 1973, 6877, 364, 3770, 316, 365, 18, 2390, 1098, 18, 4939, 12, 2187, 296, 4672, 309, 3770, 30, 365, 18, 2284...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 1638, 1046, 12, 2890, 16, 508, 4672, 309, 508, 31713, 16025, 340, 67, 1973, 6877, 364, 3770, 316, 365, 18, 2390, 1098, 18, 4939, 12, 2187, 296, 4672, 309, 3770, 30, 365, 18, 2284...
if res_obj and len(res_obj): res_obj = res_obj[0]
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context={}): company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name for att in self.browse(cr, uid, ids, context=context): sign = att.sent_by_uid and att.sent_by_uid.signature or '' sign = '<br>'.join(sign and sign.split('\n') or []) res_obj = att.ref if res_obj and len(res_obj): res_obj = res_obj[0] sub = '[%s Invitation][%d] %s' % (company, att.id, res_obj.name) att_infos = [] other_invitaion_ids = self.search(cr, uid, [('ref','=',att.ref)]) for att2 in self.browse(cr, uid, other_invitaion_ids): att_infos.append(((att2.user_id and att2.user_id.name) or \ (att2.partner_id and att2.partner_id.name) or \ att2.email) + ' - Status: ' + att2.state.title()) body_vals = {'name': res_obj.name, 'start_date': res_obj.date, 'end_date': res_obj.date_deadline or False, 'description': res_obj.description or '-', 'location': res_obj.location or '-', 'attendees': '<br>'.join(att_infos), 'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User', 'sign': sign, 'company': company } body = html_invitation % body_vals if mail_to and email_from: tools.email_send( email_from, mail_to, sub, body, subtype='html', reply_to=email_from ) return True
0cac3f59979db983cf71b8f3ad0544f8d2c024d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cac3f59979db983cf71b8f3ad0544f8d2c024d4/base_calendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4661, 67, 4408, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 4791, 67, 869, 16, 2699, 67, 2080, 33, 6642, 18, 1425, 18, 588, 2668, 3652, 67, 2080, 2187, 1083, 3631, 819, 12938, 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, 389, 4661, 67, 4408, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 4791, 67, 869, 16, 2699, 67, 2080, 33, 6642, 18, 1425, 18, 588, 2668, 3652, 67, 2080, 2187, 1083, 3631, 819, 12938, 4...
linelen = 0
def write(s, output=output, lineEnd='\n'): # RFC 1521 requires that the line ending in a space or tab must have # that trailing character encoded. if s and s[-1:] in ' \t': output.write(s[:-1] + quote(s[-1]) + lineEnd) else: output.write(s + lineEnd)
dac67ac8bf994b336748283fa25602639c6a9bf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dac67ac8bf994b336748283fa25602639c6a9bf4/quopri.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 87, 16, 876, 33, 2844, 16, 980, 1638, 2218, 64, 82, 11, 4672, 468, 8372, 4711, 5340, 4991, 716, 326, 980, 11463, 316, 279, 3476, 578, 3246, 1297, 1240, 468, 716, 7341, 3351, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 87, 16, 876, 33, 2844, 16, 980, 1638, 2218, 64, 82, 11, 4672, 468, 8372, 4711, 5340, 4991, 716, 326, 980, 11463, 316, 279, 3476, 578, 3246, 1297, 1240, 468, 716, 7341, 3351, ...
fname = "%sdistnumpt_test_matrix.npy"%dnumpytest.TmpSetDir
fname = "%sdistnumpt_test_matrix.npy"
def run(): max_ndim = 6 for i in xrange(1,max_ndim+1): src = dnumpytest.random_list(random.sample(xrange(1, 10),i)) A = np.array(src, dtype=float, dist=True) fname = "%sdistnumpt_test_matrix.npy"%dnumpytest.TmpSetDir np.save(fname,A) Bf = np.load(fname, dist=False) Bd = np.load(fname, dist=True) if not dnumpytest.array_equal(Bf,Bd): err = "Input array:\n %s\n"%str(A) err += "The loaded array from DistNumPy:\n%s\n"%str(Bd) err += "The loaded array from NumPy:\n%s\n"%str(Bf) return (True, err) return (False, "")
59a04891555a5d7638e47847b6f5915117af0f07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4342/59a04891555a5d7638e47847b6f5915117af0f07/test_IO.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 13332, 943, 67, 82, 3509, 273, 1666, 364, 277, 316, 12314, 12, 21, 16, 1896, 67, 82, 3509, 15, 21, 4672, 1705, 273, 302, 15974, 3813, 18, 9188, 67, 1098, 12, 9188, 18, 6358, 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, 1086, 13332, 943, 67, 82, 3509, 273, 1666, 364, 277, 316, 12314, 12, 21, 16, 1896, 67, 82, 3509, 15, 21, 4672, 1705, 273, 302, 15974, 3813, 18, 9188, 67, 1098, 12, 9188, 18, 6358, 12...
ligolwThincaToCoincNode = ligolw_thinca_to_coinc_node(ligolwThincaToCoincJob, dag, type+cat+".cache", "vetoes_"+cat+".xml.gz", "vetoes", "S5_HM", effsnrfac=50,p_node=[segNode[cat]])
ligolwThincaToCoincNode = ligolw_thinca_to_coinc_node(ligolwThincaToCoincJob, dag, type+cat+".cache", "vetoes_"+cat+".xml.gz", "vetoes", "S5_HM", id, effsnrfac=50, p_node=[segNode[cat]])
def ifo_seg_dict(cp): out = {} out["H1"] = string.strip(cp.get('input','h1vetosegments')) out["H2"] = string.strip(cp.get('input','h2vetosegments')) out["L1"] = string.strip(cp.get('input','l1vetosegments')) return out
fa84b2dcea9c56113a7d87c49ee290301ff67aba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/fa84b2dcea9c56113a7d87c49ee290301ff67aba/highmass_post_process.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21479, 67, 5680, 67, 1576, 12, 4057, 4672, 596, 273, 2618, 596, 9614, 44, 21, 11929, 273, 533, 18, 6406, 12, 4057, 18, 588, 2668, 2630, 17023, 76, 21, 90, 278, 2584, 75, 1346, 26112, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21479, 67, 5680, 67, 1576, 12, 4057, 4672, 596, 273, 2618, 596, 9614, 44, 21, 11929, 273, 533, 18, 6406, 12, 4057, 18, 588, 2668, 2630, 17023, 76, 21, 90, 278, 2584, 75, 1346, 26112, ...
ramp.title = 'Ramp'
xramp.title = 'X Ramp' def yramp(x, y): return y yramp.title = 'Y Ramp'
def ramp(x, y): return x
da3a8b0668083ce48b49a2e6838c25e9c6f741b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/da3a8b0668083ce48b49a2e6838c25e9c6f741b1/testfuncs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 931, 12, 92, 16, 677, 4672, 327, 619, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 931, 12, 92, 16, 677, 4672, 327, 619, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
return CommonUtil.hostname()
return None
def cl_target(job): """Build target. Only run on client.""" if hasattr(job.backend, 'CE'): targets = [] if job.backend.CE: targets.append('CE_%s' % job.backend.CE) for site in job.backend.requirements.sites: if site: targets.append('SITE_%s' % site) targetcsv = ','.join(targets) return CommonUtil.strip_to_none(targetcsv) else: return CommonUtil.hostname()
fa63c4c7876918503a20ba9f3a8ef56c59a36ae9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/fa63c4c7876918503a20ba9f3a8ef56c59a36ae9/LCGAthenaUtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 927, 67, 3299, 12, 4688, 4672, 3536, 3116, 1018, 18, 5098, 1086, 603, 1004, 12123, 309, 3859, 12, 4688, 18, 9993, 16, 296, 1441, 11, 4672, 5774, 273, 5378, 309, 1719, 18, 9993, 18, 144...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 927, 67, 3299, 12, 4688, 4672, 3536, 3116, 1018, 18, 5098, 1086, 603, 1004, 12123, 309, 3859, 12, 4688, 18, 9993, 16, 296, 1441, 11, 4672, 5774, 273, 5378, 309, 1719, 18, 9993, 18, 144...
self.theSession.printMessage( 'load rule file %s\n' % aFileName ) aGlobalNameMap = { 'aMainWindow' : self } execfile(aFileName, aGlobalNameMap) self.theModelInterpreter.load( self.theCellModelObject ) self.theEntryListWindow.update()
self.theSession.printMessage( 'loading rule file %s\n' % aFileName ) self.theSession.loadModel( aFileName )
def loadRule( self, button_obj ) : self.theStepperChacker = 1 aFileName = self.theRuleFileSelection.get_filename() self.theRuleFileSelection.hide() self.theSession.printMessage( 'load rule file %s\n' % aFileName ) aGlobalNameMap = { 'aMainWindow' : self } execfile(aFileName, aGlobalNameMap) self.theModelInterpreter.load( self.theCellModelObject ) self.theEntryListWindow.update() self.theSession.theSimulator.initialize()
8f2a6d91b6a947b937eb5fc3b937af3797e21ac3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/8f2a6d91b6a947b937eb5fc3b937af3797e21ac3/MainWindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2175, 12, 365, 16, 3568, 67, 2603, 262, 294, 365, 18, 5787, 4160, 457, 782, 484, 264, 273, 404, 279, 4771, 273, 365, 18, 5787, 2175, 812, 6233, 18, 588, 67, 3459, 1435, 365, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2175, 12, 365, 16, 3568, 67, 2603, 262, 294, 365, 18, 5787, 4160, 457, 782, 484, 264, 273, 404, 279, 4771, 273, 365, 18, 5787, 2175, 812, 6233, 18, 588, 67, 3459, 1435, 365, 18...
res = http_check(url)
try: res = http_check(url) except ValueError, e: log("%s" % e) continue
def check_urls(archive_id=None): ftp_check = FtpChecker() http_check = HttpChecker() pat = re.compile(r"((?:f|ht)tps?://\S+)") con = connect_to_db() cur = con.cursor() if archive_id is None: cur.execute("select Element_ID, Content from METADATA_ELEM me where Content regexp '(f|ht)tps?://.*' and (IntegrityChecked is null or timestampdiff(day,IntegrityChecked,now())<1) order by rand()") else: cur.execute("select Element_ID, Content from METADATA_ELEM me, ARCHIVED_ITEM ai where me.Archive_ID=ai.Archive_ID and ai.Archive_ID=%s and Content regexp '(f|ht)tps?://.*' and (IntegrityChecked is null or timestampdiff(day,IntegrityChecked,now())<1) order by rand()", archive_id) for row in cur.fetchall(): url = pat.search(row[1]).group(1) log('checking: %s' % url) sqls = ["delete from INTEGRITY_CHECK where Element_ID=%d and (Problem_Code='RNA' or Problem_Code='RNF')" % row[0]] if url.startswith('ftp'): res = ftp_check(url) if not res: sqls.append("insert into INTEGRITY_CHECK (Element_ID, Problem_Code) values (%d, 'RNA')" % row[0]) elif url.startswith('http'): res = http_check(url) if res != '200': if res == '404': sqls.append("insert into INTEGRITY_CHECK (Element_ID, Problem_Code) values (%d, 'RNF')" % row[0]) else: sqls.append("insert into INTEGRITY_CHECK (Element_ID, Problem_Code) values (%d, 'RNA')" % row[0]) else: sqls.append("insert into INTEGRITY_CHECK (Element_ID, Problem_Code) values (%d, 'RNF')" % row[0]) for sql in sqls: cur.execute(sql) con.commit() cur.close() con.close()
023c06370fe932e4aece72fe5391000041d07aaa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8937/023c06370fe932e4aece72fe5391000041d07aaa/integrity.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 10518, 12, 10686, 67, 350, 33, 7036, 4672, 13487, 67, 1893, 273, 478, 6834, 8847, 1435, 1062, 67, 1893, 273, 2541, 8847, 1435, 225, 9670, 273, 283, 18, 11100, 12, 86, 6, 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, 866, 67, 10518, 12, 10686, 67, 350, 33, 7036, 4672, 13487, 67, 1893, 273, 478, 6834, 8847, 1435, 1062, 67, 1893, 273, 2541, 8847, 1435, 225, 9670, 273, 283, 18, 11100, 12, 86, 6, 12, ...
import string
def _execvpe(file, args, env=None): if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath import string PATH = string.splitfields(envpath, pathsep) if not _notfound: import tempfile # Exec a file that is guaranteed not to exist try: execv(tempfile.mktemp(), ()) except error, _notfound: pass exc, arg = error, _notfound for dir in PATH: fullname = path.join(dir, file) try: apply(func, (fullname,) + argrest) except error, (errno, msg): if errno != arg[0]: exc, arg = error, (errno, msg) raise exc, arg
1e3c380cd4e6e569be13bdaa54da1f9acbd3c0d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1e3c380cd4e6e569be13bdaa54da1f9acbd3c0d0/os.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4177, 90, 347, 12, 768, 16, 833, 16, 1550, 33, 7036, 4672, 309, 1550, 353, 486, 599, 30, 1326, 273, 1196, 537, 1501, 8792, 273, 261, 1968, 16, 1550, 13, 469, 30, 1326, 273, 1196...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4177, 90, 347, 12, 768, 16, 833, 16, 1550, 33, 7036, 4672, 309, 1550, 353, 486, 599, 30, 1326, 273, 1196, 537, 1501, 8792, 273, 261, 1968, 16, 1550, 13, 469, 30, 1326, 273, 1196...
win.destroy = (my_progressbar_destroy, pbt)
win.callback_destroy_add(my_progressbar_destroy, *pbt)
def progressbar_clicked(obj, it, *args, **kwargs): win = elementary.Window("progressbar", elementary.ELM_WIN_BASIC) win.title_set("Progressbar test") bg = elementary.Background(win) win.resize_object_add(bg) bg.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bg.show() bx = elementary.Box(win) win.resize_object_add(bx) bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.show() pb1 = elementary.Progressbar(win) pb1.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) pb1.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) bx.pack_end(pb1) pb1.show() pb2 = elementary.Progressbar(win) pb2.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) pb2.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) pb2.label_set("Infinite bounce") pb2.pulse_set(True) bx.pack_end(pb2) pb2.show() ic1 = elementary.Icon(win) ic1.file_set('images/logo_small.png') ic1.size_hint_aspect_set(evas.EVAS_ASPECT_CONTROL_VERTICAL, 1, 1) pb3 = elementary.Progressbar(win) pb3.label_set("Label") pb3.icon_set(ic1) pb3.inverted_set(True) pb3.unit_format_set("%1.1f units") pb3.span_size_set(200) pb3.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) pb3.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.pack_end(pb3) ic1.show() pb3.show() hbx = elementary.Box(win) hbx.horizontal_set(True) hbx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) hbx.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) bx.pack_end(hbx) hbx.show() pb4 = elementary.Progressbar(win) pb4.horizontal_set(False) pb4.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL) pb4.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) hbx.pack_end(pb4) pb4.span_size_set(60) pb4.label_set("percent") pb4.show() pb5 = elementary.Progressbar(win) pb5.horizontal_set(False) pb5.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) pb5.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) pb5.span_size_set(80) pb5.pulse_set(True) pb5.unit_format_set(None) pb5.label_set("Infinite bounce") hbx.pack_end(pb5) pb5.show() ic2 = elementary.Icon(win) ic2.file_set('images/logo_small.png') ic2.size_hint_aspect_set(evas.EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1) pb6 = elementary.Progressbar(win) pb6.horizontal_set(False) pb6.label_set("Label") pb6.icon_set(ic2) pb6.inverted_set(True) pb6.unit_format_set("%1.2f%%") pb6.span_size_set(200) pb6.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) pb6.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) hbx.pack_end(pb6) ic2.show() pb6.show() pb7 = elementary.Progressbar(win) pb7.style_set("wheel") pb7.label_set("Style: wheel") pb7.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) pb7.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.pack_end(pb7) pb7.show() bt_bx = elementary.Box(win) bt_bx.horizontal_set(True) bt_bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) bx.pack_end(bt_bx) bt_bx.show() pbt = (pb1, pb2, pb3, pb4, pb5, pb6, pb7) bt = elementary.Button(win) bt.label_set("Start") bt.clicked = (my_progressbar_test_start, pbt) bt_bx.pack_end(bt) bt.show() bt = elementary.Button(win) bt.label_set("Stop") bt.clicked = (my_progressbar_test_stop, pbt) bt_bx.pack_end(bt) bt.show() win.destroy = (my_progressbar_destroy, pbt) win.show()
ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12343/ef127faaba8fc06ebbb7bd48a4185405cdfc6a4e/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31730, 67, 7475, 329, 12, 2603, 16, 518, 16, 380, 1968, 16, 2826, 4333, 4672, 5657, 273, 930, 814, 18, 3829, 2932, 8298, 3215, 3113, 930, 814, 18, 2247, 49, 67, 24572, 67, 25642, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31730, 67, 7475, 329, 12, 2603, 16, 518, 16, 380, 1968, 16, 2826, 4333, 4672, 5657, 273, 930, 814, 18, 3829, 2932, 8298, 3215, 3113, 930, 814, 18, 2247, 49, 67, 24572, 67, 25642, 13, ...
else: raise ExternalClashError('Name clash prevented file creation: %s' % path)
raise ExternalClashError('Name clash prevented file creation: %s' % path)
def _create_tmp(self): """Create a file in the tmp subdirectory and open and return it.""" now = time.time() hostname = socket.gethostname() if '/' in hostname: hostname = hostname.replace('/', r'\057') if ':' in hostname: hostname = hostname.replace(':', r'\072') uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6), os.getpid(), Maildir._count, hostname) path = os.path.join(self._path, 'tmp', uniq) try: os.stat(path) except OSError, e: if e.errno == errno.ENOENT: Maildir._count += 1 return open(path, 'wb+') else: raise else: raise ExternalClashError('Name clash prevented file creation: %s' % path)
8da4d8e5dc1aade852ca5277f200d63f53a43bd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8da4d8e5dc1aade852ca5277f200d63f53a43bd6/mailbox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 5645, 12, 2890, 4672, 3536, 1684, 279, 585, 316, 326, 1853, 29869, 471, 1696, 471, 327, 518, 12123, 2037, 273, 813, 18, 957, 1435, 5199, 273, 2987, 18, 75, 546, 669, 529...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5645, 12, 2890, 4672, 3536, 1684, 279, 585, 316, 326, 1853, 29869, 471, 1696, 471, 327, 518, 12123, 2037, 273, 813, 18, 957, 1435, 5199, 273, 2987, 18, 75, 546, 669, 529...
self.generateImpliedEndTags() if self.parser.openElements[-1].name == "table": self.parser.parseError while self.parser.openElements[-1].name != "table": self.parser.openElements.pop() self.parser.resetInsertionMode()
if self.parser.elementInScope("table", True): self.generateImpliedEndTags() if self.parser.openElements[-1].name == "table": self.parser.parseError() while self.parser.openElements[-1].name != "table": self.parser.openElements.pop() self.parser.resetInsertionMode() else: self.parser.parseError()
def endTagTable(self, name): # XXX no element in scope -> parse error, innerHTML case
ce5c9099375b170e783040096f9c19fdd2e9a823 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/ce5c9099375b170e783040096f9c19fdd2e9a823/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 1388, 12, 2890, 16, 508, 4672, 468, 11329, 1158, 930, 316, 2146, 317, 1109, 555, 16, 14129, 648, 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, 29765, 1388, 12, 2890, 16, 508, 4672, 468, 11329, 1158, 930, 316, 2146, 317, 1109, 555, 16, 14129, 648, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
CopyFile(plugindir + os.path.basename(plugfile), GetOutputDir()+"/plugins/nppanda3d.dmg")
CopyFile(plugindir + "nppanda3d.dmg", GetOutputDir()+"/plugins/nppanda3d.dmg")
def MakeRuntime(): # Delete the current. if (os.path.exists(GetOutputDir()+"/stage")): shutil.rmtree(GetOutputDir()+"/stage") if (os.path.exists(GetOutputDir()+"/rlib")): shutil.rmtree(GetOutputDir()+"/rlib") # Create a couple of directories. coreapidir = GetOutputDir()+"/stage/coreapi/"+RUNTIME_PLATFORM+"/"+RUNTIME_VERSION+"/" plugindir = GetOutputDir()+"/stage/plugin/"+RUNTIME_PLATFORM+"/"+RUNTIME_VERSION+"/" MakeDirectory(GetOutputDir()+"/rlib") MakeDirectory(GetOutputDir()+"/stage") MakeDirectory(GetOutputDir()+"/stage/coreapi") MakeDirectory(GetOutputDir()+"/stage/coreapi/"+RUNTIME_PLATFORM) MakeDirectory(GetOutputDir()+"/stage/plugin") MakeDirectory(GetOutputDir()+"/stage/plugin/"+RUNTIME_PLATFORM) MakeDirectory(coreapidir); MakeDirectory(plugindir) # Copy the p3d_plugin file to coreapi dir and the plugin to the plugin dir. plugfile = CalcLocation("p3d_plugin.dll", None) CopyFile(coreapidir + os.path.basename(plugfile), plugfile) if (sys.platform == "darwin"): plugfile = CalcLocation("nppanda3d.plugin", None) if (os.path.isdir(GetOutputDir()+"/tmp/bundle")): oscmd("rm -rf %s" % BracketNameWithQuotes(GetOutputDir()+"/tmp/bundle")) MakeDirectory(GetOutputDir()+"/tmp/bundle") CopyTree(GetOutputDir()+"/tmp/bundle/nppanda3d.plugin", plugfile) if (os.path.exists(GetOutputDir()+"/plugins/nppanda3d.dmg")): oscmd("rm -rf " + BracketNameWithQuotes(GetOutputDir()+"/plugins/nppanda3d.dmg")) oscmd("hdiutil create -fs HFS+ -srcfolder %s -volname nppanda3d %s" % (GetOutputDir()+"/tmp/bundle", GetOutputDir()+"/plugins/nppanda3d.dmg")) CopyFile(plugindir + os.path.basename(plugfile), GetOutputDir()+"/plugins/nppanda3d.dmg") oscmd("rm -rf " + BracketNameWithQuotes(GetOutputDir()+"/tmp/bundle")) else: plugfile = CalcLocation("nppanda3d.dll", None) CopyFile(plugindir + "nppanda3d.dmg", plugfile) # Copy the important libraries to built/rlib/. CopyFile(GetOutputDir()+"/rlib/Config.prc", GetOutputDir()+"/etc/Config.prc") plugfile = CalcLocation("p3dpython.exe", None) CopyFile(GetOutputDir()+"/rlib/"+os.path.basename(plugfile), plugfile) plugfile = CalcLocation("runp3d_frozen.pyd", None) CopyFile(GetOutputDir()+"/rlib/"+os.path.basename(plugfile), plugfile) if (sys.platform.startswith("win")): for base in os.listdir(GetOutputDir()+"/bin"): if (base.endswith(".dll")): omit = False for romit in RUNTIME_OMIT: if fnmatch.fnmatch(base, romit): omit = True if omit: continue CopyFile(GetOutputDir()+"/rlib/"+base, GetOutputDir()+"/bin/"+base) else: for base in os.listdir(GetOutputDir()+"/lib"): if (base.startswith("lib")) and (base.endswith(".so") or base.endswith(".dylib")): omit = False for romit in RUNTIME_OMIT: if fnmatch.fnmatch(base, romit): omit = True if omit: continue CopyFile(GetOutputDir()+"/rlib/"+base, GetOutputDir()+"/lib/"+base) if (sys.platform == "darwin"): oscmd("strip "+GetOutputDir()+"/rlib/"+base) else: oscmd("strip --strip-all "+GetOutputDir()+"/rlib/"+base) # Invoke the make_package and make_contents scripts. command = SDK["PYTHONEXEC"] + " direct/src/plugin/make_package.py" command += " -d \"" + GetOutputDir() + "/stage\"" command += " -s \"" + GetOutputDir() + "/rlib\"" command += " -p panda3d_%s_%s" % (RUNTIME_PLATFORM, RUNTIME_VERSION) oscmd(command) command = SDK["PYTHONEXEC"] + " direct/src/plugin/make_contents.py" command += " -d \"" + GetOutputDir() + "/stage\"" oscmd(command) # Tar the whole thing. if (not sys.platform.startswith("win")): if (os.path.exists("runtime_%s_%s.tar.bz2" % (RUNTIME_PLATFORM, RUNTIME_VERSION))): os.remove("runtime_%s_%s.tar.bz2" % (RUNTIME_PLATFORM, RUNTIME_VERSION)) oscmd("cd " + GetOutputDir() + "/stage/ && tar -cjvf " + os.getcwd() + ("/runtime_%s_%s.tar.bz2 coreapi panda3d plugin" % (RUNTIME_PLATFORM, RUNTIME_VERSION)))
b4363a5b8ae2a22ef4b20bfb747e5f478562be6e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/b4363a5b8ae2a22ef4b20bfb747e5f478562be6e/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4344, 5576, 13332, 468, 2504, 326, 783, 18, 309, 261, 538, 18, 803, 18, 1808, 12, 967, 1447, 1621, 1435, 9078, 19, 12869, 6, 3719, 30, 11060, 18, 86, 17371, 12, 967, 1447, 1621, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4344, 5576, 13332, 468, 2504, 326, 783, 18, 309, 261, 538, 18, 803, 18, 1808, 12, 967, 1447, 1621, 1435, 9078, 19, 12869, 6, 3719, 30, 11060, 18, 86, 17371, 12, 967, 1447, 1621, 1435, ...
file(f, 'w').write("@%s %s %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9" % (pyexe, scriptpy))
file(f, 'w').write("@%s %s %%*" % (pyexe, scriptpy))
def install(sitepackages, prefix): # bat files for pys so twisted command prompt works scripts=join(prefix, 'scripts') pyexe=join(prefix, 'python.exe') for bat in """twistd.bat mktap.bat websetroot.bat lore.bat manhole.bat tapconvert.bat trial.bat coil.bat""".split(): f=join(scripts, bat) scriptpy=f.replace('.bat', '.py') file(f, 'w').write("@%s %s %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9" % (pyexe, scriptpy)) args=['tkunzip'] doczip=join(sitepackages, 'twisteddoc.zip') docdir=join(sitepackages, 'TwistedDocs') # FIXME - should be able to do it this way (one invocation)
28179e74a9d4d6f3d8c85e83f73f157eef51a6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/28179e74a9d4d6f3d8c85e83f73f157eef51a6ba/twisted_postinstall.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 25404, 881, 484, 1023, 16, 1633, 4672, 468, 27464, 1390, 364, 21027, 1427, 2339, 25444, 1296, 6866, 6330, 8873, 33, 5701, 12, 3239, 16, 296, 12827, 6134, 2395, 14880, 33, 5701, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 25404, 881, 484, 1023, 16, 1633, 4672, 468, 27464, 1390, 364, 21027, 1427, 2339, 25444, 1296, 6866, 6330, 8873, 33, 5701, 12, 3239, 16, 296, 12827, 6134, 2395, 14880, 33, 5701, ...
return S_ERROR('Internal error: can not get site mask')
return S_ERROR( 'Internal error: can not get site mask' )
def selectJob(self, resourceDescription): """ Main job selection function to find the highest priority job matching the resource capacity """
059c4744ef6766e0575a5cd4d6f09d892a66a7df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/059c4744ef6766e0575a5cd4d6f09d892a66a7df/MatcherHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 2278, 12, 2890, 16, 1058, 3291, 4672, 3536, 12740, 1719, 4421, 445, 358, 1104, 326, 9742, 4394, 1719, 3607, 326, 1058, 7519, 3536, 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, 0, 0, 0, 0, 0, 0, 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, 2027, 2278, 12, 2890, 16, 1058, 3291, 4672, 3536, 12740, 1719, 4421, 445, 358, 1104, 326, 9742, 4394, 1719, 3607, 326, 1058, 7519, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
api.setFocusObject(NVDAEvent[1])
queueHandler.queueFunction(queueHandler.eventQueue,api.setFocusObject,NVDAEvent[1])
def pumpAll(): #Receive all the winEvents from the limiter for this cycle winEvents=winEventLimiter.flushEvents() focusWinEvents=[] for winEvent in winEvents: #We want to only pass on one focus event to NVDA, but we always want to use the most recent possible one if winEvent[0]==winUser.EVENT_OBJECT_FOCUS: focusWinEvents.append(winEvent) continue else: for focusWinEvent in reversed(focusWinEvents): NVDAEvent=winEventToNVDAEvent(*focusWinEvent) if NVDAEvent is not None: api.setFocusObject(NVDAEvent[1]) #Eventually eventHandler will do that queueHandler.queueFunction(queueHandler.eventQueue,eventHandler.manageEvent,*NVDAEvent) break focusWinEvents=[] NVDAEvent=winEventToNVDAEvent(*winEvent) if NVDAEvent is not None: queueHandler.queueFunction(queueHandler.eventQueue,eventHandler.manageEvent,*NVDAEvent) for focusWinEvent in reversed(focusWinEvents): NVDAEvent=winEventToNVDAEvent(*focusWinEvent) if NVDAEvent is not None: api.setFocusObject(NVDAEvent[1]) #Eventually eventHandler will do that queueHandler.queueFunction(queueHandler.eventQueue,eventHandler.manageEvent,*NVDAEvent)
350bd5160d09c7952366a095562c6913a97641b6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9340/350bd5160d09c7952366a095562c6913a97641b6/IAccessibleHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 2801, 1595, 13332, 468, 11323, 777, 326, 5657, 3783, 628, 326, 25057, 364, 333, 8589, 5657, 3783, 33, 8082, 1133, 22329, 18, 11330, 3783, 1435, 7155, 18049, 3783, 33, 8526, 364, 5657,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2801, 1595, 13332, 468, 11323, 777, 326, 5657, 3783, 628, 326, 25057, 364, 333, 8589, 5657, 3783, 33, 8082, 1133, 22329, 18, 11330, 3783, 1435, 7155, 18049, 3783, 33, 8526, 364, 5657,...
logkpr('User: ' + username + ' has NOT been late-kicked today') notify(username, pid, 'It is getting late', 'You are only allowed to login between ' + str(bfrom[index]) + ' and ' + str(bto[index]) + '. You will be logged out in ' + str(GRACEPERIOD) + ' seconds.') sleep(GRACEPERIOD/2) notify(username, pid, 'It is getting late', 'You are only allowed to login between ' + str(bfrom[index]) + ' and ' + str(bto[index]) + '. You will be logged out in ' + str(GRACEPERIOD/2) + ' seconds.') sleep(GRACEPERIOD/2) open(latefile, 'w') remove(allowfile)
logkpr('User %s has NOT been late-kicked today' % username) nttl = 'It is getting late' nmsg = 'You are only allowed to login between %s and %s. You will be logged out in %s seconds.' notify(username, pid, nttl, nmsg % (str(bfrom[index]),str(bto[index]),str(GRACEPERIOD))) threadit(float(GRACEPERIOD/2), notify, username, pid, nttl, nmsg % (str(bfrom[index]),str(bto[index]),str(GRACEPERIOD/2))) threadit(float(GRACEPERIOD), logOut, username, pid, latefile) threadit(float(GRACEPERIOD), remove, allowfile)
def fromtoday(fname): # Returns True if a file was last modified today fdate = strftime("%Y%m%d", localtime(getmtime(fname))) today = strftime("%Y%m%d", localtime()) return fdate == today
74b3799025d3bd8dded6111ac337b8d5d8394b0f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1574/74b3799025d3bd8dded6111ac337b8d5d8394b0f/timekpr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 628, 30064, 12, 12749, 4672, 468, 2860, 1053, 309, 279, 585, 1703, 1142, 4358, 10074, 284, 712, 273, 10405, 27188, 61, 9, 81, 9, 72, 3113, 1191, 957, 12, 588, 10838, 12, 12749, 20349, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 628, 30064, 12, 12749, 4672, 468, 2860, 1053, 309, 279, 585, 1703, 1142, 4358, 10074, 284, 712, 273, 10405, 27188, 61, 9, 81, 9, 72, 3113, 1191, 957, 12, 588, 10838, 12, 12749, 20349, ...
self.TXT_X = 15 self.TXT_DY = 26 self.CTRL_X = 65 self.CTRL_H = 20
self.TXT_W = 60
def __init__(self, parent, id, title, timeline, start=None, end=None, event=None): wx.Dialog.__init__(self, parent, id, title, size=(250, 240)) # Constants self.TXT_X = 15 self.TXT_DY = 26 self.CTRL_X = 65 self.CTRL_H = 20 self.CTRL_W = 160 self.CTRL_DY = 26 # Instance variables self._timeline = timeline self._event = event # Input data if event != None: start = event.time_period.start_time.isoformat('-') end = event.time_period.end_time.isoformat('-') name = event.text category = event.category self._updatemode = True else: self._updatemode = False name = '' category = None start = self.__time_text(start) end = self.__time_text(end ) # Controls panel = wx.Panel(self, -1) self.__static_text(panel, "Start:" , 1) self.__static_text(panel, "End:" , 2) self.__static_text(panel, "Name:" , 3) self.__static_text(panel, "Category:", 4) self._cb_close_on_ok = self.__check_box(panel, "Close on OK", 5) self._cb_close_on_ok.SetValue(True) self.__static_box (panel, "Event Properties", 6) self._textctrl_start_time = self.__text_control(panel, start, 1) self._textctrl_end_time = self.__text_control(panel, end , 2) self._textctrl_name = self.__text_control(panel, name , 3) self._category_choice = self.__choice_control(panel, 4) count = 0 for cat in timeline.get_categories(): self._category_choice.Append(cat.name, cat) if cat == category: self._category_choice.SetSelection(count) count += 1 # Dialog buttons ok_button = self.__button(self, "Ok" , True , self._on_ok ) close_button = self.__button(self, "Close", False, self._on_close) # Add controls and buttons do the dialog hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(ok_button , 1) hbox.Add(close_button, 1, wx.LEFT, 5) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(panel) vbox.Add(hbox, 1, wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, 10) self.SetSizer(vbox) # Decide focus control self._textctrl_start_time.SetFocus() for ctrl in [self._textctrl_start_time, self._textctrl_end_time, self._textctrl_name]: if ctrl.GetValue().strip() == '': ctrl.SetFocus() break
5e536432e6c9d25da46ff5c5562f1c02d7b6cc8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5252/5e536432e6c9d25da46ff5c5562f1c02d7b6cc8c/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 612, 16, 2077, 16, 18316, 16, 787, 33, 7036, 16, 679, 33, 7036, 16, 871, 33, 7036, 4672, 7075, 18, 6353, 16186, 2738, 972, 12, 2890, 16, 982, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 612, 16, 2077, 16, 18316, 16, 787, 33, 7036, 16, 679, 33, 7036, 16, 871, 33, 7036, 4672, 7075, 18, 6353, 16186, 2738, 972, 12, 2890, 16, 982, ...
def run_component (component_cls, argv=None, register=True, state_name=False, cls_kwargs={}, extra_getopt='', time_out=10, certfile=None, keyfile=None, ca=None): if argv is None: argv = sys.argv try: (opts, arg) = getopt.getopt(argv[1:], 'C:D:d' + extra_getopt) except getopt.GetoptError, e: print >> sys.stderr, e print >> sys.stderr, "Usage:" print >> sys.stderr, "%s [-d] [-D pidfile] [-C config file]" % (os.path.basename(argv[0])) sys.exit(1)
class NoExposedMethod (Exception): """There is no method exposed with the given name.""" def run_component (component_cls, location, daemon, pidfile_name, argv=None, register=True, state_name=False, cls_kwargs={}, extra_getopt='', time_out=10, certfile=None, keyfile=None, ca=None):
def run_component (component_cls, argv=None, register=True, state_name=False, cls_kwargs={}, extra_getopt='', time_out=10, certfile=None, keyfile=None, ca=None): if argv is None: argv = sys.argv try: (opts, arg) = getopt.getopt(argv[1:], 'C:D:d' + extra_getopt) except getopt.GetoptError, e: print >> sys.stderr, e print >> sys.stderr, "Usage:" print >> sys.stderr, "%s [-d] [-D pidfile] [-C config file]" % (os.path.basename(argv[0])) sys.exit(1) # default settings daemon = False pidfile = "" level = logging.INFO # get user input for item in opts: if item[0] == '-C': #FIXME cf = (item[1], ) elif item[0] == '-D': daemon = True pidfile_name = item[1] elif item[0] == '-d': level = logging.DEBUG logging.getLogger().setLevel(level) Bcfg2.Logger.setup_logging(component_cls.implementation, True, True) if daemon: child_pid = os.fork() if child_pid != 0: return os.setsid() child_pid = os.fork() if child_pid != 0: os._exit(0) redirect_file = open("/dev/null", "w+") os.dup2(redirect_file.fileno(), sys.__stdin__.fileno()) os.dup2(redirect_file.fileno(), sys.__stdout__.fileno()) os.dup2(redirect_file.fileno(), sys.__stderr__.fileno()) os.chdir(os.sep) os.umask(0) pidfile = open(pidfile_name or "/dev/null", "w") print >> pidfile, os.getpid() pidfile.close() component = component_cls(**cls_kwargs) # FIXME location = ('', 6789) server = XMLRPCServer(location, keyfile=keyfile, certfile=certfile, register=register, timeout=time_out, ca=ca) server.register_instance(component) try: server.serve_forever() finally: server.server_close()
f848924fae9fb16ac8f4df2c0c8ac53127f584a5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/f848924fae9fb16ac8f4df2c0c8ac53127f584a5/Component.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 667, 2631, 424, 7423, 1305, 261, 503, 4672, 3536, 9828, 353, 1158, 707, 16265, 598, 326, 864, 508, 12123, 225, 1652, 1086, 67, 4652, 261, 4652, 67, 6429, 16, 2117, 16, 8131, 16, 27656, 67, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 667, 2631, 424, 7423, 1305, 261, 503, 4672, 3536, 9828, 353, 1158, 707, 16265, 598, 326, 864, 508, 12123, 225, 1652, 1086, 67, 4652, 261, 4652, 67, 6429, 16, 2117, 16, 8131, 16, 27656, 67, 5...
self.process.Continue()
self.process.Kill()
def run(self): print "Running MyListeningThread:", self count = 0 # Let's only try at most 3 times to retrieve any kind of event. while not count > 3: if listener.WaitForEvent(5, event): print "Got a valid event:", event print "Event type:", event.GetType() print "Event broadcaster:", event.GetBroadcaster().GetName() return count = count + 1 print "Timeout: listener.WaitForEvent"
4ce0968354409def7e4d945f890824a1fd162b4f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11986/4ce0968354409def7e4d945f890824a1fd162b4f/TestEvents.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 1172, 315, 7051, 8005, 31594, 3830, 2773, 16, 365, 1056, 273, 374, 468, 10559, 1807, 1338, 775, 622, 4486, 890, 4124, 358, 4614, 1281, 3846, 434, 871, 18, 1323, 486...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 1172, 315, 7051, 8005, 31594, 3830, 2773, 16, 365, 1056, 273, 374, 468, 10559, 1807, 1338, 775, 622, 4486, 890, 4124, 358, 4614, 1281, 3846, 434, 871, 18, 1323, 486...
noise = mt.random_double(3)*2-1.0
noise = flex.random_double(3)*2-1.0
def tst_nsd(): mt = flex.mersenne_twister(seed=0) moving1 = flex.vec3_double() moving2 = flex.vec3_double() fixed = flex.vec3_double() max_noise = 0 for ii in range(10): noise = mt.random_double(3)*2-1.0 if noise.norm() > max_noise: max_noise = noise.norm() xyz = mt.random_double(3)*5 fixed.append( list(xyz) ) moving1.append( list(xyz + noise/10) ) moving2.append( list(xyz + noise/2) ) ne = nsd_engine(fixed) a = ne.nsd(fixed) b = ne.nsd(moving1) c = ne.nsd(moving2) assert abs(a)<1e-6 assert(b<=c) matrix = euler.zyz_matrix(0.7,1.3,2.1) fixed_r = matrix*moving1+(8,18,28) fitter = nsd_rigid_body_fitter( fixed,fixed_r) nxyz = fitter.best_shifted() dd = nxyz[0:fixed.size()]-fixed dd = dd.norms() dd = flex.max(dd) assert (dd<2.00*max_noise/10)
3fc016b025e186c52bcd75331007716e3c342986 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/3fc016b025e186c52bcd75331007716e3c342986/superpose.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 334, 67, 2387, 72, 13332, 5874, 273, 16600, 18, 81, 414, 275, 4644, 67, 11246, 1249, 12, 12407, 33, 20, 13, 12499, 21, 273, 16600, 18, 8799, 23, 67, 9056, 1435, 12499, 22, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 334, 67, 2387, 72, 13332, 5874, 273, 16600, 18, 81, 414, 275, 4644, 67, 11246, 1249, 12, 12407, 33, 20, 13, 12499, 21, 273, 16600, 18, 8799, 23, 67, 9056, 1435, 12499, 22, 273, ...
if maxDepth != 1:
if maxDepth != 1 and maxDepth is not None:
def checkTargetFilter(relchain, query): return targetFilter(relchain, query, self, targetCache)
403eedce3547f00451ae3cec073083c8bc81f3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9437/403eedce3547f00451ae3cec073083c8bc81f3e6/index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 2326, 1586, 12, 2878, 5639, 16, 843, 4672, 327, 1018, 1586, 12, 2878, 5639, 16, 843, 16, 365, 16, 1018, 1649, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 2326, 1586, 12, 2878, 5639, 16, 843, 4672, 327, 1018, 1586, 12, 2878, 5639, 16, 843, 16, 365, 16, 1018, 1649, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
security.declarePrivate('setContentType') def setContentType(self, mimetype, skipField=False): """Set the mime type of the text field and the text_format """ if not mimetype: return mimetype = translateMimetypeAlias(mimetype) if not skipField: field = self.getField('text') bu = field.getRaw(self, raw=1) raw = bu.getRaw() filename, encoding = bu.filename, bu.original_encoding field.set(self, raw, mimetype=mimetype, filename=filename, encoding=encoding) self.text_format = mimetype
text_format = ComputedAttribute(ATCTContent.getContentType, 1)
def setText(self, value, **kwargs): """Body text mutator
efb8ecec1657ae09a83dca8f4af71c851b6db5ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11956/efb8ecec1657ae09a83dca8f4af71c851b6db5ce/ATDocument.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7883, 12, 2890, 16, 460, 16, 2826, 4333, 4672, 3536, 2250, 977, 29156, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 7883, 12, 2890, 16, 460, 16, 2826, 4333, 4672, 3536, 2250, 977, 29156, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return self.manage_cacheParameters(self,REQUEST)
if REQUEST is not None: response=REQUEST['RESPONSE'] response.redirect(REQUEST['URL1']+'/manage_cacheParameters')
def manage_cache_age(self,value,REQUEST): "set cache age" try: v=self._p_jar.getVersion() except: # BoboPOS2: if self._p_jar.db is not Globals.Bobobase._jar.db: raise 'Version Error', ( '''You may not change the database cache age while working in a <em>version</em>''') self._cache_age=Globals.Bobobase._jar.cache.cache_age=value else: if v: self._vcache_age=value self._p_jar.db().setVersionCacheDeactivateAfter(value) else: self._cache_age=value self._p_jar.db().setCacheDeactivateAfter(value)
93134a644322e3d4768e743498faddead223d85a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93134a644322e3d4768e743498faddead223d85a/CacheManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 2493, 67, 410, 12, 2890, 16, 1132, 16, 5519, 4672, 315, 542, 1247, 9388, 6, 775, 30, 331, 33, 2890, 6315, 84, 67, 11930, 18, 588, 1444, 1435, 1335, 30, 468, 605, 947, 83, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 2493, 67, 410, 12, 2890, 16, 1132, 16, 5519, 4672, 315, 542, 1247, 9388, 6, 775, 30, 331, 33, 2890, 6315, 84, 67, 11930, 18, 588, 1444, 1435, 1335, 30, 468, 605, 947, 83, ...
return mask_and_ovr(2)
return mask_and_ovr(2, 'NEAREST')
def mask_16(): return mask_and_ovr(2)
a1e29113b3fa9b8b0a8e8b23a259621ad0ad11df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10289/a1e29113b3fa9b8b0a8e8b23a259621ad0ad11df/mask.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3066, 67, 2313, 13332, 327, 3066, 67, 464, 67, 1527, 86, 12, 22, 16, 296, 5407, 9332, 882, 6134, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3066, 67, 2313, 13332, 327, 3066, 67, 464, 67, 1527, 86, 12, 22, 16, 296, 5407, 9332, 882, 6134, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
val.head, x + val.spacing, y + val.spacing, \ val.channel_width - 2 * val.spacing, str_h_head) x = x_contents head2 = copy.copy(val.head) head2.align='left'
val.label, x + val.spacing, y + val.spacing, \ val.label.width - 2 * val.spacing, str_h_label)
def DrawTVGuide_Listing(self, to_listing, settings): val = settings.listing
d31c11c3f9777168daab09b7a7cda5ce84134383 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/d31c11c3f9777168daab09b7a7cda5ce84134383/main1_tv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10184, 15579, 17424, 67, 19081, 12, 2890, 16, 358, 67, 21228, 16, 1947, 4672, 1244, 273, 1947, 18, 21228, 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, 10184, 15579, 17424, 67, 19081, 12, 2890, 16, 358, 67, 21228, 16, 1947, 4672, 1244, 273, 1947, 18, 21228, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
:type: `str`"""
:type: ``str``"""
def __init__(self, title, body='', node_defaults=None, edge_defaults=None, caption=None): """ Create a new `DotGraph`. """ self.title = title """The title of the graph."""
87c91ac73c8c2c010f262c553ee24d45b2a8776e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/87c91ac73c8c2c010f262c553ee24d45b2a8776e/dotgraph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2077, 16, 1417, 2218, 2187, 756, 67, 7606, 33, 7036, 16, 3591, 67, 7606, 33, 7036, 16, 11006, 33, 7036, 4672, 3536, 1788, 279, 394, 1375, 10412, 4137, 83...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2077, 16, 1417, 2218, 2187, 756, 67, 7606, 33, 7036, 16, 3591, 67, 7606, 33, 7036, 16, 11006, 33, 7036, 4672, 3536, 1788, 279, 394, 1375, 10412, 4137, 83...
self.ret_list=[]
def __init__(self, cr, uid, name, context): super(lot_location, self).__init__(cr, uid, name, context) self.ret_list=[] self.localcontext.update({ 'time': time, 'process':self.process,
e77eed0cf9896dd375b38f91f54f555a5da67947 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/e77eed0cf9896dd375b38f91f54f555a5da67947/lot_location.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4422, 16, 4555, 16, 508, 16, 819, 4672, 2240, 12, 23372, 67, 3562, 16, 365, 2934, 972, 2738, 972, 12, 3353, 16, 4555, 16, 508, 16, 819, 13, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4422, 16, 4555, 16, 508, 16, 819, 4672, 2240, 12, 23372, 67, 3562, 16, 365, 2934, 972, 2738, 972, 12, 3353, 16, 4555, 16, 508, 16, 819, 13, 365, 18, ...
def lineage(widget, die=True, depth=0): '''Trace the parental lineage of a Qt 4 widget: parent,
def lineage(widget, die = True, depth = 0): """ Trace the parental lineage of a Qt 4 widget: parent,
def lineage(widget, die=True, depth=0): '''Trace the parental lineage of a Qt 4 widget: parent, grandparent... This is helpful in diagnosing "RuntimeError: underlying C/C++ object has been deleted" errors. It is frequently wise to kill the program at the first such deletion, so that is the default behavior (switchable with die=False). ''' if widget is not None: from PyQt4.Qt import QObject, SIGNAL print (depth * ' ') + repr(widget) def destruction(ignore, die=die, message=repr(widget)+" was just destroyed"): qt4here(message, show_traceback=True) if die: sys.exit(1) QObject.connect(widget, SIGNAL("destroyed(QObject *)"), destruction) lineage(widget.parent(), die, depth+1)
cca576cf8798366875286f6eb559227b1be45d1e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/cca576cf8798366875286f6eb559227b1be45d1e/qt4transition.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31766, 12, 6587, 16, 10387, 273, 1053, 16, 3598, 273, 374, 4672, 3536, 2677, 326, 982, 287, 31766, 434, 279, 7354, 1059, 3604, 30, 982, 16, 16225, 2938, 2777, 1220, 353, 28063, 316, 6643...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31766, 12, 6587, 16, 10387, 273, 1053, 16, 3598, 273, 374, 4672, 3536, 2677, 326, 982, 287, 31766, 434, 279, 7354, 1059, 3604, 30, 982, 16, 16225, 2938, 2777, 1220, 353, 28063, 316, 6643...
if isinstance(qLeft, Quat): try: qLeft = qLeft.normalise()
if isQuatPair(q): t = Transform3.__new__(this, q) assert t.isRot(), "%s doesn't represent a rotation" % str(q) return t elif isinstance(q, Quat): try: q = q.normalise()
def __new__(this, qLeft = None, axis = Vec3([1, 0, 0]), angle = 0): """ Initialise a 3D rotation """ if isinstance(qLeft, Quat): try: qLeft = qLeft.normalise() except ZeroDivisionError: pass # will fail on assert below: t = Transform3.__new__(this, [qLeft, qLeft.conjugate()]) assert t.isRot(), "%s doesn't represent a rotation" % str(qLeft) return t else: # q = cos(angle) + y sin(angle) alpha = angle / 2 # if axis is specified as e.g. a list: if not isinstance(axis, Vec): axis = Vec3(axis) if axis != Vec3([0, 0, 0]): axis = axis.normalise() q = math.sin(alpha) * axis q = Quat([math.cos(alpha), q[0], q[1], q[2]]) #print 'cos =', math.cos(alpha) #print 'sin =', math.sin(alpha) return Transform3.__new__(this, [q, q.conjugate()])
e43e6bffc23600e5f66b95bfd7f1f9853c21e537 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14814/e43e6bffc23600e5f66b95bfd7f1f9853c21e537/GeomTypes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2704, 972, 12, 2211, 16, 1043, 3910, 273, 599, 16, 2654, 273, 12969, 23, 3816, 21, 16, 374, 16, 374, 65, 3631, 5291, 273, 374, 4672, 3536, 31739, 279, 890, 40, 6752, 3536, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2704, 972, 12, 2211, 16, 1043, 3910, 273, 599, 16, 2654, 273, 12969, 23, 3816, 21, 16, 374, 16, 374, 65, 3631, 5291, 273, 374, 4672, 3536, 31739, 279, 890, 40, 6752, 3536, 309, ...
- B -- positive integer OUTPUT: - vector over ZZ with B entries
- ``B`` -- positive integer OUTPUT: vector over `\\ZZ` with ``B`` entries
def theta_series_vector(self, B): """ Return theta series coefficients of self, as a vector of `B` integers.
aa7c8c5c25a8f62637a37f480aa5f24e29d7fbee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/aa7c8c5c25a8f62637a37f480aa5f24e29d7fbee/quaternion_algebra.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7338, 67, 10222, 67, 7737, 12, 2890, 16, 605, 4672, 3536, 2000, 7338, 4166, 14229, 434, 365, 16, 487, 279, 3806, 434, 1375, 38, 68, 12321, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7338, 67, 10222, 67, 7737, 12, 2890, 16, 605, 4672, 3536, 2000, 7338, 4166, 14229, 434, 365, 16, 487, 279, 3806, 434, 1375, 38, 68, 12321, 18, 2, -100, -100, -100, -100, -100, -100, -1...
self.ignore_local_hold = True
def _NH_SIPApplicationGotInput(self, notification): engine = Engine() notification_center = NotificationCenter() settings = SIPSimpleSettings() if notification.data.input == '\x04': if self.active_session is not None: self.output.put('Ending audio session...\n') self.active_session.end() elif self.outgoing_session is not None: self.output.put('Cancelling audio session...\n') self.outgoing_session.end() else: self.stop() elif notification.data.input == '?': self.print_help() elif notification.data.input in ('y', 'n') and self.incoming_sessions: session = self.incoming_sessions.pop(0) if notification.data.input == 'y': session.accept([stream for stream in session.proposed_streams if isinstance(stream, AudioStream)]) else: session.reject() elif notification.data.input == 'm': self.voice_conference_bridge.muted = not self.voice_conference_bridge.muted self.output.put('The microphone is now %s\n' % ('muted' if self.voice_conference_bridge.muted else 'unmuted')) elif notification.data.input == 'h': if self.active_session is not None: self.output.put('Ending audio session...\n') self.active_session.end() elif self.outgoing_session is not None: self.output.put('Cancelling audio session...\n') self.outgoing_session.end() elif notification.data.input == ' ': if self.active_session is not None: if self.active_session.on_hold: self.active_session.unhold() else: self.active_session.hold() elif notification.data.input in ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '#', 'A', 'B', 'C', 'D'): if self.active_session is not None: try: audio_stream = self.active_session.streams[0] except IndexError: pass else: audio_stream.send_dtmf(notification.data.input) if self.voice_tone_generator is None: self.voice_tone_generator = ToneGenerator(self.voice_conference_bridge) self.voice_tone_generator.start() self.voice_conference_bridge.connect_slots(self.voice_tone_generator.slot, 0) notification_center.add_observer(self, sender=self.voice_tone_generator) self.voice_tone_generator.play_dtmf(notification.data.input) elif notification.data.input in ('\x1b[A', '\x1b[D') and len(self.started_sessions) > 0: # UP and LEFT if self.active_session is None: self.active_session = self.started_sessions[0] self.active_session.unhold() self.ignore_local_unhold = True elif len(self.started_sessions) > 1: self.active_session.hold() self.active_session = self.started_sessions[self.started_sessions.index(self.active_session)-1] self.active_session.unhold() self.ignore_local_hold = True self.ignore_local_unhold = True else: return identity = str(self.active_session.remote_identity.uri) if self.active_session.remote_identity.display_name: identity = '"%s" <%s>' % (self.active_session.remote_identity.display_name, identity) self.output.put('Active audio session: "%s" (%d/%d)\n' % (identity, self.started_sessions.index(self.active_session)+1, len(self.started_sessions))) elif notification.data.input in ('\x1b[B', '\x1b[C') and len(self.started_sessions) > 0: # DOWN and RIGHT if self.active_session is None: self.active_session = self.started_sessions[0] self.active_session.unhold() self.ignore_local_unhold = True elif len(self.started_sessions) > 1: self.active_session.hold() self.active_session = self.started_sessions[(self.started_sessions.index(self.active_session)+1) % len(self.started_sessions)] self.active_session.unhold() self.ignore_local_hold = True self.ignore_local_unhold = True else: return identity = str(self.active_session.remote_identity.uri) if self.active_session.remote_identity.display_name: identity = '"%s" <%s>' % (self.active_session.remote_identity.display_name, identity) self.output.put('Active audio session: "%s" (%d/%d)\n' % (identity, self.started_sessions.index(self.active_session)+1, len(self.started_sessions))) elif notification.data.input in ('<', ','): new_tail_length = self.voice_conference_bridge.ec_tail_length - 10 if new_tail_length < 0: new_tail_length = 0 if new_tail_length != self.voice_conference_bridge.ec_tail_length: self.voice_conference_bridge.set_sound_devices(self.voice_conference_bridge.input_device, self.voice_conference_bridge.output_device, new_tail_length) self.output.put('Set echo cancellation tail length to %d ms\n' % self.voice_conference_bridge.ec_tail_length) elif notification.data.input in ('>', '.'): new_tail_length = self.voice_conference_bridge.ec_tail_length + 10 if new_tail_length > 500: new_tail_length = 500 if new_tail_length != self.voice_conference_bridge.ec_tail_length: self.voice_conference_bridge.set_sound_devices(self.voice_conference_bridge.input_device, self.voice_conference_bridge.output_device, new_tail_length) self.output.put('Set echo cancellation tail length to %d ms\n' % self.voice_conference_bridge.ec_tail_length) elif notification.data.input == 'r': if self.active_session is None or not self.active_session.streams: return session = self.active_session audio_stream = self.active_session.streams[0] if audio_stream.recording_active: audio_stream.stop_recording() else: audio_stream.start_recording() elif notification.data.input == 'p': if self.rtp_statistics is None: self.rtp_statistics = RTPStatisticsThread(self) self.rtp_statistics.start() self.output.put('Output of RTP statistics on console is now activated\n') else: self.rtp_statistics.stop() self.rtp_statistics = None self.output.put('Output of RTP statistics on console is now dectivated\n') elif notification.data.input == 'j': self.logger.pjsip_to_stdout = not self.logger.pjsip_to_stdout engine.log_level = settings.logs.pjsip_level if (self.logger.pjsip_to_stdout or settings.logs.trace_pjsip) else 0 self.output.put('PJSIP tracing to console is now %s\n' % ('activated' if self.logger.pjsip_to_stdout else 'deactivated')) elif notification.data.input == 'n': self.logger.notifications_to_stdout = not self.logger.notifications_to_stdout self.output.put('Notification tracing to console is now %s.\n' % ('activated' if self.logger.notifications_to_stdout else 'deactivated')) elif notification.data.input == 's': self.logger.sip_to_stdout = not self.logger.sip_to_stdout engine.trace_sip = self.logger.sip_to_stdout or settings.logs.trace_sip self.output.put('SIP tracing to console is now %s\n' % ('activated' if self.logger.sip_to_stdout else 'deactivated'))
4c7f171f333c7fb3d79c3e39cdb2649589263477 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/4c7f171f333c7fb3d79c3e39cdb2649589263477/sip_audio_session.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 50, 44, 67, 17739, 3208, 15617, 1210, 12, 2890, 16, 3851, 4672, 4073, 273, 10507, 1435, 3851, 67, 5693, 273, 8050, 8449, 1435, 1947, 273, 348, 2579, 5784, 2628, 1435, 309, 3851, 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, 50, 44, 67, 17739, 3208, 15617, 1210, 12, 2890, 16, 3851, 4672, 4073, 273, 10507, 1435, 3851, 67, 5693, 273, 8050, 8449, 1435, 1947, 273, 348, 2579, 5784, 2628, 1435, 309, 3851, 18,...
cu.execute("""insert into tmpDups (counter, instanceId, path)
cu.execute(""" insert into tmpDups (counter, instanceId, path)
def fixDuplicatePaths(self, cu, repos): self.db.dropIndex("TroveFiles", "TroveFilesPathIdx") # it is faster to select all the (instanceId, path) pairs into # an indexed table than create a non-unique index, do work, # drop the non-unique index and recreate it as a unique one cu.execute(""" create temporary table tmpDupPath( instanceId integer not null, path varchar(767) not null ) %(TABLEOPTS)s""" % self.db.keywords) self.db.createIndex("tmpDupPath", "tmpDupPathIdx", "instanceId, path", check = False) cu.execute(""" create temporary table tmpDups( counter integer, instanceId integer, path varchar(767) ) %(TABLEOPTS)s""" % self.db.keywords) logMe(2, "searching the trovefiles table...") cu.execute("insert into tmpDupPath (instanceId, path) " "select instanceId, path from TroveFiles") logMe(2, "looking for troves with duplicate paths...") cu.execute("""insert into tmpDups (counter, instanceId, path) select count(*) as c, instanceId, path from tmpDupPath group by instanceId, path having c > 1""") counter = cu.execute("select count(*) from tmpDups").fetchall()[0][0] logMe(3, "detected %d duplicates" % (counter,)) # loop over every duplicate and apply the appropiate fix cu.execute("select instanceId, path from tmpDups") for (instanceId, path) in cu.fetchall(): cu.execute("""select distinct instanceId, streamId, versionId, pathId, path from trovefiles where instanceId = ? and path = ? order by streamId, versionId, pathId""", (instanceId, path)) ret = cu.fetchall() # delete all the duplicates and put the first one back cu.execute("delete from trovefiles " "where instanceId = ? and path = ?", (instanceId, path)) # in case they are different, we pick the oldest, chances are it is # more "original" cu.execute("insert into trovefiles " "(instanceId, streamId, versionId, pathId, path) " "values (?,?,?,?,?)", tuple(ret[0])) if len(ret) > 1: # need to recompute the sha1 - we might have changed the trove manifest # if the records were different self.fixTroveSig(repos, instanceId)
d623e580880aec3d60196876d2653733c42b616c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/d623e580880aec3d60196876d2653733c42b616c/migrate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 11826, 4466, 12, 2890, 16, 15985, 16, 13686, 4672, 365, 18, 1966, 18, 7285, 1016, 2932, 56, 303, 537, 2697, 3113, 315, 56, 303, 537, 2697, 743, 4223, 7923, 468, 518, 353, 12063, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 11826, 4466, 12, 2890, 16, 15985, 16, 13686, 4672, 365, 18, 1966, 18, 7285, 1016, 2932, 56, 303, 537, 2697, 3113, 315, 56, 303, 537, 2697, 743, 4223, 7923, 468, 518, 353, 12063, ...
menu_item.get_children()[0].set_label(task.get_title())
menu_item.get_children()[0].set_label(title)
def add_menu_task(self, tid): """Adds a task in the menu, trimming the title if necessary""" task = self.plugin_api.get_task(tid) if self.tasks_in_menu.has_key(tid): #task is already in the menu, updating the title menu_item = self.tasks_in_menu[tid] menu_item.get_children()[0].set_label(task.get_title()) return #trimming of the title title = task.get_title()[0:self.MAX_TITLE_LEN] if len(title)== self.MAX_TITLE_LEN: title = title + "..." #putting a separator between the tasks and the static menu if self.task_separator == None: self.task_separator = gtk.SeparatorMenuItem() self.task_separator.show() self.menu.append(self.task_separator) #creating the menu item menu_item = gtk.ImageMenuItem(title) menu_item.connect('activate', self.open_task, tid) menu_item.show() self.menu.append(menu_item) self.tasks_in_menu[tid] = menu_item
5ff5914b85a49c1326c31c9073f84ad78d4ae722 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5ff5914b85a49c1326c31c9073f84ad78d4ae722/notification_area.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 5414, 67, 4146, 12, 2890, 16, 11594, 4672, 3536, 3655, 279, 1562, 316, 326, 3824, 16, 2209, 11987, 326, 2077, 309, 4573, 8395, 1562, 273, 365, 18, 4094, 67, 2425, 18, 588, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 5414, 67, 4146, 12, 2890, 16, 11594, 4672, 3536, 3655, 279, 1562, 316, 326, 3824, 16, 2209, 11987, 326, 2077, 309, 4573, 8395, 1562, 273, 365, 18, 4094, 67, 2425, 18, 588, 67,...
code = co.co_code
def getargs(co): """Get information about the arguments accepted by a code object. Three things are returned: (args, varargs, varkw), where 'args' is a list of argument names (possibly containing nested lists), and 'varargs' and 'varkw' are the names of the * and ** arguments or None.""" if not iscode(co): raise TypeError('arg is not a code object') code = co.co_code nargs = co.co_argcount names = co.co_varnames args = list(names[:nargs]) step = 0 # The following acrobatics are for anonymous (tuple) arguments. for i in range(nargs): if args[i][:1] in ('', '.'): stack, remain, count = [], [], [] while step < len(code): op = ord(code[step]) step = step + 1 if op >= dis.HAVE_ARGUMENT: opname = dis.opname[op] value = ord(code[step]) + ord(code[step+1])*256 step = step + 2 if opname in ('UNPACK_TUPLE', 'UNPACK_SEQUENCE'): remain.append(value) count.append(value) elif opname == 'STORE_FAST': stack.append(names[value]) # Special case for sublists of length 1: def foo((bar)) # doesn't generate the UNPACK_TUPLE bytecode, so if # `remain` is empty here, we have such a sublist. if not remain: stack[0] = [stack[0]] break else: remain[-1] = remain[-1] - 1 while remain[-1] == 0: remain.pop() size = count.pop() stack[-size:] = [stack[-size:]] if not remain: break remain[-1] = remain[-1] - 1 if not remain: break args[i] = stack[0] varargs = None if co.co_flags & CO_VARARGS: varargs = co.co_varnames[nargs] nargs = nargs + 1 varkw = None if co.co_flags & CO_VARKEYWORDS: varkw = co.co_varnames[nargs] return args, varargs, varkw
9c1794b7c371677c0a6a144a62be5edb8cd52193 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/9c1794b7c371677c0a6a144a62be5edb8cd52193/inspect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1968, 12, 2894, 4672, 3536, 967, 1779, 2973, 326, 1775, 8494, 635, 279, 981, 733, 18, 225, 935, 992, 9198, 854, 2106, 30, 261, 1968, 16, 19732, 16, 569, 9987, 3631, 1625, 296, 196...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1968, 12, 2894, 4672, 3536, 967, 1779, 2973, 326, 1775, 8494, 635, 279, 981, 733, 18, 225, 935, 992, 9198, 854, 2106, 30, 261, 1968, 16, 19732, 16, 569, 9987, 3631, 1625, 296, 196...
i += 1
def makeHeader(dg): return { 'album': dg('album', 'Unknown'), 'artist': dg('albumartist', dg('artist', 'Unknown')), 'file': dg('file'), 'cls': 'album-group-start', 'id': 'aa' + i } i += 1
0c090b490984e55255994acb6c3987b098859c0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4699/0c090b490984e55255994acb6c3987b098859c0a/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 1864, 12, 72, 75, 4672, 327, 288, 296, 25090, 4278, 14938, 2668, 25090, 2187, 296, 4874, 19899, 296, 25737, 4278, 14938, 2668, 25090, 25737, 2187, 14938, 2668, 25737, 2187, 296, 4874, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1864, 12, 72, 75, 4672, 327, 288, 296, 25090, 4278, 14938, 2668, 25090, 2187, 296, 4874, 19899, 296, 25737, 4278, 14938, 2668, 25090, 25737, 2187, 14938, 2668, 25737, 2187, 296, 4874, ...
if self.treeview.get_columns() == []: emptycolumn = gtk.TreeViewColumn('') emptycolumn.pack_start(togglerenderer) emptycolumn.set_attributes(togglerenderer, active=1) emptycolumn.set_clickable(True) emptycolumn.connect('clicked', self.on_treeview_column_clicked,\ self.liststore, 1) repositorycolumn = gtk.TreeViewColumn('Repository') repositorycolumn.set_sort_column_id(5) repositorycolumn.pack_start(textrenderer) repositorycolumn.set_attributes(textrenderer, text=5) namecolumn = gtk.TreeViewColumn('Name', textrenderer, markup=2) namecolumn.set_sort_column_id(0) availableversioncolumn = gtk.TreeViewColumn('Available') availableversioncolumn.set_sort_column_id(4) availableversioncolumn.pack_start(textrenderer) availableversioncolumn.set_attributes(textrenderer, markup=4) installedversioncolumn = gtk.TreeViewColumn('Installed') installedversioncolumn.set_sort_column_id(3) installedversioncolumn.pack_start(textrenderer) installedversioncolumn.set_attributes(textrenderer, markup=3) self.treeview.append_column(emptycolumn) self.treeview.append_column(namecolumn) self.treeview.append_column(installedversioncolumn) self.treeview.append_column(availableversioncolumn) self.treeview.append_column(repositorycolumn)
for col in self.treeview.get_columns(): self.treeview.remove_column(col) emptycolumn = gtk.TreeViewColumn('') emptycolumn.pack_start(togglerenderer) emptycolumn.set_attributes(togglerenderer, active=1) emptycolumn.set_clickable(True) emptycolumn.connect('clicked', self.on_treeview_column_clicked,\ self.liststore, 1) repositorycolumn = gtk.TreeViewColumn('Repository') repositorycolumn.set_sort_column_id(5) repositorycolumn.pack_start(textrenderer) repositorycolumn.set_attributes(textrenderer, markup=5) namecolumn = gtk.TreeViewColumn('Name', textrenderer, markup=2) namecolumn.set_sort_column_id(0) availableversioncolumn = gtk.TreeViewColumn('Available') availableversioncolumn.set_sort_column_id(4) availableversioncolumn.pack_start(textrenderer) availableversioncolumn.set_attributes(textrenderer, markup=4) installedversioncolumn = gtk.TreeViewColumn('Installed') installedversioncolumn.set_sort_column_id(3) installedversioncolumn.pack_start(textrenderer) installedversioncolumn.set_attributes(textrenderer, markup=3) self.treeview.append_column(emptycolumn) self.treeview.append_column(namecolumn) self.treeview.append_column(installedversioncolumn) self.treeview.append_column(availableversioncolumn) self.treeview.append_column(repositorycolumn)
def on_search_clicked(self, button): import cgi already_seen_pkgs = {} already_seen_groups = {} # grp name => iter
838e03199ad140730985ae533020f13e50257567 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2759/838e03199ad140730985ae533020f13e50257567/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 3072, 67, 7475, 329, 12, 2890, 16, 3568, 4672, 1930, 276, 10052, 1818, 67, 15156, 67, 25376, 273, 2618, 1818, 67, 15156, 67, 4650, 273, 2618, 468, 14295, 508, 516, 1400, 2, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 3072, 67, 7475, 329, 12, 2890, 16, 3568, 4672, 1930, 276, 10052, 1818, 67, 15156, 67, 25376, 273, 2618, 1818, 67, 15156, 67, 4650, 273, 2618, 468, 14295, 508, 516, 1400, 2, -1...
h << 'Password:' << h.input(type='password', lenght=10).action(self.password)
h << 'Password:' << h.input(type='password', length=10).action(self.password)
def render(self, h, *args): h.head.css('form-errors', ''' .errors { border-top: 2px solid #c30; border-bottom: 2px solid #c30; background-color: #FFD5D5; margin: 8px; } .errors ol { margin: 4px 0 4px 0; } .errors ol li { font-size: 60%; font-weight: bold; } ''') errors = [(name, error) for (name, error) in ( ('Age', self.age.error), ('Text', self.area.error), ('Password', self.confirm.error) ) if error] if len(errors): with h.div(class_='errors'): h << h.ol([h.li('%s: %s' % error) for error in errors]) # The ``pre_action`` of the ``<form>`` element is used to reset some data with h.form.pre_action(self.reset_values).post_action(self.commit): h << 'Age (between 10 and 50): ' << h.input(value=self.age()).action(self.age) h << h.br with h.fieldset: h << h.legend('A set of controls') h << 'A text (use only "[a-d]" characters):' h << h.textarea(self.area(), rows='2', cols='40').action(self.area) h << h.br << h.br h << 'Big' << h.input(type='checkbox').selected(self.big()).action(self.big) h << 'Medium' << h.input(type='checkbox').selected(self.medium()).action(self.medium) h << 'Small' << h.input(type='checkbox').selected(self.small()).action(self.small) h << h.br h << 'Male' h << h.input(type='radio', name='gender').selected(self.gender()=='male').action(lambda: self.gender('male')) h << ' Female' h << h.input(type='radio', name='gender').selected(self.gender()=='female').action(lambda: self.gender('female')) with h.select(multiple='multiple').action(self.color): with h.optgroup(label='Colors'): h << h.option('blue', value='blue').selected(self.color()) h << h.option('white', value='white').selected(self.color()) h << h.option('red', value='red').selected(self.color()) h << h.br << h.br h << 'Upload a file:' << h.input(type='file').action(self.file) << h.br h << 'Password:' << h.input(type='password', lenght=10).action(self.password) h << ' ' h << 'Confirm:' << h.input(type='password', length=10).action(self.confirm) h << h.hr h << h.input(type='submit', value='Go') return h.root
27a37301ac3b46b5f99208f516828c668d5a69cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11207/27a37301ac3b46b5f99208f516828c668d5a69cb/form.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 366, 16, 380, 1968, 4672, 366, 18, 1978, 18, 5212, 2668, 687, 17, 4324, 2187, 9163, 263, 4324, 288, 5795, 17, 3669, 30, 576, 4430, 18035, 468, 71, 5082, 31, 5795, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 366, 16, 380, 1968, 4672, 366, 18, 1978, 18, 5212, 2668, 687, 17, 4324, 2187, 9163, 263, 4324, 288, 5795, 17, 3669, 30, 576, 4430, 18035, 468, 71, 5082, 31, 5795, ...
(vstat, odata) = self.saferun("/usr/sbin/pkgchk -n %s" % (entry.get('name'))) if vstat == 0: return True else: output = [line for line in odata if line[:5] == 'ERROR'] if len([name for name in output if name.split()[-1] not in modlist]): self.logger.debug("Package %s content verification failed" % (entry.get('name'))) else: return True
def VerifyPackage(self, entry, modlist): '''Verify Package status for entry''' if not entry.get('version'): self.logger.info("Insufficient information of Package %s; cannot Verify" % entry.get('name')) return False if entry.get('type') in ['sysv', 'blast'] or entry.get('type')[:4] == 'sysv': cmdrc = self.saferun("/usr/bin/pkginfo -q -v \"%s\" %s" % (entry.get('version'), entry.get('name')))[0] elif entry.get('type') in ['encap']: cmdrc = self.saferun("/local/sbin/epkg -q -k %s-%s >/dev/null" % (entry.get('name'), entry.get('version')))[0] if cmdrc != 0: self.logger.debug("Package %s version incorrect" % entry.get('name')) else: if entry.attrib.get('verify', 'true') == 'true': if self.setup['quick'] or entry.get('type') == 'encap': return True (vstat, odata) = self.saferun("/usr/sbin/pkgchk -n %s" % (entry.get('name'))) if vstat == 0: return True else: output = [line for line in odata if line[:5] == 'ERROR'] if len([name for name in output if name.split()[-1] not in modlist]): self.logger.debug("Package %s content verification failed" % (entry.get('name'))) else: return True return False
0f732319cf69e2195b85bdade7823d439634dbae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/0f732319cf69e2195b85bdade7823d439634dbae/Solaris.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8553, 2261, 12, 2890, 16, 1241, 16, 681, 1098, 4672, 9163, 8097, 7508, 1267, 364, 1241, 26418, 309, 486, 1241, 18, 588, 2668, 1589, 11, 4672, 365, 18, 4901, 18, 1376, 2932, 5048, 11339, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8553, 2261, 12, 2890, 16, 1241, 16, 681, 1098, 4672, 9163, 8097, 7508, 1267, 364, 1241, 26418, 309, 486, 1241, 18, 588, 2668, 1589, 11, 4672, 365, 18, 4901, 18, 1376, 2932, 5048, 11339, ...
(child_pid, x, x, x) = gobject.spawn_async( [misc.find_path("python"), "-O", os.path.join(wpath.lib, "monitor.py")], flags=gobject.SPAWN_CHILD_INHERITS_STDIN )
(child_pid, x, y, z) = gobject.spawn_async( [misc.find_path("python"), "-O", os.path.join(wpath.lib, "monitor.py")])
def main(argv): """ The main daemon program. Keyword arguments: argv -- The arguments passed to the script. """ global child_pid do_daemonize = True redirect_stderr = True redirect_stdout = True auto_connect = True try: opts, args = getopt.getopt(sys.argv[1:], 'fenoah', ['help', 'no-daemon', 'no-poll', 'no-stderr', 'no-stdout', 'no-autoconnect']) except getopt.GetoptError: # Print help information and exit usage() sys.exit(2) no_poll = False for o, a in opts: if o in ('-h', '--help'): usage() sys.exit() if o in ('-e', '--no-stderr'): redirect_stderr = False if o in ('-o', '--no-stdout'): redirect_stdout = False if o in ('-f', '--no-daemon'): do_daemonize = False if o in ('-a', '--no-autoconnect'): auto_connect = False if o in ('-n', '--no-poll'): no_poll = True if do_daemonize: daemonize() if redirect_stderr or redirect_stdout: logpath = os.path.join(wpath.log, 'wicd.log') if not os.path.exists(wpath.log): os.makedirs(wpath.log) os.chmod(wpath.log, 755) output = ManagedStdio(logpath) if os.path.exists(logpath): try: os.chmod(logpath, 0600) except: print 'unable to chmod log file to 0600' if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output print '---------------------------' print 'wicd initializing...' print '---------------------------' # Open the DBUS session bus = dbus.SystemBus() wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus) daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect) if not no_poll: (child_pid, x, x, x) = gobject.spawn_async( [misc.find_path("python"), "-O", os.path.join(wpath.lib, "monitor.py")], flags=gobject.SPAWN_CHILD_INHERITS_STDIN ) signal.signal(signal.SIGTERM, sigterm_caught) # Enter the main loop mainloop = gobject.MainLoop() try: mainloop.run() except KeyboardInterrupt: pass daemon.DaemonClosing() sigterm_caught()
e162bb1c7b1fcf99179ee4b6e60f75ebaa9efb8f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12280/e162bb1c7b1fcf99179ee4b6e60f75ebaa9efb8f/wicd-daemon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 3536, 1021, 2774, 8131, 5402, 18, 225, 18317, 1775, 30, 5261, 1493, 1021, 1775, 2275, 358, 326, 2728, 18, 225, 3536, 2552, 1151, 67, 6610, 741, 67, 21511, 554, 273...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 3536, 1021, 2774, 8131, 5402, 18, 225, 18317, 1775, 30, 5261, 1493, 1021, 1775, 2275, 358, 326, 2728, 18, 225, 3536, 2552, 1151, 67, 6610, 741, 67, 21511, 554, 273...
FL_Coord, STRING],
FL_Coord, STRING],
def fl_create_thumbwheel(type, x, y, w, h, label): """ fl_create_thumbwheel(type, x, y, w, h, label) -> object """ retval = _fl_create_thumbwheel(type, x, y, w, h, label) 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, 2640, 67, 21639, 21344, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 21639, 21344, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2640, 67, 21639, 21344, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 21639, 21344, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, ...
box = '''<table class="navbox">
box = '''<table class="navbox" width="210">
def login(self, uri, user): if self.command_line==1: return '' if user: log(3, 'Creating active user box') box = '''<table class="navbox"> <tr><th>|stractive_user|</th></tr> <form name="logout" action="/data/session/logout"> <input name="username" type="hidden" value="%s"> <tr><td align="center"> <a href="/user/|session_username||uri.lang_ext|">|session_name|</a> </td></tr> <tr><td align="center"><input type="submit" name="logout" value="|strlog_out|"></td></tr> </form> </table> ''' % user.username else: log(3, 'Creating login box') box = '''<table class="navbox"> <tr><th colspan="2">|strlogin|</th></tr> <form name="login" action="/data/session/login" method="GET"> <tr> <td class="label">|strusername|</td> <td><input type="text" name="username" size="12"></td> </tr> <tr> <td class="label">|strpassword|</td> <td><input type="password" name="password" size="12"></td> </tr> <tr> <td align="center" colspan="2"> <input type=submit name="login" value="login"><br> <a href="/mailpass">|strmail_passwd||uri.lang_ext|</a><br> <a href="/newuser|uri.lang_ext|">|strcreate_acct|</a></td> </tr> </form> </table> ''' return box
082273c82228cdbe8b4f226333276a401090d396 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6947/082273c82228cdbe8b4f226333276a401090d396/HTML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 2890, 16, 2003, 16, 729, 4672, 309, 365, 18, 3076, 67, 1369, 631, 21, 30, 327, 875, 309, 729, 30, 613, 12, 23, 16, 296, 11092, 2695, 729, 3919, 6134, 3919, 273, 9163, 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, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 2890, 16, 2003, 16, 729, 4672, 309, 365, 18, 3076, 67, 1369, 631, 21, 30, 327, 875, 309, 729, 30, 613, 12, 23, 16, 296, 11092, 2695, 729, 3919, 6134, 3919, 273, 9163, 32, ...
for j in binaries[arch][0][binary]['rdepends']: key = (j, arch)
for j in binaries[parch][0][binary]['rdepends']: key = (j, parch)
def doop_source(self, pkg): """Apply a change to the testing distribution as requested by `pkg`
b8d4deefd1e15dc48987f2d10c01b6f060204f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/b8d4deefd1e15dc48987f2d10c01b6f060204f30/britney.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 556, 67, 3168, 12, 2890, 16, 3475, 4672, 3536, 7001, 279, 2549, 358, 326, 7769, 7006, 487, 3764, 635, 1375, 10657, 68, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 556, 67, 3168, 12, 2890, 16, 3475, 4672, 3536, 7001, 279, 2549, 358, 326, 7769, 7006, 487, 3764, 635, 1375, 10657, 68, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if not len (sys.argv) >= 2 or sys.argv[1] not in ops:
if len (sys.argv) < 2 or sys.argv[1] not in ops:
def run (self): try: file = open (INSTALLED_FILES, "r") except: self.warn ("Could not read installed files list %s" % \ INSTALLED_FILES) return files = file.readlines () file.close () prepend = "" if self.root: prepend += self.root if self.prefix: prepend += self.prefix if len (prepend): for counter in xrange (len (files)): files[counter] = prepend + files[counter].rstrip () for file in files: print "Uninstalling %s" % file try: os.unlink (file) except: self.warn ("Could not remove file %s" % file)
b60ca202739b35ce0b3c3886c733e31128273377 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7062/b60ca202739b35ce0b3c3886c733e31128273377/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 261, 2890, 4672, 775, 30, 585, 273, 1696, 261, 19784, 27751, 67, 12669, 16, 315, 86, 7923, 1335, 30, 365, 18, 8935, 7566, 4445, 486, 855, 5876, 1390, 666, 738, 87, 6, 738, 521, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 261, 2890, 4672, 775, 30, 585, 273, 1696, 261, 19784, 27751, 67, 12669, 16, 315, 86, 7923, 1335, 30, 365, 18, 8935, 7566, 4445, 486, 855, 5876, 1390, 666, 738, 87, 6, 738, 521, ...
name = item[item.rfind('/') + 1:] cmd = [ options.runchandler['release'], '--catch=tests',
name = item[item.rfind('/') + 1:] cmd = options.runchandler['release'][:] cmd += ['--catch=tests',
def runScriptPerfTests(options, testlist, largeData=False, repeat=1, logger=log): """ Run script performance tests. >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> runScriptPerfTests(options, ['foobar']) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar --create foobar 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> runScriptPerfTests(options, ['foobar'], largeData=True) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar --restore=test_profile/__repository__.001 foobar 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False >>> options.profile = True >>> runScriptPerfTests(options, ['foobar.py']) /.../release/RunChandler --catch=tests --profileDir=test_profile --parcelPath=tools/cats/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=foobar.py --catsProfile=test_profile/foobar.hotshot --create foobar.py 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | 0.00 ... 0.00 False """ failed = False l = len(options.chandlerHome) + 1 timeLog = os.path.join(options.profileDir, 'time.log') if repeat == 1: just = 20 elif repeat == 2: just = 13 else: just = 6 for item in testlist: #$CHANDLERBIN/release/$RUN_CHANDLER --create --catch=tests # --profileDir="$PC_DIR" # --catsPerfLog="$TIME_LOG" # --scriptFile="$TESTNAME" &> $TESTLOG if item.startswith(options.chandlerHome): item = item[l:] name = item[item.rfind('/') + 1:] cmd = [ options.runchandler['release'], '--catch=tests', '--profileDir=%s' % options.profileDir, '--parcelPath=%s' % options.parcelPath, '--catsPerfLog=%s' % timeLog, '--scriptFile=%s' % item ] if options.profile: cmd += ['--catsProfile=%s.hotshot' % os.path.join(options.profileDir, name[:-3])] if not largeData: cmd += ['--create'] else: cmd += ['--restore=%s' % os.path.join(options.profileDir, '__repository__.001')] if options.params: cmd += [ options.params ] if options.verbose: log(' '.join(cmd)) values = [] log(name.ljust(33), newline=' ') for _x in range(repeat): if not options.dryrun: if os.path.isfile(timeLog): os.remove(timeLog) if options.dryrun: result = 0 else: tempLogger = DelayedLogger() result = build_lib.runCommand(cmd, timeout=1800, logger=tempLogger) if result != 0: if options.tbox: if result == -9: log("***Error: A timeout error has happened for %s" % name) log("***Error: The process output will be dumped below but it may be incomplete") log("***Error: due to the process either crashing or being killed.") # Strip OSAF_QA lines because we don't want to include # results from failed runs for args, kw in tempLogger.delayed: if not args[0].startswith('OSAF_QA: '): log(*args, **kw) else: tempLogger.logAll() log('***Error exit code=%d, %s' % (result, name)) failed = True failedTests.append(item) if not options.noStop: break else: if options.dryrun: value = 0.00 else: if os.path.isfile(timeLog): value = float(open(timeLog).readline()[:-1]) else: log('\ntimeLog [%s] not found' % timeLog) failed = True failedTests.append(item) if not options.noStop: break log(('%02.2f' % value).rjust(just), newline=' ') if not options.dryrun: values.append((value, tempLogger)) else: values.append((value, None)) if options.dryrun: log('- + ' * 15) else: tempLogger('- + ' * 15) else: try: originalValues = values[:] values.sort() value = values[repeat/2] log(' | ', newline='') log(('%02.2f' % value[0]).rjust(6) , newline='') log(u' \u00B1 '.encode('utf8'), newline='') # Unicode PLUS-MINUS SIGN log(('%02.2f' % stddev([x for x, _y in values])).rjust(6)) if not options.dryrun: if options.tbox: for args, kw in value[1].delayed: logger(*args, **kw) else: for _n, tempLogger in originalValues: for args, kw in tempLogger.delayed: logger(*args, **kw) except IndexError: if not options.noStop: raise if failed and not options.noStop: break return failed
64e3ec7e167097dc0b4afb4eadc40bc6adec660f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/64e3ec7e167097dc0b4afb4eadc40bc6adec660f/rt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 3651, 22016, 14650, 12, 2116, 16, 1842, 1098, 16, 7876, 751, 33, 8381, 16, 7666, 33, 21, 16, 1194, 33, 1330, 4672, 3536, 1939, 2728, 9239, 7434, 18, 225, 4080, 702, 273, 1109, 13...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 3651, 22016, 14650, 12, 2116, 16, 1842, 1098, 16, 7876, 751, 33, 8381, 16, 7666, 33, 21, 16, 1194, 33, 1330, 4672, 3536, 1939, 2728, 9239, 7434, 18, 225, 4080, 702, 273, 1109, 13...
> <doctest foo[1]>(1)<module>()
> <doctest foo[1]>(1)<...>()
-> def f2(self):
20069c315e46fe6a82c9f4bca9fbdf5948133373 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/20069c315e46fe6a82c9f4bca9fbdf5948133373/test_doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 317, 1652, 284, 22, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 317, 1652, 284, 22, 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,...
If $m$ is the input length of this S-box then the extension field is of degree $m$.
If ``m`` is the input length of this S-box then the extension field is of degree ``m``.
def interpolation_polynomial(self, k=None): r""" Return a univariate polynomial over an extension field representing this S-box.
16527da1ddc0ac750f609cd58858c5b45d932696 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/16527da1ddc0ac750f609cd58858c5b45d932696/sbox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12851, 67, 3915, 13602, 12, 2890, 16, 417, 33, 7036, 4672, 436, 8395, 2000, 279, 640, 27693, 16991, 1879, 392, 2710, 652, 5123, 333, 348, 17, 2147, 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, 12851, 67, 3915, 13602, 12, 2890, 16, 417, 33, 7036, 4672, 436, 8395, 2000, 279, 640, 27693, 16991, 1879, 392, 2710, 652, 5123, 333, 348, 17, 2147, 18, 2, -100, -100, -100, -100, -100, ...
"Export File",
"Open Babel Export",
def fileOpenBabelExport(self): # Fixed up by Mark. 2007-06-05 """ Slot method for 'File > Export'. Exported files contain all atoms, including invisible and hidden atoms. This is considered a bug. """ # To Do: Mark 2007-06-05 # # - Export only visible atoms, etc.
3fffc74d4543bd35c1416542a2c993ffcb039e5f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/3fffc74d4543bd35c1416542a2c993ffcb039e5f/ops_files.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 585, 3678, 38, 873, 6144, 12, 2890, 4672, 468, 15038, 731, 635, 6622, 18, 4044, 27, 17, 7677, 17, 6260, 3536, 23195, 707, 364, 296, 812, 405, 11054, 10332, 1312, 1798, 1390, 912, 777, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 585, 3678, 38, 873, 6144, 12, 2890, 4672, 468, 15038, 731, 635, 6622, 18, 4044, 27, 17, 7677, 17, 6260, 3536, 23195, 707, 364, 296, 812, 405, 11054, 10332, 1312, 1798, 1390, 912, 777, ...
dialog = ReportDialog(self, "Batting register", str(bs))
dialog = wxMessageDialog(self, "An internal error occurred in " "generating the report.\n" "Please send a bug report to " "the maintaner at " "turocy@econmail.tamu.edu\n" "It is helpful to include this scorebook " "as an " "attachment when you send the report.\n" "The problem deals only with this " "report: don't worry, " "your data is unaffected.\n" "We apologize for the inconvenience!\n", "Oops! There's a bug in Chadwick", wxOK | wxICON_EXCLAMATION)
def OnReportRegisterBatting(self, event): bs = statscan.BattingAccumulator() dialog = wxProgressDialog("Generating batting register", "Generating batting register", 100, self, wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_CAN_ABORT | wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME) if statscan.ProcessFile(self.book, [ bs ], dialog): dialog.Show(false)
a472aff44170d13576d93aef10c05dfe716b786d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10056/a472aff44170d13576d93aef10c05dfe716b786d/chadwick.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 4820, 3996, 38, 270, 1787, 12, 2890, 16, 871, 4672, 7081, 273, 610, 9871, 18, 38, 270, 1787, 27361, 1435, 6176, 273, 7075, 5491, 6353, 2932, 21755, 27464, 1787, 1744, 3113, 315, 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, 2755, 4820, 3996, 38, 270, 1787, 12, 2890, 16, 871, 4672, 7081, 273, 610, 9871, 18, 38, 270, 1787, 27361, 1435, 6176, 273, 7075, 5491, 6353, 2932, 21755, 27464, 1787, 1744, 3113, 315, 21...
def insertJobSpec(dbInterface, jobSpecId, jobSpecFile, jobType, workflowId, workflowPriority, siteName = None, status = "new"):
def insertJobSpec(dbInterface, dbConn, jobSpecId, jobSpecFile, jobType, workflowId, workflowPriority, siteName = None, status = "new"):
def insertJobSpec(dbInterface, jobSpecId, jobSpecFile, jobType, workflowId, workflowPriority, siteName = None, status = "new"): """ _insertJobSpec_ Insert a single job spec for a single site into the job queue. """ logging.debug("insertJobSpec(): Running...") jobSpecDict = {"JobSpecId": jobSpecId, "JobSpecFile": jobSpecFile, "JobType": jobType, "WorkflowSpecId": workflowId, "WorkflowPriority": workflowPriority, "SiteList": siteName} validateJobSpecDict(jobSpecDict) queueQuery = """INSERT INTO jq_queue (job_spec_id, job_spec_file, job_type, workflow_id, priority, status) VALUES (:p_1, :p_2, :p_3, :p_4, :p_5, :p_6)""" bindVars = {"p_1": jobSpecId, "p_2": jobSpecFile, "p_3": jobType, "p_4": workflowId, "p_5": workflowPriority, "p_6": status} dbInterface.processData(queueQuery, bindVars, transaction = True) if siteName == None: siteQuery = """INSERT INTO jq_site (job_index) SELECT job_index FROM jq_queue WHERE job_spec_id = :p_1""" bindVars = {"p_1": jobSpecId} dbInterface.processData(siteQuery, bindVars, transaction = True) else: siteQuery = """INSERT INTO jq_site (job_index, site_index) VALUES ( (SELECT job_index FROM jq_queue WHERE job_spec_id = :p_1), (SELECT site_index FROM rc_site WHERE se_name = :p_2)) """ bindVars = {"p_1": jobSpecId, "p_2": siteName} dbInterface.processData(siteQuery, bindVars, transaction = True) return
74daf97071b278bf205a43523f70120df8f62d0f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8887/74daf97071b278bf205a43523f70120df8f62d0f/JobQueueDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 2278, 1990, 12, 1966, 1358, 16, 30795, 16, 1719, 1990, 548, 16, 1719, 1990, 812, 16, 1719, 559, 16, 6095, 548, 16, 6095, 8183, 16, 27712, 273, 599, 16, 1267, 273, 315, 2704, 6, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 2278, 1990, 12, 1966, 1358, 16, 30795, 16, 1719, 1990, 548, 16, 1719, 1990, 812, 16, 1719, 559, 16, 6095, 548, 16, 6095, 8183, 16, 27712, 273, 599, 16, 1267, 273, 315, 2704, 6, ...
if testfunc(a, b):
if not testfunc(a, b):
def ClusterSnglBurstTable(sngl_burst_table, testfunc, clusterfunc, bailoutfunc = None): """ Cluster the candidates in the sngl_burst table. testfunc will be passed a pair in random order, and must return 0 (or False) if they should be clustered. clusterfunc will be passed a pair of candidates in random order, and must modify the contents of the first so as to be a "cluster" of the two. If bailoutfunc is not None, the candidates will be sorted into "increasing" order using testfunc as a comparison operator, and then only pairs of candidates for which bailoutfunc returns 0 (or False) will be considered for clustering. When used this way, testfunc must return a numeric result indicating the sort order of the two candidates it has been passed: >0 if the first is "greater" than the second, <0 if the first is "less" than the second, and 0 if the order does not matter (like a subtraction operator). The return value is True if the sngl_burst table was modified, and False if it was not. """ table_changed = False outer_did_cluster = True while outer_did_cluster: outer_did_cluster = False if bailoutfunc is not None: sngl_burst_table.sort(testfunc) i = 0 while i < len(sngl_burst_table): a = sngl_burst_table[i] j = i + 1 inner_did_cluster = False while j < len(sngl_burst_table): b = sngl_burst_table[j] if testfunc(a, b): clusterfunc(a, sngl_burst_table.pop(j)) table_changed = outer_did_cluster = inner_did_cluster = True elif bailoutfunc is not None and bailoutfunc(a, b): break else: j += 1 if not inner_did_cluster: i += 1 return table_changed
fb90fb8d787350a86c8316e8bcf95c9695de1ba1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/fb90fb8d787350a86c8316e8bcf95c9695de1ba1/ligolw_bucluster.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5584, 55, 3368, 80, 38, 18593, 1388, 12, 87, 3368, 80, 67, 70, 18593, 67, 2121, 16, 1842, 644, 16, 2855, 644, 16, 18422, 659, 644, 273, 599, 4672, 3536, 5584, 326, 7965, 316, 326, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5584, 55, 3368, 80, 38, 18593, 1388, 12, 87, 3368, 80, 67, 70, 18593, 67, 2121, 16, 1842, 644, 16, 2855, 644, 16, 18422, 659, 644, 273, 599, 4672, 3536, 5584, 326, 7965, 316, 326, 27...