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
1,501
[ -0.001933011575601995, -0.001976726343855262, 0.014130792580544949, -0.036567386239767075, -0.03588980808854103, -0.0022731670178472996, 0.020928436890244484, -0.06885073333978653, -0.03425050526857376, 0.025747988373041153, -0.02983531728386879, -0.03003203310072422, 0.016895750537514687, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "range_string", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "row", "annotation": null, "type_comment": null}}, {"_type...
def get_range_boundaries(range_string, row = 0, column = 0): if ':' in range_string: min_range, max_range = range_string.split(':') min_col, min_row = coordinate_from_string(min_range) max_col, max_row = coordinate_from_string(max_range) min_col = column_index_from_string(mi...
1,502
[ 0.007989492267370224, 0.03898919001221657, 0.0538511760532856, -0.013086541555821896, 0.00029798923060297966, -0.008248166181147099, 0.005552667658776045, -0.049712397158145905, 0.0016901979688555002, -0.014180026017129421, -0.007660271134227514, -0.020693901926279068, 0.03125249594449997, ...
11
{"_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": "min_row", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_cells(p, min_row, min_col, max_row, max_col, _re_coordinate=RE_COORDINATE): for _event, element in p: if element.tag == '{http://schemas.openxmlformats.org/spreadsheetml/2006/main}c': coord = element.get('r') column_str, row = _re_coordinate.match(coord).groups() ...
1,503
[ -0.013174297288060188, 0.01365108136087656, 0.05495563894510269, -0.023425154387950897, -0.0011731397826224566, 0.012716333381831646, 0.017327336594462395, -0.0229483712464571, -0.027226880192756653, 0.021969707682728767, -0.019773991778492928, -0.0009025961626321077, 0.02873251400887966, ...
17
{"_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": "min_col", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get_squared_range(p, min_col, min_row, max_col, max_row, string_table, style_table): expected_columns = [get_column_letter(ci) for ci in xrange(min_col, max_col)] current_row = min_row for row, cells in get_rows(p, min_row = min_row, max_row = max_row, min_column = min_col, max_column = max_col):...
1,504
[ 0.030519044026732445, 0.03009609691798687, -0.04371947795152664, -0.024553250521421432, 0.023195363581180573, 0.0010198057861998677, 0.012966698035597801, -0.03532729670405388, 0.004485475830733776, -0.02352927066385746, 0.02657894976437092, -0.014536058530211449, 0.03209953382611275, 0.02...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "archive", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}], "kwarg...
def unpack_worksheet(archive, filename): temp_file = tempfile.TemporaryFile(mode='r+', prefix='openpyxl.', suffix='.unpack.temp') zinfo = archive.getinfo(filename) if zinfo.compress_type == zipfile.ZIP_STORED: decoder = None elif zinfo.compress_type == zipfile.ZIP_DEFLATED: d...
1,505
[ 0.02287360094487667, 0.000367840490071103, 0.011222024448215961, -0.009139894507825375, -0.011830555275082588, 0.039065293967723846, -0.030450405552983284, -0.005870532710105181, -0.02749127522110939, 0.0026891694869846106, 0.016513856127858162, -0.06323947757482529, 0.008847560733556747, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "virtual"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ...
class VirtualCollector(BaseFactCollector): name = 'virtual' _fact_class = Virtual _fact_ids = set(['virtualization_type', 'virtualization_role']) def collect(self, module=None, collected_facts=None): collected_facts = collected_facts or {} if not module: ...
1,506
[ 0.018415218219161034, 0.022683419287204742, 0.029028352349996567, -0.04740915074944496, 0.00897239986807108, 0.004141990095376968, 0.03217213228344917, 0.046101152896881104, 0.019275743514299393, 0.06067269667983055, -0.018162798136472702, -0.00028397300047799945, -0.014169965870678425, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "symbol", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "train_iter", "annotation": null, "type_comment": null}}, {"_typ...
def train(symbol, train_iter, valid_iter, data_names, label_names): devs = mx.cpu() if args.gpus is None or args.gpus is '' else [mx.gpu(int(i)) for i in args.gpus.split(',')] module = mx.mod.Module(symbol, data_names=data_names, label_names=label_names, context=devs) module.bind(data_shapes=train_iter.prov...
1,507
[ -0.003106844611465931, -0.017160626128315926, 0.028670547530055046, -0.0681837722659111, -0.013011215254664421, -0.02214408852159977, -0.005942622199654579, -0.012833978980779648, 0.014825278893113136, 0.052503589540719986, -0.02364538237452507, -0.04259921982884407, 0.06505607813596725, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "launch_template", "annotation": null, "type_comment": null}...
def describe_launch_templates(connection, launch_template): if launch_template['launch_template_id'] is not None: try: lt = connection.describe_launch_templates(LaunchTemplateIds=[launch_template['launch_template_id']]) return lt except (botocore.exceptions.ClientError) as e:...
1,508
[ 0.04509679228067398, -0.013888852670788765, -0.00731023820117116, -0.022416463121771812, 0.017846815288066864, 0.04572047293186188, -0.0006975160213187337, 0.005945940036326647, -0.05219713971018791, 0.01866239495575428, 0.02371179684996605, -0.06419096887111664, -0.01355302520096302, -0.0...
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": "module", "annotation": null, "type_comment": null}}, {"_type": "a...
def collect(self, module=None, collected_facts=None): collected_facts = collected_facts or {} if not module: return {} # Network munges cached_facts by side effect, so give it a copy facts_obj = self._fact_class(module) facts_dict = facts_obj.populate(collected_fact...
1,509
[ 0.008646228350698948, -0.0073859733529388905, 0.06320086121559143, -0.017919450998306274, -0.03017088770866394, 0.0334814079105854, -0.03152519091963768, -0.05552646890282631, -0.006451754365116358, 0.017668653279542923, 0.019123276695609093, -0.06535771489143372, -0.03551286458969116, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "autoscaling_group", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "pos...
def get_properties(autoscaling_group): properties = dict() properties['healthy_instances'] = 0 properties['in_service_instances'] = 0 properties['unhealthy_instances'] = 0 properties['pending_instances'] = 0 properties['viable_instances'] = 0 properties['terminating_instances'] = 0 inst...
1,510
[ 0.024028055369853973, 0.007924381643533707, 0.022919749841094017, -0.06224241480231285, 0.0001736921985866502, 0.013454824686050415, 0.005225658882409334, 0.02347390353679657, 0.024936866015195847, 0.019971659407019615, -0.012889589183032513, -0.07638438791036606, 0.0367513969540596, -0.03...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ec2_connection", "annotation": null, "type_comment": null}}...
def get_launch_object(connection, ec2_connection): launch_object = dict() launch_config_name = module.params.get('launch_config_name') launch_template = module.params.get('launch_template') if launch_config_name is None and launch_template is None: return launch_object elif launch_config_nam...
1,511
[ 0.009802096523344517, -0.019616227596998215, 0.030615756288170815, -0.019495882093906403, 0.01352677308022976, 0.036560796201229095, -0.07201442122459412, 0.0004708496271632612, 0.0004768668732140213, 0.04878784343600273, 0.017064914107322693, -0.05049674212932587, -0.022456368431448936, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "asg_connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "elb_connection", "annotation": null, "type_comment": nu...
def elb_healthy(asg_connection, elb_connection, group_name): healthy_instances = set() as_group = describe_autoscaling_groups(asg_connection, group_name)[0] props = get_properties(as_group) # get healthy, inservice instances from ASG instances = [] for instance, settings in props['instance_facts...
1,512
[ 0.005761260166764259, -0.015718087553977966, 0.05660958215594292, -0.03571736812591553, -0.023142896592617035, 0.07999711483716965, -0.031240465119481087, 0.01602388732135296, 0.008745862171053886, 0.0328306220471859, 0.038677506148815155, -0.047680240124464035, -0.020329542458057404, -0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "asg_connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "group_name", "annotation": null, "type_comment": null}}...
def elb_dreg(asg_connection, group_name, instance_id): region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) as_group = describe_autoscaling_groups(asg_connection, group_name)[0] wait_timeout = module.params.get('wait_timeout') count = 1 if as_group['LoadBalancerNames'] a...
1,513
[ -0.0016459677135571837, -0.003701102687045932, 0.04431403800845146, -0.015139183960855007, 0.0015715737827122211, 0.04414045438170433, -0.06105269491672516, 0.006168504245579243, -0.019726814702153206, 0.01810254529118538, 0.017544589936733246, -0.043024543672800064, -0.02383088506758213, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "asg_connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "elbv2_connection", "annotation": null, "type_comment": ...
def tg_healthy(asg_connection, elbv2_connection, group_name): healthy_instances = set() as_group = describe_autoscaling_groups(asg_connection, group_name)[0] props = get_properties(as_group) # get healthy, inservice instances from ASG instances = [] for instance, settings in props['instance_fact...
1,514
[ -0.00981118157505989, -0.027608629316091537, 0.05902368202805519, -0.02963229827582836, -0.027753176167607307, 0.06389012932777405, -0.030620042234659195, 0.006739540956914425, -0.0029376328457146883, 0.026042694225907326, 0.014515007846057415, -0.04259341582655907, -0.058541856706142426, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "asg_connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "group_name", "annotation": null, "type_comment": null}}...
def wait_for_elb(asg_connection, group_name): region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) wait_timeout = module.params.get('wait_timeout') # if the health_check_type is ELB, we want to query the ELBs directly for instance # status as to avoid health_check_grace per...
1,515
[ -0.0009743530536070466, 0.010304808616638184, 0.07951225340366364, 0.008507458493113518, -0.03846960514783859, 0.06705062836408615, -0.029186446219682693, 0.04225349798798561, 0.027395403012633324, -0.00949757732450962, 0.039327286183834076, -0.05357996001839638, 0.023233117535710335, 0.04...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ec2_connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "as_group", "annotation": null, "type_comment": null}}],...
def suspend_processes(ec2_connection, as_group): suspend_processes = set(module.params.get('suspend_processes')) try: suspended_processes = set([p['ProcessName'] for p in as_group['SuspendedProcesses']]) except AttributeError: # New ASG being created, no suspended_processes defined yet ...
1,516
[ -0.014426943846046925, -0.013552220538258553, 0.07016958296298981, -0.020609918981790543, -0.03532444313168526, 0.06719791889190674, -0.02356959879398346, 0.018129538744688034, -0.0033131642267107964, 0.01806962676346302, 0.013132832013070583, -0.037625085562467575, -0.06202147901058197, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "asg_connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "group_name", "annotation": null, "type_comment": null}}...
def wait_for_target_group(asg_connection, group_name): region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) wait_timeout = module.params.get('wait_timeout') # if the health_check_type is ELB, we want to query the ELBs directly for instance # status as to avoid health_check_...
1,517
[ 0.0005080631235614419, -0.0013987742131575942, 0.02357352524995804, -0.030033346265554428, -0.043507374823093414, 0.0506180003285408, -0.00848454050719738, -0.02071722410619259, 0.0029060153756290674, 0.04155496507883072, 0.015137191861867905, -0.05124469846487045, -0.026803435757756233, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def delete_autoscaling_group(connection): group_name = module.params.get('name') notification_topic = module.params.get('notification_topic') wait_for_instances = module.params.get('wait_for_instances') wait_timeout = module.params.get('wait_timeout') if notification_topic: del_notification...
1,518
[ -0.005676002707332373, -0.004490063525736332, 0.04643501713871956, -0.015942934900522232, -0.022667331621050835, 0.03413548693060875, -0.00962811429053545, -0.0676841139793396, 0.0025170641019940376, 0.028511444106698036, 0.017544563859701157, -0.043843068182468414, -0.007354045286774635, ...
17
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def create_autoscaling_group(connection): group_name = module.params.get('name') load_balancers = module.params['load_balancers'] target_group_arns = module.params['target_group_arns'] availability_zones = module.params['availability_zones'] launch_config_name = module.params.get('launch_config_name...
1,519
[ 0.0003965462965425104, -0.01641128771007061, 0.08512665331363678, 0.009227207861840725, -0.02418621815741062, 0.023236438632011414, 0.04207739233970642, -0.03315389156341553, -0.01694139651954174, -0.0016524487873539329, -0.00744913425296545, -0.04360145330429077, -0.03724014759063721, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "group", "annotation": null, "type_comment": null}}, {"_type...
def update_size(connection, group, max_size, min_size, dc): module.debug("setting ASG sizes") module.debug("minimum size: %s, desired_capacity: %s, max size: %s" % (min_size, dc, max_size)) updated_group = dict() updated_group['AutoScalingGroupName'] = group['AutoScalingGroupName'] updated_group['M...
1,520
[ -0.002994091250002384, -0.01494690589606762, 0.05074411630630493, -0.05174895003437996, -0.038233932107686996, 0.04119819402694702, 0.018488945439457893, -0.00867297314107418, -0.01964450441300869, 0.03318464383482933, 0.024505389854311943, -0.04109771177172661, -0.03288319334387779, 0.007...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def replace(connection): batch_size = module.params.get('replace_batch_size') wait_timeout = module.params.get('wait_timeout') group_name = module.params.get('name') max_size = module.params.get('max_size') min_size = module.params.get('min_size') desired_capacity = module.params.get('desired_ca...
1,521
[ 0.03140278905630112, 0.0015332939801737666, 0.03841213509440422, -0.0806770846247673, 0.028501572087407112, 0.02416134811937809, 0.00015240463835652918, 0.030219092965126038, 0.036532144993543625, 0.01846335455775261, -0.01734928786754608, -0.047347888350486755, -0.014622141607105732, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "props", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lc_check", "annotation": null, "type_comment": null}}, {"_type":...
def get_instances_by_launch_config(props, lc_check, initial_instances): new_instances = [] old_instances = [] # old instances are those that have the old launch config if lc_check: for i in props['instances']: # Check if migrating from launch_template to launch_config first ...
1,522
[ 0.027431011199951172, -0.00950272474437952, 0.04484609514474869, -0.08626331388950348, 0.022389208897948265, 0.02368631772696972, 0.00219662394374609, 0.03866509348154068, 0.02017848566174507, 0.021295126527547836, -0.01334329228848219, -0.027453569695353508, -0.0018822163110598922, -0.028...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "props", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lt_check", "annotation": null, "type_comment": null}}, {"_type":...
def get_instances_by_launch_template(props, lt_check, initial_instances): new_instances = [] old_instances = [] # old instances are those that have the old launch template or version of the same launch templatec if lt_check: for i in props['instances']: # Check if migrating from laun...
1,523
[ -0.014413409866392612, 0.012025645934045315, 0.05641324445605278, -0.03626919910311699, -0.040461741387844086, 0.013433496467769146, -0.013880039565265179, -0.0004546829150058329, -0.008657969534397125, 0.014983993023633957, 0.004220449831336737, -0.06301215291023254, -0.06092828884720802, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "replace_instances", "annotation": null, "type_comment": nul...
def terminate_batch(connection, replace_instances, initial_instances, leftovers=False): batch_size = module.params.get('replace_batch_size') min_size = module.params.get('min_size') desired_capacity = module.params.get('desired_capacity') group_name = module.params.get('name') lc_check = module.para...
1,524
[ 0.018704071640968323, 0.05228985473513603, 0.01576085574924946, -0.06472525745630264, -0.0178249292075634, 0.02087007462978363, -0.01825813017785549, 0.026004774495959282, 0.049588724970817566, 0.013352770358324051, 0.03503828123211861, -0.07104489207267761, -0.033203549683094025, -0.02294...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "props", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lc_check", "annotation": null, "type_comment": null}}, {"_type":...
def list_purgeable_instances(props, lc_check, lt_check, replace_instances, initial_instances): instances_to_terminate = [] instances = (inst_id for inst_id in replace_instances if inst_id in props['instances']) # check to make sure instances given are actually in the given ASG # and they have a non-curr...
1,525
[ 0.031373996287584305, -0.004238174296915531, 0.030683616176247597, -0.021427391096949577, 0.00025709514738991857, 0.029532980173826218, 0.01361585408449173, -0.029686396941542625, -0.0025521735660731792, 0.008776792325079441, 0.013334588147699833, -0.033342860639095306, -0.036539070308208466...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "group_name", "annotation": null, "type_comment": null}}, {"...
def wait_for_new_inst(connection, group_name, wait_timeout, desired_size, prop): # make sure we have the latest stats after that last loop. as_group = describe_autoscaling_groups(connection, group_name)[0] props = get_properties(as_group) module.debug("Waiting for %s = %s, currently %s" % (prop, desire...
1,526
[ 0.01145156566053629, 0.03269058093428612, 0.040702980011701584, -0.035451777279376984, -0.035451777279376984, 0.04563368484377861, 0.030200576409697533, 0.02338387444615364, 0.02379065752029419, 0.05147657170891762, 0.007667248137295246, -0.04886329919099808, -0.07578495144844055, -0.03407...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "term_instances", "annotation": null, "type_comment": null}}...
def wait_for_term_inst(connection, term_instances): wait_timeout = module.params.get('wait_timeout') group_name = module.params.get('name') as_group = describe_autoscaling_groups(connection, group_name)[0] count = 1 wait_timeout = time.time() + wait_timeout while wait_timeout > time.time() and c...
1,527
[ 0.02024613693356514, 0.012713568285107613, 0.03357589244842529, -0.039536554366350174, -0.01708975061774254, 0.060964763164520264, -0.010368285700678825, -0.009117049165070057, 0.0251504797488451, 0.053570523858070374, 0.01590767875313759, -0.07665866613388062, -0.013430356979370117, 0.005...
13
{"_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 = ec2_argument_spec() argument_spec.update( dict( name=dict(required=True, type='str'), load_balancers=dict(type='list'), target_group_arns=dict(type='list'), availability_zones=dict(type='list'), launch_config_name=di...
1,528
[ 0.0033650605473667383, 0.00976527389138937, -0.018613088876008987, -0.03498908877372742, 0.002196243964135647, -0.000681416888255626, -0.03617047145962715, -0.02996191941201687, 0.017306026071310043, 0.01359848864376545, 0.055248573422431946, 0.00932539626955986, 0.01812293939292431, 0.025...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "st", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def statinfo(st): return { 'mode' : "%04o" % stat.S_IMODE(st.st_mode), 'isdir' : stat.S_ISDIR(st.st_mode), 'ischr' : stat.S_ISCHR(st.st_mode), 'isblk' : stat.S_ISBLK(st.st_mode), 'isreg' : stat.S_ISREG(st.st_mode), 'isfifo' : stat.S_ISFIFO(st.st_mode...
1,529
[ 0.024171879515051842, -0.0044260029681026936, -0.047257911413908005, -0.02646159753203392, -0.055566996335983276, 0.024856433272361755, 0.004369940608739853, 0.022413279861211777, 0.033401571214199066, 0.052592720836400986, -0.0015992624685168266, -0.06675592809915543, 0.011070908978581429, ...
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": "rover", "annotation": ...
class Stop(object): def __init__(self, rover, brake=5): self.rover = rover self.brake = brake self.rover.steer = 0 self.start_time = self.rover.total_time def __str__(self): return 'Stop' def delay(self, sec): if self.start_time == 0: self.start_...
1,530
[ 0.008260134607553482, -0.02379482053220272, 0.005435380153357983, -0.011123022064566612, -0.002927419962361455, 0.02366575598716736, 0.014455235563218594, 0.002820354886353016, 0.019324490800499916, 0.029802192002534866, -0.03787459433078766, -0.035833027213811874, -0.014748564921319485, -...
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": "sec", "annotation": null, "type_comment": null}}], "kwarg": null,...
def delay(self, sec): if self.start_time == 0: self.start_time = self.rover.total_time delta = self.rover.total_time - self.start_time if delta <= sec: return False else: self.start_time = 0 return True
1,531
[ 0.036079101264476776, -0.005184350535273552, -0.02784878946840763, -0.0070678736083209515, -0.0013139593647792935, -0.004282994661480188, 0.001740549341775477, 0.023882823064923286, 0.03538288176059723, 0.05992462858557701, -0.02588445506989956, -0.04540347307920456, -0.022005517035722733, ...
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 next(self): self.rover.throttle = 0.0 self.rover.steer = 0 if abs(self.rover.vel) < 0.02: if self.delay(0.5): self.rover.brake = 0.0 if self.rover.go_home: return ReturnHome(self.rover) else: ...
1,532
[ 0.023732300847768784, 0.003331526182591915, 0.00877902191132307, -0.03532189503312111, -0.04365714266896248, -0.011763245798647404, -0.02211155742406845, -0.03223476558923721, 0.015718629583716393, 0.04396585375070572, 0.014689586125314236, -0.04952268674969673, -0.008836905471980572, -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": "rover", "annotation": ...
class Go(object): def __init__(self, rover, throttle=0.1): self.rover = rover self.throttle = throttle self.bearing = 0 self.nav_data = None self.front_area = 0 self.start_time = 0 def __str__(self): return 'Go' def delay(self, sec): if self....
1,533
[ 0.018979758024215698, -0.02408776618540287, 0.009677673690021038, -0.010572826489806175, -0.024162884801626205, 0.0339532345533371, 0.010472670197486877, 0.012093962170183659, 0.02516445517539978, 0.028594832867383957, -0.034328822046518326, -0.032576076686382294, -0.037959516048431396, -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": "sec", "annotation": null, "type_comment": null}}], "kwarg": null,...
def delay(self, sec): if self.start_time == 0: self.start_time = self.rover.total_time delta = self.rover.total_time - self.start_time if delta <= sec: # print 'stabilizing...', delta return False else: self.start_time = 0 retur...
1,534
[ -0.009800068102777004, -0.02231118269264698, 0.012553856708109379, -0.0017890466842800379, -0.05949648842215538, -0.028820136561989784, 0.003706318559125066, -0.028136270120739937, -0.008975762873888016, 0.041569385677576065, -0.005284709390252829, -0.03942008689045906, -0.03446204587817192,...
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 update_sterring(self): self.nav_data = get_polar_points(self.rover) mean_dir = rad2deg(np.mean(get_near_periferics(self.nav_data, 100))) desv = rad2deg(np.sqrt(get_near_periferics(self.nav_data, 100).var())) AI, AD = side_areas(self.rover) if AI > 0.48: self.beari...
1,535
[ 0.015972275286912918, -0.012900193221867085, -0.03021092712879181, -0.026310276240110397, -0.018674686551094055, 0.03469794988632202, -0.003121477086097002, 0.008725476451218128, 0.009254486300051212, 0.037247397005558014, -0.021020175889134407, -0.04731770604848862, -0.03273487836122513, ...
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 stuck(self): if self.rover.vel < 0.02: if self.delay(0.3): if self.rover.throttle > 0: return True else: return False return False else: return False
1,536
[ 0.01892981119453907, -0.021515103057026863, 0.05374425649642944, -0.014902720227837563, -0.059859465807676315, -0.00617425050586462, -0.0033061914145946503, -0.023665370419621468, 0.0026443316601216793, 0.060058336704969406, 0.01597164012491703, -0.03201785311102867, -0.016356946900486946, ...
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 next(self): print('area: ', len(self.rover.nav_angles)) print('fron area:', self.front_area) if self.check_rock_sight(): self.rover.rock_detected = True return Stop(self.rover, brake=2) if self.check_area_stop(): # and is_obstacle_ahead(self.rover) == ...
1,537
[ 0.028974855318665504, 0.02181781828403473, 0.026671726256608963, -0.04635976627469063, -0.018957478925585747, -0.024405743926763535, -0.008203350938856602, 0.0037518723402172327, 0.003581614000722766, 0.06775658577680588, -0.0029593976214528084, -0.06409139186143875, -0.004042859189212322, ...
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": "rover", "annotation": ...
class SearchClearPath(object): def __init__(self, rover, turn='right'): self.rover = rover self.turn_direction = turn self.iteration = 0 def __str__(self): return 'SearchClearPath' def run(self): self.rover.brake = 0.0 def update_turn(self): if self.tur...
1,538
[ 0.02439957670867443, -0.024348797276616096, 0.024742338806390762, -0.025516726076602936, -0.04999247193336487, -0.032118067145347595, 0.022152580320835114, -0.017747454345226288, -0.006084025371819735, 0.03386996313929558, 0.0022866667713969946, -0.06007221341133118, -0.030137665569782257, ...
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 next(self): self.update_turn() AI, AD = side_areas(self.rover) print('iter: ', self.iteration) print('area: ', len(self.rover.nav_angles)) print('AI:', AI) if self.rover.rock_detected: return Rock(self.rover) else: if len(self.rover.nav...
1,539
[ 0.0000154461849888321, -0.006669700611382723, -0.01018456555902958, -0.038590289652347565, -0.038712333887815475, 0.025360727682709694, -0.026752028614282608, -0.013376014307141304, 0.008262373507022858, 0.010605617426335812, 0.014083868823945522, -0.07840102165937424, -0.02174822799861431, ...
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": "rover", "annotation": ...
class Stuck(object): def __init__(self, rover): self.rover = rover self.times = 0 def __str__(self): return 'Stuck' def check_vel_max(self): if self.rover.vel < -self.rover.max_vel: return False else: return True def run(self): s...
1,540
[ 0.05073637515306473, -0.027529271319508553, -0.025883900001645088, -0.007754119113087654, -0.016969425603747368, 0.021279316395521164, 0.00360692385584116, 0.02639961428940296, 0.033202119171619415, 0.04336903989315033, 0.00296074734069407, -0.038801293820142746, -0.03366871550679207, -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 next(self): if self.rover.picking_up: return Stop(self.rover) self.times += 1 if self.times >= 1: if self.times >= 35: self.rover.throttle = 0.0 self.times = 0 return Stop(self.rover) else: if...
1,541
[ 0.013657639734447002, -0.01588304713368416, 0.052850235253572464, -0.01808302104473114, -0.004473067820072174, -0.015387099236249924, -0.0355302095413208, -0.029807735234498978, 0.0012573548592627048, 0.03939605876803398, 0.036674704402685165, -0.05559702217578888, -0.007369276136159897, -...
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": "rover", "annotation": ...
class Rock(Go): def __init__(self, rover): self.rover = rover self.distance = 0 self.angle = 0 self.iteration = 0 self.bearing = 0 self.start_time = 0 def __str__(self): return 'Rock' def update_rock_data(self): self.distance = distance_to_ro...
1,542
[ 0.026445534080266953, -0.0328197106719017, -0.017042407765984535, 0.02997322753071785, -0.004090299364179373, 0.004662028979510069, -0.02510744333267212, -0.007985967211425304, -0.011507578194141388, 0.021506763994693756, 0.02348957024514675, -0.026932112872600555, 0.02209065854549408, 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 check(self): # If in a state where want to pickup a rock send pickup command if self.rover.near_sample: self.rover.throttle = 0 self.rover.brake = self.rover.brake_set if self.rover.vel == 0 and not self.rover.picking_up: self.rover.send_pickup = T...
1,543
[ 0.025442034006118774, -0.018655018880963326, 0.032340310513973236, -0.01713443174958229, -0.020336320623755455, -0.006675752345472574, 0.004178526345640421, -0.016009442508220673, -0.015106980688869953, 0.047620367258787155, 0.009593303315341473, -0.04860936850309372, -0.042576465755701065, ...
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 next(self): self.update_rock_data() if self.distance == 0: self.iteration += 1 self.rover.steer = np.clip(self.bearing, -15, 15) self.go() if self.iteration >= 5: self.rover.max_vel = 1 self.rover.rock_detected = False ...
1,544
[ 0.01969142071902752, 0.010067933239042759, 0.05029645562171936, -0.008956818841397762, -0.030271701514720917, -0.018580306321382523, -0.039777904748916626, -0.019851915538311005, 0.030493924394249916, 0.04454335197806358, -0.00955558568239212, -0.05713598430156708, 0.002720687771216035, -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": "rover", "annotation": ...
class ReturnHome(Go): def __init__(self, rover): self.rover = rover self.home = self.rover.pos self.front_area = 0 def __str__(self): return 'ReturnHome' def bearing_to_home_position(self): x = self.rover.pos[0] - self.home[0] y = self.rover.pos[1] - self.ho...
1,545
[ 0.003208311740309, -0.02344055101275444, 0.020147062838077545, -0.014434563927352428, -0.05242324620485306, -0.021475814282894135, 0.011317106895148754, -0.04317876696586609, 0.010408558882772923, 0.04874362424015999, -0.0001763861655490473, -0.04656310752034187, -0.0341159962117672, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def update_sterring(self): min_nav_angle = rad2deg(np.min(self.rover.nav_angles)) + 45 max_nav_angle = rad2deg(np.max(self.rover.nav_angles)) - 45 min_obs_angle = rad2deg(np.min(self.rover.nav_angles)) + 45 max_obs_angle = rad2deg(np.max(self.rover.nav_angles)) - 45 min_angle = ...
1,546
[ 0.04167480394244194, -0.03298235312104225, 0.018278637900948524, -0.00727227795869112, -0.0466209314763546, -0.032492633908987045, -0.02842799574136734, -0.018560225144028664, 0.025636615231633186, 0.046278130263090134, -0.00647036824375391, -0.03800193592905998, -0.01671154797077179, -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 next(self): if self.rover.samples_to_find == 0: self.rover.go_home = True print('area: ', len(self.rover.nav_angles)) print('front area:', self.front_area) if self.check_area_stop(): # and is_obstacle_ahead(self.rover) == self.update_sterring(...
1,547
[ 0.03292191028594971, 0.032008565962314606, -0.018505601212382317, -0.019917132332921028, -0.003770139766857028, -0.010435996577143669, -0.05920131504535675, -0.042366720736026764, 0.015402305871248245, 0.011977264657616615, 0.033565402030944824, 0.0005925710429437459, 0.011043163016438484, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "__slots__", "ctx": {"_type": "Store", "_fields": {}}}}], "ty...
class NodeList(list): __slots__ = () def item(self, index): if 0 <= index < len(self): return self[index] def _get_length(self): return len(self) def _set_length(self, value): raise xml.dom.NoModificationAllowedErr( "attempt to modify read-only attribut...
1,548
[ 0.005855247378349304, -0.016227686777710915, 0.018551677465438843, -0.02925611473619938, 0.0009004203020595014, -0.007937783375382423, -0.005860277451574802, -0.004861766472458839, 0.010684316977858543, 0.016197504475712776, -0.016217626631259918, -0.010332196950912476, 0.0031841679010540247...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "__slots__", "ctx": {"_type": "Store", "_fields": {}}}}], "ty...
class EmptyNodeList(tuple): __slots__ = () def __add__(self, other): NL = NodeList() NL.extend(other) return NL def __radd__(self, other): NL = NodeList() NL.extend(other) return NL def item(self, index): return None def _get_length(self): ...
1,549
[ 0.002481022384017706, -0.002920488826930523, 0.017629316076636314, -0.032786473631858826, 0.012077094987034798, -0.02255336567759514, -0.008014246821403503, -0.037528153508901596, -0.004306010901927948, 0.040304262191057205, -0.005790318362414837, 0.005450903438031673, 0.04368828237056732, ...
9
{"_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 find_lldb_root(): lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) while True: parent = os.path.dirname(lldb_root) if parent == lldb_root: # dirname('/') == '/' break lldb_root = parent test_path = os.path.join(lldb_root, "use_lldb_suite_root....
1,550
[ 0.056479983031749725, 0.07728166878223419, -0.026897259056568146, 0.012489535845816135, 0.040196698158979416, 0.006511182989925146, -0.042391955852508545, -0.047187428921461105, 0.02173946611583233, -0.041049227118492126, 0.03832113742828369, -0.01626197248697281, -0.002696119947358966, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "klass", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "ar...
def defproperty(klass, name, doc): get = getattr(klass, ("_get_" + name)) def set(self, value, name=name): raise xml.dom.NoModificationAllowedErr( "attempt to modify read-only attribute " + repr(name)) assert not hasattr(klass, "_set_" + name), \ "expected not to find _set_" +...
1,551
[ -0.03001539222896099, -0.014004033990204334, -0.04314564913511276, -0.017534561455249786, -0.010544353164732456, 0.027701064944267273, -0.028149761259555817, -0.03898930922150612, 0.026685595512390137, 0.012445406056940556, 0.04349988326430321, -0.02427680790424347, 0.029070768505334854, 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_parse_category(self): incident = incident_binding.parseString(INCIDENT_CATEGORIES) self.assertTrue(incident is not None) self.assertEqual(2, len(incident.Categories.Category)) categories = incident.Categories.Category self.assertEqual('Foo', categories[0].valueOf_) ...
1,552
[ -0.030008144676685333, 0.04384822025895119, 0.01916121132671833, -0.019634485244750977, -0.008314277045428753, -0.03351293131709099, -0.01377611793577671, -0.02045312151312828, 0.055616118013858795, -0.012624910101294518, 0.017076246440410614, -0.0570487342774868, 0.01820187084376812, -0.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_description_output(self): incident = incident_binding.IncidentType() assets = incident_binding.AffectedAssetsType() asset = incident_binding.AffectedAssetType() description = StructuredText("A Description") asset.Structured_Description = description.to_obj() a...
1,553
[ 0.00420606043189764, 0.002583238761872053, 0.004415092524141073, -0.06824608892202377, 0.012496717274188995, 0.020891889929771423, -0.03238299489021301, -0.0030196632724255323, 0.015389266423881054, 0.014451447874307632, 0.00035044620744884014, -0.0426425039768219, -0.005217323079705238, -...
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_add_description(self): o1 = self.klass() o2 = self.klass() o1.add_description("Test") o2.descriptions.add("Test") self.assertEqual( o1.descriptions.to_dict(), o2.descriptions.to_dict() )
1,554
[ -0.005282482597976923, -0.007929453626275063, -0.0026985350996255875, -0.0731068104505539, -0.003741281107068062, 0.03258867934346199, -0.03854722902178764, -0.013234853744506836, 0.017199579626321793, 0.03251992538571358, -0.009166997857391834, -0.049226779490709305, 0.0035407531540840864, ...
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_add_short_description(self): o1 = self.klass() o2 = self.klass() o1.add_short_description("Test") o2.short_descriptions.add("Test") self.assertEqual( o1.short_descriptions.to_dict(), o2.short_descriptions.to_dict() )
1,555
[ 0.003491652198135853, 0.04855724424123764, 0.055028438568115234, -0.043040432035923004, -0.02202068641781807, 0.0030551955569535494, 0.017923815175890923, -0.0279797725379467, -0.01946014165878296, -0.01857559010386467, 0.014082997106015682, -0.023254403844475746, -0.019297197461128235, -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": "cr", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def init(self, cr): # self._table = account_invoice_report tools.drop_view_if_exists(cr, self._table) cr.execute("""CREATE or REPLACE VIEW %s as ( WITH currency_rate (currency_id, rate, date_start, date_end) AS ( SELECT r.currency_id, r.rate, r.name AS date_start, ...
1,556
[ 0.015039892867207527, -0.010411827825009823, 0.013657278381288052, -0.035568028688430786, -0.01718241721391678, -0.04128846526145935, 0.017973991110920906, 0.03157849609851837, 0.04407479986548424, 0.021446360275149345, 0.00837484560906887, -0.01111368928104639, -0.0297420471906662, -0.005...
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": "item1", "annotation": ...
class TestCase(unittest.TestCase): def keyword_case(self, item1, item2): result = get_translation_from_keyword(item1) self.assertEqual(result, item2) def translation_case(self, item1, item2): result = get_keyword_from_translation(item1) self.assertEqual(result, item2) def ...
1,557
[ 0.03069080412387848, 0.025298884138464928, -0.031467240303754807, -0.033861253410577774, -0.04143150895833969, -0.006152180023491383, -0.03176918625831604, -0.0630207508802414, -0.021632380783557892, 0.014504263177514076, 0.004173345398157835, -0.01754530519247055, -0.002673043869435787, -...
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": "plotly_name", "annotat...
class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="uirevision", parent_name="scattergl", **kwargs): super(UirevisionValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_t...
1,558
[ -0.006186039187014103, -0.0032112542539834976, 0.022827178239822388, -0.02620711550116539, 0.011583846993744373, 0.005262232385575771, -0.011476648040115833, -0.003865486243739724, -0.0007685255259275436, -0.00021538420696742833, -0.007289563305675983, -0.05211154744029045, -0.00131161685567...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyar...
class unisports: def initialize_unisports(config): with dbapi2.connect(config) as connection: cursor = connection.cursor() query = """DROP TABLE IF EXISTS UNITEAMS CASCADE;""" cursor.execute(query) query = """DROP TABLE IF EXISTS UNILEAGUES CASCADE;""" ...
1,559
[ 0.02810099348425865, 0.0006952068652026355, 0.0036648379173129797, -0.002435419475659728, -0.03109843283891678, -0.012774243019521236, 0.005061105825006962, 0.0471160002052784, 0.01579510048031807, -0.011603368446230888, -0.023768756538629532, -0.024728873744606972, -0.0031437985599040985, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def saveuniteam(config): uni_name = None team_name = None if request.method == 'POST': uni_name = request.form['uniname_text'] team_name = request.form['teamname_text'] with dbapi2.connection(config) as connection: cursor = connection.cursor() ...
1,560
[ -0.01574603281915188, -0.006910349708050489, 0.062444545328617096, -0.01848074048757553, -0.007756514940410852, 0.005999802611768246, 0.00777490995824337, 0.013219799846410751, -0.024072788655757904, -0.009307818487286568, -0.0013520249631255865, -0.025507591664791107, 0.0030244276858866215,...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def initialize_unisports(config): with dbapi2.connect(config) as connection: cursor = connection.cursor() query = """DROP TABLE IF EXISTS UNITEAMS CASCADE;""" cursor.execute(query) query = """DROP TABLE IF EXISTS UNILEAGUES CASCADE;""" cursor.execute(q...
1,561
[ 0.027831461280584335, 0.011615562252700329, 0.008724577724933624, 0.003668223274871707, -0.02881806716322899, 0.008386149071156979, 0.019353535026311874, 0.031135443598031998, -0.008403357118368149, -0.0159118864685297, -0.0012045768089592457, -0.029116343706846237, -0.020030392333865166, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "updateuniteam", "annotation": null, "type_comment": null}}], "k...
def unisports_page_update_apply(config,updateuniteam): with dbapi2.connect(config) as connection: cursor = connection.cursor() new_uniteam = request.form['name'] print(new_uniteam) query="""UPDATE UNITEAMS set uni_name =%s where uni_name= %s""" % (new_uniteam,upda...
1,562
[ 0.014967169612646103, 0.01837954856455326, 0.0004395690921228379, -0.011532265692949295, -0.012478272430598736, -0.020890969783067703, 0.010552474297583103, -0.03191644698381424, 0.0005926616140641272, -0.016802871599793434, -0.010479271411895752, 0.038178108632564545, -0.004991872236132622,...
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": "cu_weights", "annotation": null, "type_comment": null}}, {"_type"...
def _canonical_to_opaque(self, cu_weights, cu_biases): if not self._input_size: raise RuntimeError( "%s._canonical_to_opaque invoked before input shape is known" % type(self).__name__) with ops.device("/gpu:0"): return cudnn_rnn_ops.cudnn_rnn_canonical_to_opaque_params( ...
1,563
[ 0.03730485960841179, -0.02481759525835514, 0.04012962430715561, -0.003273142734542489, -0.013765133917331696, 0.000908661400899291, 0.032036446034908295, 0.002774324733763933, -0.01932499371469021, -0.017161579802632332, -0.03389720246195793, -0.015424124896526337, 0.05604696273803711, 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 _gather_saveables_for_checkpoint(self): if self._direction == CUDNN_RNN_UNIDIRECTION: # Skip one inheritance level to avoid NotImplementedError. return super(_CudnnRNN, self)._gather_saveables_for_checkpoint else: raise NotImplementedError( "Object-based saving does not currently...
1,564
[ -0.03937968611717224, 0.014032823033630848, 0.009320671670138836, -0.0218112263828516, 0.022774381563067436, -0.01092390064150095, -0.05237620323896408, 0.009783961810171604, -0.01425227615982294, 0.034990619868040085, 0.02704153023660183, -0.029601819813251495, -0.011655411683022976, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filters", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def get_data(filters): data = [] asset_categories = get_asset_categories(filters) assets = get_assets(filters) asset_costs = get_asset_costs(assets, filters) asset_depreciations = get_accumulated_depreciations(assets, filters) for asset_category in asset_categories: row = frappe._dict() row.asset_category...
1,565
[ 0.012048647738993168, 0.042571887373924255, -0.002573626581579447, -0.009396763518452644, 0.025491157546639442, 0.023884672671556473, -0.015072621405124664, 0.005040941294282675, 0.026554273441433907, 0.03848479688167572, 0.017694974318146706, -0.02375473454594612, -0.002040592022240162, -...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "assets", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filters", "annotation": null, "type_comment": null}}], "kwarg":...
def get_accumulated_depreciations(assets, filters): asset_depreciations = frappe._dict() for d in assets: asset = frappe.get_doc("Asset", d.name) asset_depreciations.setdefault(d.asset_category, frappe._dict({ "accumulated_depreciation_as_on_from_date": asset.opening_accumulated_depreciation, "depreciati...
1,566
[ -0.018417803570628166, 0.011599043384194374, 0.03397458791732788, -0.015199157409369946, 0.021493397653102875, -0.0012814976507797837, -0.02299543097615242, 0.011289100162684917, 0.02069469727575779, 0.024867014959454536, 0.038480691611766815, -0.026464415714144707, -0.010466556996107101, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "assets", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filters", "annotation": null, "type_comment": null}}], "kwarg":...
def get_asset_costs(assets, filters): asset_costs = frappe._dict() for d in assets: asset_costs.setdefault(d.asset_category, frappe._dict({ "cost_as_on_from_date": 0, "cost_of_new_purchase": 0, "cost_of_sold_asset": 0, "cost_of_scrapped_asset": 0 })) costs = asset_costs[d.asset_category] if ...
1,567
[ -0.026978235691785812, 0.030963381752371788, 0.024828670546412468, -0.02492528036236763, 0.008471455425024033, -0.01689460687339306, -0.05328020453453064, -0.04446457698941231, -0.027678655460476875, 0.04103493317961693, 0.015566224232316017, -0.027775265276432037, 0.0126437833532691, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filters", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def get_columns(filters): return [ { "label": _("Asset Category"), "fieldname": "asset_category", "fieldtype": "Link", "options": "Asset Category", "width": 120 }, { "label": _("Cost as on") + " " + formatdate(filters.day_before_from_date), "fieldname": "cost_as_on_from_date", "fieldtype"...
1,568
[ -0.01995241828262806, 0.015391864813864231, 0.05775047466158867, 0.01904774270951748, 0.006298643536865711, 0.03256829455494881, 0.010478117503225803, 0.028280382975935936, -0.015205972827970982, 0.08942648768424988, 0.03997919335961342, -0.02855302393436432, 0.010304617695510387, -0.00479...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def test_kd_tree_query(): np.random.seed(0) X = np.random.random((40, DIMENSION)) Y = np.random.random((10, DIMENSION)) def check_neighbors(dualtree, breadth_first, k, metric, kwargs): kdt = KDTree(X, leaf_size=1, metric=metric, **kwargs) dist1, ind1 = kdt.query(Y, k, dualtree=dualtree,...
1,569
[ -0.015485295094549656, 0.03473358601331711, 0.03525812551379204, 0.015987027436494827, -0.0030503065790981054, 0.058976396918296814, 0.011283284053206444, 0.010963999666273594, -0.02967064641416073, 0.08921719342470169, 0.02967064641416073, -0.025588367134332657, -0.0028878136072307825, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dualtree", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "breadth_first", "annotation": null, "type_comment": null}}, {...
def check_neighbors(dualtree, breadth_first, k, metric, kwargs): kdt = KDTree(X, leaf_size=1, metric=metric, **kwargs) dist1, ind1 = kdt.query(Y, k, dualtree=dualtree, breadth_first=breadth_first) dist2, ind2 = brute_force_neighbors(X, Y, k, metric, **kwargs) ...
1,570
[ -0.013872746378183365, -0.02662491612136364, 0.046929776668548584, 0.014242537319660187, 0.011065700091421604, 0.004997774492949247, -0.012270321138203144, 0.007502264808863401, -0.009480083361268044, 0.067055344581604, 0.007530278991907835, -0.01471317932009697, 0.02280374802649021, -0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_samples", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_features", "annotation": null, "type_comment": null}}], "k...
def test_kd_tree_query_radius(n_samples=100, n_features=10): np.random.seed(0) X = 2 * np.random.random(size=(n_samples, n_features)) - 1 query_pt = np.zeros(n_features, dtype=float) eps = 1E-15 # roundoff error can cause test to fail kdt = KDTree(X, leaf_size=5) rad = np.sqrt(((X - query_pt) ...
1,571
[ -0.016937319189310074, -0.03764791041612625, 0.05409767106175423, 0.0124009158462286, 0.019565889611840248, 0.008654143661260605, -0.008129489608108997, 0.01106543280184269, -0.013280639424920082, 0.075253427028656, -0.006825803313404322, -0.013683403842151165, 0.008102991618216038, -0.024...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_samples", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_features", "annotation": null, "type_comment": null}}], "k...
def test_kd_tree_query_radius_distance(n_samples=100, n_features=10): np.random.seed(0) X = 2 * np.random.random(size=(n_samples, n_features)) - 1 query_pt = np.zeros(n_features, dtype=float) eps = 1E-15 # roundoff error can cause test to fail kdt = KDTree(X, leaf_size=5) rad = np.sqrt(((X - q...
1,572
[ -0.0016220274847000837, 0.012792390771210194, -0.022751640528440475, 0.01946433074772358, 0.010564805939793587, -0.0013584480620920658, -0.001019174000248313, 0.011181176640093327, 0.04922312870621681, 0.052423931658267975, -0.014911839738488197, 0.040918346494436264, -0.019258873537182808, ...
20
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "Y", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "X", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f...
def compute_kernel_slow(Y, X, kernel, h): d = np.sqrt(((Y[:, None, :] - X) ** 2).sum(-1)) norm = kernel_norm(h, X.shape[1], kernel) if kernel == 'gaussian': return norm * np.exp(-0.5 * (d * d) / (h * h)).sum(-1) elif kernel == 'tophat': return norm * (d < h).sum(-1) elif kernel == '...
1,573
[ -0.04459566995501518, -0.015290948562324047, 0.06692865490913391, -0.003125563496723771, 0.015537009574472904, 0.01668529585003853, 0.011160634458065033, 0.01820853166282177, -0.00206662155687809, 0.06852219253778458, -0.0073232511058449745, -0.02950391359627247, 0.005630115512758493, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_samples", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_features", "annotation": null, "type_comment": null}}], "k...
def test_kd_tree_two_point(n_samples=100, n_features=3): np.random.seed(0) X = np.random.random((n_samples, n_features)) Y = np.random.random((n_samples, n_features)) r = np.linspace(0, 1, 10) kdt = KDTree(X, leaf_size=10) D = DistanceMetric.get_metric("euclidean").pairwise(Y, X) counts_tru...
1,574
[ -0.02642880007624626, -0.03403490409255028, 0.0377657450735569, 0.009754345752298832, 0.016981346532702446, -0.004913277458399534, 0.0010793866822496057, 0.030400341376662254, -0.004669569432735443, 0.06691444665193558, 0.012552476488053799, -0.009591873735189438, 0.005298397038131952, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_samples", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_features", "annotation": null, "type_comment": null}}], "k...
def test_kd_tree_kde(n_samples=100, n_features=3): np.random.seed(0) X = np.random.random((n_samples, n_features)) Y = np.random.random((n_samples, n_features)) kdt = KDTree(X, leaf_size=10) for kernel in ['gaussian', 'tophat', 'epanechnikov', 'exponential', 'linear', 'cosine']: ...
1,575
[ -0.0028036499861627817, -0.012302416376769543, 0.0034989551641047, -0.01942368783056736, 0.04443224519491196, -0.02752062864601612, -0.0010955262696370482, -0.03075043298304081, -0.025187991559505463, 0.012661282904446125, 0.02581600844860077, 0.010160427540540695, -0.01244820561259985, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_nodes", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "value...
def test_node_heap(n_nodes=50): vals = np.random.random(n_nodes).astype(DTYPE) i1 = np.argsort(vals) vals2, i2 = nodeheap_sort(vals) assert_array_almost_equal(i1, i2) assert_array_almost_equal(vals[i1], vals2)
1,576
[ -0.044412415474653244, -0.016610758379101753, 0.04401441290974617, 0.028539132326841354, 0.03057597018778324, -0.030412087216973305, 0.028422072529792786, 0.01384815201163292, -0.021784793585538864, 0.023482156917452812, 0.04724525660276413, -0.01213908102363348, 0.023997219279408455, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_pts", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_nbrs", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_neighbors_heap(n_pts=5, n_nbrs=10): heap = NeighborsHeap(n_pts, n_nbrs) for row in range(n_pts): d_in = np.random.random(2 * n_nbrs).astype(DTYPE) i_in = np.arange(2 * n_nbrs, dtype=ITYPE) for d, i in zip(d_in, i_in): heap.push(row, d, i) ind = np.argsort(d...
1,577
[ 0.03288654983043671, 0.05234503373503685, 0.005160648841410875, -0.035108283162117004, -0.0064332629553973675, -0.01528357807546854, -0.010937768034636974, -0.048829320818185806, 0.022498110309243202, -0.03852633386850357, 0.011578653007745743, -0.04755976051092148, 0.02467101439833641, 0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "X86PagetableWalker"}}, "targets": [{"_type": "Name", "_fields": {"id": "type", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment...
class X86PagetableWalker(MemObject): type = 'X86PagetableWalker' cxx_class = 'X86ISA::Walker' cxx_header = 'arch/x86/pagetable_walker.hh' port = MasterPort("Port for the hardware table walker") system = Param.System(Parent.any, "system object") num_squash_per_cycle = Param.Unsigned(4, ...
1,578
[ -0.03699294477701187, -0.01334311906248331, 0.01856062188744545, -0.03440557420253754, 0.031582992523908615, -0.010178404860198498, -0.001483459840528667, -0.024718984961509705, -0.05208948627114296, -0.019736697897315025, 0.007484121713787317, -0.004565313924103975, 0.023307692259550095, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_rows", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_pts", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_simultaneous_sort(n_rows=10, n_pts=201): dist = np.random.random((n_rows, n_pts)).astype(DTYPE) ind = (np.arange(n_pts) + np.zeros((n_rows, 1))).astype(ITYPE) dist2 = dist.copy() ind2 = ind.copy() # simultaneous sort rows using function simultaneous_sort(dist, ind) # simultaneous...
1,579
[ 0.0055315434001386166, -0.01168679166585207, 0.060979899019002914, -0.015561939217150211, 0.009048827923834324, 0.0031875392887741327, 0.021205954253673553, 0.01470306795090437, -0.05349544435739517, 0.03402768447995186, -0.007361758500337601, 0.01499958336353302, 0.010357585735619068, -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": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg...
def install(self, spec, prefix): with working_dir('lib'): install_tree('include', prefix.include) libfiles = glob.glob('lib*.a') libfiles += glob.glob('lib*.so') libfiles += glob.glob('lib*.dylib') mkdirp(prefix.lib) for lib in libfiles: ...
1,580
[ 0.003528330707922578, -0.004801541101187468, 0.07373491674661636, -0.03762679919600487, 0.0037607161793857813, 0.005230308510363102, -0.00027554857661016285, -0.0021143800113350153, -0.001845991238951683, 0.014597732573747635, 0.03775772079825401, 0.01168473158031702, 0.02230900153517723, ...
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": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg...
def edit(self, spec, prefix): # Set fortran name mangling in Make.defs defs_file = FileFilter('./lib/mk/Make.defs') defs_file.filter('^\s*#\s*cppcallsfort\s*=\s*', 'cppcallsfort = -DCH_FORT_UNDERSCORE') # Set remaining variables in Make.defs.local # Mak...
1,581
[ 0.015452975407242775, 0.03562460467219353, 0.0038879490457475185, 0.02449500560760498, -0.009610244072973728, -0.0062781572341918945, -0.039750341325998306, -0.0032487071584910154, -0.01865227334201336, 0.05578388273715973, 0.017565252259373665, -0.03545166924595833, 0.028040172532200813, ...
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": "stopped", "annotation": null, "type_comment": null}}, {"_type": "...
def containers(self, stopped=False, one_off=False, filters={}): filters.update({'label': self.labels(one_off=one_off)}) return list(filter(None, [ Container.from_ps(self.client, container) for container in self.client.containers( all=stopped, filt...
1,582
[ 0.04725056141614914, 0.013374460861086845, 0.0000702028555679135, -0.016894055530428886, -0.025253092870116234, -0.013539441861212254, 0.003778065089136362, -0.004218014422804117, -0.05011023208498955, -0.0016181886894628406, 0.006456256844103336, -0.0024527176283299923, 0.03521794453263283,...
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": "do_build", "annotation": null, "type_comment": null}}], "kwarg": ...
def ensure_image_exists(self, do_build=BuildAction.none): if self.can_be_built() and do_build == BuildAction.force: self.build() return try: self.image() return except NoSuchImageError: pass if not self.can_be_built(): ...
1,583
[ 0.0284297913312912, -0.0010133561445400119, -0.04444148391485214, -0.01304538268595934, -0.008053690195083618, -0.03153431415557861, -0.0215296670794487, 0.008016478270292282, -0.015097346156835556, 0.0024081331212073565, 0.012418098747730255, -0.026324668899178505, 0.008766029961407185, -...
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 image(self): try: return self.client.inspect_image(self.image_name) except APIError as e: if e.response.status_code == 404 and e.explanation and 'No such image' in str(e.explanation): raise NoSuchImageError("Image '{}' not found".format(self.image_name)) ...
1,584
[ 0.05131936073303223, 0.04253518953919411, 0.01138230785727501, -0.014265000820159912, -0.012662816792726517, 0.008889335207641125, 0.0016841484466567636, 0.0004272231599316001, 0.02017885260283947, 0.011487470008432865, 0.015997091308236122, 0.004450853448361158, 0.0671556144952774, -0.015...
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": "strategy", "annotation": null, "type_comment": null}}], "kwarg": ...
def convergence_plan(self, strategy=ConvergenceStrategy.changed): containers = self.containers(stopped=True) if not containers: return ConvergencePlan('create', []) if strategy is ConvergenceStrategy.never: return ConvergencePlan('start', containers) if ( ...
1,585
[ 0.03472546115517616, 0.03203628212213516, 0.03645588830113411, 0.0013694341760128736, 0.036128509789705276, 0.016345519572496414, -0.0036917724646627903, -0.009546578861773014, 0.013796648010611534, -0.003931459970772266, 0.03797585889697075, -0.017187349498271942, 0.041273023933172226, -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": "containers", "annotation": null, "type_comment": null}}], "kwarg"...
def _containers_have_diverged(self, containers): config_hash = None try: config_hash = self.config_hash except NoSuchImageError as e: log.debug( 'Service %s has diverged: %s', self.name, six.text_type(e), ) return T...
1,586
[ 0.05162797123193741, 0.03963962569832802, 0.02680153027176857, -0.0031722034327685833, -0.01614522375166416, 0.01022569090127945, -0.025079067796468735, 0.006694640964269638, -0.008216150104999542, -0.019257141277194023, 0.01422754768282175, 0.01981981284916401, 0.07271092385053635, -0.027...
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": "plan", "annotation": null, "type_comment": null}}, {"_type": "arg...
def execute_convergence_plan(self, plan, do_build=BuildAction.none, timeout=DEFAULT_TIMEOUT, detached=False, start=True): (action, containers) = pl...
1,587
[ -0.02929476462304592, -0.022986693307757378, 0.047933176159858704, 0.03388801962137222, 0.01096257008612156, 0.0027738159988075495, -0.03327558562159538, 0.03523537516593933, 0.0004854816070292145, 0.0321936197578907, -0.001577017828822136, 0.026804199442267418, 0.06050848960876465, 0.0002...
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": "container", "annotation": null, "type_comment": null}}], "kwarg":...
def connect_container_to_networks(self, container): connected_networks = container.get('NetworkSettings.Networks') for network, netdefs in self.networks.items(): aliases = netdefs.get('aliases', []) ipv4_address = netdefs.get('ipv4_address', None) ipv6_address = netd...
1,588
[ 0.0744333267211914, -0.014080153778195381, 0.027259178459644318, 0.0002852991165127605, 0.0022302963770926, 0.013032590970396996, -0.016749750822782516, 0.02155953273177147, -0.006307909265160561, 0.01604011096060276, 0.013832343742251396, -0.0015361447585746646, 0.034761086106300354, -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 duplicate_containers(self): containers = sorted( self.containers(stopped=True), key=lambda c: c.get('Created'), ) numbers = set() for c in containers: if c.number in numbers: yield c else: numbers.add(c...
1,589
[ 0.022619953379034996, -0.032777123153209686, -0.02118673361837864, -0.0733642578125, 0.00748805608600378, 0.008765491656959057, 0.023741602897644043, 0.018195664510130882, -0.040898703038692474, 0.015588865615427494, 0.0225368682295084, -0.03730526566505432, 0.05142975598573685, -0.0518036...
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 config_dict(self): return { 'options': self.options, 'image_id': self.image()['Id'], 'links': self.get_link_names(), 'net': self.network_mode.id, 'networks': self.networks, 'volumes_from': [ (v.source.name, v.mode) ...
1,590
[ 0.04023144394159317, -0.014949054457247257, 0.042582154273986816, 0.03308136388659477, 0.01623459905385971, -0.014728675596415997, -0.0014668989460915327, 0.02852686122059822, -0.008637639693915844, 0.009182466194033623, 0.016687601804733276, -0.014275673776865005, 0.00686236284673214, -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": "one_off", "annotation": null, "type_comment": null}}], "kwarg": n...
def _next_container_number(self, one_off=False): containers = filter(None, [ Container.from_ps(self.client, container) for container in self.client.containers( all=True, filters={'label': self.labels(one_off=one_off)}) ]) numbers = [c.numbe...
1,591
[ -0.032068077474832535, -0.038147225975990295, 0.0250849649310112, -0.023141445592045784, -0.0041836523450911045, -0.04872358962893486, -0.029536981135606766, -0.02763865888118744, -0.01696060039103031, 0.02687029168009758, -0.0026921138633042574, -0.02501716837286949, 0.05279142037034035, ...
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": "link_to_self", "annotation": null, "type_comment": null}}], "kwar...
def _get_links(self, link_to_self): links = {} for service, link_name in self.links: for container in service.containers(): links[link_name or service.name] = container.name links[container.name] = container.name links[container.name_without_p...
1,592
[ 0.04283584654331207, 0.012128095142543316, 0.037180256098508835, -0.0002922708517871797, 0.0008810673607513309, -0.020580057054758072, 0.002187612932175398, -0.005289022345095873, -0.05739374831318855, 0.02488458901643753, -0.0052785491570830345, 0.013468679040670395, 0.03219496086239815, ...
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": "override_options", "annotation": null, "type_comment": null}}, {"...
def _get_container_create_options( self, override_options, number, one_off=False, previous_container=None): add_config_hash = (not one_off and not override_options) container_options = dict( (k, self.options[k]) for k i...
1,593
[ 0.05500899255275726, -0.004686504602432251, -0.0003091695252805948, -0.029918337240815163, -0.030560551211237907, 0.003667819779366255, 0.05642629414796829, -0.009312110021710396, -0.04832110181450844, 0.00373425567522645, 0.03328442573547363, -0.016741866245865822, -0.011593078263103962, ...
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": "no_cache", "annotation": null, "type_comment": null}}, {"_type": ...
def build(self, no_cache=False, pull=False, force_rm=False): log.info('Building %s' % self.name) build_opts = self.options.get('build', {}) path = build_opts.get('context') # python2 os.path() doesn't support unicode, so we need to encode it to # a byte string if not six...
1,594
[ 0.04136892780661583, 0.0036827099975198507, 0.08273785561323166, -0.0069385976530611515, -0.003644405398517847, -0.021833600476384163, -0.02499646320939064, -0.03436466306447983, -0.04697233811020851, 0.006331196986138821, 0.021209781989455223, -0.00714106485247612, 0.012640505097806454, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "override_options", "annotation": null, "type_comment": null}}, {"...
def _get_container_host_config(self, override_options, one_off=False): options = dict(self.options, **override_options) logging_dict = options.get('logging', None) log_config = get_log_config(logging_dict) return self.client.create_host_config( links=self._get_links(link_to...
1,595
[ 0.00761118670925498, 0.02968721091747284, -0.004788342397660017, -0.04917839914560318, -0.029421048238873482, 0.018457254394888878, -0.0013730335049331188, -0.006869006436318159, -0.008332893252372742, 0.001741564366966486, 0.005369290243834257, -0.03738541156053543, 0.029093466699123383, ...
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": "image_type", "annotation": null, "type_comment": null}}], "kwarg"...
def remove_image(self, image_type): if not image_type or image_type == ImageType.none: return False if image_type == ImageType.local and self.options.get('image'): return False log.info("Removing image %s", self.image_name) try: self.client.remove_ima...
1,596
[ 0.007729317061603069, 0.01370345801115036, 0.08778062462806702, -0.007849236018955708, -0.01584019511938095, 0.016897661611437798, -0.02701445482671261, -0.0644945576786995, 0.004837636835873127, -0.009631666354835033, 0.0276249498128891, -0.015447732992470264, 0.03187661990523338, 0.02276...
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 specifies_host_port(self): def has_host_port(binding): _, external_bindings = split_port(binding) # there are no external bindings if external_bindings is None: return False # we only need to check the first binding from the range ...
1,597
[ -0.004261740017682314, 0.006621635053306818, 0.06574490666389465, -0.010130672715604305, -0.015868352726101875, 0.01908273808658123, -0.018954163417220116, -0.06565918773412704, -0.005065336357802153, -0.011893227696418762, 0.03861549124121666, -0.005507314577698708, 0.04461567848920822, 0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "binding", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def has_host_port(binding): _, external_bindings = split_port(binding) # there are no external bindings if external_bindings is None: return False # we only need to check the first binding from the range external_binding = external_bindings[0...
1,598
[ 0.015730084851384163, 0.0043651266023516655, -0.02840123139321804, -0.02021801471710205, -0.00018385723524261266, 0.014356912113726139, 0.0010843040654435754, -0.007664090488106012, -0.04217761754989624, -0.0069607580080628395, 0.02855752781033516, -0.002387701766565442, -0.04284745827317238...
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": "ignore_pull_failures", "annotation": null, "type_comment": null}}...
def pull(self, ignore_pull_failures=False): if 'image' not in self.options: return repo, tag, separator = parse_repository_tag(self.options['image']) tag = tag or 'latest' log.info('Pulling %s (%s%s%s)...' % (self.name, repo, separator, tag)) output = self.client.pul...
1,599
[ 0.03614945337176323, -0.02893366664648056, 0.00831460952758789, -0.007092391140758991, 0.010388854891061783, 0.006822092924267054, -0.05490580201148987, 0.027076834812760353, -0.007051258813589811, 0.014255295507609844, -0.005303134210407734, -0.005056340247392654, 0.07032455503940582, -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 mode(self): containers = self.service.containers() if containers: return 'container:' + containers[0].id log.warn("Service %s is trying to use reuse the network stack " "of another service that is not running." % (self.id)) return None
1,600
[ 0.023087866604328156, 0.04090218245983124, 0.0267107542604208, 0.008628473617136478, -0.05393600091338158, 0.011083032935857773, -0.00113684160169214, 0.0069670905359089375, -0.013687653467059135, 0.03288466855883598, 0.0302050169557333, 0.022852057591080666, 0.03869415074586868, 0.0005473...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "volumes_option", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "container_volumes", "annotation": null, "type_comment":...
def warn_on_masked_volume(volumes_option, container_volumes, service): container_volumes = dict( (volume.internal, volume.external) for volume in container_volumes) for volume in volumes_option: if ( volume.external and volume.internal in container_volumes and ...