query stringlengths 9 3.4k | document stringlengths 9 87.4k | metadata dict | negatives listlengths 4 101 | negative_scores listlengths 4 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Deletes the specified policy. The deletion takes effect typically within 10 seconds. | def delete_policy(self, policy_id, **kwargs):
resource_path = "/policies/{policyId}"
method = "DELETE"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"delete_policy got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"policyId": policy_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policy_delete(request, policy_id):\n neutronclient(request).delete_qos_policy(policy_id)",
"def delete(self, policy_name):\n path = self.vault.normalize(\"/sys/policies/acl/\" + policy_name)\n address = self.vault.vault_adress + \"/v1\" + path\n # Actually run vault\n logging.i... | [
"0.8218596",
"0.77184653",
"0.76911354",
"0.7670649",
"0.74277234",
"0.7140506",
"0.6988987",
"0.6940251",
"0.67815155",
"0.665882",
"0.65701747",
"0.64927775",
"0.63801694",
"0.6353876",
"0.6351143",
"0.6344114",
"0.6344114",
"0.63357604",
"0.6287126",
"0.6283431",
"0.626953... | 0.6445359 | 12 |
Deletes the specified SMTP credential for the specified user. | def delete_smtp_credential(self, user_id, smtp_credential_id, **kwargs):
resource_path = "/users/{userId}/smtpCredentials/{smtpCredentialId}"
method = "DELETE"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"delete_smtp_credential got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id,
"smtpCredentialId": smtp_credential_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_credential(self, credential):\r\n return self.delete(self.credential_path % (credential))",
"def delete_credential(credentials):\n credentials.delete_credentials()",
"def delete_credential(self):\n Credentials.credentials_list.remove(self)",
"def delete_credential(name: str):\n ... | [
"0.7331302",
"0.72613764",
"0.670908",
"0.661661",
"0.65503716",
"0.6531281",
"0.65208536",
"0.6449064",
"0.6350622",
"0.63303417",
"0.63224506",
"0.6295059",
"0.62919253",
"0.6242662",
"0.6233042",
"0.61947227",
"0.6164052",
"0.6137985",
"0.6137985",
"0.6137985",
"0.6135059"... | 0.72640246 | 1 |
Deletes the specified tag definition. This operation triggers a process that removes the tag from all resources in your tenancy. | def delete_tag(self, tag_namespace_id, tag_name, **kwargs):
resource_path = "/tagNamespaces/{tagNamespaceId}/tags/{tagName}"
method = "DELETE"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"delete_tag got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagNamespaceId": tag_namespace_id,
"tagName": tag_name
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(self):\n request = self.tags_service.delete(path=self._path)\n request.execute()",
"def delete_tag(tag):\n tag.destroy()",
"def delete(self, tag, params={}, **options):\n path = \"/tags/%s\" % (tag)\n return self.client.delete(path, params, **options)",
"def delete_t... | [
"0.7041559",
"0.7017274",
"0.68210644",
"0.67219794",
"0.6699245",
"0.6619593",
"0.6408356",
"0.6379325",
"0.63487124",
"0.62727845",
"0.62387455",
"0.61683017",
"0.60791034",
"0.59661263",
"0.596435",
"0.592325",
"0.58542705",
"0.58466",
"0.5823866",
"0.58166766",
"0.5810723... | 0.4964765 | 93 |
Deletes the the specified tag default. | def delete_tag_default(self, tag_default_id, **kwargs):
resource_path = "/tagDefaults/{tagDefaultId}"
method = "DELETE"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"opc_request_id",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"delete_tag_default got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagDefaultId": tag_default_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"opc-request-id": kwargs.get("opc_request_id", missing),
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_default(self):\n if self.default_present:\n self.removeItem(0)\n self.default_present = False",
"def delete_tag(tag):\n tag.destroy()",
"def delete_tag(self,tag):\r\n\r\n # with shelf\r\n if self.using_shelf:\r\n del self.tag_dict[tag]",
"de... | [
"0.6711261",
"0.6618538",
"0.62383074",
"0.61715645",
"0.5984171",
"0.5975831",
"0.5970485",
"0.585169",
"0.58504015",
"0.5791107",
"0.57085663",
"0.55927753",
"0.55772495",
"0.5562356",
"0.5456258",
"0.5449171",
"0.5441209",
"0.5433733",
"0.5428394",
"0.5425312",
"0.54240113... | 0.6901326 | 0 |
Deletes the specified tag namespace. Only an empty tag namespace can be deleted. To delete a tag namespace, first delete all its tag definitions. | def delete_tag_namespace(self, tag_namespace_id, **kwargs):
resource_path = "/tagNamespaces/{tagNamespaceId}"
method = "DELETE"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match",
"opc_request_id"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"delete_tag_namespace got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagNamespaceId": tag_namespace_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing),
"opc-request-id": kwargs.get("opc_request_id", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_namespace(self, namespace):\n return self.core_client.delete_namespace(namespace)",
"def delete_namespace_content(context, namespace_id, session):\n count = 0\n query = (session.query(models.MetadefTag).filter_by(\n namespace_id=namespace_id))\n count = query.delete(synchronize_... | [
"0.6721054",
"0.66566586",
"0.62986535",
"0.62826926",
"0.6097214",
"0.6018456",
"0.6014207",
"0.600658",
"0.59086114",
"0.5848785",
"0.58461416",
"0.57414937",
"0.5721018",
"0.5693057",
"0.56371254",
"0.55568355",
"0.55374837",
"0.5530103",
"0.5464297",
"0.5459409",
"0.54590... | 0.63382393 | 2 |
Deletes the specified user. The user must not be in any groups. | def delete_user(self, user_id, **kwargs):
resource_path = "/users/{userId}"
method = "DELETE"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"delete_user got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_user(self, user):\n self.delete(user)",
"def delete_user(self, user):\n # noinspection PyUnresolvedReferences\n self.delete(user)",
"def delete_user(self, user):\n self.execute(TABELLE['id_users'][\"delete\"], user[\"id\"])",
"def delete_user(self, user):\n name ... | [
"0.89206994",
"0.8815847",
"0.8651233",
"0.86132264",
"0.8323322",
"0.83127373",
"0.8241263",
"0.82311684",
"0.82144606",
"0.8204657",
"0.8158758",
"0.80740803",
"0.80130297",
"0.80094916",
"0.79904824",
"0.79593945",
"0.79579115",
"0.79529476",
"0.7919857",
"0.79124516",
"0.... | 0.0 | -1 |
Generate seed for the MFA TOTP device. | def generate_totp_seed(self, user_id, mfa_totp_device_id, **kwargs):
resource_path = "/users/{userId}/mfaTotpDevices/{mfaTotpDeviceId}/actions/generateSeed"
method = "POST"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"generate_totp_seed got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id,
"mfaTotpDeviceId": mfa_totp_device_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="MfaTotpDevice")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="MfaTotpDevice") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createOTP():\n\t code = []\n\t for i in range(6):\n\t\t code.append(random.randint(0,9))\n\t return \"\".join(str(code) for c in code)",
"def seed():",
"def passwordGen() :\n\treturn __randomString(12)",
"def genSeed():\n\tseed_length = int(''.join(random.SystemRandom().choice(string.digits) for _ in... | [
"0.6439089",
"0.6343524",
"0.631821",
"0.629884",
"0.6196717",
"0.6172871",
"0.6148124",
"0.6079628",
"0.6045656",
"0.6045656",
"0.6012038",
"0.5985964",
"0.58983946",
"0.5868619",
"0.5857218",
"0.5822443",
"0.5819638",
"0.58043975",
"0.5787715",
"0.5729017",
"0.5728478",
"... | 0.6281103 | 4 |
Gets the authentication policy for the given tenancy. You must specify your tenant\u2019s OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). | def get_authentication_policy(self, compartment_id, **kwargs):
resource_path = "/authenticationPolicies/{compartmentId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_authentication_policy got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"compartmentId": compartment_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="AuthenticationPolicy")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="AuthenticationPolicy") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authentication_policy(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"authentication_policy\")",
"def authentication_policy(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"authentication_policy\")",
"def authentication_policy(self) -> pulumi.Output[Optional... | [
"0.5763793",
"0.5763793",
"0.56437725",
"0.52095336",
"0.51566327",
"0.5049942",
"0.49517995",
"0.49281493",
"0.4919025",
"0.48551175",
"0.48236695",
"0.48195675",
"0.48187912",
"0.47907704",
"0.47624832",
"0.4753156",
"0.4753156",
"0.47355378",
"0.47262105",
"0.4723426",
"0.... | 0.6030179 | 0 |
Gets the specified compartment's information. This operation does not return a list of all the resources inside the compartment. There is no single API operation that does that. Compartments can contain multiple types of resources (instances, block storage volumes, etc.). To find out what's in a compartment, you must call the \"List\" operation for each resource type and specify the compartment's OCID as a query parameter in the request. For example, | def get_compartment(self, compartment_id, **kwargs):
resource_path = "/compartments/{compartmentId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_compartment got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"compartmentId": compartment_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Compartment")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Compartment") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getCompartment(self, *args):\n return _libsbml.Model_getCompartment(self, *args)",
"def getCompartment(self):\n return _libsbml.CompartmentReference_getCompartment(self)",
"def list_compartments(self, compartment_id, **kwargs):\n resource_path = \"/compartments\"\n method = \"GE... | [
"0.651724",
"0.6153286",
"0.6037744",
"0.58690524",
"0.57859063",
"0.5781716",
"0.5763131",
"0.576079",
"0.5643876",
"0.5598771",
"0.5592769",
"0.55235153",
"0.5381384",
"0.5341171",
"0.5341171",
"0.5283982",
"0.5278441",
"0.5222629",
"0.5219247",
"0.5206948",
"0.5200719",
... | 0.6193012 | 1 |
Gets the specified dynamic group's information. | def get_dynamic_group(self, dynamic_group_id, **kwargs):
resource_path = "/dynamicGroups/{dynamicGroupId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_dynamic_group got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"dynamicGroupId": dynamic_group_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="DynamicGroup")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="DynamicGroup") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_group_info(groupname):\n return jsonify(admin.get_group_info(current_app.scoped_session(), groupname))",
"def get_group_details(self, group_id):\n url = self.groups_url + \"/\" + group_id\n return requests.get(url, headers=self.headers)",
"def customer_group_get(group_id=None):\n db... | [
"0.7188056",
"0.6950326",
"0.6684029",
"0.66321135",
"0.6617548",
"0.6559893",
"0.6399865",
"0.6395958",
"0.63655305",
"0.6357235",
"0.6337324",
"0.6310174",
"0.63096356",
"0.6253531",
"0.6217098",
"0.6209635",
"0.620371",
"0.6186933",
"0.618276",
"0.6155897",
"0.6151408",
... | 0.6638582 | 3 |
Gets the specified group's information. This operation does not return a list of all the users in the group. To do that, use | def get_group(self, group_id, **kwargs):
resource_path = "/groups/{groupId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_group got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"groupId": group_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Group")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Group") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_group_info(groupname):\n return jsonify(admin.get_group_info(current_app.scoped_session(), groupname))",
"def get_group_details(self, group_id):\n url = self.groups_url + \"/\" + group_id\n return requests.get(url, headers=self.headers)",
"def get_group_users(groupname):\n return js... | [
"0.72617346",
"0.7245011",
"0.7240115",
"0.71307135",
"0.7093996",
"0.7082136",
"0.7026646",
"0.7011292",
"0.6943717",
"0.69318485",
"0.6926901",
"0.68956447",
"0.68776196",
"0.68700737",
"0.68466604",
"0.68005854",
"0.6799346",
"0.6788357",
"0.6776635",
"0.67737633",
"0.6730... | 0.0 | -1 |
Gets the specified identity provider's information. | def get_identity_provider(self, identity_provider_id, **kwargs):
resource_path = "/identityProviders/{identityProviderId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_identity_provider got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"identityProviderId": identity_provider_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="IdentityProvider")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="IdentityProvider") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_consumer_info_for(self, provider):\n return secrets.AUTH_CONFIG[provider]",
"def identity_provider_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"identity_provider_name\")",
"def get(self,\n provider_id,\n ):\n return self._invoke('get',\n ... | [
"0.67674404",
"0.6680759",
"0.66144663",
"0.66144663",
"0.6562782",
"0.6389836",
"0.6265224",
"0.62433296",
"0.61461306",
"0.61224926",
"0.6072356",
"0.60681295",
"0.60681295",
"0.6066393",
"0.60295826",
"0.5999033",
"0.59945655",
"0.59081084",
"0.590395",
"0.58972937",
"0.58... | 0.5865107 | 23 |
Gets the specified group mapping. | def get_idp_group_mapping(self, identity_provider_id, mapping_id, **kwargs):
resource_path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_idp_group_mapping got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"identityProviderId": identity_provider_id,
"mappingId": mapping_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="IdpGroupMapping")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="IdpGroupMapping") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_group(self, group_name):\n\n return self._group[group_name]",
"def resolv_map(self, group):\n if group not in self._cache_map:\n self._cache_map[group] = self._upcall_read('map', dict(GROUP=group))\n\n return self._cache_map[group]",
"def get_group(group):\n\n return ldap... | [
"0.70288837",
"0.6876679",
"0.68675697",
"0.6823533",
"0.6671686",
"0.64943933",
"0.6347924",
"0.6328841",
"0.63257825",
"0.6268732",
"0.6233412",
"0.6212056",
"0.61379856",
"0.6134247",
"0.60706836",
"0.60260206",
"0.60117376",
"0.5994067",
"0.5948818",
"0.5932824",
"0.59033... | 0.54366267 | 76 |
Get the specified MFA TOTP device for the specified user. | def get_mfa_totp_device(self, user_id, mfa_totp_device_id, **kwargs):
resource_path = "/users/{userId}/mfaTotpDevices/{mfaTotpDeviceId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_mfa_totp_device got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id,
"mfaTotpDeviceId": mfa_totp_device_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="MfaTotpDeviceSummary")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="MfaTotpDeviceSummary") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_mfa_totp_device(self, user_id, **kwargs):\n resource_path = \"/users/{userId}/mfaTotpDevices\"\n method = \"POST\"\n\n # Don't accept unknown kwargs\n expected_kwargs = [\n \"retry_strategy\",\n \"opc_retry_token\"\n ]\n extra_kwargs = [_ke... | [
"0.6745442",
"0.60613525",
"0.59726477",
"0.5702831",
"0.55748624",
"0.5469353",
"0.54422414",
"0.53837264",
"0.53459823",
"0.53429735",
"0.5318181",
"0.5315078",
"0.5313801",
"0.5306907",
"0.5290798",
"0.52894306",
"0.52770966",
"0.5263118",
"0.5261724",
"0.52087736",
"0.518... | 0.7053731 | 0 |
Gets the specified network source's information. | def get_network_source(self, network_source_id, **kwargs):
resource_path = "/networkSources/{networkSourceId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_network_source got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"networkSourceId": network_source_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="NetworkSources")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="NetworkSources") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_source_info(self) -> 'outputs.DatasourceResponse':\n return pulumi.get(self, \"data_source_info\")",
"def source(self):\n if self._source not in ['Idle', 'Network']:\n return self._source\n else:\n return None",
"def get_metadata(self, source, graph):\n ... | [
"0.6463655",
"0.6205295",
"0.6124874",
"0.609256",
"0.60485286",
"0.60455465",
"0.6035504",
"0.59897584",
"0.5891964",
"0.58896935",
"0.58769464",
"0.5848994",
"0.58475167",
"0.58382004",
"0.5824984",
"0.58154297",
"0.5785791",
"0.57799673",
"0.5767593",
"0.57521796",
"0.5719... | 0.6018748 | 7 |
Gets the specified policy's information. | def get_policy(self, policy_id, **kwargs):
resource_path = "/policies/{policyId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_policy got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"policyId": policy_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Policy")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Policy") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policy_info(self) -> 'outputs.PolicyInfoResponse':\n return pulumi.get(self, \"policy_info\")",
"def policy_info(self) -> pulumi.Input['PolicyInfoArgs']:\n return pulumi.get(self, \"policy_info\")",
"def read(self, policy_name):\n path = self.vault.normalize(\"/sys/policies/acl/\" + po... | [
"0.83910096",
"0.7993574",
"0.74160916",
"0.7270525",
"0.7270525",
"0.7270525",
"0.7178607",
"0.71649534",
"0.71649534",
"0.71649534",
"0.71506953",
"0.70812213",
"0.7078061",
"0.70566046",
"0.7050848",
"0.7042278",
"0.6983816",
"0.6946659",
"0.6928475",
"0.6928475",
"0.69162... | 0.5592181 | 94 |
Gets the specified tag's information. | def get_tag(self, tag_namespace_id, tag_name, **kwargs):
resource_path = "/tagNamespaces/{tagNamespaceId}/tags/{tagName}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_tag got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagNamespaceId": tag_namespace_id,
"tagName": tag_name
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Tag")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Tag") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def info(self, tag):\n\n url = \"https://api.instagram.com/v1/tags/{0}?access_token={1}\".format(tag, self.access_token)\n request = requests.get(url)\n print(request.headers)\n return request.json()",
"def get_tag(self, tag):\n resp = self.get(_u.build_uri(\"tag\", domain=self... | [
"0.747428",
"0.7410492",
"0.6692782",
"0.6677863",
"0.6667355",
"0.65872085",
"0.65737224",
"0.65508467",
"0.6460756",
"0.6332787",
"0.63079554",
"0.62929213",
"0.6286769",
"0.6240733",
"0.6209361",
"0.6202848",
"0.6188568",
"0.61841136",
"0.6178364",
"0.61635315",
"0.6150373... | 0.0 | -1 |
Retrieves the specified tag default. | def get_tag_default(self, tag_default_id, **kwargs):
resource_path = "/tagDefaults/{tagDefaultId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_tag_default got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagDefaultId": tag_default_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="TagDefault")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="TagDefault") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_tag(self, tags):\n tags_counter = Counter()\n for tag in tags:\n tags_counter[tag] += 1\n\n if len(tags_counter) == 2 and list(tags_counter.values())[0] == list(tags_counter.values())[1]:\n return ut.find_positive_tag(tags_counter.keys())\n\n return... | [
"0.7081396",
"0.6996165",
"0.6928306",
"0.68010557",
"0.67721087",
"0.6700133",
"0.6666502",
"0.65979785",
"0.65852",
"0.65847015",
"0.6540291",
"0.64615685",
"0.64236104",
"0.63959",
"0.63959",
"0.6388913",
"0.63801557",
"0.6371682",
"0.63607526",
"0.63218176",
"0.63205206",... | 0.6928629 | 2 |
Gets the specified tag namespace's information. | def get_tag_namespace(self, tag_namespace_id, **kwargs):
resource_path = "/tagNamespaces/{tagNamespaceId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_tag_namespace got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagNamespaceId": tag_namespace_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="TagNamespace")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="TagNamespace") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def namespace(self, namespace):\n return self.client.call('GET',\n self.name, params={'namespace': namespace})",
"def _parse_ns_tag(ns_tag):\n m = _NsTagRE.match(ns_tag)\n return m.groups() if m else (None, None)",
"def _get_xml_namespace(root_tag):\n m = re.m... | [
"0.6676316",
"0.65238637",
"0.6215992",
"0.5927034",
"0.58749634",
"0.5791631",
"0.56914693",
"0.56914693",
"0.56914693",
"0.56914693",
"0.56914693",
"0.5600001",
"0.5581799",
"0.5574338",
"0.5574338",
"0.5574338",
"0.55718166",
"0.5555538",
"0.5546786",
"0.5539851",
"0.55282... | 0.5151831 | 64 |
Gets details on a specified work request. The workRequestID is returned in the opcworkrequestid header for any asynchronous operation in the Identity and Access Management service. | def get_tagging_work_request(self, work_request_id, **kwargs):
resource_path = "/taggingWorkRequests/{workRequestId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_tagging_work_request got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"workRequestId": work_request_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="TaggingWorkRequest")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="TaggingWorkRequest") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_work_request(self, work_request_id, **kwargs):\n resource_path = \"/workRequests/{workRequestId}\"\n method = \"GET\"\n\n expected_kwargs = [\"retry_strategy\"]\n extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]\n if extra_kwargs:\n ... | [
"0.6255874",
"0.5651409",
"0.5530125",
"0.5476779",
"0.5332237",
"0.5308513",
"0.52760774",
"0.51337117",
"0.5100316",
"0.5034349",
"0.4997517",
"0.4974544",
"0.4972364",
"0.49616352",
"0.49303",
"0.49270195",
"0.4919135",
"0.49007675",
"0.4880712",
"0.485593",
"0.48542556",
... | 0.4938437 | 14 |
Get the specified tenancy's information. | def get_tenancy(self, tenancy_id, **kwargs):
resource_path = "/tenancies/{tenancyId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_tenancy got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tenancyId": tenancy_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Tenancy")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Tenancy") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tenants(self):\n # print \"tenant list is %s\" % self.auth.tenants.list()\n if not self._tenancy:\n self._tenancy = {}\n for tenant in self.auth.tenants.list():\n t = Tenant(tenant, self)\n self._tenancy[t[\"name\"]] = t\n return self._te... | [
"0.633115",
"0.6270229",
"0.6024418",
"0.5914824",
"0.59081745",
"0.5818619",
"0.5763514",
"0.5751513",
"0.5732008",
"0.5686052",
"0.56732315",
"0.5667248",
"0.5657612",
"0.5629676",
"0.561599",
"0.56010634",
"0.559895",
"0.5592223",
"0.5585628",
"0.5580276",
"0.55515385",
... | 0.6393299 | 0 |
Gets the specified user's information. | def get_user(self, user_id, **kwargs):
resource_path = "/users/{userId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_user got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="User")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="User") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_info(self):\n response = self.query('user_info')\n return response",
"def GetInfoForUser(user):\n return models.UserInfo.gql('WHERE user = :1', user).get()",
"def get_users_info(): \n \n data = user_obj.get_users_info()\n return data",
"def user_info(user_id):\n return U... | [
"0.8078219",
"0.8060639",
"0.8038709",
"0.80188537",
"0.79876477",
"0.7913451",
"0.7849845",
"0.7831485",
"0.78257066",
"0.7802099",
"0.7783503",
"0.7776827",
"0.77714074",
"0.77186304",
"0.7709317",
"0.76658565",
"0.7657189",
"0.7639148",
"0.7587892",
"0.758278",
"0.758278",... | 0.0 | -1 |
Gets the specified UserGroupMembership's information. | def get_user_group_membership(self, user_group_membership_id, **kwargs):
resource_path = "/userGroupMemberships/{userGroupMembershipId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_user_group_membership got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userGroupMembershipId": user_group_membership_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="UserGroupMembership")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="UserGroupMembership") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_their_members(our_group):\n\tgroup_id = our_group[\"groupId\"]\n\turl = f'{BASE_URL}/groups/{group_id}/members'\n\tparams = {'$select': 'userPrincipalName,id'}\n\treturn call_api(url, params)",
"def get_membership_data_for_current_user(self):\n # TODO: Assuming first server is good - need to mak... | [
"0.6235419",
"0.61992306",
"0.60605794",
"0.60599184",
"0.6059044",
"0.60332453",
"0.6025113",
"0.5984252",
"0.5957381",
"0.5928913",
"0.5920698",
"0.59183306",
"0.5917003",
"0.59147394",
"0.59113026",
"0.58406615",
"0.5840103",
"0.5822994",
"0.5788936",
"0.57630724",
"0.5758... | 0.67357963 | 0 |
Gets the specified user's console password information. The returned object contains the user's OCID, but not the password itself. The actual password is returned only when created or reset. | def get_user_ui_password_information(self, user_id, **kwargs):
resource_path = "/users/{userId}/uiPassword"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_user_ui_password_information got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="UIPasswordInformation")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="UIPasswordInformation") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_password(self):\n return self.controller.dbfilter.db.get('passwd/user-password')",
"def get_password_from_user():\n pwd = ''\n keyboard = xbmc.Keyboard('', ADDON_NAME + ': ' + localise(32022), True)\n keyboard.doModal()\n if keyboard.isConfirmed():\n pwd = keyboard.getText()\n ... | [
"0.7236961",
"0.68295044",
"0.681905",
"0.6805937",
"0.66924196",
"0.66504323",
"0.66416496",
"0.664007",
"0.66202456",
"0.66089183",
"0.66012734",
"0.6560518",
"0.6538691",
"0.6538691",
"0.6538691",
"0.6501631",
"0.64902675",
"0.6487195",
"0.64705867",
"0.6461097",
"0.641077... | 0.0 | -1 |
Gets details on a specified work request. The workRequestID is returned in the opcworkrequestid header for any asynchronous operation in the Identity and Access Management service. | def get_work_request(self, work_request_id, **kwargs):
resource_path = "/workRequests/{workRequestId}"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"get_work_request got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"workRequestId": work_request_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="WorkRequest")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="WorkRequest") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getwork(self, data: Optional[str] = None) -> Dict[str, Any]:\n assert data is None or type(data) == str\n return self.rpc_call(\"getwork\", data)",
"def get_request(request_id=None, workload_id=None, session=None):\n\n try:\n if not request_id and workload_id:\n request_ids... | [
"0.56530815",
"0.5529833",
"0.54778296",
"0.5333147",
"0.53069115",
"0.5274904",
"0.51362526",
"0.51026773",
"0.5036096",
"0.49953598",
"0.49753773",
"0.49725127",
"0.4961871",
"0.4939883",
"0.49278948",
"0.4925855",
"0.49189013",
"0.49009278",
"0.4879232",
"0.48540133",
"0.4... | 0.6257329 | 0 |
Lists the API signing keys for the specified user. A user can have a maximum of three keys. Every user has permission to use this API call for their own user ID. An administrator in your organization does not need to write a policy to give users this ability. | def list_api_keys(self, user_id, **kwargs):
resource_path = "/users/{userId}/apiKeys"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_api_keys got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[ApiKey]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[ApiKey]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_keys(user_id):\n\n db_conn = sqlite3.connect(db_path)\n db = db_conn.cursor()\n keys = []\n try:\n for row in db.execute(\"SELECT public_key FROM public_keys WHERE username=? AND status=?\", [user_id, PK_STATUS_OK]):\n keys.append({\"public\": row[0]})\n db_conn.close()... | [
"0.6866222",
"0.66910446",
"0.6670618",
"0.64299655",
"0.6349597",
"0.6267026",
"0.622857",
"0.62016267",
"0.6186303",
"0.6160741",
"0.60831136",
"0.5966327",
"0.5913713",
"0.58797574",
"0.58408535",
"0.57975286",
"0.5738591",
"0.571278",
"0.5685982",
"0.5669537",
"0.56538075... | 0.69830835 | 0 |
Lists the auth tokens for the specified user. The returned object contains the token's OCID, but not the token itself. The actual token is returned only upon creation. | def list_auth_tokens(self, user_id, **kwargs):
resource_path = "/users/{userId}/authTokens"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_auth_tokens got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[AuthToken]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[AuthToken]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_tokens(user):\n return AppSpecificAuthToken.select().where(AppSpecificAuthToken.user == user)",
"def get_user_access_tokens(request, user):\n manager = internal_keystoneclient(request).oauth2.access_tokens\n\n return manager.list_for_user(user=user)",
"def _list_tokens(self, user_id, tenant_i... | [
"0.7914114",
"0.728109",
"0.70411885",
"0.68726313",
"0.6513083",
"0.6368803",
"0.6219715",
"0.60768193",
"0.60738933",
"0.6033857",
"0.59760535",
"0.59416234",
"0.5925432",
"0.5917948",
"0.59171313",
"0.58211654",
"0.58108604",
"0.578572",
"0.5776958",
"0.5731432",
"0.568180... | 0.72673726 | 2 |
Lists the availability domains in your tenancy. Specify the OCID of either the tenancy or another of your compartments as the value for the compartment ID (remember that the tenancy is simply the root compartment). See `Where to Get the Tenancy's OCID and User's OCID`__. Note that the order of the results returned can change if availability domains are added or removed; therefore, do not create a dependency on the list order. | def list_availability_domains(self, compartment_id, **kwargs):
resource_path = "/availabilityDomains"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_availability_domains got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[AvailabilityDomain]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[AvailabilityDomain]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_fault_domains(self, compartment_id, availability_domain, **kwargs):\n resource_path = \"/faultDomains\"\n method = \"GET\"\n\n expected_kwargs = [\"retry_strategy\"]\n extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]\n if extra_kwargs... | [
"0.5952278",
"0.5752911",
"0.56866777",
"0.5658533",
"0.5655036",
"0.56334436",
"0.5622109",
"0.55967",
"0.5533269",
"0.55126745",
"0.5500697",
"0.5494048",
"0.5493609",
"0.5492394",
"0.54891664",
"0.54583323",
"0.5394912",
"0.5390071",
"0.5349818",
"0.5348451",
"0.53267604",... | 0.72129303 | 0 |
Lists the compartments in a specified compartment. The members of the list returned depends on the values set for several parameters. With the exception of the tenancy (root compartment), the ListCompartments operation returns only the firstlevel child compartments in the parent compartment specified in `compartmentId`. The list does not include any subcompartments of the child compartments (grandchildren). The parameter `accessLevel` specifies whether to return only those compartments for which the requestor has INSPECT permissions on at least one resource directly or indirectly (the resource can be in a subcompartment). The parameter `compartmentIdInSubtree` applies only when you perform ListCompartments on the tenancy (root compartment). When set to true, the entire hierarchy of compartments can be returned. To get a full list of all compartments and subcompartments in the tenancy (root compartment), set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ANY. See `Where to Get the Tenancy's OCID and User's OCID`__. | def list_compartments(self, compartment_id, **kwargs):
resource_path = "/compartments"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"access_level",
"compartment_id_in_subtree"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_compartments got unknown kwargs: {!r}".format(extra_kwargs))
if 'access_level' in kwargs:
access_level_allowed_values = ["ANY", "ACCESSIBLE"]
if kwargs['access_level'] not in access_level_allowed_values:
raise ValueError(
"Invalid value for `access_level`, must be one of {0}".format(access_level_allowed_values)
)
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"accessLevel": kwargs.get("access_level", missing),
"compartmentIdInSubtree": kwargs.get("compartment_id_in_subtree", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Compartment]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Compartment]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getListOfCompartments(self):\n return self.model.getListOfCompartments()",
"def getListOfCompartments(self, *args):\n return _libsbml.Model_getListOfCompartments(self, *args)",
"def get_compartment(self, compartment_id, **kwargs):\n resource_path = \"/compartments/{compartmentId}\"\n ... | [
"0.62096506",
"0.60235274",
"0.5435602",
"0.5372225",
"0.52894926",
"0.5113388",
"0.50968504",
"0.5042258",
"0.49255446",
"0.4908474",
"0.48918715",
"0.4878826",
"0.4840922",
"0.46979246",
"0.46899638",
"0.46821752",
"0.468023",
"0.45857018",
"0.45253602",
"0.4391601",
"0.437... | 0.84061605 | 0 |
Lists all the tags enabled for costtracking in the specified tenancy. For information about costtracking tags, see `Using Costtracking Tags`__. | def list_cost_tracking_tags(self, compartment_id, **kwargs):
resource_path = "/tagNamespaces/actions/listCostTrackingTags"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_cost_tracking_tags got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Tag]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Tag]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listTags(self, authenticationToken):\r\n pass",
"def list_tags(self, session):\n result = self._tag(session.get, session=session)\n return result['tags']",
"def list_tags():\r\n tags = Tag.query.order_by(Tag.name).all()\r\n return render_template('tags.html', tags=tags)",
"def get_... | [
"0.63822997",
"0.61948174",
"0.6163116",
"0.6132447",
"0.6132447",
"0.6095878",
"0.60922146",
"0.6062289",
"0.60137403",
"0.6006326",
"0.59625673",
"0.5926329",
"0.5855336",
"0.5804048",
"0.57833034",
"0.57692766",
"0.57686114",
"0.5734323",
"0.57283866",
"0.57195485",
"0.571... | 0.6232547 | 1 |
Lists the secret keys for the specified user. The returned object contains the secret key's OCID, but not the secret key itself. The actual secret key is returned only upon creation. | def list_customer_secret_keys(self, user_id, **kwargs):
resource_path = "/users/{userId}/customerSecretKeys"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_customer_secret_keys got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[CustomerSecretKeySummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[CustomerSecretKeySummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def describe_user_encryption_key_list(\n self,\n request: dds_20151201_models.DescribeUserEncryptionKeyListRequest,\n ) -> dds_20151201_models.DescribeUserEncryptionKeyListResponse:\n runtime = util_models.RuntimeOptions()\n return self.describe_user_encryption_key_list_with_options(... | [
"0.66501856",
"0.6520959",
"0.6316638",
"0.6299123",
"0.62734264",
"0.627234",
"0.62511283",
"0.606225",
"0.60029274",
"0.59841985",
"0.5940731",
"0.5805145",
"0.5801294",
"0.5739835",
"0.5712983",
"0.5704147",
"0.566274",
"0.5550773",
"0.5525107",
"0.5505345",
"0.5473902",
... | 0.7246356 | 0 |
Lists the dynamic groups in your tenancy. You must specify your tenancy's OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See `Where to Get the Tenancy's OCID and User's OCID`__. | def list_dynamic_groups(self, compartment_id, **kwargs):
resource_path = "/dynamicGroups"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_dynamic_groups got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[DynamicGroup]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[DynamicGroup]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list(request):\n return render_to_response('rteacher/manage_groups_list.html', request, **klist(\n request=request\n ))",
"def groups(self):\n #return self.get('{}/groups'.format(ApiVersion.A1.value))\n return self.get('{}/groups'.format(ApiVersion.CM1.value))",
"def groups():\n ... | [
"0.65068406",
"0.6469846",
"0.63963234",
"0.6134552",
"0.6109888",
"0.6099704",
"0.60848904",
"0.60196185",
"0.6018239",
"0.6011199",
"0.5968778",
"0.5935231",
"0.59249777",
"0.587962",
"0.5860688",
"0.58439285",
"0.58141536",
"0.5788746",
"0.5758732",
"0.57442486",
"0.567956... | 0.671684 | 0 |
Lists the Fault Domains in your tenancy. Specify the OCID of either the tenancy or another of your compartments as the value for the compartment ID (remember that the tenancy is simply the root compartment). See `Where to Get the Tenancy's OCID and User's OCID`__. | def list_fault_domains(self, compartment_id, availability_domain, **kwargs):
resource_path = "/faultDomains"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_fault_domains got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"availabilityDomain": availability_domain
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[FaultDomain]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[FaultDomain]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listDomains(self):\n reply = self.rpc.getDomains(self.username,\n self.password)\n if reply[0] == 'UNKNOWN_ERROR':\n raise Exception(\"RPC returned error: \" + reply[0])\n return reply",
"def get_storage_domains(cohesity_client):\n storage... | [
"0.57624483",
"0.5618712",
"0.5579227",
"0.55783147",
"0.5538795",
"0.54575324",
"0.5412407",
"0.53967834",
"0.5350825",
"0.5334975",
"0.52671653",
"0.52478313",
"0.52312326",
"0.52176356",
"0.5216194",
"0.520539",
"0.5197498",
"0.5193738",
"0.51901394",
"0.5165269",
"0.51523... | 0.65855885 | 0 |
Lists the groups in your tenancy. You must specify your tenancy's OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See `Where to Get the Tenancy's OCID and User's OCID`__. | def list_groups(self, compartment_id, **kwargs):
resource_path = "/groups"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_groups got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Group]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Group]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def groups():\n access_token = session['access_token']\n return \"%s\" % list_groups(access_token)",
"def list_groups(access_token):\n request_url = OKTA_URL + \"api/v1/groups\"\n headers = {\"Authorization\": \"Bearer \" + access_token}\n group_request = requests.get(request_url, headers=headers)... | [
"0.71493185",
"0.7144411",
"0.71203303",
"0.6876979",
"0.68021864",
"0.6760384",
"0.6710377",
"0.67021704",
"0.6697574",
"0.6696664",
"0.6681032",
"0.6635194",
"0.66194427",
"0.6614419",
"0.65979445",
"0.65908253",
"0.65883386",
"0.65745854",
"0.6557424",
"0.6525643",
"0.6454... | 0.6430042 | 21 |
Lists the identity provider groups. | def list_identity_provider_groups(self, identity_provider_id, **kwargs):
resource_path = "/identityProviders/{identityProviderId}/groups"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_identity_provider_groups got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"identityProviderId": identity_provider_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[IdentityProviderGroupSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[IdentityProviderGroupSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_groups(self):\n return self.get_admin(\"groups\")",
"def get_list_groups(self):\n list_response = requests.get(self.groups_url, headers=self.headers)\n return list_response.json()[\"groups\"]",
"def list_groups(self):\n return self._get(\"cloudConnectorGroups\").list",
"d... | [
"0.7612845",
"0.74096733",
"0.7197947",
"0.71231127",
"0.7057429",
"0.7055238",
"0.70541674",
"0.6953628",
"0.69469327",
"0.69342464",
"0.69159657",
"0.69158304",
"0.6810128",
"0.6757535",
"0.6740337",
"0.67368454",
"0.67164993",
"0.66926956",
"0.66826135",
"0.6666242",
"0.66... | 0.69324946 | 10 |
Lists all the identity providers in your tenancy. You must specify the identity provider type (e.g., `SAML2` for identity providers using the SAML2.0 protocol). You must specify your tenancy's OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See `Where to Get the Tenancy's OCID and User's OCID`__. | def list_identity_providers(self, protocol, compartment_id, **kwargs):
resource_path = "/identityProviders"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_identity_providers got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"protocol": protocol,
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[IdentityProvider]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[IdentityProvider]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list(conn):\n try:\n return conn.get(url='/auth-providers')['providers']\n except SystemError as e:\n raise e",
"def providers(self) -> List[str]:\n return [\n getattr(auth_account, \"provider\")\n for auth_account in self.auth_accounts # pylint: disable=not-... | [
"0.6727649",
"0.64191025",
"0.6271538",
"0.62455416",
"0.62455416",
"0.6074249",
"0.6066744",
"0.5960773",
"0.59022737",
"0.59022737",
"0.59022737",
"0.59022737",
"0.59022737",
"0.59022737",
"0.5825487",
"0.5819967",
"0.581062",
"0.5770538",
"0.576516",
"0.5720312",
"0.571423... | 0.64960575 | 1 |
Lists the group mappings for the specified identity provider. | def list_idp_group_mappings(self, identity_provider_id, **kwargs):
resource_path = "/identityProviders/{identityProviderId}/groupMappings"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_idp_group_mappings got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"identityProviderId": identity_provider_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[IdpGroupMapping]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[IdpGroupMapping]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def groups():\n access_token = session['access_token']\n return \"%s\" % list_groups(access_token)",
"def get_identity_groups(self):\n\t\tresult = {\n\t\t\t'success': False,\n\t\t\t'response': '',\n\t\t\t'error': '',\n\t\t}\n\n\t\tself.ise.headers.update({'Accept': 'application/vnd.com.cisco.ise.identity.i... | [
"0.60451424",
"0.6032505",
"0.5956654",
"0.5918813",
"0.58596",
"0.5801229",
"0.5754967",
"0.5714305",
"0.5660738",
"0.56143993",
"0.55850315",
"0.5576164",
"0.55513936",
"0.5545537",
"0.5543902",
"0.5542496",
"0.5516063",
"0.5498167",
"0.5491729",
"0.546018",
"0.5443648",
... | 0.6934423 | 0 |
Lists the MFA TOTP devices for the specified user. The returned object contains the device's OCID, but not the seed. The seed is returned only upon creation or when the IAM service regenerates the MFA seed for the device. | def list_mfa_totp_devices(self, user_id, **kwargs):
resource_path = "/users/{userId}/mfaTotpDevices"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"sort_by",
"sort_order"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_mfa_totp_devices got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
if 'sort_by' in kwargs:
sort_by_allowed_values = ["TIMECREATED", "NAME"]
if kwargs['sort_by'] not in sort_by_allowed_values:
raise ValueError(
"Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values)
)
if 'sort_order' in kwargs:
sort_order_allowed_values = ["ASC", "DESC"]
if kwargs['sort_order'] not in sort_order_allowed_values:
raise ValueError(
"Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values)
)
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"sortBy": kwargs.get("sort_by", missing),
"sortOrder": kwargs.get("sort_order", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[MfaTotpDeviceSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[MfaTotpDeviceSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_user_devices(self, user_id):\n if self.database is None:\n raise Exception(\"No database.\")\n if user_id is None or len(user_id) == 0:\n raise Exception(\"Bad parameter.\")\n devices = self.database.retrieve_user_devices(user_id)\n if devices is not N... | [
"0.63648194",
"0.62265784",
"0.6117706",
"0.61175627",
"0.5826038",
"0.574232",
"0.5716294",
"0.5668577",
"0.53647625",
"0.52985567",
"0.5172679",
"0.5028343",
"0.501832",
"0.49658716",
"0.4858226",
"0.48548654",
"0.4841386",
"0.48357037",
"0.48057312",
"0.47699174",
"0.47577... | 0.6962967 | 0 |
Lists the network sources in your tenancy. You must specify your tenancy's OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See `Where to Get the Tenancy's OCID and User's OCID`__. | def list_network_sources(self, compartment_id, **kwargs):
resource_path = "/networkSources"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_network_sources got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[NetworkSourcesSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[NetworkSourcesSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_sources():\n url = base_url + \"sources\"\n params = {\"language\": \"en\"}\n resp = requests.get(url, params=params)\n data = resp.json()\n sources = [src['id'].strip() for src in data['sources']]\n print(\"all the sources:\")\n print(sources)\n return sources",
"def paths_list(c... | [
"0.6069622",
"0.60684687",
"0.6046004",
"0.60339135",
"0.59831995",
"0.59754866",
"0.59675294",
"0.5898026",
"0.586566",
"0.5807168",
"0.5727688",
"0.5714986",
"0.5702389",
"0.5680545",
"0.564806",
"0.5645466",
"0.56405693",
"0.56157684",
"0.55836064",
"0.55833864",
"0.557077... | 0.66614133 | 0 |
List of Oauth tokens for the user | def list_o_auth_client_credentials(self, user_id, **kwargs):
resource_path = "/users/{userId}/oauth2ClientCredentials"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"lifecycle_state"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_o_auth_client_credentials got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
if 'lifecycle_state' in kwargs:
lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"]
if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
raise ValueError(
"Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values)
)
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"lifecycleState": kwargs.get("lifecycle_state", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[OAuth2ClientCredentialSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[OAuth2ClientCredentialSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_tokens(user):\n return AppSpecificAuthToken.select().where(AppSpecificAuthToken.user == user)",
"def tokens(self):\n return self.rpc.call(MsfRpcMethod.AuthTokenList)['tokens']",
"def tokens():\n return ['access token', 'refresh token']",
"def get_user_access_tokens(request, user):\n ... | [
"0.76735115",
"0.7521337",
"0.7381115",
"0.72044426",
"0.71589434",
"0.7055708",
"0.70043594",
"0.69068575",
"0.67511743",
"0.67317975",
"0.66999596",
"0.6661664",
"0.6636696",
"0.6495753",
"0.64924324",
"0.63827467",
"0.63599586",
"0.63553977",
"0.6325954",
"0.6325954",
"0.6... | 0.0 | -1 |
Lists the policies in the specified compartment (either the tenancy or another of your compartments). See `Where to Get the Tenancy's OCID and User's OCID`__. To determine which policies apply to a particular group or compartment, you must view the individual statements inside all your policies. There isn't a way to automatically obtain that information via the API. | def list_policies(self, compartment_id, **kwargs):
resource_path = "/policies"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_policies got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Policy]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[Policy]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_policies(self):\n client = self.connect(VAULT_TOKEN)\n return client.list_policies()",
"def list_policies(policystore_url, verbose):\n\n if verbose:\n logging.info('Listing policies')\n\n list_url = policystore_url + POLICYSTORE_PREFIX + 'ListEntitlementPolicies'\n\n r = re... | [
"0.7189241",
"0.6911353",
"0.69109756",
"0.6786608",
"0.6505484",
"0.6489422",
"0.6399176",
"0.6282769",
"0.6273543",
"0.62666065",
"0.6170152",
"0.61578345",
"0.59558356",
"0.5855535",
"0.5853909",
"0.58492464",
"0.57598",
"0.57497317",
"0.5630949",
"0.56128603",
"0.56102735... | 0.7190767 | 0 |
Lists the region subscriptions for the specified tenancy. | def list_region_subscriptions(self, tenancy_id, **kwargs):
resource_path = "/tenancies/{tenancyId}/regionSubscriptions"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_region_subscriptions got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tenancyId": tenancy_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[RegionSubscription]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[RegionSubscription]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAllSubscriptions(self):\n return self.request(\n \"getAllSubscriptions\",\n )",
"def listSubscriptions() -> object:\n\n db = Db()\n return db.Subscriptions.objects().to_json()",
"def GetSubscriptions(self):\n\n return self.__GetJson(\"/subscriptions\", True)",
"de... | [
"0.6887986",
"0.64734304",
"0.6237735",
"0.6100922",
"0.6089093",
"0.6054437",
"0.6008919",
"0.5998848",
"0.5985489",
"0.5876979",
"0.58604753",
"0.58339596",
"0.58058745",
"0.57581854",
"0.57325035",
"0.5700422",
"0.56921446",
"0.56718814",
"0.5643824",
"0.56429935",
"0.5636... | 0.7903534 | 0 |
Lists all the regions offered by Oracle Cloud Infrastructure. | def list_regions(self, **kwargs):
resource_path = "/regions"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_regions got unknown kwargs: {!r}".format(extra_kwargs))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
header_params=header_params,
response_type="list[Region]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
header_params=header_params,
response_type="list[Region]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_regions():\n regions_areas = (\n db.session.query(\n models.Region.code.label(\"region_code\"),\n models.Region.name.label(\"region_name\"),\n db.case([(models.District.code.is_(None),\n db.literal_column(\"'admin_area'\"))],\n ... | [
"0.7262118",
"0.7250822",
"0.7223589",
"0.70556355",
"0.68627703",
"0.65822685",
"0.6565507",
"0.6476824",
"0.6466699",
"0.6466699",
"0.644316",
"0.6336067",
"0.6334379",
"0.6329589",
"0.63073355",
"0.6281749",
"0.62563527",
"0.6244125",
"0.62346613",
"0.6221511",
"0.6212274"... | 0.71180004 | 3 |
Lists the SMTP credentials for the specified user. The returned object contains the credential's OCID, the SMTP user name but not the SMTP password. The SMTP password is returned only upon creation. | def list_smtp_credentials(self, user_id, **kwargs):
resource_path = "/users/{userId}/smtpCredentials"
method = "GET"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_smtp_credentials got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[SmtpCredentialSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="list[SmtpCredentialSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_credentials(user):\n return Credentials.list_credentials(user)",
"def get_user_credentials(connection):\n\n response = connection.get_json('user')\n user_data = response.get('user', None)\n if user_data is None:\n raise SAPCliError('gCTS response does not contain \\'user\\'')\n\n c... | [
"0.7158633",
"0.63490164",
"0.5840114",
"0.5356084",
"0.5350056",
"0.5333744",
"0.53025347",
"0.53025347",
"0.53025347",
"0.5278439",
"0.5255396",
"0.52334976",
"0.5210725",
"0.5210725",
"0.5193972",
"0.51926774",
"0.5166273",
"0.51630765",
"0.51324713",
"0.51061445",
"0.5105... | 0.7803695 | 0 |
Lists the tag defaults for tag definitions in the specified compartment. | def list_tag_defaults(self, **kwargs):
resource_path = "/tagDefaults"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"id",
"compartment_id",
"tag_definition_id",
"lifecycle_state"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_tag_defaults got unknown kwargs: {!r}".format(extra_kwargs))
if 'lifecycle_state' in kwargs:
lifecycle_state_allowed_values = ["ACTIVE"]
if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
raise ValueError(
"Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values)
)
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"id": kwargs.get("id", missing),
"compartmentId": kwargs.get("compartment_id", missing),
"tagDefinitionId": kwargs.get("tag_definition_id", missing),
"lifecycleState": kwargs.get("lifecycle_state", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[TagDefaultSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[TagDefaultSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initDefaults(self):\n return _libsbml.CompartmentGlyph_initDefaults(self)",
"def initDefaults(self):\n return _libsbml.Compartment_initDefaults(self)",
"def defaults(file):\n\n\tUNCAT_TAGID = 47\n\tNOSERIES_TAGID = 375\n\n\treturn [NOSERIES_TAGID, UNCAT_TAGID]",
"def get_default_vpas(self, ... | [
"0.5788659",
"0.5745859",
"0.5657144",
"0.5510926",
"0.5421845",
"0.52667904",
"0.5232069",
"0.52265173",
"0.51869756",
"0.5130844",
"0.51299524",
"0.5102675",
"0.5096235",
"0.50511813",
"0.5039385",
"0.502269",
"0.50160813",
"0.49855888",
"0.49597377",
"0.4956205",
"0.495322... | 0.6216055 | 0 |
Lists the tag namespaces in the specified compartment. | def list_tag_namespaces(self, compartment_id, **kwargs):
resource_path = "/tagNamespaces"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"include_subcompartments",
"lifecycle_state"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_tag_namespaces got unknown kwargs: {!r}".format(extra_kwargs))
if 'lifecycle_state' in kwargs:
lifecycle_state_allowed_values = ["ACTIVE", "INACTIVE", "DELETING", "DELETED"]
if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
raise ValueError(
"Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values)
)
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"includeSubcompartments": kwargs.get("include_subcompartments", missing),
"lifecycleState": kwargs.get("lifecycle_state", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[TagNamespaceSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[TagNamespaceSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def list_namespaces(self) -> list:\n return await self.AD.state.list_namespaces()",
"def namespaces(self):\n return [self._namespace_prefix]",
"def namespaces(self):\n namespaces = set()\n for namespace_package in self.namespace_packages:\n dotted_name = []\n ... | [
"0.71969026",
"0.61050427",
"0.5985775",
"0.59844434",
"0.59576994",
"0.5934063",
"0.59100467",
"0.5898842",
"0.58896667",
"0.5883841",
"0.58817756",
"0.58812404",
"0.58636045",
"0.584227",
"0.581729",
"0.5809152",
"0.58016217",
"0.5761703",
"0.5708301",
"0.56499183",
"0.5643... | 0.7114337 | 1 |
Gets the errors for a work request. | def list_tagging_work_request_errors(self, work_request_id, **kwargs):
resource_path = "/taggingWorkRequests/{workRequestId}/errors"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_tagging_work_request_errors got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"workRequestId": work_request_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[TaggingWorkRequestErrorSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[TaggingWorkRequestErrorSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_errors(self, request):\n\n value = request._get_parameter_value(self)\n return value.errors",
"def getErrors(self):\n return self.errors",
"def errors (self):\n return self._errors",
"def errors (self):\n return self._errors",
"def errors(self):\n return se... | [
"0.76682556",
"0.6973088",
"0.69202435",
"0.69202435",
"0.691879",
"0.6830657",
"0.6767033",
"0.6696042",
"0.6650402",
"0.6554404",
"0.6477976",
"0.64408416",
"0.64325213",
"0.6419485",
"0.6418935",
"0.63859105",
"0.6373044",
"0.63697267",
"0.6365497",
"0.6364051",
"0.6349409... | 0.6593195 | 9 |
Gets the logs for a work request. | def list_tagging_work_request_logs(self, work_request_id, **kwargs):
resource_path = "/taggingWorkRequests/{workRequestId}/logs"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_tagging_work_request_logs got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"workRequestId": work_request_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[TaggingWorkRequestLogSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[TaggingWorkRequestLogSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getLogs():",
"def getLogs():",
"def logs(self, **kwargs):\n return self.client.api.logs(self.id, **kwargs)",
"def get_logs(self):\n return self.network.get_logs()",
"def get_job_logs(self, params, ujs_proxy=None):\n if ujs_proxy is None:\n ujs_proxy = self.__proxy_client... | [
"0.7205541",
"0.7205541",
"0.69183385",
"0.68548286",
"0.671339",
"0.66895777",
"0.6651718",
"0.6651718",
"0.6607248",
"0.6598488",
"0.6557063",
"0.655379",
"0.64999664",
"0.6349522",
"0.63252586",
"0.6317283",
"0.6278176",
"0.6275006",
"0.6270008",
"0.6261736",
"0.62345433",... | 0.6452193 | 13 |
Lists the tagging work requests in compartment. | def list_tagging_work_requests(self, compartment_id, **kwargs):
resource_path = "/taggingWorkRequests"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"resource_identifier"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_tagging_work_requests got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"resourceIdentifier": kwargs.get("resource_identifier", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[TaggingWorkRequestSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[TaggingWorkRequestSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list(self, jobguid=\"\", executionparams=None):",
"def tags(self, request, tag_list, group):\n return tag_list",
"def get_jobs_list(self, response):\n pass",
"def listTagsByNotebook(self, authenticationToken, notebookGuid):\r\n pass",
"def handle_tags(self, request):\n \"\"\"\n ... | [
"0.58259183",
"0.5787486",
"0.578615",
"0.5756901",
"0.57381487",
"0.5711629",
"0.5706951",
"0.5672795",
"0.5647787",
"0.56005555",
"0.5547329",
"0.5543428",
"0.55379766",
"0.55379766",
"0.55000997",
"0.5487424",
"0.5475018",
"0.5472611",
"0.5454506",
"0.54417205",
"0.5426978... | 0.69553626 | 0 |
Lists the tag definitions in the specified tag namespace. | def list_tags(self, tag_namespace_id, **kwargs):
resource_path = "/tagNamespaces/{tagNamespaceId}/tags"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"lifecycle_state"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_tags got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagNamespaceId": tag_namespace_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
if 'lifecycle_state' in kwargs:
lifecycle_state_allowed_values = ["ACTIVE", "INACTIVE", "DELETING", "DELETED"]
if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values:
raise ValueError(
"Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values)
)
query_params = {
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"lifecycleState": kwargs.get("lifecycle_state", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[TagSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
query_params=query_params,
header_params=header_params,
response_type="list[TagSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list(self):\n\n\t\treturn self._list(\"/tag\", \"tag\")",
"def get_all(context, namespace_name, session, filters=None, marker=None,\n limit=None, sort_key='created_at', sort_dir='desc'):\n\n namespace = namespace_api.get(context, namespace_name, session)\n query = (session.query(models.Metad... | [
"0.62576944",
"0.6049763",
"0.57420623",
"0.5677931",
"0.56470114",
"0.5591507",
"0.5418022",
"0.54105335",
"0.54017437",
"0.5380748",
"0.5363339",
"0.53598344",
"0.53386366",
"0.5322805",
"0.5246583",
"0.5219264",
"0.52185553",
"0.5193574",
"0.51878446",
"0.5177014",
"0.5166... | 0.50524735 | 27 |
Lists the `UserGroupMembership` objects in your tenancy. You must specify your tenancy's OCID as the value for the compartment ID (see `Where to Get the Tenancy's OCID and User's OCID`__). | def list_user_group_memberships(self, compartment_id, **kwargs):
resource_path = "/userGroupMemberships"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"user_id",
"group_id",
"page",
"limit"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_user_group_memberships got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"userId": kwargs.get("user_id", missing),
"groupId": kwargs.get("group_id", missing),
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[UserGroupMembership]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[UserGroupMembership]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view_group(request, group_id):\n users = models.UserProfile.all().order('email')\n if group_id:\n group = models.UserGroup.get_by_id(int(group_id))\n if group.users:\n users = models.UserProfile.get(group.users)\n else:\n users = []\n return utility.respond(request, 'admin/view_group', {'... | [
"0.59523857",
"0.59251404",
"0.5874129",
"0.5672281",
"0.56644803",
"0.56609535",
"0.56514776",
"0.56267077",
"0.5618761",
"0.56177497",
"0.5544431",
"0.54518914",
"0.544957",
"0.5421477",
"0.54123914",
"0.54096514",
"0.5407805",
"0.5396198",
"0.53743017",
"0.53723145",
"0.53... | 0.68893605 | 0 |
Lists the users in your tenancy. You must specify your tenancy's OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See `Where to Get the Tenancy's OCID and User's OCID`__. | def list_users(self, compartment_id, **kwargs):
resource_path = "/users"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"identity_provider_id",
"external_identifier"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_users got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"identityProviderId": kwargs.get("identity_provider_id", missing),
"externalIdentifier": kwargs.get("external_identifier", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[User]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[User]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_user_list(cs, args):\n _, users = cs.users.list()\n fields = ['user_id', 'username', 'email', 'realname', 'comment']\n utils.print_list(users, fields, sortby=args.sortby)",
"def user_list(ctx):\n data = ctx.obj.get_all_users()\n output_json_data(data)",
"def list(self, tenant_id=None):\n\... | [
"0.7112592",
"0.7053617",
"0.7042246",
"0.7014473",
"0.6937669",
"0.6858919",
"0.68402475",
"0.68375933",
"0.6806012",
"0.6805044",
"0.67853475",
"0.6784348",
"0.6762646",
"0.67508584",
"0.67508584",
"0.67508584",
"0.67508584",
"0.67508584",
"0.67508584",
"0.6744993",
"0.6743... | 0.6938413 | 4 |
Lists the work requests in compartment. | def list_work_requests(self, compartment_id, **kwargs):
resource_path = "/workRequests"
method = "GET"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"page",
"limit",
"resource_identifier"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_work_requests got unknown kwargs: {!r}".format(extra_kwargs))
query_params = {
"compartmentId": compartment_id,
"page": kwargs.get("page", missing),
"limit": kwargs.get("limit", missing),
"resourceIdentifier": kwargs.get("resource_identifier", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[WorkRequestSummary]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[WorkRequestSummary]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listRequests(self):\n reqmgr = RequestManagerImpl()\n retval = []\n for request in reqmgr.listRequests(self.endpoint):\n tmpRequest = Request()\n tmpRequest.setReqmgrUrl( self.endpoint )\n tmpRequest.setWorkflowName( request['request_name'] )\n r... | [
"0.67798686",
"0.64472514",
"0.6357527",
"0.62949765",
"0.61017513",
"0.606693",
"0.6015134",
"0.59746355",
"0.5971976",
"0.59663254",
"0.596574",
"0.59381527",
"0.5924295",
"0.590886",
"0.5905645",
"0.5905645",
"0.5890049",
"0.5807364",
"0.57771367",
"0.57649094",
"0.5733279... | 0.69024056 | 0 |
Move the compartment to a different parent compartment in the same tenancy. When you move a compartment, all its contents (subcompartments and resources) are moved with it. Note that the `CompartmentId` that you specify in the path is the compartment that you want to move. | def move_compartment(self, compartment_id, move_compartment_details, **kwargs):
resource_path = "/compartments/{compartmentId}/actions/moveCompartment"
method = "POST"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match",
"opc_request_id",
"opc_retry_token"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"move_compartment got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"compartmentId": compartment_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing),
"opc-request-id": kwargs.get("opc_request_id", missing),
"opc-retry-token": kwargs.get("opc_retry_token", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
if not isinstance(retry_strategy, retry.NoneRetryStrategy):
self.base_client.add_opc_retry_token_if_needed(header_params)
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=move_compartment_details)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=move_compartment_details) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_project_move_child(self):\n new_category = self.make_project(\n 'NewCategory', PROJECT_TYPE_CATEGORY, self.category\n )\n self.make_assignment(new_category, self.user, self.role_owner)\n url = reverse(\n 'projectroles:api_project_update',\n ... | [
"0.5687158",
"0.542566",
"0.533787",
"0.5328388",
"0.516376",
"0.5099298",
"0.50907147",
"0.5065896",
"0.50041324",
"0.49923396",
"0.49568546",
"0.4937967",
"0.49123746",
"0.4888783",
"0.4883443",
"0.48625642",
"0.48523584",
"0.48384222",
"0.48384222",
"0.48376495",
"0.483340... | 0.6347577 | 0 |
Recover the compartment from DELETED state to ACTIVE state. | def recover_compartment(self, compartment_id, **kwargs):
resource_path = "/compartments/{compartmentId}/actions/recoverCompartment"
method = "POST"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match",
"opc_request_id"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"recover_compartment got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"compartmentId": compartment_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing),
"opc-request-id": kwargs.get("opc_request_id", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Compartment")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="Compartment") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reactivate(self):\n self.write({'active': True, 'state': 'running'})\n STAGE = self.env['anytracker.stage']\n for ticket in self:\n starts = STAGE.search([('method_id', '=', ticket.method_id.id),\n ('progress', '=', 0)])\n if len(star... | [
"0.5480294",
"0.5277981",
"0.52267",
"0.52267",
"0.5225232",
"0.5208037",
"0.5192213",
"0.51521283",
"0.51319057",
"0.50953686",
"0.50489",
"0.503891",
"0.503891",
"0.503891",
"0.503891",
"0.503891",
"0.5005554",
"0.5005554",
"0.49955514",
"0.49873796",
"0.49641302",
"0.491... | 0.47606575 | 48 |
Removes a user from a group by deleting the corresponding `UserGroupMembership`. | def remove_user_from_group(self, user_group_membership_id, **kwargs):
resource_path = "/userGroupMemberships/{userGroupMembershipId}"
method = "DELETE"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"remove_user_from_group got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userGroupMembershipId": user_group_membership_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params)
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_from_group(user: User, group: Group) -> Result:\n if user.pw_name not in group.gr_mem:\n return Result(State.unchanged)\n command([\"/usr/sbin/deluser\", user.pw_name, group.gr_name])\n group.gr_mem.remove(user.pw_name)\n return Result(State.success)",
"def delete_group_user(self, g... | [
"0.77502465",
"0.77219933",
"0.7696446",
"0.7663514",
"0.76629514",
"0.74954414",
"0.7458197",
"0.7424002",
"0.73372084",
"0.73255515",
"0.7295747",
"0.72660804",
"0.7258215",
"0.7208784",
"0.7098873",
"0.7064429",
"0.70261437",
"0.6963763",
"0.69584423",
"0.692891",
"0.69165... | 0.68140376 | 23 |
Resets the OAuth2 client credentials for the SCIM client associated with this identity provider. | def reset_idp_scim_client(self, identity_provider_id, **kwargs):
resource_path = "/identityProviders/{identityProviderId}/actions/resetScimClient"
method = "POST"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"reset_idp_scim_client got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"identityProviderId": identity_provider_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="ScimClientCredentials")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="ScimClientCredentials") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logout(self):\n self._client.clear_credentials()",
"def reset_secret(self, save=False):\n client = cas.get_client()\n client.revoke_application_tokens(self.client_id, self.client_secret)\n self.client_secret = generate_client_secret()\n\n if save:\n self.save()\n... | [
"0.63996184",
"0.61857796",
"0.6167417",
"0.61205524",
"0.6116238",
"0.5673805",
"0.5546106",
"0.54928285",
"0.54202366",
"0.53968155",
"0.53470254",
"0.53334624",
"0.5311507",
"0.5289614",
"0.5285055",
"0.5245378",
"0.52309966",
"0.5217204",
"0.5211187",
"0.51890314",
"0.513... | 0.6584309 | 0 |
Updates the specified auth token's description. | def update_auth_token(self, user_id, auth_token_id, update_auth_token_details, **kwargs):
resource_path = "/users/{userId}/authTokens/{authTokenId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_auth_token got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id,
"authTokenId": auth_token_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_auth_token_details,
response_type="AuthToken")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_auth_token_details,
response_type="AuthToken") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_api_video_patch_detail_token_user_description(self):\n video = factories.VideoFactory(description=\"my description\")\n jwt_token = AccessToken()\n jwt_token.payload[\"resource_id\"] = str(video.id)\n jwt_token.payload[\"roles\"] = [random.choice([\"instructor\", \"administrato... | [
"0.6497291",
"0.6414944",
"0.62694657",
"0.610832",
"0.5971511",
"0.5964725",
"0.581407",
"0.5786695",
"0.5741787",
"0.57394075",
"0.5723997",
"0.5715468",
"0.5691383",
"0.55781394",
"0.55590355",
"0.5552019",
"0.5540073",
"0.5533868",
"0.552116",
"0.5510495",
"0.54998803",
... | 0.0 | -1 |
Updates authentication policy for the specified tenancy | def update_authentication_policy(self, compartment_id, update_authentication_policy_details, **kwargs):
resource_path = "/authenticationPolicies/{compartmentId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_authentication_policy got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"compartmentId": compartment_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_authentication_policy_details,
response_type="AuthenticationPolicy")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_authentication_policy_details,
response_type="AuthenticationPolicy") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_policy(self, *args, **kwargs):\r\n pass",
"def update_policy(self):\n pass",
"def update_access_policy_request(self, subscription_id: str, resource_group_name: str,\n vault_name: str, operation_kind: str, object_id: str,\n ... | [
"0.61890286",
"0.60093766",
"0.5636485",
"0.55529946",
"0.5489578",
"0.54655504",
"0.5454699",
"0.54493403",
"0.5210004",
"0.5150643",
"0.51444256",
"0.5112735",
"0.50792444",
"0.50723416",
"0.50633496",
"0.5059199",
"0.5028738",
"0.50170374",
"0.498372",
"0.49623302",
"0.495... | 0.535475 | 8 |
Updates the specified compartment's description or name. You can't update the root compartment. | def update_compartment(self, compartment_id, update_compartment_details, **kwargs):
resource_path = "/compartments/{compartmentId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_compartment got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"compartmentId": compartment_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_compartment_details,
response_type="Compartment")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_compartment_details,
response_type="Compartment") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_object(self, name: str) -> None:",
"def update(args, config):\n print('Updates an HPC fleet with name \"{}\"'.format(args.fleet_name))",
"def test_update(self):\n obj = self.provision_single_asset()\n test_string = \"testing this thing\"\n p = {'id': obj.id, 'description': te... | [
"0.56508",
"0.5638967",
"0.5597009",
"0.55432",
"0.5494998",
"0.5449337",
"0.53832597",
"0.5348151",
"0.53268445",
"0.5285396",
"0.5275306",
"0.5235795",
"0.5235795",
"0.51921105",
"0.5159983",
"0.5123664",
"0.50844306",
"0.50828993",
"0.50785875",
"0.5047809",
"0.5020412",
... | 0.60476094 | 0 |
Updates the specified secret key's description. | def update_customer_secret_key(self, user_id, customer_secret_key_id, update_customer_secret_key_details, **kwargs):
resource_path = "/users/{userId}/customerSecretKeys/{customerSecretKeyId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_customer_secret_key got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id,
"customerSecretKeyId": customer_secret_key_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_customer_secret_key_details,
response_type="CustomerSecretKeySummary")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_customer_secret_key_details,
response_type="CustomerSecretKeySummary") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description(self, new_description):\r\n self.set({\"description\": new_description})",
"def update_experiment_description(self, experiment_id, description):\n return self.dbclient.update_by_id(Tables.EXPERIMENTS, experiment_id, {\n ExperimentAttr.DESC: description\n })",
"as... | [
"0.6546764",
"0.6383036",
"0.63771176",
"0.6299966",
"0.6243986",
"0.6152988",
"0.6130237",
"0.5990805",
"0.5977715",
"0.59324723",
"0.59167236",
"0.58869696",
"0.5866867",
"0.58435416",
"0.5841273",
"0.5839453",
"0.5824073",
"0.5772846",
"0.5757899",
"0.57126033",
"0.5691525... | 0.0 | -1 |
Updates the specified dynamic group. | def update_dynamic_group(self, dynamic_group_id, update_dynamic_group_details, **kwargs):
resource_path = "/dynamicGroups/{dynamicGroupId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_dynamic_group got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"dynamicGroupId": dynamic_group_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_dynamic_group_details,
response_type="DynamicGroup")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_dynamic_group_details,
response_type="DynamicGroup") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_group():\n _id = request.form['_id']\n name = request.form['name']\n data, code, message = FIELD_SERVICE.update_group(_id, name)\n return __result(data, code, message)",
"def update_group(groupname):\n name = request.get_json().get(\"name\", None)\n description = request.get_json().g... | [
"0.73748296",
"0.71882457",
"0.7182601",
"0.7062276",
"0.6967742",
"0.6875376",
"0.68748295",
"0.6828043",
"0.6739177",
"0.6604309",
"0.64636046",
"0.6460566",
"0.639448",
"0.6345957",
"0.6323035",
"0.6288533",
"0.6273564",
"0.6173461",
"0.61531174",
"0.61079484",
"0.6106953"... | 0.7564378 | 0 |
Updates the specified group. | def update_group(self, group_id, update_group_details, **kwargs):
resource_path = "/groups/{groupId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_group got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"groupId": group_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_group_details,
response_type="Group")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_group_details,
response_type="Group") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_group(self, group_id, **kwargs):\n post_body = json.dumps({'group': kwargs})\n resp, body = self.patch('groups/%s' % group_id, post_body)\n self.expected_success(200, resp.status)\n body = json.loads(body)\n return rest_client.ResponseBody(resp, body)",
"def update_g... | [
"0.83019364",
"0.82925797",
"0.81625587",
"0.8079423",
"0.8010341",
"0.7975716",
"0.78060603",
"0.7803931",
"0.7534597",
"0.7418219",
"0.7364829",
"0.7364479",
"0.73005295",
"0.7184962",
"0.7092921",
"0.7048925",
"0.7039343",
"0.7023443",
"0.7007921",
"0.6988068",
"0.6973582"... | 0.7277004 | 13 |
Updates the specified identity provider. | def update_identity_provider(self, identity_provider_id, update_identity_provider_details, **kwargs):
resource_path = "/identityProviders/{identityProviderId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_identity_provider got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"identityProviderId": identity_provider_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_identity_provider_details,
response_type="IdentityProvider")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_identity_provider_details,
response_type="IdentityProvider") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_provider(self, provider_id, provider_name, endpoints, zone_id, provider_region):\n try:\n self.client.post('{api_url}/providers/{id}'.format(api_url=self.api_url, id=provider_id),\n action='edit',\n zone={'id': zone_id},\n ... | [
"0.6841701",
"0.6564375",
"0.63220054",
"0.62459624",
"0.623236",
"0.5886005",
"0.58837974",
"0.5625915",
"0.5601719",
"0.55890137",
"0.5554441",
"0.54530036",
"0.54441226",
"0.539471",
"0.5389379",
"0.53829527",
"0.5339994",
"0.5336483",
"0.5261702",
"0.521437",
"0.52008426"... | 0.7050549 | 0 |
Updates the specified group mapping. | def update_idp_group_mapping(self, identity_provider_id, mapping_id, update_idp_group_mapping_details, **kwargs):
resource_path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_idp_group_mapping got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"identityProviderId": identity_provider_id,
"mappingId": mapping_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_idp_group_mapping_details,
response_type="IdpGroupMapping")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_idp_group_mapping_details,
response_type="IdpGroupMapping") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_group():\n _id = request.form['_id']\n name = request.form['name']\n data, code, message = FIELD_SERVICE.update_group(_id, name)\n return __result(data, code, message)",
"def do_group_update():\n target_group = Group.query.filter_by(id=request.form['id']).first()\n if target_group is... | [
"0.668097",
"0.66690725",
"0.65914",
"0.65848315",
"0.6473367",
"0.6461976",
"0.63963073",
"0.6341957",
"0.63222533",
"0.6204804",
"0.6149209",
"0.6132897",
"0.61260456",
"0.61017835",
"0.6094815",
"0.60790116",
"0.60371214",
"0.60071486",
"0.5943335",
"0.5897234",
"0.5892558... | 0.59906954 | 18 |
Updates the specified network source. | def update_network_source(self, network_source_id, update_network_source_details, **kwargs):
resource_path = "/networkSources/{networkSourceId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_network_source got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"networkSourceId": network_source_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_network_source_details,
response_type="NetworkSources")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_network_source_details,
response_type="NetworkSources") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_sources(self, *args, **kwargs):\n tasks.update_sources()\n return Response({})",
"def set_source(self, source):\n self.data['source'] = source",
"def update_source(wn, old_source, target, new_source, change_list=None):\n rel_type = find_type(old_source, target)\n delete_re... | [
"0.6329532",
"0.612555",
"0.60807055",
"0.6027774",
"0.58959955",
"0.5872399",
"0.5833497",
"0.5821681",
"0.58040607",
"0.5792299",
"0.57776225",
"0.5715011",
"0.5686939",
"0.5681682",
"0.5670427",
"0.5601962",
"0.5567387",
"0.5534381",
"0.5495406",
"0.5481051",
"0.54780453",... | 0.7314297 | 0 |
Updates Oauth token for the user | def update_o_auth_client_credential(self, user_id, oauth2_client_credential_id, update_o_auth2_client_credential_details, **kwargs):
resource_path = "/users/{userId}/oauth2ClientCredentials/{oauth2ClientCredentialId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_o_auth_client_credential got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id,
"oauth2ClientCredentialId": oauth2_client_credential_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_o_auth2_client_credential_details,
response_type="OAuth2ClientCredential")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_o_auth2_client_credential_details,
response_type="OAuth2ClientCredential") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_access_token(self):\n self.token = util.prompt_for_user_token(self._username, scope,\n client_id=const.CLIENT_ID,\n client_secret=const.CLIENT_SECRET,\n red... | [
"0.7218071",
"0.7128234",
"0.70803964",
"0.70797455",
"0.6948329",
"0.69223416",
"0.6816124",
"0.67791194",
"0.677325",
"0.6766163",
"0.6606324",
"0.65013164",
"0.6490434",
"0.64472616",
"0.64429665",
"0.64318883",
"0.6418706",
"0.64162564",
"0.6413319",
"0.63991517",
"0.6385... | 0.0 | -1 |
Updates the specified policy. You can update the description or the policy statements themselves. Policy changes take effect typically within 10 seconds. | def update_policy(self, policy_id, update_policy_details, **kwargs):
resource_path = "/policies/{policyId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_policy got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"policyId": policy_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_policy_details,
response_type="Policy")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_policy_details,
response_type="Policy") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_policy(self, *args, **kwargs):\r\n pass",
"def update_policy(self):\n pass",
"def UpdatePolicy(self, request, global_params=None):\n config = self.GetMethodConfig('UpdatePolicy')\n return self._RunMethod(\n config, request, global_params=global_params)",
"def updat... | [
"0.7842353",
"0.75241417",
"0.748778",
"0.7414664",
"0.7212257",
"0.71420217",
"0.71321785",
"0.68537253",
"0.67365426",
"0.67068434",
"0.67029107",
"0.664534",
"0.6516526",
"0.6492029",
"0.6485327",
"0.6461159",
"0.6407627",
"0.64037424",
"0.6252379",
"0.6247484",
"0.6230572... | 0.68388695 | 8 |
Updates the specified SMTP credential's description. | def update_smtp_credential(self, user_id, smtp_credential_id, update_smtp_credential_details, **kwargs):
resource_path = "/users/{userId}/smtpCredentials/{smtpCredentialId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_smtp_credential got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id,
"smtpCredentialId": smtp_credential_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_smtp_credential_details,
response_type="SmtpCredentialSummary")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_smtp_credential_details,
response_type="SmtpCredentialSummary") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_credential(self, context, id, credential):\n c = credential['credential']\n cred = update_credential(id,\n c['user_name'],\n c['password'])\n return self._make_credential_dict(cred)",
"def _update_credential(self, key... | [
"0.6017124",
"0.5905993",
"0.57960504",
"0.5608559",
"0.551452",
"0.54189515",
"0.54140085",
"0.54125625",
"0.5373373",
"0.5373373",
"0.5362979",
"0.52861714",
"0.5260703",
"0.5092259",
"0.50158775",
"0.49928087",
"0.49136016",
"0.49073347",
"0.48982912",
"0.48782173",
"0.486... | 0.56239367 | 3 |
Updates the specified tag definition. Setting `validator` determines the value type. Tags can use either a static value or a list of possible values. Static values are entered by a user applying the tag to a resource. Lists are created by you and the user must apply a value from the list. On update, any values in a list that were previously set do not change, but new values must pass validation. Values already applied to a resource do not change. You cannot remove list values that appear in a TagDefault. To remove a list value that appears in a TagDefault, first update the TagDefault to use a different value. | def update_tag(self, tag_namespace_id, tag_name, update_tag_details, **kwargs):
resource_path = "/tagNamespaces/{tagNamespaceId}/tags/{tagName}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_tag got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagNamespaceId": tag_namespace_id,
"tagName": tag_name
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_tag_details,
response_type="Tag")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_tag_details,
response_type="Tag") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validator(self, value: Optional[Dict[str, Any]]):\n self._validator = value",
"def clean_value(tag):\n value = tag.get('v')\n if is_street_name(tag):\n return update_name(value, mapping)\n elif is_state(tag):\n return update_state(value)\n elif is_phone(tag):\n return ... | [
"0.47837424",
"0.46425956",
"0.46075892",
"0.45793426",
"0.4565419",
"0.4549842",
"0.4544998",
"0.4527444",
"0.44851163",
"0.44719568",
"0.44582808",
"0.44389117",
"0.44280824",
"0.44129667",
"0.43951792",
"0.43817663",
"0.43775243",
"0.43701255",
"0.4363229",
"0.4363229",
"0... | 0.0 | -1 |
Updates the specified tag default. If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked. If the `isRequired` flag is set to \"true\", the value is set during resource creation. If the `isRequired` flag is set to \"false\", the value you enter is set during resource creation. | def update_tag_default(self, tag_default_id, update_tag_default_details, **kwargs):
resource_path = "/tagDefaults/{tagDefaultId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match",
"opc_request_id"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_tag_default got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagDefaultId": tag_default_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing),
"opc-request-id": kwargs.get("opc_request_id", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_tag_default_details,
response_type="TagDefault")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_tag_default_details,
response_type="TagDefault") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_default(self, name, default, group=None):\n opt_info = self._get_opt_info(name, group)\n opt_info['default'] = self._get_enforced_type_value(\n opt_info['opt'], default)\n opt_info['location'] = LocationInfo(\n Locations.set_default,\n _get_caller_detai... | [
"0.6250223",
"0.62021977",
"0.6062567",
"0.60212696",
"0.59388936",
"0.5849943",
"0.58077544",
"0.5761992",
"0.5740362",
"0.57305574",
"0.5730093",
"0.57221216",
"0.5609175",
"0.5585611",
"0.5582013",
"0.5553106",
"0.5544306",
"0.55127645",
"0.55110776",
"0.5498642",
"0.54802... | 0.7059619 | 0 |
Updates the the specified tag namespace. You can't update the namespace name. Updating `isRetired` to 'true' retires the namespace and all the tag definitions in the namespace. Reactivating a namespace (changing `isRetired` from 'true' to 'false') does not reactivate tag definitions. To reactivate the tag definitions, you must reactivate each one individually after you reactivate the namespace, | def update_tag_namespace(self, tag_namespace_id, update_tag_namespace_details, **kwargs):
resource_path = "/tagNamespaces/{tagNamespaceId}"
method = "PUT"
expected_kwargs = ["retry_strategy"]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_tag_namespace got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"tagNamespaceId": tag_namespace_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json"
}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_tag_namespace_details,
response_type="TagNamespace")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_tag_namespace_details,
response_type="TagNamespace") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update():\n for namespace in metadata.get_namespaces():\n logging.info('Switching namespace: \\'%s\\'', namespace)\n namespace_manager.set_namespace(namespace)\n update_per_namespace()\n\n namespace_manager.set_namespace('')\n return ('', 204)",
"def updateSBMLNamespace(self, *args):\n ret... | [
"0.6844458",
"0.60155666",
"0.5898544",
"0.5898544",
"0.56981826",
"0.5425525",
"0.53448004",
"0.5315865",
"0.52691925",
"0.52540755",
"0.5249237",
"0.522236",
"0.51815814",
"0.51776683",
"0.51709676",
"0.507831",
"0.50578856",
"0.49961218",
"0.49445054",
"0.49280253",
"0.492... | 0.54768914 | 5 |
Updates the description of the specified user. | def update_user(self, user_id, update_user_details, **kwargs):
resource_path = "/users/{userId}"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_user got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_user_details,
response_type="User")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_user_details,
response_type="User") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self, user: U) -> None:\n ...",
"def update_user():",
"def update_user():\n #TODO user update \n pass",
"async def set_profile_description(self, ctx, *, description: str):\n max_words = self.plugin.data.profile.max_description_length\n if len(description) > max_words:\n ... | [
"0.67517585",
"0.6600952",
"0.6573515",
"0.6480376",
"0.6474432",
"0.63814116",
"0.63341343",
"0.6327405",
"0.61766285",
"0.6165234",
"0.6114876",
"0.61027694",
"0.60700554",
"0.605967",
"0.60183775",
"0.60172874",
"0.5994123",
"0.59738964",
"0.5973046",
"0.59612536",
"0.5958... | 0.0 | -1 |
Updates the capabilities of the specified user. | def update_user_capabilities(self, user_id, update_user_capabilities_details, **kwargs):
resource_path = "/users/{userId}/capabilities"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_user_capabilities got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_user_capabilities_details,
response_type="User")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_user_capabilities_details,
response_type="User") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_user():",
"def update(self, user: U) -> None:\n ...",
"def update(self, user: 'User', privileges: 'Optional[List[str]]' = None) -> 'Optional[User]':\n return self._update(schema=UserSchema(), entity=user, privileges=privileges)",
"def getCapabilities4User(session_key, user=None):\n\n... | [
"0.5838249",
"0.5771097",
"0.57477796",
"0.57301706",
"0.5712233",
"0.56142646",
"0.5583086",
"0.55510235",
"0.5524724",
"0.5517849",
"0.5512739",
"0.55080456",
"0.54812056",
"0.5419713",
"0.54144186",
"0.5388361",
"0.5363638",
"0.5359393",
"0.5356132",
"0.53485364",
"0.53039... | 0.71365345 | 0 |
Updates the state of the specified user. | def update_user_state(self, user_id, update_state_details, **kwargs):
resource_path = "/users/{userId}/state"
method = "PUT"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"if_match"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"update_user_state got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_state_details,
response_type="User")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=update_state_details,
response_type="User") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_user():",
"def update_user():\n #TODO user update \n pass",
"def update(self, user: U) -> None:\n ...",
"def set_state_of_user(user_id, state):\n if not ValidStates.has_value(state):\n raise RuntimeError(\"Invalid event alteration state reached\")\n UserEventA... | [
"0.76819336",
"0.7584826",
"0.74265414",
"0.72629994",
"0.69820327",
"0.69404083",
"0.68895626",
"0.6865466",
"0.67882496",
"0.672065",
"0.6654662",
"0.66312045",
"0.6603028",
"0.65605366",
"0.65469825",
"0.65042037",
"0.64609027",
"0.6450725",
"0.64290047",
"0.6422216",
"0.6... | 0.64827514 | 16 |
Uploads an API signing key for the specified user. Every user has permission to use this operation to upload a key for their own user ID. An administrator in your organization does not need to write a policy to give users this ability. To compare, administrators who have permission to the tenancy can use this operation to upload a key for any user, including themselves. | def upload_api_key(self, user_id, create_api_key_details, **kwargs):
resource_path = "/users/{userId}/apiKeys"
method = "POST"
# Don't accept unknown kwargs
expected_kwargs = [
"retry_strategy",
"opc_retry_token"
]
extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"upload_api_key got unknown kwargs: {!r}".format(extra_kwargs))
path_params = {
"userId": user_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}
for (k, v) in six.iteritems(path_params):
if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"opc-retry-token": kwargs.get("opc_retry_token", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.retry_strategy
if kwargs.get('retry_strategy'):
retry_strategy = kwargs.get('retry_strategy')
if retry_strategy:
if not isinstance(retry_strategy, retry.NoneRetryStrategy):
self.base_client.add_opc_retry_token_if_needed(header_params)
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=create_api_key_details,
response_type="ApiKey")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
body=create_api_key_details,
response_type="ApiKey") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_key( self, trans, user_id, **kwd ):\n user = self.get_user( trans, user_id )\n key = self.create_api_key( trans, user )\n return key",
"def upload_key():\n data = check_args(('cloudProvider', 'key'))\n provider = jobs.init_provider(data, True)\n key = decrypt_key(data['key']... | [
"0.67768776",
"0.65675324",
"0.609125",
"0.595348",
"0.5758476",
"0.5749899",
"0.5690145",
"0.55707395",
"0.55044675",
"0.54585487",
"0.54316515",
"0.5418301",
"0.5411513",
"0.54110056",
"0.5376245",
"0.53506505",
"0.53419787",
"0.53266",
"0.5320789",
"0.5302657",
"0.52935576... | 0.651776 | 2 |
return the classroom that has given classroomId. Otherwise return None | def getClassroomById(classroomId):
for classroom in classroomEntities:
if classroom["classroomId"] == classroomId:
return classroom.copy()
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_room(self, name=None, id=None):\n \n if(name):\n return self.rooms[name] if name in self.rooms else None\n if(id):\n return next((v for (k,v) in self.rooms.items() if v.id == id), None)\n return None",
"def getRoomById(self, id):\n for room in self... | [
"0.62929714",
"0.62483174",
"0.61793196",
"0.6084332",
"0.6035611",
"0.5742967",
"0.569907",
"0.5663777",
"0.56626433",
"0.5645693",
"0.5644132",
"0.5593693",
"0.55252326",
"0.54916966",
"0.54792434",
"0.5459054",
"0.54231",
"0.5395465",
"0.5352263",
"0.5347712",
"0.5322388",... | 0.83576775 | 0 |
store the classroom inside the classroom data list. return True if operation is successful | def addClassroom(classroomName, capacity,location):
for classroom in classroomEntities:
if classroom["classroomName"] == classroomName:
print("Two classrooms can not have same name")
return False
if classroomEntities==[]:
lastSavedIdNumber = "0"
else:
lastSavedId=classroomEntities[-1]["classroomId"] #update classroomId as first element in classroomEntities list
lastSavedIdNumber=lastSavedId[2:]
numberOfDigitsInID = 3
if lastSavedIdNumber == "9" * len(lastSavedIdNumber):
numberOfDigitsInID = len(lastSavedIdNumber) + 1
classroomId="CR"+str(int(lastSavedIdNumber)+1).rjust(numberOfDigitsInID,"0")
# add the new Classroom
newClassroom = {}
newClassroom["classroomId"] = classroomId
newClassroom["classroomName"] = classroomName
newClassroom["capacity"] = capacity
newClassroom["location"] = location
classroomEntities.append(newClassroom)
print(f"Class Room is added into the system, Class Room id is {classroomId}.")
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modifyClassroom(classroomId, classroomName, capacity,location):\n for classroom in classroomEntities:\n if classroom[\"classroomId\"] == classroomId:\n selectedClassroom = classroom\n selectedClassroom[\"classroomName\"] = classroomName\n selectedClassroom[\"capacity\... | [
"0.6729376",
"0.6159639",
"0.6049469",
"0.5342558",
"0.5292166",
"0.52788186",
"0.5239066",
"0.5235893",
"0.5207037",
"0.52025837",
"0.5175275",
"0.5164154",
"0.51413965",
"0.5103515",
"0.51000875",
"0.50629807",
"0.5052926",
"0.5046601",
"0.5038495",
"0.50214577",
"0.4994517... | 0.75351626 | 0 |
modify content of a already stored classroom. return True if operation is successful | def modifyClassroom(classroomId, classroomName, capacity,location):
for classroom in classroomEntities:
if classroom["classroomId"] == classroomId:
selectedClassroom = classroom
selectedClassroom["classroomName"] = classroomName
selectedClassroom["capacity"] = capacity
selectedClassroom["location"] = location
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addClassroom(classroomName, capacity,location):\n for classroom in classroomEntities:\n if classroom[\"classroomName\"] == classroomName:\n print(\"Two classrooms can not have same name\")\n return False\n\n if classroomEntities==[]:\n lastSavedIdNumber = \"0\"\n el... | [
"0.642563",
"0.5946925",
"0.54554087",
"0.5389277",
"0.5383477",
"0.5381614",
"0.53707135",
"0.536546",
"0.5361684",
"0.5358011",
"0.5356025",
"0.5323734",
"0.5304585",
"0.52719533",
"0.5269355",
"0.5269355",
"0.52631587",
"0.5255712",
"0.5246466",
"0.5222454",
"0.5217273",
... | 0.697157 | 0 |
delete a classroom from the system. return True if operation is successful | def deleteClassroom(classroomId):
for classroom in classroomEntities:
if classroom["classroomId"] == classroomId:
selectedClassroom = classroom
classroomEntities.remove(selectedClassroom)
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_remove_classroom_specific_for_coach_pt1(self):\n self.assertTrue(self.coach1.has_perm('auth.remove_classroom', self.classrooms[0]))",
"def test_remove_classroom_specific_for_learner(self):\n self.assertFalse(self.learner1.has_perm('auth.remove_classroom', self.classrooms[1]))",
"def dele... | [
"0.6959816",
"0.6681781",
"0.6642126",
"0.64679796",
"0.6322488",
"0.6272679",
"0.62258446",
"0.62023646",
"0.6199112",
"0.6172018",
"0.6158727",
"0.6144896",
"0.61320245",
"0.60920924",
"0.60902715",
"0.6075575",
"0.6064415",
"0.6015804",
"0.6012518",
"0.5992586",
"0.5977719... | 0.7279858 | 0 |
prints dictionary with classroom details | def helpClassroom(classroomId):
selectedClassroomCopy = getClassroomById(classroomId)
print("Class Id: " + selectedClassroomCopy["classroomId"])
print("Name: " + selectedClassroomCopy["classroomName"])
print("Capacity: " + selectedClassroomCopy["capacity"])
print("Location: " + selectedClassroomCopy["location"])
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_print_room_data(self, room):\n habitants = self.all_rooms[room]['occupants']\n\n return {'room': room, 'names': habitants}",
"def print_room(room):\r\n cls()\r\n print(\"\\n\" + room[\"name\"].upper() + \"\\n\")\r\n wrap_print(room[\"description\"] + print_room_items(room) + print_... | [
"0.63964313",
"0.63553905",
"0.6345478",
"0.6339327",
"0.62925047",
"0.62898177",
"0.6135573",
"0.6135079",
"0.6008951",
"0.5964196",
"0.58336455",
"0.5817201",
"0.5811558",
"0.576086",
"0.57605565",
"0.5755586",
"0.57405245",
"0.5738328",
"0.57352346",
"0.57244223",
"0.57174... | 0.56665343 | 23 |
saves classroomEntities in the ClassRoomData file | def saveClassroomData():
with open("ClassRoomData.txt","wb") as classroomData:
pickle.dump(classroomEntities,classroomData) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(cls):\n playerdata = getAttributes(cls)\n Data.object_dump(playerdata, \"savedata.dat\")\n del playerdata",
"def class_to_db(self):",
"def saveTeachersData():\n with open(\"TeacherData.txt\",\"wb\") as teacherData:\n pickle.dump(teacherEntities,teacherData)",
"def sav... | [
"0.66771996",
"0.66205716",
"0.6545138",
"0.60703945",
"0.60378635",
"0.60299575",
"0.6015636",
"0.5970347",
"0.596366",
"0.590775",
"0.58763117",
"0.58763117",
"0.58763117",
"0.58696264",
"0.58696264",
"0.58696264",
"0.58696264",
"0.58696264",
"0.5866105",
"0.5827522",
"0.58... | 0.8425549 | 0 |
Get the escape code associated to name. `name` can be either a varialble_name, a capname or a tcap code See man terminfo(5) to see which names are available. If the name is not supported, None is returned. If the name isn't present in the database an exception is raised. | def get(self, name):
# `name` is most likely a capname, so we try that first
for i in (self._by_capname, self._by_var, self._by_tcap_code):
if i.get(name):
return i.get(name)
else:
raise TerminfoError("'%s' is not a valid terminfo entry" % name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_code_by_name(self, name):\n raise NotImplementedError()",
"def _find_ebcdic_codec(code_name):\n return _codec_name_to_info_map.get(code_name)",
"def get_sup_code_by_name(self, name):\n raise NotImplementedError()",
"def getEncoder (name):\n for m in _registeredEncoders:\n i... | [
"0.6151477",
"0.5700235",
"0.54649127",
"0.53456575",
"0.51838666",
"0.51424867",
"0.50688034",
"0.50449085",
"0.50296956",
"0.49381745",
"0.49306858",
"0.49157912",
"0.4901924",
"0.48943734",
"0.48937386",
"0.48490885",
"0.48409435",
"0.48289338",
"0.4797155",
"0.477383",
"0... | 0.49186072 | 11 |
If the environment variable TERM is unset try with `fallback` if not empty. vt100 is a popular terminal supporting ANSI X3.64. | def load_terminfo(terminal_name=None, fallback='vt100'):
terminal_name = os.getenv('TERM')
if not terminal_name:
if not fallback:
raise TerminfoError('Environment variable TERM is unset and no fallback was requested')
else:
terminal_name = fallback
if os.getenv('TERMINFO'):
# from man terminfo(5):
# if the environment variable TERMINFO is set,
# only that directory is searched
terminfo_locations = [os.getenv('TERMINFO')]
else:
terminfo_locations = [] # from most to least important
if os.getenv('TERMINFO_DIRS'):
for i in os.getenv('TERMINFO_DIRS').split(':'):
# from man terminfo(5)
# An empty directory name is interpreted as /usr/share/terminfo.
terminfo_locations.append(i or '/usr/share/terminfo')
terminfo_locations += [
os.path.expanduser('~/.terminfo'),
'/etc/terminfo',
'/usr/local/ncurses/share/terminfo',
'/lib/terminfo',
'/usr/share/terminfo'
]
# remove duplicates preserving order
terminfo_locations = list(OrderedDict.fromkeys(terminfo_locations))
terminfo_path = None
for dirpath in terminfo_locations:
path = os.path.join(dirpath, terminal_name[0], terminal_name)
if os.path.exists(path):
terminfo_path = path
break
if not path:
raise TerminfoError("Couldn't find a terminfo file for terminal '%s'" % terminal_name)
from terminfo_index import BOOLEAN_CAPABILITIES, NUMBER_CAPABILITIES, STRING_CAPABILITIES
data = open(terminfo_path, 'rb').read()
# header (see man term(5), STORAGE FORMAT)
header = struct.unpack('<hhhhhh', data[:12]) # 2 bytes == 1 short integer
magic_number = header[0] # the magic number (octal 0432)
size_names = header[1] # the size, in bytes, of the names section
size_booleans = header[2] # the number of bytes in the boolean section
num_numbers = header[3] # the number of short integers in the numbers section
num_offsets = header[4] # the number of offsets (short integers) in the strings section
size_strings = header[5] # the size, in bytes, of the string table
if magic_number != 0o432:
raise TerminfoError('Bad magic number')
# sections indexes
idx_section_names = 12
idx_section_booleans = idx_section_names + size_names
idx_section_numbers = idx_section_booleans + size_booleans
if idx_section_numbers % 2 != 0:
idx_section_numbers += 1 # must start on an even byte
idx_section_strings = idx_section_numbers + 2 * num_numbers
idx_section_string_table = idx_section_strings + 2 * num_offsets
# terminal names
terminal_names = data[idx_section_names:idx_section_booleans].decode('ascii')
terminal_names = terminal_names[:-1].split('|') # remove ASCII NUL and split
terminfo = Terminfo(terminal_names[0], terminal_names[1:])
# booleans
for i, idx in enumerate(range(idx_section_booleans, idx_section_booleans + size_booleans)):
cap = BooleanCapability(*BOOLEAN_CAPABILITIES[i], value=data[i] == b'\x00')
terminfo.booleans[cap.variable] = cap
# numbers
numbers = struct.unpack('<'+'h' * num_numbers, data[idx_section_numbers:idx_section_strings])
for i,strnum in enumerate(numbers):
cap = NumberCapability(*NUMBER_CAPABILITIES[i], value=strnum)
terminfo.numbers[cap.variable] = cap
# strings
offsets = struct.unpack('<'+'h' * num_offsets, data[idx_section_strings:idx_section_string_table])
idx = 0
for offset in offsets:
k = 0
string = []
while True and offset != -1:
char = data[idx_section_string_table + offset + k:idx_section_string_table + offset + k + 1]
if char == b'\x00':
break
string.append(char.decode('iso-8859-1'))
k += 1
string = u''.join(string)
cap = StringCapability(*STRING_CAPABILITIES[idx], value=string)
terminfo.strings[cap.variable] = cap
idx += 1
terminfo._reset_index()
return terminfo | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _init_term(fullterm):\n if platform == 'win32':\n return True\n elif platform in ('darwin', 'linux'):\n global _STATIC_VARS\n fd = stdin.fileno()\n if not isatty(fd):\n return\n old = tcgetattr(fd)\n _STATIC_VARS.term_config = (fd, old)\n new = ... | [
"0.5692326",
"0.53151155",
"0.5231032",
"0.52155876",
"0.51974976",
"0.51403886",
"0.5131423",
"0.50917715",
"0.50907224",
"0.5077649",
"0.4965872",
"0.48994294",
"0.4885659",
"0.48755345",
"0.48475754",
"0.48131225",
"0.480396",
"0.47808626",
"0.4763937",
"0.47169244",
"0.47... | 0.5457427 | 1 |
This function will create foreign table under the existing dummy schema. | def create_foreign_table(server, db_name, schema_name, fsrv_name,
foreign_table_name):
try:
connection = get_db_connection(db_name,
server['username'],
server['db_password'],
server['host'],
server['port'])
old_isolation_level = connection.isolation_level
connection.set_isolation_level(0)
pg_cursor = connection.cursor()
pg_cursor.execute(
"CREATE FOREIGN TABLE " + schema_name + "." + foreign_table_name +
"(emp_name text NULL) SERVER %s" % fsrv_name)
connection.set_isolation_level(old_isolation_level)
connection.commit()
# Get 'oid' from newly created foreign table
pg_cursor.execute(
"SELECT ftrelid FROM pg_foreign_table WHERE ftserver = "
"(SELECT oid FROM pg_foreign_server WHERE srvname = '%s') ORDER BY "
"ftrelid ASC limit 1" % fsrv_name)
oid = pg_cursor.fetchone()
ft_id = ''
if oid:
ft_id = oid[0]
connection.close()
return ft_id
except Exception:
traceback.print_exc(file=sys.stderr) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_table(self):\n pass",
"def create_tables():\n db.create_all()",
"def create_tables():\n db.create_all()",
"def create_table(self, cursor: sqlite3.Cursor) -> None:\n\n if self.created:\n return\n\n # Preset this to true to work with Foreign key loops.\n... | [
"0.68531334",
"0.6769567",
"0.6769567",
"0.67081726",
"0.6704613",
"0.6654913",
"0.6629334",
"0.66245294",
"0.6596241",
"0.65905637",
"0.6554986",
"0.6512326",
"0.64604354",
"0.64442676",
"0.6398214",
"0.63658255",
"0.63251376",
"0.6320983",
"0.6311493",
"0.6310929",
"0.63013... | 0.7019781 | 0 |
This function will verify current foreign table. | def verify_foreign_table(server, db_name, fsrv_name):
try:
connection = get_db_connection(db_name,
server['username'],
server['db_password'],
server['host'],
server['port'])
pg_cursor = connection.cursor()
pg_cursor.execute(
"SELECT ftrelid FROM pg_foreign_table WHERE ftserver = "
"(SELECT oid FROM pg_foreign_server WHERE srvname = '%s') ORDER BY "
"ftrelid ASC limit 1" % fsrv_name)
fts = pg_cursor.fetchone()
connection.close()
return fts
except Exception:
traceback.print_exc(file=sys.stderr) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def foreign_key_check(self):\n # MyRocks doesn't support foreign key\n if self.is_myrocks_table:\n log.info(\n \"SKip foreign key check because MyRocks doesn't support \" \"this yet\"\n )\n return True\n foreign_keys = self.query(\n sq... | [
"0.73069215",
"0.65584505",
"0.65232533",
"0.65034956",
"0.6413673",
"0.61686987",
"0.6062092",
"0.60607314",
"0.5977171",
"0.5951747",
"0.59400225",
"0.5912802",
"0.5910147",
"0.5875509",
"0.5874834",
"0.58528465",
"0.5831443",
"0.5819649",
"0.5797078",
"0.57933843",
"0.5743... | 0.69198555 | 1 |
Returns last blockchain value | def get_last_block():
if namoto_length < 1:
return None
return namoto_blockchain[-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_last_blockchain_value():\n return blockchain[-1]",
"def last_value():\n return blockchain[-1]",
"def get_last_blockchain_value():\n if len(blockchain)< 1:\n return None\n return blockchain[-1]",
"def get_last_blockchain_value():\n if len(blockchain) < 1:\n return None\n ... | [
"0.9357195",
"0.92896146",
"0.89885485",
"0.8950827",
"0.89315474",
"0.8893679",
"0.8893679",
"0.8893679",
"0.8893679",
"0.8893679",
"0.88605654",
"0.74856514",
"0.74814206",
"0.7459868",
"0.74472046",
"0.7285969",
"0.7243078",
"0.7127286",
"0.7126116",
"0.7078929",
"0.702716... | 0.7415065 | 15 |
Checks if previous blocks have been unchanged | def verify_chain():
block_index = 0
is_unchanged = True
if namoto_length < 1:
print('Blockchain is empty!')
return None
for block in namoto_blockchain:
if block[0] == namoto_blockchain[block_index -1]:
is_unchanged = True
block_index += 1
else:
is_unchanged = False
break
return is_unchanged | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _blocks_changed(block1, block2):\n if block1.name != block2.name:\n return True\n\n # Check for any changed blocks (symmetric difference operation of sets)\n block_diff = set(block1.to_dict().items()) ^ set(block2.to_dict().items())\n if len(block_diff) > 0:\n return True\n\n retur... | [
"0.74993265",
"0.72713685",
"0.71471745",
"0.69462794",
"0.6817872",
"0.6817872",
"0.6773962",
"0.67605287",
"0.6748862",
"0.6742866",
"0.6739253",
"0.6687307",
"0.6665253",
"0.6467874",
"0.64111555",
"0.6352307",
"0.6308329",
"0.6284981",
"0.62747335",
"0.62637866",
"0.62513... | 0.59465235 | 36 |
Randomly split a dataset into nonoverlapping new datasets of given lengths. | def transform_random_split(dataset, lengths, transforms=None):
if sum(lengths) != len(dataset):
raise ValueError("Sum of input lengths does not equal the length of the input dataset!")
if transforms is None:
transforms = [None] * len(lengths)
indices = torch.randperm(sum(lengths))
return [TransformSubset(dataset, indices[offset - length:offset], transform) for offset, length, transform in zip(torch._utils._accumulate(lengths), lengths, transforms)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_split(dataset, lengths):\n if sum(lengths) != len(dataset):\n raise ValueError(\"Sum of input lengths does not equal the length of the input dataset!\")\n\n indices = randperm(sum(lengths))\n return [Subset(dataset, indices[offset - length:offset]) for offset, length in zip(_accumulate(l... | [
"0.84061474",
"0.6924902",
"0.6857288",
"0.6845405",
"0.6843688",
"0.659823",
"0.65702295",
"0.65012205",
"0.648653",
"0.6431003",
"0.63632774",
"0.6349559",
"0.6339707",
"0.63243866",
"0.63061655",
"0.62308013",
"0.61856407",
"0.6180755",
"0.61523664",
"0.6138766",
"0.609819... | 0.6593007 | 6 |
Calculates the vibrational partition function, assuming harmonic motion around the vibrational angular frequency omega. | def qvib(v):
T = s.Symbol("T")
return 1.0 / (1.0 - s.exp(-1.0 * (h * v) / (k * T))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def relative_partition_function(self):\n return self.overall_norm**2",
"def partition_function(array, temp):\r\n\r\n # Constants imported from scipy.constants\r\n h = scipy.constants.h # Planck's constant\r\n # speed of light must be in cm/s as wavenumber is in cm-1\r\n c = scipy.constants.c ... | [
"0.5701903",
"0.56463856",
"0.563504",
"0.5585956",
"0.555302",
"0.55438894",
"0.54815304",
"0.5467443",
"0.5334224",
"0.53278655",
"0.53052276",
"0.52949303",
"0.52682424",
"0.52625763",
"0.5254825",
"0.5235348",
"0.5234946",
"0.52277654",
"0.52228475",
"0.5213484",
"0.52134... | 0.0 | -1 |
Calculates the translational partition function, assuming free movement ie. no spatial potential. | def qtrans(m,V):
T = s.Symbol("T")
return (((2 * s.pi * m * k * T) / (h**2))**(3/2)) * V | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def relative_partition_function(self):\n return self.overall_norm**2",
"def getPartitionFunction(self, Tlist, V=1.0):\n\t\treturn _modes.translation_partitionfunction(Tlist, self.mass, self.dimension, V)",
"def heuristic_3_partition(game, player) -> float:\n\n partition_possible_factor = get_partitio... | [
"0.6461611",
"0.63680524",
"0.5586814",
"0.55430216",
"0.5531079",
"0.55039924",
"0.5489266",
"0.546037",
"0.53223366",
"0.5185964",
"0.5154166",
"0.512814",
"0.5126923",
"0.5116043",
"0.5107573",
"0.5096535",
"0.5077164",
"0.5064965",
"0.50587356",
"0.505364",
"0.50446224",
... | 0.0 | -1 |
Calculates the rotational partition function, assuming rigid rotor | def qrot(I,sym):
T = s.Symbol("T")
if type(I) == list:
return (((s.pi * I[0] * I[1] * I[2])**(1/2))/sym) * ((8 * s.pi**2 * k * T) / (h**2))**(3/2)
else:
return (((s.pi * I)**(1/2))/sym) * ((8 * s.pi**2 * k * T) / (h**2))**(3/2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rpartition(self, x):\n pass",
"def getPartitionFunction(self, Tlist):\n\t\treturn _modes.hinderedrotor_partitionfunction(Tlist, self.frequency, self.barrier) ** self.degeneracy",
"def relative_partition_function(self):\n return self.overall_norm**2",
"def my_rodriguez_rotation(P, k, theta):\n\n... | [
"0.60148156",
"0.5928004",
"0.5905255",
"0.58448195",
"0.5765161",
"0.56619036",
"0.56407213",
"0.56067413",
"0.5598395",
"0.5529949",
"0.55244756",
"0.55044246",
"0.5503363",
"0.54765314",
"0.54362005",
"0.5415683",
"0.54050183",
"0.5374608",
"0.5368864",
"0.5364739",
"0.536... | 0.0 | -1 |
returns partition sum without electronic contribution, v = vibrational frequency in m^1, m = mass in kg, I=moment of inertia either number or list of three [kgm^2], V= Volume in m^3, sym=number of similar rotation axis | def partition(v,m,I,V,sym):
T = s.Symbol("T")
return qvib(v) + qtrans(m,V) + qrot(I,sym) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vol_uc(x):\r\n return sum([vol(m) for m in metamer(x)])",
"def get_effective_mass():\n\n H_BAR = 6.582119514e-16 # eV*s\n M_0 = 9.10938356e-31 # kg\n N_KPTS = 6 # Number of k-points included in the parabola.\n\n spin_up = Spin(1)\n\n band_structure = Vasprun('vasprun.xml').get_band_structu... | [
"0.5707858",
"0.54226637",
"0.5395542",
"0.52172196",
"0.5165793",
"0.5102502",
"0.5102502",
"0.5101261",
"0.50958854",
"0.49969062",
"0.49926218",
"0.49795717",
"0.4946353",
"0.49354938",
"0.49308503",
"0.49158522",
"0.4907569",
"0.4894429",
"0.4889348",
"0.4864072",
"0.4845... | 0.7013808 | 0 |
create a database connection to the SQLite database specified by the db_file | def create_connection(db_file):
try:
conn = sqlite3.connect(db_file)
#print("connection with the database is established")
return conn
except Error as e:
print(e)
#print("we have just failed to connect to the database")
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_db_connection(db_file):\n\n conn = None\n try:\n conn = sqlite3.connect(db_file)\n except Exception as e:\n print(e)\n\n return conn",
"def create_connection(db_file):\n conn = sqlite3.connect(db_file)\n return conn",
"def create_db(db_file):\n conn = None\n try... | [
"0.846957",
"0.8452252",
"0.8396848",
"0.838181",
"0.8371498",
"0.8364115",
"0.83331347",
"0.8318548",
"0.83168167",
"0.8303119",
"0.8297461",
"0.8294878",
"0.82667893",
"0.825977",
"0.825977",
"0.825977",
"0.8247484",
"0.8242083",
"0.8225199",
"0.8222829",
"0.82215047",
"0... | 0.7852928 | 90 |
This function resizes the image message recieved over the head image topic and republishes it to a new topic. | def headImageCallback(msg):
global headCamImage
# extract head cam image and update globally
bridge = CvBridge()
headCamImage = bridge.imgmsg_to_cv2(msg, "bgr8") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FlyResize( image, log_mess, nimages, method = Image.ANTIALIAS ):\n oldw, oldh = image.size\n resl = [8, 10, 14, 16, 20, 22, 24, 32, 40, 48, 64, 96, 128, 256]\n \n if oldw > 256 or oldh > 256:\n newsiz = min(resl, key = lambda x:abs(x - max(oldw, oldh)))... | [
"0.6290891",
"0.6252121",
"0.62168384",
"0.60811555",
"0.60775405",
"0.6049448",
"0.5981075",
"0.58995944",
"0.5890728",
"0.572378",
"0.56443006",
"0.5638707",
"0.56351453",
"0.5631245",
"0.5589404",
"0.55732054",
"0.5532038",
"0.54880667",
"0.54583186",
"0.54128087",
"0.5394... | 0.0 | -1 |
This function resizes the image message recieved over the left arm image topic and republishes it to a new topic. | def leftArmImageCallback(msg):
global armCamImage
# extract arm cam image and update globally
bridge = CvBridge()
armCamImage = bridge.imgmsg_to_cv2(msg, "bgr8") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FlyResize( image, log_mess, nimages, method = Image.ANTIALIAS ):\n oldw, oldh = image.size\n resl = [8, 10, 14, 16, 20, 22, 24, 32, 40, 48, 64, 96, 128, 256]\n \n if oldw > 256 or oldh > 256:\n newsiz = min(resl, key = lambda x:abs(x - max(oldw, oldh)))... | [
"0.64465207",
"0.6418566",
"0.6362998",
"0.62206006",
"0.59658504",
"0.59462744",
"0.58035374",
"0.5765646",
"0.5717802",
"0.56819785",
"0.5623336",
"0.55827916",
"0.5574665",
"0.5500553",
"0.54983515",
"0.54708004",
"0.54649293",
"0.53893703",
"0.53882927",
"0.538468",
"0.53... | 0.51675516 | 36 |
This function subscribes to the primaryCam topic and updates its state in the global scope. | def primaryCamCallback(msg):
global primaryCamString
primaryCamString = msg.data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _on_connect(self, client, userdata, flags, rc):\n self.subscribe(self.topic)",
"def on_connect():\n # There is now a connection\n subscribe_to_topic(\"pir\",\"Trigger\")",
"def on_connect(client, userdata, flags, rc):\n client.subscribe(mqtt_Light_topic)",
"def subscribe(self, topic):\n ... | [
"0.69074756",
"0.6543661",
"0.64770025",
"0.6473724",
"0.64547884",
"0.6375277",
"0.63147134",
"0.6292447",
"0.6290028",
"0.61770564",
"0.6158316",
"0.61119586",
"0.60491896",
"0.60434437",
"0.60176116",
"0.60137093",
"0.59834874",
"0.5942834",
"0.5942834",
"0.59380347",
"0.5... | 0.64189833 | 5 |
This function subscribes to the secondaryCam topic and updates its state in the global scope. | def secondayCamCallback(msg):
global secondaryCamString
secondaryCamString = msg.data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _on_connect(self, client, userdata, flags, rc):\n self.subscribe(self.topic)",
"def _subscribe_update_callback(self, client, userdata, message):\n logger.info('Message recieved from {} topic'.format(message.topic))\n payload = message.payload\n try:\n payload_dict = jso... | [
"0.6671746",
"0.63125056",
"0.6236678",
"0.6203599",
"0.6199879",
"0.61778575",
"0.61778575",
"0.61778575",
"0.6139608",
"0.6105276",
"0.60968137",
"0.60713357",
"0.60546625",
"0.6009579",
"0.59927255",
"0.596567",
"0.59032744",
"0.588785",
"0.5863523",
"0.5775574",
"0.577557... | 0.6567832 | 1 |
This function uniformally scales image to newSize | def resizeImage(image, newSize):
# scale image
scaledImage = cv2.resize(image, newSize)
return scaledImage | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rescale_image(image, scale=0.50):\r\n \r\n wi = int(image.shape[1]*scale)\r\n hei = int(image.shape[0]*scale)\r\n dimension = (wi, hei)\r\n return cv.resize(image, dimension, interpolation = cv.INTER_AREA)",
"def scale(img, scale):\n return resize(img, x_scale=scale, y_scale=scale)",
"def... | [
"0.72932327",
"0.72652304",
"0.7210784",
"0.7190373",
"0.7156874",
"0.714985",
"0.7103231",
"0.70871055",
"0.7044541",
"0.70186824",
"0.69733804",
"0.694513",
"0.6941695",
"0.69353527",
"0.6923214",
"0.6918948",
"0.68329215",
"0.68258023",
"0.6771118",
"0.6759777",
"0.6754045... | 0.7020678 | 9 |
This function first determines which camera is the primary and which is secondary. The image streams from the respective primary and seconday cameras are resized and republished | def resizeAndRepubThread():
# reference globals
global primaryCamString
global secondaryCamString
global armCamImage
global headCamImage
# initialize image publishers
primaryPub = rospy.Publisher(primaryCamRepub, Image, queue_size=1)
secondaryPub = rospy.Publisher(secondaryCamRepub, Image, queue_size=1)
# create CvBridge object for converting CV2 images to sensor_msgs/Image messages
backBridge = CvBridge()
while(True):
primaryImage = np.zeros(shape=[512, 512, 3])
secondaryImage = np.zeros(shape=[512, 512, 3])
# just keep looping until we get images
if(np.sum(headCamImage) == 0 or np.sum(armCamImage) == 0):
rospy.loginfo("still waiting on camera images...")
continue
# get primary image
if(primaryCamString == "head"):
primaryImage = resizeImage(headCamImage, primarySize)
elif(primaryCamString == "leftArm"):
primaryImage = resizeImage(armCamImage, primarySize)
elif(primaryCamString == ""):
pass
else:
rospy.logerr("Invalid Option for primaryCamString recieved!")
# get secondary image
if(secondaryCamString == "head"):
secondaryImage = resizeImage(headCamImage, secondarySize)
elif(secondaryCamString == "leftArm"):
secondaryImage = resizeImage(armCamImage, secondarySize)
elif(secondaryCamString == ""):
pass
else:
rospy.logerr("Invalid Option for secondaryCamString recieved!")
# publish both new images
if(np.sum(primaryImage) != 0 and np.sum(secondaryImage) != 0):
primaryImageMessage = backBridge.cv2_to_imgmsg(primaryImage, "bgr8")
primaryPub.publish(primaryImageMessage)
secondaryImageMessage = backBridge.cv2_to_imgmsg(secondaryImage, "bgr8")
secondaryPub.publish(secondaryImageMessage) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, camera, cameras, settings):\n\n self.cam = None\n self.jpeg_quality = 95 # 0 to 100, higher is better quality, 95 is cv2 default\n # check picamera version\n try:\n picamversion = require('picamera')[0].version\n except:\n picamversion = ... | [
"0.6055959",
"0.594556",
"0.5910366",
"0.58318543",
"0.5761805",
"0.5758764",
"0.57067573",
"0.56581026",
"0.5576743",
"0.5523943",
"0.5506011",
"0.53973216",
"0.5318885",
"0.5317909",
"0.5289555",
"0.5289161",
"0.52827555",
"0.527724",
"0.52749354",
"0.5268248",
"0.52553976"... | 0.6135356 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.