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 |
|---|---|---|---|---|---|
17,101 | [
0.0026457011699676514,
0.014685533940792084,
-0.03666773810982704,
-0.03237403184175491,
-0.010865977965295315,
0.03756335750222206,
-0.01356600970029831,
-0.022970018908381462,
0.03150475025177002,
-0.011353300884366035,
0.01594993844628334,
-0.022495867684483528,
-0.011570620350539684,
-... | 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}}, {"_type": "arg", "_fields": {"arg": "clock", "annotation": ... | class TestDec(TestCase):
def clockGen(self, clock):
while 1:
yield delay(10)
clock.next = not clock
def stimulus(self, enable, clock, reset):
reset.next = INACTIVE_HIGH
yield clock.negedge
reset.next = ACTIVE_LOW
yield clock.negedge
r... | |
17,102 | [
0.02045406773686409,
-0.019901255145668983,
-0.009153548628091812,
-0.01406458206474781,
-0.0329887717962265,
-0.016957206651568413,
0.022485332563519478,
0.005971662234514952,
0.016764365136623383,
-0.005823817104101181,
0.04515065252780914,
-0.021122585982084274,
-0.020479779690504074,
-... | 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": "enable", "annotation": null, "type_comment": null}}, {"_type": "a... | def stimulus(self, enable, clock, reset):
reset.next = INACTIVE_HIGH
yield clock.negedge
reset.next = ACTIVE_LOW
yield clock.negedge
reset.next = INACTIVE_HIGH
for i in range(1000):
enable.next = 1
yield clock.negedge
for i in range(1000):
... | |
17,103 | [
0.03411351889371872,
-0.008075328543782234,
-0.012238500639796257,
-0.038937900215387344,
-0.020509744063019753,
0.04883155599236488,
0.04062765836715698,
-0.000434684130595997,
-0.017999595031142235,
0.023142337799072266,
0.04165620729327202,
0.0024657610338181257,
0.0003388316836208105,
... | 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": "count", "annotation": null, "type_comment": null}}, {"_type": "ar... | def check(self, count, count_v, enable, clock, reset, n):
expect = 0
yield reset.posedge
self.assertEqual(count, expect)
self.assertEqual(count, count_v)
while 1:
yield clock.posedge
if enable:
if expect == -n:
expect = ... | |
17,104 | [
0.03095908649265766,
0.013868646696209908,
-0.02912415750324726,
-0.03964299336075783,
-0.045617178082466125,
0.012481781654059887,
-0.016717053949832916,
-0.008465208113193512,
0.032879360020160675,
0.013580605387687683,
0.015298184007406235,
-0.012396436184644699,
0.08649767935276031,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "arg", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}, {"_type": "ar... | def get_value(arg, config, module):
command = PARAM_TO_COMMAND_KEYMAP[arg]
command_val_re = re.compile(r'(?:{0}\s)(?P<value>.*)$'.format(command), re.M)
if arg in BOOL_PARAMS:
command_re = re.compile(r'\s+{0}\s*$'.format(command), re.M)
value = False
if command_re.search(config):
... | |
17,105 | [
0.009391304105520248,
0.00802417192608118,
-0.008065392263233662,
-0.021970292553305626,
-0.025542698800563812,
0.03803237900137901,
0.011569097638130188,
-0.005021977704018354,
-0.008134092204272747,
0.0010296427644789219,
0.027397600933909416,
0.014660602435469627,
0.005331127904355526,
... | 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": "dec", "annotation": null, "type_comment": null}}], "kwarg": null,... | def bench(self, dec):
m = 8
n = 2 ** (m-1)
count = Signal(intbv(0, min=-n, max=n))
count_v = Signal(intbv(0, min=-n, max=n))
enable = Signal(bool(0))
clock, reset = [Signal(bool()) for i in range(2)]
dec_inst_ref = decRef(count, enable, clock, reset, n=n)
... | |
17,106 | [
0.04065952077507973,
-0.004374254494905472,
-0.004419760312885046,
-0.050238508731126785,
0.007764443755149841,
0.05192222818732262,
-0.007457278668880463,
0.005105192773044109,
0.04225222393870354,
0.035926904529333115,
0.037610623985528946,
-0.029032763093709946,
0.020830323919653893,
0.... | 9 | {"_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": "netcfg", "annotation": null, "type_comment": null}}], "kwarg": ... | def check_interface(module, netcfg):
config = str(netcfg)
has_interface = re.search(r'(?:interface nve)(?P<value>.*)$', config, re.M)
value = ''
if has_interface:
value = 'nve{0}'.format(has_interface.group('value'))
return value | |
17,107 | [
0.02497626468539238,
0.006315494887530804,
0.0060089463368058205,
-0.06114304065704346,
-0.009648838080465794,
0.01995244063436985,
0.008547644130885601,
0.01419051829725504,
-0.007666689343750477,
0.057381123304367065,
0.008648835122585297,
-0.020916728302836418,
0.04171441122889519,
0.01... | 12 | {"_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": "args", "annotation": null, "type_comment": null}}], "kwarg": nu... | def get_existing(module, args):
existing = {}
netcfg = CustomNetworkConfig(indent=2, contents=get_config(module))
interface_exist = check_interface(module, netcfg)
if interface_exist:
parents = ['interface {0}'.format(interface_exist)]
temp_config = netcfg.get_section(parents)
... | |
17,108 | [
0.0034280773252248764,
0.00188821938354522,
0.05352983996272087,
-0.04698670655488968,
-0.02490699291229248,
0.005590610206127167,
0.0020077056251466274,
-0.016007792204618454,
0.013476702384650707,
0.07103205472230911,
0.007902921177446842,
-0.02759964019060135,
0.052237369120121,
0.01336... | 19 | {"_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": "existing", "annotation": null, "type_comment": null}}, {"_type"... | def state_present(module, existing, proposed, candidate):
commands = list()
proposed_commands = apply_key_map(PARAM_TO_COMMAND_KEYMAP, proposed)
existing_commands = apply_key_map(PARAM_TO_COMMAND_KEYMAP, existing)
for key, value in proposed_commands.items():
if key == 'associate-vrf':
... | |
17,109 | [
-0.0015842476859688759,
0.023910706862807274,
0.05602683871984482,
-0.04996423050761223,
-0.029163222759962082,
0.01019798219203949,
-0.004164774902164936,
-0.006372922100126743,
0.013052894733846188,
0.08681023865938187,
0.01884111389517784,
-0.03702893108129501,
0.0496506504714489,
0.024... | 10 | {"_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": "existing", "annotation": null, "type_comment": null}}, {"_type"... | def state_absent(module, existing, proposed, candidate):
if existing['assoc_vrf']:
commands = ['no member vni {0} associate-vrf'.format(
module.params['vni'])]
else:
commands = ['no member vni {0}'.format(module.params['vni'])]
parents = ['interface {0}'.format(module.params['int... | |
17,110 | [
-0.031081661581993103,
-0.07684554159641266,
0.04308072850108147,
-0.0014475617790594697,
-0.006117592100054026,
-0.013737750239670277,
0.027389639988541603,
0.07019131630659103,
-0.01812739111483097,
-0.006863508839160204,
0.05052916333079338,
0.0003434437676332891,
0.0003555179573595524,
... | 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().setUp()
self.provider = self.configure_linkedin_provider(
enabled=True,
visible=True,
key='linkedin_oauth2_key',
secret='linkedin_oauth2_secret',
) | |
17,111 | [
-0.006573197897523642,
-0.006304838228970766,
0.00402862997725606,
-0.05082669481635094,
-0.03579854965209961,
0.0439722053706646,
-0.009641552343964577,
-0.013152862899005413,
0.016774103045463562,
0.08287467807531357,
0.013812446035444736,
-0.04128213971853256,
0.017524218186736107,
0.03... | 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(
interface=dict(required=True, type='str'),
vni=dict(required=True, type='str'),
assoc_vrf=dict(required=False, type='bool'),
multicast_group=dict(required=False, type='str'),
peer_list=dict(required=False, type='list'),
suppress_arp=d... | |
17,112 | [
0.006125574465841055,
0.011741136200726032,
-0.006011635530740023,
-0.014399711042642593,
0.04535854980349541,
-0.010303335264325142,
-0.006624735426157713,
-0.0011475278297439218,
-0.0007765481132082641,
-0.00011478669330244884,
0.010015775449573994,
-0.024328675121068954,
-0.01205582451075... | 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}}, {"_type": "arg", "_fields": {"arg": "username", "annotation... | class Device():
def __init__(self,username='cisco',password='!cisco123!',ip='192.168.200.50'):
self.username = username
self.password = password
self.ip = ip
def open(self):
self.sw1 = NXAPI()
self.sw1.set_target_url('https://'+self.ip+'/ins')
self.sw1.set_username(self.usernam... | |
17,113 | [
-0.02055490016937256,
0.045302364975214005,
0.058877211064100266,
-0.06227659061551094,
0.032951295375823975,
-0.050945330411195755,
0.014538003131747246,
0.01749546080827713,
-0.012792989611625671,
-0.051443908363580704,
0.019410444423556328,
-0.019410444423556328,
0.04718335345387459,
-0... | 15 | {"_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": "storage_type", "annotation": null, "type_comment": null}}, {"_typ... | def _login(self, storage_type, storage):
if storage_type == 'iscsi':
hosts_service = self._connection.system_service().hosts_service()
host_id = get_id_by_name(hosts_service, self.param('host'))
if storage.get('target'):
hosts_service.host_service(host_id).isc... | |
17,114 | [
-0.01550477184355259,
-0.0308774933218956,
0.06188703700900078,
-0.05039875954389572,
0.023526757955551147,
-0.012335591949522495,
0.030129214748740196,
0.0013170527527108788,
-0.01728743501007557,
-0.026607904583215714,
-0.002730391453951597,
-0.007939455099403858,
0.036797698587179184,
-... | 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": "storage", "annotation": null, "type_comment": null}}], "kwarg": n... | def __target_lun_map(self, storage):
if storage.get('target'):
lun_ids = storage.get('lun_id') if isinstance(storage.get('lun_id'), list) else [(storage.get('lun_id'))]
return [(lun_id, storage.get('target')) for lun_id in lun_ids]
elif storage.get('target_lun_map'):
... | |
17,115 | [
-0.0016299430280923843,
0.009959022514522076,
0.01669517159461975,
-0.010169705376029015,
0.040701597929000854,
0.0019075315212830901,
0.01313064992427826,
-0.018722278997302055,
-0.029222244396805763,
-0.02630685269832611,
0.031841542571783066,
-0.0077553968876600266,
0.009617375209927559,
... | 17 | {"_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 build_entity(self):
storage_type = self._get_storage_type()
storage = self._get_storage()
self._login(storage_type, storage)
return otypes.StorageDomain(
name=self.param('name'),
description=self.param('description'),
comment=self.param('comment')... | |
17,116 | [
0.00944002065807581,
0.024656027555465698,
0.04957812651991844,
0.0030736885964870453,
0.02716154046356678,
0.015997592359781265,
-0.01099765207618475,
0.011540883220732212,
-0.015864556655287743,
-0.02330349199473858,
0.044101472944021225,
-0.0021299635991454124,
0.02909056469798088,
-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": "storage_domain", "annotation": null, "type_comment": null}}], "kw... | def _attached_sd_service(self, storage_domain):
dc_name = self.param('data_center')
if not dc_name:
# Find the DC, where the storage resides:
dc_name = self._find_attached_datacenter_name(storage_domain.name)
attached_sds_service = self._attached_sds_service(dc_name)
... | |
17,117 | [
0.00849058199673891,
0.030225588008761406,
0.0472288616001606,
0.015090682543814182,
0.023503877222537994,
0.01837415061891079,
-0.027373282238841057,
0.023326989263296127,
-0.014372078701853752,
-0.03360855206847191,
0.03918049857020378,
-0.013576086610555649,
0.019944023340940475,
-0.043... | 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": "dc_name", "annotation": null, "type_comment": null}}], "kwarg": n... | def _attached_sds_service(self, dc_name):
# Get data center object of the storage domain:
dcs_service = self._connection.system_service().data_centers_service()
# Search the data_center name, if it does not exist, try to search by guid.
dc = search_by_name(dcs_service, dc_name)
... | |
17,118 | [
0.004697565920650959,
0.05335032194852829,
0.012919013388454914,
-0.0028083582874387503,
-0.004711706656962633,
0.02893768437206745,
0.003410755190998316,
0.014072900637984276,
0.028372053056955338,
-0.028892435133457184,
0.060680899769067764,
-0.033892612904310226,
0.028688807040452957,
-... | 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": "storage_domain", "annotation": null, "type_comment": null}}], "kw... | def _unattach(self, storage_domain):
attached_sd_service = self._attached_sd_service(storage_domain)
attached_sd = get_entity(attached_sd_service)
if attached_sd and attached_sd.status == sdstate.MAINTENANCE:
if not self._module.check_mode:
# Detach the storage domai... | |
17,119 | [
0.020551567897200584,
0.06583619117736816,
0.005738425068557262,
-0.0067170714028179646,
0.0008436056668870151,
0.042170751839876175,
0.02290286123752594,
0.012341109104454517,
0.02956273965537548,
-0.005090231075882912,
0.0536348931491375,
-0.03853578120470047,
0.029486481100320816,
-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}}, {"_type": "arg", "_fields": {"arg": "storage_domain", "annotation": null, "type_comment": null}}], "kw... | def _maintenance(self, storage_domain):
attached_sd_service = self._attached_sd_service(storage_domain)
attached_sd = get_entity(attached_sd_service)
if attached_sd and attached_sd.status != sdstate.MAINTENANCE:
if not self._module.check_mode:
attached_sd_service.dea... | |
17,120 | [
0.025551723316311836,
0.06801827996969223,
0.026583662256598473,
0.004335268400609493,
0.0211323294788599,
0.0373292937874794,
0.0010431563714519143,
0.00839011836796999,
0.004929755348712206,
0.002230728277936578,
0.06936429440975189,
-0.02362244389951229,
0.013762934133410454,
-0.0036286... | 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": "storage_domain", "annotation": null, "type_comment": null}}], "kw... | def pre_remove(self, storage_domain):
# In case the user chose to destroy the storage domain there is no need to
# move it to maintenance or detach it, it should simply be removed from the DB.
# Also if storage domain in already unattached skip this step.
if storage_domain.status == sdst... | |
17,121 | [
0.028097065165638924,
0.02346503548324108,
0.020967258140444756,
0.026596052572131157,
0.013309752568602562,
0.005989389028400183,
0.02579863928258419,
0.009891432709991932,
-0.008026895113289356,
-0.006349983625113964,
0.06562235951423645,
0.007018402684479952,
0.030606567859649658,
-0.01... | 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": "sd_id", "annotation": null, "type_comment": null}}], "kwarg": nul... | def post_create_check(self, sd_id):
storage_domain = self._service.service(sd_id).get()
dc_name = self.param('data_center')
if not dc_name:
# Find the DC, where the storage resides:
dc_name = self._find_attached_datacenter_name(storage_domain.name)
self._service =... | |
17,122 | [
-0.006839694920927286,
0.04592456296086311,
-0.027836114168167114,
0.01761111617088318,
0.01699560508131981,
0.05964163690805435,
0.031051838770508766,
0.030097169801592827,
0.035247355699539185,
0.018138695508241653,
-0.003069697879254818,
-0.04984372854232788,
-0.026278497651219368,
0.02... | 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": "entity", "annotation": null, "type_comment": null}}], "kwarg": nu... | def update_check(self, entity):
return (
equal(self.param('comment'), entity.comment) and
equal(self.param('description'), entity.description) and
equal(self.param('backup'), entity.backup) and
equal(self.param('critical_space_action_blocker'), entity.critical_spa... | |
17,123 | [
0.024406462907791138,
0.03730306029319763,
-0.020812518894672394,
0.02121698297560215,
0.011423195712268353,
0.03926759585738182,
-0.010238696821033955,
0.020176934078335762,
0.046386148780584335,
0.020084485411643982,
0.04486074298620224,
-0.04278064891695976,
0.025423400104045868,
-0.027... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sd_module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | def control_state(sd_module):
sd = sd_module.search_entity()
if sd is None:
return
sd_service = sd_module._service.service(sd.id)
# In the case of no status returned, it's an attached storage domain.
# Redetermine the corresponding service and entity:
if sd.status is None:
sd_s... | |
17,124 | [
0.03780326619744301,
0.09217917174100876,
-0.0005424107075668871,
-0.03804842382669449,
0.00631280243396759,
0.039960652589797974,
0.014170096255838871,
-0.004878631792962551,
-0.0046702479012310505,
0.029516948387026787,
0.03415042161941528,
-0.0015590477269142866,
-0.009873713366687298,
... | 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": "module", "annotation":... | class VmwareDatastoreMaintenanceMgr(PyVmomi):
def __init__(self, module):
super(VmwareDatastoreMaintenanceMgr, self).__init__(module)
datastore_name = self.params.get('datastore')
cluster_name = self.params.get('cluster_name')
datastore_cluster = self.params.get('datastore_cluster')
... | |
17,125 | [
0.013534101657569408,
0.040012750774621964,
-0.0005206656060181558,
-0.03616783767938614,
-0.005555902607738972,
0.06469710916280746,
-0.016238359734416008,
-0.002375837182626128,
0.014700393192470074,
0.04247349873185158,
0.09197037667036057,
-0.028452374041080475,
0.028272943571209908,
-... | 16 | {"_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 = ovirt_full_argument_spec(
state=dict(
choices=['present', 'absent', 'maintenance', 'unattached', 'imported', 'update_ovf_store'],
default='present',
),
id=dict(default=None),
name=dict(default=None),
description=dict(default... | |
17,126 | [
0.022563621401786804,
0.06338483095169067,
0.0014116616221144795,
-0.027283035218715668,
0.004027577582746744,
0.010449310764670372,
0.00330129312351346,
-0.008893396705389023,
-0.01856762170791626,
0.028523173183202744,
0.03070489689707756,
-0.010891396552324295,
-0.023470759391784668,
-0... | 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": "module", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, module):
super(VmwareDatastoreMaintenanceMgr, self).__init__(module)
datastore_name = self.params.get('datastore')
cluster_name = self.params.get('cluster_name')
datastore_cluster = self.params.get('datastore_cluster')
self.datastore_objs = []
if datast... | |
17,127 | [
0.04397859051823616,
0.06271068006753922,
0.015601626597344875,
-0.03338317200541496,
0.034194301813840866,
0.05333195999264717,
0.0051963175646960735,
0.008618282154202461,
0.012236693874001503,
0.04425741732120514,
0.04613316059112549,
-0.0010424319189041853,
0.009049196727573872,
-0.032... | 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 ensure(self):
datastore_results = dict()
change_datastore_list = []
for datastore in self.datastore_objs:
changed = False
if self.state == 'present' and datastore.summary.maintenanceMode != 'normal':
datastore_results[datastore.name] = "Datastore '%s' ... | |
17,128 | [
0.023932790383696556,
0.05937577784061432,
0.003898143768310547,
-0.013299893587827682,
-0.0248451828956604,
0.029547519981861115,
0.014457931742072105,
0.015241654589772224,
0.024096552282571793,
0.06447582691907883,
0.023371316492557526,
-0.027395207434892654,
0.00042476021917536855,
-0.... | 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(
datastore=dict(type='str', required=False),
cluster_name=dict(type='str', required=False),
datastore_cluster=dict(type='str', required=False),
state=dict(type='str', default='present', choices=['present', 'absent']),
... | |
17,129 | [
0.014636670239269733,
-0.013962110504508018,
0.06068490818142891,
-0.05640845373272896,
0.005568298511207104,
0.02560780942440033,
-0.005981943570077419,
0.029426071792840958,
0.060226716101169586,
0.04559004679322243,
0.011976614594459534,
-0.02960425615310669,
-0.03680804371833801,
0.024... | 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 EvalMetricsTest(test_util.TensorFlowTestCase):
def testTop2(self):
top_2_fn = eval_metrics._top_k_generator(2)
probabilities = constant_op.constant([[0.1, 0.2, 0.3], [0.4, 0.7, 0.5],
[0.9, 0.8, 0.2], [0.6, 0.4, 0.8]])
targets = constant_op.constant([[0], [2... | |
17,130 | [
-0.0031734835356473923,
0.001933012972585857,
0.0758422389626503,
-0.056046128273010254,
0.02735462412238121,
0.008773275651037693,
0.0024809411261230707,
0.040646299719810486,
0.06180499866604805,
0.024012424051761627,
0.00021210117847658694,
0.004656584933400154,
-0.018510647118091583,
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 testTop3(self):
top_3_fn = eval_metrics._top_k_generator(3)
probabilities = constant_op.constant([[0.1, 0.2, 0.6, 0.3, 0.5, 0.5],
[0.1, 0.4, 0.7, 0.3, 0.5, 0.2],
[0.1, 0.3, 0.8, 0.7, 0.4, 0.9],
... | |
17,131 | [
0.012620046734809875,
-0.0005952926585450768,
0.06715623289346695,
-0.049977898597717285,
-0.005980395246297121,
0.04133850336074829,
-0.0009300220990553498,
0.04548239707946777,
0.05826568976044655,
0.04693904146552086,
0.014089246280491352,
-0.012080084532499313,
-0.025943299755454063,
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 testTop2(self):
top_2_fn = eval_metrics._top_k_generator(2)
probabilities = constant_op.constant([[0.1, 0.2, 0.3], [0.4, 0.7, 0.5],
[0.9, 0.8, 0.2], [0.6, 0.4, 0.8]])
targets = constant_op.constant([[0], [2], [1], [1]])
in_top_2_op, update_op = top_2_fn(prob... | |
17,132 | [
0.02237221784889698,
0.005553878843784332,
0.05279650539159775,
-0.012144401669502258,
-0.01201783400028944,
0.03314848989248276,
-0.004984327591955662,
0.014766145497560501,
0.03534231707453728,
0.034305673092603683,
0.017972508445382118,
-0.013428151607513428,
-0.017478294670581818,
-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 testAccuracy(self):
predictions = constant_op.constant([0, 1, 3, 6, 5, 2, 7, 6, 4, 9])
targets = constant_op.constant([0, 1, 4, 6, 5, 1, 7, 5, 4, 8])
accuracy_op, update_op = eval_metrics._accuracy(predictions, targets)
with self.test_session():
variables.local_variables_initializer().run()
... | |
17,133 | [
0.02287101373076439,
0.013570820912718773,
0.03946471959352493,
-0.04540758207440376,
-0.0003075141576118767,
0.0261383019387722,
0.004588995594531298,
-0.001497774850577116,
0.05032137781381607,
0.04026224836707115,
0.010438598692417145,
-0.01717255637049675,
-0.026755742728710175,
0.0046... | 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 testR2(self):
scores = constant_op.constant(
[1.2, 3.9, 2.1, 0.9, 2.2, 0.1, 6.0, 4.0, 0.9])
targets = constant_op.constant(
[1.0, 4.3, 2.6, 0.5, 1.1, 0.7, 5.1, 3.4, 1.8])
r2_op, update_op = eval_metrics._r2(scores, targets)
with self.test_session():
# initializes internal accur... | |
17,134 | [
0.014774199575185776,
-0.016051577404141426,
-0.05191456153988838,
-0.018148405477404594,
0.008055915124714375,
0.02853613719344139,
0.0003415629907976836,
-0.02523423545062542,
0.0022203477565199137,
0.007857078686356544,
0.047696802765131,
-0.023812249302864075,
-0.0026150092016905546,
-... | 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, *args, **kwargs):
self.__dict__.setdefault('_instrument_id', 'MSO-X 4024A')
super(agilentMSOX4024A, self).__init__(*args, **kwargs)
self._analog_channel_count = 4
self._digital_channel_count = 16
self._channel_count = self._analog_channel_coun... | |
17,135 | [
0.011572339572012424,
-0.014116859994828701,
-0.0013710202183574438,
-0.038481514900922775,
0.0237604770809412,
-0.008051838725805283,
0.004641716368496418,
-0.011113396845757961,
0.05446900427341461,
0.012710983864963055,
0.040874991565942764,
-0.006401967257261276,
-0.0217271838337183,
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_prep_value(self, f):
self.assertIs(f.get_prep_value(True), True)
self.assertIs(f.get_prep_value("1"), True)
self.assertIs(f.get_prep_value(1), True)
self.assertIs(f.get_prep_value(False), False)
self.assertIs(f.get_prep_value("0"), False)
self.assertIs(f.get... | |
17,136 | [
0.0012983729830011725,
0.05942801386117935,
0.00763520784676075,
-0.01568382792174816,
-0.004040459170937538,
0.012680130079388618,
0.02058017998933792,
-0.009579537436366081,
-0.0006661428487859666,
0.05901460349559784,
-0.015864696353673935,
-0.020399311557412148,
0.015322092920541763,
-... | 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_return_type(self):
b = BooleanModel.objects.create(bfield=True)
b.refresh_from_db()
self.assertIs(b.bfield, True)
b2 = BooleanModel.objects.create(bfield=False)
b2.refresh_from_db()
self.assertIs(b2.bfield, False)
b3 = NullBooleanModel.objects.create(nb... | |
17,137 | [
0.011560041457414627,
-0.0032235782127827406,
-0.03171629086136818,
0.02565738745033741,
-0.03989690914750099,
-0.02495744079351425,
-0.02252950333058834,
0.009088357910513878,
0.03230687230825424,
0.03031640127301216,
-0.009886734187602997,
-0.07616284489631653,
-0.023120082914829254,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "HTTP_400_BAD_REQUEST", "value": {"_type": "Name", "_fields": {"id": "status", "ctx": {"_type": "Load", "_field... | class ValidationError(APIException):
status_code = status.HTTP_400_BAD_REQUEST
def __init__(self, detail):
# For validation errors the 'detail' key is always required.
# The details should always be coerced to a list if not already.
if not isinstance(detail, dict) and not isinstance(det... | |
17,138 | [
0.029795533046126366,
0.008133599534630775,
-0.021827924996614456,
0.01079984288662672,
0.0013058887561783195,
0.01774037629365921,
-0.033903829753398895,
-0.004647770896553993,
0.03792913258075714,
-0.0017455078195780516,
-0.03373783826828003,
-0.07502830773591995,
-0.014389416202902794,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "HTTP_405_METHOD_NOT_ALLOWED", "value": {"_type": "Name", "_fields": {"id": "status", "ctx": {"_type": "Load", ... | class MethodNotAllowed(APIException):
status_code = status.HTTP_405_METHOD_NOT_ALLOWED
default_detail = _('Method "{method}" not allowed.')
def __init__(self, method, detail=None):
if detail is not None:
self.detail = force_text(detail)
else:
self.detail = force_text... | |
17,139 | [
0.031194094568490982,
-0.019814560189843178,
0.0021986966021358967,
0.023777471855282784,
-0.01620587520301342,
-0.024596622213721275,
-0.049414634704589844,
0.006935095880180597,
0.039053503423929214,
-0.019371775910258293,
-0.028780926018953323,
-0.07505179941654205,
-0.031149817630648613,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "HTTP_406_NOT_ACCEPTABLE", "value": {"_type": "Name", "_fields": {"id": "status", "ctx": {"_type": "Load", "_fi... | class NotAcceptable(APIException):
status_code = status.HTTP_406_NOT_ACCEPTABLE
default_detail = _('Could not satisfy the request Accept header.')
def __init__(self, detail=None, available_renderers=None):
if detail is not None:
self.detail = force_text(detail)
else:
... | |
17,140 | [
0.015022463165223598,
-0.010721977800130844,
-0.030470190569758415,
0.007287967950105667,
-0.0019708345644176006,
-0.025281965732574463,
-0.0349779948592186,
0.003399456851184368,
0.027599656954407692,
-0.03083166666328907,
-0.0401662178337574,
-0.057325635105371475,
0.008303286507725716,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "HTTP_415_UNSUPPORTED_MEDIA_TYPE", "value": {"_type": "Name", "_fields": {"id": "status", "ctx": {"_type": "Loa... | class UnsupportedMediaType(APIException):
status_code = status.HTTP_415_UNSUPPORTED_MEDIA_TYPE
default_detail = _('Unsupported media type "{media_type}" in request.')
def __init__(self, media_type, detail=None):
if detail is not None:
self.detail = force_text(detail)
else:
... | |
17,141 | [
0.018781447783112526,
-0.00831320695579052,
-0.029099490493535995,
0.0007183447014540434,
-0.006458571646362543,
0.01697905734181404,
-0.05819898098707199,
-0.013354680500924587,
0.014419137500226498,
0.020492415875196457,
-0.024724118411540985,
-0.046339765191078186,
-0.06206498295068741,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "HTTP_429_TOO_MANY_REQUESTS", "value": {"_type": "Name", "_fields": {"id": "status", "ctx": {"_type": "Load", "... | class Throttled(APIException):
status_code = status.HTTP_429_TOO_MANY_REQUESTS
default_detail = _('Request was throttled.')
extra_detail_singular = 'Expected available in {wait} second.'
extra_detail_plural = 'Expected available in {wait} seconds.'
def __init__(self, wait=None, detail=None):
... | |
17,142 | [
-0.007674528751522303,
0.018879659473896027,
0.004509252030402422,
-0.00847451388835907,
-0.00525323860347271,
-0.007951856590807438,
-0.04829779639840126,
-0.04757247865200043,
-0.0037305995356291533,
-0.01055981032550335,
-0.00840518157929182,
0.0162450410425663,
-0.005210572853684425,
0... | 16 | {"_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 default_host_os():
host_os = os_name()
if host_os not in (x.upper() for x in __os_names):
if host_os == 'NT': host_os = 'windows'
elif host_os == 'AS400': host_os = 'unix'
elif host_os == 'MINGW': host_os = 'windows'
elif host_os == 'BSDI': host_os = 'bsd'
elif host_o... | |
17,143 | [
-0.006312117911875248,
0.0469767227768898,
0.0037387157790362835,
0.007513847667723894,
-0.04581140726804733,
-0.006852289196103811,
0.019701089709997177,
-0.0049920352175831795,
-0.022080272436141968,
0.050157058984041214,
-0.009255749173462391,
0.03275018185377121,
-0.059965118765830994,
... | 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": "wait", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, wait=None, detail=None):
if detail is not None:
self.detail = force_text(detail)
else:
self.detail = force_text(self.default_detail)
if wait is None:
self.wait = None
else:
self.wait = math.ceil(wait)
self.de... | |
17,144 | [
0.0011450756574049592,
0.06247808784246445,
0.08308631181716919,
-0.026363441720604897,
-0.07906519621610641,
0.008142760023474693,
-0.005196035839617252,
-0.0379241481423378,
-0.03676807880401611,
0.0033896751701831818,
0.04330239072442055,
-0.030811801552772522,
0.054134272038936615,
-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": "target", "annotation": null, "type_comment": null}}, {"_type": "a... | def process (self, target, matches, binding):
angle = regex.transform (matches, "<(.*)>")
quoted = regex.transform (matches, '"(.*)"')
g = str(id(self))
b = os.path.normpath(os.path.dirname(binding[0]))
# Attach binding of including file to included targets.
... | |
17,145 | [
0.015829825773835182,
0.06892358511686325,
0.08618837594985962,
-0.036134038120508194,
-0.059251684695482254,
0.015038900077342987,
0.006265266798436642,
-0.04295860230922699,
-0.05333103612065315,
-0.002101604361087084,
-0.0015536054270341992,
-0.037828877568244934,
0.04343315586447716,
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": "includes", "annotation... | class CScanner (scanner.Scanner):
def __init__ (self, includes):
scanner.Scanner.__init__ (self)
self.includes_ = []
for i in includes:
self.includes_.extend(i.split("&&"))
def pattern (self):
return r'#[ \t]*include[ ]*(<(.*)>|"(.*)")'
def proce... | |
17,146 | [
0.011483944021165371,
0.05524548888206482,
0.0654272511601448,
-0.05496266111731529,
-0.023156438022851944,
-0.013057167641818523,
-0.01661607064306736,
0.015260858461260796,
-0.025077303871512413,
-0.013222149573266506,
0.018548719584941864,
-0.05416131764650345,
-0.008072346448898315,
-0... | 16 | {"_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": "id", "annotation": nul... | class SearchedLibGenerator (generators.Generator):
def __init__ (self, id = 'SearchedLibGenerator', composing = False, source_types = [], target_types_and_names = ['SEARCHED_LIB'], requirements = []):
# TODO: the comment below looks strange. There are no requirements!
# The requirements cause the ge... | |
17,147 | [
-0.010371015407145023,
0.033758826553821564,
0.06434718519449234,
-0.06979503482580185,
-0.036058537662029266,
-0.005280398763716221,
-0.026524793356657028,
-0.017035704106092453,
-0.020061049610376358,
-0.02107694000005722,
-0.01277119666337967,
-0.013820578344166279,
0.021121595054864883,
... | 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": "project", "annotation": null, "type_comment": null}}, {"_type": "... | def run(self, project, name, prop_set, sources):
# The lib generator is composing, and can be only invoked with
# explicit name. This check is present in generator.run (and so in
# builtin.LinkingGenerator), but duplicate it here to avoid doing
# extra work.
if name:
... | |
17,148 | [
-0.005594928748905659,
-0.00004754234760184772,
0.06876857578754425,
-0.044293880462646484,
-0.01760227233171463,
-0.032765943557024,
-0.01134504098445177,
-0.01898784190416336,
-0.030482525005936623,
-0.026026533916592598,
0.01350098755210638,
-0.06562056392431259,
0.013811354525387287,
-... | 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": "id", "annotation": nul... | class PrebuiltLibGenerator(generators.Generator):
def __init__(self, id, composing, source_types, target_types_and_names, requirements):
generators.Generator.__init__ (self, id, composing, source_types, target_types_and_names, requirements)
def run(self, project, name, properties, sources):
... | |
17,149 | [
0.021298520267009735,
0.05941299349069595,
0.07612764835357666,
-0.049485500901937485,
-0.02440086007118225,
-0.025236593559384346,
-0.027022022753953934,
0.005422765389084816,
-0.015271114185452461,
-0.03385983407497406,
0.00953494943678379,
-0.02279270812869072,
-0.010503639467060566,
-0... | 15 | {"_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": "project", "annotation": null, "type_comment": null}}, {"_type": "... | def run(self, project, name, prop_set, sources):
if not name:
return None
# If name is empty, it means we're called not from top-level.
# In this case, we just fail immediately, because SearchedLibGenerator
# cannot be used to produce intermediate targets.
... | |
17,150 | [
-0.015497221611440182,
0.03212666139006615,
0.04757670685648918,
-0.04224584996700287,
-0.009476421400904655,
-0.010815032757818699,
-0.023399153724312782,
-0.03429674357175827,
-0.0038094387855380774,
0.012643091380596161,
-0.0018545952625572681,
-0.014341416768729687,
0.04698701202869415,
... | 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": "project", "annotation": null, "type_comment": null}}, {"_type": "... | def run (self, project, name, prop_set, sources):
sources.extend(prop_set.get('<library>'))
# Add <library-path> properties for all searched libraries
extra = []
for s in sources:
if s.type () == 'SEARCHED_LIB':
search = s.search()
ex... | |
17,151 | [
0.030652835965156555,
0.027567485347390175,
0.07184101641178131,
-0.013106470927596092,
-0.008114723488688469,
0.007098815869539976,
0.021033063530921936,
-0.037952326238155365,
0.007851339876651764,
0.02942371368408203,
0.024356713518500328,
-0.027818327769637108,
0.019678520038723946,
-0... | 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": "created_targets", "annotation": null, "type_comment": null}}, {"_... | def extra_usage_requirements (self, created_targets, prop_set):
result = property_set.empty ()
extra = []
# Add appropriate <xdll-path> usage requirements.
raw = prop_set.raw ()
if '<link>shared' in raw:
paths = []
... | |
17,152 | [
0.02194962464272976,
0.03379853814840317,
0.023770665749907494,
-0.06361506134271622,
0.009348015300929546,
0.0173241775482893,
0.015308891423046589,
-0.04164115712046623,
-0.03787767142057419,
0.011454353109002113,
0.0455746091902256,
-0.04569600895047188,
-0.012601609341800213,
0.0048287... | 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": "filename", "annotation... | class RotatingLogger(object):
def __init__(self, filename, max_size, max_files):
self.filename = filename
self.max_size = max_size
self.max_files = max_files
def initLogger(self, loglevel=1):
l = logging.getLogger('lazylibrarian')
l.setLevel(logging.DEBUG)
se... | |
17,153 | [
0.0014456316130235791,
0.018477004021406174,
0.07376029342412949,
-0.056181907653808594,
-0.06790082901716232,
-0.003942212089896202,
-0.0260967668145895,
-0.07735475897789001,
-0.028263291344046593,
-0.010069413110613823,
0.0040899296291172504,
-0.05593571066856384,
0.0294942706823349,
-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": "sources", "annotation": null, "type_comment": null}}, {"_type": "... | def generated_targets (self, sources, prop_set, project, name):
# sources to pass to inherited rule
sources2 = []
# sources which are libraries
libraries = []
# Searched libraries are not passed as argument to linker
# but via some option. So, we pass them to t... | |
17,154 | [
0.021170247346162796,
0.030397644266486168,
0.023679791018366814,
-0.05724332109093666,
0.02921365387737751,
0.03307449072599411,
0.01013469323515892,
-0.015507688745856285,
-0.00925313588231802,
0.02038521133363247,
0.03847965970635414,
-0.0006997763994149864,
-0.024117352440953255,
-0.00... | 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": "loglevel", "annotation": null, "type_comment": null}}], "kwarg": ... | def initLogger(self, loglevel=1):
l = logging.getLogger('lazylibrarian')
l.setLevel(logging.DEBUG)
self.filename = os.path.join(lazylibrarian.LOGDIR, self.filename)
filehandler = handlers.RotatingFileHandler(self.filename, maxBytes=self.max_size, backupCount=self.max_files)
fi... | |
17,155 | [
0.007440296933054924,
0.022153064608573914,
-0.0012473335955291986,
-0.04990033805370331,
0.03457220643758774,
0.05034787207841873,
-0.005090729333460331,
-0.013873635791242123,
-0.032306551933288574,
0.00010795073467306793,
0.005384425166994333,
0.006199081894010305,
-0.008181529119610786,
... | 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": "message", "annotation": null, "type_comment": null}}, {"_type": "... | def log(self, message, level):
logger = logging.getLogger('lazylibrarian')
threadname = threading.currentThread().getName()
if level != 'DEBUG':
lazylibrarian.LOGLIST.insert(0, (formatter.now(), message, level, threadname))
message = threadname + ' : ' + message
... | |
17,156 | [
0.020109986886382103,
0.021805839613080025,
0.0529671348631382,
-0.017382491379976273,
0.006702151615172625,
-0.00972288940101862,
-0.0016278419643640518,
-0.012747160159051418,
-0.01704332046210766,
0.012937943451106548,
0.028674043715000153,
-0.07099970430135727,
-0.006398311350494623,
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}}, {"_type": "arg", "_fields": {"arg": "orm", "annotation": nu... | class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'PackageBuild.log'
db.alter_column(u'core_packagebuild', 'log', self.gf('django.db.models.fields.URLField')(max_length=512))
# Changing field 'PackageBuild.url'
db.alter_column(u'core_packagebuild', 'url',... | |
17,157 | [
0.01350896805524826,
0.01591084524989128,
0.0660833790898323,
0.01415709313005209,
0.013674176298081875,
0.0070467758923769,
-0.009397818706929684,
-0.03311793878674507,
0.0005917322123423219,
-0.0025273715145885944,
0.04244586452841759,
0.015593135729432106,
0.012238133698701859,
-0.03522... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "admin_mc", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "admin_cc", "annotation": null, "type_comment": null}}, {"_typ... | def test_dep_creation_kubectl(admin_mc, admin_cc, remove_resource):
name = random_str()
project = admin_mc.client.create_project(name=random_str(),
clusterId='local')
remove_resource(project)
namespace_name = random_str()
ns = admin_cc.client.create_names... | |
17,158 | [
0.006308185402303934,
-0.02008940279483795,
0.018930183723568916,
-0.02572794258594513,
0.010258538648486137,
-0.02901427634060383,
-0.022250279784202576,
0.009757710620760918,
0.03837807476520538,
-0.007129768840968609,
-0.024850085377693176,
-0.02957700379192829,
-0.01501359324902296,
-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 TestLaxResponseAdapter(unittest.TestCase):
def setUp(self):
settings = Mock()
self.logger = Mock()
self.laxresponseadapter = LaxResponseAdapter(settings, self.logger)
def test_parse_message(self):
expected_workflow_starter_message = self.laxresponseadapter.parse_message(fa... | |
17,159 | [
0.016954969614744186,
0.006903449073433876,
0.05894578993320465,
0.003033427754417062,
0.024403754621744156,
-0.004151984583586454,
-0.012282438576221466,
-0.03653746470808983,
0.033835578709840775,
0.028630103915929794,
0.03450485318899155,
0.0166203323751688,
0.02825828455388546,
-0.0248... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "admin_pc", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def test_port(admin_pc):
client = admin_pc.client
ports = [{
'sourcePort': 776,
'containerPort': 80,
'kind': 'HostPort',
'protocol': 'TCP', },
{
'sourcePort': 777,
'containerPort': 80,
'kind': 'NodePort',
'protocol': 'TCP', },
{
... | |
17,160 | [
-0.011210273019969463,
0.045993492007255554,
-0.014187301509082317,
-0.010390790179371834,
0.005092959385365248,
-0.008470126427710056,
-0.03557068854570389,
0.024008294567465782,
0.00039013478090055287,
0.03715843707323074,
0.03872057795524597,
-0.02285589650273323,
-0.011869700625538826,
... | 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 analyze(request):
print(request.POST)
corpus = request.POST['label']
process = request.POST['process']
method = request.POST['method']
cursor = connection.cursor()
if method == 'wordcloud':
normalize(corpus)
if process == 'stop':
stopwords_removal(corpus)
elif process == 'stem':
stemming(corpu... | |
17,161 | [
0.003166057402268052,
-0.038086190819740295,
0.06204329803586006,
-0.01157338172197342,
-0.007542436942458153,
-0.006165890488773584,
0.04070422798395157,
-0.01686139963567257,
0.028195831924676895,
0.03665250539779663,
-0.0016856204019859433,
-0.04550395905971527,
-0.0008499526884406805,
... | 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):
super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs)
self.port = kwargs.get('port', None)
self.protocol = kwargs.get('protocol', None)
self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None)
self.request_timeout = kwar... | |
17,162 | [
0.025484440848231316,
-0.014278608374297619,
-0.006812413223087788,
0.005658487323671579,
0.013742507435381413,
-0.055440753698349,
-0.053871672600507736,
0.02235936000943184,
-0.03859931603074074,
-0.024647599086165428,
0.033970534801483154,
-0.052825622260570526,
0.006550900172442198,
-0... | 8 | {"_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 result(request):
cursor = connection.cursor()
cursor.execute('SELECT * FROM hoax_result ORDER BY ID DESC LIMIT 1')
row = namedtuplefetchall(cursor)
pth = row[0].result_txt
data = open(pth, 'r').read()
img = row[0].result_img
return render(request, 'mainapp/result.html', {'data' : data, 'imej' : img}) | |
17,163 | [
-0.016649577766656876,
0.012979825958609581,
-0.0068321083672344685,
-0.0522025004029274,
-0.05083371698856354,
0.010484159924089909,
-0.04377741366624832,
-0.0028378618881106377,
-0.011327847838401794,
0.07330061495304108,
0.042196232825517654,
0.009062279015779495,
-0.07613258063793182,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "label", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def stopwords_removal(label):
#code to remove stopwords from normalize.txt and save to label_final.txt file
if label == 'Hoax':
#f1 = open('/home/adhanindita/tugas-akhir/fnc-id/django_project/hoaxdetector/hoax/static/hoax_normalize.txt', 'r')
f1 = open('D:/tugas-akhir/fnc-id/django_project/hoaxdetector/hoax/sta... | |
17,164 | [
-0.0072786337696015835,
0.03207183629274368,
-0.011783363297581673,
-0.01859203726053238,
-0.05093897506594658,
0.005264114122837782,
0.009043845348060131,
-0.0015517245046794415,
-0.003478843020275235,
-0.01652880199253559,
0.039384860545396805,
-0.012482570484280586,
-0.0790906623005867,
... | 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": "server", "annotation": null, "type_comment": null}}, {"_type": "a... | def _wait_until_swap_volume(self, server, volume_id):
for i in range(50):
volume_attachments = self.api.get_server_volumes(server['id'])
if len(volume_attachments) > 0:
for volume_attachment in volume_attachments:
if volume_attachment['volumeId'] == vo... | |
17,165 | [
0.0022139661014080048,
0.0027594571001827717,
0.013557269237935543,
-0.04929492995142937,
0.006790271960198879,
0.021284330636262894,
0.023111362010240555,
0.02611374482512474,
0.018165577203035355,
0.017944471910595894,
0.025508614256978035,
-0.007744517643004656,
-0.054322175681591034,
-... | 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 test_instance_action(self):
# A single test case is used to test most of the instance action
# notifications to avoid booting up an instance for every action
# separately.
# Every instance action test function shall make sure that after the
# function the instance is in activ... | |
17,166 | [
0.04126334190368652,
0.0462266206741333,
0.0038714793045073748,
-0.04865960031747818,
-0.008253884501755238,
0.02325928770005703,
0.005738791543990374,
0.05011938884854317,
0.010966656729578972,
0.045691363513469696,
0.020047754049301147,
0.011520160362124443,
-0.0289524607360363,
-0.01933... | 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 test_create_delete_server(self):
fake_trusted_certs = ['cert-id-1', 'cert-id-2']
server = self._boot_a_server(
extra_params={'networks': [{'port': self.neutron.port_1['id']}],
'tags': ['tag'],
'trusted_image_certificates': fake_trusted_... | |
17,167 | [
0.009605363942682743,
0.025857212021946907,
0.026133626699447632,
-0.03771786019206047,
-0.0008245284552685916,
-0.015567097812891006,
-0.006784691475331783,
0.016421465203166008,
-0.01807994581758976,
0.021195879206061363,
0.012074237689375877,
-0.00733123579993844,
-0.010648196563124657,
... | 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": "mock_build", "annotation": null, "type_comment": null}}], "kwarg"... | def test_create_server_error(self, mock_build):
def _build_resources(*args, **kwargs):
raise exception.FlavorDiskTooSmall()
mock_build.side_effect = _build_resources
fake_trusted_certs = ['cert-id-1', 'cert-id-2']
server = self._boot_a_server(
expected_status='E... | |
17,168 | [
0.029262835159897804,
0.05623951181769371,
-0.0034149501007050276,
-0.06835615634918213,
0.022701559588313103,
0.04855801910161972,
0.0021718512289226055,
0.042088188230991364,
0.038864705711603165,
0.02517061121761799,
0.0019618102815002203,
-0.010693509131669998,
-0.026976676657795906,
-... | 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 test_delete_server_while_compute_is_down(self):
server = self._boot_a_server(
expected_status='ACTIVE',
extra_params={'networks': [{'port': self.neutron.port_1['id']}]})
self._attach_volume_to_server(server, self.cinder.SWAP_OLD_VOL)
service_id = self.api.get_servic... | |
17,169 | [
-0.01881813444197178,
0.023715687915682793,
0.020419921725988388,
-0.03447878360748291,
0.007455806713551283,
0.013978197239339352,
0.0037134988233447075,
0.04381294921040535,
-0.005612021312117577,
0.02069648914039135,
0.002042568288743496,
0.0018020119750872254,
0.004649796057492495,
-0.... | 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 test_instance_exists(self):
server = self._boot_a_server(
extra_params={'networks': [{'port': self.neutron.port_1['id']}]})
self._attach_volume_to_server(server, self.cinder.SWAP_OLD_VOL)
self.notifier.reset()
post = {
'rebuild': {
'imageRef... | |
17,170 | [
0.026125479489564896,
-0.0018783126724883914,
0.004533429630100727,
-0.07879902422428131,
-0.025678040459752083,
0.041760995984077454,
0.0509086437523365,
0.011266768909990788,
0.014864926226437092,
0.046359676867723465,
0.010030096396803856,
-0.010645325295627117,
-0.044023048132658005,
-... | 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 test_create_delete_server_with_instance_update(self):
# This makes server network creation synchronous which is necessary
# for notification samples that expect instance.info_cache.network_info
# to be set.
self.useFixture(fixtures.SpawnIsSynchronousFixture())
self.flags(noti... | |
17,171 | [
0.011161509901285172,
-0.00297748320735991,
0.004266596399247646,
-0.02244088239967823,
-0.07486580312252045,
0.007018669042736292,
0.08702913671731949,
-0.0021215120796114206,
-0.006871341727674007,
0.07312144339084625,
0.015015590004622936,
-0.01758497767150402,
-0.06892556697130203,
-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": "steps", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _verify_instance_update_steps(self, steps, notifications,
initial=None):
replacements = {}
if initial:
replacements = initial
for i, step in enumerate(steps):
replacements.update(step)
self._verify_notification(
... | |
17,172 | [
0.003262369893491268,
-0.0017443952383473516,
-0.011008505709469318,
-0.02793583646416664,
-0.00005486114969244227,
0.05217240750789642,
-0.004282857291400433,
0.0024411967024207115,
0.004219076596200466,
-0.018611134961247444,
0.03888056054711342,
0.012660418637096882,
-0.02237418107688427,... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_shelve_and_shelve_offload_server(self, server):
self.flags(shelved_offload_time=-1)
self.api.post_server_action(server['id'], {'shelve': {}})
self._wait_for_state_change(server, expected_status='SHELVED')
self.assertEqual(3, len(self.notifier.versioned_notifications),
... | |
17,173 | [
0.01748715154826641,
0.017475271597504616,
-0.02410423383116722,
-0.021241188049316406,
-0.0475907139480114,
0.057165879756212234,
-0.014493427239358425,
0.014184551313519478,
0.0787397027015686,
0.012747088447213173,
0.025803053751587868,
-0.013091604225337505,
-0.041460707783699036,
-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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_power_off_on_server(self, server):
self.api.post_server_action(server['id'], {'os-stop': {}})
self._wait_for_state_change(server, expected_status='SHUTOFF')
self.api.post_server_action(server['id'], {'os-start': {}})
self._wait_for_state_change(server, expected_status='ACTIVE')... | |
17,174 | [
-0.02575877122581005,
-0.010663839057087898,
-0.01903909258544445,
-0.02292238548398018,
0.011929865926504135,
0.04258231818675995,
0.000645567022729665,
0.029508158564567566,
0.008563939481973648,
-0.03464530408382416,
0.03537570312619209,
0.01094991248100996,
-0.03474269062280655,
-0.022... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_unshelve_server(self, server):
# setting the shelved_offload_time to 0 should set the
# instance status to 'SHELVED_OFFLOADED'
self.flags(shelved_offload_time = 0)
self.api.post_server_action(server['id'], {'shelve': {}})
# we need to wait for the instance.host to becom... | |
17,175 | [
-0.03192810341715813,
0.01924203895032406,
-0.017693383619189262,
-0.009304835461080074,
-0.05828104913234711,
0.02888241596519947,
-0.0010897045722231269,
0.013808839954435825,
0.045891810208559036,
0.009827506728470325,
0.03244432061910629,
-0.008175607770681381,
-0.020080892369151115,
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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_suspend_resume_server(self, server):
post = {'suspend': {}}
self.api.post_server_action(server['id'], post)
self._wait_for_state_change(server, 'SUSPENDED')
post = {'resume': None}
self.api.post_server_action(server['id'], post)
self._wait_for_state_change(serv... | |
17,176 | [
-0.020223958417773247,
-0.00938623957335949,
-0.04562486335635185,
-0.03769010677933693,
-0.0689936950802803,
0.04637479409575462,
0.01042041927576065,
-0.006247413344681263,
0.05312417820096016,
0.011394120752811432,
0.051334019750356674,
-0.013631818816065788,
0.002769908169284463,
-0.01... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_pause_unpause_server(self, server):
self.api.post_server_action(server['id'], {'pause': {}})
self._wait_for_state_change(server, 'PAUSED')
self.api.post_server_action(server['id'], {'unpause': {}})
self._wait_for_state_change(server, 'ACTIVE')
# Four versioned notific... | |
17,177 | [
0.012414045631885529,
0.04457985609769821,
-0.006180020980536938,
-0.016079530119895935,
-0.02983691170811653,
0.038099441677331924,
-0.019130725413560867,
0.0205348152667284,
-0.006291402969509363,
0.033590152859687805,
0.02999892272055149,
0.0184421818703413,
-0.029188869521021843,
0.041... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_resize_and_revert_server(self, server):
self.flags(allow_resize_to_same_host=True)
other_flavor_body = {
'flavor': {
'name': 'other_flavor',
'ram': 256,
'vcpus': 1,
'disk': 1,
'id': 'd5a8bb54-365a-45ae-... | |
17,178 | [
0.011998621746897697,
0.017318271100521088,
0.027656953781843185,
-0.01444278471171856,
-0.050451718270778656,
0.037146057933568954,
0.013671631924808025,
0.015318501740694046,
-0.015645261853933334,
0.02050744742155075,
0.046687446534633636,
-0.003092781873419881,
-0.03461040183901787,
-0... | 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 test_rebuild_server(self):
# NOTE(gabor_antal): Rebuild changes the image used by the instance,
# therefore the actions tested in test_instance_action had to be in
# specific order. To avoid this problem, rebuild was moved from
# test_instance_action to its own method.
serve... | |
17,179 | [
0.0032108372543007135,
0.01160653680562973,
-0.007122331764549017,
-0.06092670559883118,
-0.06156034395098686,
0.01347698736935854,
0.018387679010629654,
-0.011387201026082039,
0.005224464926868677,
0.008322588168084621,
0.027392646297812462,
-0.0067080301232635975,
-0.019459988921880722,
... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_snapshot_server(self, server):
post = {'createImage': {'name': 'test-snap'}}
response = self.api.post_server_action(server['id'], post)
self._wait_for_notification('instance.snapshot.end')
self.assertEqual(2, len(self.notifier.versioned_notifications),
... | |
17,180 | [
0.013508112169802189,
0.022851524874567986,
0.01931454800069332,
-0.011842232197523117,
-0.03360731527209282,
-0.009922849014401436,
-0.012409597635269165,
0.013942689634859562,
0.0033770280424505472,
0.03247258439660072,
0.018735112622380257,
-0.030034122988581657,
-0.02316538617014885,
0... | 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": "mock_rebuild", "annotation": null, "type_comment": null}}], "kwar... | def test_rebuild_server_exc(self, mock_rebuild):
def _virtual_interface_create_failed(*args, **kwargs):
# A real error that could come out of driver.spawn() during rebuild
raise exception.VirtualInterfaceCreateException()
server = self._boot_a_server(
extra_params={'... | |
17,181 | [
0.018794791772961617,
0.02106626331806183,
0.023675208911299706,
-0.015601754188537598,
-0.04789556935429573,
0.045714959502220154,
-0.008858732879161835,
0.015458976849913597,
-0.021325858309864998,
0.035486850887537,
0.05560558661818504,
0.01998893730342388,
-0.02345455065369606,
-0.0117... | 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 test_rebuild_server_with_trusted_cert(self):
# NOTE(gabor_antal): Rebuild changes the image used by the instance,
# therefore the actions tested in test_instance_action had to be in
# specific order. To avoid this problem, rebuild was moved from
# test_instance_action to its own meth... | |
17,182 | [
0.01388602890074253,
0.018847061321139336,
0.01570993848145008,
-0.025340178981423378,
-0.04939145967364311,
0.04097715765237808,
-0.0043044257909059525,
0.030617354437708855,
0.05243130773305893,
0.034556999802589417,
0.012998392805457115,
-0.03219807520508766,
-0.058024629950523376,
-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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_reboot_server(self, server):
post = {'reboot': {'type': 'HARD'}}
self.api.post_server_action(server['id'], post)
self._wait_for_notification('instance.reboot.start')
self._wait_for_notification('instance.reboot.end')
self.assertEqual(2, len(self.notifier.versioned_noti... | |
17,183 | [
0.028616029769182205,
0.01714116707444191,
-0.010680630803108215,
-0.03504100441932678,
-0.017591627314686775,
0.04518819600343704,
-0.017887981608510017,
0.03864467889070511,
0.009637461975216866,
0.03643979877233505,
0.027169818058609962,
0.004836512263864279,
-0.022036951035261154,
0.00... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_restore_server(self, server):
self.flags(reclaim_instance_interval=30)
self.api.delete_server(server['id'])
self._wait_for_state_change(server, 'SOFT_DELETED')
# we don't want to test soft_delete here
self.notifier.reset()
self.api.post_server_action(server['id'... | |
17,184 | [
0.003312129760161042,
0.015826284885406494,
-0.0020412311423569918,
-0.04179578274488449,
-0.015598483383655548,
0.011605942621827126,
0.0028295479714870453,
0.018320124596357346,
0.01269699726253748,
0.009885434061288834,
0.028727106750011444,
-0.0019213350024074316,
-0.05467262119054794,
... | 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 test_volume_swap_server(self):
server = self._boot_a_server(
extra_params={'networks':
[{'port': self.neutron.port_1['id']}]})
self._attach_volume_to_server(server, self.cinder.SWAP_OLD_VOL)
self.cinder.swap_volume_instance_uuid = server['id']
... | |
17,185 | [
-0.016162658110260963,
0.041600197553634644,
0.010729518719017506,
-0.031007438898086548,
-0.025537000969052315,
0.03200206533074379,
-0.021832020953297615,
0.02613377571105957,
0.027401922270655632,
0.0255618654191494,
0.008031598292291164,
-0.013576633296906948,
-0.0367514006793499,
-0.0... | 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": "server", "annotation": null, "type_comment": null}}, {"_type": "a... | def _test_reboot_server_error(self, server, mock_reboot):
def _hard_reboot(*args, **kwargs):
raise exception.UnsupportedVirtType(virt="FakeVirt")
mock_reboot.side_effect = _hard_reboot
post = {'reboot': {'type': 'HARD'}}
self.api.post_server_action(server['id'], post)
... | |
17,186 | [
0.008889863267540932,
0.031222334131598473,
0.029965555295348167,
-0.0020869309082627296,
-0.0151183120906353,
0.032257329672575,
-0.0064933584071695805,
0.04228691756725311,
-0.017311515286564827,
0.046969037503004074,
-0.0006041318411007524,
0.02464272640645504,
-0.03390838950872421,
0.0... | 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 test_resize_confirm_server(self):
server = self._boot_a_server(
extra_params={'networks': [{'port': self.neutron.port_1['id']}]})
self._attach_volume_to_server(server, self.cinder.SWAP_OLD_VOL)
self.admin_api.post_extra_spec(
'2', {"extra_specs": {"hw:watchdog_action"... | |
17,187 | [
0.015193545259535313,
0.02078649401664734,
-0.017844172194600105,
-0.011128827929496765,
-0.030894387513399124,
0.024071242660284042,
0.01017130445688963,
-0.006436330731958151,
0.022143514826893806,
0.018072456121444702,
0.03185825049877167,
-0.010818108916282654,
-0.04530162364244461,
0.... | 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 test_volume_swap_server_with_error(self):
server = self._do_setup_server_and_error_flag()
self._volume_swap_server(server, self.cinder.SWAP_ERR_OLD_VOL,
self.cinder.SWAP_ERR_NEW_VOL)
self._wait_for_notification('compute.exception')
# Eight versioned... | |
17,188 | [
-0.007068655453622341,
0.026086559519171715,
0.005351634696125984,
-0.026402613148093224,
-0.04551168531179428,
0.023934965953230858,
0.005032542161643505,
0.028250308707356453,
0.04210803285241127,
-0.010423683561384678,
0.006084027234464884,
-0.002969078253954649,
-0.04568186774849892,
-... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_trigger_crash_dump(self, server):
post = {'trigger_crash_dump': None}
self.api.post_server_action(server['id'], post)
self._wait_for_notification('instance.trigger_crash_dump.end')
self.assertEqual(2, len(self.notifier.versioned_notifications),
self.n... | |
17,189 | [
-0.002943190047517419,
0.04424566030502319,
0.02156560868024826,
-0.03350434824824333,
-0.05543748661875725,
0.025086766108870506,
0.014392880722880363,
0.003942037001252174,
0.0209491103887558,
0.03355177119374275,
0.025134189054369926,
-0.008251601830124855,
-0.0355435386300087,
0.033314... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_volume_detach_attach_server(self, server):
self._detach_volume_from_server(server, self.cinder.SWAP_OLD_VOL)
# 0. volume_detach-start
# 1. volume_detach-end
self.assertEqual(2, len(self.notifier.versioned_notifications),
self.notifier.versioned_notific... | |
17,190 | [
-0.002621628111228347,
0.011983693577349186,
0.005885796621441841,
-0.01590755768120289,
-0.014023604802787304,
0.032139506191015244,
-0.00589515408501029,
0.03326239436864853,
0.04067344218492508,
0.03246389701962471,
0.014048557728528976,
-0.036156944930553436,
0.004728599917143583,
0.02... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_rescue_unrescue_server(self, server):
# Both "rescue" and "unrescue" notification asserts are made here
# rescue notification asserts
post = {
"rescue": {
"rescue_image_ref": 'a2459075-d96c-40d5-893e-577ff92e721c'
}
}
self.api.pos... | |
17,191 | [
0.042883507907390594,
0.02913728728890419,
-0.01629573293030262,
-0.03409532457590103,
-0.026294052600860596,
0.042883507907390594,
-0.006209297105669975,
0.05056729167699814,
0.0386773981153965,
0.02029036171734333,
0.05343402549624443,
-0.0050197201780974865,
-0.04807652533054352,
-0.005... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_soft_delete_server(self, server):
self.flags(reclaim_instance_interval=30)
self.api.delete_server(server['id'])
self._wait_for_state_change(server, 'SOFT_DELETED')
self.assertEqual(2, len(self.notifier.versioned_notifications),
self.notifier.versioned_... | |
17,192 | [
-0.020508823916316032,
0.012595092877745628,
0.024560758844017982,
-0.03671656548976898,
-0.0681879073381424,
0.0351167693734169,
-0.01904016174376011,
0.0007544106338173151,
0.02579338662326336,
0.032467931509017944,
0.01264098845422268,
-0.033044908195734024,
0.00842513982206583,
-0.0175... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_interface_attach_and_detach(self, server):
post = {
'interfaceAttachment': {
'net_id': fixtures.NeutronFixture.network_1['id']
}
}
self.api.attach_interface(server['id'], post)
self._wait_for_notification('instance.interface_attach.end')
... | |
17,193 | [
-0.023585718125104904,
0.028890227898955345,
-0.00031303439754992723,
-0.01081391517072916,
-0.042800337076187134,
0.0008622674504294991,
0.002098753349855542,
-0.0027020559646189213,
0.007063194178044796,
0.01577693223953247,
0.008662515319883823,
0.00031499084434472024,
-0.0128514841198921... | 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": "server", "annotation": null, "type_comment": null}}, {"_type": "a... | def _do_test_attach_volume_error(self, server, mock_attach):
def attach_volume(*args, **kwargs):
raise exception.CinderConnectionFailed(
reason="Connection timed out")
mock_attach.side_effect = attach_volume
post = {"volumeAttachment": {"volumeId": self.cinder.SWAP_N... | |
17,194 | [
-0.013430103659629822,
0.02471478469669819,
-0.014072517864406109,
-0.03379343822598457,
-0.04135696217417717,
0.03687217831611633,
0.011108925566077232,
0.008060486055910587,
0.02724807895720005,
-0.02344207651913166,
0.025987492874264717,
0.013866460882127285,
-0.041963011026382446,
-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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_lock_unlock_instance(self, server):
self.api.post_server_action(server['id'], {'lock': {}})
self._wait_for_server_parameter(server, {'locked': True})
self.api.post_server_action(server['id'], {'unlock': {}})
self._wait_for_server_parameter(server, {'locked': False})
# T... | |
17,195 | [
-0.028247082605957985,
0.008172678761184216,
0.0009322618134319782,
-0.029424045234918594,
-0.03475640341639519,
-0.025893159210681915,
-0.034059833735227585,
0.011073049157857895,
0.02011643908917904,
0.0183509960770607,
-0.0027472449000924826,
-0.0458054319024086,
-0.00863505620509386,
0... | 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": "server", "annotation": null, "type_comment": null}}, {"_type": "a... | def _test_interface_attach_error(self, server, mock_driver):
def _unsuccessful_attach_interface(*args, **kwargs):
raise exception.InterfaceAttachFailed("dummy")
mock_driver.side_effect = _unsuccessful_attach_interface
post = {
'interfaceAttachment': {
'net... | |
17,196 | [
-0.0014427009737119079,
0.026029463857412338,
-0.007167069241404533,
-0.015371730551123619,
-0.020739026367664337,
0.044065628200769424,
-0.024876583367586136,
0.009344730526208878,
0.00892200879752636,
-0.017126670107245445,
0.03263930603861809,
0.012355027720332146,
-0.04639700427651405,
... | 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": "server", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _test_lock_unlock_instance_with_reason(self, server):
self.api.post_server_action(
server['id'], {'lock': {"locked_reason": "global warming"}})
self._wait_for_server_parameter(server, {'locked': True})
self.api.post_server_action(server['id'], {'unlock': {}})
self._wait_f... | |
17,197 | [
0.04200981929898262,
-0.001478940830565989,
0.029053693637251854,
-0.01712922565639019,
0.022715045139193535,
-0.03338479623198509,
0.023737406358122826,
-0.021562563255429268,
-0.04951953887939453,
-0.002002901863306761,
-0.012686594389379025,
-0.04253029450774193,
0.06985526531934738,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "books"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n... | class Book(db.Model):
__tablename__ = 'books'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(255))
author = db.Column(db.String(255))
publishedDate = db.Column(db.String(255))
imageUrl = db.Column(db.String(255))
description = db.Column(db.String(4096))
created... | |
17,198 | [
0.01290416531264782,
0.007166021037846804,
0.03778544440865517,
-0.02246241271495819,
0.013074658811092377,
-0.04829205572605133,
-0.027577193453907967,
0.01768861711025238,
-0.02019272744655609,
-0.002925015287473798,
0.0004898334736935794,
-0.05617734417319298,
0.020118137821555138,
0.00... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "user_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "limit", "annotation": null, "type_comment": null}}, {"_type": ... | def list_by_user(user_id, limit=10, cursor=None):
cursor = int(cursor) if cursor else 0
query = (Book.query
.filter_by(createdById=user_id)
.order_by(Book.title)
.limit(limit)
.offset(cursor))
books = builtin_list(map(from_sql, query.all()))
next_page ... | |
17,199 | [
0.028574995696544647,
0.0196574404835701,
0.047919727861881256,
-0.024908769875764847,
0.004687916953116655,
-0.04276544600725174,
-0.03437625989317894,
0.010211517103016376,
-0.02290312945842743,
-0.008842074312269688,
-0.003310386324301362,
-0.053483765572309494,
0.02415395900607109,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "limit", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cursor", "annotation": null, "type_comment": null}}], "kwarg": n... | def list(limit=10, cursor=None):
cursor = int(cursor) if cursor else 0
query = (Book.query
.order_by(Book.title)
.limit(limit)
.offset(cursor))
books = builtin_list(map(from_sql, query.all()))
next_page = cursor + limit if len(books) == limit else None
return (... | |
17,200 | [
0.02589387819170952,
0.03701543062925339,
0.044800516217947006,
-0.03450099378824234,
-0.005702818278223276,
-0.009954999200999737,
0.017443913966417313,
0.02879515290260315,
0.016319669783115387,
-0.028384137898683548,
0.05468903109431267,
-0.03051174059510231,
0.025192735716700554,
0.008... | 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": "autocommit", "annotation": null, "type_comment": null}}], "kwarg"... | def run(self, autocommit=False):
config_param_obj = self.env['ir.config_parameter']
config_param_list = config_param_obj.search(
[('key', '=', 'procurement.order'), ('value', '=', 'no_confirm')])
if config_param_list:
config_param_list.unlink()
else:
s... |