query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Creates a new IPsecPolicy.
def create_ipsecpolicy(self, body=None): return self.post(self.ipsecpolicies_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy_create(request, **kwargs):\n body = {'policy': kwargs}\n policy = neutronclient(request).create_qos_policy(body=body).get('policy')\n return QoSPolicy(policy)", "def test_create_ipsecpolicy_with_limited_params(self):\r\n resource = 'ipsecpolicy'\r\n cmd = ipsecpolicy.CreateIPsec...
[ "0.6523855", "0.63184994", "0.60983205", "0.58342034", "0.5829371", "0.5804038", "0.5802355", "0.57480276", "0.56827766", "0.5611309", "0.5586934", "0.55758935", "0.5554747", "0.5554747", "0.55451876", "0.55408686", "0.55269873", "0.5513526", "0.5468993", "0.54595256", "0.534...
0.7491522
0
Deletes the specified IPsecPolicy.
def delete_ipsecpolicy(self, ipsecpolicy): return self.delete(self.ipsecpolicy_path % (ipsecpolicy))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy_delete(request, policy_id):\n neutronclient(request).delete_qos_policy(policy_id)", "def delete_policy(policy_id):\n policy = PolicyService.get_policy_by_id(policy_id)\n if policy is None:\n abort(404)\n\n policy.delete()\n\n return {}", "def delete(self, policy_name):\n ...
[ "0.761043", "0.6945922", "0.67073476", "0.6707107", "0.6587773", "0.65314233", "0.65010214", "0.6463276", "0.6461859", "0.6396434", "0.60502285", "0.60077006", "0.5999948", "0.5989723", "0.5949439", "0.5948413", "0.5943496", "0.5850399", "0.5848674", "0.5848674", "0.5815025",...
0.7415815
1
Fetches a list of all load balancer vips for a tenant.
def list_vips(self, retrieve_all=True, **_params): # Pass filters in "params" argument to do_request return self.list('vips', self.vips_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_loadbalancers(call=None):\n if call == \"action\":\n raise SaltCloudSystemExit(\n \"The avail_images function must be called with \"\n \"-f or --function, or with the --list-loadbalancers option\"\n )\n\n ret = {}\n conn = get_conn()\n datacenter = get_datac...
[ "0.5617398", "0.5593716", "0.55149007", "0.54893655", "0.5479464", "0.54651594", "0.5372961", "0.53601766", "0.5348587", "0.5264206", "0.5247198", "0.5216902", "0.52149767", "0.5203361", "0.51989055", "0.51749426", "0.5169607", "0.5164837", "0.5164028", "0.5156722", "0.515319...
0.66470325
0
Fetches information of a certain load balancer vip.
def show_vip(self, vip, **_params): return self.get(self.vip_path % (vip), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_load_balancer_ip(cluster_config):\n cluster = load_cluster_config_json(cluster_config)\n\n lb_ip = cluster[\"load_balancers\"][0][\"ip\"]\n return lb_ip", "def get(self, request, loadbalancer_id):\n conn = get_sdk_connection(request)\n loadbalancer = conn.load_balancer.find_load_ba...
[ "0.66438174", "0.652625", "0.6481885", "0.6382166", "0.63138247", "0.61080116", "0.6099167", "0.6005084", "0.59748024", "0.5965726", "0.5954159", "0.59242725", "0.5908232", "0.5887846", "0.5850761", "0.5808859", "0.5764781", "0.5755382", "0.56931424", "0.56830674", "0.5626007...
0.6686279
0
Creates a new load balancer vip.
def create_vip(self, body=None): return self.post(self.vips_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_vip(self, context, vip, netinfo):\n LOG.info(_(\"Agent received create_vip\"))\n self.driver.create_vip(vip, netinfo)", "def add_virtualip(self, lb, vip):\n resp, body = self.api.method_post(\"/loadbalancers/%s/virtualips\" % lb.id,\n body=vip.to_dict())\n re...
[ "0.70703477", "0.6925294", "0.677822", "0.6749381", "0.6702949", "0.6603127", "0.6512064", "0.64853495", "0.63139737", "0.6305228", "0.6186546", "0.6184659", "0.6163926", "0.6135965", "0.61169434", "0.6077778", "0.6031967", "0.59520847", "0.5935914", "0.592049", "0.5902803", ...
0.71251917
0
Updates a load balancer vip.
def update_vip(self, vip, body=None): return self.put(self.vip_path % (vip), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_loadbalancer(self, context, lb, old):\n LOG.debug(\"\\nupdate_loadbalancer({}): called\".format(lb.id))\n hostnames = self._get_hostname(lb)\n # Update the TrafficIP group\n vapv = self._get_vapv(hostnames)\n # Update allowed_address_pairs\n if not old or lb.vip...
[ "0.69501674", "0.68709505", "0.660137", "0.6559625", "0.6518858", "0.63838536", "0.6332854", "0.63197947", "0.61692894", "0.5989271", "0.59790754", "0.5976584", "0.59753597", "0.5837428", "0.5828339", "0.5752084", "0.56893516", "0.5664997", "0.56476814", "0.5620249", "0.56126...
0.74929464
0
Deletes the specified load balancer vip.
def delete_vip(self, vip): return self.delete(self.vip_path % (vip))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_virtualip(self, loadbalancer, vip):\n lb = vip.parent\n if not lb:\n raise exc.UnattachedVirtualIP(\"No parent Load Balancer for this \"\n \"VirtualIP could be determined.\")\n resp, body = self.api.method_delete(\"/loadbalancers/%s/virtualips/%s\" %\n ...
[ "0.83227915", "0.7897649", "0.7836446", "0.71675014", "0.7155789", "0.67704123", "0.6738804", "0.6719887", "0.6645137", "0.6587413", "0.648962", "0.64112294", "0.63836735", "0.6236653", "0.6218045", "0.62147665", "0.6185486", "0.6182067", "0.6169506", "0.61605674", "0.6075796...
0.817396
1
Fetches a list of all load balancer pools for a tenant.
def list_pools(self, retrieve_all=True, **_params): # Pass filters in "params" argument to do_request return self.list('pools', self.pools_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_pools(self) -> List[CachingPool]:\n return await self._pool_fetcher.get_pools()", "def getPools(self):\n data = self.connect('get','pools',None)\n return data", "def list_pools_on_lbaas_agent(self, lbaas_agent, **_params):\r\n return self.get((self.agent_path + self.LO...
[ "0.64885235", "0.63832843", "0.6373779", "0.62559193", "0.62125343", "0.60228425", "0.5984435", "0.59661174", "0.5937696", "0.5794994", "0.5790406", "0.56883925", "0.5678287", "0.5643476", "0.5605727", "0.5600341", "0.5594697", "0.5594006", "0.5559764", "0.5546073", "0.552050...
0.6885515
0
Fetches information of a certain load balancer pool.
def show_pool(self, pool, **_params): return self.get(self.pool_path % (pool), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, request, pool_id):\n conn = get_sdk_connection(request)\n pool = conn.load_balancer.find_pool(pool_id)\n pool = _get_sdk_object_dict(pool)\n\n if request.GET.get('includeChildResources'):\n resources = {}\n resources['pool'] = pool\n\n if p...
[ "0.7106879", "0.6871207", "0.6782803", "0.6717103", "0.6549001", "0.6521597", "0.6512605", "0.64808595", "0.64730555", "0.6460818", "0.6423393", "0.63883483", "0.6257994", "0.6255898", "0.62404823", "0.6211178", "0.61900294", "0.6189252", "0.61788994", "0.61485076", "0.612659...
0.7443111
0
Updates a load balancer pool.
def update_pool(self, pool, body=None): return self.put(self.pool_path % (pool), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_pool(self, context, old_pool, pool):\n old_val, new_val = self.get_diff_of_dict(old_pool, pool)\n LOG.info(\"Received request 'Update Pool' for Pool:%(pool)s \"\n \"in LB:%(lb_id)s with new Param:%(new_val)s and \"\n \"old Param:%(old_val)s\",\n ...
[ "0.68706685", "0.6857617", "0.6845245", "0.6766318", "0.6747887", "0.65619475", "0.6480729", "0.63982177", "0.6064409", "0.6002602", "0.5965404", "0.5946069", "0.58925164", "0.5889436", "0.5783237", "0.574946", "0.56865215", "0.5683171", "0.5667662", "0.5654379", "0.5612481",...
0.7689518
0
Retrieves stats for a certain load balancer pool.
def retrieve_pool_stats(self, pool, **_params): return self.get(self.pool_path_stats % (pool), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pool_stats(self, pool):\n svc = self.pool_path % pool\n ret = self.rclient.get(svc)\n if ret.status != restclient.Status.OK:\n exception_msg = (_('Error getting pool stats: '\n 'pool: %(pool)s '\n 'return code: %(re...
[ "0.7811298", "0.71534944", "0.6650154", "0.6583187", "0.6479198", "0.6318627", "0.6265656", "0.62604696", "0.61618876", "0.6066381", "0.5996045", "0.5907003", "0.58319587", "0.5795752", "0.57949924", "0.5728804", "0.5718277", "0.56890684", "0.5630172", "0.5616478", "0.5546755...
0.83906263
0
Fetches a list of all load balancer members for a tenant.
def list_members(self, retrieve_all=True, **_params): # Pass filters in "params" argument to do_request return self.list('members', self.members_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_members(self):\n\n user_migrator = MigrateMemberAuth()\n\n # Make sure we only fetch ID's from the database\n return user_migrator._list_from().only('id')", "def _get_org_members(self):\n url = f\"{BASE_URL}/orgs/{ORG}/members\"\n return self.fetch_all_pages(url, flatt...
[ "0.6391402", "0.6124557", "0.6073281", "0.60686046", "0.60608774", "0.60337555", "0.60250235", "0.59194875", "0.58834416", "0.58087546", "0.574711", "0.5702761", "0.56860137", "0.56655455", "0.56489336", "0.56368655", "0.56167287", "0.56167287", "0.56167287", "0.56167287", "0...
0.6616581
0
Fetches information of a certain load balancer member.
def show_member(self, member, **_params): return self.get(self.member_path % (member), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, request, member_id, pool_id):\n conn = get_sdk_connection(request)\n member = conn.load_balancer.find_member(member_id, pool_id)\n return _get_sdk_object_dict(member)", "async def get_guild_member(guild_id, member_id):\n user_id = await token_check()\n await guild_check(u...
[ "0.75904655", "0.6251855", "0.6246115", "0.62460583", "0.61917824", "0.61822265", "0.6129956", "0.6129956", "0.6072084", "0.5963283", "0.59447235", "0.593797", "0.5892445", "0.58627737", "0.5849817", "0.5792465", "0.5763985", "0.57312113", "0.5646421", "0.5633066", "0.5633066...
0.684679
1
Updates a load balancer member.
def update_member(self, member, body=None): return self.put(self.member_path % (member), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self, request, member_id, pool_id):\n data = request.DATA\n conn = get_sdk_connection(request)\n monitor_address = data.get('monitor_address')\n member = conn.load_balancer.update_member(\n member_id, pool_id, weight=data.get('weight'),\n monitor_address=mo...
[ "0.73988515", "0.7200073", "0.7090033", "0.6488313", "0.6397488", "0.6339667", "0.62624913", "0.61097205", "0.6095201", "0.6090544", "0.60724914", "0.6049983", "0.59969854", "0.5987845", "0.5789719", "0.57263315", "0.5704301", "0.5588402", "0.5576284", "0.55726373", "0.548709...
0.7679598
0
Fetches a list of all load balancer health monitors for a tenant.
def list_health_monitors(self, retrieve_all=True, **_params): # Pass filters in "params" argument to do_request return self.list('health_monitors', self.health_monitors_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, request):\n pool_id = request.GET.get('poolId')\n conn = get_sdk_connection(request)\n health_monitor_list = _sdk_object_to_list(\n conn.load_balancer.health_monitors(\n project_id=request.user.project_id\n )\n )\n\n if pool_id:\...
[ "0.68901986", "0.6361477", "0.6159507", "0.6083955", "0.60717803", "0.57513934", "0.57083917", "0.5637575", "0.5617609", "0.5608417", "0.5604214", "0.54895395", "0.5396915", "0.5329629", "0.5327571", "0.53201497", "0.5307021", "0.5290351", "0.5265495", "0.51811594", "0.516197...
0.7332779
0
Updates a load balancer health monitor.
def update_health_monitor(self, health_monitor, body=None): return self.put(self.health_monitor_path % (health_monitor), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_monitor(request, **kwargs):\n data = request.DATA\n monitor_id = data['monitor']['id']\n hm_type = data['monitor']['type']\n\n conn = get_sdk_connection(request)\n healthmonitor_kwargs = {\n 'delay': data['monitor'].get('delay'),\n 'timeout': data['monitor'].get('timeout'),\...
[ "0.7534068", "0.7220566", "0.7034508", "0.6964282", "0.6887532", "0.68862224", "0.6697243", "0.6198273", "0.61803037", "0.614257", "0.6064578", "0.6044781", "0.6024156", "0.5986242", "0.5931802", "0.5792398", "0.5688219", "0.5687414", "0.56839436", "0.5664143", "0.56462824", ...
0.7613361
0
Associate specified load balancer health monitor and pool.
def associate_health_monitor(self, pool, body): return self.post(self.associate_pool_health_monitors_path % (pool), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_loadbalancer_healthmonitor_create(self, resource_dict):\n pass", "def pre_loadbalancer_healthmonitor_create(self, resource_dict):\n pass", "def create_healthmonitor(self, context, healthmonitor):\n LOG.info(\"Received request 'Create Pool Health Monitor' for\"\n \"...
[ "0.6778952", "0.67355716", "0.648745", "0.641679", "0.6409335", "0.63331187", "0.6244122", "0.624059", "0.621399", "0.61304736", "0.5918235", "0.589895", "0.58703053", "0.5826062", "0.58003503", "0.57517254", "0.574669", "0.5717543", "0.5531685", "0.55174804", "0.55116934", ...
0.8073447
0
Disassociate specified load balancer health monitor and pool.
def disassociate_health_monitor(self, pool, health_monitor): path = (self.disassociate_pool_health_monitors_path % {'pool': pool, 'health_monitor': health_monitor}) return self.delete(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_healthmonitor(self, context, healthmonitor):\n LOG.info(\"Received request 'Delete Pool Health Monitor' for \"\n \"Health monitor:%(hm)s\",\n {'hm': healthmonitor['id']})\n arg_dict = {'context': context,\n lb_const.HEALTHMONITOR: healthmo...
[ "0.6170834", "0.61175746", "0.6076449", "0.59184957", "0.5815427", "0.57858783", "0.57855165", "0.57609636", "0.5755864", "0.57522935", "0.56465745", "0.5572244", "0.54569775", "0.5376652", "0.5369299", "0.5314224", "0.52987087", "0.52365905", "0.5153941", "0.5120014", "0.511...
0.7618305
0
Fetches information of a certain agent.
def show_agent(self, agent, **_params): return self.get(self.agent_path % (agent), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_agent(self, account_id, agent_id, filters=None):\n return self.rest_request.get('accounts/' + str(account_id) +\n '/agents/' + str(agent_id), filters)", "def get_agent(self, agent_id: str) -> Mapping[str, Any]:\n return self.__get_one_by_id(\"agents\", \"...
[ "0.6484612", "0.63000304", "0.62550956", "0.61938536", "0.61057025", "0.6010476", "0.59606665", "0.5949737", "0.5931788", "0.59045815", "0.587425", "0.5830453", "0.5784631", "0.5692295", "0.56844026", "0.56782377", "0.56639445", "0.560746", "0.55718106", "0.5533608", "0.55251...
0.74993396
0
Deletes the specified agent.
def delete_agent(self, agent): return self.delete(self.agent_path % (agent))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, agent_id):\n self._client.delete('scanners/1/agents/%(agent_id)s', path_params={'agent_id': agent_id})\n return True", "def delete(self):\n rest_params = common.get_restful_params(self.request.uri)\n if rest_params is None:\n common.echo_json_response(self,...
[ "0.7904113", "0.77537805", "0.76021314", "0.74562705", "0.7406257", "0.72061086", "0.6470654", "0.6370957", "0.6018436", "0.5851619", "0.58453286", "0.5785872", "0.5759275", "0.5755108", "0.5737678", "0.5718371", "0.56550926", "0.5606634", "0.5464975", "0.53717154", "0.536998...
0.8920055
0
Fetch a network gateway.
def show_network_gateway(self, gateway_id, **_params): return self.get(self.network_gateway_path % gateway_id, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_gateway(self):\n return self.gateway", "async def get_gw(test_cli) -> str:\n gw_resp = await test_cli.get('/api/v6/gateway')\n gw_json = await gw_resp.json\n return gw_json['url']", "def get_network_default_gateway(self):\n return self.mycam.devicemgmt.GetNetworkDefaultGateway()"...
[ "0.7077603", "0.65630823", "0.65052164", "0.64133066", "0.63255405", "0.6192412", "0.61779696", "0.61768025", "0.61318785", "0.61205274", "0.60998017", "0.6086011", "0.60561377", "0.6016003", "0.5989221", "0.5970194", "0.5968634", "0.59273136", "0.5889362", "0.58878154", "0.5...
0.7128359
0
Create a new network gateway.
def create_network_gateway(self, body=None): return self.post(self.network_gateways_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Create(self):\n\n gateway = None\n netmask = None\n\n self._AcquireNetworkDetails()\n\n if self.is_vpc:\n # Create a VPC first\n\n cidr = '10.0.0.0/16'\n vpc = self.cs.create_vpc(self.vpc_name,\n self.zone_id,\n cidr,\n ...
[ "0.8282759", "0.735945", "0.71596324", "0.6880562", "0.6804249", "0.6776266", "0.6756551", "0.6709377", "0.6702008", "0.66921186", "0.6571167", "0.6495602", "0.64863545", "0.6467722", "0.64599526", "0.64504224", "0.6411406", "0.63999265", "0.6377891", "0.63314635", "0.6322438...
0.86117136
0
Update a network gateway.
def update_network_gateway(self, gateway_id, body=None): return self.put(self.network_gateway_path % gateway_id, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self) -> None:\n self._gateway.update()", "def update_gateway_device(self, gateway_device_id, body=None):\r\n return self.put(self.gateway_device_path % gateway_device_id,\r\n body=body)", "def update(self):\n return self._api.update_payment_gateway(**to_d...
[ "0.73716456", "0.661934", "0.6539232", "0.65375525", "0.6341725", "0.62306046", "0.61826205", "0.6149847", "0.60765433", "0.6051", "0.5973867", "0.59261507", "0.59006083", "0.5874266", "0.5866621", "0.5860527", "0.585056", "0.58328515", "0.5832191", "0.5825109", "0.5804609", ...
0.8335931
0
Delete the specified network gateway.
def delete_network_gateway(self, gateway_id): return self.delete(self.network_gateway_path % gateway_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_gateway_device(self, gateway_device_id):\r\n return self.delete(self.gateway_device_path % gateway_device_id)", "def delete_nat_gateway(ec2_client=None, module=None, nat_gateway=None):\n nat_gateway_address = nat_gateway.get('NatGatewayAddresses')[0]\n nat_gateway_id = nat_gateway['NatGat...
[ "0.74179", "0.7397583", "0.7236924", "0.7101013", "0.6979045", "0.6832819", "0.66104114", "0.64691854", "0.6339585", "0.63345855", "0.62928927", "0.62730354", "0.62596416", "0.6257655", "0.6179543", "0.6134833", "0.61258703", "0.6033291", "0.60238856", "0.6016785", "0.5993671...
0.86855984
0
Connect a network gateway to the specified network.
def connect_network_gateway(self, gateway_id, body=None): base_uri = self.network_gateway_path % gateway_id return self.put("%s/connect_network" % base_uri, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ConnectNetwork(self, network_name, group_name, mode, link,\n vlan=\"\", dry_run=False, reason=None):\n body = {\n \"group_name\": group_name,\n \"network_mode\": mode,\n \"network_link\": link,\n \"network_vlan\": vlan,\n }\n\n query = []\n _AppendDryRunIf(...
[ "0.71485025", "0.71401685", "0.6828193", "0.64658195", "0.6440116", "0.63980526", "0.63615894", "0.6331955", "0.6327372", "0.6321787", "0.63109803", "0.6249003", "0.6223708", "0.61937", "0.6121953", "0.6100455", "0.60495764", "0.5982616", "0.59816384", "0.5966832", "0.5956214...
0.8106213
0
Disconnect a network from the specified gateway.
def disconnect_network_gateway(self, gateway_id, body=None): base_uri = self.network_gateway_path % gateway_id return self.put("%s/disconnect_network" % base_uri, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_network_gateway(self, gateway_id):\r\n return self.delete(self.network_gateway_path % gateway_id)", "def DisconnectWireless(self):\n self.SetForcedDisconnect(True)\n self.wifi.Disconnect()", "def remove_gateway(self, network_ref):\n raise NotImplementedError()", "def do...
[ "0.7099296", "0.6354061", "0.633697", "0.6201671", "0.61283344", "0.6002237", "0.5930887", "0.57622766", "0.56524765", "0.5643636", "0.5637644", "0.55920553", "0.55915636", "0.5495355", "0.5494552", "0.5468569", "0.54578805", "0.54431415", "0.54333377", "0.541832", "0.5407983...
0.84754086
0
Fetch a gateway device.
def show_gateway_device(self, gateway_device_id, **_params): return self.get(self.gateway_device_path % gateway_device_id, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device(self):\n return self.broker.device(**{\"DeviceRouteID\": self.DeviceRouteID})", "def get_device(self, dev_id):\n return self.api_request('GET', self.url + '/device/' + str(dev_id), {})", "def get_device(self, device):\n\t\tself.ise.headers.update({'Accept': 'application/vnd.com.cisco.i...
[ "0.64669836", "0.63796175", "0.624815", "0.62402916", "0.6227601", "0.6223333", "0.6223333", "0.6223333", "0.6223333", "0.60732704", "0.5993849", "0.5948876", "0.5947603", "0.58807874", "0.58714783", "0.5867177", "0.5859333", "0.5844973", "0.5844973", "0.58263415", "0.5808297...
0.689964
0
Create a new gateway device.
def create_gateway_device(self, body=None): return self.post(self.gateway_devices_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_network_gateway(self, body=None):\r\n return self.post(self.network_gateways_path, body=body)", "def test_gwservice_createdevice(self, setup_controller):\n configuration = {'uuid': '1'}\n payload = {'serialNumber': 'DEADBEEF0011',\n 'UUID': '123456',\n ...
[ "0.6836808", "0.67288667", "0.6622431", "0.6516142", "0.6516142", "0.6478883", "0.64679116", "0.6254829", "0.6207394", "0.61746645", "0.61678076", "0.6118375", "0.6097656", "0.60154575", "0.5961961", "0.59553105", "0.58612436", "0.5842456", "0.58021945", "0.57906455", "0.5778...
0.8448245
0
Updates a new gateway device.
def update_gateway_device(self, gateway_device_id, body=None): return self.put(self.gateway_device_path % gateway_device_id, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self) -> None:\n self._gateway.update()", "def update(self):\n self.device = self._api.device_query(self._hardware_address, {})", "def update_device(self, device: Device) -> None:\n self._devices[device.name] = device", "def update(self):\n try:\n self._devic...
[ "0.69497615", "0.65185535", "0.64119345", "0.6394917", "0.639221", "0.6377932", "0.6322422", "0.63127756", "0.62251025", "0.6208143", "0.6164233", "0.6164233", "0.61302495", "0.61273617", "0.61150837", "0.60159", "0.5983123", "0.59802514", "0.5960421", "0.5892624", "0.5892624...
0.77028626
0
Delete the specified gateway device.
def delete_gateway_device(self, gateway_device_id): return self.delete(self.gateway_device_path % gateway_device_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_network_gateway(self, gateway_id):\r\n return self.delete(self.network_gateway_path % gateway_id)", "def delete_device(device_id):\n netAdminToolDB = app.config['DATABASE']\n device = netAdminToolDB.get_device(device_id)\n\n if device == None:\n return jsonify({'error': 'Device_...
[ "0.73596257", "0.70437884", "0.70126605", "0.69349265", "0.6878977", "0.68403476", "0.67639136", "0.6751011", "0.67302734", "0.6588201", "0.64607847", "0.62781656", "0.6269225", "0.6235544", "0.6220198", "0.6181021", "0.6181021", "0.60968906", "0.5993642", "0.59863865", "0.59...
0.8634534
0
Fetches a list of dhcp agents hosting a network.
def list_dhcp_agent_hosting_networks(self, network, **_params): return self.get((self.network_path + self.DHCP_AGENTS) % network, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_dhcp_agent_hosting_network(self):\n self.admin_networks_client.list_dhcp_agents_on_hosting_network(\n self.network['id'])", "def test_list_networks_hosted_by_one_dhcp(self):\n body = self.admin_networks_client.list_dhcp_agents_on_hosting_network(\n self.network['...
[ "0.7808694", "0.7578811", "0.71674603", "0.69997406", "0.67217845", "0.65720654", "0.64308", "0.6159891", "0.58248585", "0.5748065", "0.57080424", "0.5690139", "0.56564534", "0.56515914", "0.56087554", "0.5607984", "0.55518776", "0.55417496", "0.55108505", "0.549798", "0.5483...
0.82947797
0
Adds a network to dhcp agent.
def add_network_to_dhcp_agent(self, dhcp_agent, body=None): return self.post((self.agent_path + self.DHCP_NETS) % dhcp_agent, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dhcp_agent_network_add(self, dhcp_net_info):\n self.turn_on_dhcp_check()", "def network_create_end(self, payload):\n network_id = payload['network']['id']\n self.enable_dhcp_helper(network_id)", "def add_network(self, network, distance):\n self.networks[network] = distance", "...
[ "0.7993567", "0.69905144", "0.695304", "0.6948659", "0.69300616", "0.6838031", "0.6834063", "0.656378", "0.65624505", "0.65344405", "0.63545275", "0.6264123", "0.6201176", "0.61982304", "0.6183074", "0.6177877", "0.6031145", "0.5987884", "0.5983296", "0.596687", "0.59634006",...
0.79406667
1
Remove a network from dhcp agent.
def remove_network_from_dhcp_agent(self, dhcp_agent, network_id): return self.delete((self.agent_path + self.DHCP_NETS + "/%s") % ( dhcp_agent, network_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dhcp_agent_network_remove(self, dhcp_net_info):\n self.turn_on_dhcp_check()", "def test_delete_network_from_dhcp_agent(self):\n network_id = self._create_and_prepare_network_for_agent(\n self.agent['id'])\n self.agents_client.add_dhcp_agent_to_network(\n self.agent[...
[ "0.81059325", "0.7416146", "0.7311771", "0.71699446", "0.70607364", "0.69897085", "0.67913854", "0.6775231", "0.67347074", "0.6649926", "0.6647897", "0.65776294", "0.6455701", "0.6360901", "0.6351416", "0.63387024", "0.6319579", "0.63093585", "0.62985367", "0.62240994", "0.61...
0.81989366
0
Fetches a list of L3 agents hosting a router.
def list_l3_agent_hosting_routers(self, router, **_params): return self.get((self.router_path + self.L3_AGENTS) % router, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_l3_agents_on_router(self):\n with self.override_role():\n # NOTE: It is not empty list since it's a special case where\n # policy.enforce is called from the controller.\n self.ntp_client.list_l3_agents_hosting_router(self.router['id'])", "def router_list_on_l...
[ "0.7668786", "0.7257907", "0.71452254", "0.6604342", "0.6339175", "0.62582594", "0.62342864", "0.6228603", "0.62164915", "0.6151718", "0.61158353", "0.59450513", "0.5939779", "0.5933268", "0.5877356", "0.5837007", "0.57619286", "0.5721032", "0.56838113", "0.5661482", "0.56472...
0.82901573
0
Adds a router to L3 agent.
def add_router_to_l3_agent(self, l3_agent, body): return self.post((self.agent_path + self.L3_ROUTERS) % l3_agent, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_gateway_router(self, router, body=None):\r\n return self.put((self.router_path % router),\r\n body={'router': {'external_gateway_info': body}})", "def add_router(self):\n router = OrderedDict({self.router_name: {\n 'type': 'OS::Neutron::Router',\n ...
[ "0.734532", "0.7196997", "0.68207264", "0.6697992", "0.65954566", "0.65714985", "0.6471647", "0.6417413", "0.627794", "0.61565644", "0.61321044", "0.6088554", "0.59852374", "0.59830207", "0.5965617", "0.5859502", "0.5854467", "0.5829519", "0.58202237", "0.5806709", "0.579449"...
0.86837584
0
Fetches a list of all firewall rules for a tenant.
def list_firewall_rules(self, retrieve_all=True, **_params): # Pass filters in "params" argument to do_request return self.list('firewall_rules', self.firewall_rules_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_firewall_rules(self, server):\n server_uuid, server_instance = uuid_and_instance(server)\n\n url = f'/server/{server_uuid}/firewall_rule'\n res = self.api.get_request(url)\n\n return [\n FirewallRule(server=server_instance, **firewall_rule)\n for firewall_r...
[ "0.6232312", "0.6231069", "0.61562014", "0.58896816", "0.58752656", "0.5728168", "0.5700419", "0.5683381", "0.56574285", "0.55847776", "0.55532306", "0.5510661", "0.5491232", "0.54786634", "0.53851366", "0.53546613", "0.5225483", "0.5210484", "0.5197971", "0.51920617", "0.518...
0.702476
0
Fetches information of a certain firewall rule.
def show_firewall_rule(self, firewall_rule, **_params): return self.get(self.firewall_rule_path % (firewall_rule), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_rule(self, rule):\n for kbrule in self.rules:\n if rule == kbrule:\n return kbrule", "def _get_rule(self, rule):\n for kbrule in self.rules:\n if rule == kbrule:\n return kbrule", "def _get_rule(self, rule):\n for kbrule in self....
[ "0.66064155", "0.66064155", "0.66064155", "0.6383028", "0.63234866", "0.62817323", "0.6250253", "0.6178156", "0.6120374", "0.61120397", "0.607358", "0.60636246", "0.60278934", "0.5957132", "0.5920766", "0.5900916", "0.58918655", "0.58585995", "0.58002335", "0.5760116", "0.576...
0.75909406
0
Creates a new firewall rule.
def create_firewall_rule(self, body=None): return self.post(self.firewall_rules_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_firewall_rule(self, server, firewall_rule_body):\n server_uuid, server_instance = uuid_and_instance(server)\n\n url = f'/server/{server_uuid}/firewall_rule'\n body = {'firewall_rule': firewall_rule_body}\n res = self.api.post_request(url, body)\n\n return FirewallRule(...
[ "0.75746644", "0.73016423", "0.72972524", "0.7051592", "0.67895025", "0.6624186", "0.6598076", "0.65394807", "0.6520667", "0.6457384", "0.6382312", "0.63332236", "0.6333125", "0.6326056", "0.62172323", "0.6191648", "0.6160085", "0.615451", "0.61526835", "0.6136764", "0.607252...
0.8462622
0
Updates a firewall rule.
def update_firewall_rule(self, firewall_rule, body=None): return self.put(self.firewall_rule_path % (firewall_rule), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_firewall_rule(self):\r\n resource = 'firewall_rule'\r\n cmd = firewallrule.UpdateFirewallRule(test_cli20.MyApp(sys.stdout),\r\n None)\r\n self._test_update_resource(resource, cmd, 'myid',\r\n ['myid'...
[ "0.7676399", "0.7126098", "0.69864595", "0.6753691", "0.67512226", "0.66830754", "0.6529023", "0.65162325", "0.64459217", "0.6367014", "0.63591367", "0.63147587", "0.6300518", "0.62627393", "0.62527394", "0.6206311", "0.6127455", "0.6119819", "0.61131346", "0.6089892", "0.602...
0.8285445
0
Deletes the specified firewall rule.
def delete_firewall_rule(self, firewall_rule): return self.delete(self.firewall_rule_path % (firewall_rule))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_firewall_rule(self, server_uuid, firewall_rule_position):\n url = f'/server/{server_uuid}/firewall_rule/{firewall_rule_position}'\n return self.api.delete_request(url)", "def cloudflare_waf_firewall_rule_delete_request(self, rule_id: str, zone_id: str) -> Dict[str, Any]:\n return ...
[ "0.7865063", "0.75619334", "0.7403397", "0.7344586", "0.7260129", "0.70308244", "0.7010474", "0.68722457", "0.6847275", "0.68452483", "0.6841127", "0.6821352", "0.67873496", "0.6773156", "0.6763249", "0.6729523", "0.6712253", "0.6708854", "0.66834664", "0.6621239", "0.6598687...
0.8690892
0
Fetches a list of all firewall policies for a tenant.
def list_firewall_policies(self, retrieve_all=True, **_params): # Pass filters in "params" argument to do_request return self.list('firewall_policies', self.firewall_policies_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_policies(self):\n client = self.connect(VAULT_TOKEN)\n return client.list_policies()", "def list_policies(self):\n return self.con.list_policies(\n Scope='Local'\n )", "def ListPolicies(self, request, global_params=None):\n config = self.GetMethodConfig('Lis...
[ "0.6369753", "0.5877332", "0.56792355", "0.5663501", "0.55814", "0.5498755", "0.54811", "0.54676265", "0.5452789", "0.54221016", "0.53502595", "0.53350145", "0.5325583", "0.5253421", "0.5231644", "0.52054423", "0.5202875", "0.5132389", "0.50926423", "0.5080169", "0.50724727",...
0.6845963
0
Fetches information of a certain firewall policy.
def show_firewall_policy(self, firewall_policy, **_params): return self.get(self.firewall_policy_path % (firewall_policy), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_policy(client, policy_name):\n response = client.describe_firewall_policy(\n FirewallPolicyName=policy_name,\n )\n return response", "def read(self, policy_name):\n path = self.vault.normalize(\"/sys/policies/acl/\" + policy_name)\n address = self.vault.vault_adress + \"/v1\" + path\n...
[ "0.75920844", "0.6699691", "0.66329557", "0.6356902", "0.6346933", "0.6233168", "0.620738", "0.620738", "0.620738", "0.6192408", "0.6159254", "0.6159254", "0.6159254", "0.6134643", "0.60909563", "0.6058809", "0.6058809", "0.6014234", "0.6014234", "0.6004263", "0.5964909", "...
0.7842972
0
Creates a new firewall policy.
def create_firewall_policy(self, body=None): return self.post(self.firewall_policies_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Create(self,\n firewall_policy=None,\n parent_id=None,\n batch_mode=False,\n only_generate_request=False):\n\n if batch_mode:\n requests = [self._MakeCreateRequestTuple(firewall_policy, parent_id)]\n if not only_generate_request:\n return self...
[ "0.7127725", "0.6759481", "0.6576294", "0.64439803", "0.63746595", "0.6240316", "0.6238295", "0.6177763", "0.61514884", "0.61499244", "0.6108789", "0.60220695", "0.6016407", "0.601616", "0.60010135", "0.5972228", "0.5951646", "0.5945979", "0.58931273", "0.5854514", "0.583967"...
0.835379
0
Updates a firewall policy.
def update_firewall_policy(self, firewall_policy, body=None): return self.put(self.firewall_policy_path % (firewall_policy), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Update(self,\n fp_id=None,\n only_generate_request=False,\n firewall_policy=None,\n batch_mode=False):\n\n if batch_mode:\n requests = [\n self._MakeUpdateRequestTuple(\n fp_id=fp_id, firewall_policy=firewall_policy)\n ]\n ...
[ "0.77502215", "0.7484777", "0.73084265", "0.71117526", "0.6945951", "0.67466795", "0.6641654", "0.6378163", "0.62731165", "0.6264349", "0.61965215", "0.6191666", "0.61300886", "0.6126616", "0.6038952", "0.6031837", "0.60005814", "0.5951066", "0.5923457", "0.5921816", "0.59033...
0.8141987
0
Deletes the specified firewall policy.
def delete_firewall_policy(self, firewall_policy): return self.delete(self.firewall_policy_path % (firewall_policy))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Delete(self, fp_id=None, batch_mode=False, only_generate_request=False):\n\n if batch_mode:\n requests = [self._MakeDeleteRequestTuple(fp_id=fp_id)]\n if not only_generate_request:\n return self._compute_client.MakeRequests(requests)\n return requests\n\n op_res = self._service.Dele...
[ "0.7437354", "0.73796976", "0.69442236", "0.6904816", "0.68614036", "0.6812244", "0.67235583", "0.65640336", "0.6510478", "0.6499342", "0.6492141", "0.6300546", "0.62801087", "0.6122406", "0.5986225", "0.59847015", "0.5982568", "0.5902126", "0.5881453", "0.58646894", "0.58125...
0.8475224
0
Inserts specified rule into firewall policy.
def firewall_policy_insert_rule(self, firewall_policy, body=None): return self.put(self.firewall_policy_insert_path % (firewall_policy), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_rule(self, rule):\n \n self.rules.append(rule)", "def insert(self, rule, ident=None):\n if ident is None:\n self.rules.append(rule)\n else:\n self.rules.insert(ident, rule)", "def add_rule(self, rule):\n self.rule.append(rule)", "def add_rule(s...
[ "0.74442726", "0.74174887", "0.72671765", "0.7232407", "0.7228418", "0.7160213", "0.7102518", "0.70741", "0.7025056", "0.7023518", "0.69237626", "0.6915233", "0.686694", "0.67392105", "0.6585327", "0.65667284", "0.6563158", "0.6464058", "0.6449564", "0.6287459", "0.6277808", ...
0.81768304
0
Removes specified rule from firewall policy.
def firewall_policy_remove_rule(self, firewall_policy, body=None): return self.put(self.firewall_policy_remove_path % (firewall_policy), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_firewall_rule(self, firewall_rule):\r\n return self.delete(self.firewall_rule_path % (firewall_rule))", "def remove_policy(self, sec, ptype, rule):\n line = self.convert_to_item(ptype, rule)\n\n _id = line['id']['S']\n\n self.dynamodb.delete_item(\n Key={\n ...
[ "0.77855355", "0.7329481", "0.71321225", "0.69293594", "0.6861332", "0.68613195", "0.6839967", "0.68148744", "0.6789386", "0.6733025", "0.67243755", "0.67061925", "0.6678299", "0.66566837", "0.6602159", "0.65895474", "0.65440726", "0.6460611", "0.64314723", "0.64075226", "0.6...
0.8063575
0
Fetches information of a certain firewall.
def show_firewall(self, firewall, **_params): return self.get(self.firewall_path % (firewall), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_firewall(client, firewall_name):\n response = client.describe_firewall(\n FirewallName=firewall_name,\n )\n return response", "def show_firewall_rule(self, firewall_rule, **_params):\r\n return self.get(self.firewall_rule_path % (firewall_rule),\r\n params=_params)", ...
[ "0.7587161", "0.62764543", "0.6244351", "0.58603615", "0.58502734", "0.56528944", "0.5448396", "0.54362357", "0.53930527", "0.5256758", "0.5219113", "0.51706636", "0.51443547", "0.5079199", "0.50502574", "0.4981944", "0.4909233", "0.48432657", "0.48150116", "0.47847328", "0.4...
0.802783
0
Creates a new firewall.
def create_firewall(self, body=None): return self.post(self.firewalls_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_firewall(context):\n return [{\n 'type': 'templates/firewall.py',\n 'name': 'fc-firewall',\n 'properties': {\n 'projectId':\n '$(ref.fc-project.projectId)',\n 'network':\n '$(ref.fc-network.selfLink)',\n 'dependsOn':\n '$(ref.fc-network.resourceNames)',\n ...
[ "0.69996005", "0.6987328", "0.6905342", "0.6708049", "0.66985524", "0.6572095", "0.6032799", "0.59174097", "0.58864784", "0.57559496", "0.5744627", "0.5549965", "0.5435781", "0.5376397", "0.5296857", "0.5275886", "0.5272854", "0.525992", "0.5238594", "0.52326596", "0.5226379"...
0.84064144
0
Deletes the specified firewall.
def delete_firewall(self, firewall): return self.delete(self.firewall_path % (firewall))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_firewall_rule(self, firewall_rule):\r\n return self.delete(self.firewall_rule_path % (firewall_rule))", "def delete_firewall_policy(self, firewall_policy):\r\n return self.delete(self.firewall_policy_path % (firewall_policy))", "def delete_firewall_rule(self, server_uuid, firewall_rule...
[ "0.6898676", "0.64936376", "0.6319546", "0.59047914", "0.58547926", "0.5721806", "0.56004256", "0.5584247", "0.55730397", "0.55495495", "0.5423727", "0.5345709", "0.525416", "0.5244898", "0.5219103", "0.5215542", "0.5201969", "0.51794297", "0.5145191", "0.5130948", "0.5072114...
0.88908124
0
Remove a router from l3 agent.
def remove_router_from_l3_agent(self, l3_agent, router_id): return self.delete((self.agent_path + self.L3_ROUTERS + "/%s") % ( l3_agent, router_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_router_from_l3_agent(self):\n self.agents_client.create_router_on_l3_agent(\n self.agent['id'], router_id=self.router['id'])\n self.addCleanup(\n test_utils.call_and_ignore_notfound_exc,\n self.agents_client.delete_router_from_l3_agent,\n se...
[ "0.7786139", "0.777706", "0.71951383", "0.6692688", "0.664114", "0.6546304", "0.6483943", "0.6482314", "0.6398428", "0.6340283", "0.6256002", "0.623186", "0.6205545", "0.61974275", "0.6168839", "0.60581374", "0.58679247", "0.58651936", "0.5855954", "0.58352876", "0.5760015", ...
0.8547501
0
Fetches a loadbalancer agent hosting a pool.
def get_lbaas_agent_hosting_pool(self, pool, **_params): return self.get((self.pool_path + self.LOADBALANCER_AGENT) % pool, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_agent_pool(agent_pool_name: Optional[str] = None,\n kubernetes_cluster_name: Optional[str] = None,\n resource_group_name: Optional[str] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAgentPoolResult:\n __args__ = dict()\n __...
[ "0.6822763", "0.63551646", "0.6132398", "0.5843235", "0.57483953", "0.5659386", "0.5508824", "0.5492956", "0.5453422", "0.5433909", "0.5364477", "0.53580743", "0.5341485", "0.53034294", "0.5272875", "0.52552325", "0.5241654", "0.523493", "0.52341044", "0.5223258", "0.52208894...
0.80421126
0
Fetches a list of pools hosted by the loadbalancer agent.
def list_pools_on_lbaas_agent(self, lbaas_agent, **_params): return self.get((self.agent_path + self.LOADBALANCER_POOLS) % lbaas_agent, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPools(self):\n data = self.connect('get','pools',None)\n return data", "async def get_pools(self) -> List[CachingPool]:\n return await self._pool_fetcher.get_pools()", "def pools(self) -> List[CachingPool]:\n return self._pool_fetcher.pools", "def list_pools(self, retrieve_...
[ "0.7458122", "0.734829", "0.7194336", "0.7013317", "0.69429797", "0.68600583", "0.68326235", "0.6807121", "0.6746081", "0.66606236", "0.66272414", "0.6563584", "0.6472164", "0.64286816", "0.63685405", "0.6313028", "0.6151671", "0.6101827", "0.608971", "0.6061556", "0.60079795...
0.79365355
0
Fetch a list of all credentials for a tenant.
def list_credentials(self, **_params): return self.get(self.credentials_path, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_credentials():\n session = db.get_session()\n return (session.query(network_models_v2.Credential).all())", "def list_credentials(user):\n return Credentials.list_credentials(user)", "def get_tenants():\n # these are the tenant_id strings configured for the service -\n tenants_strings...
[ "0.7408005", "0.6807436", "0.6548845", "0.6349993", "0.6349993", "0.6349993", "0.6300897", "0.62632185", "0.62337697", "0.6205891", "0.61948234", "0.61883175", "0.61883175", "0.6169535", "0.6119927", "0.6083075", "0.59551257", "0.5942657", "0.58955693", "0.58475935", "0.58452...
0.7127034
1
Create a new credential.
def create_credential(self, body=None): return self.post(self.credentials_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_credential(account,userName,password):\n new_credential = Credentials(account,userName,password)\n return new_credential", "def m_credential_create(node_name, credential_hash, participantDID):\n pass", "def make_instance(self, include_optional):\n # model = openapi_client.models....
[ "0.82129794", "0.71526945", "0.6765534", "0.67013925", "0.6690681", "0.6671148", "0.6534608", "0.6408601", "0.63128364", "0.62566274", "0.6237215", "0.6199901", "0.6177472", "0.6149115", "0.6122608", "0.6107753", "0.60892326", "0.6071949", "0.6031311", "0.60056144", "0.598287...
0.786629
1
Delete the specified credential.
def delete_credential(self, credential): return self.delete(self.credential_path % (credential))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_credential(credentials):\n credentials.delete_credentials()", "def delete_credential(self):\n Credentials.credentials_list.remove(self)", "def delete_credential(self):\n\n Credential.credential_list.remove(self)", "def delete_credential(self):\n Credential.credential_list.r...
[ "0.83345723", "0.78936267", "0.7870029", "0.7769463", "0.7743528", "0.76626366", "0.7516849", "0.74108857", "0.7403175", "0.71771854", "0.71771854", "0.71771854", "0.7061404", "0.6968268", "0.69647276", "0.69591576", "0.67291147", "0.6704603", "0.65337545", "0.64367586", "0.6...
0.8819896
0
Fetch a list of all network profiles for a tenant.
def list_network_profiles(self, **params): return self.get(self.network_profiles_path, params=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_profiles(self, params):\n return self.profiles", "def fetch_all(profile):\n params = {}\n params[\"profile\"] = profile\n response = utils.do_request(instanceprofile, \"get\", params)\n data = utils.get_data(\"InstanceProfiles\", response)\n return data", "def GetAllProfiles(self...
[ "0.6795108", "0.6778038", "0.6731372", "0.6688756", "0.6614129", "0.66025275", "0.65353435", "0.6218279", "0.6108761", "0.6066531", "0.6055497", "0.6022031", "0.5943921", "0.5920367", "0.5908565", "0.5905929", "0.5905929", "0.57345873", "0.56705946", "0.5632675", "0.5630586",...
0.7375674
0
Fetch a network profile.
def show_network_profile(self, profile, **params): return self.get(self.network_profile_path % (profile), params=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile(self):\n endpoint = '/profile'\n return self.get_request(endpoint)", "def getProfile(self, profile):\n for network in self.networks:\n if network.getProfileName() == profile:\n return network\n else:\n raise Exception('Network with ...
[ "0.7564368", "0.746909", "0.7128708", "0.70291847", "0.68386704", "0.68386704", "0.6765802", "0.67434824", "0.6661508", "0.6641882", "0.64806426", "0.6458895", "0.6448768", "0.6383853", "0.6378429", "0.63658094", "0.63539726", "0.6344743", "0.63307583", "0.63242495", "0.63107...
0.77783895
0
Create a network profile.
def create_network_profile(self, body=None): return self.post(self.network_profiles_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_network_profile(projectArn=None, name=None, description=None, type=None, uplinkBandwidthBits=None, downlinkBandwidthBits=None, uplinkDelayMs=None, downlinkDelayMs=None, uplinkJitterMs=None, downlinkJitterMs=None, uplinkLossPercent=None, downlinkLossPercent=None):\n pass", "def createProfile(self):\...
[ "0.7556703", "0.72365105", "0.68905246", "0.6554721", "0.650793", "0.64945596", "0.6455163", "0.64482087", "0.63874567", "0.63485795", "0.63088846", "0.6287079", "0.62742215", "0.6247466", "0.6243951", "0.623538", "0.6213833", "0.6198993", "0.619535", "0.6186585", "0.61607736...
0.8449724
0
Update a network profile.
def update_network_profile(self, profile, body=None): return self.put(self.network_profile_path % (profile), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_network_profile(arn=None, name=None, description=None, type=None, uplinkBandwidthBits=None, downlinkBandwidthBits=None, uplinkDelayMs=None, downlinkDelayMs=None, uplinkJitterMs=None, downlinkJitterMs=None, uplinkLossPercent=None, downlinkLossPercent=None):\n pass", "def update(self, profile: Dict[d...
[ "0.76141626", "0.7451812", "0.69024754", "0.68228656", "0.66997266", "0.6656515", "0.66172934", "0.6465898", "0.6317081", "0.6289909", "0.61952424", "0.610687", "0.60899025", "0.606742", "0.597912", "0.5957542", "0.59494334", "0.5936277", "0.59313524", "0.59103763", "0.590144...
0.8979735
0
Delete the network profile.
def delete_network_profile(self, profile): return self.delete(self.network_profile_path % profile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_network_profile(arn=None):\n pass", "def test_delete_profile(self):\n self.cim.delete_profile(customer_profile_id=u\"123\")", "def DeleteWiredNetworkProfile(self, profilename):\n profilename = misc.to_unicode(profilename)\n print \"Deleting wired profile for \" + str(profilen...
[ "0.84156525", "0.74447817", "0.72688985", "0.7117286", "0.70243156", "0.6956503", "0.6906419", "0.6875007", "0.68728507", "0.68238163", "0.67722034", "0.6724106", "0.6704582", "0.670159", "0.66890985", "0.6682457", "0.66775584", "0.66704357", "0.65861684", "0.65540975", "0.65...
0.90215075
0
Update a policy profile.
def update_policy_profile(self, profile, body=None): return self.put(self.policy_profile_path % (profile), body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_policy(self, *args, **kwargs):\r\n pass", "def update(self, profile: Dict[datetime.time, float]) -> None:\n\n if self._profile is None:\n self._profile = profile\n else:\n self._profile.update(profile)", "def update_policy(self):\n pass", "def upda...
[ "0.75090593", "0.7367581", "0.72250706", "0.6973589", "0.68901694", "0.67963797", "0.6726454", "0.6695949", "0.6664862", "0.64785635", "0.64703935", "0.6433767", "0.6402601", "0.63865376", "0.63848585", "0.6275494", "0.6220236", "0.61943", "0.618253", "0.6181913", "0.61352074...
0.8853719
0
Creates a metering label.
def create_metering_label(self, body=None): return self.post(self.metering_labels_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_metering_label(self):\r\n resource = 'metering_label'\r\n cmd = metering.CreateMeteringLabel(\r\n test_cli20.MyApp(sys.stdout), None)\r\n name = 'my label'\r\n myid = 'myid'\r\n description = 'my description'\r\n args = [name, '--description', de...
[ "0.79385513", "0.69731164", "0.6796265", "0.6574569", "0.6507201", "0.64291316", "0.63145757", "0.61448723", "0.607408", "0.59968865", "0.59874487", "0.5945679", "0.5923062", "0.59200543", "0.58582246", "0.576239", "0.5743417", "0.57324505", "0.57050675", "0.5694959", "0.5686...
0.7930899
1
Deletes the specified metering label.
def delete_metering_label(self, label): return self.delete(self.metering_label_path % (label))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_metering_label(self):\r\n resource = 'metering_label'\r\n cmd = metering.DeleteMeteringLabel(\r\n test_cli20.MyApp(sys.stdout), None)\r\n myid = 'myid'\r\n args = [myid]\r\n self._test_delete_resource(resource, cmd, myid, args)", "def delete_metering_...
[ "0.8053136", "0.7480608", "0.6949647", "0.68498945", "0.64869463", "0.6456922", "0.6299056", "0.6226198", "0.6221507", "0.61977166", "0.6192721", "0.61167806", "0.6057763", "0.59570384", "0.595597", "0.59176546", "0.5915135", "0.5912779", "0.58964753", "0.5878231", "0.5839052...
0.9023373
0
Fetches a list of all metering labels for a tenant.
def list_metering_labels(self, retrieve_all=True, **_params): return self.list('metering_labels', self.metering_labels_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(self):\n return get_labels(self.api_key)", "def get_labels():\n\n logging.info(\"Getting metadata about labels\")\n\n labels = []\n\n if len(args.labels) == 0:\n logging.warning(\"No labels specified, assuming all labels. If you have a lot of labels in your inbox you could h...
[ "0.6457788", "0.6242445", "0.6082684", "0.59228736", "0.59053916", "0.58714134", "0.5795048", "0.5738527", "0.56544113", "0.5619567", "0.5604264", "0.5585014", "0.55731374", "0.5507561", "0.5451812", "0.544326", "0.5435576", "0.5429042", "0.5415038", "0.54110825", "0.53918517...
0.7327838
0
Fetches information of a certain metering label.
def show_metering_label(self, metering_label, **_params): return self.get(self.metering_label_path % (metering_label), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meter(self, name):\n if name not in self.meters:\n return None\n return self.meters[name]", "def _get_meter(self, meter_name):\n meter = self.METRIC_MAP.get(meter_name)\n if meter is None:\n raise exception.MetricNotAvailable(metric=meter_name)\n r...
[ "0.6109366", "0.60958403", "0.6088569", "0.597872", "0.5956597", "0.5829163", "0.56682867", "0.56606156", "0.56462276", "0.55531365", "0.5501862", "0.54974216", "0.54537135", "0.5451163", "0.5431368", "0.5431368", "0.54304945", "0.53986526", "0.53809875", "0.53541225", "0.532...
0.73447627
0
Creates a metering label rule.
def create_metering_label_rule(self, body=None): return self.post(self.metering_label_rules_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_metering_label(self, body=None):\r\n return self.post(self.metering_labels_path, body=body)", "def test_create_metering_label(self):\r\n resource = 'metering_label'\r\n cmd = metering.CreateMeteringLabel(\r\n test_cli20.MyApp(sys.stdout), None)\r\n name = 'my lab...
[ "0.6513352", "0.6434864", "0.6325153", "0.58857507", "0.56241167", "0.55774724", "0.55774724", "0.5566286", "0.54233354", "0.5421766", "0.53225523", "0.53225523", "0.52733827", "0.52690357", "0.5225439", "0.51690835", "0.51054645", "0.5063008", "0.50395566", "0.503811", "0.50...
0.82270217
0
Deletes the specified metering label rule.
def delete_metering_label_rule(self, rule): return self.delete(self.metering_label_rule_path % (rule))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_metering_label(self, label):\r\n return self.delete(self.metering_label_path % (label))", "def test_delete_metering_label(self):\r\n resource = 'metering_label'\r\n cmd = metering.DeleteMeteringLabel(\r\n test_cli20.MyApp(sys.stdout), None)\r\n myid = 'myid'\r\n ...
[ "0.7421562", "0.6761197", "0.66971546", "0.64418876", "0.63509923", "0.63017774", "0.61208904", "0.60836786", "0.60674757", "0.60439885", "0.58794063", "0.58783823", "0.58492035", "0.5841357", "0.5773799", "0.575916", "0.5721856", "0.5683262", "0.5640768", "0.55792165", "0.55...
0.87295634
0
Fetches a list of all metering label rules for a label.
def list_metering_label_rules(self, retrieve_all=True, **_params): return self.list('metering_label_rules', self.metering_label_rules_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_rules(self, labels=None):\n # Extract flat list of rules in array form\n if isinstance(self.base_estimator, RandomForestClassifier):\n rules = list(it.chain(*[self.__extract_dt_rules__(dt) for dt in self.base_estimator.estimators_]))\n elif isinstance(self.base_estimator...
[ "0.57482624", "0.5516608", "0.5357591", "0.530031", "0.5222081", "0.5218295", "0.51783687", "0.5128793", "0.51048404", "0.5095553", "0.50337917", "0.50204724", "0.5004493", "0.4985553", "0.4963917", "0.49584508", "0.49472302", "0.49364412", "0.49233997", "0.49183097", "0.4909...
0.7437749
0
Fetches information of a certain metering label rule.
def show_metering_label_rule(self, metering_label_rule, **_params): return self.get(self.metering_label_rule_path % (metering_label_rule), params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_metering_label_rules(self, retrieve_all=True, **_params):\r\n return self.list('metering_label_rules',\r\n self.metering_label_rules_path, retrieve_all,\r\n **_params)", "def create_metering_label_rule(self, body=None):\r\n return self.post(s...
[ "0.5749725", "0.56896865", "0.53727543", "0.5339056", "0.52721786", "0.5223315", "0.5223315", "0.50914735", "0.507633", "0.50260407", "0.49995106", "0.49948278", "0.49948278", "0.49948278", "0.49808478", "0.49793372", "0.4972282", "0.49648386", "0.49490532", "0.4948544", "0.4...
0.7088634
0
Fetch a list of all network partitions for a tenant.
def list_net_partitions(self, **params): return self.get(self.net_partitions_path, params=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_partitions(self):\n \n parts = client.Management.Partition.get_partition_list()\n partitions = []\n for part in parts:\n partitions.append(part['partition_name'])\n return partitions", "def list_partitions(self, partitioning):\n return []", "def get_partitions...
[ "0.67660326", "0.6758356", "0.6584987", "0.6551029", "0.63861006", "0.63013387", "0.6170014", "0.6149972", "0.60316294", "0.6015112", "0.58948547", "0.58694863", "0.5818245", "0.5794568", "0.57519025", "0.56942075", "0.56459546", "0.561672", "0.55776316", "0.5553374", "0.5541...
0.7341327
0
Fetch a network partition.
def show_net_partition(self, netpartition, **params): return self.get(self.net_partition_path % (netpartition), params=params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_partition():\n if selection is None:\n warning(\"You need to pick something first.\")\n return\n if not selection.obj_type in ['partition']:\n warning(\"You need to partition the selection first.\")\n return\n res = askItems([['property',[1]]],\n caption...
[ "0.69014907", "0.6638482", "0.653303", "0.6299674", "0.6299674", "0.6172137", "0.6167602", "0.6078324", "0.60572803", "0.58988655", "0.57241666", "0.5673879", "0.5632247", "0.56248057", "0.55858135", "0.55768174", "0.5530593", "0.54860526", "0.5475339", "0.5435857", "0.542189...
0.703554
0
Create a network partition.
def create_net_partition(self, body=None): return self.post(self.net_partitions_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partition_network(self, *args):\n Blockade.blockade_create_partition(*args)", "def createPartition(self, mp, mtype, fs, size, vg, nr):\n startSector = 0\n endSector = 0\n\n # primary partition: calculate the space according instructions below\n if mtype == 'Pri':\n\n ...
[ "0.8267545", "0.73862374", "0.71127677", "0.69926906", "0.65314716", "0.63135135", "0.6260008", "0.621013", "0.6164522", "0.6133775", "0.6073639", "0.6063786", "0.60147226", "0.5996693", "0.5980926", "0.59421134", "0.5847319", "0.5832983", "0.57437587", "0.56981105", "0.56805...
0.81742126
1
Delete the network partition.
def delete_net_partition(self, netpartition): return self.delete(self.net_partition_path % netpartition)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_partition(self, partition):\n raise NotImplementedError('delete_file')", "def delete_partition(self, partition_spec, if_exists=False, async_=False, hints=None):\n return self.partitions.delete(\n partition_spec, if_exists=if_exists, hints=hints, async_=async_\n )", "d...
[ "0.7445487", "0.6641203", "0.6510621", "0.63935685", "0.6205695", "0.612753", "0.60952127", "0.6081498", "0.60551745", "0.60271436", "0.59529066", "0.5949345", "0.5939962", "0.59164274", "0.58938175", "0.58485097", "0.5816137", "0.5796667", "0.57603586", "0.5741945", "0.57372...
0.81478804
0
Create a new packet filter.
def create_packet_filter(self, body=None): return self.post(self.packet_filters_path, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, filter,\n double_precision = False):\n filters.check_is_filter(filter)\n (f, i) = filter\n filt_len = f.shape[0]\n assert filt_len == i * 2 + 1 # check it's symmetric\n dtype = (torch.float64 if double_precision else torch.float32)\n # t...
[ "0.6488138", "0.614059", "0.613992", "0.6001748", "0.584723", "0.58219844", "0.57764983", "0.57568866", "0.5745277", "0.574284", "0.5729884", "0.5645626", "0.56437176", "0.5626443", "0.557961", "0.5567407", "0.554649", "0.5511731", "0.54957", "0.547382", "0.5453739", "0.544...
0.79164827
0
Update a packet filter.
def update_packet_filter(self, packet_filter_id, body=None): return self.put(self.packet_filter_path % packet_filter_id, body=body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cloudflare_waf_filter_update_request(self, filter_id: str, expression: str, zone_id: str, ref: str = None,\n paused: bool = None, description: str = None) -> Dict[str, Any]:\n params = remove_empty_elements({\n 'id': filter_id,\n 'express...
[ "0.6520881", "0.63559145", "0.62711424", "0.6238306", "0.6197009", "0.60501987", "0.6043722", "0.597732", "0.5932158", "0.58276725", "0.5822518", "0.5703243", "0.56657267", "0.56615776", "0.56402576", "0.5638194", "0.5618479", "0.5612873", "0.55636066", "0.55454075", "0.55434...
0.80393976
0
Fetch a list of all packet filters for a tenant.
def list_packet_filters(self, retrieve_all=True, **_params): return self.list('packet_filters', self.packet_filters_path, retrieve_all, **_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetFilters(self, bulk=False):\n query = []\n _AppendIf(query, bulk, (\"bulk\", 1))\n\n filters = self._SendRequest(HTTP_GET, \"/%s/filters\" % GANETI_RAPI_VERSION,\n query, None)\n if bulk:\n return filters\n else:\n return [f[\"uuid\"] for f in filters]"...
[ "0.68841", "0.6719281", "0.66721904", "0.6203976", "0.62009436", "0.6171794", "0.6166032", "0.61062443", "0.59795624", "0.5976046", "0.5959277", "0.58664405", "0.5858418", "0.58559227", "0.5850228", "0.5850065", "0.58031726", "0.57973117", "0.5790999", "0.578245", "0.57679826...
0.69572335
0
Fetch information of a certain packet filter.
def show_packet_filter(self, packet_filter_id, **_params): return self.get(self.packet_filter_path % packet_filter_id, params=_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, pkt):\n return pkt", "def getFilter(self, channel, group, node, unitCode=0, resp=None):\n resp = self.XAPCommand('FILTER', channel, group, node, unitCode=unitCode, rtnCount=9)\n type = None\n freq = None\n gain = None\n bandwidth = None\n if int(r...
[ "0.6224088", "0.5915098", "0.57071084", "0.5666445", "0.5662054", "0.5644824", "0.55097526", "0.54657936", "0.5435283", "0.5399172", "0.5383127", "0.5336129", "0.53209823", "0.52840376", "0.527451", "0.52673495", "0.5262919", "0.5229014", "0.5219188", "0.52071005", "0.5201223...
0.6721544
0
Delete the specified packet filter.
def delete_packet_filter(self, packet_filter_id): return self.delete(self.packet_filter_path % packet_filter_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cloudflare_waf_filter_delete_request(self, filter_id: str, zone_id: str) -> Dict[str, Any]:\n return self._http_request(\n method='DELETE',\n url_suffix=f'zones/{zone_id}/filters',\n params={'id': filter_id})", "def cloudflare_waf_filter_delete_command(client: Client, ...
[ "0.7065296", "0.6998032", "0.694061", "0.68922025", "0.66605544", "0.64817053", "0.60303646", "0.5899795", "0.5713327", "0.56261694", "0.55948937", "0.5584926", "0.5552384", "0.55350125", "0.54980665", "0.5430551", "0.533297", "0.53167546", "0.52826464", "0.5256641", "0.52558...
0.82072103
0
Call do_request with the default retry configuration. Only idempotent requests should retry failed connection attempts.
def retry_request(self, method, action, body=None, headers=None, params=None): max_attempts = self.retries + 1 for i in range(max_attempts): try: return self.do_request(method, action, body=body, headers=heade...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call(self, request=None, *args, **kwargs):\n if request is not None:\n self.request = request\n\n retry = self.request.configuration.retry\n if not isinstance(retry, SimpleRetry):\n raise Error('Currently only the fast retry strategy is supported')\n\n last_exc...
[ "0.6729656", "0.637971", "0.6109874", "0.60819364", "0.6021752", "0.60116726", "0.59798336", "0.5907625", "0.58662295", "0.583994", "0.5785021", "0.575224", "0.57102096", "0.5658372", "0.56307805", "0.5607868", "0.5588081", "0.5575883", "0.55712205", "0.55710757", "0.5570575"...
0.6629842
1
Analyse a confusion matrix by printing the True Positive (TP), False Positive (FP), ... and the specificity and sensitivity as well for each classes.
def analyze_confusion_matrix(confusion_matrix): n_classes = len(confusion_matrix) # True positive : correct prediction, ie the diagonal of the confusion matrix TP = confusion_matrix.diag() for c in range(n_classes): idx = torch.ones(n_classes).byte() idx[c] = 0 TN = con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confusionMatrix(testDataPredictions, testDataOriginal):\n matrix = {\"predicted >50K correctly as >50K\": 0, \"predicted >50K incorrectly as <=50K\": 0,\n \"predicted <=50K correctly as <=50K\": 0, \"predicted <=50K incorrectly as >50K\": 0}\n\n for instance in range(len(testDataPredictions)...
[ "0.74491894", "0.7377686", "0.73206645", "0.7228996", "0.71899956", "0.7060822", "0.7049538", "0.685456", "0.6830191", "0.68265086", "0.68125165", "0.6800462", "0.67516446", "0.6725235", "0.67091966", "0.6700737", "0.6692203", "0.6686371", "0.66814786", "0.6649996", "0.664755...
0.75660235
0
Constructs a new ReplicatorValue object
def __init__(self, replicator_id=''): self.replicator_id = replicator_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _new_rep(self, rep):\n return self._new(rep, self.shape, self.domain)", "def copy(self):\n return self.__class__(\n group_list=self.group_list, bits_except_last=self.bits_except_last,\n max_value=self.max_value\n )", "def new_value(self, value=0):\n return ...
[ "0.6084624", "0.6004562", "0.59728104", "0.5943229", "0.5943229", "0.591257", "0.59099877", "0.5903905", "0.59019524", "0.5872284", "0.5861993", "0.58383065", "0.5753103", "0.5664996", "0.5662879", "0.56450135", "0.56154025", "0.56136125", "0.55858725", "0.55858725", "0.55662...
0.6295505
0
Sets this components path from individual components.
def _from_components(self, property_name, *protocol_ids): assert property_name is not None and isinstance(property_name, str) assert property_name.find(ProtocolPath.path_separator) < 0 for protocol_id in protocol_ids: assert protocol_id is not None and isinstance(protocol_id, str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetPath(self, path):\n\n\t\tfor point in path:\n\t\t\t# Check if correct type\n\t\t\tif type(point) != Point:\n\t\t\t\traise TypeError(\"Not of type Core.Types.Point\")\n\n\t\tself.path = path", "def set_path(self, key, value):\n return set_path(self, key, self.from_obj(value))", "def set(self, new_...
[ "0.61862373", "0.6101257", "0.6078512", "0.5973134", "0.5934757", "0.5862571", "0.5811863", "0.5741532", "0.5681197", "0.5680933", "0.567429", "0.5666033", "0.56404704", "0.56123084", "0.56061804", "0.56000787", "0.5571635", "0.552776", "0.5526396", "0.5526396", "0.5526396", ...
0.67479634
0
Splits a protocol path string into the property name, and the individual protocol ids.
def to_components(path_string): property_name_index = path_string.find(ProtocolPath.property_separator) property_name = path_string[property_name_index + 1:] protocol_id_path = path_string[:property_name_index] protocol_ids = protocol_id_path.split(ProtocolPath.path_separator) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _from_components(self, property_name, *protocol_ids):\n\n assert property_name is not None and isinstance(property_name, str)\n\n assert property_name.find(ProtocolPath.path_separator) < 0\n\n for protocol_id in protocol_ids:\n\n assert protocol_id is not None and isinstance(pro...
[ "0.61609274", "0.6133861", "0.60456616", "0.6042714", "0.6003168", "0.5955503", "0.5950088", "0.59124535", "0.5872106", "0.5835307", "0.5825878", "0.5824099", "0.57710177", "0.57510704", "0.5652095", "0.562677", "0.5614178", "0.55737364", "0.55539405", "0.5530218", "0.5516221...
0.79196525
0
Prepend a new protocol id onto the front of the path.
def prepend_protocol_id(self, id_to_prepend): property_name, protocol_ids = ProtocolPath.to_components(self._full_path) if len(protocol_ids) == 0 or (len(protocol_ids) > 0 and protocol_ids[0] != id_to_prepend): protocol_ids.insert(0, id_to_prepend) self._from_components(property_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepend_path(path, paths):\n\n if path in paths: paths.remove(path)\n paths.insert(0, path)", "def replace_protocol(self, old_id, new_id):\n self._full_path = self._full_path.replace(old_id, new_id)", "def append_to_path(path, name):\n if path[-1] == '/' or path[-1] == ':':\n return path...
[ "0.66855586", "0.66787505", "0.6110264", "0.6004697", "0.59061235", "0.5879382", "0.5854363", "0.58252287", "0.56801903", "0.55817735", "0.5521786", "0.5509535", "0.549153", "0.54776144", "0.5396674", "0.53601295", "0.53539044", "0.5328268", "0.53162754", "0.5288578", "0.5278...
0.8019293
0
Pops and then returns the leading protocol id from the path. Returns
def pop_next_in_path(self): property_name, protocol_ids = ProtocolPath.to_components(self._full_path) if len(protocol_ids) == 0: return None next_in_path = protocol_ids.pop(0) self._from_components(property_name, *protocol_ids) return next_in_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_path_infomation(self):\n long_identifier = self._device_path.split('/')[4]\n protocol, remainder = long_identifier.split('-', 1)\n identifier, _, device_type = remainder.rsplit('-', 2)\n return (protocol, identifier, device_type)", "def prepend_protocol_id(self, id_to_prepend...
[ "0.6219566", "0.5965659", "0.5783188", "0.5747099", "0.5634188", "0.5616808", "0.56127423", "0.55606073", "0.5552654", "0.5540661", "0.55257887", "0.5493753", "0.54796386", "0.54419166", "0.54330134", "0.5403448", "0.53902686", "0.53836745", "0.5362701", "0.5354733", "0.53269...
0.65887743
0
Appends a uuid to each of the protocol id's in the path
def append_uuid(self, uuid): if self.is_global: # Don't append uuids to global paths. return property_name, protocol_ids = ProtocolPath.to_components(self._full_path) appended_ids = [] for protocol_id in protocol_ids: if protocol_id is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_uuid(self, value):\n if self.id.find(value) >= 0:\n return\n\n self._id = graph.append_uuid(self.id, value)\n\n for input_path in self.required_inputs:\n\n input_path.append_uuid(value)\n\n value_references = self.get_value_references(input_path)\n\n ...
[ "0.5968178", "0.5823053", "0.5382426", "0.534203", "0.5339131", "0.5256109", "0.5218487", "0.521202", "0.5207927", "0.52027667", "0.51832616", "0.51754117", "0.51754117", "0.51754117", "0.51680183", "0.512681", "0.50913817", "0.50849915", "0.5069002", "0.50551116", "0.5046208...
0.7560965
0
Retrieve a dict whose form is {ASIN => item details}. The dict does not contain keys which don't exist in the cache.
def get_cached_items(self, asins): keys = [to_bytes(asin) for asin in asins] # key must be bytes cached_json_items = self.cache.get_multi(keys, key_prefix=self.key_prefix) cached_items = {} for key, value in cached_json_items.items(): # Although pylibmc automatically pickle ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getitems(self):\n return {k:self.get(k) for k in self.keys}", "def read_item(sessionKey):\n\n # Try to get the element from the cache, erasing it if it exists\n payload = c.pop(sessionKey, \"\")\n return {\"payload\": payload}", "def extract_key_item_data(item_data):\n extracted_item_data ...
[ "0.5769965", "0.5732929", "0.57088935", "0.556562", "0.55456996", "0.5544044", "0.551607", "0.5514118", "0.54914254", "0.54679686", "0.54657054", "0.5446405", "0.54148483", "0.5413959", "0.54104495", "0.5409624", "0.5385252", "0.5321656", "0.53159004", "0.52895033", "0.528295...
0.69177437
0
recursively applies the function fkt to every elemenent and sublist of lst
def recursive_map(fkt, lst): return [recursive_map(fkt,item) if type(item) is list else fkt(item) for item in lst]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_function_to_nested_list(func, l):\n from itertools import chain\n result = func(list(chain(*l)))\n csum = np.cumsum(map(len, l))\n new_l = [result[(0 if i == 0 else csum[i-1]):csum[i]] for i in range(len(l))]\n return new_l", "def list_func(lst: List[valueType]) -> List[valueType]:\n ...
[ "0.70438933", "0.6275951", "0.58420646", "0.5804727", "0.5795173", "0.57414764", "0.57273996", "0.56959635", "0.568941", "0.56869394", "0.56300324", "0.56258065", "0.56181127", "0.5582306", "0.55785596", "0.5575358", "0.55268943", "0.5515409", "0.5505422", "0.548368", "0.5460...
0.7568617
0
Formats a period in seconds into a string
def format_period(seconds): if seconds == (24 * 60 * 60): return "day" elif seconds == (60 * 60): return "hour" elif seconds > (24 * 60 * 60): return "%.1f days" % (seconds / 24. / 60. / 60.) elif seconds > (60 * 60): return "%.1f hours" % (seconds / 60. / 60.) elif ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_seconds(s):\n return '%dh %dm' % (s//3600, (s//60) % 60)", "def format_seconds(duration):\n\treturn stats_utils.format_seconds(duration)", "def format_time(seconds: float) -> str:\n # return str(timedelta(seconds=seconds))[2:10] if seconds != 0.0 else \"00:00.00\"\n if seconds =...
[ "0.74343485", "0.73177636", "0.730745", "0.7167537", "0.70485187", "0.70414513", "0.7032614", "0.7026307", "0.69955707", "0.6857048", "0.68486637", "0.67831635", "0.67334914", "0.67275393", "0.67202556", "0.6701395", "0.66790986", "0.6652973", "0.66259664", "0.65982836", "0.6...
0.7953767
0
Syncs tc, db, and bwmon.pickle. Then, starts new slices, kills old ones, and updates byte accounts for each running slice. Sends emails and caps those that went over their limit.
def sync(nmdbcopy): # Defaults global DB_FILE, \ period, \ default_MaxRate, \ default_Maxi2Rate, \ default_MaxKByte,\ default_Maxi2KByte,\ default_Share, \ dev_default # All slices names = [] # In case the limits have changed. default_MaxR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync_entries():\n import time\n\n while True:\n try:\n update_pending_scripts(settings['api_handler'])\n except:\n logging.exception(\"Error occured during synchronisation\")\n time.sleep(60)", "def main():\n\tlogger.warn(\"leprechaun rsync started.\")\n\n\tti...
[ "0.55476534", "0.5505242", "0.547258", "0.53901726", "0.5317194", "0.53054774", "0.52975595", "0.52915615", "0.5279213", "0.5249152", "0.52469254", "0.5221539", "0.52172494", "0.5210602", "0.5190685", "0.5178232", "0.5177902", "0.51734185", "0.5141393", "0.51380384", "0.50962...
0.63890535
0
Turn off all slice HTBs
def allOff(): # Get/set special slice IDs root_xid = bwlimit.get_xid("root") default_xid = bwlimit.get_xid("default") kernelhtbs = gethtbs(root_xid, default_xid) if len(kernelhtbs): logger.log("bwmon: Disabling all running HTBs.") for htb in kernelhtbs.keys(): bwlimit.off(htb, dev = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_eht_off(self):\n raise NotImplementedError", "def off_all(self):\n self._set_status(\"off\", \"11111111\")", "def turn_off(self):\n self._state = False\n self.write_state(bytes([1]))\n self.schedule_update_ha_state()", "def disable_vae_slicing(self):\n self....
[ "0.63343924", "0.57503784", "0.57366097", "0.5704659", "0.5629737", "0.55784094", "0.5566999", "0.55569965", "0.55203027", "0.5464858", "0.5462128", "0.54510033", "0.5431682", "0.54298925", "0.54233426", "0.54200375", "0.5416879", "0.537195", "0.535316", "0.5322585", "0.53062...
0.7344729
0
When run as a thread, wait for event, lock db, deep copy it, release it, run bwmon.GetSlivers(), then go back to waiting.
def run(): logger.verbose("bwmon: Thread started") while True: lock.wait() logger.verbose("bwmon: Event received. Running.") database.db_lock.acquire() nmdbcopy = copy.deepcopy(database.db) database.db_lock.release() try: if getDefaults(nmdbcopy) and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run():\r\n event = threading.Event()\r\n while (event.is_set() == False):\r\n # perform database backup\r\n backup()\r\n\r\n # sleep for the predefined amount interval\r\n event.wait(BACKUP_INTERVAL)", "def syncDBLoop(self):\n while 1:\n self.evSyncDB.wait()\n i...
[ "0.60967696", "0.5767627", "0.5736665", "0.5632945", "0.5563657", "0.54911983", "0.54457074", "0.5422245", "0.54212034", "0.5407008", "0.5403839", "0.5361349", "0.5359709", "0.5354534", "0.53536624", "0.5333217", "0.5309702", "0.5295493", "0.52853715", "0.528163", "0.5264975"...
0.6785303
0
Read or create a new pickle file and return the data.
def read_or_new_pickle(filename, value, *args, **kwargs): data = None filename = "{}.pkl".format(filename) os.makedirs(os.path.dirname(filename), exist_ok=True) if os.path.isfile(filename): # If file had been created, but is empty return None since another process # could be writing to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_object(self, filename):\n with open(filename, 'rb') as inp: # Overwrites any existing file.\n data = pickle.load(inp)\n return data", "def load_pickle_data(filename):\n path = \"../tmp/{}.pckl\".format(filename)\n if os.path.exists(path):\n print(\"LOADING PCKL FIL...
[ "0.7194657", "0.7113822", "0.7054853", "0.70204663", "0.69924474", "0.69662946", "0.6940556", "0.68701947", "0.68606484", "0.684021", "0.6837062", "0.6820283", "0.680073", "0.67892516", "0.67740124", "0.676149", "0.67593324", "0.675681", "0.6748782", "0.6723315", "0.6710549",...
0.7277842
0
Read or create a new json file and return the data.
def read_or_new_json(filename, value, *args, **kwargs): data = None filename = "{}.json".format(filename) os.makedirs(os.path.dirname(filename), exist_ok=True) if os.path.isfile(filename): # If file had been created, but is empty return None since another process # could be writing to i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_json(cls, input_file):\n with open(input_file) as f:\n return json.load(f)", "def _read_json(cls, input_file):\n with open(input_file) as f:\n return json.load(f)", "def read_json_file(self, fname):\n return {}", "def openJson(self):\n json_file = o...
[ "0.7190205", "0.7190205", "0.71838874", "0.71492124", "0.7089315", "0.7088723", "0.7088723", "0.7031506", "0.701352", "0.699548", "0.6972864", "0.692402", "0.6919216", "0.6880745", "0.6876042", "0.68599683", "0.6858713", "0.68038887", "0.67970616", "0.67945015", "0.6791648", ...
0.73330307
0
Add postfix to a filename to make it unique.
def add_unique_postfix(filename): if not os.path.exists(filename): return filename path, name = os.path.split(filename) name, ext = os.path.splitext(name) make_filename = lambda i: os.path.join(path, '{}_{}{}'.format(name, i, ext)) for i in range(1, sys.maxsize): unique_filename =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def giverandomfilename(self,user,postfix=\"\"):\n return \"%s_%s_%s\" % (user.username.encode(\"ascii\",\"ignore\"),\n str(randint(10000,99999)),\n \"testfile%s.txt\" % postfix)", "def add_suffix_to_filename(filename, suffix):\n name, ext = os.pat...
[ "0.6688911", "0.6385569", "0.6384604", "0.62978894", "0.6184149", "0.61631465", "0.61355627", "0.6128925", "0.61214083", "0.6111603", "0.6055405", "0.6050752", "0.6027128", "0.5992498", "0.5985448", "0.5940152", "0.59259474", "0.5904364", "0.58930105", "0.58843166", "0.588425...
0.8221782
0
Given a document (represented as a string), return a list of all of the words in that document, in order. Process document by coverting all words to lowercase, and removing any punctuation or English stopwords.
def tokenize(document): raw_words=[word.lower() for word in nltk.word_tokenize(document) if word.isalpha()] raw_words=[word.lower() for word in raw_words] final_words=[] for word in raw_words: if word not in string.punctuation and word not in nltk.corpus.stopwords.words("english"): f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(document):\n token = nltk.word_tokenize(document)\n\n output = [word.lower() for word in token if (word not in string.punctuation and word not in nltk.corpus.stopwords.words(\"english\"))]\n\n return output", "def tokenize(document):\n words = [word.lower() for word in nltk.word_tokenize...
[ "0.79225713", "0.78998256", "0.77558446", "0.7736347", "0.77261716", "0.766667", "0.7387504", "0.7341044", "0.72900367", "0.7227586", "0.70762444", "0.7042829", "0.7022621", "0.70182997", "0.70182997", "0.69928956", "0.6972842", "0.6969272", "0.6964892", "0.69495815", "0.6945...
0.79469746
0
Like `bool`, but the string 'False' evaluates to `False`.
def bool_(val): if isinstance(val, six.string_types) and val.lower() == 'false': return False return bool(val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_bool(s):\n if not s:\n return False\n if type(s) != str:\n # It's not a string and it's not falsy, soooo....\n return True\n s = s.lower()\n if s in [\"false\", \"0\", \"no\", \"n\"]:\n return False\n return True", "def toBool( string ):\r\n return string == ...
[ "0.79706836", "0.77999836", "0.77764535", "0.77737457", "0.7769025", "0.7752392", "0.7732956", "0.7688372", "0.7639961", "0.7552712", "0.7499345", "0.74967587", "0.74940103", "0.74873126", "0.74873126", "0.7462245", "0.7449587", "0.7444772", "0.7444772", "0.7442706", "0.73980...
0.8482024
0
Like str, but allows a value of None to pass through asis.
def str_or_none(val): return str(val) if val is not None else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _coerce_str_unless_none(value):\n return str(value) if value is not None else None", "def string(self, value):\n # respect {None}\n if value is None:\n # by leaving it alone\n return None\n # my value knows\n return str(value)", "def noneToString(text):\...
[ "0.8081559", "0.7763027", "0.76215655", "0.7473673", "0.74665016", "0.7368865", "0.7334071", "0.73068684", "0.71900374", "0.7161688", "0.7096358", "0.70624596", "0.70293933", "0.7020066", "0.7012749", "0.69696677", "0.6965904", "0.6909482", "0.6829046", "0.6783363", "0.676243...
0.7903235
1
Compute the list of all declared slots for a class.
def GetAllSlots(cls): slots = [] for parent in cls.__mro__: slots.extend(getattr(parent, "__slots__", [])) return slots
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slots(self):\n return self.__slots.values()", "def get_potential_classes_for_slot(slot_number):\n return [\"econ\", \"biz\", \"wtf\"]", "def slots(cls, mangled=False):\n # type: (type, bool) -> Set[str]\n _slots = set() # type: Set[str]\n for base in inspect.getmro(cls):\n _slots...
[ "0.6665447", "0.6540712", "0.63587636", "0.6284265", "0.6129058", "0.60046625", "0.5797897", "0.57293785", "0.5724125", "0.5720947", "0.5678318", "0.56717503", "0.55985445", "0.55912197", "0.554557", "0.54841936", "0.5479285", "0.5446785", "0.54353386", "0.54201335", "0.54131...
0.75151503
0