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
15,901
[ 0.06251853704452515, 0.009000083431601524, 0.00540175149217248, -0.0391307957470417, 0.01080350298434496, 0.010548301972448826, 0.02110794559121132, 0.02183385007083416, 0.02524787001311779, -0.01373547688126564, 0.047365278005599976, -0.004276032093912363, -0.016480304300785065, 0.0178754...
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 testStream(self): stream = InputStream("abcde") self.assertEqual(0, stream.index) self.assertEqual(5, stream.size) self.assertEqual(ord("a"), stream.LA(1)) stream.consume() self.assertEqual(1, stream.index) stream.seek(5) self.assertEqual(Token.EOF, st...
15,902
[ -0.03663550317287445, 0.0007879933691583574, 0.010468072257936, -0.024093618616461754, -0.017316600307822227, -0.0008154974784702063, -0.04424864426255226, -0.030518583953380585, -0.025083767250180244, 0.05641647428274155, 0.016007404774427414, 0.02713007479906082, 0.06926640123128891, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vlans", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "state", "annotation": null, "type_comment": null}}], "kwarg": nu...
def build_commands(vlans, state): commands = [] for vlan in vlans: if state == 'present': command = 'vlan {0}'.format(vlan) commands.append(command) elif state == 'absent': command = 'no vlan {0}'.format(vlan) commands.append(command) return co...
15,903
[ 0.012871532700955868, 0.011373259127140045, -0.02735484391450882, -0.052030954509973526, -0.007780807092785835, 0.013541215099394321, -0.03366575390100479, -0.00451752170920372, 0.009165575727820396, 0.03611747547984123, 0.022417351603507996, 0.021066635847091675, 0.010573044419288635, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vlanid", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": ...
def get_vni(vlanid, module): flags = str('all | section vlan.{0}'.format(vlanid)).split(' ') body = get_config(module, flags=flags) #command = 'show run all | section vlan.{0}'.format(vlanid) #body = execute_show_command(command, module, command_type='cli_show_ascii')[0] value = '' if body: ...
15,904
[ -0.02051989547908306, 0.0249393992125988, 0.004816610831767321, -0.06340745091438293, -0.033346183598041534, 0.010157294571399689, -0.05052713677287102, 0.005178599152714014, 0.02952098846435547, 0.018920661881566048, -0.014317463152110577, 0.019244831055402756, 0.028462035581469536, -0.03...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def get_list_of_vlans(module): body = run_commands(module, ['show vlan | json']) vlan_list = [] vlan_table = body[0].get('TABLE_vlanbrief')['ROW_vlanbrief'] if isinstance(vlan_table, list): for vlan in vlan_table: vlan_list.append(str(vlan['vlanshowbr-vlanid-utf'])) else: ...
15,905
[ -0.03797205910086632, -0.022141078487038612, 0.04158419743180275, -0.012330328114330769, 0.02282114140689373, 0.0106301698833704, 0.02722482942044735, 0.010106186382472515, 0.02218567207455635, -0.018774207681417465, 0.0023049686569720507, -0.0050252219662070274, -0.015719495713710785, 0.0...
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 TestCore(OsfTestCase): def setUp(self): super(TestCore, self).setUp() self.user = UserFactory() self.user.add_addon('box') self.user.save() self.settings = self.user.get_addon('box') self.settings.save() def test_get_addon_returns_box_user_settings(self...
15,906
[ -0.014706057496368885, -0.0010392157128080726, -0.011682325042784214, -0.052715182304382324, -0.04468473792076111, 0.05601603910326958, -0.03470826894044876, -0.024571679532527924, 0.007279129233211279, 0.08996067196130753, 0.01159610878676176, -0.033993903547525406, 0.009884096682071686, ...
14
{"_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 main(): argument_spec = dict( vlan_id=dict(required=False, type='str'), vlan_range=dict(required=False), name=dict(required=False), vlan_state=dict(choices=['active', 'suspend'], required=False), mapped_vni=dict(required=False, type='str'), state=dict(choices=['pr...
15,907
[ -0.003780178027227521, -0.0116069121286273, 0.042836032807826996, -0.010074488818645477, 0.032420337200164795, 0.003217491088435054, 0.03388093039393425, 0.03261189162731171, 0.013648148626089096, -0.019634177908301353, 0.009853005409240723, 0.016617219895124435, -0.018065838143229485, -0....
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 setUp(self): super(TestCore, self).setUp() self.user = UserFactory() self.user.add_addon('box') self.user.save() self.settings = self.user.get_addon('box') self.settings.save()
15,908
[ 0.033591605722904205, -0.022856498137116432, 0.07951082289218903, -0.03501226007938385, -0.016795802861452103, 0.02291378378868103, 0.018399767577648163, 0.04788980633020401, 0.005000933073461056, -0.0001342604518868029, -0.00906240101903677, -0.03205638378858566, -0.029604608193039894, -0...
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 tearDown(self): ServerTestsBase.tearDown(self) # Restore the configuration settings. setup.setup_repos() setup.setup_configs() # Flush the configuration cache. config.cache.enable(False) self.go('/haiti?lang=en&flush=config')
15,909
[ 0.04792552441358566, -0.012307405471801758, 0.045869067311286926, -0.05281588435173035, 0.01677769608795643, 0.04724839702248573, 0.05048355832695961, 0.02382482960820198, 0.027461251243948936, -0.019247954711318016, 0.03217605873942375, 0.011091085150837898, -0.019335730001330376, 0.00188...
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_config_cache_enabling(self): # The tests below flush the resource cache so that the effects of # the config cache become visible for testing. # Modify the custom title directly in the datastore. # With the config cache off, new values should appear immediately. config.c...
15,910
[ 0.07645180821418762, -0.007744439411908388, 0.07234299182891846, -0.04240397736430168, 0.01885903626680374, 0.030031342059373856, 0.016816167160868645, -0.011801324784755707, 0.011657054536044598, 0.00013471256534103304, 0.0009622841025702655, -0.024468272924423218, 0.002412202302366495, 0...
7
{"_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_config_namespaces(self): # Tests the cache's ability to retrieve global or repository-specific # configuration entries. cfg_sub = config.Configuration('_foo') cfg_global = config.Configuration('*') config.set_for_repo('*', captcha_private_key...
15,911
[ 0.06300967931747437, 0.0011524658184498549, 0.02536657266318798, -0.0009444672614336014, 0.005854772869497538, 0.033871401101350784, 0.01729314960539341, -0.0171698909252882, 0.024799585342407227, 0.007173637393862009, 0.015259386971592903, -0.0025699371472001076, -0.036459825932979584, 0....
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_global_admin_page(self): # Load the global administration page. doc = self.go_as_admin('/global/admin') assert self.s.status == 200 # Change some settings. settings_form = doc.first('form', id='save_global') doc = self.s.submit(settings_form, sms_num...
15,912
[ -0.012825505807995796, 0.009422261267900467, 0.032567061483860016, -0.02077553980052471, -0.010456245392560959, 0.03642909228801727, 0.02513059601187706, -0.018187155947089195, -0.0038277937564998865, 0.011045136488974094, 0.03503218665719032, -0.013003543019294739, -0.02532232739031315, 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 test_repo_admin_page(self): # Load the repository administration page. doc = self.go_as_admin('/haiti/admin') self.assertEquals(self.s.status, 200) # Activate a new repository. assert not Repo.get_by_key_name('xyz') create_form = doc.first('form', id='create_repo') ...
15,913
[ 0.044108860194683075, 0.029692793264985085, 0.001813775161281228, -0.008478852920234203, 0.01108100637793541, 0.03152169659733772, -0.005940576083958149, 0.027164602652192116, 0.01952623948454857, 0.014093318954110146, 0.036201540380716324, -0.001741493120789528, -0.02191995270550251, -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 test_deactivation(self): # Load the administration page. doc = self.go_as_admin('/haiti/admin') assert self.s.status == 200 cfg = config.Configuration('haiti') old_updated_date = cfg.updated_date self.advance_utcnow(seconds=1) # Deactivate an existing reposi...
15,914
[ 0.01805531047284603, 0.0020096031948924065, 0.030345499515533447, -0.017596719786524773, 0.004304186906665564, 0.030607549473643303, 0.04035584628582001, 0.018343565985560417, 0.02089856192469597, 0.023636994883418083, 0.011137165129184723, 0.005093615036457777, 0.00538187101483345, -0.022...
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_the_test_mode(self): HTML_PATHS = ['', '/query', '/results', '/create', '/view', '/multiview', '/reveal', '/photo', '/embed', '/delete'] # First check no HTML pages show the test mode message. for path in HTML_PATHS: doc = self.go('/haiti%s' % path) ...
15,915
[ 0.0536479689180851, -0.016572171822190285, 0.024762701243162155, 0.022988086566329002, 0.001025522593408823, 0.006095119286328554, 0.0059722610749304295, 0.0058050379157066345, 0.006979013793170452, -0.017732497304677963, -0.0016082446090877056, -0.02432587370276451, -0.019124886021018028, ...
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_custom_messages(self): # Load the administration page. doc = self.go_as_admin('/haiti/admin') assert self.s.status == 200 # Edit the custom text fields settings_form = doc.first('form', id='save_repo') doc = self.s.submit(settings_form, language_menu...
15,916
[ 0.00934220477938652, 0.07963204383850098, 0.020446397364139557, -0.04152906686067581, -0.015980247408151627, 0.042312171310186386, 0.00742114894092083, -0.009764347225427628, 0.025353042408823967, 0.042067453265190125, 0.03061453253030777, -0.008687577210366726, -0.014389565214514732, 0.00...
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": "module", "annotation":...
class VmwareMaintenanceMgr(PyVmomi): def __init__(self, module): super(VmwareMaintenanceMgr, self).__init__(module) self.esxi_hostname = self.module.params.get('esxi_hostname') self.vsan = self.module.params.get('vsan', None) self.host = self.find_hostsystem_by_name(host_name=self.es...
15,917
[ 0.005223654210567474, 0.0800483226776123, 0.03410879150032997, -0.04195619747042656, -0.003082909854128957, 0.04882566258311272, -0.01093031745404005, 0.017626849934458733, 0.031318072229623795, 0.03289232403039932, 0.03532525897026062, 0.004195023328065872, 0.0011262758634984493, -0.00791...
12
{"_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 ExitMaintenanceMode(self): if not self.host.runtime.inMaintenanceMode: self.module.exit_json(changed=False, hostsystem=str(self.host), hostname=self.esxi_hostname, status='NO_ACTION', ...
15,918
[ 0.010895741172134876, 0.08548770099878311, 0.030869146808981895, -0.03918398171663284, -0.0035630471538752317, 0.05588993802666664, -0.0025109788402915, 0.007882566191256046, 0.021511778235435486, 0.0350901335477829, 0.034403588622808456, 0.006871818099170923, 0.00514909578487277, -0.00091...
12
{"_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 EnterMaintenanceMode(self): if self.host.runtime.inMaintenanceMode: self.module.exit_json(changed=False, hostsystem=str(self.host), hostname=self.esxi_hostname, status='NO_ACTION', ...
15,919
[ 0.023321086540818214, 0.06612314283847809, 0.01119119580835104, -0.02716120332479477, -0.044082097709178925, 0.039376430213451385, 0.00438260892406106, 0.01933468133211136, 0.02918488346040249, 0.04608139395713806, 0.03740151226520538, -0.03671882674098015, 0.010532890446484089, 0.02603964...
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": "Call", "_fields": {"a...
def main(): spec = vmware_argument_spec() spec.update(dict(esxi_hostname=dict(type='str', required=True), vsan=dict(type='str', choices=['ensureObjectAccessibility', 'evacuateAllData', ...
15,920
[ 0.0536179356276989, -0.000934068753849715, 0.013337011449038982, -0.036120135337114334, 0.032769013196229935, 0.018284974619746208, -0.0054905530996620655, 0.00915935542434454, -0.04594859108328819, 0.027326254174113274, 0.043047286570072174, -0.016733113676309586, 0.027123838663101196, -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": "stack", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__(self, stack, entryfunc): # Store the entry func, this is needed for prepending a stack self.entryfunction = entryfunc self.entryFrame = 0 for (fname, _) in stack: if fname == entryfunc: break self.entryFrame += 1 self.stack =...
15,921
[ 0.001685788040049374, -0.03062339685857296, 0.007283564656972885, -0.006833220832049847, 0.025315342471003532, 0.0440736748278141, -0.021616514772176743, -0.020355552434921265, -0.05764404311776161, 0.04027877375483513, 0.01862623170018196, -0.05966158211231232, 0.03156011179089546, 0.0311...
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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def is_contained_in(self, other): slen = len(self.stack) olen = len(other.stack) if slen > olen: return False for i in range(slen): if self.stack[i] != other.stack[i]: return False return True
15,922
[ 0.01757814921438694, 0.05613911151885986, 0.061838772147893906, -0.025068407878279686, -0.005125909578055143, 0.024173108860850334, 0.011487585492432117, -0.0010261276038363576, 0.006153613328933716, 0.04072985798120499, 0.050187256187200546, -0.008398168720304966, -0.052103955298662186, 0...
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 validate(self): if not self.doc.is_opening: self.doc.is_opening='No' self.doc.clearance_date = None self.validate_debit_credit() self.validate_cheque_info() self.validate_entries_for_advance() self.validate_against_jv() get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year, \ ...
15,923
[ -0.0024580240715295076, 0.017396237701177597, 0.03868407756090164, -0.044044699519872665, -0.01294409018009901, 0.02216409519314766, 0.008073142729699612, -0.00037510637775994837, 0.032627612352371216, 0.02968958020210266, 0.021339384838938713, -0.005183434579521418, -0.016404008492827415, ...
12
{"_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 validate_entries_for_advance(self): for d in getlist(self.doclist,'entries'): if not d.is_advance and not d.against_voucher and \ not d.against_invoice and not d.against_jv: master_type = webnotes.conn.get_value("Account", d.account, "master_type") if (master_type == 'Customer' and flt(d.credit) >...
15,924
[ 0.0067438087426126, 0.04280993714928627, 0.014277189038693905, -0.04246382415294647, -0.0045400382950901985, 0.040084291249513626, 0.0054296585731208324, 0.02435775101184845, -0.026499329134821892, 0.03270774334669113, 0.02355736307799816, 0.010015664622187614, -0.029549455270171165, 0.014...
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 validate_cheque_info(self): if self.doc.voucher_type in ['Bank Voucher']: if not self.doc.cheque_no or not self.doc.cheque_date: msgprint("Reference No & Reference Date is required for %s" % self.doc.voucher_type, raise_exception=1) if self.doc.cheque_date and not self.doc.cheque_no: msgprint...
15,925
[ -0.003978111781179905, 0.004253918770700693, 0.029229063540697098, -0.02612704411149025, -0.017249301075935364, 0.04158522188663483, -0.0011048507876694202, 0.014367927797138691, 0.02506275288760662, 0.021220922470092773, 0.021675193682312965, -0.011791564524173737, -0.008280702866613865, ...
13
{"_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 validate_against_jv(self): for d in getlist(self.doclist, 'entries'): if d.against_jv: if d.against_jv == self.doc.name: msgprint("You can not enter current voucher in 'Against JV' column", raise_exception=1) elif not webnotes.conn.sql("""select name from `tabJournal Voucher Detail` w...
15,926
[ 0.018846942111849785, -0.019355595111846924, 0.011110058054327965, 0.0018505608895793557, 0.024335043504834175, 0.03632855415344238, 0.008125066757202148, 0.04058517888188362, 0.02819010056555271, 0.018606001511216164, 0.0278688445687294, -0.018806785345077515, -0.014737559482455254, -0.02...
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 set_against_account(self): # Debit = Credit debit, credit = 0.0, 0.0 debit_list, credit_list = [], [] for d in getlist(self.doclist, 'entries'): debit += flt(d.debit, 2) credit += flt(d.credit, 2) if flt(d.debit)>0 and (d.account not in debit_list): debit_list.append(d.account) if flt(d.credit)>...
15,927
[ 0.002015474485233426, 0.00928534846752882, 0.05851959064602852, -0.0326339453458786, -0.013934462331235409, 0.005003270227462053, -0.024958400055766106, 0.008177803829312325, -0.00007415159052470699, 0.010637584142386913, 0.025499293580651283, 0.011513317003846169, -0.019897175952792168, -...
18
{"_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 create_remarks(self): r = [] if self.doc.cheque_no : if self.doc.cheque_date: r.append('Via Reference #%s dated %s' % (self.doc.cheque_no, formatdate(self.doc.cheque_date))) else : msgprint("Please enter Reference date", raise_exception=1) for d in getlist(self.doclist, 'entries'): i...
15,928
[ 0.009547469206154346, -0.0024260475765913725, 0.039669327437877655, -0.0031234577763825655, 0.013766409829258919, 0.03523097559809685, 0.0131019102409482, -0.014443445950746536, 0.0010805941419675946, 0.013365202583372593, 0.049172911792993546, -0.03432825952768326, -0.025388870388269424, ...
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 set_aging_date(self): if self.doc.is_opening != 'Yes': self.doc.aging_date = self.doc.posting_date else: # check account type whether supplier or customer exists = False for d in getlist(self.doclist, 'entries'): account_type = webnotes.conn.get_value("Account", d.account, "account_type") if...
15,929
[ 0.015367856249213219, -0.022966479882597923, 0.052284833043813705, -0.006427333224564791, 0.04968633875250816, -0.006079555489122868, -0.00021469556668307632, 0.003792750183492899, 0.04698285460472107, 0.010925482027232647, 0.017060814425349236, -0.056746888905763626, 0.00238523306325078, ...
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": "ac", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def get_credit_days_for(self, ac): if not self.credit_days_for.has_key(ac): self.credit_days_for[ac] = cint(webnotes.conn.get_value("Account", ac, "credit_days")) if not self.credit_days_for[ac]: if self.credit_days_global==-1: self.credit_days_global = cint(webnotes.conn.get_value("Company", self....
15,930
[ 0.011476321145892143, 0.0048520066775381565, 0.01248104590922594, -0.002867520321160555, 0.0072577279061079025, 0.015464015305042267, -0.005341887474060059, 0.014989735558629036, 0.008118920028209686, 0.025935612618923187, 0.05866091325879097, -0.032350871711969376, -0.05940977856516838, 0...
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 check_credit_days(self): date_diff = 0 if self.doc.cheque_date: date_diff = (getdate(self.doc.cheque_date)-getdate(self.doc.posting_date)).days if date_diff <= 0: return # Get List of Customer Account acc_list = filter(lambda d: webnotes.conn.get_value("Account", d.account, "master_type")=='...
15,931
[ -0.002763368422165513, 0.007406238932162523, -0.0003413767262827605, -0.004914942663162947, 0.02729543298482895, -0.0182479377835989, -0.05214368924498558, 0.03979015350341797, -0.008835719898343086, 0.011577027849853039, 0.06790915131568909, 0.005997347645461559, -0.04421389475464821, 0.0...
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 get_authorized_user(self): if self.is_approving_authority==-1: self.is_approving_authority = 0 # Fetch credit controller role approving_authority = webnotes.conn.get_value("Global Defaults", None, "credit_controller") # Check logged-in user is authorized if approving_authority in webnotes...
15,932
[ 0.023012058809399605, -0.012763486243784428, 0.046401944011449814, -0.05095949023962021, 0.0070665557868778706, 0.00846569798886776, 0.022197367623448372, -0.004424714483320713, 0.011889760382473469, 0.030438730493187904, 0.026613228023052216, -0.03768829628825188, -0.006895352620631456, 0...
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 check_account_against_entries(self): for d in self.doclist.get({"parentfield": "entries"}): if d.against_invoice and webnotes.conn.get_value("Sales Invoice", d.against_invoice, "debit_to") != d.account: msgprint("Debit account is not matching with Sales Invoice", raise_exception=1) if d.agains...
15,933
[ -0.009429932571947575, -0.01889951340854168, -0.004619147162884474, -0.01967928372323513, 0.002856403822079301, -0.01653377152979374, -0.009324200451374054, -0.013361824676394463, 0.02923477254807949, -0.007949690334498882, 0.04829288646578789, -0.03359619900584221, -0.005464999470859766, ...
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": "args", "annotation": null, "type_comment": null}}], "kwarg": null...
def get_outstanding(self, args): args = eval(args) o_s = webnotes.conn.sql("""select outstanding_amount from `tab%s` where name = %s""" % (args['doctype'], '%s'), args['docname']) if args['doctype'] == 'Purchase Invoice': return {'debit': o_s and flt(o_s[0][0]) or 0} if args['doctype'] == 'Sales Invoice'...
15,934
[ -0.0031507390085607767, 0.006626359652727842, 0.048523832112550735, -0.004321538843214512, -0.0008129703346639872, -0.0026480918750166893, -0.01370632741600275, 0.020277518779039383, 0.011376988142728806, 0.03109056130051613, 0.01981165073812008, 0.006016440223902464, -0.026554478332400322, ...
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_balance(self): if not getlist(self.doclist,'entries'): msgprint("Please enter atleast 1 entry in 'GL Entries' table") else: flag, self.doc.total_debit, self.doc.total_credit = 0, 0, 0 diff = flt(self.doc.difference, 2) # If any row without amount, set the diff on that row for d in getlist...
15,935
[ 0.015340819954872131, -0.009276142343878746, 0.02489844523370266, -0.03260084241628647, 0.028583312407135963, -0.00747848954051733, -0.03477593511343002, 0.004513322841376066, 0.019371142610907555, 0.020791353657841682, 0.026817645877599716, -0.00962159875780344, -0.02445063181221485, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def get_values(self): cond = (flt(self.doc.write_off_amount) > 0) and \ ' and outstanding_amount <= '+ self.doc.write_off_amount or '' if self.doc.write_off_based_on == 'Accounts Receivable': return webnotes.conn.sql("""select name, debit_to, outstanding_amount from `tabSales Invoice` where docstatus = 1...
15,936
[ 0.005200138781219721, -0.012407349422574043, 0.025713970884680748, -0.020618094131350517, 0.000538015621714294, 0.010406794026494026, -0.03409414365887642, 0.028125062584877014, 0.022494837641716003, 0.015626482665538788, 0.028802774846553802, -0.013971300795674324, -0.03221740201115608, -...
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 get_outstanding_invoices(self): self.doclist = self.doc.clear_table(self.doclist, 'entries') total = 0 for d in self.get_values(): total += flt(d[2]) jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist) jd.account = cstr(d[1]) if self.doc.write_off_based_on == 'Accounts Recei...
15,937
[ 0.0223542507737875, -0.035291638225317, -0.017419036477804184, 0.05637159198522568, 0.020809972658753395, -0.015108018182218075, 0.001564527628943324, 0.03935212269425392, 0.06993532925844193, 0.03332619369029999, 0.05537806823849678, -0.02058319002389908, 0.03881216421723366, -0.013812119...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def callback(request): client = _openid_consumer(request) response = client.complete( dict(list(request.GET.items()) + list(request.POST.items())), request.build_absolute_uri(request.path)) if response.status == consumer.SUCCESS: login = providers.registry \ .by_id(OpenID...
15,938
[ 0.025724459439516068, 0.08485127985477448, -0.012038768269121647, -0.05028911307454109, 0.015170239843428135, -0.008315796963870525, 0.003928836900740862, -0.03050285205245018, -0.01614447496831417, 0.016898348927497864, 0.03774002939462662, 0.006784854922443628, 0.026930654421448708, 0.03...
15
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "book", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "background", "annotation": null, "type_comment": null}}], "k...
async def _read_pages(book, background=False): if book.filename == manual_filename: return book if book.load_state == book_file.LoadState.DONE: return book try: if book.ext == '.pef': mode = 'rb' else: mode = 'r' async with aiofiles.open(book....
15,939
[ 0.01219604630023241, 0.03836449608206749, -0.0211612731218338, -0.024368248879909515, 0.02682414837181568, -0.017274752259254456, 0.00310265994630754, -0.03340500593185425, -0.04279942065477371, -0.03540787845849991, 0.0442538857460022, 0.0033619599416851997, -0.017370127141475677, 0.02155...
12
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "book", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "store", "annotation": null, "type_comment": null}}, {"_type"...
async def get_page_data(book, store, page_number=None): if page_number is None: page_number = book.page_number while book.load_state != book_file.LoadState.DONE: await asyncio.sleep(0) # accessing store.state will get a fresh state book = store.state['app']['user']['books'][book...
15,940
[ 0.013521557673811913, 0.03933108597993851, -0.024036994203925133, -0.02974982187151909, 0.026923349127173424, 0.008904586546123028, 0.027713803574442863, -0.0182642824947834, -0.03545067459344864, -0.009473473764955997, 0.019222408533096313, 0.01572524756193161, -0.019988911226391792, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "book", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "store", "annotation": null, "type_comment": null}}, {"_type"...
async def _load(book, store, background=False): await store.dispatch(actions.set_book_loading(book)) if background: log.info('background loading {}'.format(book.filename)) else: log.info('priority loading {}'.format(book.filename)) book = await _read_pages2(book, background=background) ...
15,941
[ -0.01751670427620411, -0.024432802572846413, -0.03456825390458107, 0.015154212713241577, 0.026048598811030388, -0.03424999117851257, -0.032976940274238586, -0.013048781082034111, 0.03280556574463844, -0.01489715464413166, -0.0014750263653695583, -0.004856570158153772, 0.004100695718079805, ...
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": "block", "annotation": null, "type_comment": null}}, {"_type": "ar...
def get(self, block, name, default): if self.user: assert self.user is TESTUSER assert block == 'block' if name == 'foo': return 'fu' elif name == 'oh': return 'man' return default
15,942
[ 0.03988150507211685, 0.04969993233680725, 0.0013244645670056343, -0.04060620069503784, -0.05619879439473152, 0.026112334802746773, 0.00822877511382103, -0.02044336311519146, -0.04221922531723976, -0.021203123033046722, 0.022979790344834328, -0.015008163638412952, 0.004552710335701704, 0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "active_plugins", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], ...
def upgrade(active_plugins=None, options=None): if not migration.should_run(active_plugins, migration_for_plugins): return op.execute("CREATE TABLE IF NOT EXISTS meteringlabels( " "tenant_id VARCHAR(255) NULL, " "id VARCHAR(36) PRIMARY KEY NOT NULL, " "name ...
15,943
[ 0.06722219288349152, -0.007651815190911293, -0.00878963153809309, -0.007282025180757046, 0.0420081801712513, -0.01563359797000885, -0.009506456553936005, 0.03593224287033081, 0.014120301231741905, -0.04965430870652199, 0.057846587151288986, 0.0010645694565027952, 0.0003434783429838717, -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 test_delete(self): data = self.make_one() data.delete('block', 'foo') self.assertEqual(data.get('block', 'foo'), 'fu') with disable_overrides(): # Since field_data is responsible for attribute access, you'd # expect it to raise AttributeError. In fact, it rais...
15,944
[ 0.03067457303404808, -0.006536324042826891, 0.029322229325771332, -0.04243781045079231, 0.03303580731153488, -0.020145617425441742, 0.035697560757398605, -0.005323508754372597, -0.05070212855935097, -0.012460874393582344, -0.00035485587432049215, -0.02560865320265293, 0.00040080599137581885,...
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 OverrideModulestoreFieldDataTests(FieldOverrideTestMixin, OverrideFieldDataTests): def make_one(self): return OverrideModulestoreFieldData.wrap(self.course, DictFieldData({ 'foo': 'bar', 'bees': 'knees', })) @override_settings(MODULESTORE_FIELD_OVERRIDE_PROVIDERS=[...
15,945
[ 0.013236475177109241, -0.0014907126314938068, 0.019497759640216827, 0.004874439910054207, -0.050137098878622055, -0.008268407545983791, -0.0018739969236776233, -0.01620912179350853, -0.018175283446907997, -0.03073296509683132, -0.014289774931967258, -0.01631445251405239, 0.008888685144484043...
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__(self): super(ViscaUI, self).__init__() self.group = QGroupBox('Camera') self.grid = QGridLayout() self.group.setLayout(self.grid) self.setCentralWidget(self.group) # create and add power panel self.grid.addWidget(self.create_power()) self.grid...
15,946
[ 0.044844307005405426, 0.003771819407120347, 0.03936007618904114, -0.01798737421631813, -0.03453034535050392, 0.011758372187614441, -0.0017815286992117763, -0.009890799410641193, -0.005929965991526842, -0.007983731105923653, 0.01650911569595337, -0.0469883494079113, 0.0656302198767662, 0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "subject"}}, "targets": [{"_type": "Name", "_fields": {"id": "_rec_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class password_entry(osv.osv): _rec_name = "subject" _columns = { "subject" : fields.char("Name",select=True), "login" : fields.char("Login",select=True), "password" : fields.char("Password",select=True), "partner_id" : fields.many2one("res.partner","Partner", select=True, ondel...
15,947
[ -0.00033381913090124726, 0.005461063701659441, -0.0013045374071225524, -0.007095484063029289, -0.028477901592850685, -0.013531201519072056, -0.007953180000185966, 0.0000802215508883819, -0.047263242304325104, -0.013579185120761395, -0.011048082262277603, 0.012715491466224194, 0.0290297064930...
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 create_lens(self): lens_group = QGroupBox('Lens Group') lens_layout = QGridLayout() lens_group.setLayout(lens_layout) # ----------------------------- # ---------- ZOOM ------------- # ----------------------------- zoom_group = QGroupBox('Zoom Group') ...
15,948
[ 0.018197108060121536, 0.010045340284705162, -0.03631363809108734, -0.027262087911367416, -0.01872086152434349, 0.0631728395819664, 0.051086198538541794, 0.023233206942677498, -0.0029796925373375416, 0.038166921585798264, -0.004267255309969187, -0.02373010292649269, 0.004945449996739626, 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": "mode", "annotation": null, "type_comment": null}}], "kwarg": null...
def on_AE_currentIndexChanged(self,mode): if type(mode) == unicode: mode = mode.encode('utf-8') v.AE = mode if mode == 'auto': self.AE_manual.setVisible(False) if mode == 'manual': self.AE_manual.setVisible(True) sel...
15,949
[ -0.01521667093038559, 0.04003189876675606, 0.010394646786153316, -0.02517915517091751, 0.00040302000707015395, 0.006289102602750063, -0.0350506566464901, 0.009251690469682217, -0.020686939358711243, 0.06873659044504166, -0.0037473042029887438, -0.05467993766069412, -0.028340766206383705, -...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class AzureRMVirtualMachineImageFacts(AzureRMModuleBase): def __init__(self, **kwargs): self.module_arg_spec = dict( location=dict(type='str', required=True), publisher=dict(type='str'), offer=dict(type='str'), sku=dict(type='str'), version=dict(...
15,950
[ 0.020568758249282837, 0.01823892630636692, -0.04545455798506737, -0.018079036846756935, -0.028003662824630737, -0.0022227622102946043, 0.07492007315158844, 0.04974875599145889, -0.012882598675787449, 0.02313842624425888, 0.011055279523134232, 0.025902245193719864, -0.03656921908259392, 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": "mode", "annotation": null, "type_comment": null}}], "kwarg": null...
def on_focus_mode_currentIndexChanged(self, mode): if type(mode) == unicode: mode = mode.encode('utf-8') v.focus_auto = mode sleep(0.1) focus = v._query('focus') focus_auto___ = v._query('focus_auto') print('------focus_mode-------', focus_auto___) sel...
15,951
[ -0.007532174699008465, 0.02379699796438217, 0.0010205352446064353, 0.0026824739761650562, -0.005147162824869156, -0.005213561002165079, -0.007585292682051659, 0.019505038857460022, -0.021990975365042686, 0.09586790204048157, -0.025709256529808044, -0.05554049089550972, -0.031063580885529518,...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def __init__(self, **kwargs): self.module_arg_spec = dict( location=dict(type='str', required=True), publisher=dict(type='str'), offer=dict(type='str'), sku=dict(type='str'), version=dict(type='str') ) self.results = dict( ...
15,952
[ 0.01951371133327484, 0.03909757360816002, 0.0008001615642569959, -0.05761747807264328, -0.0166608989238739, 0.005387024022638798, -0.021746857091784477, 0.034841738641262054, 0.01674274168908596, 0.015795700252056122, 0.0033672552090138197, -0.0967150554060936, -0.005085958633571863, -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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def exec_module(self, **kwargs): for key in self.module_arg_spec: setattr(self, key, kwargs[key]) if self.location and self.publisher and self.offer and self.sku and self.version: self.results['objects'] = self.get_item() elif self.location and self.publisher and self.o...
15,953
[ 0.000157034388394095, 0.04213959723711014, -0.028871698305010796, -0.01594250276684761, -0.05078241974115372, -0.018792299553751945, -0.019014209508895874, 0.011953957378864288, 0.007871976122260094, 0.004575440194457769, -0.018418554216623306, -0.022214388474822044, -0.012508733198046684, ...
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 get_item(self): item = None result = [] try: item = self.compute_client.virtual_machine_images.get(self.location, self.publisher, self.offer, ...
15,954
[ -0.023748300969600677, 0.039630647748708725, 0.010439581237733364, -0.0166130643337965, -0.023339958861470222, -0.017547952011227608, -0.047367651015520096, 0.027853211387991905, 0.018654773011803627, 0.0386420302093029, -0.031442321836948395, -0.02884182706475258, -0.01967562921345234, -0...
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 list_images(self): response = None results = [] try: response = self.compute_client.virtual_machine_images.list(self.location, self.publisher, ...
15,955
[ -0.03639756888151169, 0.02131991647183895, 0.03280709311366081, -0.0014674309641122818, -0.027362709864974022, -0.02272794581949711, -0.04078592732548714, 0.030178768560290337, 0.039025887846946716, 0.024804789572954178, -0.0012004919117316604, -0.058480165898799896, -0.008307375013828278, ...
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 list_offers(self): response = None results = [] try: response = self.compute_client.virtual_machine_images.list_offers(self.location, self.publisher) except CloudError: pass ...
15,956
[ -0.012433487921953201, 0.017358725890517235, 0.04294807091355324, -0.04408634454011917, -0.012137973681092262, -0.03401697054505348, -0.0515289269387722, 0.02106907032430172, 0.01709604635834694, 0.00775998504832387, -0.0005516950041055679, -0.030098672956228256, 0.006802299991250038, -0.0...
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 list_publishers(self): response = None results = [] try: response = self.compute_client.virtual_machine_images.list_publishers(self.location) except CloudError: pass except Exception as exc: self.fail("Failed to list publishers: {0}".format...
15,957
[ 0.017687948420643806, -0.008628414012491703, 0.002160097472369671, -0.0297473706305027, -0.009544546715915203, -0.053554847836494446, 0.02066987194120884, -0.002549304161220789, 0.02541220560669899, 0.008586498908698559, 0.041219986975193024, -0.018873533234000206, -0.021591993048787117, -...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "p", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "subtitle", "annotation": null, "type_comment": null}}], "kwarg": nul...
def siteTemplate(p,subtitle): p.newBlock("header") p.newBlock("menu") p.beginMenu() p.menuAddItem(link("Home","index.html",cssclass="first"),cssclass="current_item") p.menuAddItem(link("Download","download.html")) p.endMenu() p.endBlock() #menu p.endBlock() #header p.newBlock("logo") p.addTitle(link("PyWeb","...
15,958
[ 0.07845912128686905, -0.00900870468467474, 0.030138639733195305, -0.009625337086617947, -0.01844024285674095, -0.031125251203775406, 0.0009058622526936233, -0.018757367506623268, 0.007023735903203487, -0.004231272265315056, 0.02983325906097889, -0.007376097142696381, -0.03603481873869896, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "p", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def endSiteTemplate(p): p.endBlock() #content-bgbtm p.endBlock() #content-bgtop p.endBlock() #content p.addText("<div style='clear:both;'></div>") p.newBlock("footer") p.addParagraph("The design of this site is from "+link("CSS Templates","http://freecsstemplates.org")+".") p.addPyWebLogo() p.endBlock() #footer...
15,959
[ 0.03129000961780548, 0.037174709141254425, -0.006921650841832161, -0.0778750479221344, -0.04409635812044144, -0.010745408944785595, 0.009345524944365025, -0.02038905769586563, -0.011166670359671116, 0.07351985573768616, -0.006526312790811062, -0.04194468632340431, 0.0054861209355294704, 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": "config", "annotation":...
class Analyser_Merge_Restriction_Motorway_FR_Maxweight(Analyser_Merge_Point): def __init__(self, config, logger = None): Analyser_Merge_Point.__init__(self, config, logger) self.def_class_missing_official(item = 8320, id = 1, level = 3, tags = ['merge', 'maxweight', 'fix:picture'], title...
15,960
[ 0.03639857843518257, 0.03575805202126503, 0.00835468526929617, -0.06889830529689789, -0.015400469303131104, -0.015609337016940117, 0.007776819169521332, -0.03745683655142784, 0.006603682413697243, 0.04987746849656105, -0.0027587865479290485, -0.03896068036556244, 0.0022035480942577124, -0....
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": "config", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, config, logger = None): Analyser_Merge_Point.__init__(self, config, logger) self.def_class_missing_official(item = 8320, id = 1, level = 3, tags = ['merge', 'maxweight', 'fix:picture'], title = T_('maxweight Restriction not integrated')) self.init( u"h...
15,961
[ 0.027067899703979492, 0.0346558541059494, 0.00598092982545495, -0.06579022854566574, -0.019242383539676666, -0.015567186288535595, -0.0016847566002979875, -0.046198491007089615, 0.008098010905086994, 0.04946843534708023, -0.004751205909997225, -0.043739043176174164, 0.0031808624044060707, ...
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": "config", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, config, logger = None): Analyser_Merge_Point.__init__(self, config, logger) self.def_class_missing_official(item = 8320, id = 2, level = 3, tags = ['merge', 'maxheight', 'fix:picture'], title = T_('maxheight Restriction not integrated')) self.init( u"h...
15,962
[ 0.01692933402955532, 0.028154784813523293, 0.007989343255758286, -0.07579132914543152, -0.0428963266313076, -0.005472732707858086, -0.007351237814873457, -0.0333898551762104, -0.008816276676952839, 0.06631089746952057, -0.007103809155523777, -0.05969543755054474, 0.00818468164652586, 0.020...
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": "config", "annotation":...
class Analyser_Merge_Restriction_Motorway_FR_Maxheight(Analyser_Merge_Point): def __init__(self, config, logger = None): Analyser_Merge_Point.__init__(self, config, logger) self.def_class_missing_official(item = 8320, id = 2, level = 3, tags = ['merge', 'maxheight', 'fix:picture'], title...
15,963
[ 0.017328014597296715, 0.023816587403416634, 0.03543566167354584, 0.010877164080739021, -0.03181413188576698, -0.010374173521995544, 0.038679949939250946, -0.007840360514819622, 0.014976534061133862, 0.02473454549908638, -0.014008278027176857, -0.009556814096868038, 0.05231098458170891, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "assignees", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "assignees_and_prs", "annotation": null, "type_comment": null...
def add_reminders( assignees, assignees_and_prs, message, primary_assignee_map, first_pass_assignee_map): has_primary_assignee = False for assignee_info in assignees: assignee = assignee_info.login if assignee in primary_assignee_map: has_primary_assignee = True elif ...
15,964
[ 0.010707281529903412, 0.03869669884443283, 0.0030351229943335056, -0.010766998864710331, 0.012433106079697609, 0.01528758555650711, -0.004484756384044886, 0.0033113148529082537, 0.0042190151289105415, -0.003998061642050743, 0.030861811712384224, -0.012851126492023468, -0.00856940820813179, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "labels", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "repo", "annotation": null, "type_comment": null}}, {"_type": "a...
def needs_api_review(labels, repo, pr_info): # API reviews should always have the label, so don't bother doing an RPC if # it's not tagged (this helps avoid github rate limiting) if not (is_api(labels)): return False # repokitten tags each commit as pending unless there has been an API LGTM ...
15,965
[ 0.009163142181932926, 0.0039548869244754314, 0.021623436361551285, -0.002263968111947179, -0.019342530518770218, -0.009197017177939415, -0.0023034887854009867, 0.0023726497311145067, 0.004189187660813332, -0.003401597961783409, 0.0023881758097559214, -0.017197124660015106, -0.026964368298649...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "assignees_and_messages", "annotation": null, "type_comment": nu...
def post_to_assignee(client, assignees_and_messages, assignees_map): # Post updates to individual assignees for key in assignees_and_messages: message = assignees_and_messages[key] # Only send messages if we have the slack UID if key not in assignees_map: continue ui...
15,966
[ 0.026224976405501366, 0.03452496975660324, 0.022187480702996254, -0.061799947172403336, -0.007043743971735239, 0.0014343737857416272, -0.0008960929699242115, 0.02248748019337654, -0.018899982795119286, 0.04052496328949928, 0.016137486323714256, -0.018674982711672783, -0.004490620922297239, ...
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": "Call", "_fields": {"a...
def track_prs(): git = github.Github() repo = git.get_repo('envoyproxy/envoy') # The list of PRs which are not waiting, but are well within review SLO recent_prs = [] # A dict of maintainer : outstanding_pr_string to be sent to slack maintainers_and_prs = {} # A placeholder for unassigned P...
15,967
[ -0.00061373773496598, 0.0021023608278483152, 0.04397163167595863, -0.008791690692305565, -0.04774138331413269, -0.025188786908984184, -0.03572035953402519, 0.01602802984416485, 0.013246850110590458, 0.01813698001205921, 0.06052689999341965, -0.016067571938037872, -0.004731959197670221, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "unassigned_prs", "annotation": null, "type_comment": null}}, {"...
def post_to_oncall(client, unassigned_prs, out_slo_prs): # Post updates to #envoy-maintainer-oncall unassigned_prs = maintainers_and_messages['unassigned'] try: client.chat_postMessage( channel='#envoy-maintainer-oncall', text=("*'Unassigned' PRs* (PRs with no maintainer assi...
15,968
[ -0.022646455094218254, 0.0391048863530159, -0.025439660996198654, -0.003416305873543024, 0.013224756345152855, 0.03650505468249321, 0.02475210279226303, 0.013385903090238571, 0.03611830249428749, 0.06854098290205002, -0.007573885843157768, -0.020605266094207764, 0.008632080629467964, 0.063...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "subnet", "annotation": null, "type_comment": null}}, {"_type": ...
def _system_state_change(module, subnet, cloud): state = module.params['state'] if state == 'present': if not subnet: return True return _needs_update(subnet, module, cloud) if state == 'absent' and subnet: return True return False
15,969
[ 0.048732269555330276, -0.026627859100699425, 0.0293235182762146, -0.02499731443822384, 0.023564010858535767, 0.010473624803125858, 0.007916035130620003, 0.0342414528131485, -0.003121376736089587, -0.008954850025475025, 0.03129595145583153, -0.030980363488197327, -0.0024721173103898764, 0.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": "v", "annotation": null...
class Account(object): def __init__(self, v): self.receiving_pubkeys = v.get('receiving', []) self.change_pubkeys = v.get('change', []) # addresses will not be stored on disk self.receiving_addresses = map(self.pubkeys_to_address, self.receiving_pubkeys) self.change_ad...
15,970
[ -0.014035082422196865, 0.0061723412945866585, 0.009547188878059387, -0.015035037882626057, 0.02223709411919117, 0.02276088111102581, -0.009160301648080349, 0.015654057264328003, 0.02787969820201397, 0.06175912544131279, 0.017963476479053497, -0.021153809502720833, -0.015094558708369732, 0....
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": "List", "_fields": {"c...
def main(): ipv6_mode_choices = ['dhcpv6-stateful', 'dhcpv6-stateless', 'slaac'] argument_spec = openstack_full_argument_spec( name=dict(required=True), network_name=dict(default=None), cidr=dict(default=None), ip_version=dict(default='4', choices=['4', '6']), enable_dhcp...
15,971
[ 0.050846707075834274, -0.03944291174411774, 0.041898053139448166, -0.018356211483478546, -0.020845772698521614, -0.062043994665145874, -0.00317505095154047, 0.022635504603385925, -0.002336114877834916, 0.003877749666571617, 0.015774870291352272, 0.010474513284862041, 0.0048902095295488834, ...
7
{"_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": "for_change", "annotation": null, "type_comment": null}}], "kwarg"...
def create_new_address(self, for_change): pubkeys_list = self.change_pubkeys if for_change else self.receiving_pubkeys addr_list = self.change_addresses if for_change else self.receiving_addresses n = len(pubkeys_list) pubkeys = self.derive_pubkeys(for_change, n) address = self.p...
15,972
[ 0.059848278760910034, -0.024140678346157074, 0.04160813242197037, 0.01077081635594368, -0.034021731466054916, -0.03338953107595444, 0.03170366585254669, 0.02613093890249729, 0.0034712469205260277, -0.0268567968159914, 0.01943429931998253, 0.04266180098056793, -0.028285101056098938, -0.0218...
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": "wallet", "annotation": null, "type_comment": null}}, {"_type": "a...
def synchronize_sequence(self, wallet, for_change): limit = wallet.gap_limit_for_change if for_change else wallet.gap_limit while True: addresses = self.get_addresses(for_change) if len(addresses) < limit: address = self.create_new_address(for_change) ...
15,973
[ 0.06908909231424332, -0.008154197596013546, 0.021460162475705147, 0.007090606261044741, -0.008985127322375774, 0.04349643737077713, 0.009334118105471134, 0.07139354199171066, 0.004221126437187195, 0.008874337188899517, 0.04431628808379173, 0.004077098798006773, -0.009760662913322449, 0.012...
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": "seed", "annotation": null, "type_comment": null}}], "kwarg": null...
def check_seed(self, seed): secexp = self.stretch_key(seed) master_private_key = ecdsa.SigningKey.from_secret_exponent( secexp, curve = SECP256k1 ) master_public_key = master_private_key.get_verifying_key().to_string() if master_public_key != self.mpk: print_error('invalid pa...
15,974
[ 0.034254997968673706, -0.05283293128013611, 0.004935085773468018, -0.02738342434167862, 0.008244859054684639, 0.011541773565113544, -0.010934853926301003, 0.03320574387907982, 0.03269140422344208, -0.007967115379869938, 0.022857237607240677, -0.02199314907193184, -0.013743146322667599, 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": "x_pubkey", "annotation": null, "type_comment": null}}], "kwarg": ...
def parse_xpubkey(self, x_pubkey): assert is_extended_pubkey(x_pubkey) pk = x_pubkey[2:] mpk = pk[0:128] dd = pk[128:] s = [] while dd: n = int(bitcoin.rev_hex(dd[0:4]), 16) dd = dd[4:] s.append(n) assert len(s) == 2 ret...
15,975
[ 0.08775065839290619, -0.029378511011600494, 0.008675641380250454, -0.030554506927728653, 0.028223896399140358, -0.034253548830747604, -0.0022597825154662132, 0.025294598191976547, 0.01721229963004589, -0.031858790665864944, 0.01822793297469616, -0.010359453037381172, -0.028116988018155098, ...
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": "for_change", "annotation": null, "type_comment": null}}, {"_type"...
def derive_pubkeys(self, for_change, n): xpub = self.xpub_change if for_change else self.xpub_receive if xpub is None: xpub = bip32_public_derivation(self.xpub, "", "/%d"%for_change) if for_change: self.xpub_change = xpub else: self.xpu...
15,976
[ 0.05134088918566704, 0.005678241606801748, 0.0096381064504385, -0.0266757532954216, 0.015734251588582993, -0.0036091755609959364, -0.019007351249456406, 0.030556712299585342, 0.022853242233395576, -0.036565184593200684, 0.010608346201479435, -0.03743021935224533, 0.0007488674018532038, -0....
14
{"_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": "v", "annotation": null...
class BIP32_Account(Account): def __init__(self, v): Account.__init__(self, v) self.xpub = v['xpub'] self.xpub_receive = None self.xpub_change = None def dump(self): d = Account.dump(self) d['xpub'] = self.xpub return d def first_address(self): ...
15,977
[ 0.05735703185200691, -0.01619645021855831, 0.03537304699420929, 0.0009954068809747696, 0.0006181645439937711, -0.04215396195650101, -0.00965308491140604, 0.04604111239314079, 0.024251485243439674, -0.05260607227683067, 0.018874263390898705, -0.04172205552458763, -0.023690009489655495, -0.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": "sequence", "annotation": null, "type_comment": null}}, {"_type": ...
def get_private_key(self, sequence, wallet, password): out = [] xpubs = self.get_master_pubkeys() roots = [k for k, v in wallet.master_public_keys.iteritems() if v in xpubs] for root in roots: xpriv = wallet.get_master_private_key(root, password) if not xpriv: ...
15,978
[ 0.0027797722723335028, -0.04771394282579422, -0.012545650824904442, -0.015813590958714485, 0.01660275273025036, 0.009404179640114307, -0.034824300557374954, 0.050506364554166794, 0.024686602875590324, -0.006085652392357588, 0.015712415799498558, -0.010051697492599487, 0.00223722355440259, ...
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": "pubkey", "annotation": null, "type_comment": null}}], "kwarg": nu...
def parse_xpubkey(self, pubkey): assert is_extended_pubkey(pubkey) pk = pubkey.decode('hex') pk = pk[1:] xkey = bitcoin.EncodeBase58Check(pk[0:78]) dd = pk[78:] s = [] while dd: n = int( bitcoin.rev_hex(dd[0:2].encode('hex')), 16) dd = dd[2...
15,979
[ 0.05405251309275627, 0.042627882212400436, 0.015037165954709053, -0.012158429250121117, 0.0004653251962736249, -0.016346707940101624, -0.0032371676061302423, 0.013795357197523117, -0.0009518176084384322, -0.01092790998518467, 0.018627120181918144, -0.033370766788721085, -0.006017124280333519...
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": "v", "annotation": null...
class Multisig_Account(BIP32_Account): def __init__(self, v): self.m = v.get('m', 2) Account.__init__(self, v) self.xpub_list = v['xpubs'] def dump(self): d = Account.dump(self) d['xpubs'] = self.xpub_list d['m'] = self.m return d def get_pubkeys(se...
15,980
[ 0.027838457375764847, 0.04880495369434357, 0.04003969579935074, -0.0415823794901371, -0.050441134721040726, -0.023093530908226967, 0.0026091248728334904, 0.0016376422718167305, 0.019938038662075996, 0.020136717706918716, 0.058014318346977234, -0.09742291271686554, 0.002220531925559044, -0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "apps", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "schema_editor", "annotation": null, "type_comment": null}}], "kwa...
def remove_create_subs(apps, schema_editor): subs = apps.get_model("pootle_statistics.Submission").objects.all() # type 10 is the now deleted SubmissionTypes.UNIT_CREATE to_delete = subs.filter(type=10) total = to_delete.count() offset = 0 step = 10000 start = time.time() while True: ...
15,981
[ 0.01680801808834076, -0.03537582606077194, 0.023757196962833405, -0.05299374833703041, -0.023517224937677383, -0.013478410430252552, -0.008653978817164898, 0.011588633060455322, -0.04247498884797096, 0.05979294702410698, 0.011758612468838692, -0.020167620852589607, 0.024737082421779633, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dirpath", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dirnames", "annotation": null, "type_comment": null}}, {"_type...
def build_package(dirpath, dirnames, filenames): # Ignore dirnames that start with '.' for i, dirname in enumerate(dirnames): if dirname.startswith('.'): del dirnames[i] if '__init__.py' in filenames and 'steps.py' not in filenames: pkg = dirpath.replace(os.path.sep, '.') ...
15,982
[ 0.033934831619262695, 0.026401298120617867, -0.004790467210114002, -0.033188264816999435, 0.011028819717466831, -0.001791476272046566, 0.006091302260756493, 0.015926746651530266, 0.029749535024166107, 0.012793431058526039, 0.0592275932431221, -0.01201293058693409, -0.04692056030035019, -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 test_float_validates_object(self): instance = FloatModel(size=2.5) # Try setting float field to unsaved object instance.size = instance with transaction.atomic(): with self.assertRaises(TypeError): instance.save() # Set value to valid and save ...
15,983
[ 0.039117634296417236, -0.00908799096941948, 0.029161222279071808, -0.02967010624706745, 0.015576252713799477, 0.02564329095184803, 0.029050596058368683, -0.014823989942669868, 0.03511294350028038, 0.008147663436830044, 0.030488744378089905, -0.016206825152039528, 0.002750458661466837, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_datetimes_save_completely(self): dat = datetime.date(2014, 3, 12) datetim = datetime.datetime(2014, 3, 12, 21, 22, 23, 240000) tim = datetime.time(21, 22, 23, 240000) DateTimeModel.objects.create(d=dat, dt=datetim, t=tim) obj = DateTimeModel.objects.first() self....
15,984
[ -0.03133107349276543, -0.03560566529631615, 0.04265037924051285, -0.03847131133079529, 0.0016805826453492045, 0.01339690014719963, -0.0008455151109956205, -0.012752129696309566, 0.019164014607667923, 0.02602962777018547, 0.02669827826321125, -0.048047348856925964, 0.009683499112725258, 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": "f", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def _test_get_db_prep_lookup(self, f): self.assertEqual(f.get_db_prep_lookup('exact', True, connection=connection), [True]) self.assertEqual(f.get_db_prep_lookup('exact', '1', connection=connection), [True]) self.assertEqual(f.get_db_prep_lookup('exact', 1, connection=connection), [True]) ...
15,985
[ -0.01048207562416792, 0.04359619691967964, -0.006671578157693148, -0.018770229071378708, -0.018346840515732765, 0.04174868389964104, 0.016422346234321594, -0.014215593226253986, 0.0033486189786344767, 0.04729122668504715, -0.029585883021354675, -0.048676859587430954, -0.0035122008994221687, ...
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 test_return_type(self): b = BooleanModel() b.bfield = True b.save() b2 = BooleanModel.objects.get(pk=b.pk) self.assertIsInstance(b2.bfield, bool) self.assertEqual(b2.bfield, True) b3 = BooleanModel() b3.bfield = False b3.save() b4 = Bo...
15,986
[ 0.019528796896338463, -0.012502563185989857, 0.05997556447982788, -0.01662416011095047, 0.00712382048368454, -0.021916797384619713, 0.011314302682876587, 0.01424764096736908, 0.025074010714888573, 0.08541695773601532, 0.012996235862374306, -0.018690699711441994, -0.041537441313266754, 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 ValidationTest(test.TestCase): def test_charfield_raises_error_on_empty_string(self): f = models.CharField() self.assertRaises(ValidationError, f.clean, "", None) def test_charfield_cleans_empty_string_when_blank_true(self): f = models.CharField(blank=True) self.assertEqua...
15,987
[ 0.05217454582452774, 0.036639899015426636, -0.028862066566944122, -0.03272996097803116, 0.011866451241075993, 0.0073048570193350315, 0.03197320178151131, 0.007677982561290264, -0.031216438859701157, 0.01029511820524931, 0.0342855304479599, -0.00341331260278821, -0.04120149463415146, 0.0045...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class NoopField(models.TextField): def __init__(self, *args, **kwargs): self.prep_value_count = 0 super(NoopField, self).__init__(*args, **kwargs) def get_prep_value(self, value): self.prep_value_count += 1 return super(NoopField, ...
15,988
[ -0.010727765038609505, 0.0015317152719944715, 0.02653437666594982, -0.05592488497495651, -0.04065379872918129, 0.02918320707976818, -0.05988661199808121, -0.02561304345726967, 0.03782070055603981, 0.019486183300614357, -0.03206237033009529, -0.08513112366199493, -0.0029655389953404665, -0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "stdout"}}, {"_type": "Constant", "_fields": {"kind": null...
class Parameters(AnsibleF5Parameters): returnables = ['stdout', 'stdout_lines'] def to_return(self): result = {} for returnable in self.returnables: result[returnable] = getattr(self, returnable) result = self._filter_params(result) return result
15,989
[ -0.011618237942457199, 0.05632471293210983, 0.005223458632826805, -0.04799250513315201, 0.010237978771328926, 0.036393262445926666, -0.024414129555225372, -0.023730330169200897, 0.03758357837796211, 0.03697575628757477, 0.008965354412794113, -0.037735532969236374, -0.029428649693727493, -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}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class ModuleManager(object): def __init__(self, *args, **kwargs): self.module = kwargs.get('module', None) self.client = F5RestClient(**self.module.params) self.want = Parameters(params=self.module.params) self.changes = Parameters() def _set_changed_options(self): chang...
15,990
[ 0.018047505989670753, 0.037099555134773254, 0.019223276525735855, -0.053651660680770874, 0.005704769864678383, 0.04376605898141861, 0.010347921401262283, 0.024611273780465126, 0.031528912484645844, 0.006449614651501179, 0.02972530387341976, -0.0656604990363121, 0.003889745566993952, -0.015...
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 exec_module(self): result = {} changed = self.execute() result.update(**self.changes.to_return()) result.update(dict(changed=changed)) return result
15,991
[ 0.01019228994846344, 0.014327602460980415, 0.0328923724591732, -0.024309391155838966, -0.003155807266011834, -0.016025185585021973, 0.00260748784057796, 0.054757244884967804, 0.0111700976267457, 0.03416895493865013, 0.0202487725764513, -0.0321318544447422, -0.013933762907981873, 0.02927991...
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 execute(self): responses = [] if self.want.reset: response = self.reset() responses.append(response) if self.want.merge_content: if self.want.verify: response = self.merge(verify=True) responses.append(response) ...
15,992
[ 0.016657069325447083, 0.04304635897278786, 0.03326734900474548, 0.007468777243047953, -0.007305013947188854, 0.03434350714087486, -0.05053268373012543, 0.006135276053100824, 0.028073713183403015, 0.05090700089931488, -0.0008122368599288166, -0.042484886944293976, -0.004652632866054773, -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": "stdout", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _detect_errors(self, stdout): errors = [ 'Unexpected Error:' ] msg = [x for x in stdout for y in errors if y in x] if msg: # Error only contains the lines that include the error raise F5ModuleError(' '.join(msg))
15,993
[ 0.044769641011953354, 0.009669957682490349, -0.004267032258212566, -0.02852221205830574, 0.037680719047784805, 0.002181092742830515, 0.031019985675811768, -0.004552492406219244, 0.0034939113538712263, 0.02680945210158825, -0.007576583884656429, -0.004939052741974592, -0.028879035264253616, ...
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": "verify", "annotation": null, "type_comment": null}}], "kwarg": nu...
def merge(self, verify=True): temp_name = next(tempfile._get_candidate_names()) remote_path = "/var/config/rest/downloads/{0}".format(temp_name) temp_path = '/tmp/' + temp_name if self.module.check_mode: return True self.upload_to_device(temp_name) self.move...
15,994
[ 0.006693051662296057, 0.014180392026901245, -0.008556126616895199, -0.003153793979436159, -0.019985709339380264, 0.010898110456764698, -0.02749641053378582, 0.031888362020254135, 0.007937048561871052, -0.011943534947931767, -0.017369229346513748, 0.005212520714849234, 0.02229849249124527, ...
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 reset_device(self): command = 'tmsh load sys config default' uri = "https://{0}:{1}/mgmt/tm/util/bash".format( self.client.provider['server'], self.client.provider['server_port'], ) args = dict( command='run', utilCmdArgs='-c "{0}"'.for...
15,995
[ 0.010825117118656635, 0.04473831504583359, 0.013034925796091557, -0.01969381608068943, -0.006499784532934427, 0.020412741228938103, -0.010235834866762161, 0.052611127495765686, 0.02045988291501999, 0.0242784321308136, 0.014024919830262661, -0.0264469925314188, 0.015651339665055275, -0.0636...
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": "remote_path", "annotation": null, "type_comment": null}}], "kwarg...
def remove_temporary_file(self, remote_path): uri = "https://{0}:{1}/mgmt/tm/util/unix-rm".format( self.client.provider['server'], self.client.provider['server_port'], ) args = dict( command='run', utilCmdArgs=remote_path ) resp = s...
15,996
[ 0.02663194015622139, 0.06015023961663246, -0.0077705769799649715, 0.004242489114403725, 0.020705923438072205, 0.016419516876339912, 0.008836323395371437, -0.005914304871112108, 0.009017851203680038, 0.022661743685603142, -0.013433084823191166, 0.02745174430310726, 0.015517731197178364, -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": "remote_path", "annotation": null, "type_comment": null}}, {"_type...
def merge_on_device(self, remote_path, verify=True): command = 'tmsh load sys config file {0} merge'.format( remote_path ) if verify: command += ' verify' uri = "https://{0}:{1}/mgmt/tm/util/bash".format( self.client.provider['server'], se...
15,997
[ 0.04137885570526123, 0.023503020405769348, -0.028135929256677628, -0.021059637889266014, 0.013581403531134129, -0.02178948000073433, -0.015760350972414017, -0.0077056484296917915, 0.010852430015802383, -0.019864389672875404, -0.008472510613501072, 0.014321822673082352, -0.012809252366423607,...
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": "temp_name", "annotation": null, "type_comment": null}}], "kwarg":...
def upload_to_device(self, temp_name): template = StringIO(self.want.merge_content) url = 'https://{0}:{1}/mgmt/shared/file-transfer/uploads'.format( self.client.provider['server'], self.client.provider['server_port'] ) try: upload_file(self.client, ur...
15,998
[ 0.006471460685133934, 0.053462959825992584, 0.0014358187327161431, 0.01058806199580431, -0.003370797261595726, 0.02027176320552826, 0.000487047916976735, 0.0046010795049369335, 0.03626836836338043, 0.015843922272324562, 0.0025427790824323893, 0.00021985055354889482, 0.005114920437335968, -...
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": "remote_path", "annotation": null, "type_comment": null}}], "kwarg...
def move_on_device(self, remote_path): uri = "https://{0}:{1}/mgmt/tm/util/unix-mv".format( self.client.provider['server'], self.client.provider['server_port'], ) args = dict( command='run', utilCmdArgs='{0} /tmp/{1}'.format( remote...
15,999
[ 0.036328501999378204, 0.031013205647468567, -0.030551960691809654, 0.003599354764446616, -0.028333595022559166, 0.00790155865252018, -0.0009334711357951164, -0.004195129033178091, 0.047266583889722824, 0.032265156507492065, 0.006018143147230148, -0.03230908513069153, 0.011651916429400444, ...
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 ArgumentSpec(object): def __init__(self): self.supports_check_mode = True argument_spec = dict( reset=dict( type='bool', default=False ), merge_content=dict(), verify=dict( type='bool', ...
16,000
[ 0.017805838957428932, 0.026361586526036263, 0.007449501659721136, -0.003748288145288825, -0.0033305040560662746, 0.025584861636161804, -0.022842785343527794, 0.020547915250062943, 0.012274613603949547, -0.022066060453653336, -0.018559027463197708, 0.0008907332667149603, 0.0405544750392437, ...
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 save_on_device(self): command = 'tmsh save sys config' uri = "https://{0}:{1}/mgmt/tm/util/bash".format( self.client.provider['server'], self.client.provider['server_port'], ) args = dict( command='run', utilCmdArgs='-c "{0}"'.format(co...