Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
9,401 | [
0.030372263863682747,
0.009258035570383072,
0.053896669298410416,
-0.06439671665430069,
0.0023816446773707867,
0.015575519762933254,
0.012641683220863342,
0.009929394349455833,
0.03544773533940315,
-0.015226413495838642,
0.05762942507863045,
0.016904810443520546,
0.013145201839506626,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testNames(self):
checkpoint_directory = self.get_temp_dir()
checkpoint_prefix = os.path.join(checkpoint_directory, "ckpt")
x1 = resource_variable_ops.ResourceVariable(2.)
x2 = resource_variable_ops.ResourceVariable(3.)
x3 = resource_variable_ops.ResourceVariable(4.)
y = resource_variable_op... | |
9,402 | [
0.016993064433336258,
0.031192397698760033,
0.042367324233055115,
-0.0007344758487306535,
0.008015958592295647,
0.0014753593131899834,
0.01114929560571909,
-0.010566200129687786,
-0.00859905406832695,
-0.032525185495615005,
0.038855936378240585,
0.021132400259375572,
0.03521639481186867,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def __init__(self):
self.slotdeps = containers.UniqueNameTracker()
slotdeps = self.slotdeps
slots = []
slots.append(slotdeps.track(
resource_variable_ops.ResourceVariable(3.), "x"))
slots.append(slotdeps.track(
resource_variable_ops.ResourceVariable(4.), "... | |
9,403 | [
0.02732684649527073,
0.0624052919447422,
0.025560658425092697,
-0.01867988519370556,
-0.019734691828489304,
0.024579443037509918,
0.00704635214060545,
-0.028406182304024696,
-0.0002077416720567271,
-0.015748504549264908,
0.06191468611359596,
-0.0026600132696330547,
0.017011819407343864,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class SlotManager(tracking.Checkpointable):
def __init__(self):
self.slotdeps = containers.UniqueNameTracker()
slotdeps = self.slotdeps
slots = []
slots.append(slotdeps.track(
resource_variable_ops.ResourceVariable(3.), "x"))
slots.append(slotdeps.track(
... | |
9,404 | [
0.005848504137247801,
-0.01563994400203228,
-0.005549214314669371,
-0.005499790422618389,
0.008506416343152523,
-0.003327881218865514,
-0.04814993962645531,
0.0060571832582354546,
0.048413533717393875,
0.012542707845568657,
-0.04366883262991905,
-0.079957015812397,
0.009154419414699078,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation"... | class PersonAdmin(admin.ModelAdmin):
def response_post_save_add(self, request, obj):
return HttpResponseRedirect(
reverse('admin:admin_custom_urls_person_history', args=[obj.pk]))
def response_post_save_change(self, request, obj):
return HttpResponseRedirect(
reverse('a... | |
9,405 | [
-0.01472010649740696,
0.040007855743169785,
0.0408284030854702,
0.00736005324870348,
-0.04070407524704933,
-0.015739573165774345,
-0.007925732992589474,
-0.06196368858218193,
0.009119254536926746,
-0.0007731474470347166,
-0.03299591317772865,
-0.06549452245235443,
0.048188455402851105,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "res.partner"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'sale_warn' : fields.selection(WARNING_MESSAGE, 'Sales Order', help=WARNING_HELP, required=True),
'sale_warn_msg' : fields.text('Message for Sales Order'),
'purchase_warn' : fields.selection(WARNING_MESSAGE, 'Purchase Orde... | |
9,406 | [
-0.004797059576958418,
-0.011154944077134132,
-0.016822224482893944,
0.0477166511118412,
-0.05658610165119171,
-0.000787767581641674,
0.007513018790632486,
0.010721380822360516,
0.029804324731230736,
0.04048234969377518,
0.03577509894967079,
-0.03446202352643013,
0.0059212250635027885,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def onchange_partner_id(self, cr, uid, ids, part, context=None):
if not part:
return {'value':{'partner_invoice_id': False, 'partner_shipping_id':False, 'payment_term' : False}}
warning = {}
title = False
message = False
partner = self.pool.get('res.partner').browse(c... | |
9,407 | [
0.0011535751400515437,
0.020202476531267166,
-0.006736251525580883,
0.012028572149574757,
-0.06077065318822861,
0.0124366395175457,
-0.020026693120598793,
-0.03234405070543289,
0.025099284946918488,
0.00029584887670353055,
0.033448971807956696,
-0.05695365369319916,
0.012373859994113445,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sale.order"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n... | class sale_order(osv.osv):
_inherit = 'sale.order'
def onchange_partner_id(self, cr, uid, ids, part, context=None):
if not part:
return {'value':{'partner_invoice_id': False, 'partner_shipping_id':False, 'payment_term' : False}}
warning = {}
title = False
message = Fa... | |
9,408 | [
-0.02249784581363201,
-0.017810272052884102,
-0.006100739352405071,
0.06803248822689056,
-0.04795362800359726,
-0.006382745690643787,
0.022999191656708717,
0.027323290705680847,
0.031885527074337006,
0.05103689804673195,
0.04263937100768089,
-0.025769121944904327,
0.017333995550870895,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def onchange_partner_id(self, cr, uid, ids, part, context=None):
if not part:
return {'value':{'partner_address_id': False}}
warning = {}
title = False
message = False
partner = self.pool.get('res.partner').browse(cr, uid, part, context=context)
if partner.pur... | |
9,409 | [
-0.027857013046741486,
0.004569703247398138,
-0.015432935208082199,
0.018780289217829704,
-0.04488213360309601,
0.0006107825320214033,
-0.005318783689290285,
0.000019833782062050886,
0.01850447803735733,
0.001496593584306538,
0.03427590802311897,
-0.04696326330304146,
0.014705794863402843,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "purchase.order"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment... | class purchase_order(osv.osv):
_inherit = 'purchase.order'
def onchange_partner_id(self, cr, uid, ids, part, context=None):
if not part:
return {'value':{'partner_address_id': False}}
warning = {}
title = False
message = False
partner = self.pool.get('res.part... | |
9,410 | [
-0.006091086193919182,
0.030643559992313385,
0.0034850265365093946,
-0.0011858341749757528,
-0.04838326945900917,
-0.004265302326530218,
0.024919481948018074,
-0.029459267854690552,
0.021230904385447502,
0.017739709466695786,
0.03377699851989746,
-0.04692757874727249,
0.01487767044454813,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "account.invoice"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen... | class account_invoice(osv.osv):
_inherit = 'account.invoice'
def onchange_partner_id(self, cr, uid, ids, type, partner_id,
date_invoice=False, payment_term=False,
partner_bank_id=False, company_id=False,
context=None):
i... | |
9,411 | [
-0.002311103045940399,
0.0039051794447004795,
-0.012327934615314007,
0.024852819740772247,
-0.044707994908094406,
-0.00896129384636879,
0.041655246168375015,
0.005123816896229982,
0.015091409906744957,
0.046431321650743484,
0.029690442606806755,
-0.033334046602249146,
-0.00150560203474015,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def onchange_partner_id(self, cr, uid, ids, type, partner_id,
date_invoice=False, payment_term=False,
partner_bank_id=False, company_id=False,
context=None):
if not partner_id:
return {'value': {
'account... | |
9,412 | [
-0.0009631643770262599,
0.008781402371823788,
0.04548792913556099,
0.011657609604299068,
-0.05271498113870621,
-0.021402176469564438,
0.014082127250730991,
0.009106884710490704,
0.0068152183666825294,
0.007990943267941475,
0.041130438446998596,
-0.05781643092632294,
0.029492756351828575,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "stock.picking"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment"... | class stock_picking(osv.osv):
_inherit = 'stock.picking'
def onchange_partner_in(self, cr, uid, ids, partner_id=None, context=None):
if not partner_id:
return {}
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
warning = {}
title = ... | |
9,413 | [
-0.015892591327428818,
0.00564623111858964,
0.020853914320468903,
0.0655876025557518,
-0.0596449188888073,
-0.01337785366922617,
0.026619408279657364,
0.033638861030340195,
0.03644664213061333,
0.0677684023976326,
0.04007222503423691,
-0.04056290537118912,
0.006481069140136242,
0.010433771... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def onchange_partner_in(self, cr, uid, ids, partner_id=None, context=None):
if not partner_id:
return {}
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
warning = {}
title = False
message = False
if partner.picking_warn != '... | |
9,414 | [
0.012399612925946712,
0.002695941599085927,
-0.01102442480623722,
-0.02002044767141342,
-0.03907826170325279,
-0.018885916098952293,
-0.0018077993299812078,
-0.04366222396492958,
0.02071950025856495,
-0.02970406413078308,
-0.010417049750685692,
-0.06564231216907501,
0.0378405936062336,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "product.template"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comme... | class product_product(osv.osv):
_inherit = 'product.template'
_columns = {
'sale_line_warn' : fields.selection(WARNING_MESSAGE,'Sales Order Line', help=WARNING_HELP, required=True),
'sale_line_warn_msg' : fields.text('Message for Sales Order Line'),
'purchase_line_warn' : fields.selec... | |
9,415 | [
0.0014169119531288743,
-0.0015953719848766923,
-0.014178349636495113,
-0.013870660215616226,
-0.038645848631858826,
-0.00042845815187320113,
0.0014215272385627031,
-0.03591356426477432,
0.022301362827420235,
0.014793729409575462,
0.04984576255083084,
-0.05558110028505325,
-0.0020661375019699... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "sale.order.line"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen... | class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
def product_id_change_with_wh(self, cr, uid, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, packaging=False,
fiscal_positio... | |
9,416 | [
0.015671633183956146,
-0.01583566889166832,
-0.03164610266685486,
0.02104692906141281,
-0.042977120727300644,
-0.0056875916197896,
0.022851310670375824,
0.013463472947478294,
0.008359466679394245,
0.031469449400901794,
0.05228925123810768,
-0.03348833695054054,
-0.02871870994567871,
0.0080... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def product_id_change_with_wh(self, cr, uid, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, packaging=False,
fiscal_position=False, flag=False, warehouse_id=False, context=None):
warni... | |
9,417 | [
-0.0324227474629879,
-0.0024506989866495132,
-0.019188974052667618,
-0.008626461029052734,
-0.0211495328694582,
-0.008963432163000107,
0.009171741083264351,
-0.0003059544542338699,
0.02837909571826458,
0.01635841652750969,
0.05318016931414604,
-0.038181889802217484,
0.0013379284646362066,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "purchase.order.line"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_co... | class purchase_order_line(osv.osv):
_inherit = 'purchase.order.line'
def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom,
partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
name=False, price_unit=False, state='draft', context=None):
wa... | |
9,418 | [
-0.019509324803948402,
-0.014536600559949875,
-0.0243589598685503,
0.023645054548978806,
-0.03446442261338234,
-0.017810720950365067,
0.022648047655820847,
0.030968744307756424,
0.018610788509249687,
0.034612126648426056,
0.05952497944235802,
-0.019127754494547844,
-0.00933001097291708,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom,
partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
name=False, price_unit=False, state='draft', context=None):
warning = {}
if not product:
return {'value': {'price_unit'... | |
9,419 | [
0.04172082617878914,
-0.0018507321365177631,
0.0825602263212204,
-0.038824714720249176,
0.0004535015032161027,
0.026169955730438232,
0.03660016134381294,
-0.008835245855152607,
0.0006095873541198671,
0.032885581254959106,
0.0008197785937227309,
-0.01878276653587818,
0.034921254962682724,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null... | def __init__(self, path):
#: Path to the configuration file
self.path = path
#: The underlying configuration object
self.config = configparser.SafeConfigParser()
self.config.add_section('general')
self.config.set('general', 'languages', json.dumps(['en']))
self.c... | |
9,420 | [
0.01706823520362377,
-0.05397086590528488,
0.06028180941939354,
-0.03399303928017616,
-0.005242898594588041,
0.007238119840621948,
0.035878125578165054,
0.0020733396522700787,
-0.015244618058204651,
0.03714851289987564,
-0.012089146301150322,
-0.006392904091626406,
0.025960927829146385,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": nul... | def provider_configs(self, value):
# loop over provider configurations
for provider, config in value.items():
# create the corresponding section if necessary
if not self.config.has_section(provider):
self.config.add_section(provider)
# add config opti... | |
9,421 | [
-0.013467896729707718,
0.01819145865738392,
0.042681001126766205,
-0.003659240435808897,
-0.020772863179445267,
0.023246144875884056,
-0.026814157143235207,
-0.024773361161351204,
-0.024638209491968155,
0.016110118478536606,
0.03557200729846954,
-0.03632885590195656,
0.025759970769286156,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":... | class ClsSeriesSelector(wx.Panel):
def __init__(self, parent, dbservice):
self.parent = parent
wx.Panel.__init__(self, name=u'pnlSeriesSelector', parent=parent,
size=wx.Size(935, 270), style=wx.TAB_TRAVERSAL)
self._init_ctrls()
self.series_service ... | |
9,422 | [
0.017846807837486267,
-0.00011581606668187305,
0.029097305610775948,
0.003944569732993841,
0.008233893662691116,
0.03109688311815262,
-0.007739745546132326,
-0.017708905041217804,
0.014663570560514927,
0.011606745421886444,
0.017869791015982628,
-0.03785407915711403,
0.04468022286891937,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, parent, dbservice):
self.parent = parent
wx.Panel.__init__(self, name=u'pnlSeriesSelector', parent=parent,
size=wx.Size(935, 270), style=wx.TAB_TRAVERSAL)
self._init_ctrls()
self.series_service = dbservice
self.initTableSeries(... | |
9,423 | [
-0.020064115524291992,
0.03697580471634865,
0.052003152668476105,
0.02352467179298401,
0.028608843684196472,
-0.03899051249027252,
-0.007821804843842983,
-0.02367873676121235,
-0.016378385946154594,
0.036833591759204865,
-0.013664456084370613,
-0.007407012395560741,
0.0025806031189858913,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _init_coll_boxSizer5_Items(self, parent):
# generated method, don't edit
pnlSpacer= wx.Panel(id=0, name='pnlSpacer', parent=self.pnlRadio, pos=wx.Point(3, 3),
size=wx.Size(0, 25), style=wx.TAB_TRAVERSAL)
parent.AddWindow(self.rbAll, 0, border=1, flag=wx.ALL... | |
9,424 | [
-0.01785186305642128,
0.014186488464474678,
0.041659072041511536,
0.0012531044194474816,
-0.023608699440956116,
0.00012839002010878175,
-0.010691266506910324,
-0.01615033484995365,
-0.026841601356863976,
0.01775260828435421,
0.029124485328793526,
-0.021623583510518074,
0.020744459703564644,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _init_ctrls(self):
# generated method, don't edit
self.SetClientSize(wx.Size(919, 232))
self.Enable(True)
## Radio panel
self.pnlRadio = wx.Panel(id=wxID_PNLRADIO, name='pnlRadio', parent=self, pos=wx.Point(3, 3),
size=wx.Size(1000... | |
9,425 | [
-0.014205068349838257,
0.018334893509745598,
0.04193755239248276,
0.012766661122441292,
-0.004701992496848106,
-0.026568975299596786,
-0.0019146795384585857,
-0.031044019386172295,
-0.021761499345302582,
0.014435213059186935,
-0.010324565693736076,
-0.021953286603093147,
-0.00431522075086832... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _init_sizers(self):
# generated method, don't edit
boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL)
boxSizer2 = wx.BoxSizer(orient=wx.HORIZONTAL)
boxSizer3 = wx.BoxSizer(orient=wx.VERTICAL)
boxSizer4 = wx.BoxSizer(orient=wx.HORIZONTAL)
boxSizer5 = wx.BoxSizer(orient=... | |
9,426 | [
0.05344025045633316,
-0.0017323432257398963,
-0.040381718426942825,
-0.01943703554570675,
-0.03196209296584129,
0.03822462260723114,
0.035139746963977814,
0.03268112614750862,
0.010402756743133068,
-0.0036589407827705145,
0.06638281047344208,
-0.004032952710986137,
0.01983134262263775,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bucket", "annotation":... | class DeleteMarker(object):
def __init__(self, bucket=None, name=None):
self.bucket = bucket
self.name = name
self.version_id = None
self.is_latest = False
self.last_modified = None
self.owner = None
def startElement(self, name, attrs, connection):
if nam... | |
9,427 | [
0.09138265252113342,
0.013888860121369362,
-0.03543171286582947,
-0.0193792637437582,
0.03952625393867493,
0.005045471712946892,
-0.015389415435492992,
-0.03201184421777725,
0.017285466194152832,
-0.014982287771999836,
0.031034739688038826,
-0.013667847961187363,
0.00298947817645967,
-0.03... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def endElement(self, name, value, connection):
if name == 'Key':
self.name = value
elif name == 'IsLatest':
if value == 'true':
self.is_latest = True
else:
self.is_latest = False
elif name == 'LastModified':
self.las... | |
9,428 | [
-0.014180174097418785,
0.03550015762448311,
0.016377802938222885,
-0.05266353860497475,
0.017272764816880226,
0.03184075653553009,
0.0023194430395960808,
-0.021797295659780502,
0.02289113774895668,
0.05445346236228943,
0.025814680382609367,
-0.05699913203716278,
0.07362553477287292,
-0.025... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "arg", "annotation": nu... | class InvPath(Path):
def __init__(self, arg):
self.arg = arg
def eval(self, graph, subj=None, obj=None):
for s, o in evalPath(graph, (obj, self.arg, subj)):
yield o, s
def __repr__(self):
return "Path(~%s)" % (self.arg,) | |
9,429 | [
0.015085184946656227,
0.045502178370952606,
0.030273128300905228,
-0.04895491898059845,
0.03014981746673584,
0.04883160442113876,
0.007439832203090191,
0.000880525738466531,
0.020716438069939613,
0.04533776268362999,
0.045543283224105835,
-0.07776885479688644,
0.05803891271352768,
-0.02651... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg... | class SequencePath(Path):
def __init__(self, *args):
self.args = []
for a in args:
if isinstance(a, SequencePath):
self.args += a.args
else:
self.args.append(a)
def eval(self, graph, subj=None, obj=None):
def _eval_seq(paths, subj,... | |
9,430 | [
-0.006551765836775303,
0.053520843386650085,
0.014597599394619465,
-0.05307815596461296,
-0.011543060652911663,
0.04099280387163162,
0.028531169518828392,
-0.006557299289852381,
0.05892162397503853,
0.030899543315172195,
0.051041796803474426,
-0.08601406216621399,
0.02297544851899147,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "paths", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "subj", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _eval_seq(paths, subj, obj):
if paths[1:]:
for s, o in evalPath(graph, (subj, paths[0], None)):
for r in _eval_seq(paths[1:], o, obj):
yield s, r[1]
else:
for s, o in evalPath(graph, (subj, paths[0], obj)):
... | |
9,431 | [
0.0030847713351249695,
0.03789946064352989,
0.02448996715247631,
-0.05043850839138031,
-0.0050903139635920525,
0.0332178995013237,
0.01971430517733097,
-0.007181135937571526,
0.04768603667616844,
0.051238372921943665,
0.0488387830555439,
-0.08822034299373627,
0.016291355714201927,
0.012068... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "graph", "annotation": null, "type_comment": null}}, {"_type": "ar... | def eval(self, graph, subj=None, obj=None):
def _eval_seq(paths, subj, obj):
if paths[1:]:
for s, o in evalPath(graph, (subj, paths[0], None)):
for r in _eval_seq(paths[1:], o, obj):
yield s, r[1]
else:
for s, o... | |
9,432 | [
0.006548608653247356,
0.02396467700600624,
0.03746825084090233,
-0.04115672782063484,
0.004073995165526867,
0.020182427018880844,
0.007507195696234703,
-0.016900306567549706,
0.03534268960356712,
0.05659831687808037,
0.00624644523486495,
-0.07156061381101608,
0.05201376974582672,
0.0032248... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg... | class AlternativePath(Path):
def __init__(self, *args):
self.args = []
for a in args:
if isinstance(a, AlternativePath):
self.args += a.args
else:
self.args.append(a)
def eval(self, graph, subj=None, obj=None):
for x in self.args:
... | |
9,433 | [
-0.0018451412906870246,
0.04592606797814369,
0.037402521818876266,
-0.04447867348790169,
-0.025455771014094353,
0.02892492339015007,
0.022963033989071846,
-0.013738764449954033,
0.03558753430843353,
0.03820662945508957,
0.046523407101631165,
-0.068831667304039,
0.012440703809261322,
-0.002... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "paths", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "subj", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _eval_seq_bw(paths, subj, obj):
if paths[:-1]:
for s, o in evalPath(graph, (None, paths[-1], obj)):
for r in _eval_seq(paths[:-1], subj, s):
yield r[0], o
else:
for s, o in evalPath(graph, (subj, paths[0], obj)):
... | |
9,434 | [
0.04223901405930519,
0.03639091178774834,
0.012691361829638481,
0.0045611499808728695,
0.009527735412120819,
0.0372263565659523,
0.01021574717015028,
-0.008956439793109894,
0.03560461476445198,
0.05931645259261131,
0.00740841357037425,
-0.02272896282374859,
0.005583953578025103,
-0.0193011... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, path, mod):
self.path = path
self.mod = mod
if mod == ZeroOrOne:
self.zero = True
self.more = False
elif mod == ZeroOrMore:
self.zero = True
self.more = True
elif mod == OneOrMore:
self.zero = False
... | |
9,435 | [
0.009916642680764198,
0.0326710119843483,
0.027907012030482292,
-0.03813707455992699,
0.01777724362909794,
0.02478533796966076,
0.008299389854073524,
0.0008517217356711626,
0.03881406411528587,
0.0717608854174614,
0.035253603011369705,
-0.06699688732624054,
0.02390776015818119,
-0.03144240... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": n... | class MulPath(Path):
def __init__(self, path, mod):
self.path = path
self.mod = mod
if mod == ZeroOrOne:
self.zero = True
self.more = False
elif mod == ZeroOrMore:
self.zero = True
self.more = True
elif mod == OneOrMore:
... | |
9,436 | [
0.022965537384152412,
0.029464321210980415,
0.002619710983708501,
-0.03775710240006447,
-0.017334051430225372,
0.046358782798051834,
0.03846994787454605,
0.020126033574342728,
0.03621260076761246,
0.03552351891994476,
0.03637893125414848,
-0.07071436941623688,
0.01861717365682125,
-0.00958... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "subj", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _fwd(subj=None, obj=None, seen=None):
seen.add(subj)
for s, o in evalPath(graph, (subj, self.path, None)):
if not obj or o == obj:
yield s, o
if self.more:
if o in seen:
continue
... | |
9,437 | [
0.00614733062684536,
0.020007699728012085,
0.02592402510344982,
-0.049229979515075684,
-0.012474332936108112,
0.014540554024279118,
0.02136806957423687,
0.01123588252812624,
0.039476387202739716,
0.06309034675359726,
0.05323408544063568,
-0.0836242288351059,
0.0007820521132089198,
-0.02362... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "graph", "annotation": null, "type_comment": null}}, {"_type": "ar... | def eval(self, graph, subj=None, obj=None, first=True):
if self.zero and first:
if subj and obj:
if subj == obj:
yield (subj, obj)
elif subj:
yield (subj, subj)
elif obj:
yield (obj, obj)
def _fwd(su... | |
9,438 | [
0.040517497807741165,
0.05788214132189751,
0.018855929374694824,
-0.025389786809682846,
-0.030381806194782257,
0.03938007727265358,
0.040037255734205246,
0.00530796917155385,
0.030432358384132385,
0.03071039356291294,
0.03020487353205681,
-0.07259280234575272,
0.017895439639687538,
-0.0109... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "subj", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _bwd(subj=None, obj=None, seen=None):
seen.add(obj)
for s, o in evalPath(graph, (None, self.path, obj)):
if not subj or subj == s:
yield s, o
if self.more:
if s in seen:
continue
... | |
9,439 | [
0.023508384823799133,
0.0026500604581087828,
0.0406297892332077,
-0.0362018384039402,
-0.022018983960151672,
-0.006269573234021664,
0.013324101455509663,
0.006024694535881281,
0.012921560555696487,
0.06333309412002563,
0.04653371870517731,
-0.04755349084734917,
-0.010647204704582691,
-0.03... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Assign", "_fields": {"val... | def _fwdbwd():
if self.zero:
seen1 = set()
# According to the spec, ALL nodes are possible solutions
# (even literals)
# we cannot do this without going through ALL triples
# unless we keep an index of all terms somehow
... | |
9,440 | [
0.007648609112948179,
0.033477574586868286,
-0.015680944547057152,
-0.06550320982933044,
-0.003730965778231621,
0.04028094559907913,
-0.010262100026011467,
0.019030777737498283,
0.023728838190436363,
0.05417808145284653,
-0.021903542801737785,
-0.054344017058610916,
0.027524622157216072,
0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "arg", "annotation": nu... | class NegatedPath(Path):
def __init__(self, arg):
if isinstance(arg, (URIRef, InvPath)):
self.args = [arg]
elif isinstance(arg, AlternativePath):
self.args = arg.args
else:
raise Exception(
'Can only negate URIRefs, InvPaths or ' +
... | |
9,441 | [
0.0011134800733998418,
0.02256203070282936,
-0.004088384099304676,
-0.017107103019952774,
-0.03066006675362587,
-0.012225786224007607,
-0.010088804177939892,
0.009189022704958916,
-0.0035035256296396255,
0.06901326775550842,
-0.04103005304932594,
-0.035428911447525024,
0.04224475845694542,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "arg", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __init__(self, arg):
if isinstance(arg, (URIRef, InvPath)):
self.args = [arg]
elif isinstance(arg, AlternativePath):
self.args = arg.args
else:
raise Exception(
'Can only negate URIRefs, InvPaths or ' +
'AlternativePaths, no... | |
9,442 | [
0.02177048847079277,
-0.006189993117004633,
-0.027057774364948273,
-0.00579139543697238,
0.011911047622561455,
0.008945009671151638,
0.008716401644051075,
0.025299252942204475,
0.08234567195177078,
0.0017761060735210776,
0.00001752796561049763,
-0.07296688854694366,
-0.021336719393730164,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_escape():
uvalue = py.builtin._totext('\xc4\x85\xc4\x87\n\xe2\x82\xac\n', 'utf-8')
class A:
def __unicode__(self):
return uvalue
def __str__(self):
x = self.__unicode__()
if py.std.sys.version_info[0] < 3:
return x.encode('utf-8')
... | |
9,443 | [
-0.003002768848091364,
0.04687687009572983,
-0.002298380946740508,
-0.05392635986208916,
0.0029017410706728697,
0.0398273803293705,
-0.0005160131840966642,
0.012549890205264091,
0.035606663674116135,
0.05091797932982445,
0.01789313554763794,
-0.04831371083855629,
0.01269581913948059,
-0.00... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "graph", "annotation": null, "type_comment": null}}, {"_type": "ar... | def eval(self, graph, subj=None, obj=None):
for s, p, o in graph.triples((subj, None, obj)):
for a in self.args:
if isinstance(a, URIRef):
if p == a:
break
elif isinstance(a, InvPath):
if (o, a.arg, s) in... | |
9,444 | [
-0.0210731141269207,
-0.015599091537296772,
0.03434044495224953,
-0.024065745994448662,
0.01511278934776783,
0.0062814089469611645,
0.013541657477617264,
-0.022282635793089867,
0.013815982267260551,
0.043193649500608444,
0.006777063477784395,
-0.04222104325890541,
-0.0030113353859633207,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"... | def test_alternating_style():
alternating = (
html.Style(background="white"),
html.Style(background="grey"),
)
class my(html):
class li(html.li):
def style(self):
i = self.parent.index(self)
return alternating[i%2]
style = prope... | |
9,445 | [
0.060588423162698746,
-0.05125630646944046,
-0.05542996898293495,
-0.0058736070059239864,
0.002501558745279908,
-0.013986453413963318,
-0.03266241401433945,
-0.003168347990140319,
0.05299142375588417,
0.027316376566886902,
-0.014338166452944279,
-0.047387465834617615,
-0.036414019763469696,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class A:
def __unicode__(self):
return uvalue
def __str__(self):
x = self.__unicode__()
if py.std.sys.version_info[0] < 3:
return x.encode('utf-8')
return x | |
9,446 | [
0.0354982390999794,
-0.05484538897871971,
-0.009136831387877464,
0.005089910700917244,
0.048721637576818466,
0.07397296279668808,
0.010673869401216507,
-0.00046316967927850783,
-0.01302821934223175,
0.012613463215529919,
0.0046568564139306545,
-0.062457382678985596,
0.021811289712786674,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __eq__(self, other):
if other is None:
return False
if not isinstance(other, PublicKey):
return False
return self.n == other.n and self.e == other.e | |
9,447 | [
0.038910314440727234,
-0.030509985983371735,
0.05671900510787964,
-0.02311769872903824,
0.02097841538488865,
0.03525897115468979,
-0.014784574508666992,
0.029613951221108437,
-0.04334568604826927,
0.03476615250110626,
0.01001878920942545,
-0.024304945021867752,
-0.010035590268671513,
-0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def __init__(self, n, e, d, p, q, exp1=None, exp2=None, coef=None):
self.n = n
self.e = e
self.d = d
self.p = p
self.q = q
# Calculate the other values if they aren't supplied
if exp1 is None:
self.exp1 = int(d % (p - 1))
else:
sel... | |
9,448 | [
0.018393265083432198,
-0.005916996859014034,
0.020614854991436005,
-0.025864753872156143,
0.030432041734457016,
0.04110559821128845,
-0.045821819454431534,
0.007862438447773457,
-0.011399604380130768,
-0.01902623288333416,
-0.008309238590300083,
-0.060566216707229614,
0.02296055480837822,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "version"}}, {"_type": "Call", "_fields": {"args": [], "func... | class AsnPrivKey(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('version', univ.Integer()),
namedtype.NamedType('modulus', univ.Integer()),
namedtype.NamedType('publicExponent', univ.Integer()),
namedtype.NamedType('p... | |
9,449 | [
0.03473353758454323,
-0.046319395303726196,
0.008118513971567154,
0.000473605003207922,
0.053410325199365616,
0.06408277899026871,
0.017246583476662636,
0.019133493304252625,
-0.005207025911659002,
-0.011663978919386864,
0.02010699361562729,
-0.04497332125902176,
-0.006670281756669283,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __eq__(self, other):
if other is None:
return False
if not isinstance(other, PrivateKey):
return False
return (self.n == other.n and
self.e == other.e and
self.d == other.d and
self.p == other.p and
self.q == other.q a... | |
9,450 | [
-0.0024493159726262093,
-0.007932793349027634,
0.010641551576554775,
-0.06988831609487534,
-0.010729499161243439,
0.008694997988641262,
-0.01767142489552498,
-0.022725429385900497,
0.04219096899032593,
0.03262236714363098,
-0.024249840527772903,
-0.05422207713127136,
-0.007909340783953667,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestParameters(unittest.TestCase):
def test_module_parameters(self):
args = dict(
arp_log_level='warning',
http_compression_log_level='error',
http_log_level='error',
ip_log_level='warning',
irule_log_level='informational',
layer4... | |
9,451 | [
0.024864664301276207,
0.02403859607875347,
-0.006866695359349251,
-0.036078546196222305,
0.010666610673069954,
-0.005028692539781332,
0.0034101144410669804,
-0.0352318249642849,
0.02122996374964714,
-0.017791451886296272,
0.044070757925510406,
-0.017058316618204117,
0.04725112393498421,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def load_fixture(name):
path = os.path.join(fixture_path, name)
if path in fixture_data:
return fixture_data[path]
with open(path) as f:
data = f.read()
try:
data = json.loads(data)
except Exception:
pass
fixture_data[path] = data
return data | |
9,452 | [
0.008465579710900784,
0.0002901627158280462,
0.011855324730277061,
-0.02686036005616188,
-0.011463074013590813,
0.03950604051351547,
0.03194205090403557,
-0.020596064627170563,
0.01727071963250637,
0.04437696933746338,
-0.001219195662997663,
-0.021403983235359192,
-0.03360472247004509,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen... | def test_update(self, *args):
set_module_args(dict(
arp_log_level='debug',
layer4_log_level='debug',
password='admin',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
... | |
9,453 | [
0.024493349716067314,
0.027471961453557014,
0.005152424797415733,
-0.036866042762994766,
-0.010551157407462597,
0.025799356400966644,
0.010121550410985947,
-0.030908819288015366,
-0.004863155540078878,
0.022591620683670044,
-0.019727570936083794,
-0.026234691962599754,
-0.032375212758779526,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestManager(unittest.TestCase):
def setUp(self):
self.spec = ArgumentSpec()
def test_update(self, *args):
set_module_args(dict(
arp_log_level='debug',
layer4_log_level='debug',
password='admin',
provider=dict(
server='localh... | |
9,454 | [
-0.023974014446139336,
0.01964816078543663,
0.013153107836842537,
0.018068281933665276,
-0.004071946255862713,
-0.015410075895488262,
0.001962308306246996,
-0.0114603815600276,
-0.0005144790047779679,
-0.011121836490929127,
0.06595361977815628,
-0.059985194355249405,
0.03006782941520214,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "HolesTrait", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "hole_str", "ctx": {"_type": "Store", "_fields": {}}}}... | class AddHolesView(HasTraits):
hole_str = HolesTrait
@property
def holes(self):
return parse_holestr(self.hole_str)
@property
def holes_id(self):
return md5(str(self.holes)).hexdigest()
def traits_view(self):
v = View(UItem('hole_str'),
buttons=['OK', ... | |
9,455 | [
-0.021213348954916,
-0.0006077333819121122,
0.03217319771647453,
-0.013944757170975208,
0.016929665580391884,
-0.005437202285975218,
-0.01909429207444191,
0.02791230008006096,
0.03723159059882164,
0.018832258880138397,
0.04472803696990013,
-0.013568796217441559,
-0.023560259491205215,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "hstr", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def parse_holestr(hstr):
hs = []
for sublist in hstr.split(','):
if '-' in sublist:
s, e = sublist.split('-')
s, e = int(s.strip()), int(e.strip())
for i in range(s, e + 1):
hs.append(i)
else:
hs.append(int(sublist))
return hs | |
9,456 | [
0.022375527769327164,
-0.05658362805843353,
0.027281392365694046,
0.0025443355552852154,
-0.026922427117824554,
0.0031176835764199495,
-0.01156667247414589,
0.049723394215106964,
-0.004752971697598696,
0.02866407483816147,
0.0017665765481069684,
-0.0018895554821938276,
-0.008681652136147022,... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class Latin1Prober(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self.reset()
def reset(self):
self._mLastCharClass = OTH
self._mFreqCounter = [0] * FREQ_CAT_NUM
CharSetProber.reset(self)
def get_charset_name(self):
return "wind... | |
9,457 | [
0.021145110949873924,
0.008397243916988373,
0.013463962823152542,
-0.005515968892723322,
0.019118422642350197,
0.013761211186647415,
-0.02118564397096634,
0.053666695952415466,
-0.00039478190592490137,
0.07998661696910858,
0.02500932849943638,
-0.017159290611743927,
-0.024549946188926697,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null... | def feed(self, aBuf):
aBuf = self.filter_with_english_letters(aBuf)
for c in aBuf:
charClass = Latin1_CharToClass[wrap_ord(c)]
freq = Latin1ClassModel[(self._mLastCharClass * CLASS_NUM)
+ charClass]
if freq == 0:
... | |
9,458 | [
0.0261516235768795,
-0.052710384130477905,
0.035285014659166336,
0.00774234626442194,
-0.031403664499521255,
0.007552350405603647,
0.008251264691352844,
0.04842189699411392,
-0.007565921172499657,
0.05564175546169281,
-0.011766195297241211,
0.017099661752581596,
-0.050430428236722946,
0.04... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_confidence(self):
if self.get_state() == eNotMe:
return 0.01
total = sum(self._mFreqCounter)
if total < 0.01:
confidence = 0.0
else:
confidence = ((self._mFreqCounter[3] / total)
- (self._mFreqCounter[1] * 20... | |
9,459 | [
-0.004424622748047113,
0.017534181475639343,
0.0013621558900922537,
-0.050137899816036224,
0.016430959105491638,
-0.013907632790505886,
-0.0013240125263109803,
-0.0015829468611627817,
-0.014928700402379036,
-0.0069772894494235516,
0.002502787159755826,
0.01384895108640194,
0.0289654340595006... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fn", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def cache(fn, self, con, *args, **kw):
info_cache = kw.get('info_cache', None)
if info_cache is None:
return fn(self, con, *args, **kw)
key = (
fn.__name__,
tuple(a for a in args if isinstance(a, basestring)),
tuple((k, v) for k, v in kw.iteritems() if isinstance(... | |
9,460 | [
0.03785447031259537,
0.019202301278710365,
-0.029026124626398087,
-0.03038836270570755,
-0.03227453678846359,
-0.02095749042928219,
0.009967906400561333,
0.013635467737913132,
0.009273690171539783,
0.01831160858273506,
0.04267469048500061,
-0.03085990622639656,
-0.015600232407450676,
-0.00... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def __iter__(self):
state = "pre_head"
meta_found = (self.encoding is None)
pending = []
for token in _base.Filter.__iter__(self):
type = token["type"]
if type == "StartTag":
if token["name"].lower() == "head":
state = "in_head... | |
9,461 | [
0.009423041716217995,
0.015877261757850647,
-0.04441358149051666,
-0.04868868365883827,
-0.02315681427717209,
-0.015022240579128265,
0.007707062643021345,
0.027313165366649628,
-0.0033428939059376717,
0.014095968566834927,
0.05001871660351753,
-0.031707022339105606,
-0.0012602650094777346,
... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "source", "annotation":... | class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.encoding is None)
pending = []
for token in _base.Filter.__iter__(self):
... | |
9,462 | [
0.005784914363175631,
-0.015267402864992619,
0.05245519429445267,
-0.02351074106991291,
-0.014618008397519588,
-0.004068656824529171,
-0.0026290547102689743,
0.006076479330658913,
0.007269245572388172,
-0.031621549278497696,
0.0728912502527237,
-0.04103114455938339,
-0.006845150608569384,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestSaleToReservation(TransactionCase):
def test_sale_vci_generates_procurements_and_special_po(self):
self.sol.stock_owner_id = self.supplier
self.so.action_button_confirm()
self.Procurement.run_scheduler()
delivery = self.so.picking_ids
self.assertEqual(1, len(deliv... | |
9,463 | [
0.01974167674779892,
-0.04708557203412056,
0.07104326784610748,
-0.016690082848072052,
0.00044669726048596203,
0.0003682742826640606,
-0.0010197077644988894,
0.008572571910917759,
0.019085852429270744,
-0.04462288320064545,
0.08169708400964737,
-0.033246323466300964,
-0.01758682169020176,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_sale_vci_generates_procurements_and_special_po(self):
self.sol.stock_owner_id = self.supplier
self.so.action_button_confirm()
self.Procurement.run_scheduler()
delivery = self.so.picking_ids
self.assertEqual(1, len(delivery))
self.assertEqual('waiting', delivery.... | |
9,464 | [
0.022034766152501106,
-0.003529841313138604,
0.02512337826192379,
0.0021376265212893486,
0.0027944575995206833,
-0.024013618007302284,
-0.011846361681818962,
0.030484993010759354,
0.010756656527519226,
-0.05150359123945236,
0.06722743064165115,
-0.013571170158684254,
0.026273250579833984,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_customer_is_owner_reserves_without_po(self):
self.sol.stock_owner_id = self.customer
self.so.action_button_confirm()
self.Procurement.run_scheduler()
delivery = self.so.picking_ids
self.assertEqual(1, len(delivery))
delivery.action_assign()
self.assertE... | |
9,465 | [
0.01054043136537075,
-0.009836395271122456,
0.040847525000572205,
-0.006628000643104315,
-0.00401300797238946,
-0.012109427712857723,
0.006624647881835699,
0.028724689036607742,
0.0029569531325250864,
-0.02032989077270031,
0.06967949867248535,
-0.045165617018938065,
-0.02228778414428234,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_sale_mto_buy_creates_procurements_and_normal_po(self):
self.product.route_ids = (
self.env.ref('stock.route_warehouse0_mto') |
self.env.ref('purchase.route_warehouse0_buy')
)
self.so.action_button_confirm()
self.Procurement.run_scheduler()
deliv... | |
9,466 | [
0.018130311742424965,
0.004890722222626209,
-0.023144328966736794,
-0.05688032880425453,
-0.017613643780350685,
-0.02787652797996998,
-0.05504851043224335,
-0.02010303921997547,
0.03870305046439171,
0.04647653549909592,
0.02040834352374077,
-0.000013198766282584984,
-0.0007269298075698316,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null... | def visit_FunctionDef(self, node):
# Replace all function statements except doc string by 'pass'.
if node.body:
if isinstance(node.body[0], ast.Expr) and \
isinstance(node.body[0].value, ast.Str):
# Keep doc string.
first... | |
9,467 | [
-0.013465813361108303,
-0.026225602254271507,
0.04323437437415123,
-0.013594181276857853,
-0.021540166810154915,
-0.016983099281787872,
0.01834380067884922,
0.012227061204612255,
-0.020513221621513367,
-0.023388667032122612,
0.07014032453298569,
-0.034556690603494644,
-0.014081980101764202,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
super(TestSaleToReservation, self).setUp()
self.Procurement = self.env['procurement.order']
self.supplier = self.env.ref('base.res_partner_1')
self.customer = self.env.ref('base.res_partner_2')
self.product = self.env.ref('product.product_product_36')
se... | |
9,468 | [
0.005357338115572929,
0.020141247659921646,
-0.01067369058728218,
-0.07143117487430573,
-0.0008401945233345032,
-0.0007999413064680994,
-0.04482598975300789,
-0.021605001762509346,
-0.009291907772421837,
0.03833863139152527,
0.027120426297187805,
-0.020047567784786224,
0.010257984511554241,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null... | def visit_ClassDef(self, node):
# Visit nodes of class.
# Store instance member assignments to be added later to generated code.
self_assignments = {}
for child in ast.walk(node):
if isinstance(child, ast.Assign):
new_child = self.repla... | |
9,469 | [
-0.01348961889743805,
0.006617932114750147,
-0.11108381301164627,
-0.07584231346845627,
0.027953658252954483,
-0.0355663076043129,
-0.002570538781583309,
-0.011033269576728344,
0.03396257758140564,
0.03704823926091194,
0.024725893512368202,
0.013093761168420315,
0.019620340317487717,
0.000... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _get_type_node_for_function_node(node):
# Convert node to dot expression
attrs = []
while isinstance(node, ast.Attribute):
attrs.insert(0, node.attr)
node = node.value
if isinstance(node, ast.Name):
attrs.insert(0, node.... | |
9,470 | [
0.018920915201306343,
0.00984117016196251,
-0.009011946618556976,
-0.02142423391342163,
-0.005580313969403505,
0.05282001942396164,
0.026117956265807152,
0.031082870438694954,
0.03884315863251686,
0.025596430525183678,
0.00814099982380867,
-0.056867048144340515,
-0.01828465424478054,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "application", "annotation": {"_type": "Name", "_fields": {"id": "Application", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg... | def notify_application_deleted(application: Application):
queue_name = settings.QUEUES.get('QUEUES_NAME', {}).get('APPLICATION_REQUEST')
if queue_name:
message_serialized = ApplicationSerializer().serialize_to_delete_epc_message(application)
queue_sender.send_message(queue_name, message_serializ... | |
9,471 | [
0.019385170191526413,
-0.02423967979848385,
-0.0005366125260479748,
-0.006246210541576147,
0.00030392062035389245,
0.05737747251987457,
0.026212168857455254,
-0.0003609378181863576,
0.03098997101187706,
0.00471753254532814,
-0.011462344788014889,
-0.04887386038899422,
-0.020305663347244263,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "application", "annotation": {"_type": "Name", "_fields": {"id": "Application", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg... | def notify_application_saved(application: Application):
queue_name = settings.QUEUES.get('QUEUES_NAME', {}).get('APPLICATION_REQUEST')
if queue_name:
message_serialized = ApplicationSerializer().serialize_to_update_epc_message(application)
queue_sender.send_message(queue_name, message_serialized... | |
9,472 | [
-0.04005054384469986,
-0.011637657880783081,
0.05835079029202461,
-0.0032437939662486315,
-0.004934441763907671,
0.022875310853123665,
0.022525304928421974,
-0.014912702143192291,
-0.031875431537628174,
0.038275521248579025,
0.024850336834788322,
-0.06435087323188782,
0.013287680223584175,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "global_id", "annotation": {"_type": "Name", "_fields": {"id": "str", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}, {"_type": "arg", ... | def __update_tutor_application(global_id: str, acronym: str, year: Any, num_ele_itv: str):
external_id_computed = 'osis.tutor_application_{num_ele_itv}'.format(num_ele_itv=num_ele_itv)
existing_application = TutorApplication.objects.get(
learning_container_year__academic_year__year=int(year),
le... | |
9,473 | [
0.006746821571141481,
0.007194191683083773,
0.07273992896080017,
-0.05687643215060234,
-0.02797875553369522,
0.00067332194885239,
-0.0013625134015455842,
-0.018221255391836166,
0.054409854114055634,
0.037167973816394806,
0.04594609886407852,
0.012296626344323158,
0.023505056276917458,
0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestData2PDBNoOut(unittest.TestCase):
# These all test failure cases
def testNoArgs(self):
with capture_stderr(main, []) as output:
self.assertTrue("WARNING: Problems reading file: Could not read file" in output)
with capture_stdout(main, []) as output:
self.assert... | |
9,474 | [
-0.016557738184928894,
-0.010795596055686474,
0.0950845256447792,
-0.050065115094184875,
0.01572495326399803,
0.018994860351085663,
0.016312802210450172,
-0.018100840970873833,
0.04056156054139137,
0.018407011404633522,
0.049648720771074295,
0.008480941876769066,
0.05187764763832092,
0.013... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestData2PDB(unittest.TestCase):
# These test/demonstrate different options
def testDefIni(self):
test_input = ["-c", DEF_INI]
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
try:
main(test_input)
self.assertFalse(diff_lines(PDB_OUT, GOOD... | |
9,475 | [
0.015328840352594852,
-0.015967020764946938,
0.02958153374493122,
-0.048551756888628006,
0.0221110712736845,
0.0056747994385659695,
-0.015416434034705162,
0.02316219173371792,
0.0755305141210556,
0.038591139018535614,
0.013789700344204903,
0.009754148311913013,
-0.0035381466150283813,
0.01... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testHelp(self):
test_input = ['-h']
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stderr(main, test_input) as output:
self.assertFalse(output)
with capture_stdout(main, test_input) as output:
self.assertTrue("optional argumen... | |
9,476 | [
-0.011097942478954792,
0.0037849757354706526,
0.04850352928042412,
-0.01677699200809002,
0.03446770831942558,
0.04030539095401764,
0.011542113497853279,
0.0017465457785874605,
0.024937057867646217,
0.01384546048939228,
0.05832606554031372,
-0.018160268664360046,
0.04870657995343208,
-0.001... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testGluDict(self):
try:
data2pdb.main(["-c", GLU_DICT_INI])
self.assertFalse(diff_lines(GLU_OUT, GOOD_GLU_OUT))
with open(DEF_DICT_OUT, 'r') as d_file:
dict_test = json.load(d_file)
with open(GOOD_DICT, 'r') as d_file:
dict_good... | |
9,477 | [
0.013853007927536964,
0.0021318760700523853,
0.08445779979228973,
-0.03796849772334099,
0.02230682596564293,
0.022521186619997025,
0.02301689423620701,
-0.006718842778354883,
0.05766281113028526,
0.021020667627453804,
0.044372498989105225,
0.0190244410187006,
0.010021325200796127,
-0.00152... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testDefIni(self):
test_input = ["-c", DEF_INI]
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
try:
main(test_input)
self.assertFalse(diff_lines(PDB_OUT, GOOD_PDB_OUT))
finally:
silent_remove(PDB_TPL_OUT)
silent_remo... | |
9,478 | [
-0.009351344779133797,
-0.045595668256282806,
0.041431888937950134,
0.015396831557154655,
-0.009294149465858936,
-0.04360529035329819,
0.04568718001246452,
0.0404481403529644,
-0.04113447666168213,
0.07458197325468063,
0.010912761092185974,
-0.0009944740450009704,
-0.0015928742941468954,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "image", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def detect(image):
faces = []
(h, w) = image.shape[:2]
blob = cv2.dnn.blobFromImage(cv2.resize(image, (300, 300)), 1.0, (300, 300), (104.0, 177.0, 123.0))
net.setInput(blob)
detections = net.forward()
for i in range(0, detections.shape[2]):
confidence = detections[0, 0, i, 2]
if confidence > 0.8:
box =... | |
9,479 | [
-0.030602071434259415,
-0.03557740896940231,
0.03310224041342735,
-0.05325360223650932,
0.006334803532809019,
-0.006122289225459099,
-0.03315224498510361,
-0.03180215135216713,
0.037852562963962555,
0.03907764330506325,
0.019263803958892822,
-0.04322792589664459,
0.009469390846788883,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class UnorderedListTests(SimpleTestCase):
@setup({'unordered_list01': '{{ a|unordered_list }}'})
def test_unordered_list01(self):
output = self.engine.render_to_string('unordered_list01', {'a': ['x>', ['<y']]})
self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>'... | |
9,480 | [
0.0005005167913623154,
-0.02617459185421467,
0.012213552370667458,
-0.01487249881029129,
-0.014847354963421822,
-0.02513112872838974,
-0.021812159568071365,
-0.0006301639950834215,
0.053807515650987625,
0.042291704565286636,
0.013879322446882725,
-0.01731143705546856,
-0.013879322446882725,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_ulitem(self):
@python_2_unicode_compatible
class ULItem(object):
def __init__(self, title):
self.title = title
def __str__(self):
return 'ulitem-%s' % str(self.title)
a = ULItem('a')
b = ULItem('b')
c = ULItem('<a... | |
9,481 | [
-0.033804818987846375,
-0.03843597695231438,
0.038540635257959366,
-0.03477291390299797,
-0.007417698390781879,
-0.019793611019849777,
-0.03665677458047867,
-0.022056858986616135,
0.05892295017838478,
0.0493989922106266,
0.011263912543654442,
-0.06279533356428146,
-0.02341742441058159,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class FunctionTests(SimpleTestCase):
def test_list(self):
self.assertEqual(unordered_list(['item 1', 'item 2']), '\t<li>item 1</li>\n\t<li>item 2</li>')
def test_nested(self):
self.assertEqual(
unordered_list(['item 1', ['item 1.1']]),
'\t<li>item 1\n\t<ul>\n\t\t<li>ite... | |
9,482 | [
-0.00484913494437933,
-0.006146925501525402,
0.038051482290029526,
-0.01802842505276203,
-0.030840113759040833,
-0.025265367701649666,
-0.037361033260822296,
0.020061416551470757,
0.056616924703121185,
0.03598013147711754,
-0.0036088814958930016,
-0.02474113553762436,
-0.014691248536109924,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_ulitem_autoescape_off(self):
@python_2_unicode_compatible
class ULItem(object):
def __init__(self, title):
self.title = title
def __str__(self):
return 'ulitem-%s' % str(self.title)
a = ULItem('a')
b = ULItem('b')
... | |
9,483 | [
0.04054899513721466,
0.03396452218294144,
-0.003493561176583171,
0.05030728131532669,
-0.011132026091217995,
0.0065311831422150135,
-0.007928607985377312,
0.06778693199157715,
-0.03571722283959389,
0.047180842608213425,
0.0001581169490236789,
-0.0019747503101825714,
-0.017965195700526237,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":... | class CharacterDialog(WindowModalDialog):
def __init__(self, parent):
super(CharacterDialog, self).__init__(parent)
self.setWindowTitle(_("KeepKey Seed Recovery"))
self.character_pos = 0
self.word_pos = 0
self.loop = QEventLoop()
self.word_help = QLabel()
sel... | |
9,484 | [
0.05437127873301506,
0.020401816815137863,
0.01918097957968712,
0.02523481845855713,
-0.015531055629253387,
0.002005884889513254,
0.051023419946432114,
0.06665515899658203,
-0.03589511290192604,
0.051098935306072235,
0.009458336979150772,
0.016009321436285973,
-0.0382361002266407,
0.016676... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def refresh(self):
self.word_help.setText("Enter seed word %2d:" % (self.word_pos + 1))
self.accept_button.setEnabled(self.character_pos >= 3)
self.finished_button.setEnabled((self.word_pos in (11, 17, 23)
and self.character_pos >= 3))
for n, butt... | |
9,485 | [
0.05001155659556389,
0.025860678404569626,
0.010430947877466679,
0.04573706537485123,
-0.010810903273522854,
-0.0033513205125927925,
0.004606952425092459,
0.055425915867090225,
-0.049679096788167953,
0.04958410933613777,
0.006566094700247049,
0.0023212868254631758,
-0.020731287077069283,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, parent):
super(CharacterDialog, self).__init__(parent)
self.setWindowTitle(_("KeepKey Seed Recovery"))
self.character_pos = 0
self.word_pos = 0
self.loop = QEventLoop()
self.word_help = QLabel()
self.char_buttons = []
vbox = QVBoxLayout... | |
9,486 | [
0.054569829255342484,
0.04175558313727379,
0.0257895365357399,
0.009426639415323734,
-0.0012674775207415223,
0.01104279886931181,
0.025030342862010002,
0.0644623339176178,
0.004767958540469408,
0.009944270364940166,
0.02999960258603096,
0.026249652728438377,
-0.020693743601441383,
0.012170... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def process_key(self, key):
self.data = None
if key == Qt.Key_Return and self.finished_button.isEnabled():
self.data = {'done': True}
elif key == Qt.Key_Backspace and (self.word_pos or self.character_pos):
self.data = {'delete': True}
elif self.is_valid_alpha_spac... | |
9,487 | [
0.05303715914487839,
0.02827697992324829,
0.02946508675813675,
0.023999789729714394,
0.03830461576581001,
-0.002848489908501506,
-0.00524549838155508,
0.03730660304427147,
0.025639379397034645,
0.03673630952835083,
0.00842368882149458,
0.003181160194799304,
-0.03079576976597309,
0.01555233... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def is_valid_alpha_space(self, key):
# Auto-completion requires at least 3 characters
if key == ord(' ') and self.character_pos >= 3:
return True
# Firmware aborts protocol if the 5th character is non-space
if self.character_pos >= 4:
return False
return (... | |
9,488 | [
0.04370948672294617,
0.03381628915667534,
-0.038252029567956924,
0.020160190761089325,
-0.02561764605343342,
0.03189745917916298,
-0.005460570566356182,
0.04545387625694275,
0.014403696171939373,
0.031772859394550323,
0.0018020194256678224,
0.0007289067725650966,
-0.026813799515366554,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "msg", "annotation": null, "type_comment": null}}], "kwarg": null,... | def get_char(self, msg):
self.done.clear()
self.char_signal.emit(msg)
self.done.wait()
data = self.character_dialog.data
if not data or 'done' in data:
self.close_char_dialog_signal.emit()
return data | |
9,489 | [
0.029120758175849915,
0.0119345523416996,
-0.048865173012018204,
0.026213189586997032,
-0.017422867938876152,
0.007776054088026285,
-0.007071701344102621,
0.0007194962818175554,
-0.008531119674444199,
0.04066087305545807,
-0.04212592542171478,
0.006694168318063021,
0.03628825023770332,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "object", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Name", "_fields": {"id": "pyqtSignal", "ctx": {... | class QtHandler(QtHandlerBase):
char_signal = pyqtSignal(object)
pin_signal = pyqtSignal(object, object)
close_char_dialog_signal = pyqtSignal()
def __init__(self, win, pin_matrix_widget_class, device):
super(QtHandler, self).__init__(win, device)
self.char_signal.connect(self.update_c... | |
9,490 | [
0.025974411517381668,
0.027962883934378624,
-0.05170026421546936,
0.01619361713528633,
-0.004178897477686405,
0.02627268247306347,
0.027018358930945396,
0.03179069235920906,
0.0015449493657797575,
0.024532770738005638,
-0.018393363803625107,
0.014801686629652977,
0.0314178541302681,
0.0214... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "msg", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def pin_dialog(self, msg, show_strength):
# Needed e.g. when resetting a device
self.clear_dialog()
dialog = WindowModalDialog(self.top_level_window(), _("Enter PIN"))
matrix = self.pin_matrix_widget_class(show_strength)
vbox = QVBoxLayout()
vbox.addWidget(QLabel(msg))
... | |
9,491 | [
-0.008342468179762363,
0.007741997018456459,
-0.0032413783483207226,
-0.010388733819127083,
0.00029513449408113956,
-0.040692124515771866,
-0.016778213903307915,
0.04118182882666588,
-0.002815801650285721,
0.0029965259600430727,
-0.006820885930210352,
-0.012324233539402485,
0.040855359286069... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "menu", "annotation": null, "type_comment": null}}, {"_type": "arg... | def receive_menu(self, menu, addrs, wallet):
if len(addrs) != 1:
return
for keystore in wallet.get_keystores():
if type(keystore) == self.keystore_class:
def show_address():
keystore.thread.add(partial(self.show_address, wallet, addrs[0], keyst... | |
9,492 | [
-0.00038021086947992444,
-0.0016566806007176638,
-0.02701827697455883,
0.009295523166656494,
0.030384907498955727,
0.015522724017500877,
0.04025041311979294,
0.036905091255903244,
-0.008874693885445595,
0.03641501069068909,
-0.007495014928281307,
0.006008796393871307,
0.0284458976238966,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "window", "annotation": null, "type_comment": null}}, {"_type": "a... | def show_settings_dialog(self, window, keystore):
def connect():
device_id = self.choose_device(window, keystore)
return device_id
def show_dialog(device_id):
if device_id:
SettingsDialog(window, self, keystore, device_id).exec_()
keystore.thre... | |
9,493 | [
-0.005429823417216539,
-0.02120155096054077,
-0.003169554052874446,
-0.00604464253410697,
-0.01595940813422203,
0.009157568216323853,
0.025731796398758888,
0.01467799674719572,
-0.02481280453503132,
0.02016606554389,
0.0075202081352472305,
0.008814563974738121,
0.016295941546559334,
0.0016... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "window", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, window, plugin, keystore, device_id):
title = _("{} Settings").format(plugin.device)
super(SettingsDialog, self).__init__(window, title)
self.setMaximumWidth(540)
devmgr = plugin.device_manager()
config = devmgr.config
handler = keystore.handler
... | |
9,494 | [
0.0341685488820076,
-0.010579203255474567,
0.019755231216549873,
-0.04096287116408348,
-0.027398843318223953,
-0.04637863487005234,
0.06208435073494911,
-0.011619276367127895,
-0.03293769434094429,
0.045492418110370636,
0.013785582035779953,
-0.015779567882418633,
-0.05174516513943672,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "features", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def update(features):
self.features = features
set_label_enabled()
bl_hash = bh2u(features.bootloader_hash)
bl_hash = "\n".join([bl_hash[:32], bl_hash[32:]])
noyes = [_("No"), _("Yes")]
endis = [_("Enable Passphrases"), _("Disable Passphrases")]
... | |
9,495 | [
-0.008869856595993042,
0.023339802399277687,
-0.009882508777081966,
-0.017825117334723473,
-0.035381823778152466,
-0.005877652671188116,
0.010163123719394207,
0.036626286804676056,
0.02667057327926159,
0.003803545841947198,
0.0403352752327919,
-0.004764345474541187,
0.00922977551817894,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "method", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kw_args", "annotation": null, "type_comment": null}},... | def invoke_client(method, *args, **kw_args):
unpair_after = kw_args.pop('unpair_after', False)
def task():
client = devmgr.client_by_id(device_id)
if not client:
raise RuntimeError("Device not connected")
if method:
... | |
9,496 | [
0.003609140170738101,
-0.0056200348772108555,
-0.04828610643744469,
0.02291126362979412,
-0.03668265789747238,
-0.02515311911702156,
0.01282291766256094,
0.033898815512657166,
0.032790206372737885,
0.008536294102668762,
0.04242279380559921,
0.03761881962418556,
-0.012471857480704784,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields"... | def wipe_device():
wallet = window.wallet
if wallet and sum(wallet.get_balance()):
title = _("Confirm Device Wipe")
msg = _("Are you SURE you want to wipe the device?\n"
"Your wallet still has litecoins in it!")
if not self.... | |
9,497 | [
0.011655484326183796,
0.013396700844168663,
-0.020326027646660805,
-0.01704496145248413,
-0.043423786759376526,
0.02691185101866722,
0.036222025752067566,
0.08248861134052277,
0.020077282562851906,
0.003734137862920761,
0.0029864218086004257,
0.018679572269320488,
0.029944172129034996,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def toggle_passphrase():
title = _("Confirm Toggle Passphrase Protection")
currently_enabled = self.features.passphrase_protection
if currently_enabled:
msg = _("After disabling passphrases, you can only pair this "
"Electrum wallet if it had a... | |
9,498 | [
0.0556136891245842,
0.044654522091150284,
0.058762405067682266,
-0.06203380227088928,
0.020456433296203613,
0.053078360855579376,
0.022265922278165817,
0.05778098851442337,
-0.030607976019382477,
0.04124000668525696,
-0.0016382525209337473,
-0.04338685795664787,
0.06632750481367111,
-0.003... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def daemon_exec(config):
if 'daemon' in config:
if os.name != 'posix':
raise Exception('daemon mode is only supported on Unix')
command = config['daemon']
if not command:
command = 'start'
pid_file = config['pid-file']
log_file = config['log-file']
... | |
9,499 | [
0.002369844587519765,
0.029129015281796455,
-0.000609188515227288,
-0.02442355826497078,
-0.005844475235790014,
-0.01127193309366703,
-0.019444240257143974,
0.02057703584432602,
0.028182944282889366,
0.014763680286705494,
0.03301288187503815,
0.0011934804497286677,
0.02895473875105381,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def task():
client = devmgr.client_by_id(device_id)
if not client:
raise RuntimeError("Device not connected")
if method:
getattr(client, method)(*args, **kw_args)
if unpair_after:
devmgr.unpair_id... | |
9,500 | [
0.06605906784534454,
0.05461612343788147,
0.020948337391018867,
-0.04330994933843613,
0.011853248812258244,
0.027581598609685898,
0.019911179319024086,
0.04650120809674263,
0.024504313245415688,
0.031137574464082718,
0.06177366524934769,
-0.03011181205511093,
0.017096031457185745,
-0.00577... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pid_file", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "log_file", "annotation": null, "type_comment": null}}], "kwar... | def daemon_start(pid_file, log_file):
def handle_exit(signum, _):
if signum == signal.SIGTERM:
sys.exit(0)
sys.exit(1)
signal.signal(signal.SIGINT, handle_exit)
signal.signal(signal.SIGTERM, handle_exit)
# fork only once because we are sure parent will exit
pid = os.fo... |