query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
This API is used to delete an exporter integration. | def DeleteExporterIntegration(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteExporterIntegration", params, headers=headers)
response = json.loads(body)
model = models.DeleteExporterIntegrationRespon... | [
"def delete(self):\n try:\n self.source._api.delete_export(self.source.id, self.id)\n except:\n # Export probably no longer exists\n pass",
"def delete(self, aggregator_id):\n le_aggregator = get_a_aggregator(aggregator_id)\n if not le_aggregator:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to delete a Grafana notification channel. | def DeleteGrafanaNotificationChannel(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteGrafanaNotificationChannel", params, headers=headers)
response = json.loads(body)
model = models.DeleteGrafanaNoti... | [
"async def channel_delete(self, channel, *, reason = None):\n channel_id = get_channel_id(channel, Channel.is_in_group_guild)\n \n await self.http.channel_delete(channel_id, reason)",
"async def on_channel_delete(self, channel):",
"async def on_guild_channel_delete(self, channel: GuildChann... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to delete an alarm policy group. | def DeletePolicyGroup(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DeletePolicyGroup", params, headers=headers)
response = json.loads(body)
model = models.DeletePolicyGroupResponse()
model._... | [
"def delete_group(self, group):\n path = \"api/groups/{0}\".format(group)\n self._delete(path)",
"def delete_policy(self, scaling_group, policy):\r\n return self._manager.delete_policy(scaling_group=scaling_group,\r\n policy=policy)",
"def delete_policy(self, scaling_group, p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to delete Prometheus configurations. If the target cluster does not exist, a result indicating success will be returned. | def DeletePrometheusConfig(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DeletePrometheusConfig", params, headers=headers)
response = json.loads(body)
model = models.DeletePrometheusConfigResponse()
... | [
"def delete_cluster_config(self, cluster=None, **kwargs):\n if cluster is None:\n raise SyntaxError('Cluster name has not been specified')\n request_endpoint = '/api/v1/config/clusters/%s' % cluster\n return self.query(query_endpoint=request_endpoint, query_type='DELETE', **kwargs)",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to batch delete Prometheus recording rules. | def DeleteRecordingRules(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteRecordingRules", params, headers=headers)
response = json.loads(body)
model = models.DeleteRecordingRulesResponse()
... | [
"def realms_bulk_del_jobs():\n try:\n body = json.loads(request.body.read())\n jobs = body['jobs']\n for realm_id, job_id in jobs:\n _del_job(realm_id, job_id)\n except ValueError:\n raise JSONError(client.BAD_REQUEST,\n exception='ValueError',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to query the list of alarm events. | def DescribeAlarmEvents(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAlarmEvents", params, headers=headers)
response = json.loads(body)
model = models.DescribeAlarmEventsResponse()
m... | [
"def list_alarms(self, entity):\r\n uri = \"/%s/%s/alarms\" % (self.uri_base, utils.get_id(entity))\r\n resp, resp_body = self.api.method_get(uri)\r\n return [CloudMonitorAlarm(self, dct, entity)\r\n for dct in resp_body[\"values\"]]",
"def _list_alarms(self, alarm_id=None):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to query the list of alarm metrics. | def DescribeAlarmMetrics(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAlarmMetrics", params, headers=headers)
response = json.loads(body)
model = models.DescribeAlarmMetricsResponse()
... | [
"def describe_alarms_for_metric(self, req):\r\n self._enforce(req, 'DescribeAlarmsForMetric')\r\n return exception.HeatAPINotImplementedError()",
"def _list_alarms(self, alarm_id=None):\n if alarm_id:\n return self.clients(\"ceilometer\").alarms.get(alarm_id)\n else:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to query the list of alarm policies. | def DescribeAlarmPolicies(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAlarmPolicies", params, headers=headers)
response = json.loads(body)
model = models.DescribeAlarmPoliciesResponse()
... | [
"def DescribeAlarmPolicy(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"DescribeAlarmPolicy\", params, headers=headers)\n response = json.loads(body)\n model = models.DescribeAlarmPolicyResponse()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to get the details of a single alarm policy. | def DescribeAlarmPolicy(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAlarmPolicy", params, headers=headers)
response = json.loads(body)
model = models.DescribeAlarmPolicyResponse()
m... | [
"def DescribeAlarmPolicies(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"DescribeAlarmPolicies\", params, headers=headers)\n response = json.loads(body)\n model = models.DescribeAlarmPoliciesRespo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to query all namespaces. | def DescribeAllNamespaces(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAllNamespaces", params, headers=headers)
response = json.loads(body)
model = models.DescribeAllNamespacesResponse()
... | [
"def list_namespaces():\n try:\n api_instance = initiate_api()\n namespaces = api_instance.list_namespace().items\n for namespace in namespaces:\n if namespace.metadata.name is not None:\n print(namespace.metadata)\n except ApiException as e:\n print(\"Exc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to get the basic alarm list. | def DescribeBasicAlarmList(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeBasicAlarmList", params, headers=headers)
response = json.loads(body)
model = models.DescribeBasicAlarmListResponse()
... | [
"def _list_alarms(self, alarm_id=None):\n if alarm_id:\n return self.clients(\"ceilometer\").alarms.get(alarm_id)\n else:\n return self.clients(\"ceilometer\").alarms.list()",
"def list_alarms(self, entity):\r\n uri = \"/%s/%s/alarms\" % (self.uri_base, utils.get_id(enti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to query the list of exporter integrations. | def DescribeExporterIntegrations(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeExporterIntegrations", params, headers=headers)
response = json.loads(body)
model = models.DescribeExporterIntegrati... | [
"def GetAllExporters(self):\n return self.native.get_all_exporters()",
"def DeleteExporterIntegration(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"DeleteExporterIntegration\", params, headers=headers)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to list installed Grafana integrations. | def DescribeGrafanaIntegrations(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeGrafanaIntegrations", params, headers=headers)
response = json.loads(body)
model = models.DescribeGrafanaIntegrations... | [
"def List(apig):\n\t\t\t\treturn apig.client.get_api_keys()['items']",
"def getInstalledPlugins(store):\n return store.powerupsFor(IEridanusPlugin)",
"def list():\n print(json.dumps(Config.get_apis()['apis'], indent=4, sort_keys=True))",
"def integrations(self) -> Dict[str, Union[Type[\"Integration\"], ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to list Grafana notification channels. | def DescribeGrafanaNotificationChannels(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeGrafanaNotificationChannels", params, headers=headers)
response = json.loads(body)
model = models.DescribeGra... | [
"def list_channels(self):\n path = self.build_url(\"/channels\")\n return self.request('get', path)",
"def fetch_all_channels(self):\n try:\n response = self.client.conversations_list()\n channels = response['channels']\n except SlackApiError as error:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to get basic alarm policy conditions. | def DescribePolicyConditionList(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePolicyConditionList", params, headers=headers)
response = json.loads(body)
model = models.DescribePolicyConditionList... | [
"def DescribeAlarmPolicy(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"DescribeAlarmPolicy\", params, headers=headers)\n response = json.loads(body)\n model = models.DescribeAlarmPolicyResponse()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to list Prometheus CVM agents. | def DescribePrometheusAgents(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePrometheusAgents", params, headers=headers)
response = json.loads(body)
model = models.DescribePrometheusAgentsResponse(... | [
"def get_agent_list(self) -> List[NodeAgentDefinition]:",
"def get_agents():\n\n q = '''\n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n PREFIX prov: <http://www.w3.org/ns/prov#>\n SELECT ?ag ?label\n WHERE { GRAPH ?g {\n ?ag a prov:Agent ;\n rdfs:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to get the Prometheus configuration. | def DescribePrometheusConfig(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePrometheusConfig", params, headers=headers)
response = json.loads(body)
model = models.DescribePrometheusConfigResponse(... | [
"def monitoring_prometheus_settings(config):\n # type: (dict) -> PrometheusMonitoringSettings\n try:\n conf = config['monitoring']['services']['prometheus']\n except KeyError:\n conf = {}\n port = None\n else:\n port = str(_kv_read(conf, 'port'))\n return PrometheusMonitor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to query the usage of a payasyougo Tencent Managed Service for Prometheus (TMP) instance. | def DescribePrometheusInstanceUsage(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePrometheusInstanceUsage", params, headers=headers)
response = json.loads(body)
model = models.DescribePrometheusI... | [
"def ex_get_usage(self):\r\n action = '/currentusage/'\r\n response = self.connection.request(action=action, method='GET')\r\n return response.object",
"async def get_usage(self):\n await self.throttle()\n response = await aget(self.urlBase + self.endpoints['usage'], headers = self.auth... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to delete the data of a Prometheus instance. The specified instance must be terminated first. | def DestroyPrometheusInstance(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DestroyPrometheusInstance", params, headers=headers)
response = json.loads(body)
model = models.DestroyPrometheusInstanceRespon... | [
"def delete_instance(self, inst):\n cognipy_call(self._uid, \"RemoveInstance\", inst)\n if self._verbose:\n markdown = \"(\"+inst+\")\"\n display(Markdown(markdown))",
"def delete(self, instance):\n self.descriptor.__delete__(instance)",
"def delete_instance(self, inst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to set the Grafana SSO through a Tencent Cloud account. | def EnableGrafanaSSO(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("EnableGrafanaSSO", params, headers=headers)
response = json.loads(body)
model = models.EnableGrafanaSSOResponse()
model._des... | [
"def set_credentials_storage_account(config, ssel, sakey, ep=None):\n # type: (dict, str, str, str) -> None\n config['credentials']['storage'][ssel]['account_key'] = sakey\n if util.is_not_empty(ep):\n config['credentials']['storage'][ssel]['endpoint'] = ep",
"def enable_sso(self, DirectoryId: str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to get the command line for Prometheus agent management. | def GetPrometheusAgentManagementCommand(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("GetPrometheusAgentManagementCommand", params, headers=headers)
response = json.loads(body)
model = models.GetPromethe... | [
"def get_commandline(self, mgmt_tap_name):\n directory = '/tmp/' + self.vm_name\n if not os.path.exists(directory):\n os.makedirs(directory)\n return ([self.qemu_binary, '-m', str(self.max_ram)] +\n self._get_misc_params() +\n self._get_chardev_lines() +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify the trigger condition of an alarm policy. | def ModifyAlarmPolicyCondition(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyAlarmPolicyCondition", params, headers=headers)
response = json.loads(body)
model = models.ModifyAlarmPolicyConditionRes... | [
"def set_group_trigger_conditions(self, group_id, conditions):\n firing_gc = hawkular.alerts.GroupConditionsInfo()\n autoresolve_gc = hawkular.alerts.GroupConditionsInfo()\n for c in conditions:\n name = c.pop(\"name\")\n condition = hawkular.alerts.Condition(c)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to edit the basic information of a v2.0 alarm policy, including policy name and remarks. | def ModifyAlarmPolicyInfo(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyAlarmPolicyInfo", params, headers=headers)
response = json.loads(body)
model = models.ModifyAlarmPolicyInfoResponse()
... | [
"def ModifyAlarmPolicyNotice(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"ModifyAlarmPolicyNotice\", params, headers=headers)\n response = json.loads(body)\n model = models.ModifyAlarmPolicyNotic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify the alarm notification template bound to an alarm policy. | def ModifyAlarmPolicyNotice(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyAlarmPolicyNotice", params, headers=headers)
response = json.loads(body)
model = models.ModifyAlarmPolicyNoticeResponse()
... | [
"def update_policy_template(self, policy):\n baseURL = self.baseURL + \"policy-templates/{}\".format(policy['policy_id'])\n\n policy['checksum'] = \"\"\n policy['policy_utctimestamp'] = \"\"\n\n data = {}\n data['modelDetails'] = policy\n data['name'] = policy['name']\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify the tasks triggered by alarm policy, which are listed by the value of the `TriggerTasks` field. If an empty array is passed in for `TriggerTasks`, it means unbinding all the trigger tasks from the policy. | def ModifyAlarmPolicyTasks(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyAlarmPolicyTasks", params, headers=headers)
response = json.loads(body)
model = models.ModifyAlarmPolicyTasksResponse()
... | [
"def google_tasks_update(modified_tasks):\r\n for t in modified_tasks:\r\n [summary, due_time, duration, task_id] = t\r\n g_task = util.services['tasks'].tasks().get(tasklist=util.task_list_id,\r\n task=task_id).execute()\r\n g_task['due'] =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify the attributes of a Grafana instance. | def ModifyGrafanaInstance(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyGrafanaInstance", params, headers=headers)
response = json.loads(body)
model = models.ModifyGrafanaInstanceResponse()
... | [
"def modify_instance_attribute(DryRun=None, InstanceId=None, Attribute=None, Value=None, BlockDeviceMappings=None, SourceDestCheck=None, DisableApiTermination=None, InstanceType=None, Kernel=None, Ramdisk=None, UserData=None, InstanceInitiatedShutdownBehavior=None, Groups=None, EbsOptimized=None, SriovNetSupport=No... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update policy group. | def ModifyPolicyGroup(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyPolicyGroup", params, headers=headers)
response = json.loads(body)
model = models.ModifyPolicyGroupResponse()
model._... | [
"def updateGroup(self, groupName, **kwargs):\n self._validateValues(groupName=groupName, accountName=self.accountName)\n group = self.getGroup(groupName)\n if kwargs:\n if not str(BitbucketSettingsParam.NAME) in kwargs:\n kwargs[str(BitbucketSettingsParam.NAME)] = grou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify the external labels of the associated cluster. | def ModifyPrometheusAgentExternalLabels(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyPrometheusAgentExternalLabels", params, headers=headers)
response = json.loads(body)
model = models.ModifyProme... | [
"def set_labels(\n self,\n project_id,\n zone,\n cluster_id,\n resource_labels,\n label_fingerprint,\n name=None,\n retry=google.api_core.gapic_v1.method.DEFAULT,\n timeout=google.api_core.gapic_v1.method.DEFAULT,\n metadata=None,\n ):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify the Prometheus configuration. If there are no configuration items, one will be added. | def ModifyPrometheusConfig(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyPrometheusConfig", params, headers=headers)
response = json.loads(body)
model = models.ModifyPrometheusConfigResponse()
... | [
"def generate(cls, **kwargs) -> \"PrometheusConfiguration\":\n return cls(\n **{**dict(\n description=\"Update the base_url and metrics to match your Prometheus configuration\",\n metrics=[\n PrometheusMetric(\n \"throughput\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify the attributes of a Prometheus instance. | def ModifyPrometheusInstanceAttributes(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyPrometheusInstanceAttributes", params, headers=headers)
response = json.loads(body)
model = models.ModifyPrometh... | [
"def ModifyPrometheusConfig(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"ModifyPrometheusConfig\", params, headers=headers)\n response = json.loads(body)\n model = models.ModifyPrometheusConfigRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to modify a Prometheus recording instance through YAML. | def ModifyPrometheusRecordRuleYaml(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("ModifyPrometheusRecordRuleYaml", params, headers=headers)
response = json.loads(body)
model = models.ModifyPrometheusRecor... | [
"def ModifyPrometheusInstanceAttributes(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"ModifyPrometheusInstanceAttributes\", params, headers=headers)\n response = json.loads(body)\n model = models.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to send a custom alarm notification. | def SendCustomAlarmMsg(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("SendCustomAlarmMsg", params, headers=headers)
response = json.loads(body)
model = models.SendCustomAlarmMsgResponse()
mode... | [
"def onAlarm(self):",
"def handle_create_alarm(self, message):\n if self.neon_in_request(message):\n content = self._extract_alert_params(message, AlertType.ALARM)\n content[\"kind\"] = int(AlertType.ALARM)\n LOG.info(content)\n self.confirm_alert(\"alarm\", cont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to set an alarm policy as the default policy in the current policy type under the current project. Alarm policies in the same type under the project will be set as nondefault. | def SetDefaultAlarmPolicy(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("SetDefaultAlarmPolicy", params, headers=headers)
response = json.loads(body)
model = models.SetDefaultAlarmPolicyResponse()
... | [
"def update_identity_security_defaults_enforcement_policy(\n self,\n body, # type: \"models.MicrosoftGraphIdentitySecurityDefaultsEnforcementPolicy\"\n **kwargs # type: Any\n ):\n # type: (...) -> None\n cls = kwargs.pop('cls', None) # type: ClsType[None]\n error_map ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to terminate a payasyougo Prometheus instance. | def TerminatePrometheusInstances(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("TerminatePrometheusInstances", params, headers=headers)
response = json.loads(body)
model = models.TerminatePrometheusInstan... | [
"def DestroyPrometheusInstance(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"DestroyPrometheusInstance\", params, headers=headers)\n response = json.loads(body)\n model = models.DestroyPrometheusI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to delete a Grafana dashboard. | def UninstallGrafanaDashboard(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UninstallGrafanaDashboard", params, headers=headers)
response = json.loads(body)
model = models.UninstallGrafanaDashboardRespon... | [
"def delete_dashboard(self, dash_id):\n return self.http_request('DELETE', '/dash/' + str(dash_id))",
"def delete_dashboard_by_id(self, dashboardid: str, query_params: Dict[str, object] = None) -> SSCVoidModel:\n if query_params is None:\n query_params = {}\n\n path_params = {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update a Prometheus alerting rule. | def UpdateAlertRule(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpdateAlertRule", params, headers=headers)
response = json.loads(body)
model = models.UpdateAlertRuleResponse()
model._deseri... | [
"def update_rule(self, ruleresourcename: str, rule_patch: RulePATCH, query_params: Dict[str, object] = None) -> Rule:\n if query_params is None:\n query_params = {}\n\n path_params = {\n \"ruleresourcename\": ruleresourcename,\n }\n\n path = Template(\"/catalog/v2al... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update the status of a Prometheus alerting rule. | def UpdateAlertRuleState(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpdateAlertRuleState", params, headers=headers)
response = json.loads(body)
model = models.UpdateAlertRuleStateResponse()
... | [
"def UpdateAlertRule(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"UpdateAlertRule\", params, headers=headers)\n response = json.loads(body)\n model = models.UpdateAlertRuleResponse()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update the exporter integration configuration. | def UpdateExporterIntegration(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpdateExporterIntegration", params, headers=headers)
response = json.loads(body)
model = models.UpdateExporterIntegrationRespon... | [
"def update(self, settings):\n update_config = settings.configuration\n self.configuration.update(update_config)",
"def updated(self, newConfiguration):",
"def update_plugin_config(self):\n conf_dict = {}\n # conf_dict['bridge'] = self.bridge\n conf_dict['bridge_serial'] = sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update the Grafana configuration. | def UpdateGrafanaConfig(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpdateGrafanaConfig", params, headers=headers)
response = json.loads(body)
model = models.UpdateGrafanaConfigResponse()
m... | [
"def update_config():\n g.config = app.config",
"def config():\n update_config_cli()",
"def updated(self, newConfiguration):",
"def update_oam_config(self, context):\n return self.call(context, self.make_msg('update_oam_config'))",
"def update_config(self):\n for key_name, entry in self.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update the Grafana notification channel. | def UpdateGrafanaNotificationChannel(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpdateGrafanaNotificationChannel", params, headers=headers)
response = json.loads(body)
model = models.UpdateGrafanaNoti... | [
"def update_channel(self, channel):",
"def update_notification_channel(\n self,\n notification_channel,\n update_mask=None,\n retry=google.api_core.gapic_v1.method.DEFAULT,\n timeout=google.api_core.gapic_v1.method.DEFAULT,\n metadata=None,\n ):\n if metadata is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update the status of a Prometheus CVM agent. | def UpdatePrometheusAgentStatus(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpdatePrometheusAgentStatus", params, headers=headers)
response = json.loads(body)
model = models.UpdatePrometheusAgentStatus... | [
"def updateReplicationStatus(self, data, agentId):\n return self.session.request('replicationcomms/slave/agents/%s/status'\n % (agentId), 'PUT',\n self.getXML(data, 'job'))",
"def update_worker_status():\n\n threading.Timer(5, update_worker_status).start()\n \"\"\"\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update a Prometheus recording rule. | def UpdateRecordingRule(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpdateRecordingRule", params, headers=headers)
response = json.loads(body)
model = models.UpdateRecordingRuleResponse()
m... | [
"def update_sampling_rule(self, SamplingRuleUpdate: Dict) -> Dict:\n pass",
"def PBH_RULE_update():\n\n pass",
"def PBH_RULE_update_field():\n\n pass",
"def update_an_existing_profiling_rule(self,\n rule_id,\n clust... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to update a Grafana dashboard. | def UpgradeGrafanaDashboard(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpgradeGrafanaDashboard", params, headers=headers)
response = json.loads(body)
model = models.UpgradeGrafanaDashboardResponse()
... | [
"def main(self):\n\n scriptDirPath = dirname(sys.argv[0])\n dashboardName: str = \"SPPMON for IBM Spectrum Protect Plus.json\"\n dashboardDir: str = realpath(join(scriptDirPath, \"..\", \"Grafana\"))\n dashboardPath: str = join(dashboardDir, dashboardName)\n\n genericVarName: str ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This API is used to upgrade a Grafana instance. | def UpgradeGrafanaInstance(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("UpgradeGrafanaInstance", params, headers=headers)
response = json.loads(body)
model = models.UpgradeGrafanaInstanceResponse()
... | [
"def UpgradeGrafanaDashboard(self, request):\n try:\n params = request._serialize()\n headers = request.headers\n body = self.call(\"UpgradeGrafanaDashboard\", params, headers=headers)\n response = json.loads(body)\n model = models.UpgradeGrafanaDashboar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set brightness level (025) | def set_brightness(self, value=25):
# byte2: 0x02 to 0x1B (2-27)
value = max(0, min(25, value))
value += 2
self.on()
LOGGER.info('Swiching light brightness to {1} in group {0}'.format(self._group, value))
MiLightCommand(self.BRIGHTNESS, bytes[(value)]).send() | [
"def setBrightness(self, value = 0):\n\t\tgrovepi.fourDigit_brightness(self.display, value)",
"def set_brightness(self, level):\r\n if level <= 0:\r\n self._change_color(**self.offcolor)\r\n # LED must be on or else it cannot get brighter\r\n elif self.state or level < self.current... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable disco mode, if no valid mode is provided the default disco mode is started | def set_disco(self, mode=''):
self.on()
if mode.upper() in self.DISCO_CODES:
command = self.DISCO_CODE + self.DISCO_CODES[mode.upper()]
self.send_command(command, byte2=b"", byte3=b"")
else:
self.send_command(self.DISCO_MODE) | [
"def mode(ctx, mode, touch_eject, autoeject_timeout, chalresp_timeout, force):\n dev = ctx.obj['dev']\n if autoeject_timeout:\n touch_eject = True\n autoeject = autoeject_timeout if touch_eject else None\n\n if mode is not None:\n if mode.transports != TRANSPORT.CCID:\n autoejec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increase disco_speed (1 <= value <= 30) | def increase_disco_speed(self, steps=1):
steps = max(1, min(30, steps)) # value should be between 1 and 30
self.on()
for i in range(0, steps):
self.send_command(self.DISCO_SPEED_FASTER) | [
"def accelerate(self):\n self.speed += 2",
"def increase_speed(self):\r\n self.enemy_speed += 1",
"def increase_speed(self):\n max_speed = 1.0\n self.linear_speed += 0.1\n self.angular_speed += 0.1\n \n if self.linear_speed > max_speed:\n self.linear_s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decrease disco_speed (1 <= value <= 30) | def decrease_disco_speed(self, steps=1):
steps = max(1, min(30, steps)) # value should be between 1 and 30
self.on()
for i in range(0, steps):
self.send_command(self.DISCO_SPEED_SLOWER) | [
"def decrease_speed(self):\n min_speed = 0.0\n self.linear_speed -= 0.1\n self.angular_speed -= 0.1\n\n if self.linear_speed < min_speed:\n self.linear_speed = min_speed\n\n if self.angular_speed < min_speed:\n self.angular_speed = min_speed",
"def decelera... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
S is a list of indices in faces Return the mins and maxs of the whole set | def Box(S):
v = verts[faces[S,:3].flatten(),:3]
return np.min(v,0), np.max(v,0) | [
"def slice2limits(slices):\n mins = [s.start for s in slices]\n maxs = [s.stop - 1 for s in slices]\n return mins, maxs",
"def assign_cluster_labels(S):\n mins = []\n for i in S:\n mins.append(np.argmin(i))\n return mins",
"def get_bounds(vectors):\n vectors = np.array(vectors)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given some BVH nodes, produce a list of vertices and indices suitable for loading into an opengl vertex array for drawing quads or line strips around the boxes | def box_vertices(cls, nodes):
q = [[[1,1,0],[0,1,0],[0,1,1],[1,1,1]], \
[[1,0,1],[0,0,1],[0,0,0],[1,0,0]], \
[[1,1,1],[0,1,1],[0,0,1],[1,0,1]], \
[[1,0,0],[0,0,0],[0,1,0],[1,1,0]], \
[[0,1,1],[0,1,0],[0,0,0],[0,0,1]], \
[[1,1,0],[1,1,1],[1,0,1],[1... | [
"def vertices_from_bbox(box_min_x, box_min_y, box_min_z,\n box_max_x, box_max_y, box_max_z):\n v0 = (box_min_x, box_min_y, box_min_z)\n v1 = (box_min_x, box_min_y, box_max_z)\n v2 = (box_min_x, box_max_y, box_min_z)\n v3 = (box_min_x, box_max_y, box_max_z)\n v4 = (box_max_x, box... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process the two mappings defined above of permanent and temporary redirects to target URLs, to send the appropriate redirect responses | def apply_redirects():
permanent_redirect_url = permanent_redirect_map.get_target(
flask.request.path
)
if permanent_redirect_url:
return flask.redirect(permanent_redirect_url, code=301)
redirect_url = redirect_map.get_target(flask.request.path)
if redirect_url:
return flas... | [
"def handle(mapping, fvars=None):\n for url, ofno in utils.group(mapping, 2):\n if isinstance(ofno, tuple): \n ofn, fna = ofno[0], list(ofno[1:])\n else: \n ofn, fna = ofno, []\n fn, result = utils.re_subm('^' + url + '$', ofn, web.ctx.path)\n if result: # it's a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If a file doesn't exist at the requested path, see if it exists at one of the other paths, and redirect there if necessary | def find_file_or_redirect():
request_path = flask.request.path
template_finder = routing.TemplateFinder(app.template_folder)
file_path = routing.get_file(request_path)
preferred_languages = routing.requested_languages(flask.request)
if 'en' not in preferred_languages:
preferred_languages.ap... | [
"def _check_local_exists(direct_path, tail):\n file_name = os.path.join(direct_path, tail)\n if os.path.exists(file_name):\n logging.info(\"%s existed\", tail)\n return True\n return False",
"def check_files(self, target, path=\"/\", phishing=False):\n self.log.critical(\"\\tTesting ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assumes word is str type object. Returns True if characters of word make up palindrome, Returns False otherwise. Nonletters, capitalisation, ignored. Helper Methods toChars(word) converts input string to lowercase english characters. isPal(word) check equality in outer word chars recursively moving inwards. | def isPalindrome(word):
# HELPER METHOD 1: convert input word to lower-case char array
def toChars(word):
global NumCalls
alphabet_english = "abcdefghijklmnopqrstuvwxyz"
word = word.lower()
letters = ""
for character in word:
if character in alphabet_englis... | [
"def is_palindrome(word):\n pass",
"def is_palindrome(word):\n return word.lower() == word.lower()[::-1]",
"def is_palindrome(s):\n def to_chars(s):\n s = s.lower()\n letters = ''\n for c in s:\n if c in 'abcdefghijklmnopqrstuvwxyz':\n letters = letters + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply smoothing to raw counts and recompute log probabilities | def _update_feature_log_prob(self, alpha):
smoothed_fc = self.feature_count_ + alpha
smoothed_cc = smoothed_fc.sum(axis=1)
self.feature_log_prob_ = (np.log(smoothed_fc) -
np.log(smoothed_cc.reshape(-1, 1))) | [
"def apply_smoothing(self):\r\n smooth_length(self.ln_lookup, self.ln_counter)\r\n smooth_grammar(self.grammar, self.ip_counter, self.ep_counter)",
"def smooth(self,windowlength):\n #self.data = self.df.data[int(start * self.df.rate) : int(end * self.df.rate)].copy()#.astype(float)\n #... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invoke this method to notify that trash has been grabbed (e.g. one thread will invoke this when it sees that the IR sensor has been tripped in the handle) | def notify_trash_grabbed(self):
print("notify_trash_grabbed() invoked")
if not self.notifying:
return
# Send a random integer from 0-10 for debugging purposes
# The exact integer sent has no application purposes,
# but we can tell that a new indication has been se... | [
"def wait(self, handle):\n return",
"def notify(info):\n __notifier.notify(info)",
"def _monitor(self):\n q = self.queue\n has_task_done = hasattr(q, \"task_done\")\n while True:\n try:\n records = self.dequeue(True)\n if records is self._s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that changes name in list | def change_name(list_line, name="Lisa"):
k = 0 # índice para recorrer line
for t in list_line:
if t == "<name>":
list_line[k] = name
k += 1
return list_line | [
"def idschange(listname, dictname):\n for index, item in enumerate(listname):\n if isinstance(item, list):\n idschange(item, dictname)\n elif item in dictname.keys():\n listname[index] = dictname[item]\n return",
"def edit_bucketlistitem(self, b_id, name):\n self.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The name of the Load Balancing Inbound NAT Rules associated with this Backend Address Pool Address. | def inbound_nat_rule_name(self) -> Optional[str]:
return pulumi.get(self, "inbound_nat_rule_name") | [
"def inbound_nat_rule_name(self) -> str:\n return pulumi.get(self, \"inbound_nat_rule_name\")",
"def inbound_nat_rules(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"inbound_nat_rules\")",
"def load_balancer_rules(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The Frontend IP Configuration ID of a Gateway SKU Load Balancer. | def gateway_load_balancer_frontend_ip_configuration_id(self) -> Optional[str]:
return pulumi.get(self, "gateway_load_balancer_frontend_ip_configuration_id") | [
"def frontend_id(self):\n return self._frontend_id",
"def backend_address_pool_id(self) -> str:\n return pulumi.get(self, \"backend_address_pool_id\")",
"def load_balancer_id(self) -> Optional[str]:\n return pulumi.get(self, \"load_balancer_id\")",
"def service_runtime_subnet_id(self) -> ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The list of IDs of inbound rules that use this frontend IP. | def inbound_nat_rules(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "inbound_nat_rules") | [
"def load_balancer_inbound_nat_rules_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"load_balancer_inbound_nat_rules_ids\")",
"def cdn_frontdoor_rule_set_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"cdn_fr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The list of IDs of load balancing rules that use this frontend IP. | def load_balancer_rules(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "load_balancer_rules") | [
"def load_balancer_inbound_nat_rules_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"load_balancer_inbound_nat_rules_ids\")",
"def load_balancer_backend_address_pool_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The list of IDs outbound rules that use this frontend IP. | def outbound_rules(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "outbound_rules") | [
"def private_dns_resolver_outbound_endpoint_ids(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"private_dns_resolver_outbound_endpoint_ids\")",
"def private_dns_resolver_outbound_endpoint_ids(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulumi.get(self, \"private_d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The version of IP that the Private IP Address is. Possible values are `IPv4` or `IPv6`. | def private_ip_address_version(self) -> Optional[str]:
return pulumi.get(self, "private_ip_address_version") | [
"def private_ip_address_version(self) -> str:\n return pulumi.get(self, \"private_ip_address_version\")",
"def ip_version(value):\n return ipaddress.ip_address(value).version",
"def _get_ip_version(self, cidr):\n network = netaddr.IPNetwork(cidr)\n ip_version = network.ip.version\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The ID of a Public IP Address which should be associated with the Load Balancer. | def public_ip_address_id(self) -> Optional[str]:
return pulumi.get(self, "public_ip_address_id") | [
"def aipid(self):\n return self.fields[0]",
"def getPublicAddress(self):\n reservations = self.list_instances()\n instances = reservations[\"Reservations\"][0][\"Instances\"]\n \n ip_address = None\n for instance in instances:\n if instance[\"PublicIpAddress\"]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The ID of a Public IP Prefix which should be associated with the Load Balancer. Public IP Prefix can only be used with outbound rules. | def public_ip_prefix_id(self) -> Optional[str]:
return pulumi.get(self, "public_ip_prefix_id") | [
"def node_public_ip_prefix_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"node_public_ip_prefix_id\")",
"def ip_address_prefix(self):\n return self._ip_address_prefix",
"def create_ip_prefix(self, prefix, **kwargs):\n required_fields = {\"prefix\": prefix}\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A list of `inbound_nat_rule_port_mapping` block as defined below. | def inbound_nat_rule_port_mappings(self) -> Sequence['outputs.GetBackendAddressPoolBackendAddressInboundNatRulePortMappingResult']:
return pulumi.get(self, "inbound_nat_rule_port_mappings") | [
"def port_mappings(self) -> Sequence['outputs.K8sSlbAttachmentSlbConfigPortMapping']:\n return pulumi.get(self, \"port_mappings\")",
"def GetAllMappedPorts(self):\n return self._port_mappings",
"def ex_list_port_forwarding_rules(self):\r\n rules = []\r\n result = self._sync_request(comma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The ID of the Virtual Network where the Backend Address of the Load Balancer exists. | def virtual_network_id(self) -> str:
return pulumi.get(self, "virtual_network_id") | [
"def backend_address_pool_id(self) -> str:\n return pulumi.get(self, \"backend_address_pool_id\")",
"def gateway_load_balancer_frontend_ip_configuration_id(self) -> Optional[str]:\n return pulumi.get(self, \"gateway_load_balancer_frontend_ip_configuration_id\")",
"def load_balancer_id(self) -> Opt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The Backend Port of the Load Balancing Inbound NAT Rules associated with this Backend Address Pool Address. | def backend_port(self) -> int:
return pulumi.get(self, "backend_port") | [
"def port(self) -> \"ServiceBackendPort\":\n return typing.cast(\n \"ServiceBackendPort\",\n self._properties.get(\"port\"),\n )",
"def frontend_port(self) -> int:\n return pulumi.get(self, \"frontend_port\")",
"def backend_port(self, value):\n if value is not N... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The Frontend Port of the Load Balancing Inbound NAT Rules associated with this Backend Address Pool Address. | def frontend_port(self) -> int:
return pulumi.get(self, "frontend_port") | [
"def port(self) -> \"ServiceBackendPort\":\n return typing.cast(\n \"ServiceBackendPort\",\n self._properties.get(\"port\"),\n )",
"def get_frontend_address(self):\n return self._fe_address",
"def netflow_collector_port(self):\n return self.data[\"netflow_collec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The name of the Load Balancing Inbound NAT Rules associated with this Backend Address Pool Address. | def inbound_nat_rule_name(self) -> str:
return pulumi.get(self, "inbound_nat_rule_name") | [
"def inbound_nat_rules(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"inbound_nat_rules\")",
"def load_balancer_rules(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"load_balancer_rules\")",
"def inbound_nat_rule_port_mappings(self) -> Sequence['outputs.GetBackendAddre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private IP Address to assign to the Load Balancer. | def private_ip_address(self) -> str:
return pulumi.get(self, "private_ip_address") | [
"def _get_private_ip(self):\n with _ExceptionHandler.catch(gen_msg='no_instance_ip'):\n return self._instance.private_ip_address",
"def unit_private_ip(self):\n return self.environment.unit_get('private-address')",
"def private_ip_address_allocation(self) -> str:\n return pulumi.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The allocation method for the Private IP Address used by this Load Balancer. | def private_ip_address_allocation(self) -> str:
return pulumi.get(self, "private_ip_address_allocation") | [
"def allocate_subnet(self, request):",
"def ex_allocate_public_ip(self):\r\n return self.driver.ex_allocate_public_ip(self)",
"def PrivateIPAddressing(self, zone = None):\n self.private_addressing = True\n if zone is None:\n zone = self.zone\n self.reservation = self.teste... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The Private IP Address Version, either `IPv4` or `IPv6`. | def private_ip_address_version(self) -> str:
return pulumi.get(self, "private_ip_address_version") | [
"def private_ip_address_version(self) -> Optional[str]:\n return pulumi.get(self, \"private_ip_address_version\")",
"def ip_version(value):\n return ipaddress.ip_address(value).version",
"def _get_ip_version(self, cidr):\n network = netaddr.IPNetwork(cidr)\n ip_version = network.ip.versi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The ID of a Public IP Address which is associated with this Load Balancer. | def public_ip_address_id(self) -> str:
return pulumi.get(self, "public_ip_address_id") | [
"def getPublicAddress(self):\n reservations = self.list_instances()\n instances = reservations[\"Reservations\"][0][\"Instances\"]\n \n ip_address = None\n for instance in instances:\n if instance[\"PublicIpAddress\"] != \"\":\n ip_address = instance[\"Pu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The ID of the Subnet which is associated with the IP Configuration. | def subnet_id(self) -> str:
return pulumi.get(self, "subnet_id") | [
"def service_runtime_subnet_id(self) -> str:\n return pulumi.get(self, \"service_runtime_subnet_id\")",
"def client_subnet(self) -> str:\n return pulumi.get(self, \"client_subnet\")",
"def get_subnet(self, subnet_id):",
"def subnetwork(self) -> pulumi.Output[Optional[str]]:\n return pulum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Template filter that returns field class name (in lower case). E.g. if field is CharField then {{ field|field_type }} will return 'charfield'. | def field_type(field):
if hasattr(field, 'field') and field.field:
return field.field.__class__.__name__.lower()
return '' | [
"def name(field: BaseField) -> str:\n return field.NAME",
"def _csv_filter_class_name(cls, filter_class, lookup_type):\n # DateTimeFilter => DateTime\n type_name = filter_class.__name__\n if type_name.endswith('Filter'):\n type_name = type_name[:-6]\n\n # in => In\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Template filter that returns field widget class name (in lower case). E.g. if field's widget is TextInput then {{ field|widget_type }} will return 'textinput'. | def widget_type(field):
if hasattr(field, 'field') and hasattr(field.field, 'widget') and field.field.widget:
return field.field.widget.__class__.__name__.lower()
return '' | [
"def _widget_name(field):\n return field.field.widget.__class__.__name__",
"def field_type(field):\r\n if hasattr(field, 'field') and field.field:\r\n return field.field.__class__.__name__.lower()\r\n return ''",
"def _csv_filter_class_name(cls, filter_class, lookup_type):\n # DateTimeFil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render a form field using given attributevalue pairs Takes form field as first argument and list of attributevalue pairs for all other arguments. Attributevalue pairs should be in the form of attribute=value or attribute="a value" for assignment and attribute+=value or attribute+="value" for appending. | def render_field(parser, token):
error_msg = '%r tag requires a form field followed by a list of attributes and values in the form attr="value"' % token.split_contents()[0]
try:
bits = token.split_contents()
tag_name = bits[0]
form_field = bits[1]
attr_list = bits[2:]
... | [
"def render_field_from_tag(field, *attributes):\r\n attr_strings = [' %s' % f for f in attributes]\r\n tpl = string.Template('{% render_field form.$field$attrs %}')\r\n render_field_str = tpl.substitute(field=field, attrs=''.join(attr_strings))\r\n return render_form(render_field_str)",
"def render_fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders template ``text`` with widget_tweaks library loaded and MyForm instance available in context as ``form``. | def render_form(text, form=None, **context_args):
tpl = Template("{% load widget_tweaks %}" + text)
context_args.update({'form': MyForm() if form is None else form})
context = Context(context_args)
return tpl.render(context) | [
"def render_template(text, **context_args):\n template = Template(\"{% load bootstrap3 %}\" + text)\n if not 'form' in context_args:\n context_args['form'] = AccountForm()\n return template.render(Context(context_args))",
"def render_template(text, **context_args):\r\n template = Template(\"{% ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders ``field`` of MyForm with filter ``template_filter`` applied. ``params`` are filter arguments. If you want to apply several filters (in a chain), pass extra ``template_filter`` and ``params`` as positional arguments. In order to use custom form, pass form instance as ``form`` keyword argument. | def render_field(field, template_filter, params, *args, **kwargs):
filters = [(template_filter, params)]
filters.extend(zip(args[::2], args[1::2]))
filter_strings = ['|%s:"%s"' % (f[0], f[1],) for f in filters]
render_field_str = '{{ form.%s%s }}' % (field, ''.join(filter_strings))
return rende... | [
"def render_form(text, form=None, **context_args):\r\n tpl = Template(\"{% load widget_tweaks %}\" + text)\r\n context_args.update({'form': MyForm() if form is None else form})\r\n context = Context(context_args)\r\n return tpl.render(context)",
"def render_field_from_tag(field, *attributes):\r\n a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders MyForm's field ``field`` with attributes passed as positional arguments. | def render_field_from_tag(field, *attributes):
attr_strings = [' %s' % f for f in attributes]
tpl = string.Template('{% render_field form.$field$attrs %}')
render_field_str = tpl.substitute(field=field, attrs=''.join(attr_strings))
return render_form(render_field_str) | [
"def render_field(field, template_filter, params, *args, **kwargs):\r\n filters = [(template_filter, params)]\r\n filters.extend(zip(args[::2], args[1::2]))\r\n filter_strings = ['|%s:\"%s\"' % (f[0], f[1],) for f in filters]\r\n render_field_str = '{{ form.%s%s }}' % (field, ''.join(filter_strings))\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return as many versions of the source text wrapped to ensure each remix verse (that exist on the source) appears as an independent line at least once as an independent line (if it exists) >>> fragmenter('I have a dream that one day this nation will rise up ' 'and live out the true meaning of its creed', ['I have a drea... | def fragmenter(source, remix_lines, debug=False):
# fragments not present in this source.
not_found_on_source = []
for line in remix_lines:
if line not in source:
not_found_on_source.append(line)
def iterate(lines):
current = source
not_found = []
for line ... | [
"def telegram_chunk_by_line(self, text: str, max_length: int) -> List[str]:\n chunks = []\n\n # Escape Markdown by type\n lines = re.split(r'(`)(.*?)(`)', text)\n for i in range(len(lines)):\n if i % 4 in (1, 3):\n continue\n base_entity = 'code' if i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given raw line potentially having symbols + or at the beginning or the end, return of the cleaned line, start_offset, end_offset each symbol is equivalent to an ``offset_step`` (in seconds), positive or negative, which are applied to the segment cut then | def fine_tuning(raw_line, offset_step=0.05):
def _offset(symbols):
if not symbols:
return 0
sign = int('{}1'.format(symbols[0]))
return len(symbols) * offset_step * sign
result = re.match(OFFSET_PATTERN, raw_line).groupdict()
line = result.pop('line').strip()
return ... | [
"def split_line(self):\n # coordinate of the # symbol or end of the line (-1) if not found\n hash_or_end = self.line.find(\"#\")\n temp = self.line[self.region_end:hash_or_end].strip(\" |\")\n self.coord_str = regex_paren.sub(\"\", temp)\n\n # don't want any meta_str if there is n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the moviepy clip resulting of concatenate each segment listed in the remix data | def make_remix(remix_data, mvp_clips, output_type):
concatenate = (
concatenate_videoclips if output_type == 'video' else concatenate_audioclips
)
segments = []
for _, segment_data in remix_data:
clip = mvp_clips[segment_data['clip']]
segment = clip.subclip(segment_data['begin'],... | [
"def concat(src, dst):\n combineVideos(src, dst)",
"def concatenate_audio_pydub(audio_clip_paths, output_path, verbose=1):\n def get_file_extension(filename):\n \"\"\"A helper function to get a file's extension\"\"\"\n return os.path.splitext(filename)[1].lstrip(\".\")\n\n clips = []\n #... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the difference of the the time indexes \ Returns the int time_step | def get_time_step(time_array):
if len(time_array) > 1:
return abs(time_array[1] - time_array[0])
else:
return 0 | [
"def estimate_indexing_time(self) -> float:\n raise NotImplementedError()",
"def n_timesteps(self) -> int:\n if self.total_time < self.timestep:\n warnings.warn(\n f\"No simulation possible: you asked for {self.total_time} \"\n f\"simulation time but the time... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Closes the input netCDF file | def close_netcdf(data):
data['file'].close() | [
"def close(self):\n if self._nc_handle is not None:\n self._nc_handle.close()\n self._nc_handle = None",
"def _close_file(self):\n self._iostream.close()\n self._fileobj.close()",
"def close_file(self):\n self.hdf.close()",
"def close_file():\n lib_close.cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes the netCDF file \ Returns the int fill_value | def get_fill_value(f):
fill_value = netCDF4.default_fillvals['f4']
if 'RUNSF' in f.variables:
variable = f.variables['RUNSF']
if '_FillValue' in variable.ncattrs():
fill_value = variable._FillValue
else:
fill_value = None
return fill_value | [
"def nodata_val():\n with rasterio.open(filenames[0]) as src:\n return src.nodata",
"def fill_value(self, default=None):\n fillval = self.get_property(\"missing_value\", None)\n if fillval is None:\n fillval = self.get_property(\"_FillValue\", None)\n\n if fillval is None... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
opens the input netCDF file \ Returns the Dict, containing the necessary values for \ calculations and later file creation | def read_netcdf(netcdf):
print('Read GLDAS netCDF file')
f = netCDF4.Dataset(netcdf, 'r')
data = {}
data['data'] = []
data['filename'] = netcdf
data['file'] = f
data['longitude_size'] = len(f.dimensions['lon'])
data['latitude_size'] = len(f.dimensions['lat'])
data['time_size'] = l... | [
"def init_netcdf_output(filename):\n\n # Read YAML config for netcdf structure and properties\n nc = cfg.read_nc_config()\n dimensions = nc.dimensions\n global_attributes = nc.global_attributes\n\n # Filter out only METAR variables\n variables = {}\n all_variables = nc.variables\n metar_vari... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a output point shapefile, containing the geometry \ and properties of the Point \ If the file already exists, the cached one will be used instead | def create_point_shapefile(data, polygon, point_shapefile):
print('Create a point shapefile with all the GLDAS grid cells')
longitude_array = data['longitude_array']
latitude_array = data['latitude_array']
polygon_driver = polygon.driver
point_driver = polygon_driver
polygon_crs = polygon.crs
... | [
"def test_export_stp(self):\n\n test_shape = ExtrudeMixedShape(\n points=[\n (10, 20, \"straight\"),\n (10, 10, \"straight\"),\n (20, 10, \"circle\"),\n (22, 15, \"circle\"),\n (20, 20, \"straight\"),\n ],\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an Index object containing \ the int id and 4tuple bound of the point shape | def create_spatial_index(point):
print('Create spatial index for the bounds of each point feature')
index = rtree.index.Index()
for point_feature in point:
point_feature_id = int(point_feature['id'])
# The first argument of index.insert has to be int, not long or str
point_shape = s... | [
"def buildNodeIndex():\n node_index = rtree.index.Index()\n \n desc = arcpy.Describe(SOURCE_NETWORK_SHAPEFILE)\n shape_field = desc.ShapeFieldName\n rows = arcpy.SearchCursor(SOURCE_NETWORK_SHAPEFILE,VALID_LINKS_QUERY)\n node_xy = {}\n for row in rows:\n a = row.getValue('A')\n b ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterates through the features of the polygon \ and the index object's list of intersection bounds \ Returns the Dict, containing the list of longitude and latitude indexes\ that intersect with the polygon | def find_intersection(polygon, point, index, data):
print('Find GLDAS grid cells that intersect with polygon')
target_lon_indexes = []
target_lat_indexes = []
for polygon_feature in polygon:
polygon_shape = shapely.geometry.shape(polygon_feature['geometry'])
polygon_prepared = shapely.p... | [
"def inds_in_polygon(xy, polygon):\n bpath = mplpath.Path(polygon)\n inside = bpath.contains_points(xy)\n inds = np.where(inside)[0]\n return inds",
"def get_interesecting_vdatum_regions(self):\n dataset = gdal.Open(self.input_file)\n is_raster = dataset.RasterCount > 0\n if is_ra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of surface areas, \ computed by using the data, provided by the input netCDF file | def compute_surface_areas(target_indexes, data):
print('Compute surface area of each grid cell')
surface_areas = [0] * len(target_indexes['lon'])
# in meters
earth_radius = 6371000
for i in range(len(target_indexes['lon'])):
latitude_index = target_indexes['lat'][i]
latitude = data... | [
"def areas(self) -> list[float]:",
"def dem2array(filename, variable_name='elevation',\n easting_min=None, easting_max=None,\n northing_min=None, northing_max=None,\n use_cache=False, verbose=False,):\n\n\n\n\n import os\n from anuga.file.netcdf import NetCDFFile\n\n\n\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the int total Surface area by \ adding the list of given surface areas | def compute_total_surface_area(surface_areas):
print('Compute total surface area')
total_surface_area = sum(surface_areas)
print(' - the area (m2) : ' + str(total_surface_area))
return total_surface_area | [
"def surface_area(self):\n l, h, w = self.size\n return 2 * (w * l + h * l + h * w)",
"def surface_area(self):\n\t\treturn 4 * PI * power(self.r, 2)",
"def total_area(cls):\n cummulative_area = 0\n for t in cls.all_triangles:\n cummulative_area+=t.area()\n return cu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks command line and parses the options \ Returns the dict, containing the Source, Model, Location, \ start_time, and variable_names | def read_command_line():
global advanced
global add_all_variable_names
try:
options, arguments = getopt.getopt(sys.argv[1:], 'hd:')
except getopt.GetoptError:
print_usage()
print('ERROR: Syntax Error with command!')
raise SystemExit(22)
command_info = {'source': '',... | [
"def parse_command_line_args():\n if len(sys.argv) < 2:\n sys.stderr.write(\"Usage : python {} MMDDYY_HHMMSS_cust_id (for example 051317_000001_000015)\\n\"\n .format(sys.argv[0]))\n raise SystemExit(1) \n mmddyy, hhmmss, raw_cust_id = sys.argv[1].split('_')\n our_run_date = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the input files exist | def check_if_input_files_exist(input_command_info):
for input_file in input_command_info:
try:
with open(input_file) as f:
pass
except IOError as e:
print('ERROR - Unable to open \'' + input_file + '\'')
raise SystemExit(22) | [
"def testFileExistence(self):\n check_file_exists(\"null\")\n check_file_exists(\"sample/null.tif\")\n check_file_exists(\"test_merger.py\")",
"def ensure_files(*args):\n for path in args:\n if not os.path.exists(path):\n print('Can\\'t find: {}'.format(path))\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures the initial variable names in command_info contains nothing \ and proceeds to add the list of proper variable names from the function, \ get_computable_variables | def post_command_info_setup(command_info, data):
if add_all_variable_names:
command_info['variable_names'] = get_computable_variables(command_info,\
data)
command_info['start_time'] = parse_start_time_string(data['time_units']) | [
"def _get_output_vars(self):",
"def free_variables(self) -> Set[str]:\n # Task 7.6.3\n vars = set()\n free_vars = set()\n self.form_extract_helper(free_vars, 4, vars)\n return free_vars",
"def __collect_names():\n for c in constants.keys():\n if not all_names.__conta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates an orthonormal basis given an arbitrary vector u. | def define_orthonormal_basis(u):
u = u / np.sqrt(u[0]**2 + u[1]**2)
w = np.array([-u[1],u[0]])
W = np.column_stack((u,w))
return W | [
"def unit_vector(u: Vec4) -> Vec4:\n _mag = Vec4.magnitude(u)\n linv = 1.0 / _mag\n return u * linv",
"def ode(u: float) -> float:\n return u ** 2",
"def russellrao(u, v):\n u = _validate_vector(u)\n v = _validate_vector(v)\n if u.dtype == bool:\n ntt = (u & v).sum()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
vlsr in kms freq0 in whatever you want out | def calc_frequency(vlsr, freq0):
from scipy import constants
return (1-vlsr/(constants.c*1e-3))*freq0 | [
"def vat_rate():",
"def resonantfreq(self):\n\n return c0/self.wavelength",
"def freq_kep(self):\n return self.vel_ff/self.rads",
"def cm12freq(wn):\n c = 299792458*1e6/1e12 # speed of light in vac. [μm/ps]\n return c*1e-4*wn",
"def frequency_to_wavelength(freq):\n return ifc.SPEED_OF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calc vlsr in km/s from two freq | def calc_vlsr (f,f0):
from scipy import constants
return (1-f/f0)*constants.c*1e-3 | [
"def calc_vswr(ant,f,r):\n\n# fwdcalfac = get_calfac(f)\n# revcalfac = get_calfac(r)\n\n f=abs(DAQC.getADC(0,f))\n r=abs(DAQC.getADC(0,r))\n# TODO For normalizing elements when true test rig is ready\n# f=f-fwdcalfac\n# r=r-revcalfac\n# Need to divide voltage by 50 ohm to get current, multiply current times v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save a class and its attributes to a plain text file Takes the object/class and a filename (optional) as input and writes a (text)file with the class information. Does not save class methods (obviously). The problem that it solves is that Pickle cannot save dynamically created classes without tweaks. | def save_class(obj, filename = 'object.save'):
#~ return 0
variables = vars(obj)
keys = variables.keys()
subclasses = [key for key in keys if str(type(variables[key]))[7:-2] in ['instance', 'classobj']]
#~ "__main__" in str(variables[key]) or "classobj" in str(variables[key])]
keys0 = [key ... | [
"def _dump_cls(self, cls, fn):\n w = gzip.open(fn, 'wb')\n cPickle.dump(cls, w, 1)\n w.close()",
"def save(self, file):\n # get __init__ arguments\n signature = inspect.signature(self.__init__)\n args_list = list(signature.parameters)\n args = {arg: getattr(self, arg) fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stylify text change format, forground color and background color. Sends back the string 'txt' with the correct foreground unicode color start and finish (reset color). Arguments Formatting style of text (f) f = "n" normal "b" bold "u" underline "l" blinking "i" inverse Forground color of text (fg) fg = "k" black "r" re... | def stylify (s='Test text', f='n', fg='r', bg='d'):
# needed them in this order for it to work,
# styles, fg color, bg color
format_and_colors = {"n_f": 0, #
"b_f": 1, #
"u_f": 4,
"l_f": 5,
"i_f": 7,
... | [
"def format_text(text: str, style: Dict[str, Any]) -> str:\n return click.style(\n text, fg=style[\"fg\"], bold=style.get(\"bold\", False), dim=style.get(\"dim\", False)\n )",
"def set_text_style(self, style):\n\n raise NotImplementedError()",
"def highlight(regexes, color_themes, text, print_ou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |