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 |
|---|---|---|---|---|---|---|
Create, update, and delete volume attachments via patch [Arguments] | def fusion_api_patch_storage_volume_attachments(self, body, param='', api=None, headers=None):
return self.volume_attachment.patch(body=body, param=param, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_aws_service_api_volume_attachment_put(self):\n pass",
"def test_aws_service_api_volume_attachment_delete(self):\n pass",
"def test_manage_volume_attachments(self, volume, instance, volumes_steps):\n volumes_steps.attach_instance(volume.name, instance.name)\n volumes_steps.d... | [
"0.69271636",
"0.6763079",
"0.6706392",
"0.6365676",
"0.6276474",
"0.62318283",
"0.61483425",
"0.6080413",
"0.6048534",
"0.60193163",
"0.60192627",
"0.600426",
"0.5877835",
"0.5871101",
"0.57794565",
"0.572767",
"0.5701827",
"0.5693271",
"0.568384",
"0.5607973",
"0.5607061",
... | 0.7713857 | 0 |
Updates a Switch. [Arguments] | def fusion_api_edit_switch(self, body, uri, api=None, headers=None):
return self.switch.update(body, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_switch(self, value):\n act = SwitchAction(self, value)\n return act.invoke()",
"def switch_changed(self, switch, name):\n section, option = name\n v = (\"1\" if switch.value else \"0\")\n _stash.config.set(section, option, v)\n self.save()",
"def command_update... | [
"0.6282466",
"0.6170663",
"0.6168931",
"0.61634696",
"0.60626763",
"0.5929562",
"0.5883229",
"0.5791149",
"0.578171",
"0.5781447",
"0.5766732",
"0.57095605",
"0.57047874",
"0.5698562",
"0.5698562",
"0.5691825",
"0.5651865",
"0.5648597",
"0.5609185",
"0.5602009",
"0.5587439",
... | 0.6216313 | 1 |
Refreshes a Switch based on uri provided [Arguments] | def fusion_api_refresh_switch(self, uri, api=None, headers=None):
return self.switch.refresh(uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh(self, url, args, cancellationSignal):\n pass",
"def fusion_api_edit_switch(self, body, uri, api=None, headers=None):\n return self.switch.update(body, uri, api, headers)",
"def fusion_api_get_switch(self, uri=None, param='', api=None, headers=None):\n return self.switch... | [
"0.6420177",
"0.5545554",
"0.53256416",
"0.52885365",
"0.519113",
"0.5158461",
"0.5119947",
"0.5117481",
"0.5094451",
"0.50451607",
"0.4990647",
"0.49901125",
"0.49833083",
"0.49725384",
"0.49562463",
"0.49557462",
"0.4953017",
"0.4822759",
"0.48081386",
"0.47947106",
"0.4782... | 0.62286013 | 1 |
Removes a Switch based on name OR uri provided [Arguments] | def fusion_api_remove_switch(self, name=None, uri=None, api=None, headers=None):
return self.switch.delete(name, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _remove_from_switch(self, _switch, context):\n _network = context.current['id']\n _vlanid = context.current['provider:segmentation_id']\n\n # BRIDGE_PORT_URL = '{url_prefix}://{switch_name_or_ip}:{port}/networks/{vlan}/{network_id}/{port_id}'\n for _switchport in _switch.get('ports'... | [
"0.64799225",
"0.60489744",
"0.58654183",
"0.5754106",
"0.5738819",
"0.5728677",
"0.5728677",
"0.5728677",
"0.5728677",
"0.5618364",
"0.5616719",
"0.5604793",
"0.5554135",
"0.55125505",
"0.55086726",
"0.5494269",
"0.5492298",
"0.5490624",
"0.5460127",
"0.5402718",
"0.53422207... | 0.74323237 | 0 |
Gets a default or paginated collection of Switches without ports info [Arguments] | def fusion_api_get_switches_without_ports(self, uri=None, api=None, headers=None):
return self.switch.get(uri=uri, api=api, headers=headers, param='/withoutPorts') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def switches(self) -> List[dict]:\n return self.items_by_domain(\"switch\")",
"def get_all_switches(name):\n return [False,False,False,False] #TODO Implement",
"def list_switches(self):\n return [x for x,y in self.devices.items() if y.device_type == \"Switch\"]",
"def get_all_switch(self, co... | [
"0.6520135",
"0.6164974",
"0.6038765",
"0.5980532",
"0.58495516",
"0.5426051",
"0.5400386",
"0.53886455",
"0.5363743",
"0.533867",
"0.52681065",
"0.52616465",
"0.52521765",
"0.52512336",
"0.5225842",
"0.5202271",
"0.518069",
"0.5145818",
"0.51111346",
"0.51039314",
"0.5092655... | 0.6331513 | 1 |
Gets a default or paginated collection of Switch Types. [Arguments] | def fusion_api_get_switch_types(self, param='', api=None, headers=None):
return self.swtypes.get(api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def switches(self) -> List[dict]:\n return self.items_by_domain(\"switch\")",
"def list_switches(self):\n return [x for x,y in self.devices.items() if y.device_type == \"Switch\"]",
"def get_all_switch(self, conf):\n\t\tpass",
"def switches(self):\n return {k:v for k, v in self._data.ite... | [
"0.6429243",
"0.62044716",
"0.5973956",
"0.5961749",
"0.58429617",
"0.5724761",
"0.56757826",
"0.54745233",
"0.5419325",
"0.5411464",
"0.53042865",
"0.5303776",
"0.53003997",
"0.52718854",
"0.5233143",
"0.5197792",
"0.5194815",
"0.5182634",
"0.5126415",
"0.50823814",
"0.50694... | 0.6891026 | 0 |
Creates a Uplink Set [Arguments] | def fusion_api_create_uplink_set(self, body, param='', api=None, headers=None):
return self.uplink_set.create(body, param, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def up_cmd(ctx):\n pass",
"def addOnCreate(call, args=(), kwargs={}, nodeClass='*'):\n pass",
"def get_args():\n\n parser = argparse.ArgumentParser(description=\"Tool to create an uplink subnet for FIP access via VSG/VRS-G gateway.\")\n parser.add_argument('-d', '--debug', required=False, help='Enabl... | [
"0.54519755",
"0.5435972",
"0.5399245",
"0.5381882",
"0.52568656",
"0.5251068",
"0.5216274",
"0.5202875",
"0.5168291",
"0.51639724",
"0.51597434",
"0.5073443",
"0.50513744",
"0.5046323",
"0.50254655",
"0.5006739",
"0.4990694",
"0.4967758",
"0.4956707",
"0.4934899",
"0.4934899... | 0.7222193 | 0 |
Updates an Uplink Set [Arguments] | def fusion_api_edit_uplink_set(self, body, uri, api=None, headers=None):
return self.uplink_set.update(body, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command_update(arguments):\n global current_name\n tag = arguments[0]\n if (len(arguments) == 2):\n old_target, new_target = (...), arguments[1]\n else:\n old_target, new_target = arguments[1:]\n\n to_replace = network[current_name, tag, old_target]\n if not len(to_replace):\n ... | [
"0.6135603",
"0.609327",
"0.5954924",
"0.5858715",
"0.57880354",
"0.56711507",
"0.563974",
"0.563974",
"0.563974",
"0.563974",
"0.563974",
"0.563974",
"0.56302327",
"0.55801797",
"0.5516977",
"0.5502105",
"0.54873466",
"0.54873466",
"0.54873466",
"0.5427483",
"0.53419477",
... | 0.67684245 | 0 |
Deletes an Uplink Set from the appliance based on name OR uri [Arguments] | def fusion_api_delete_uplink_set(self, name=None, uri=None, api=None, headers=None):
return self.uplink_set.delete(name, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_delete_network_set(self, name=None, uri=None, api=None, headers=None):\n return self.network_set.delete(name, uri, api, headers)",
"def test_remove_share(self):\n self.app.delete(url=\"/config/shares?share=80&destination=gsiftp://nowhere&vo=dteam\", status=400)\n self.app.... | [
"0.60390645",
"0.5904155",
"0.59041137",
"0.58668137",
"0.5849788",
"0.5787649",
"0.569228",
"0.56363535",
"0.56350154",
"0.5628608",
"0.5624718",
"0.5623885",
"0.55697083",
"0.5543166",
"0.55367833",
"0.55204713",
"0.55089206",
"0.5494897",
"0.5448532",
"0.54449373",
"0.5438... | 0.8037802 | 0 |
Gets a default or paginated collection of Uplink Sets. [Arguments] | def fusion_api_get_uplink_set(self, uri=None, param='', api=None, headers=None):
return self.uplink_set.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_create_uplink_set(self, body, param='', api=None, headers=None):\n return self.uplink_set.create(body, param, api, headers)",
"def link_to_set(page):\n #s = set()\n links = Measurements.get_all_links(page)\n s = set(links)\n return s",
"def getSets():",
"... | [
"0.6034614",
"0.5520875",
"0.5430212",
"0.5270419",
"0.5221473",
"0.519221",
"0.5191031",
"0.5018383",
"0.500693",
"0.49028212",
"0.48873365",
"0.48775196",
"0.48375025",
"0.47938913",
"0.47694138",
"0.47593793",
"0.475309",
"0.47418198",
"0.47398478",
"0.47387344",
"0.473623... | 0.67165923 | 0 |
Removes a User from the appliance based on name OR uri [Arguments] | def fusion_api_remove_user(self, name=None, uri=None, api=None, headers=None):
return self.user.delete(name, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wipe_user(user_name):\n user_name = urllib.unquote(user_name) # Username is coming straight from the url bar.\n user = User.query.filter(User.user_name==user_name).first()\n delete_user(user)",
"def del_user(self, username):\n pass",
"def delete_user():",
"def delete_user():\n del glob... | [
"0.7027543",
"0.70250374",
"0.6999531",
"0.68815476",
"0.67725843",
"0.6740869",
"0.67364764",
"0.6715946",
"0.6699434",
"0.6612588",
"0.6598224",
"0.6559849",
"0.65336317",
"0.65224516",
"0.6503584",
"0.6503184",
"0.64976114",
"0.6484936",
"0.6465641",
"0.6463593",
"0.637226... | 0.76143265 | 0 |
Gets the appliance's supported API versions [Example] ${resp} = Fusion Api Get Appliance Api Versions | | | def fusion_api_get_appliance_api_versions(self, api=None, headers=None):
return self.version.get(api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_versions():\n ret_obj = {'versions': picard_versions(current_app)}\n return make_response(jsonify(ret_obj), 200)",
"def api_versions(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"api_versions\")",
"def api_versions(self) -> Optional[Sequence[str]]:\n return pulumi.ge... | [
"0.7494345",
"0.73989725",
"0.73989725",
"0.73989725",
"0.73989725",
"0.73362356",
"0.72414464",
"0.708449",
"0.70133454",
"0.6999114",
"0.6908404",
"0.68778837",
"0.6701922",
"0.6691587",
"0.66610116",
"0.65204805",
"0.64245963",
"0.6255539",
"0.62366027",
"0.62292904",
"0.6... | 0.77546126 | 0 |
Sets the XAPIVersion header to the specified value for all future requests. If no value is supplied, the value of ${XAPIVersion} is used if it exists else the appliances current version is queried and used [Example] ${resp} = |Fusion Api Set Default Api Version | | | def fusion_api_set_default_api_version(self, api=None):
return self.version.set(api=api) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_api_version_header(response):\n response.headers.setdefault('X-API-Version', g.api_version)\n return response",
"def SetDefaultVersion(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)",
"def getAPIVersion(self):\r\n self._update('getAPIVersion')\r\n ... | [
"0.7020459",
"0.5847266",
"0.58408767",
"0.581011",
"0.56751347",
"0.55736",
"0.5506365",
"0.5420947",
"0.53353244",
"0.5267194",
"0.52175796",
"0.5127778",
"0.51140654",
"0.49792168",
"0.49792168",
"0.49792168",
"0.49792168",
"0.49792168",
"0.49792168",
"0.49792168",
"0.4979... | 0.61179054 | 1 |
Send a POST rest call to the EM RIS interface through the Fusion appliance | def hal_api_post_em_ris(self, fusion_ip, em_ip, resource, data=None, header=None, retries=5): # pylint: disable=unused-argument
dcs = BuiltIn().get_variable_value("${DCS}")
nic = BuiltIn().get_variable_value("${FUSION_NIC}")
ssh = paramiko.client.SSHClient()
ssh.load_sys... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post(self):\n text = 'HELLO from socnet API Server!'\n return push_to_mattermost(text)",
"def do_POST(self,):\n self.http_method = 'POST'\n self.response()",
"def hal_api_perform_post_action(self, fusion_ip, action=None, parameters=None, retries=5):\n url = \"https://... | [
"0.629005",
"0.6278455",
"0.6227176",
"0.61504656",
"0.6135106",
"0.6040742",
"0.60321116",
"0.6011967",
"0.5993692",
"0.59902436",
"0.59897685",
"0.59825003",
"0.5982412",
"0.59688205",
"0.59475356",
"0.59312737",
"0.59105766",
"0.5900485",
"0.5899863",
"0.5885932",
"0.58621... | 0.6545464 | 0 |
Send a Claim call to the Perm Webapp on Fusion | def perm_api_perform_claim(self, fusion_ip, fusion_claim_ip, retries=5):
# Build URL
url = "https://" + fusion_ip + "/perm/rest/resources/atlas/tbird/fts?ipAddress=" + fusion_claim_ip
response = None
# Retry in case rest call fails.
# Currently calls to the w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def claim(self, ctx, *args):\n if has_post_permission(ctx.guild.id, ctx.channel.id):\n number, name = ch.parse_number_and_name(args)\n out = ch.claim(ctx.user_object, name, number)\n await ctx.send(out)",
"def post(self):\n dao = ClaimDao()\n return dao... | [
"0.58439505",
"0.55393654",
"0.52551943",
"0.5190258",
"0.5176609",
"0.51296705",
"0.51259375",
"0.51256275",
"0.5119167",
"0.50780183",
"0.5069017",
"0.50431377",
"0.50258064",
"0.49945018",
"0.49897614",
"0.49878263",
"0.49685344",
"0.49454448",
"0.49396595",
"0.49318913",
... | 0.64909756 | 0 |
Compare two IP addresses. Return True if they are equal. False otherwise | def ip_address_match(self, ip1, ip2):
# Build IP objects
converted_ip1 = IPy.IP(ip1)
converted_ip2 = IPy.IP(ip2)
if converted_ip1 == converted_ip2:
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_ip(ip1, ip2):\n return cmp(normalize_ip(ip1), normalize_ip(ip2))",
"def is_ip_address_equal(ip1, ip2):\n if Convert.is_valid_ipv6_address(ip1) and Convert.is_valid_ipv6_address(ip2):\n if Convert.is_ipv6_equal(ip1, ip2):\n return True\n else:\n re... | [
"0.78469706",
"0.7376112",
"0.73338",
"0.67397344",
"0.6569595",
"0.647767",
"0.641742",
"0.6412459",
"0.6405167",
"0.63363826",
"0.6331186",
"0.6294796",
"0.62394756",
"0.6137863",
"0.61093587",
"0.6021489",
"0.5972934",
"0.59692293",
"0.59515405",
"0.59456486",
"0.593293",
... | 0.8048186 | 0 |
Gets a Deployment Manager. [Arguments] | def fusion_api_get_deployment_manager(self, uri=None, param='', api=None, headers=None):
return self.dep_mgr.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_manager(api_version=None):\n from manager import get_keystone_manager\n return get_keystone_manager(get_local_endpoint(), get_admin_token(),\n api_version)",
"def GetManager(self):\r\n\r\n return self.manager",
"def get_manager():\n return __manager__",
... | [
"0.6725439",
"0.64918023",
"0.62597597",
"0.6233775",
"0.61700165",
"0.6023853",
"0.58021766",
"0.57533944",
"0.57072103",
"0.5679756",
"0.5606789",
"0.5581873",
"0.55539227",
"0.5527742",
"0.55214655",
"0.5490343",
"0.54241663",
"0.53941226",
"0.53548354",
"0.5341178",
"0.53... | 0.7509083 | 0 |
Creates a Deployment Manager. [Arguments] | def fusion_api_create_deployment_manager(self, body, api=None, headers=None):
return self.dep_mgr.create(body=body, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_podmanager(cls, values):\n return cls.dbdriver.create_podmanager(values)",
"def create_manager(self, username, tenancy):\n raise NotImplementedError",
"def create_manager(app, db):\n manager = Manager(app)\n\n manager.add_command(\"runserver\", Server())\n\n def make_shell_con... | [
"0.6148503",
"0.6106779",
"0.59578663",
"0.59382886",
"0.5600401",
"0.5570314",
"0.5496767",
"0.5469237",
"0.5436702",
"0.54037696",
"0.53826296",
"0.53341144",
"0.5308474",
"0.53061575",
"0.5288264",
"0.5222923",
"0.51940596",
"0.51562995",
"0.5129845",
"0.51202434",
"0.5110... | 0.72286177 | 0 |
Updates a Deployment Manager. [Arguments] | def fusion_api_update_deployment_manager(self, body=None, uri=None, api=None, headers=None):
return self.dep_mgr.update(body=body, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def manager_update(self, manager, config):\n self.request('/v1.1/managers/configs/%s' % manager, 'POST', body=config)",
"def update_podmanager(cls, podmanager_uuid, values):\n return cls.dbdriver.update_podmanager(podmanager_uuid, values)",
"def fusion_api_update_hypervisor_manager(self, body=Non... | [
"0.66454226",
"0.6606417",
"0.5710404",
"0.5449812",
"0.5437378",
"0.5316729",
"0.5316729",
"0.53141195",
"0.52908653",
"0.52317894",
"0.5228793",
"0.520537",
"0.52035236",
"0.5133824",
"0.51167214",
"0.5114726",
"0.5045032",
"0.503883",
"0.5027585",
"0.49912292",
"0.49884212... | 0.7084983 | 0 |
Deletes a Deployment Manager. [Arguments] | def fusion_api_delete_deployment_manager(self, name=None, uri=None, api=None, headers=None):
return self.dep_mgr.delete(name=name, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_podmanager(cls, podmanager_uuid):\n cls.dbdriver.delete_podmanager(podmanager_uuid)",
"def manager_remove(self, manager):\n self.request('/v1.1/managers/configs/%s' % manager, 'DELETE')",
"def delete_deployment(request, deployment, **_kwargs):\n pass",
"def fusion_api_delete_hyper... | [
"0.69262546",
"0.66423124",
"0.6501913",
"0.6232213",
"0.5951453",
"0.5951453",
"0.58923715",
"0.5875943",
"0.58508486",
"0.57864344",
"0.5729849",
"0.57091665",
"0.5703853",
"0.56583726",
"0.5641767",
"0.5613142",
"0.5593527",
"0.55735373",
"0.5569031",
"0.55578",
"0.555631"... | 0.7267033 | 0 |
Gets a hypervisor Manager. [Arguments] | def fusion_api_get_hypervisor_manager(self, uri=None, param='', api=None, headers=None):
return self.hypervisor_mgr.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetManager(self):\r\n\r\n return self.manager",
"def get_manager():\n\n return multiprocessing.Manager()",
"def getManager(self):\n return self._manager",
"def get_manager(api_version=None):\n from manager import get_keystone_manager\n return get_keystone_manager(get_local_endp... | [
"0.6979449",
"0.67611295",
"0.66910297",
"0.6666388",
"0.66302234",
"0.65858084",
"0.6492841",
"0.61952776",
"0.61311185",
"0.6104131",
"0.59339416",
"0.58791596",
"0.5862384",
"0.5799686",
"0.57992333",
"0.57717127",
"0.57673347",
"0.5757488",
"0.5752421",
"0.5737294",
"0.57... | 0.800843 | 0 |
Creates a hypervisor Manager. [Arguments] | def fusion_api_create_hypervisor_manager(self, body, api=None, headers=None):
return self.hypervisor_mgr.create(body=body, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_manager(self, username, tenancy):\n raise NotImplementedError",
"def create_manager(\n pdb_hierarchy,\n geometry_restraints_manager,\n fmodel,\n wavelength,\n params,\n resolution_factor = 0.25,\n nproc = Auto,\n verbose = False,\n log = None,\n manager_class=None)... | [
"0.6740068",
"0.62326854",
"0.6093036",
"0.60881156",
"0.6008856",
"0.5954897",
"0.59497124",
"0.5865377",
"0.5721835",
"0.56874454",
"0.56452775",
"0.56088275",
"0.56063145",
"0.554333",
"0.54826665",
"0.5461298",
"0.5404432",
"0.5404395",
"0.53953975",
"0.5392871",
"0.53741... | 0.7718598 | 0 |
Updates a hypervisor Manager. [Arguments] | def fusion_api_update_hypervisor_manager(self, body=None, uri=None, api=None, headers=None):
return self.hypervisor_mgr.update(body=body, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def manager_update(self, manager, config):\n self.request('/v1.1/managers/configs/%s' % manager, 'POST', body=config)",
"def fusion_api_create_hypervisor_manager(self, body, api=None, headers=None):\n return self.hypervisor_mgr.create(body=body, api=api, headers=headers)",
"async def light_ma... | [
"0.66171026",
"0.582097",
"0.5712763",
"0.56886685",
"0.56004804",
"0.56004804",
"0.55416906",
"0.55198437",
"0.53832316",
"0.5369145",
"0.5321215",
"0.5302087",
"0.52570873",
"0.52438563",
"0.52284807",
"0.52227217",
"0.52209795",
"0.5214909",
"0.5200389",
"0.5195968",
"0.51... | 0.77996296 | 0 |
Deletes a hypervisor Manager. [Arguments] | def fusion_api_delete_hypervisor_manager(self, name=None, uri=None, api=None, headers=None):
return self.hypervisor_mgr.delete(name=name, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_podmanager(cls, podmanager_uuid):\n cls.dbdriver.delete_podmanager(podmanager_uuid)",
"def manager_remove(self, manager):\n self.request('/v1.1/managers/configs/%s' % manager, 'DELETE')",
"def delete(self):\n self.manager.delete(self.name)",
"def delete(self):\n self.ma... | [
"0.6937779",
"0.67486507",
"0.63681626",
"0.63681626",
"0.6347231",
"0.6175517",
"0.6060668",
"0.59882313",
"0.59756935",
"0.5936945",
"0.59265184",
"0.58496314",
"0.5802527",
"0.5783574",
"0.57668984",
"0.57509613",
"0.57486266",
"0.57470006",
"0.5669473",
"0.55834955",
"0.5... | 0.806357 | 0 |
Gets a Hypervisor clusters. [Arguments] | def fusion_api_get_hypervisor_clusters(self, uri=None, param='', api=None, headers=None):
return self.hypervisor_clusters.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_clusters(self):\n fields = ['name', ]\n return self.get_data(\"clusters\", fields)",
"def list_clusters(self, **kwargs):\n return self._get_names('SCVMHostCluster')",
"def get_clusters(self):\r\n\r\n return self.__clusters",
"def _get_cluster_list(self):\n return self._... | [
"0.7424538",
"0.7212302",
"0.71992284",
"0.7133369",
"0.7071449",
"0.70424414",
"0.697467",
"0.693924",
"0.69356865",
"0.6861388",
"0.68498963",
"0.68434745",
"0.6812175",
"0.6797095",
"0.67725927",
"0.6652517",
"0.66451806",
"0.6602558",
"0.6587589",
"0.6474094",
"0.6470819"... | 0.80251724 | 0 |
Gets a Hypervisor cluster profile. [Arguments] | def fusion_api_get_hypervisor_cluster_profile(self, uri=None, param='', api=None, headers=None):
return self.cluster_profile.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cluster(self, profile):\n if self._value.has_option(profile, 'cluster'):\n if self._value.has_option(profile, 'cluster'):\n cluster = self._value.get(profile, 'cluster')\n self.logger.info(\"Connecting to: %s cluster\" % cluster)\n else:\n ... | [
"0.71974623",
"0.645041",
"0.6425894",
"0.6204044",
"0.6123612",
"0.60758156",
"0.6050714",
"0.59964824",
"0.59913784",
"0.59863085",
"0.5854982",
"0.5842499",
"0.58419126",
"0.57995874",
"0.57753825",
"0.5745835",
"0.57405496",
"0.5696487",
"0.56512314",
"0.56255156",
"0.561... | 0.80410475 | 0 |
Creates a hypervisor cluster profile. [Arguments] | def fusion_api_create_hypervisor_cluster_profile(self, body, api=None, headers=None):
return self.cluster_profile.create(body=body, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_hyperflex_cluster_profile(self):\n pass",
"def create_cluster():\n config = get_kube_config()\n command = CLUSTER_CREATE_COMMAND.replace('\\n','').format(cluster_name=config['cluster_name'],\n project_name=config['project_na... | [
"0.7299049",
"0.6737419",
"0.6406335",
"0.63813174",
"0.62996036",
"0.6183486",
"0.61396635",
"0.6103186",
"0.6031262",
"0.6022853",
"0.6017192",
"0.5997851",
"0.5964505",
"0.5943418",
"0.5941464",
"0.5923629",
"0.5901515",
"0.5809093",
"0.57562375",
"0.57538897",
"0.5749142"... | 0.78777266 | 0 |
Updates a hypervisor cluster profile. [Arguments] | def fusion_api_update_hypervisor_cluster_profile(self, uri=None, body=None, api=None, headers=None):
return self.cluster_profile.update(body=body, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_update_hyperflex_cluster_profile(self):\n pass",
"def update_network_profile(self, profile, body=None):\r\n return self.put(self.network_profile_path % (profile), body=body)",
"def update_cluster(self, cluster, params, *args, **kwargs):\n raise NotImplementedError",
"def fusion_... | [
"0.69869",
"0.65845144",
"0.6579093",
"0.6464687",
"0.6215387",
"0.60455185",
"0.6026187",
"0.60101837",
"0.59323263",
"0.5911774",
"0.5902939",
"0.58916545",
"0.5850991",
"0.57385135",
"0.5716251",
"0.5682264",
"0.567401",
"0.56732166",
"0.56196904",
"0.55932254",
"0.5577131... | 0.8152496 | 0 |
Deletes a hypervisor cluster profile. [Arguments] | def fusion_api_delete_hypervisor_cluster_profile(self, name=None, uri=None, api=None, headers=None):
return self.cluster_profile.delete(name, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_delete_hyperflex_cluster_profile(self):\n pass",
"def delete_network_profile(arn=None):\n pass",
"def delete(profile, name):\n client = boto3client.get(\"iam\", profile)\n params = {}\n params[\"InstanceProfileName\"] = name\n return client.delete_instance_profile(**params)",
"... | [
"0.73555297",
"0.7025996",
"0.6983594",
"0.69076455",
"0.64352804",
"0.643093",
"0.6422486",
"0.64189655",
"0.6414927",
"0.63980794",
"0.6384168",
"0.6366012",
"0.62055856",
"0.61796516",
"0.6123568",
"0.6111072",
"0.60962975",
"0.6093105",
"0.6040947",
"0.5955083",
"0.592536... | 0.8240659 | 0 |
Creates a virtual switch layout. [Arguments] | def fusion_api_create_virtual_switch_layout(self, body, api=None, headers=None):
return self.cluster_profile.create(body=body, api=api, headers=headers, param='/virtualswitch-layout') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_layout( self ):",
"def create_logical_router(self, switch):\n if self.nb_api is None:\n self.nb_api = api_nb.NbApi.get_instance(False)\n\n # TODO: lswitch from nb api\n router_ports = []\n dpid = str(switch.dp.id)\n\n for port in switch.ports:\n ... | [
"0.6015329",
"0.57742697",
"0.56836456",
"0.5482166",
"0.54532725",
"0.5418142",
"0.53833425",
"0.53744787",
"0.5351992",
"0.53280634",
"0.53216034",
"0.53180486",
"0.5310005",
"0.53014076",
"0.52938443",
"0.524624",
"0.5244449",
"0.5193772",
"0.51780003",
"0.5163845",
"0.514... | 0.67626137 | 0 |
Gets a Hypervisor host profile. [Arguments] | def fusion_api_get_hypervisor_host_profile(self, uri=None, param='', api=None, headers=None):
return self.host_profile.get(uri, api, headers, param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_get_hypervisor_cluster_profile(self, uri=None, param='', api=None, headers=None):\n return self.cluster_profile.get(uri=uri, api=api, headers=headers, param=param)",
"def fusion_api_get_hypervisor_host(self, uri=None, param='', api=None, headers=None): # pylint: disable=unused-argument... | [
"0.6291275",
"0.62387",
"0.59896106",
"0.5946244",
"0.5946244",
"0.5942801",
"0.5914829",
"0.58072954",
"0.5784481",
"0.5778",
"0.57352436",
"0.5682452",
"0.5610289",
"0.5591172",
"0.55779195",
"0.5567231",
"0.5545119",
"0.5533411",
"0.55181134",
"0.5480795",
"0.5428293",
"... | 0.80805653 | 0 |
Updates a hypervisor host profile. [Arguments] | def fusion_api_update_hypervisor_host_profile(self, uri=None, body=None, api=None, headers=None):
return self.host_profile.update(body, uri, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_update_hypervisor_cluster_profile(self, uri=None, body=None, api=None, headers=None):\n return self.cluster_profile.update(body=body, uri=uri, api=api, headers=headers)",
"def update_network_profile(self, profile, body=None):\r\n return self.put(self.network_profile_path % (profi... | [
"0.6738024",
"0.63721013",
"0.6303127",
"0.6171435",
"0.6132946",
"0.6038028",
"0.59906864",
"0.5918259",
"0.5901422",
"0.58302",
"0.5811974",
"0.5763593",
"0.57516897",
"0.5698796",
"0.56739473",
"0.567078",
"0.5663646",
"0.56575376",
"0.56191176",
"0.55845803",
"0.5581878",... | 0.80823314 | 0 |
Edit the remote support to initiate remote support registration [Example] ${resp} = Fusion Api Edit Remote Support | | | | def fusion_api_edit_remote_support(self, body, api=None, headers=None):
return self.remote_support.update(body, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edit(cm_response, **data):\n return cm_response",
"def respond(self, resp):\n self.push(resp + '\\r\\n')\n self.logline('==> %s' % resp)",
"def setResponse(self, response):\n if(Debug_Level==2):\n print'response =',response \n #removing the end line and splitti... | [
"0.56080025",
"0.54728335",
"0.5336991",
"0.53315264",
"0.52677256",
"0.5175285",
"0.51725364",
"0.51725364",
"0.5153644",
"0.512804",
"0.5109952",
"0.50710225",
"0.5068613",
"0.50233895",
"0.50152797",
"0.5004218",
"0.49749124",
"0.49616578",
"0.49452564",
"0.49318555",
"0.4... | 0.5913376 | 0 |
Get the remote support configuration details [Example] ${resp} = Fusion Api Get Configuration | | | | def fusion_api_get_configuration(self, uri=None, param='', api=None, headers=None):
return self.configuration.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_config(req):\n #try:\n # user_id = req.user\n #except KeyError as e:\n # msg = req.get_error_msg(e)\n # return send_error_response(msg)\n try:\n config = tools_config_get_config(req)\n except Exception:\n raise http_exc.HTTPClientError()\n else:\n retur... | [
"0.66445255",
"0.61464477",
"0.614004",
"0.6097132",
"0.6057521",
"0.6036706",
"0.6006283",
"0.5937391",
"0.5936521",
"0.590213",
"0.5879762",
"0.5877101",
"0.5839141",
"0.58137393",
"0.5808278",
"0.57864505",
"0.5757012",
"0.5752552",
"0.57210034",
"0.5696712",
"0.5687088",
... | 0.62298936 | 1 |
Create OS Deployment Server. [Arguments] | def fusion_api_create_os_deploymentserver(self, body, api=None, headers=None):
return self.osds.create(body, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_server(DisableAutomatedBackup=None, Engine=None, EngineModel=None, EngineVersion=None, EngineAttributes=None, BackupRetentionCount=None, ServerName=None, InstanceProfileArn=None, InstanceType=None, KeyPair=None, PreferredMaintenanceWindow=None, PreferredBackupWindow=None, SecurityGroupIds=None, ServiceR... | [
"0.6567448",
"0.6424248",
"0.64162976",
"0.63874674",
"0.63142943",
"0.6168334",
"0.61501795",
"0.61205155",
"0.6112681",
"0.6051007",
"0.60456806",
"0.6044642",
"0.6022895",
"0.599268",
"0.59312016",
"0.58959",
"0.582929",
"0.58238673",
"0.58151454",
"0.580947",
"0.5804975",... | 0.70523727 | 0 |
Delete OS Deployment server. [Arguments] | def fusion_api_delete_os_deploymentserver(self, name=None, uri=None, param='', api=None, headers=None):
return self.osds.delete(name=name, uri=uri, param=param, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_server(ServerName=None):\n pass",
"def delete(args):\n if args.tag is not None:\n tag = str(args.tag)\n interface = DigitalOceanSetup.create_interface()\n # Delete everything matching the tag\n interface.destroy_machines_by_tag(tag)\n elif a... | [
"0.7311343",
"0.7191963",
"0.698584",
"0.65994453",
"0.64927745",
"0.6424388",
"0.6421005",
"0.63916403",
"0.63363886",
"0.62683016",
"0.6262936",
"0.62379235",
"0.6201516",
"0.6142421",
"0.61166936",
"0.61104494",
"0.6102672",
"0.60981226",
"0.59932476",
"0.598643",
"0.59757... | 0.758158 | 0 |
Gets value of the OS Deployment Server is available [Arguments] | def fusion_api_get_os_deploymentserver(self, uri=None, param='', api=None, headers=None):
return self.osds.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"server\")",
"def get_server():\n pass",
"def config_server(self) -> Optional[pulumi.Input['ConfigServerSettingsArgs']]:\n return pulumi.get(self, \"config_server\")",
"def get_os_version(self):\n\t\treturn call_sdk_... | [
"0.6122306",
"0.6116507",
"0.60377234",
"0.5933984",
"0.59329784",
"0.59246665",
"0.5922845",
"0.5922845",
"0.58639693",
"0.5771792",
"0.57105774",
"0.57105774",
"0.56729096",
"0.56728786",
"0.5656897",
"0.5648294",
"0.5638455",
"0.56105363",
"0.5601789",
"0.55934906",
"0.558... | 0.659178 | 0 |
Gets value of an i3s appliance [Arguments] | def fusion_api_get_i3sappliance_uri(self, uri=None, param='', api=None, headers=None):
return self.osds.geti3suri(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_ami ( s3_infra_conn, region_name, env_type, app_name ) :\n ami_bucket = get_admin_bucket_name( region_name = region_name )\n return retrieve_s3_contents( s3_conn = s3_infra_conn,\n bucket_name = ami_bucket,\n key_name = get_ami_keypa... | [
"0.6054499",
"0.5129115",
"0.5069351",
"0.50430375",
"0.50374556",
"0.5037109",
"0.49930125",
"0.49121296",
"0.48898426",
"0.48777938",
"0.4867673",
"0.4867673",
"0.4867673",
"0.4867673",
"0.4867673",
"0.4867673",
"0.48612306",
"0.48609614",
"0.48272517",
"0.4798483",
"0.4786... | 0.5175439 | 1 |
Gets OS Deployment Plan [Arguments] | def fusion_api_get_os_deploymentplan(self, uri=None, param='', api=None, headers=None):
return self.osds.getosdp(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_deployment_parameters(plan_name):\n pass",
"def plan_get(request):\n company = auth_api_key(request)\n plan = get_and_check_plan(request, company)\n return plan",
"def deploy_plan(plan_name):\n pass",
"def plan(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"pl... | [
"0.68726015",
"0.63036317",
"0.59006155",
"0.5568436",
"0.5565372",
"0.55153424",
"0.5511352",
"0.5364062",
"0.5345589",
"0.53239554",
"0.5298429",
"0.5253463",
"0.52343905",
"0.5222922",
"0.521661",
"0.5208022",
"0.5189935",
"0.5159971",
"0.51265657",
"0.50976896",
"0.507150... | 0.6821857 | 1 |
Adds Fabric Manager to One View [Arguments] | def fusion_api_create_fabric_manager(self, body, api=None, headers=None):
return self.fabricmanager.post(body, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_view( *args, **kwargs ):",
"def add_view(self, *args, **kwargs):\n return self._resources_manager.add_view(*args, **kwargs)",
"def manager():\n pass",
"def add_views(self, *args):\n for view in args:\n self.add_view(view)",
"def manage_afterAdd(self, item, container) :\n... | [
"0.59634304",
"0.5662595",
"0.5455031",
"0.5405313",
"0.53803706",
"0.534478",
"0.5262761",
"0.5262761",
"0.5262761",
"0.5087117",
"0.5053838",
"0.504193",
"0.50273764",
"0.50249666",
"0.5023837",
"0.5022318",
"0.4999911",
"0.49980935",
"0.49980935",
"0.49811444",
"0.4964837"... | 0.5848207 | 1 |
Gets the Fabric Manager details for the provided name or list of all Fabric Managers if name is not provided [Arguments] | def fusion_api_get_fabric_manager(self, uri=None, param='', api=None, headers=None):
return self.fabricmanager.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_get_fabric_manager_tenants(self, uri, name=None, param='', api=None, headers=None):\n param = '/tenants/'\n if name:\n param += '?&filter=\"\\'name\\' == \\'%s\\'\"' % (name)\n return self.fabricmanager.get(uri=uri, api=api, headers=headers, param=para... | [
"0.60854346",
"0.59693724",
"0.59690547",
"0.59468293",
"0.56654155",
"0.5441895",
"0.53470236",
"0.5284382",
"0.52781856",
"0.5217851",
"0.520762",
"0.51865655",
"0.5180018",
"0.51691216",
"0.514083",
"0.51072943",
"0.50171417",
"0.49826366",
"0.49755776",
"0.49681163",
"0.4... | 0.63042766 | 0 |
Deletes the Fabric Manager [Arguments] | def fusion_api_delete_fabric_manager(self, name, uri=None, api=None, headers=None):
return self.fabricmanager.delete(name=name, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rm(args):\n args.delete = True\n return remove(args)",
"def delete(self):\n self.manager.delete(self.name)",
"def delete(self):\n self.manager.delete(self.name)",
"def delete(self):\n os.system(\"rm \"+self._name)",
"def delete(args, config):\n print('Deletes a selected HP... | [
"0.6673103",
"0.6598021",
"0.6598021",
"0.65250075",
"0.6506779",
"0.64955616",
"0.64426833",
"0.6403957",
"0.63426346",
"0.6341505",
"0.6298142",
"0.6287084",
"0.62784547",
"0.6251517",
"0.6181623",
"0.6166767",
"0.61451185",
"0.6132013",
"0.6025371",
"0.6014678",
"0.6004683... | 0.72733957 | 0 |
Edits Fabric Manager [Arguments] | def fusion_api_edit_fabric_manager(self, body, uri, api=None, headers=None):
return self.fabricmanager.put(body=body, uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edit():",
"def edit(self, **kwargs):\n ...",
"async def edit(self, *, name, roles: Optional[Any] = ..., reason: Optional[Any] = ...):\n ...",
"def edit(argv):\n output = lib.output.CLIoutput(\"vadapter\")\n valid_list = ['assignment_type','component_mask' ,'vfabric_id', 'init_type', '... | [
"0.5791912",
"0.5778062",
"0.55881244",
"0.5558738",
"0.5506726",
"0.5498924",
"0.5436379",
"0.54148054",
"0.53646386",
"0.53453696",
"0.53438175",
"0.53438175",
"0.5334068",
"0.53141785",
"0.5312301",
"0.5311755",
"0.52907723",
"0.526777",
"0.5249392",
"0.52193946",
"0.52171... | 0.6381094 | 0 |
Gets Tenants for the provided Fabric Manager [Arguments] | def fusion_api_get_fabric_manager_tenants(self, uri, name=None, param='', api=None, headers=None):
param = '/tenants/'
if name:
param += '?&filter="\'name\' == \'%s\'"' % (name)
return self.fabricmanager.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tenants():\n # these are the tenant_id strings configured for the service -\n tenants_strings = conf.tenants\n result = []\n # the tenants service is a special case, as it must be a) configured to serve all tenants and b) actually maintains\n # the list of tenants in its own DB. in this case... | [
"0.5958651",
"0.584731",
"0.57416695",
"0.5416656",
"0.5394366",
"0.5332738",
"0.52771735",
"0.5249437",
"0.5218875",
"0.51591974",
"0.5118933",
"0.5095858",
"0.5093036",
"0.5080304",
"0.50682324",
"0.4968553",
"0.4935974",
"0.4935974",
"0.49077785",
"0.4867381",
"0.48321927"... | 0.70706767 | 0 |
Initiates Fabric Manager Refresh using Snapshot API [Arguments] | def fusion_api_fabric_manager_refresh(self, body, uri, api=None, headers=None):
param = '/snapshot/'
return self.fabricmanager.put(body=body, uri=uri, param=param, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Refresh(self, *args, **kwargs):\n # type: (*Any, **Any) -> None\n payload = {}\n for i in range(len(args)):\n payload[\"Arg%s\" % (i + 1)] = args[i]\n for item in kwargs.items():\n payload[item[0]] = item[1]\n return self._execute(\"refresh\", payload=pa... | [
"0.58108914",
"0.56057084",
"0.55814093",
"0.55398834",
"0.5529131",
"0.5527788",
"0.55108947",
"0.53939646",
"0.5334728",
"0.530829",
"0.529463",
"0.52867246",
"0.52867246",
"0.52739894",
"0.523049",
"0.5227205",
"0.5202879",
"0.5193885",
"0.51764804",
"0.5140236",
"0.513587... | 0.6941463 | 0 |
Gets Reports for Fabric Manager [Arguments] Uri of the existing Fabric Manager or Tenant | def fusion_api_get_fabric_manager_report(self, uri, api=None, headers=None):
param = '/report/'
return self.fabricmanager.get(uri=uri, api=api, headers=headers, param=param) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_get_fabric_manager(self, uri=None, param='', api=None, headers=None):\n return self.fabricmanager.get(uri=uri, api=api, headers=headers, param=param)",
"def fusion_api_get_fabric_manager_tenants(self, uri, name=None, param='', api=None, headers=None):\n param = '/tenants/'\n ... | [
"0.56766737",
"0.54050255",
"0.5230322",
"0.5214337",
"0.5190606",
"0.5153666",
"0.5005133",
"0.4954604",
"0.49541247",
"0.4939854",
"0.49134123",
"0.49134123",
"0.48381823",
"0.481615",
"0.48036653",
"0.47944608",
"0.47694454",
"0.47487447",
"0.4656791",
"0.4603878",
"0.4581... | 0.70640254 | 0 |
Adds an rackmaager to the appliance [Arguments] | def fusion_api_add_rack_manager(self, body, api=None, headers=None):
return self.rackmanager.post(body, api, headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_add_rack(self, body, api=None, headers=None):\n return self.rack.create(body, api, headers)",
"def add(self, arguments):\n url = arguments['<location>']\n if url:\n name = arguments['<name>']\n else:\n url = arguments['<name>']\n nam... | [
"0.5335254",
"0.52000356",
"0.519472",
"0.5162352",
"0.5091715",
"0.50824",
"0.50122625",
"0.5003473",
"0.49970138",
"0.49732828",
"0.49596536",
"0.4910242",
"0.48956198",
"0.4864047",
"0.48495474",
"0.48495474",
"0.48495474",
"0.48479155",
"0.48257363",
"0.48086825",
"0.4787... | 0.55991477 | 0 |
Gets a Rack Manager [Arguments] | def fusion_api_get_rack_manager(self, uri=None, api=None, headers=None):
return self.rackmanager.get(uri=uri, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cli_arguments(self):\n pass",
"def get_options():\n parser = argparse.ArgumentParser(\n description=\"view the aria2 queue on localhost:6800\",\n )\n # parser.add_argument() calls here\n options = parser.parse_args()\n # extra processing of options here\n retu... | [
"0.55990356",
"0.5466417",
"0.54518133",
"0.54118025",
"0.5386328",
"0.53435844",
"0.5313144",
"0.52774763",
"0.5259597",
"0.52551603",
"0.5208383",
"0.5194557",
"0.51910126",
"0.5186137",
"0.5174422",
"0.5167607",
"0.5161358",
"0.51293916",
"0.5108545",
"0.5103814",
"0.51020... | 0.575111 | 0 |
Deletes Rack Manager from the appliance based on uri [Arguments] | def fusion_api_delete_rack_manager(self, uri, name=None, param='', api=None, headers=None):
return self.rackmanager.delete(uri=uri, name=name, param=param, api=api, headers=headers) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fusion_api_remove_rack(self, name=None, uri=None, api=None, headers=None):\n return self.rack.delete(name, uri, api, headers)",
"def fusion_api_remove_san_manager(self, name=None, uri=None, api=None, headers=None):\n return self.dm.delete(name, uri, api, headers)",
"def fusion_api_del... | [
"0.68630743",
"0.67151904",
"0.6714827",
"0.6587817",
"0.6407161",
"0.63303494",
"0.615097",
"0.6058198",
"0.6026346",
"0.59584045",
"0.5894118",
"0.58919597",
"0.5862057",
"0.583348",
"0.5830776",
"0.57852274",
"0.575848",
"0.5754835",
"0.57540447",
"0.5753239",
"0.574271",
... | 0.79687536 | 0 |
Initialize particles to be consistent with a uniform prior. Each particle is a tuple of ghost positions. Use self.numParticles for | def initializeParticles(self):
import itertools
import random
#create a list of possible ghost permutations, where each of three ghosts can be on any of the legal positions in the boards.
permutations = list(itertools.product(self.legalIntentions, repeat=self.numAgents))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_particles(self):\n \n # Each particle is a dimension-K vector. We generate each particle \n # uniformly at random from the space [0,1]^K. \n self.Particles = np.random.uniform(0, 1, (self.Npar, self.K))\n #print(\"Particles: \", self.Particles) \n return None",
... | [
"0.73676294",
"0.7053749",
"0.68827",
"0.6763224",
"0.671548",
"0.6645336",
"0.6637801",
"0.66186696",
"0.6572894",
"0.6544678",
"0.64980954",
"0.6426581",
"0.6356929",
"0.6327402",
"0.63196164",
"0.62938076",
"0.6253168",
"0.62287265",
"0.6143017",
"0.6065585",
"0.60641867",... | 0.7536992 | 0 |
Get the value of the ADDONSPATH variable. | def get_cached_addon_path():
settingspath = get_cached_setting_path()
if not settingspath:
logger.error("#SETTINGSPATH# resolution required but was not found")
return
return os.path.join(settingspath, "Addons") + "\\" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_abs_path(self, value):\n return os.path.abspath(os.path.expanduser(os.path.expandvars(value)))",
"def location(self):\n\n p = os.path.abspath(__file__)\n pathSP = os.path.split(p)\n return pathSP",
"def _GetSystemPath():\n return encoding_util.GetEncodedValue(os.environ, \"PATH... | [
"0.6033623",
"0.5921134",
"0.58051646",
"0.5630593",
"0.5581429",
"0.5525819",
"0.55247533",
"0.5490318",
"0.5476768",
"0.54625976",
"0.54127926",
"0.53831667",
"0.5338885",
"0.5338132",
"0.53280693",
"0.53262985",
"0.52948344",
"0.5281537",
"0.52779865",
"0.52707076",
"0.526... | 0.5957791 | 1 |
Get the VOLTHA PORT object for this port | def get_port(self):
if self._port is None:
self._port = Port(port_no=self._port_no,
label=self._label,
type=Port.PON_OLT,
admin_state=AdminState.ENABLED,
oper_status=OperStatus.ACT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_port(self):\n return self.__port",
"def getPort(self):\n return self._port",
"def get_port(self):\n return self.__port",
"def getPort(self):\n return self._port",
"def get_port(self):\n return self.port",
"def get_port(self):\n \n return self._por... | [
"0.6576839",
"0.6366624",
"0.63357687",
"0.628415",
"0.62502146",
"0.62232053",
"0.59385276",
"0.5834423",
"0.58323324",
"0.5817069",
"0.5712418",
"0.5707369",
"0.56816727",
"0.564813",
"0.56160957",
"0.5613599",
"0.55900675",
"0.55900675",
"0.5557575",
"0.55402493",
"0.55366... | 0.69255394 | 0 |
Get the VOLTHA logical port for this port. For PON ports, a logical port is not currently created, so always return None | def get_logical_port(self):
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_port(self):\n if self._port is None:\n self._port = Port(port_no=self._port_no,\n label=self._label,\n type=Port.PON_OLT,\n admin_state=AdminState.ENABLED,\n oper_status=Ope... | [
"0.69949347",
"0.6425281",
"0.6324397",
"0.6155099",
"0.61252946",
"0.608648",
"0.6081095",
"0.60716444",
"0.6043632",
"0.60040736",
"0.5972916",
"0.5964086",
"0.5931539",
"0.59029865",
"0.59029865",
"0.58882225",
"0.58602065",
"0.5801619",
"0.57786167",
"0.5769991",
"0.57699... | 0.73856133 | 0 |
Process PON status poll request | def process_status_poll(self, status):
self.log.debug('process-status-poll', status=status)
if self._admin_state != AdminState.ENABLED:
return
# Get new/missing from the discovered ONU leaf. Stale ONUs from previous
# configs are now cleaned up during h/w re-sync/reflow.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def poll(self, poll_input):",
"def _process_pool_status_response(self, buf, length):\n\t\tself.pcpResInfo.pcp_add_json_result('command_status', 'success')\n\t\tvalue, index = self._getNextString(buf, 0)\n\t\tif value == 'ArraySize':\n\t\t\tindex += 1\n\t\t\tci_size = buf[index:]\n\t\t\tci_size = self.bytes_to_in... | [
"0.66186523",
"0.6358219",
"0.5927366",
"0.58907",
"0.58850914",
"0.5843748",
"0.5833384",
"0.5741044",
"0.5719501",
"0.5672158",
"0.56507057",
"0.56396514",
"0.5633935",
"0.5629005",
"0.5579656",
"0.5574",
"0.5571632",
"0.5566738",
"0.5507098",
"0.5507098",
"0.5507098",
"0... | 0.68012106 | 0 |
Process ONU status for this PON | def _update_onu_status(self, onus):
for onu_id, onu_status in onus.iteritems():
if onu_id in self._onu_by_id:
self._onu_by_id[onu_id].rssi = onu_status.rssi
self._onu_by_id[onu_id].equalization_delay = onu_status.equalization_delay
self._onu_by_id[onu_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_status_poll(self, status):\n self.log.debug('process-status-poll', status=status)\n\n if self._admin_state != AdminState.ENABLED:\n return\n\n # Get new/missing from the discovered ONU leaf. Stale ONUs from previous\n # configs are now cleaned up during h/w re-sy... | [
"0.655683",
"0.6364406",
"0.5901802",
"0.5859409",
"0.573432",
"0.5732758",
"0.57218087",
"0.567886",
"0.5675471",
"0.56213325",
"0.55984366",
"0.55904573",
"0.5551701",
"0.5540505",
"0.55091304",
"0.54808426",
"0.547645",
"0.54632586",
"0.54630697",
"0.5462684",
"0.54545075"... | 0.70205426 | 0 |
Parse through available xPON information for ONU configuration settings | def _get_onu_info(self, serial_number):
try:
from flow.demo_data import get_tconts, get_gem_ports, get_onu_id
if self.activation_method == "autoactivate":
onu_id = get_onu_id(serial_number)
if onu_id is None:
onu_id = self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parse_knx(self, config):\n\t\tif \"knx\" in config:\n\t\t\tself._knx = config[\"knx\"]\n\t\tfor item in self._knx[\"sensors\"]:\n\t\t\tif not \"address\" in item:\n\t\t\t\traise ValueError(\"Missing address for KNX sensor\")\n\t\tfor item in self._knx[\"switches\"]:\n\t\t\tif not \"address\" in item:\n\t\t\t\... | [
"0.5860691",
"0.53012323",
"0.52924263",
"0.5150295",
"0.50907314",
"0.49680468",
"0.49017316",
"0.4875954",
"0.48654738",
"0.48572677",
"0.48541096",
"0.48308924",
"0.48128533",
"0.4808714",
"0.47831556",
"0.47818446",
"0.4748246",
"0.47355053",
"0.47156107",
"0.47149676",
"... | 0.56708354 | 1 |
Called when a new ONU is discovered and VOLTHA device adapter needs to be informed | def activate_onu(self, onu):
if self.olt.autoactivate:
self.log.info('activate-onu', onu=onu)
olt = self.olt
adapter = self.adapter_agent
channel_id = onu.onu_vid
proxy = onu.proxy_address
# NOTE: The following method will be deprecated.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_discovered():\n event.set()",
"def on_connect(client, userdata, flags, rc):\n\t# subscribe to the LEDs topic when connected\n\tclient.subscribe(\"SNHU/IT697/leds\")",
"def test_device_on(self):\n self.ms.add_response({'\\x14081031031E226410\\x0D': 'PA\\x0D'})\n # Network / Devic... | [
"0.65213245",
"0.6183199",
"0.6078185",
"0.6038242",
"0.6008273",
"0.5960707",
"0.59480184",
"0.5902333",
"0.58434427",
"0.5833241",
"0.5729351",
"0.5601769",
"0.55898815",
"0.55544865",
"0.55472565",
"0.55431855",
"0.55277807",
"0.55186784",
"0.5476209",
"0.5475365",
"0.5475... | 0.6676301 | 0 |
Delete/enable/disable a specified channel partition on this PON. When creating a new Channel Partition, create it disabled, then define any associated Channel Pairs. Then enable the Channel Partition. | def channel_partition(self, name, partition=0, xpon_system=0, operation=None):
if operation.lower() not in ['delete', 'enable', 'disable']:
raise ValueError('Unsupported operation: {}'.format(operation))
try:
xml = 'interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_pair(self, name, partition, operation=None, **kwargs):\n if operation.lower() not in ['delete', 'enable', 'disable']:\n raise ValueError('Unsupported operation: {}'.format(operation))\n\n try:\n xml = 'interfaces xmlns=\"urn:ietf:params:xml:ns:yang:ietf-interfaces\"'... | [
"0.5930615",
"0.5629349",
"0.5421836",
"0.52993655",
"0.52665484",
"0.5152782",
"0.5028327",
"0.49557593",
"0.48950937",
"0.4868015",
"0.4856679",
"0.47942936",
"0.47765732",
"0.47706714",
"0.47600013",
"0.4758206",
"0.47271204",
"0.47198334",
"0.4715526",
"0.47069684",
"0.46... | 0.7122026 | 0 |
Create/delete a channel pair on a specific channel_partition for a PON | def channel_pair(self, name, partition, operation=None, **kwargs):
if operation.lower() not in ['delete', 'enable', 'disable']:
raise ValueError('Unsupported operation: {}'.format(operation))
try:
xml = 'interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channel_partition(self, name, partition=0, xpon_system=0, operation=None):\n if operation.lower() not in ['delete', 'enable', 'disable']:\n raise ValueError('Unsupported operation: {}'.format(operation))\n\n try:\n xml = 'interfaces xmlns=\"urn:ietf:params:xml:ns:yang:ietf-i... | [
"0.61758345",
"0.53666586",
"0.5140615",
"0.4981957",
"0.49264306",
"0.4917317",
"0.4888045",
"0.48726103",
"0.48679605",
"0.48194185",
"0.48172766",
"0.47911158",
"0.47854713",
"0.47262764",
"0.4725585",
"0.47093052",
"0.4699324",
"0.46934438",
"0.4691812",
"0.4669043",
"0.4... | 0.6580948 | 0 |
Evaluates calls from call_queue and places the results in result_queue. This worker is run in a separate process. | def _process_worker(call_queue, result_queue):
while True:
call_item = call_queue.get(block=True)
if call_item is None:
# Wake up queue management thread
result_queue.put(os.getpid())
return
try:
r = call_item.fn(*call_item.args, **call_item.kw... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call_queue_closure(data, call_queue):\n result = data.copy()\n for func, f_args, f_kwargs in call_queue:\n try:\n result = func(result, *f_args, **f_kwargs)\n except Exception as err:\n self.call_queue = []\n ... | [
"0.6878254",
"0.653854",
"0.6499669",
"0.6313003",
"0.6291972",
"0.61565644",
"0.6106621",
"0.60317",
"0.6018602",
"0.59836715",
"0.59836715",
"0.59609747",
"0.5950041",
"0.5924165",
"0.5924025",
"0.59115165",
"0.590969",
"0.58802915",
"0.5863303",
"0.5858751",
"0.58530885",
... | 0.7384044 | 0 |
Convert a BGR color tuple (e.g. (0, 147, 255)) to a color tuple that can be used by Matplotlib (e.g. (0, 0.5764705882352941, 1)). | def color_tuple_bgr_to_plt(color_tuple):
return (color_tuple[2]/255, color_tuple[1]/255, color_tuple[0]/255) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def int2color_tuple(x):\n red_val = int(1000 * x % 255)\n green_val = int(10000 * x % 255)\n blue_val = int(100000 * x % 255)\n return red_val, green_val, blue_val",
"def to_color(self):\n return (int(self.r * 255), int(self.g * 255), int(self.b * 255))",
"def colour_to_rgb_tuple(cls, col_st... | [
"0.7479977",
"0.72842014",
"0.723168",
"0.71900856",
"0.7151505",
"0.71181124",
"0.7104675",
"0.7094821",
"0.7084356",
"0.70437115",
"0.7004791",
"0.6984981",
"0.6979475",
"0.69711167",
"0.6894583",
"0.6887978",
"0.6884093",
"0.684709",
"0.6821083",
"0.68084604",
"0.6765526",... | 0.8025614 | 0 |
Calculate the modified twosided KolmogorovSmirnov statistic, adjusted for rightcensored timetodeath data, as described in Fleming et al (1980). This calcuate the residues for a nonparametric test for the null hypothesis that 2 independent samples are drawn from the same continuous distribution. The actual test is perfo... | def KSm_2samples(data1, relative_time_grid1, data2, relative_time_grid2):
def deltaNA (d, Y):
return np.sum([ np.power(Y-l,-1) for l in range(int(d))])
mortalities1 = pd.Series(data1.loc[data1['status']==1,'mortality'].value_counts(), index=relative_time_grid1).fillna(0)
censored1 = pd.Series(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def KSm_test(residues, maxcdf, alternative='two-sided', alpha=0.05):\n \n Ystats = residues\n R_MaxCDF = maxcdf\n R_func = np.sqrt(R_MaxCDF-R_MaxCDF*R_MaxCDF)\n \n if alternative=='two-sided':\n \n A_MaxAbsY = np.max(np.abs(Ystats))\n prob_BrownianBridge = 1-norm.cdf(A_M... | [
"0.6556137",
"0.6203104",
"0.61933494",
"0.61850893",
"0.6151925",
"0.60617256",
"0.60514313",
"0.6029852",
"0.5988094",
"0.5967601",
"0.5933769",
"0.59139836",
"0.5897438",
"0.58525157",
"0.5850537",
"0.58362997",
"0.58152133",
"0.5803236",
"0.58009744",
"0.57719064",
"0.576... | 0.6239925 | 1 |
Performs the KolmogorovSmirnov 1or2sided tests modified for right censored timetodeath data, based on residues calculated from functions KSm_2samples or KSm_gof. The test statistic is based on a timetransformed Brownian bridge, more precisely, the sumprema of a Brownian bridge restricted to (0, maxcdf). Asymptotic dist... | def KSm_test(residues, maxcdf, alternative='two-sided', alpha=0.05):
Ystats = residues
R_MaxCDF = maxcdf
R_func = np.sqrt(R_MaxCDF-R_MaxCDF*R_MaxCDF)
if alternative=='two-sided':
A_MaxAbsY = np.max(np.abs(Ystats))
prob_BrownianBridge = 1-norm.cdf(A_MaxAbsY/R_func)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_ks2x(self):\n D, Pval = ks_test(self.x1, self.x2)\n assert_allclose((D, Pval), (0.46, 3.801e-05), rtol=1e-4)\n D, Pval = ks_test(self.x1, self.x2, exact=False)\n assert_allclose((D, Pval), (0.46, 5.084e-05), rtol=1e-4)\n D, Pval = ks_test(self.x1, self.x2[:20])\n ... | [
"0.65256953",
"0.63897914",
"0.6337468",
"0.61477834",
"0.6146518",
"0.614462",
"0.612953",
"0.6116342",
"0.60985845",
"0.59907585",
"0.5973902",
"0.59544104",
"0.59449357",
"0.59340596",
"0.58936447",
"0.5890429",
"0.58695716",
"0.58615464",
"0.58401906",
"0.5830212",
"0.578... | 0.6872264 | 0 |
Precreate N partitions ahead of time according to the specified interval unit and interval. | def postgres_auto_partition(
model: PostgresPartitionedModel,
count: int,
interval_unit: PostgresAutoPartitioningIntervalUnit,
interval: int,
start_from: Optional[date] = None,
using="default",
):
connection = connections[using]
with connection.cursor() as cursor:
table = conne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createPartitions(config, logger):\n databaseConnection, databaseCursor = connectToDatabase(config, logger)\n try:\n for aDatabaseObjectClass in databaseObjectClassListForWeeklyPartitions:\n weekIterator = mondayPairsIteratorFactory(config.startDate, config.endDate)\n aDatabaseObject = aDatabaseO... | [
"0.593766",
"0.5498116",
"0.54152864",
"0.53877294",
"0.53830886",
"0.53789216",
"0.5308101",
"0.52501756",
"0.52337325",
"0.5225058",
"0.52231616",
"0.51973605",
"0.51917195",
"0.5139701",
"0.5094759",
"0.50867045",
"0.508078",
"0.5067348",
"0.5050254",
"0.50363874",
"0.5024... | 0.65793604 | 0 |
Render Hebrew in a dataframe. | def pretty_hebrew(val):
return 'font-size:20px; font-family: Times New Roman; text-align: right; max-width: 500px' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disp(df):\n display(HTML(df.to_html(index=False)))",
"def df_to_html(df, percentage_columns=None): # pragma: no cover\n big_dataframe_setup()\n try:\n res = \"<br><h2> {} </h2>\".format(df.name)\n except AttributeError:\n res = \"\"\n df.style.set_properties(**{\"text-align\": \... | [
"0.6045315",
"0.55508834",
"0.53905046",
"0.53869677",
"0.5380068",
"0.53508544",
"0.53235275",
"0.5310591",
"0.53040236",
"0.52949053",
"0.5287557",
"0.5267061",
"0.52548164",
"0.51928174",
"0.5151537",
"0.51386535",
"0.5135061",
"0.5115769",
"0.50743735",
"0.5065344",
"0.50... | 0.5721064 | 1 |
Show proportion dataframe with highlighting. | def df_highlighter(pr_df, rule='max'):
if rule == 'max':
return pr_df.style.apply(highlight_max, 1)
elif rule == 'fishers':
return pr_df.style.applymap(highlight_sig)
else:
return pr_df.style | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show(self, df, extra=[], spread=25):\n original_shape = df.shape\n df = df[self.default + extra]\n if spread > 0:\n spread_i = get_spread(df.index, spread)\n df = df.loc[spread_i]\n print(f'showing {df.shape[0]} of {original_shape[0]}')\n return df.style... | [
"0.61285084",
"0.58342224",
"0.58050156",
"0.5471041",
"0.53932345",
"0.5360068",
"0.53036433",
"0.52993584",
"0.5256975",
"0.52450204",
"0.51859456",
"0.51738006",
"0.5134529",
"0.51012987",
"0.50567937",
"0.5041237",
"0.5036244",
"0.5028948",
"0.49912107",
"0.49670103",
"0.... | 0.58691823 | 1 |
Gets a client item from pypodio, from the app_id given to the podioApi object when it was created. Optionally it receives an app_token; in that case it doesn't need to fetch it from the database | def _getClient(self, app_token=None):
if app_token is None:
from . import models
app_token = models.Aplicacion.objects.get(app_id=self.app_id).app_token
return api.OAuthAppClient(settings.CLIENT_ID, settings.CLIENT_SECRET, self.app_id, app_token) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_app(self, app_id):\n return req(self.logger, self.access_token, 'GET', '/apps/'+app_id, {})",
"def client(app=None):\n fs_client = _utils.get_app_service(app, _FIRESTORE_ATTRIBUTE, _FirestoreClient.from_app)\n return fs_client.get()",
"async def getAppProduct(self, item_id=None):\n ... | [
"0.60084134",
"0.59242415",
"0.5678864",
"0.56198317",
"0.55885607",
"0.5561114",
"0.55412453",
"0.5527581",
"0.54644537",
"0.5451878",
"0.54084194",
"0.5390055",
"0.52960443",
"0.52796483",
"0.5270817",
"0.52567786",
"0.52563524",
"0.5234272",
"0.5232072",
"0.52201605",
"0.5... | 0.6530229 | 0 |
Returns raw information of the api object's application, as a Python dictionary. | def getAppInfo(self):
data = self._client.Application.find(self.app_id)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize(self):\n return {\n 'app_id': self.id,\n 'name': self.name,\n 'app_info': [item.serialize for item in self.appinfo.all()]\n }",
"def get_app_details(self, app_id):\n app_data = AppData.objects.get(uid=app_id)\n return model_to_dict(app_da... | [
"0.7094638",
"0.694228",
"0.6678645",
"0.6611751",
"0.65245116",
"0.6498092",
"0.64952576",
"0.64924556",
"0.64852405",
"0.6457486",
"0.6449787",
"0.64373326",
"0.64291966",
"0.64280385",
"0.6368658",
"0.6310357",
"0.6304767",
"0.629864",
"0.6292921",
"0.6239421",
"0.6216532"... | 0.74249846 | 0 |
Returns all items belonging to a certain view, given by its ID. As all new methods, it automatically asks for the external ID | def get_items_by_view(self, view_id, depth=1):
data = self.filter_by_view(
int(self.app_id), int(view_id),{
'limit': 500,
},
)["items"]
fields = [self.make_dict(item, external_id=False, depth=depth, optimize=True) for item in data]
return fields | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show(self, item_id):\n pass",
"def view(self, view_id):\r\n return resources.View(self, view_id)",
"def get_user_items(self, id):\n return self.execute(TABELLE['items']['select']['by_id'], (id,))",
"def __getView(self, raw_view_id):\n if iDevice.dump_view:\n self.__... | [
"0.6050449",
"0.60087174",
"0.58421457",
"0.5774646",
"0.57450885",
"0.5733086",
"0.5725173",
"0.5718675",
"0.5693349",
"0.56803656",
"0.56435144",
"0.5628805",
"0.5583422",
"0.5583316",
"0.5546081",
"0.5523566",
"0.55118436",
"0.5508082",
"0.5507996",
"0.5435928",
"0.5392885... | 0.65132153 | 0 |
Creates a dictionary with the external_id of the item's fields ad keys, and their values as the dictionary values. | def makeDict(self, item, nested=False, no_html=False):
dictionary = dict([(field["external_id"], self.getFieldValue(field, nested, no_html)) for field in item["fields"]])
return {'item': item["item_id"], 'values':dictionary} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_dict(self, item, external_id=True, no_html=False, depth=1, optimize=False):\n if external_id:\n key_type = \"external_id\"\n else:\n key_type = \"field_id\"\n\n dictionary = dict([(field[key_type], {\"label\":field[\"label\"], \"type\": field[\"type\"], \"value\"... | [
"0.7522956",
"0.6268185",
"0.6242335",
"0.61984485",
"0.5945112",
"0.59421134",
"0.59377867",
"0.58974934",
"0.5887909",
"0.58877665",
"0.5864283",
"0.58118176",
"0.5773755",
"0.57677674",
"0.57671314",
"0.57475454",
"0.57330495",
"0.5711399",
"0.5707601",
"0.56359065",
"0.55... | 0.7668655 | 0 |
Creates a dictionary with the external_id of the item's fields ad keys, and their values as the dictionary values. This second versions allows to choose between the field_id or the external_id for the dictionary's key, and adds the field type to the generated dictionary. | def make_dict(self, item, external_id=True, no_html=False, depth=1, optimize=False):
if external_id:
key_type = "external_id"
else:
key_type = "field_id"
dictionary = dict([(field[key_type], {"label":field["label"], "type": field["type"], "value": self.getFieldValue(fiel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def makeDict(self, item, nested=False, no_html=False):\n dictionary = dict([(field[\"external_id\"], self.getFieldValue(field, nested, no_html)) for field in item[\"fields\"]])\n return {'item': item[\"item_id\"], 'values':dictionary}",
"def _item_to_dict(self, raw_response):\n\n if 'Item' n... | [
"0.71578294",
"0.6062752",
"0.5871339",
"0.58003277",
"0.5790452",
"0.5784216",
"0.5772315",
"0.5709299",
"0.56147534",
"0.55840975",
"0.5571692",
"0.5539155",
"0.5517967",
"0.5512531",
"0.5494441",
"0.54721624",
"0.5455877",
"0.5452799",
"0.544782",
"0.54249597",
"0.54240185... | 0.7510255 | 0 |
This method takes an item's values and copies them to a new item in the target app. | def copy_item(self, origin_item_id, target_app_id, field_conversor, extra_data = None, silent=False, hook=True):
source_item = self.get_item(origin_item_id, external_id=False)
if extra_data is None:
destination_dict = {}
else:
destination_dict = extra_data
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Copy(self, items):\r\n \r\n self.Clear()\r\n\r\n for item in items._items:\r\n self._items.append(item)\r\n \r\n self._selection = items._selection\r\n self._rowCount = items._rowCount\r\n self._columnCount = items._columnCount\r\n\r\n self._ba... | [
"0.6275045",
"0.6155121",
"0.60563624",
"0.59427583",
"0.58470327",
"0.5806149",
"0.5760919",
"0.5711546",
"0.5645925",
"0.5640575",
"0.56116366",
"0.5557648",
"0.5505642",
"0.54528534",
"0.54519296",
"0.54476357",
"0.54476357",
"0.54476357",
"0.5418839",
"0.5403946",
"0.5396... | 0.68416226 | 0 |
Move the fist based on mouse position. | def update(self):
pos = pygame.mouse.get_pos()
self.rect.midtop = pos
if self.punching:
self.rect.move_ip(5, 10) # move fist position in place | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def follow_mouse(self, mouse):\n half_width = self.width() / 2\n self.left = mouse.get_x() - half_width\n self.right = mouse.get_x() + half_width",
"def follow(self):\n\t\tpos = pygame.mouse.get_pos()\n\t\tself.x = pos[0]\n\t\tself.y = pos[1]\n\t\tself.draw()",
"def mousePosition(self):",
... | [
"0.71755165",
"0.7101349",
"0.7000044",
"0.6952539",
"0.6935647",
"0.6929391",
"0.68467486",
"0.68411225",
"0.6729126",
"0.6657786",
"0.66523236",
"0.66523236",
"0.6651963",
"0.66329193",
"0.6623596",
"0.6551806",
"0.6551806",
"0.65431446",
"0.6522208",
"0.65183115",
"0.64927... | 0.71138275 | 1 |
Move the monkey across the scree, turnaround when it reaches the end. | def _walk(self):
new_pos = self.rect.move((self.move, 0)) # move 9 pixel to the right per frame
if self.rect.left < self.area.left or self.rect.right > self.area.right:
self.move = -self.move # move to the opposite direction when the chimp position exceeds the screen
new_pos = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main():\n move()\n move()\n pick_beeper()\n move()\n turn_left()\n for i in range(2):\n move()\n put_beeper()\n turn_around()\n move_to_wall()\n turn_right()\n move_to_wall()\n turn_around()",
"def foward_shimmey(self):\n for x in range(6):\n self.... | [
"0.6293175",
"0.6188732",
"0.61269486",
"0.6100515",
"0.60992014",
"0.6092559",
"0.60872597",
"0.60869735",
"0.60626805",
"0.60558814",
"0.6001239",
"0.59711635",
"0.59577036",
"0.594625",
"0.5932024",
"0.5930882",
"0.5926476",
"0.5900304",
"0.58895755",
"0.5858425",
"0.58563... | 0.6345669 | 0 |
Test that two candidates with the same name is considered equal. | def test_equal(self):
candidate1 = pyrankvote.Candidate("Per")
candidate2 = pyrankvote.Candidate("Per")
candidate3 = pyrankvote.Candidate("Aase")
self.assertEqual(candidate1, candidate2, "These candidates should be equal/the same candidate.")
self.assertNotEqual(candidate1, can... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return self.name == other.name",
"def __eq__(self, name):\n return self.name == name",
"def __eq__(self, other):\n return self.getName() == other.getName()",
"def __eq__(self, other: 'Pair') -> bool:\n return self.names == other.names",
"def __eq__(sel... | [
"0.7137341",
"0.6986297",
"0.69103146",
"0.6893109",
"0.68889",
"0.6812805",
"0.6812805",
"0.67275023",
"0.6676643",
"0.66710836",
"0.662369",
"0.662369",
"0.6585671",
"0.6563278",
"0.6547755",
"0.651176",
"0.64836264",
"0.6444751",
"0.6440682",
"0.64404285",
"0.6353767",
"... | 0.7321387 | 0 |
Test that voting with two equal candidates raises DuplicateCandidateError | def test_raise_duplicate_candidate_error(self):
candidate1 = pyrankvote.Candidate("Per")
candidate2 = pyrankvote.Candidate("Per")
candidate3 = pyrankvote.Candidate("Aase")
def tester(_):
pyrankvote.Ballot(ranked_candidates=[candidate1, candidate2, candidate3])
msg ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_equal(self):\n\n candidate1 = pyrankvote.Candidate(\"Per\")\n candidate2 = pyrankvote.Candidate(\"Per\")\n candidate3 = pyrankvote.Candidate(\"Aase\")\n\n self.assertEqual(candidate1, candidate2, \"These candidates should be equal/the same candidate.\")\n self.assertNotE... | [
"0.7190982",
"0.67039883",
"0.63653916",
"0.62804335",
"0.61187637",
"0.60533804",
"0.59969497",
"0.59777725",
"0.5905661",
"0.58996975",
"0.586041",
"0.58293116",
"0.58067715",
"0.57936454",
"0.57888746",
"0.5755017",
"0.5683631",
"0.5670919",
"0.5661115",
"0.5626121",
"0.56... | 0.7878966 | 0 |
Test that if one of the candidate that are voted for are not a cadidate, that a TypeError is raised | def test_raise_error_if_not_all_obj_are_candidate_objects(self):
candidate1 = pyrankvote.Candidate("Per")
candidate2 = "Aase"
def tester(_):
pyrankvote.Ballot(ranked_candidates=[candidate1, candidate2])
msg = "Candidate 2 is a string, not a Candidate, and should raise a Ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_tally_no_candidates(self):\n self.init_elect_types()\n\n userA = models.User(\n name = \"UserA\",\n email = \"userA@eLect.com\",\n password = \"asdf\")\n\n session.add(userA)\n session.commit()\n\n electionA = models.Election(\n ... | [
"0.68555146",
"0.6602259",
"0.6469301",
"0.60011166",
"0.59726834",
"0.58263236",
"0.5738305",
"0.5644295",
"0.5516878",
"0.548198",
"0.5445231",
"0.5321506",
"0.53020644",
"0.52884585",
"0.5283049",
"0.5281973",
"0.52745837",
"0.52628803",
"0.52594995",
"0.52544856",
"0.5249... | 0.70258445 | 0 |
Make a sum of integrals CpT for calculate dST and dHT | def CpT(dict_, T_react): # T_column - name of the column in of Cp temperature in Data
T = T_react
if not dict_['T(Cp)']:
return 0, 0
else:
CpT_S_ = dict_['a']*(math.log(T/298)) + dict_['b']*math.pow(10,-3)*(T-298) - 0.5*dict_['c']*math.pow(10,6)*(math.pow(T, -2) - math.pow(298,-2)) + dict_['d']*(0.5*math.pow(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dCdt(t,C,params_unknown, params_known, i):\r\n q_co2_interp,P0,C0,a,b,c,P = params_known\r\n d,M0 = params_unknown\r\n return (1-C)*q_co2_interp[i]/M0 -b/a/M0*(P[i]-P0)*(carbon_prime(C,P[i],P0)-C)-d*(C-C0)",
"def integrate(self, t):",
"def Cintegrate(phi,\n HC, \n dt):\... | [
"0.6367222",
"0.62956077",
"0.61352813",
"0.59738237",
"0.5969108",
"0.5945719",
"0.5938884",
"0.5851866",
"0.581811",
"0.5812156",
"0.5800408",
"0.5785194",
"0.5775465",
"0.5771758",
"0.57488585",
"0.56765854",
"0.5642424",
"0.56408626",
"0.56318754",
"0.56190896",
"0.561747... | 0.7117006 | 0 |
'Accepted a dictionary of thermodynamic data and return Gibbs Free Energy of compound' | def gibbs_(dict_, T):
dST = dict_['S298'] + CpT(dict_, T)[0]
dHT = dict_['dH298'] + CpT(dict_, T)[1]/1000
return (dHT - T*dST/1000) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc_free_g(energies, temperatures):\n pass",
"def BraggEnergy(ID,hkl,twotheta):\n ID=goodID(ID)\n d=dSpace(ID,hkl)\n l=2*d*sind(twotheta/2.0)\n E=lam2E(l)\n return E",
"def get_internal_energy(filename):\n # --------------- helper functions --------------- #\n def parse_data(block)... | [
"0.650521",
"0.64380336",
"0.6039046",
"0.59228855",
"0.5849885",
"0.5758292",
"0.5723967",
"0.5673121",
"0.5652979",
"0.5629196",
"0.5627507",
"0.5578335",
"0.55377835",
"0.5457064",
"0.5428888",
"0.54141587",
"0.53989697",
"0.5396005",
"0.5381766",
"0.53807193",
"0.53804505... | 0.6666221 | 0 |
Action on one light by light_id. | def action_on_light_by_id(bridge, light_id, action):
if action == 'on':
bridge.set_light(light_id, 'on', True)
elif action == 'off':
bridge.set_light(light_id, 'on', False)
elif action == 'toggle':
current_state = bridge.get_light(light_id, 'on')
bridge.set_light(light_id, 'o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def Turn_On_Light(\n light_id: int = Path(..., title=\"Numeric light identifier\", ge=0),\n) -> Dict[str, Any]:\n busylightapi.manager.light_on(light_id)\n return {\n \"action\": \"on\",\n \"light_id\": light_id,\n \"color\": \"green\",\n }",
"def addLight(self, id):\r\n\t\... | [
"0.72733927",
"0.6812936",
"0.6758126",
"0.6477925",
"0.63752294",
"0.624486",
"0.62303555",
"0.61155444",
"0.6082006",
"0.5978591",
"0.59443074",
"0.58976763",
"0.58453494",
"0.5826358",
"0.58137035",
"0.5706582",
"0.56572086",
"0.5648138",
"0.56393903",
"0.56304437",
"0.562... | 0.7258166 | 1 |
Running the list of conf in a multiprocess pool | def pooling(lconf, poolsize=10):
pool = Pool(poolsize)
pool.map(worker, lconf) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forqs_parallel(configs):\n pool = Pool(21)\n pool.map(forqs_sim, configs)\n pool.close()\n pool.join()",
"def run(self):\n self.logger.info(\"Starting execution loop...\")\n with ThreadPoolExecutor(\n max_workers=len(self.config) + 10 - (len(self.config) % 10)\n ) ... | [
"0.65946066",
"0.63634336",
"0.6124032",
"0.59440327",
"0.5874448",
"0.5866036",
"0.5825758",
"0.5822465",
"0.5777083",
"0.5734233",
"0.57098234",
"0.56977147",
"0.5667062",
"0.5592518",
"0.55613124",
"0.5558571",
"0.5541053",
"0.55395705",
"0.5511079",
"0.55040234",
"0.54911... | 0.7368655 | 0 |
Walk the raw_metrics and pass them over to the agent as a counter or gauge type and with the correct units defined | def add_stats(self):
units = self.get_unit_map()
for metric in self.raw_metrics:
unit, metric_type = units.get(metric, (DEFAULT_UNIT, DEFAULT_TYPE))
if metric_type == "counter":
# Unit/Second
unit = "/".join((unit, "Second"))
self.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_metric(self):\r\n if self.units != 'metric':\r\n self.units = 'metric'\r\n for statement in self.statements:\r\n statement.to_metric()\r\n for tool in iter(self.tools.values()):\r\n tool.to_metric()\r\n for primitive in self.pr... | [
"0.6258945",
"0.61666566",
"0.60249275",
"0.6001037",
"0.5927554",
"0.592675",
"0.57163465",
"0.57082105",
"0.56740946",
"0.5633948",
"0.56112427",
"0.5591662",
"0.5533326",
"0.5493495",
"0.54703236",
"0.54512477",
"0.54392433",
"0.5438802",
"0.54218864",
"0.54157937",
"0.540... | 0.682586 | 0 |
Walk the META dict and build a category/metric => [unit, type] map | def get_unit_map(self):
units = dict()
for t in META:
for c in META[t]:
for i in META[t][c]:
unit = DEFAULT_UNIT
if (isinstance(i, (tuple, list))):
val, unit = i
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_metric(self, slug):\n results = OrderedDict()\n granularities = self._granularities()\n keys = self._build_keys(slug)\n for granularity, key in zip(granularities, keys):\n results[granularity] = self.r.get(key)\n return results",
"def to_metric(self):\r\n ... | [
"0.5816675",
"0.57289094",
"0.5644376",
"0.56161416",
"0.5572126",
"0.5567753",
"0.5550242",
"0.5526054",
"0.53678817",
"0.5350343",
"0.5344897",
"0.53356266",
"0.53257257",
"0.5325444",
"0.52578825",
"0.52578384",
"0.5251907",
"0.5248301",
"0.52464676",
"0.5242211",
"0.52412... | 0.78846425 | 0 |
Given a list of names, return the values collected for those names as a list. If any are missing, then return None. | def get_values(self, names):
r = []
for n in names:
if n in self.raw_metrics:
r.append(self.raw_metrics[n])
else:
return None
return r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def values(names, location, field = 0):\n table = read_properties(location)\n result = []\n for name in names:\n result.append(table[name][field])\n return result",
"def get_name_value(self):\n name, value = self.get()\n if not isinstance(name, list):\n name = [name]\n... | [
"0.62341124",
"0.61295545",
"0.6060184",
"0.58670735",
"0.58584267",
"0.5791712",
"0.5745358",
"0.56358737",
"0.5626649",
"0.5603033",
"0.55910695",
"0.5588045",
"0.55808705",
"0.5564574",
"0.5495613",
"0.5486652",
"0.5477916",
"0.54763335",
"0.54682344",
"0.546777",
"0.54158... | 0.75494033 | 0 |
Given a list of metric names, return the sum of their values if all of them exist in the raw metrics, otherwise return None. | def sum_of(self, names):
vals = self.get_values(names)
if vals is None:
return None
return sum(vals) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_values(self, names):\n r = []\n for n in names:\n if n in self.raw_metrics:\n r.append(self.raw_metrics[n])\n else:\n return None\n return r",
"def merge_measurements(measurements_list: List[Measurements]) -> \\\n Tuple[Measu... | [
"0.63208723",
"0.58659804",
"0.57584655",
"0.5594722",
"0.5587642",
"0.5583846",
"0.54215026",
"0.53978634",
"0.5388517",
"0.53796774",
"0.5361299",
"0.5329915",
"0.5302537",
"0.5300705",
"0.5294816",
"0.5272846",
"0.52468646",
"0.5246003",
"0.52124965",
"0.5141806",
"0.51274... | 0.7123606 | 0 |
Given a list of metric names, return the result of the first subtracted by all others (a b c d ...). If any metric names do not exist, return None. | def diff_of(self, names):
vals = self.get_values(names)
if vals is None:
return None
return vals[0] - (sum(vals[1:])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subtract(*args):\n return args[0] - reduce(lambda x, y: x + y, args[1:])",
"def subtract(*args):\n #convert args to floats so we can do the maths\n values = list(args)\n for x in range(len(values)):\n values[x] = float(values[x])\n \n difference = str(ft.reduce(oper.sub,values))\... | [
"0.5903671",
"0.5564674",
"0.5434356",
"0.53246856",
"0.5131955",
"0.50864434",
"0.5047729",
"0.5025216",
"0.5021303",
"0.49535123",
"0.49406168",
"0.49197245",
"0.48909643",
"0.48661345",
"0.48607007",
"0.48527187",
"0.4794334",
"0.4729753",
"0.47213003",
"0.471478",
"0.4704... | 0.5787716 | 1 |
Update the raw metrics for a particular metric name if the value is a number. | def update_metric(self, metric, value):
if self.is_number(value):
self.logger.debug("Collected raw metric: %s = %s" % (metric, value))
self.raw_metrics[metric] = value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_metric(self, metric_name: str, metric_value: Union[float, int]):\n self._metrics.append(Metric(metric_name, metric_value))",
"def apply_filter_metrics(self, pack_nr, filter_metrics):\n current_pack_metrics = ast.literal_eval(self.list_pack[pack_nr]['metrics'])\n\n for i in filter_m... | [
"0.5767613",
"0.56614435",
"0.56110084",
"0.5580715",
"0.55691767",
"0.544993",
"0.53968453",
"0.5386266",
"0.5385655",
"0.53586227",
"0.5325535",
"0.5323981",
"0.52706116",
"0.5256082",
"0.525114",
"0.5226717",
"0.5223895",
"0.5173679",
"0.51539004",
"0.51441383",
"0.5132418... | 0.8006188 | 0 |
Derive all of the custom newrelic metric data from what we've collected. | def derive_newrelic_stats(self):
self.logger.debug("Collecting stats for newrelic")
self.derive_newrelic_volume()
self.derive_newrelic_throughput()
self.derive_newrelic_innodb()
self.derive_newrelic_qcache()
self.derive_newrelic_slaves() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derive_newrelic_innodb(self):\n # InnoDB Metrics\n vals = self.get_values([\"status/innodb_pages_created\", \"status/innodb_pages_read\",\n \"status/innodb_pages_written\", \"status/innodb_buffer_pool_read_requests\",\n \"status/innodb... | [
"0.6022074",
"0.59213793",
"0.5731898",
"0.56916195",
"0.56569976",
"0.56055313",
"0.5598628",
"0.5564767",
"0.55601907",
"0.55311126",
"0.5521709",
"0.5505745",
"0.5444377",
"0.5430692",
"0.54174036",
"0.5376228",
"0.5355599",
"0.53036517",
"0.5295715",
"0.5289679",
"0.52818... | 0.7011071 | 0 |
Derive the newrelic read/write volume metrics | def derive_newrelic_volume(self):
# read and write volume
self.update_metric("newrelic/volume_reads", self.sum_of(["status/com_select", "status/qcache_hits"]))
self.update_metric("newrelic/volume_writes", self.sum_of(["status/com_insert", "status/com_insert_select",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derive_newrelic_stats(self):\n self.logger.debug(\"Collecting stats for newrelic\")\n self.derive_newrelic_volume()\n self.derive_newrelic_throughput()\n self.derive_newrelic_innodb()\n self.derive_newrelic_qcache()\n self.derive_newrelic_slaves()",
"def derive_newre... | [
"0.6909179",
"0.6324424",
"0.587309",
"0.58164966",
"0.57896197",
"0.5775137",
"0.5725627",
"0.56265193",
"0.5589847",
"0.55038005",
"0.5489829",
"0.54812914",
"0.5480851",
"0.54732245",
"0.5446111",
"0.54351324",
"0.5425124",
"0.53942096",
"0.53008056",
"0.5265735",
"0.52520... | 0.8065374 | 0 |
Derive the newrelic throughput metrics | def derive_newrelic_throughput(self):
# read and write throughput
self.update_metric("newrelic/bytes_reads", self.sum_of(["status/bytes_sent"]))
self.update_metric("newrelic/bytes_writes", self.sum_of(["status/bytes_received"]))
# Connection management
vals = self.get_values(["s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derive_newrelic_stats(self):\n self.logger.debug(\"Collecting stats for newrelic\")\n self.derive_newrelic_volume()\n self.derive_newrelic_throughput()\n self.derive_newrelic_innodb()\n self.derive_newrelic_qcache()\n self.derive_newrelic_slaves()",
"def compute_metr... | [
"0.69189394",
"0.61661357",
"0.5897504",
"0.58614343",
"0.5855015",
"0.58358943",
"0.58298737",
"0.5791972",
"0.5702153",
"0.56862736",
"0.56187415",
"0.5615706",
"0.56001467",
"0.55977714",
"0.5567835",
"0.5560966",
"0.5535466",
"0.5501375",
"0.54764473",
"0.54760295",
"0.54... | 0.7748093 | 0 |
Derive the newrelic innodb metrics | def derive_newrelic_innodb(self):
# InnoDB Metrics
vals = self.get_values(["status/innodb_pages_created", "status/innodb_pages_read",
"status/innodb_pages_written", "status/innodb_buffer_pool_read_requests",
"status/innodb_buffer_pool_reads... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derive_newrelic_stats(self):\n self.logger.debug(\"Collecting stats for newrelic\")\n self.derive_newrelic_volume()\n self.derive_newrelic_throughput()\n self.derive_newrelic_innodb()\n self.derive_newrelic_qcache()\n self.derive_newrelic_slaves()",
"def mysql_status... | [
"0.622359",
"0.6214452",
"0.6004368",
"0.5830676",
"0.58252716",
"0.5782086",
"0.57635754",
"0.56960446",
"0.5643359",
"0.56161225",
"0.5613598",
"0.55897206",
"0.55739963",
"0.5533932",
"0.5531093",
"0.5449568",
"0.54442644",
"0.5439991",
"0.54288715",
"0.5375634",
"0.536858... | 0.72587854 | 0 |
Derive the newrelic qcache metrics | def derive_newrelic_qcache(self):
# Query Cache
vals = self.get_values(["status/qcache_hits", "status/com_select", "status/qcache_free_blocks",
"status/qcache_total_blocks", "status/qcache_inserts", "status/qcache_not_cached"])
if vals:
qc_hits, reads,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derive_newrelic_stats(self):\n self.logger.debug(\"Collecting stats for newrelic\")\n self.derive_newrelic_volume()\n self.derive_newrelic_throughput()\n self.derive_newrelic_innodb()\n self.derive_newrelic_qcache()\n self.derive_newrelic_slaves()",
"def test_get_der... | [
"0.66529113",
"0.6139272",
"0.6087995",
"0.60597914",
"0.5858092",
"0.58465123",
"0.58407485",
"0.5827561",
"0.5758349",
"0.574827",
"0.5718123",
"0.57102144",
"0.56753933",
"0.56337994",
"0.5624577",
"0.56002194",
"0.5561739",
"0.5540792",
"0.55359334",
"0.54992205",
"0.5476... | 0.809507 | 0 |
Derive newrelic status metrics about slaves | def derive_newrelic_slaves(self):
if self.has_slave_data is True:
self.update_metric("newrelic/replication_lag", self.sum_of(["slave/seconds_behind_master"]))
# both need to be YES, which is 1
running = self.sum_of(["slave/slave_io_running", "slave/slave_sql_running"])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def slave_status():\n run_mysql_command(\"SHOW SLAVE STATUS\\G;\")",
"def __init__(self, is_master, track_processes, write_profile,\n verbose_cluster_stats):\n my_ip = appscale_info.get_private_ip()\n lb_ips = appscale_info.get_load_balancer_ips()\n\n self._is_lb = my_ip in lb_ips\n ... | [
"0.7028809",
"0.5855735",
"0.5841473",
"0.5718452",
"0.57006025",
"0.560662",
"0.55952454",
"0.5494366",
"0.548229",
"0.543067",
"0.5367218",
"0.5296817",
"0.5293506",
"0.52714247",
"0.527107",
"0.52170867",
"0.5173371",
"0.51723516",
"0.5159897",
"0.5144632",
"0.5134972",
... | 0.71810716 | 0 |
Parse the values from mysql, converting them to floats when necessary on|yes|true => 1 off|no|false => 0 null => 1 | def parse_metric_value(self, value):
if isinstance(value, str):
if value == "":
return None
# yes|true|on
if self.is_true.match(value):
return 1
# no|false|off
if self.is_false.match(value):
return 0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convertToFloat(boolean: bool) -> float:\n ...",
"def parse_value(self, value):\n\t\t\n\t\tif goodies.is_float(value):\n\t\t\treturn float(value)\n\t\telif goodies.is_int(value):\n\t\t\treturn int(value)\n\t\telif goodies.is_bool(value):\n\t\t\treturn bool(value.capitalize())\n\t\telse:\n\t\t\treturn v... | [
"0.5576609",
"0.5521588",
"0.5519995",
"0.53601056",
"0.5292483",
"0.52703524",
"0.52464485",
"0.5240127",
"0.5214614",
"0.5169053",
"0.51640624",
"0.51472664",
"0.51410556",
"0.5130782",
"0.5097779",
"0.50775486",
"0.506641",
"0.5049185",
"0.5041503",
"0.5037315",
"0.5005407... | 0.5565192 | 1 |
Parse the innodb status results and pull interesting metrics from it. | def parse_innodb_status_stats(self, cursor):
rows = list(cursor)
metrics = {
"history_list_length": "^History list length\s+(\d+)",
"log_sequence_number": "^Log sequence number\s+(\d+)",
"last_checkpoint": "^Last checkpoint at\s+(\d+)",
"queries_inside_inn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mysql_status(self):\n stamp = int(time.time())\n\n # get data\n conn = self.object.connect()\n result = {}\n try:\n with conn.cursor() as cursor:\n for key in REQUIRED_STATUS_FIELDS:\n cursor.execute('SHOW GLOBAL STATUS LIKE \"%s\"... | [
"0.6954353",
"0.62820905",
"0.6002656",
"0.58837825",
"0.5661363",
"0.56151706",
"0.555977",
"0.5538942",
"0.55202043",
"0.5509902",
"0.548991",
"0.54785293",
"0.5459194",
"0.5427737",
"0.5423125",
"0.5409682",
"0.5383005",
"0.53386635",
"0.5331502",
"0.5330284",
"0.53202844"... | 0.778952 | 0 |
Opens compressed file .bz2 | def bz2_file_reader(path):
return bz2.open(path, 'rt') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compress_bz2(filename):\n bz2_filename = filename + '.bz2'\n\n with open(filename, 'rb') as og_file, bz2.BZ2File(bz2_filename, 'wb') as bz2_file:\n for data in iter(lambda : og_file.read(100 * 1024), b''):\n bz2_file.write(data)\n\n return bz2_filename",
"def compress_bz2(filename)... | [
"0.69785935",
"0.69785935",
"0.69372684",
"0.69372684",
"0.6839064",
"0.6691569",
"0.6567918",
"0.6491263",
"0.6439713",
"0.63826275",
"0.6346191",
"0.6245385",
"0.6123849",
"0.59531605",
"0.5905753",
"0.5889792",
"0.5867345",
"0.5854815",
"0.5793635",
"0.5793635",
"0.5776847... | 0.7192209 | 0 |
Opens compressed file .bz2 in bytes mode | def bz2_file_bytes_reader(path):
return bz2.open(path, 'rb') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compress_bz2(filename):\n bz2_filename = filename + '.bz2'\n\n with open(filename, 'rb') as og_file, bz2.BZ2File(bz2_filename, 'wb') as bz2_file:\n for data in iter(lambda : og_file.read(100 * 1024), b''):\n bz2_file.write(data)\n\n return bz2_filename",
"def compress_bz2(filename)... | [
"0.7045241",
"0.7045241",
"0.69642025",
"0.68728",
"0.68728",
"0.64734644",
"0.62642217",
"0.6183835",
"0.61643773",
"0.5998363",
"0.59920585",
"0.59511447",
"0.5924625",
"0.59138536",
"0.5905901",
"0.5905238",
"0.5795446",
"0.57917845",
"0.5782833",
"0.5713188",
"0.56975424"... | 0.72273827 | 0 |
Opens a txt file and loads tabseparated columns into a dictionary | def load_dict_from_txt_file(path, key_type=str, value_type=str):
with txt_file_reader(path) as txt_file:
return {key_type(key): value_type(value) for key, value in [line.strip().split('\t') for line in txt_file]} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loadtwocol(infile):\n kvdict = {}\n with open(infile) as f:\n for nline, line in enumerate(f):\n line = line.strip()\n if line: # to exclude blank line\n k, v = line.split('\\t')\n kvdict[k] = v\n return kvdict",
"def open_txt_table(txt_file... | [
"0.7027454",
"0.69427824",
"0.6827322",
"0.63295215",
"0.63261515",
"0.6240552",
"0.623014",
"0.62298214",
"0.6190121",
"0.6161519",
"0.6150538",
"0.61352277",
"0.612601",
"0.60427094",
"0.60386354",
"0.6011791",
"0.60058546",
"0.5992848",
"0.5989369",
"0.5974285",
"0.5972237... | 0.7086704 | 0 |
provide functionality to associate an account with the market segment Raises ValueError if the market segment already knows about the account | def add_account(self, account, add_ms_to_account=True):
# check if name already exists and throw ValueError if it does
# it doesn't make sense to add an account twice -- this could be
# refactored to use a set instead
# check for accounts by name per Q2 bonus below
if accoun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put_account(self, account):\n \n pass",
"def associate_member_account(memberAccountId=None):\n pass",
"def add_account(insert_dict):\n return ar.add_account(insert_dict)",
"def add_account(self, account):\n self.accounts[account.account_number] = account.json()\n # We sh... | [
"0.6881962",
"0.6379945",
"0.6314283",
"0.6247812",
"0.614936",
"0.614936",
"0.6070196",
"0.6060519",
"0.60320276",
"0.59797066",
"0.5976318",
"0.58752096",
"0.586902",
"0.5846821",
"0.5827182",
"0.5821246",
"0.57961375",
"0.5756492",
"0.5755137",
"0.5746932",
"0.57255113",
... | 0.6542094 | 1 |
get the sales rep assocated to this Account | def get_sales_rep(self):
return self._sales_rep | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sales_rep_code(self):\n return self._sales_rep_code",
"def get_sales_data():\n print(\"Retrieving all the sales information...\")\n data = SHEET.worksheet('sales')\n print(\"Compilation complete!\\n\")\n return data",
"def get_sales(res=None, user_email=None, user_role=None, user_id=None... | [
"0.60808676",
"0.59343404",
"0.5843296",
"0.58057",
"0.5775382",
"0.57279",
"0.5499945",
"0.5478197",
"0.5337665",
"0.53167444",
"0.53152895",
"0.5267397",
"0.5243935",
"0.52410465",
"0.52232355",
"0.52158624",
"0.52153754",
"0.52091914",
"0.5116701",
"0.5112952",
"0.511263",... | 0.7881946 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.