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 |
|---|---|---|---|---|---|---|
This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](~~134067~~). To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can call the [ReleasePublicNetworkAddress](~~67604~~) operation. | def release_node_private_network_address_with_options(
self,
request: dds_20151201_models.ReleaseNodePrivateNetworkAddressRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.network_type):
query['NetworkType'] = request.network_type
if not UtilClient.is_unset(request.node_id):
query['NodeId'] = request.node_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='ReleaseNodePrivateNetworkAddress',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release_address(self, public_ip=None, allocation_id=None):\r\n params = {}\r\n\r\n if public_ip is not None:\r\n params['PublicIp'] = public_ip\r\n elif allocation_id is not None:\r\n params['AllocationId'] = allocation_id\r\n\r\n return self.get_status('Releas... | [
"0.5712464",
"0.5607081",
"0.5554131",
"0.524051",
"0.52084637",
"0.5085088",
"0.50104165",
"0.49779233",
"0.49513933",
"0.49257186",
"0.4916261",
"0.48996267",
"0.48951858",
"0.48708498",
"0.48667976",
"0.48482025",
"0.47911367",
"0.47712603",
"0.47670642",
"0.4749826",
"0.4... | 0.54412097 | 3 |
This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](~~134067~~). To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can call the [ReleasePublicNetworkAddress](~~67604~~) operation. | async def release_node_private_network_address_with_options_async(
self,
request: dds_20151201_models.ReleaseNodePrivateNetworkAddressRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.network_type):
query['NetworkType'] = request.network_type
if not UtilClient.is_unset(request.node_id):
query['NodeId'] = request.node_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='ReleaseNodePrivateNetworkAddress',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release_address(self, public_ip=None, allocation_id=None):\r\n params = {}\r\n\r\n if public_ip is not None:\r\n params['PublicIp'] = public_ip\r\n elif allocation_id is not None:\r\n params['AllocationId'] = allocation_id\r\n\r\n return self.get_status('Releas... | [
"0.57126313",
"0.5606727",
"0.55545366",
"0.5440909",
"0.5240857",
"0.5087529",
"0.5010123",
"0.49782026",
"0.49522084",
"0.49264276",
"0.4914645",
"0.48995593",
"0.48968387",
"0.48700112",
"0.48656347",
"0.48495722",
"0.47913688",
"0.47733217",
"0.47699565",
"0.47490388",
"0... | 0.5208502 | 5 |
This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](~~134067~~). To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can call the [ReleasePublicNetworkAddress](~~67604~~) operation. | def release_node_private_network_address(
self,
request: dds_20151201_models.ReleaseNodePrivateNetworkAddressRequest,
) -> dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse:
runtime = util_models.RuntimeOptions()
return self.release_node_private_network_address_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release_address(self, public_ip=None, allocation_id=None):\r\n params = {}\r\n\r\n if public_ip is not None:\r\n params['PublicIp'] = public_ip\r\n elif allocation_id is not None:\r\n params['AllocationId'] = allocation_id\r\n\r\n return self.get_status('Releas... | [
"0.5712464",
"0.5554131",
"0.54412097",
"0.524051",
"0.52084637",
"0.5085088",
"0.50104165",
"0.49779233",
"0.49513933",
"0.49257186",
"0.4916261",
"0.48996267",
"0.48951858",
"0.48708498",
"0.48667976",
"0.48482025",
"0.47911367",
"0.47712603",
"0.47670642",
"0.4749826",
"0.... | 0.5607081 | 1 |
This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](~~134067~~). To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can call the [ReleasePublicNetworkAddress](~~67604~~) operation. | async def release_node_private_network_address_async(
self,
request: dds_20151201_models.ReleaseNodePrivateNetworkAddressRequest,
) -> dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse:
runtime = util_models.RuntimeOptions()
return await self.release_node_private_network_address_with_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release_address(self, public_ip=None, allocation_id=None):\r\n params = {}\r\n\r\n if public_ip is not None:\r\n params['PublicIp'] = public_ip\r\n elif allocation_id is not None:\r\n params['AllocationId'] = allocation_id\r\n\r\n return self.get_status('Releas... | [
"0.57125086",
"0.5607883",
"0.55533296",
"0.54408795",
"0.52399385",
"0.52079135",
"0.50849366",
"0.5009823",
"0.49770507",
"0.49518353",
"0.4925341",
"0.49161455",
"0.48942116",
"0.48699126",
"0.48663092",
"0.4848325",
"0.47907278",
"0.47718734",
"0.476847",
"0.47496375",
"0... | 0.49001652 | 12 |
> This operation can reset only the password of the root account of an instance. | def reset_account_password_with_options(
self,
request: dds_20151201_models.ResetAccountPasswordRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.ResetAccountPasswordResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.account_name):
query['AccountName'] = request.account_name
if not UtilClient.is_unset(request.account_password):
query['AccountPassword'] = request.account_password
if not UtilClient.is_unset(request.character_type):
query['CharacterType'] = request.character_type
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='ResetAccountPassword',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.ResetAccountPasswordResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_password():\n pass",
"def resetPassword(self, customerguid, password, jobguid=\"\", executionparams=None):",
"def reset_password(self):\n self.password = passwordResetter(self.user_id, self.password)",
"def reset_password(cursor: Cursor, owner: Owner) -> Result:\n return pgsql.reset_pa... | [
"0.6995449",
"0.6721432",
"0.6687601",
"0.6683846",
"0.65477824",
"0.6516542",
"0.6435638",
"0.63833916",
"0.6339373",
"0.6333628",
"0.6329721",
"0.62919116",
"0.62820923",
"0.61816514",
"0.6117711",
"0.6081572",
"0.6053006",
"0.60414654",
"0.60382646",
"0.60087836",
"0.60084... | 0.5785506 | 31 |
> This operation can reset only the password of the root account of an instance. | async def reset_account_password_with_options_async(
self,
request: dds_20151201_models.ResetAccountPasswordRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.ResetAccountPasswordResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.account_name):
query['AccountName'] = request.account_name
if not UtilClient.is_unset(request.account_password):
query['AccountPassword'] = request.account_password
if not UtilClient.is_unset(request.character_type):
query['CharacterType'] = request.character_type
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='ResetAccountPassword',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.ResetAccountPasswordResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_password():\n pass",
"def resetPassword(self, customerguid, password, jobguid=\"\", executionparams=None):",
"def reset_password(self):\n self.password = passwordResetter(self.user_id, self.password)",
"def reset_password(cursor: Cursor, owner: Owner) -> Result:\n return pgsql.reset_pa... | [
"0.6997105",
"0.6723147",
"0.6690475",
"0.66852945",
"0.65497524",
"0.6517603",
"0.64377475",
"0.6385964",
"0.6340677",
"0.63359714",
"0.6331445",
"0.6292827",
"0.6283269",
"0.61848646",
"0.6118911",
"0.6083716",
"0.60545266",
"0.6041933",
"0.60399234",
"0.6008904",
"0.600806... | 0.0 | -1 |
> This operation can reset only the password of the root account of an instance. | def reset_account_password(
self,
request: dds_20151201_models.ResetAccountPasswordRequest,
) -> dds_20151201_models.ResetAccountPasswordResponse:
runtime = util_models.RuntimeOptions()
return self.reset_account_password_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_password():\n pass",
"def resetPassword(self, customerguid, password, jobguid=\"\", executionparams=None):",
"def reset_password(self):\n self.password = passwordResetter(self.user_id, self.password)",
"def reset_password(cursor: Cursor, owner: Owner) -> Result:\n return pgsql.reset_pa... | [
"0.6995449",
"0.6721432",
"0.6687601",
"0.6683846",
"0.65477824",
"0.6516542",
"0.6435638",
"0.63833916",
"0.6339373",
"0.6333628",
"0.6329721",
"0.62919116",
"0.62820923",
"0.61816514",
"0.6117711",
"0.6081572",
"0.60414654",
"0.60382646",
"0.60087836",
"0.6008431",
"0.59336... | 0.6053006 | 16 |
> This operation can reset only the password of the root account of an instance. | async def reset_account_password_async(
self,
request: dds_20151201_models.ResetAccountPasswordRequest,
) -> dds_20151201_models.ResetAccountPasswordResponse:
runtime = util_models.RuntimeOptions()
return await self.reset_account_password_with_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_password():\n pass",
"def resetPassword(self, customerguid, password, jobguid=\"\", executionparams=None):",
"def reset_password(self):\n self.password = passwordResetter(self.user_id, self.password)",
"def reset_password(cursor: Cursor, owner: Owner) -> Result:\n return pgsql.reset_pa... | [
"0.69956654",
"0.67230797",
"0.6687879",
"0.6683989",
"0.6548391",
"0.65178514",
"0.64349926",
"0.63839984",
"0.6341612",
"0.63333577",
"0.63292885",
"0.6291432",
"0.62829876",
"0.61829466",
"0.6119637",
"0.60824883",
"0.60539484",
"0.6043146",
"0.60395235",
"0.6010371",
"0.6... | 0.0 | -1 |
This operation can also be used to restart a shard or mongos node in a sharded cluster instance. | def restart_dbinstance_with_options(
self,
request: dds_20151201_models.RestartDBInstanceRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.RestartDBInstanceResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.node_id):
query['NodeId'] = request.node_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='RestartDBInstance',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.RestartDBInstanceResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_restart(r):\n cluster_id = request_get(r, \"cluster_id\")\n if not cluster_id:\n logger.warning(\"No cluster_id is given\")\n return make_fail_response(\"No cluster_id is given\")\n if cluster_handler.restart(cluster_id):\n return jsonify(response_ok), CODE_OK\n\n retur... | [
"0.7612083",
"0.7318449",
"0.72762173",
"0.69061714",
"0.6568057",
"0.6536657",
"0.6463088",
"0.62089056",
"0.61884105",
"0.61884105",
"0.6181434",
"0.61671895",
"0.6118982",
"0.61028636",
"0.6042757",
"0.6039685",
"0.6015281",
"0.59943885",
"0.59732586",
"0.597307",
"0.59728... | 0.0 | -1 |
This operation can also be used to restart a shard or mongos node in a sharded cluster instance. | async def restart_dbinstance_with_options_async(
self,
request: dds_20151201_models.RestartDBInstanceRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.RestartDBInstanceResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.node_id):
query['NodeId'] = request.node_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='RestartDBInstance',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.RestartDBInstanceResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_restart(r):\n cluster_id = request_get(r, \"cluster_id\")\n if not cluster_id:\n logger.warning(\"No cluster_id is given\")\n return make_fail_response(\"No cluster_id is given\")\n if cluster_handler.restart(cluster_id):\n return jsonify(response_ok), CODE_OK\n\n retur... | [
"0.76114905",
"0.73184144",
"0.7275371",
"0.69063234",
"0.6566835",
"0.65363693",
"0.64630884",
"0.6208303",
"0.6188034",
"0.6188034",
"0.6180357",
"0.61680347",
"0.6119984",
"0.6103842",
"0.6042654",
"0.60374564",
"0.60140425",
"0.59943813",
"0.59744895",
"0.59729147",
"0.59... | 0.0 | -1 |
This operation can also be used to restart a shard or mongos node in a sharded cluster instance. | def restart_dbinstance(
self,
request: dds_20151201_models.RestartDBInstanceRequest,
) -> dds_20151201_models.RestartDBInstanceResponse:
runtime = util_models.RuntimeOptions()
return self.restart_dbinstance_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_restart(r):\n cluster_id = request_get(r, \"cluster_id\")\n if not cluster_id:\n logger.warning(\"No cluster_id is given\")\n return make_fail_response(\"No cluster_id is given\")\n if cluster_handler.restart(cluster_id):\n return jsonify(response_ok), CODE_OK\n\n retur... | [
"0.7612083",
"0.7318449",
"0.72762173",
"0.69061714",
"0.6568057",
"0.6536657",
"0.6463088",
"0.62089056",
"0.61884105",
"0.61884105",
"0.6181434",
"0.61671895",
"0.6118982",
"0.61028636",
"0.6042757",
"0.6039685",
"0.6015281",
"0.59943885",
"0.59732586",
"0.597307",
"0.59728... | 0.5776906 | 37 |
This operation can also be used to restart a shard or mongos node in a sharded cluster instance. | async def restart_dbinstance_async(
self,
request: dds_20151201_models.RestartDBInstanceRequest,
) -> dds_20151201_models.RestartDBInstanceResponse:
runtime = util_models.RuntimeOptions()
return await self.restart_dbinstance_with_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_restart(r):\n cluster_id = request_get(r, \"cluster_id\")\n if not cluster_id:\n logger.warning(\"No cluster_id is given\")\n return make_fail_response(\"No cluster_id is given\")\n if cluster_handler.restart(cluster_id):\n return jsonify(response_ok), CODE_OK\n\n retur... | [
"0.7611809",
"0.7319289",
"0.72763574",
"0.6905782",
"0.65671515",
"0.6536635",
"0.6462853",
"0.62082076",
"0.61881244",
"0.61881244",
"0.6181432",
"0.6168009",
"0.612062",
"0.6102914",
"0.60427433",
"0.60393894",
"0.6015079",
"0.59957445",
"0.59742093",
"0.59734917",
"0.5972... | 0.0 | -1 |
The instance must be running when you call this operation. > This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances. On replica set instances, the switch is performed between instances. On sharded cluster instances, the switch is performed between shards. | def switch_dbinstance_hawith_options(
self,
request: dds_20151201_models.SwitchDBInstanceHARequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.SwitchDBInstanceHAResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.node_id):
query['NodeId'] = request.node_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.role_ids):
query['RoleIds'] = request.role_ids
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
if not UtilClient.is_unset(request.switch_mode):
query['SwitchMode'] = request.switch_mode
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='SwitchDBInstanceHA',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.SwitchDBInstanceHAResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reboot_instance(InstanceId=None):\n pass",
"def start_instance(self):\n instance_id = self._choose_among_stopped_instances()\n\n # Cancel\n if not instance_id:\n print 'Operation cancelled'\n return\n\n print '# Starting the instance \"%s\"' % instance_id\... | [
"0.61040485",
"0.6096324",
"0.60282654",
"0.58379394",
"0.58264416",
"0.5758901",
"0.57290405",
"0.56599015",
"0.56398165",
"0.55757517",
"0.55595875",
"0.55456",
"0.5543997",
"0.5541205",
"0.5492753",
"0.5477153",
"0.54576474",
"0.54539895",
"0.54452765",
"0.5433373",
"0.542... | 0.0 | -1 |
The instance must be running when you call this operation. > This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances. On replica set instances, the switch is performed between instances. On sharded cluster instances, the switch is performed between shards. | async def switch_dbinstance_hawith_options_async(
self,
request: dds_20151201_models.SwitchDBInstanceHARequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.SwitchDBInstanceHAResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.node_id):
query['NodeId'] = request.node_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.role_ids):
query['RoleIds'] = request.role_ids
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
if not UtilClient.is_unset(request.switch_mode):
query['SwitchMode'] = request.switch_mode
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='SwitchDBInstanceHA',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.SwitchDBInstanceHAResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reboot_instance(InstanceId=None):\n pass",
"def start_instance(self):\n instance_id = self._choose_among_stopped_instances()\n\n # Cancel\n if not instance_id:\n print 'Operation cancelled'\n return\n\n print '# Starting the instance \"%s\"' % instance_id\... | [
"0.6103962",
"0.6098033",
"0.6030681",
"0.5840055",
"0.5827348",
"0.5759573",
"0.573131",
"0.5658811",
"0.56404024",
"0.5575826",
"0.5560752",
"0.55465156",
"0.55443525",
"0.55416125",
"0.5493635",
"0.547756",
"0.5457497",
"0.5455699",
"0.544469",
"0.5434933",
"0.5429983",
... | 0.0 | -1 |
The instance must be running when you call this operation. > This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances. On replica set instances, the switch is performed between instances. On sharded cluster instances, the switch is performed between shards. | def switch_dbinstance_ha(
self,
request: dds_20151201_models.SwitchDBInstanceHARequest,
) -> dds_20151201_models.SwitchDBInstanceHAResponse:
runtime = util_models.RuntimeOptions()
return self.switch_dbinstance_hawith_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reboot_instance(InstanceId=None):\n pass",
"def start_instance(self):\n instance_id = self._choose_among_stopped_instances()\n\n # Cancel\n if not instance_id:\n print 'Operation cancelled'\n return\n\n print '# Starting the instance \"%s\"' % instance_id\... | [
"0.61040485",
"0.6096324",
"0.60282654",
"0.58379394",
"0.58264416",
"0.5758901",
"0.57290405",
"0.56599015",
"0.56398165",
"0.55757517",
"0.55595875",
"0.55456",
"0.5543997",
"0.5541205",
"0.5492753",
"0.5477153",
"0.54576474",
"0.54539895",
"0.54452765",
"0.5433373",
"0.542... | 0.0 | -1 |
The instance must be running when you call this operation. > This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances. On replica set instances, the switch is performed between instances. On sharded cluster instances, the switch is performed between shards. | async def switch_dbinstance_ha_async(
self,
request: dds_20151201_models.SwitchDBInstanceHARequest,
) -> dds_20151201_models.SwitchDBInstanceHAResponse:
runtime = util_models.RuntimeOptions()
return await self.switch_dbinstance_hawith_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reboot_instance(InstanceId=None):\n pass",
"def start_instance(self):\n instance_id = self._choose_among_stopped_instances()\n\n # Cancel\n if not instance_id:\n print 'Operation cancelled'\n return\n\n print '# Starting the instance \"%s\"' % instance_id\... | [
"0.6103812",
"0.6096315",
"0.60282797",
"0.5838405",
"0.5826192",
"0.57585657",
"0.5728754",
"0.5659324",
"0.5638693",
"0.5576284",
"0.55599195",
"0.554497",
"0.554396",
"0.55413884",
"0.5492706",
"0.54776263",
"0.5457303",
"0.5453998",
"0.54452205",
"0.5434242",
"0.5428812",... | 0.0 | -1 |
You can create multiple tags and bind them to multiple instances. This allows you to classify and filter instances by tag. A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can have the same value. If the tag you specify does not exist, this tag is automatically created and bound to the specified instance. If a tag that has the same key is already bound to the instance, the new tag overwrites the existing tag. You can bind up to 20 tags to each instance. You can bind tags to up to 50 instances each time you call the operation. | def tag_resources_with_options(
self,
request: dds_20151201_models.TagResourcesRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.TagResourcesResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.region_id):
query['RegionId'] = request.region_id
if not UtilClient.is_unset(request.resource_group_id):
query['ResourceGroupId'] = request.resource_group_id
if not UtilClient.is_unset(request.resource_id):
query['ResourceId'] = request.resource_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.resource_type):
query['ResourceType'] = request.resource_type
if not UtilClient.is_unset(request.tag):
query['Tag'] = request.tag
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='TagResources',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.TagResourcesResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tag_instance(self, tags):\n self._request({\"instance-tags\": dict(tags)})",
"def test_can_create_multiple_instance_tags(self):\n\n # local imports of code-under-test ensure moto has mocks\n # registered before any possible calls out to AWS\n from awstools.awstools import launch_i... | [
"0.74873763",
"0.65912956",
"0.65561086",
"0.6501582",
"0.6467801",
"0.6455448",
"0.6356754",
"0.63517284",
"0.63239217",
"0.6164876",
"0.60988724",
"0.60375375",
"0.599445",
"0.5963434",
"0.58057624",
"0.57843035",
"0.57726794",
"0.5756584",
"0.5738389",
"0.57328016",
"0.573... | 0.0 | -1 |
You can create multiple tags and bind them to multiple instances. This allows you to classify and filter instances by tag. A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can have the same value. If the tag you specify does not exist, this tag is automatically created and bound to the specified instance. If a tag that has the same key is already bound to the instance, the new tag overwrites the existing tag. You can bind up to 20 tags to each instance. You can bind tags to up to 50 instances each time you call the operation. | async def tag_resources_with_options_async(
self,
request: dds_20151201_models.TagResourcesRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.TagResourcesResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.region_id):
query['RegionId'] = request.region_id
if not UtilClient.is_unset(request.resource_group_id):
query['ResourceGroupId'] = request.resource_group_id
if not UtilClient.is_unset(request.resource_id):
query['ResourceId'] = request.resource_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.resource_type):
query['ResourceType'] = request.resource_type
if not UtilClient.is_unset(request.tag):
query['Tag'] = request.tag
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='TagResources',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.TagResourcesResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tag_instance(self, tags):\n self._request({\"instance-tags\": dict(tags)})",
"def test_can_create_multiple_instance_tags(self):\n\n # local imports of code-under-test ensure moto has mocks\n # registered before any possible calls out to AWS\n from awstools.awstools import launch_i... | [
"0.7487185",
"0.65916544",
"0.6556984",
"0.6501802",
"0.64678895",
"0.6454626",
"0.6356658",
"0.635133",
"0.63240445",
"0.6164839",
"0.6097934",
"0.6037268",
"0.5994",
"0.59635496",
"0.5806253",
"0.57834727",
"0.577199",
"0.5755929",
"0.5738129",
"0.57312036",
"0.57304275",
... | 0.0 | -1 |
You can create multiple tags and bind them to multiple instances. This allows you to classify and filter instances by tag. A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can have the same value. If the tag you specify does not exist, this tag is automatically created and bound to the specified instance. If a tag that has the same key is already bound to the instance, the new tag overwrites the existing tag. You can bind up to 20 tags to each instance. You can bind tags to up to 50 instances each time you call the operation. | def tag_resources(
self,
request: dds_20151201_models.TagResourcesRequest,
) -> dds_20151201_models.TagResourcesResponse:
runtime = util_models.RuntimeOptions()
return self.tag_resources_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tag_instance(self, tags):\n self._request({\"instance-tags\": dict(tags)})",
"def test_can_create_multiple_instance_tags(self):\n\n # local imports of code-under-test ensure moto has mocks\n # registered before any possible calls out to AWS\n from awstools.awstools import launch_i... | [
"0.74873763",
"0.65912956",
"0.65561086",
"0.6501582",
"0.6467801",
"0.6455448",
"0.6356754",
"0.63517284",
"0.63239217",
"0.6164876",
"0.60988724",
"0.60375375",
"0.599445",
"0.5963434",
"0.58057624",
"0.57843035",
"0.57726794",
"0.5756584",
"0.5738389",
"0.57328016",
"0.573... | 0.0 | -1 |
You can create multiple tags and bind them to multiple instances. This allows you to classify and filter instances by tag. A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can have the same value. If the tag you specify does not exist, this tag is automatically created and bound to the specified instance. If a tag that has the same key is already bound to the instance, the new tag overwrites the existing tag. You can bind up to 20 tags to each instance. You can bind tags to up to 50 instances each time you call the operation. | async def tag_resources_async(
self,
request: dds_20151201_models.TagResourcesRequest,
) -> dds_20151201_models.TagResourcesResponse:
runtime = util_models.RuntimeOptions()
return await self.tag_resources_with_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tag_instance(self, tags):\n self._request({\"instance-tags\": dict(tags)})",
"def test_can_create_multiple_instance_tags(self):\n\n # local imports of code-under-test ensure moto has mocks\n # registered before any possible calls out to AWS\n from awstools.awstools import launch_i... | [
"0.74874234",
"0.6591031",
"0.6557189",
"0.6501294",
"0.64681226",
"0.645559",
"0.635655",
"0.6351105",
"0.6322822",
"0.6165512",
"0.6098559",
"0.60358423",
"0.59951353",
"0.59632707",
"0.5805972",
"0.57836425",
"0.5773342",
"0.5757457",
"0.5739055",
"0.5732122",
"0.5731473",... | 0.0 | -1 |
> You can remove up to 20 tags at a time. If you remove a tag from all instances, the tag is automatically deleted. | def untag_resources_with_options(
self,
request: dds_20151201_models.UntagResourcesRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.UntagResourcesResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.all):
query['All'] = request.all
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.region_id):
query['RegionId'] = request.region_id
if not UtilClient.is_unset(request.resource_group_id):
query['ResourceGroupId'] = request.resource_group_id
if not UtilClient.is_unset(request.resource_id):
query['ResourceId'] = request.resource_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.resource_type):
query['ResourceType'] = request.resource_type
if not UtilClient.is_unset(request.tag_key):
query['TagKey'] = request.tag_key
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='UntagResources',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.UntagResourcesResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tag(tag):\n tag.destroy()",
"def RemoveTags(obj):\n tags = obj.GetTags() # Get tags\n for t in tags: # Iterate through tags\n t.Remove() # Remove tag",
"async def removetags(self, ctx, tag=None):\r\n\t\tTag = self.settings.ServerConfig(ctx.guild.id, 'Tags')\r\n\t\tif not tag in Tag:\... | [
"0.71796733",
"0.68758255",
"0.6856147",
"0.6738873",
"0.6660143",
"0.6617361",
"0.6605107",
"0.6569438",
"0.65644944",
"0.6558519",
"0.6515231",
"0.65021783",
"0.6444791",
"0.63917637",
"0.63694924",
"0.63107765",
"0.6270814",
"0.6265261",
"0.625803",
"0.62343985",
"0.61936"... | 0.0 | -1 |
> You can remove up to 20 tags at a time. If you remove a tag from all instances, the tag is automatically deleted. | async def untag_resources_with_options_async(
self,
request: dds_20151201_models.UntagResourcesRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.UntagResourcesResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.all):
query['All'] = request.all
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.region_id):
query['RegionId'] = request.region_id
if not UtilClient.is_unset(request.resource_group_id):
query['ResourceGroupId'] = request.resource_group_id
if not UtilClient.is_unset(request.resource_id):
query['ResourceId'] = request.resource_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.resource_type):
query['ResourceType'] = request.resource_type
if not UtilClient.is_unset(request.tag_key):
query['TagKey'] = request.tag_key
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='UntagResources',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.UntagResourcesResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tag(tag):\n tag.destroy()",
"def RemoveTags(obj):\n tags = obj.GetTags() # Get tags\n for t in tags: # Iterate through tags\n t.Remove() # Remove tag",
"async def removetags(self, ctx, tag=None):\r\n\t\tTag = self.settings.ServerConfig(ctx.guild.id, 'Tags')\r\n\t\tif not tag in Tag:\... | [
"0.71809316",
"0.68764615",
"0.6857069",
"0.6740014",
"0.66612315",
"0.66182756",
"0.66062665",
"0.65692097",
"0.6564891",
"0.65599036",
"0.65165895",
"0.65031886",
"0.6446048",
"0.6392404",
"0.63693607",
"0.6309676",
"0.62702256",
"0.6265954",
"0.62573457",
"0.62348354",
"0.... | 0.0 | -1 |
> You can remove up to 20 tags at a time. If you remove a tag from all instances, the tag is automatically deleted. | def untag_resources(
self,
request: dds_20151201_models.UntagResourcesRequest,
) -> dds_20151201_models.UntagResourcesResponse:
runtime = util_models.RuntimeOptions()
return self.untag_resources_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tag(tag):\n tag.destroy()",
"def RemoveTags(obj):\n tags = obj.GetTags() # Get tags\n for t in tags: # Iterate through tags\n t.Remove() # Remove tag",
"async def removetags(self, ctx, tag=None):\r\n\t\tTag = self.settings.ServerConfig(ctx.guild.id, 'Tags')\r\n\t\tif not tag in Tag:\... | [
"0.71796733",
"0.68758255",
"0.6856147",
"0.6738873",
"0.6660143",
"0.6617361",
"0.6605107",
"0.6569438",
"0.65644944",
"0.6558519",
"0.6515231",
"0.65021783",
"0.6444791",
"0.63917637",
"0.63694924",
"0.63107765",
"0.6270814",
"0.6265261",
"0.625803",
"0.62343985",
"0.61936"... | 0.0 | -1 |
> You can remove up to 20 tags at a time. If you remove a tag from all instances, the tag is automatically deleted. | async def untag_resources_async(
self,
request: dds_20151201_models.UntagResourcesRequest,
) -> dds_20151201_models.UntagResourcesResponse:
runtime = util_models.RuntimeOptions()
return await self.untag_resources_with_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tag(tag):\n tag.destroy()",
"def RemoveTags(obj):\n tags = obj.GetTags() # Get tags\n for t in tags: # Iterate through tags\n t.Remove() # Remove tag",
"async def removetags(self, ctx, tag=None):\r\n\t\tTag = self.settings.ServerConfig(ctx.guild.id, 'Tags')\r\n\t\tif not tag in Tag:\... | [
"0.7179029",
"0.6874668",
"0.6855494",
"0.673707",
"0.6659385",
"0.66167855",
"0.6604312",
"0.65682214",
"0.6563147",
"0.6558112",
"0.6515623",
"0.65010685",
"0.64438564",
"0.6391957",
"0.63677007",
"0.63088256",
"0.62703615",
"0.62650335",
"0.62569135",
"0.6232759",
"0.61929... | 0.0 | -1 |
The instance must be in the running state when you call this operation. > The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](~~398673~~). You can also call the [DescribeAvailableEngineVersion](~~141355~~) operation to query the available database versions. > You cannot downgrade the MongoDB version of an instance after you upgrade it. > The instance is automatically restarted for two to three times during the upgrade process. Make sure that you upgrade the instance during offpeak hours. | def upgrade_dbinstance_engine_version_with_options(
self,
request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.UpgradeDBInstanceEngineVersionResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.engine_version):
query['EngineVersion'] = request.engine_version
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='UpgradeDBInstanceEngineVersion',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.UpgradeDBInstanceEngineVersionResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_version(self) -> Optional[pulumi.Input['InstanceDatabaseVersion']]:\n return pulumi.get(self, \"database_version\")",
"def upgrade_dbinstance_engine_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInst... | [
"0.60887057",
"0.58272535",
"0.57711166",
"0.56431997",
"0.55289644",
"0.5520775",
"0.54857856",
"0.5430625",
"0.5372646",
"0.5360392",
"0.52892214",
"0.5286582",
"0.5278977",
"0.52780265",
"0.52661526",
"0.5259783",
"0.5211577",
"0.51565385",
"0.514894",
"0.5146001",
"0.5137... | 0.49824673 | 32 |
The instance must be in the running state when you call this operation. > The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](~~398673~~). You can also call the [DescribeAvailableEngineVersion](~~141355~~) operation to query the available database versions. > You cannot downgrade the MongoDB version of an instance after you upgrade it. > The instance is automatically restarted for two to three times during the upgrade process. Make sure that you upgrade the instance during offpeak hours. | async def upgrade_dbinstance_engine_version_with_options_async(
self,
request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.UpgradeDBInstanceEngineVersionResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.engine_version):
query['EngineVersion'] = request.engine_version
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='UpgradeDBInstanceEngineVersion',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.UpgradeDBInstanceEngineVersionResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_version(self) -> Optional[pulumi.Input['InstanceDatabaseVersion']]:\n return pulumi.get(self, \"database_version\")",
"def upgrade_dbinstance_engine_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInst... | [
"0.6090064",
"0.58261514",
"0.57712024",
"0.5643622",
"0.5528457",
"0.55217195",
"0.5486818",
"0.54299986",
"0.5373658",
"0.53594774",
"0.52883273",
"0.52877307",
"0.52789235",
"0.5277654",
"0.52671677",
"0.52614397",
"0.52117026",
"0.51576954",
"0.5149471",
"0.51448",
"0.513... | 0.48418233 | 53 |
The instance must be in the running state when you call this operation. > The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](~~398673~~). You can also call the [DescribeAvailableEngineVersion](~~141355~~) operation to query the available database versions. > You cannot downgrade the MongoDB version of an instance after you upgrade it. > The instance is automatically restarted for two to three times during the upgrade process. Make sure that you upgrade the instance during offpeak hours. | def upgrade_dbinstance_engine_version(
self,
request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceEngineVersionResponse:
runtime = util_models.RuntimeOptions()
return self.upgrade_dbinstance_engine_version_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_version(self) -> Optional[pulumi.Input['InstanceDatabaseVersion']]:\n return pulumi.get(self, \"database_version\")",
"def db_version(engine):\n return IMPL.db_version(engine)",
"def db_version():\n return IMPL.db_version()",
"def mmo_mongo_version(self, mmo_connection):\n re... | [
"0.60887057",
"0.57711166",
"0.56431997",
"0.55289644",
"0.5520775",
"0.54857856",
"0.5430625",
"0.5372646",
"0.5360392",
"0.52892214",
"0.5286582",
"0.5278977",
"0.52780265",
"0.52661526",
"0.5259783",
"0.5211577",
"0.51565385",
"0.514894",
"0.5146001",
"0.5137969",
"0.51183... | 0.58272535 | 1 |
The instance must be in the running state when you call this operation. > The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](~~398673~~). You can also call the [DescribeAvailableEngineVersion](~~141355~~) operation to query the available database versions. > You cannot downgrade the MongoDB version of an instance after you upgrade it. > The instance is automatically restarted for two to three times during the upgrade process. Make sure that you upgrade the instance during offpeak hours. | async def upgrade_dbinstance_engine_version_async(
self,
request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceEngineVersionResponse:
runtime = util_models.RuntimeOptions()
return await self.upgrade_dbinstance_engine_version_with_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_version(self) -> Optional[pulumi.Input['InstanceDatabaseVersion']]:\n return pulumi.get(self, \"database_version\")",
"def upgrade_dbinstance_engine_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInst... | [
"0.60901463",
"0.5825471",
"0.57710415",
"0.5643417",
"0.5529335",
"0.5520822",
"0.5485604",
"0.5430104",
"0.5372222",
"0.53590053",
"0.52879465",
"0.52787435",
"0.5277866",
"0.5267304",
"0.526129",
"0.5212593",
"0.51575416",
"0.51503915",
"0.5145446",
"0.5138863",
"0.5119322... | 0.5288145 | 10 |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation during offpeak hours. | def upgrade_dbinstance_kernel_version_with_options(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='UpgradeDBInstanceKernelVersion',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.UpgradeDBInstanceKernelVersionResponse(),
self.call_api(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upgrade_dbinstance_kernel_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return self.upgrade_dbinstance_kernel_version_with_option... | [
"0.79366666",
"0.713365",
"0.65763366",
"0.6048078",
"0.56803346",
"0.5636641",
"0.55429274",
"0.5415511",
"0.53714454",
"0.5316516",
"0.5281482",
"0.52180755",
"0.5102098",
"0.50040174",
"0.499213",
"0.49542388",
"0.49341667",
"0.48674172",
"0.4845689",
"0.4839142",
"0.48272... | 0.7097949 | 2 |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation during offpeak hours. | async def upgrade_dbinstance_kernel_version_with_options_async(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.dbinstance_id):
query['DBInstanceId'] = request.dbinstance_id
if not UtilClient.is_unset(request.owner_account):
query['OwnerAccount'] = request.owner_account
if not UtilClient.is_unset(request.owner_id):
query['OwnerId'] = request.owner_id
if not UtilClient.is_unset(request.resource_owner_account):
query['ResourceOwnerAccount'] = request.resource_owner_account
if not UtilClient.is_unset(request.resource_owner_id):
query['ResourceOwnerId'] = request.resource_owner_id
if not UtilClient.is_unset(request.security_token):
query['SecurityToken'] = request.security_token
req = open_api_models.OpenApiRequest(
query=OpenApiUtilClient.query(query)
)
params = open_api_models.Params(
action='UpgradeDBInstanceKernelVersion',
version='2015-12-01',
protocol='HTTPS',
pathname='/',
method='POST',
auth_type='AK',
style='RPC',
req_body_type='formData',
body_type='json'
)
return TeaCore.from_map(
dds_20151201_models.UpgradeDBInstanceKernelVersionResponse(),
await self.call_api_async(params, req, runtime)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upgrade_dbinstance_kernel_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return self.upgrade_dbinstance_kernel_version_with_option... | [
"0.7937624",
"0.71343994",
"0.709872",
"0.6047597",
"0.5681405",
"0.5637572",
"0.5542199",
"0.5414881",
"0.5371163",
"0.53170407",
"0.5281084",
"0.52176833",
"0.51020956",
"0.5003764",
"0.49939057",
"0.4953727",
"0.49351478",
"0.48668408",
"0.48451775",
"0.48387653",
"0.48285... | 0.6576928 | 3 |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation during offpeak hours. | def upgrade_dbinstance_kernel_version(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
runtime = util_models.RuntimeOptions()
return self.upgrade_dbinstance_kernel_version_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def upgrade_dbinstance_kernel_version_async(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return await self.upgrade_dbinstance_kernel_v... | [
"0.713365",
"0.7097949",
"0.65763366",
"0.6048078",
"0.56803346",
"0.5636641",
"0.55429274",
"0.5415511",
"0.53714454",
"0.5316516",
"0.5281482",
"0.52180755",
"0.5102098",
"0.50040174",
"0.499213",
"0.49542388",
"0.49341667",
"0.48674172",
"0.4845689",
"0.4839142",
"0.482721... | 0.79366666 | 0 |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation during offpeak hours. | async def upgrade_dbinstance_kernel_version_async(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
runtime = util_models.RuntimeOptions()
return await self.upgrade_dbinstance_kernel_version_with_options_async(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upgrade_dbinstance_kernel_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return self.upgrade_dbinstance_kernel_version_with_option... | [
"0.7936817",
"0.70986426",
"0.6577163",
"0.60453767",
"0.56828487",
"0.5638934",
"0.55407673",
"0.54129595",
"0.53686017",
"0.5318697",
"0.5280949",
"0.5216302",
"0.5101547",
"0.5003827",
"0.49964812",
"0.49521586",
"0.4936471",
"0.48645243",
"0.48442766",
"0.48389387",
"0.48... | 0.71337795 | 1 |
Split the dataset in train and test | def split_data(X_data, y_data):
return cv.train_test_split(X_data, y_data, test_size=0.1, random_state=0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, self.valid, test_size=0.5)",
"def split_dataset(self, test_size=0.20):\n\t\t(self.training_data, self.test_data, self.traini... | [
"0.8802637",
"0.86079246",
"0.8466979",
"0.82975525",
"0.8284587",
"0.827557",
"0.8264588",
"0.81958085",
"0.81672466",
"0.8152023",
"0.8112103",
"0.8103609",
"0.8087945",
"0.80442524",
"0.8010122",
"0.7993666",
"0.7990225",
"0.79382634",
"0.79229766",
"0.79132396",
"0.786750... | 0.78183466 | 26 |
Use features and result to train Support Vector Machine | def train(features, result):
clf = grid_search(result)
clf.fit(features, result)
return clf | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trainModel( self, featureTrain, classTrain):",
"def trainNewModel():\n print \"Creating feature vectors for trainset...\"\n trainDependencies = getDependency(trainDepFilename)\n trainLabel, trainFeatureVectors = \\\n createFeatureVectors(trainFilename, trainDependencies)\n print \"Length o... | [
"0.7079623",
"0.6985331",
"0.6951296",
"0.68263084",
"0.67677474",
"0.6763887",
"0.67388266",
"0.66454804",
"0.66344404",
"0.6605667",
"0.6589454",
"0.65607995",
"0.6531744",
"0.6518474",
"0.6516882",
"0.64959514",
"0.6491756",
"0.64540136",
"0.64505",
"0.64383566",
"0.643159... | 0.700062 | 1 |
Predict labels from trained CLF | def predict(clf, features):
return clf.predict(features).astype(np.int) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_label(self, src): # real signature unknown; restored from __doc__\n pass",
"def _predict(self, X):\n predictions = np.asarray([clf.predict(X) for clf in self.clfs_]).T\n predicted_labels = self.combiner.combine(predictions)\n return predicted_labels",
"def predict(self,... | [
"0.7386694",
"0.71547484",
"0.70753515",
"0.6984876",
"0.6951311",
"0.6930104",
"0.69105846",
"0.68986803",
"0.6878426",
"0.6850824",
"0.6850824",
"0.6849669",
"0.6848837",
"0.684592",
"0.684592",
"0.682805",
"0.6805592",
"0.67691106",
"0.6756331",
"0.67532843",
"0.67532843",... | 0.0 | -1 |
Scores are computed on the test set | def show_score(clf, X_test, y_test):
y_pred = predict(clf, X_test)
print metrics.classification_report(y_test.astype(np.int), y_pred) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def score(self, test_data):\n\n\t\tpass",
"def score(self, test_data):\n\n\t\tins, outs = self._split_inputs_outputs(test_data)\n\t\treturn self.model.score(ins, outs)",
"def scoring(self):\n pass",
"def test_score():\n print(\"Tests for 'score' function\")\n test_suite = TestSuite()\n\n # Te... | [
"0.7901326",
"0.7223528",
"0.71334326",
"0.701038",
"0.6967124",
"0.6966751",
"0.6931556",
"0.6913712",
"0.6913712",
"0.6911562",
"0.6869426",
"0.68653387",
"0.6790049",
"0.6784269",
"0.67793673",
"0.6718337",
"0.66967857",
"0.66949916",
"0.666959",
"0.66609585",
"0.66582024"... | 0.0 | -1 |
When a user asks for a potential_category, rank the possible categories by relevance and return the top match | def find_match(potential_category: str, categories: List[str]):
return process.extractOne(potential_category, categories)[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FoodRank(search_term):\n return _ranks[search_term.lower()]",
"def test_category(self):\n # XXX identifiers would be groovy\n self.check_search(\n dict(category=u'36:self'), # trap\n [u'Ingrain'],\n 'simple category search, vs self',\n exact=True,\n... | [
"0.5779498",
"0.5776032",
"0.57445335",
"0.5656867",
"0.56513745",
"0.5642086",
"0.5516284",
"0.5513393",
"0.5420318",
"0.54119575",
"0.53935814",
"0.5359446",
"0.532522",
"0.5297809",
"0.5292416",
"0.5278605",
"0.52570313",
"0.5227728",
"0.52234787",
"0.52224135",
"0.5209769... | 0.66086555 | 0 |
UserBase a model defined in OpenAPI | def __init__(self, email: str=None, is_bot: bool=None, avatar_url: str=None, avatar_version: int=None, full_name: str=None, is_admin: bool=None, is_owner: bool=None, is_billing_admin: bool=None, role: int=None, bot_type: int=None, user_id: int=None, bot_owner_id: int=None, is_active: bool=None, is_guest: bool=None, timezone: str=None, date_joined: str=None, delivery_email: str=None, profile_data: Dict[str, object]=None):
self.openapi_types = {
'email': str,
'is_bot': bool,
'avatar_url': str,
'avatar_version': int,
'full_name': str,
'is_admin': bool,
'is_owner': bool,
'is_billing_admin': bool,
'role': int,
'bot_type': int,
'user_id': int,
'bot_owner_id': int,
'is_active': bool,
'is_guest': bool,
'timezone': str,
'date_joined': str,
'delivery_email': str,
'profile_data': Dict[str, object]
}
self.attribute_map = {
'email': 'email',
'is_bot': 'is_bot',
'avatar_url': 'avatar_url',
'avatar_version': 'avatar_version',
'full_name': 'full_name',
'is_admin': 'is_admin',
'is_owner': 'is_owner',
'is_billing_admin': 'is_billing_admin',
'role': 'role',
'bot_type': 'bot_type',
'user_id': 'user_id',
'bot_owner_id': 'bot_owner_id',
'is_active': 'is_active',
'is_guest': 'is_guest',
'timezone': 'timezone',
'date_joined': 'date_joined',
'delivery_email': 'delivery_email',
'profile_data': 'profile_data'
}
self._email = email
self._is_bot = is_bot
self._avatar_url = avatar_url
self._avatar_version = avatar_version
self._full_name = full_name
self._is_admin = is_admin
self._is_owner = is_owner
self._is_billing_admin = is_billing_admin
self._role = role
self._bot_type = bot_type
self._user_id = user_id
self._bot_owner_id = bot_owner_id
self._is_active = is_active
self._is_guest = is_guest
self._timezone = timezone
self._date_joined = date_joined
self._delivery_email = delivery_email
self._profile_data = profile_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_base() -> typing.Any:\n # pylint: disable=no-member\n return open_alchemy.models.Base # type: ignore",
"def user_model(username):\n return {\n 'username': username,\n }",
"def user_model(self): \n return self.auth.store.user_model",
"def convert_api_to_usr_model(self):\n\n ... | [
"0.61172575",
"0.5993476",
"0.5881623",
"0.58649784",
"0.5860354",
"0.5810632",
"0.57947624",
"0.5793472",
"0.5785655",
"0.57642925",
"0.5711532",
"0.57008547",
"0.56957424",
"0.56417537",
"0.56417537",
"0.56417537",
"0.5575235",
"0.55717164",
"0.5571534",
"0.55618167",
"0.55... | 0.5249836 | 46 |
Returns the dict as a model | def from_dict(cls, dikt: dict) -> 'UserBase':
return util.deserialize_model(dikt, cls) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, dikt) -> 'ModelClass':\n return util.deserialize_model(dikt, cls)",
"def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())",
"def from_dict(cls, dikt):\n return util.deserialize_model(dikt, cls)",
"def from_dict(cls, ... | [
"0.6939894",
"0.68444926",
"0.67725724",
"0.67725724",
"0.67725724",
"0.67725724",
"0.67725724",
"0.67725724",
"0.6739522",
"0.6698291",
"0.6698291",
"0.66464084",
"0.66383654",
"0.66022646",
"0.660082",
"0.65999925",
"0.6593835",
"0.6580194",
"0.65621036",
"0.64150435",
"0.6... | 0.59424317 | 86 |
Gets the email of this UserBase. The Zulip API email address of the user or bot. If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else. | def email(self):
return self._email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')",
"def get_email(self):\n return self._email",
"def get_email(self):\n return self.email",
"def user_email(self) -> pulumi.Output[str]:\n return pulumi.get(self... | [
"0.8533475",
"0.80256367",
"0.80006677",
"0.7957389",
"0.78827",
"0.7873399",
"0.78575724",
"0.7735007",
"0.76502186",
"0.76435256",
"0.7608377",
"0.76025885",
"0.76025885",
"0.76025885",
"0.75683004",
"0.75669813",
"0.75593585",
"0.7512967",
"0.74382466",
"0.7384822",
"0.731... | 0.76262873 | 12 |
Sets the email of this UserBase. The Zulip API email address of the user or bot. If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else. | def email(self, email):
self._email = email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setEmail(self, email):\n self.email = email\n return self",
"def email(self, email):\n if self.local_vars_configuration.client_side_validation and email is None: # noqa: E501\n raise ValueError(\"Invalid value for `email`, must not be `None`\") # noqa: E501\n\n self._... | [
"0.7745995",
"0.734506",
"0.7238552",
"0.71991414",
"0.70291823",
"0.69148123",
"0.67069113",
"0.66328615",
"0.66016483",
"0.65045893",
"0.65045893",
"0.64563024",
"0.6400238",
"0.6398678",
"0.63835156",
"0.6366219",
"0.6354441",
"0.6354117",
"0.6353652",
"0.6346813",
"0.6336... | 0.7170487 | 10 |
Gets the is_bot of this UserBase. A boolean specifying whether the user is a bot or full account. | def is_bot(self):
return self._is_bot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bot(self) -> bool:\n if self._bot is not None:\n return hasattr(self, 'ubot')\n return bool(Config.BOT_TOKEN)",
"def is_bot(self) -> undefined.UndefinedOr[bool]:",
"def bot_type(self):\n return self._bot_type",
"def is_bot(self) -> bool:",
"def bot(self):\n ret... | [
"0.774403",
"0.6506757",
"0.6466639",
"0.63527393",
"0.6351612",
"0.59704244",
"0.5953491",
"0.5796303",
"0.5599795",
"0.55755657",
"0.55704886",
"0.5508024",
"0.5390804",
"0.5384107",
"0.5262253",
"0.52469635",
"0.52303284",
"0.522477",
"0.5224286",
"0.5201915",
"0.5175014",... | 0.7682634 | 1 |
Sets the is_bot of this UserBase. A boolean specifying whether the user is a bot or full account. | def is_bot(self, is_bot):
self._is_bot = is_bot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bot(self):\n return self._is_bot",
"def is_bot(self) -> bool:\n if self._bot is not None:\n return hasattr(self, 'ubot')\n return bool(Config.BOT_TOKEN)",
"def bot_type(self, bot_type):\n\n self._bot_type = bot_type",
"def set_is_ai(self, is_ai):\n self.__... | [
"0.6343722",
"0.6289822",
"0.58650166",
"0.57027304",
"0.544486",
"0.5285852",
"0.51772743",
"0.5169832",
"0.50523525",
"0.5034742",
"0.5024811",
"0.50076777",
"0.48692012",
"0.48260602",
"0.48116446",
"0.4810998",
"0.48001114",
"0.4750782",
"0.47010517",
"0.46964487",
"0.468... | 0.7644477 | 0 |
Gets the avatar_url of this UserBase. | def avatar_url(self):
return self._avatar_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_url(self) -> typing.Optional[files.URL]:\n return self.make_avatar_url()",
"def avatar_url(self):\n if self.avatar and hasattr(self.avatar, 'url'):\n return self.avatar.url\n else:\n return '/static/defaults/!default_user_avatar/user.gif'",
"def avatar_url(... | [
"0.83125377",
"0.80434006",
"0.79306704",
"0.7921607",
"0.7852214",
"0.7280996",
"0.7254777",
"0.7066657",
"0.6957944",
"0.69364053",
"0.6856294",
"0.6781074",
"0.6680307",
"0.6594353",
"0.6536579",
"0.6501867",
"0.634738",
"0.6297715",
"0.6278013",
"0.6261349",
"0.625929",
... | 0.8626505 | 0 |
Sets the avatar_url of this UserBase. | def avatar_url(self, avatar_url):
self._avatar_url = avatar_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_url(self):\n if self.avatar and hasattr(self.avatar, 'url'):\n return self.avatar.url\n else:\n return '/static/defaults/!default_user_avatar/user.gif'",
"def avatar_url(self):\n return self._avatar_url",
"def avatar_url(self) -> typing.Optional[files.URL]:... | [
"0.7171562",
"0.7052809",
"0.6945081",
"0.65909845",
"0.65333134",
"0.64174134",
"0.63824266",
"0.6325658",
"0.6313757",
"0.62597895",
"0.62147564",
"0.6207663",
"0.61743844",
"0.6130403",
"0.5995444",
"0.59891415",
"0.59879833",
"0.5912891",
"0.5886393",
"0.5850929",
"0.5847... | 0.83707076 | 0 |
Gets the avatar_version of this UserBase. Version for the user's avatar. Used for cachebusting requests for the user's avatar. Clients generally shouldn't need to use this; most avatar URLs sent by Zulip will already end with `?v={avatar_version}`. | def avatar_version(self):
return self._avatar_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_version(self, avatar_version):\n\n self._avatar_version = avatar_version",
"def GetAvatar(self):\n\n return self.__GetJsonOrNone(\"/users/\"+self.userName+\"/avatar\", False)",
"def avatar_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"avatar_url\")",
"def avatar... | [
"0.6582307",
"0.6567599",
"0.627431",
"0.62414306",
"0.6070075",
"0.60053706",
"0.5953287",
"0.5907676",
"0.59010553",
"0.5892529",
"0.58835626",
"0.58578086",
"0.58211213",
"0.55421185",
"0.5502481",
"0.54706377",
"0.5448654",
"0.5431678",
"0.540974",
"0.53088725",
"0.527344... | 0.80662423 | 0 |
Sets the avatar_version of this UserBase. Version for the user's avatar. Used for cachebusting requests for the user's avatar. Clients generally shouldn't need to use this; most avatar URLs sent by Zulip will already end with `?v={avatar_version}`. | def avatar_version(self, avatar_version):
self._avatar_version = avatar_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_version(self):\n return self._avatar_version",
"def avatar_url(self, avatar_url):\n\n self._avatar_url = avatar_url",
"def update_avatar(self, url):\n if self.avatar:\n logging.info(f'{self} already has an avatar: {self.avatar}')\n # TODO: check if image ha... | [
"0.6936227",
"0.649719",
"0.59142345",
"0.5799783",
"0.57989764",
"0.5582525",
"0.54501593",
"0.5385766",
"0.5370928",
"0.5284951",
"0.5270443",
"0.5203477",
"0.5187659",
"0.51164407",
"0.5090491",
"0.50683516",
"0.5042792",
"0.503107",
"0.50070167",
"0.498359",
"0.49506572",... | 0.8566245 | 0 |
Gets the full_name of this UserBase. Full name of the user or bot, used for all display purposes. | def full_name(self):
return self._full_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name(self):\n return self.user.get_full_name() or None",
"def get_full_name(self):\n return self.username",
"def get_full_name(self):\n return self.username",
"def get_full_name(self):\n full_name = f'{self.first_name} {self.last_name}' if self.first_name and self.last_na... | [
"0.8647986",
"0.8576306",
"0.8576306",
"0.8471668",
"0.84708536",
"0.8437073",
"0.8408093",
"0.8342528",
"0.8340403",
"0.8282167",
"0.8266369",
"0.8264482",
"0.81552136",
"0.8024534",
"0.8024534",
"0.80235624",
"0.8002769",
"0.8002769",
"0.8002769",
"0.8002769",
"0.8002769",
... | 0.78962016 | 26 |
Sets the full_name of this UserBase. Full name of the user or bot, used for all display purposes. | def full_name(self, full_name):
self._full_name = full_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_full_name(self, user_full_name):\n\n self._user_full_name = user_full_name",
"def full_name(self):\n return \"{} {}\".format(self.user.first_name, self.user.last_name)",
"def full_name(self):\n return self.user.get_full_name() or None",
"def set_fullname(self, value):\n s... | [
"0.8363899",
"0.72705364",
"0.71784294",
"0.71450037",
"0.7083193",
"0.69895613",
"0.6981791",
"0.6929003",
"0.6929003",
"0.6929003",
"0.6892608",
"0.6891887",
"0.6880059",
"0.6880059",
"0.68403715",
"0.6780736",
"0.6769605",
"0.6752243",
"0.67450094",
"0.6741219",
"0.6727072... | 0.81382096 | 2 |
Gets the is_admin of this UserBase. A boolean specifying whether the user is an organization administrator. | def is_admin(self):
return self._is_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_admin(self):\n return self.admin",
"def is_admin(self) -> bool:\n return self._is_admin",
"def is_admin(self):\r\n return self.admin",
"def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False"... | [
"0.7881886",
"0.77665955",
"0.77486885",
"0.7689977",
"0.7461093",
"0.73404866",
"0.7156036",
"0.71471244",
"0.71004605",
"0.7084834",
"0.7068",
"0.7034636",
"0.70345366",
"0.6991166",
"0.69782645",
"0.6957708",
"0.6923771",
"0.6915408",
"0.6905435",
"0.6894784",
"0.6880022",... | 0.7862511 | 1 |
Sets the is_admin of this UserBase. A boolean specifying whether the user is an organization administrator. | def is_admin(self, is_admin):
self._is_admin = is_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n self._is_admin = is_admin",
"def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n ... | [
"0.83135295",
"0.66889644",
"0.6337106",
"0.626878",
"0.62481576",
"0.62481576",
"0.62017304",
"0.6183351",
"0.6072974",
"0.60349",
"0.601608",
"0.59858966",
"0.59276825",
"0.58737713",
"0.58411723",
"0.5830839",
"0.5752557",
"0.5735811",
"0.5708521",
"0.57063186",
"0.5701734... | 0.8068177 | 1 |
Gets the is_owner of this UserBase. | def is_owner(self):
return self._is_owner | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_user_is_owner(self):\n return self._tag == 'user_is_owner'",
"def get_owner_object(self):\n return False",
"def isowner(self, o):\n return self._owner is o",
"def get_owner(self):\n return self.__owner",
"def owner(self) -> discord.User:\n if self.config.owner_id:\... | [
"0.7645217",
"0.7104894",
"0.6914149",
"0.6853681",
"0.67683494",
"0.6743861",
"0.66868156",
"0.65692985",
"0.6566306",
"0.6566306",
"0.6566118",
"0.6552337",
"0.65283376",
"0.6492521",
"0.64828247",
"0.6478465",
"0.64477557",
"0.6443881",
"0.64351815",
"0.6400954",
"0.632009... | 0.79326665 | 0 |
Sets the is_owner of this UserBase. | def is_owner(self, is_owner):
self._is_owner = is_owner | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_owner(self, owner):\n self.__owner = owner",
"def set_owner(self, owner):\n self.settings[\"owner\"] = owner",
"def is_user_is_owner(self):\n return self._tag == 'user_is_owner'",
"def set_owner(self, owner, is_stream=False):\n if is_stream:\n self._logger.debug... | [
"0.6996318",
"0.69127315",
"0.6491776",
"0.64011246",
"0.63992107",
"0.63773704",
"0.636248",
"0.63547474",
"0.63318616",
"0.6193567",
"0.6193567",
"0.6193567",
"0.6193567",
"0.6184652",
"0.61401767",
"0.61401767",
"0.61401767",
"0.61401767",
"0.6025569",
"0.59794116",
"0.597... | 0.8064309 | 0 |
Gets the is_billing_admin of this UserBase. | def is_billing_admin(self):
return self._is_billing_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_billing_admin(self, is_billing_admin):\n\n self._is_billing_admin = is_billing_admin",
"def is_admin(self):\n return self.admin",
"def is_admin(self):\r\n return self.admin",
"def is_admin(self):\n if self.user is None:\n return False\n if unicode(self.use... | [
"0.75745505",
"0.6962725",
"0.6885912",
"0.6775686",
"0.67065483",
"0.6678298",
"0.6678298",
"0.66013443",
"0.6554211",
"0.6432071",
"0.6286309",
"0.6203971",
"0.61566216",
"0.6140026",
"0.61183566",
"0.60726625",
"0.6026393",
"0.6017969",
"0.59559476",
"0.59489256",
"0.59279... | 0.8872368 | 0 |
Sets the is_billing_admin of this UserBase. | def is_billing_admin(self, is_billing_admin):
self._is_billing_admin = is_billing_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_billing_admin(self):\n return self._is_billing_admin",
"def is_admin(self, is_admin):\n\n self._is_admin = is_admin",
"def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n ... | [
"0.737039",
"0.6722866",
"0.6429481",
"0.59705704",
"0.5679304",
"0.5440798",
"0.5371101",
"0.52895933",
"0.52759075",
"0.52700037",
"0.52601206",
"0.5256608",
"0.5244197",
"0.5224175",
"0.517771",
"0.51590234",
"0.5110502",
"0.50515014",
"0.503452",
"0.503452",
"0.50335866",... | 0.8755264 | 0 |
Gets the role of this UserBase. | def role(self):
return self._role | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_role(self):\n return self.role",
"def role(self):\n\n return self._role",
"def role(self) -> aws_cdk.aws_iam.IRole:\n return self._values.get('role')",
"def role(self) -> str:\n return pulumi.get(self, \"role\")",
"def role(self) -> typing.Optional[aws_cdk.aws_iam.IRole]... | [
"0.7832626",
"0.7500845",
"0.74306035",
"0.73451483",
"0.71249825",
"0.7112837",
"0.71025026",
"0.70645654",
"0.698936",
"0.6881144",
"0.67973137",
"0.6794101",
"0.6794101",
"0.6781229",
"0.67532885",
"0.6691753",
"0.6611382",
"0.6611382",
"0.6611382",
"0.653817",
"0.63703835... | 0.7420549 | 5 |
Sets the role of this UserBase. | def role(self, role):
allowed_values = [100, 200, 300, 400, 600] # noqa: E501
if role not in allowed_values:
raise ValueError(
"Invalid value for `role` ({0}), must be one of {1}"
.format(role, allowed_values)
)
self._role = role | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_role(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'4 .. 32']}), is_leaf=True, yang_name=\"role\", rest_name=\"role\", parent=self, path_helper=self._path_helper, ex... | [
"0.7486664",
"0.7334197",
"0.712406",
"0.7118152",
"0.7118152",
"0.66809034",
"0.65651333",
"0.65358007",
"0.6365971",
"0.63436615",
"0.63090795",
"0.6153752",
"0.6122553",
"0.6036801",
"0.60276306",
"0.5917643",
"0.5917643",
"0.5917643",
"0.5857858",
"0.5825336",
"0.58118975... | 0.6081036 | 13 |
Gets the bot_type of this UserBase. | def bot_type(self):
return self._bot_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chat_type(self) -> str:\n return self.user.chat_type.name",
"def lobby_type(self):\n return self._get(\"lobby_type\")",
"def get_type(self) -> str:\n return Tables.USER.name",
"def user_type(self):\n if \"userType\" in self._prop_dict:\n return self._prop_dict[\"use... | [
"0.64627266",
"0.6358613",
"0.614378",
"0.6125625",
"0.6125625",
"0.59903854",
"0.59903854",
"0.5968016",
"0.5968016",
"0.59540266",
"0.5942109",
"0.58541214",
"0.585159",
"0.58268684",
"0.58268684",
"0.58098865",
"0.57802206",
"0.5750634",
"0.5730113",
"0.56939965",
"0.56846... | 0.83526576 | 0 |
Sets the bot_type of this UserBase. | def bot_type(self, bot_type):
self._bot_type = bot_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bot_type(self):\n return self._bot_type",
"def set_type(self, rtype=ALL_USERS):\r\n self.type = rtype",
"def set_type(self, type):\n self.type = type",
"def set_type(self, type):\n self.type = type",
"def is_bot(self, is_bot):\n\n self._is_bot = is_bot",
"def set_ty... | [
"0.6873118",
"0.60826707",
"0.5980632",
"0.5980632",
"0.5958783",
"0.59285235",
"0.58882517",
"0.56953204",
"0.56326497",
"0.5610567",
"0.55728096",
"0.5503789",
"0.5461631",
"0.54612577",
"0.5455133",
"0.5455133",
"0.5455133",
"0.5455133",
"0.5442875",
"0.5397702",
"0.539770... | 0.8411738 | 0 |
Gets the user_id of this UserBase. The unique ID of the user. | def user_id(self):
return self._user_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_id(self):\n return self.id_user",
"def user_id(self) -> str:\n return self._user_id",
"def user_id(self) -> str:\n return self._user_id",
"def get_id(self) -> int:\n return self.user_id",
"def get_id(self):\n return self.user_id",
"def user_id(self):\n ... | [
"0.833126",
"0.8074868",
"0.8074868",
"0.79576075",
"0.7943644",
"0.7802189",
"0.77085686",
"0.75711966",
"0.7557508",
"0.74490136",
"0.74490136",
"0.7431941",
"0.7417376",
"0.7399928",
"0.73023885",
"0.7278637",
"0.7249883",
"0.7241275",
"0.71973765",
"0.71973765",
"0.719737... | 0.81448174 | 5 |
Sets the user_id of this UserBase. The unique ID of the user. | def user_id(self, user_id):
self._user_id = user_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id_user(self, id_user):\n\n self._id_user = id_user",
"def user_id(self, user_id):\n if user_id is None:\n raise ValueError(\"Invalid value for `user_id`, must not be `None`\") # noqa: E501\n\n self._user_id = user_id",
"def user_id(self, user_id):\n if user_id is No... | [
"0.8062206",
"0.7894141",
"0.7894141",
"0.78666085",
"0.7841344",
"0.7453738",
"0.7334409",
"0.7047939",
"0.69315517",
"0.6743944",
"0.67409",
"0.67378694",
"0.67298764",
"0.65137416",
"0.6411481",
"0.6411481",
"0.6393266",
"0.6393266",
"0.6393266",
"0.6393266",
"0.6393266",
... | 0.8119237 | 10 |
Gets the bot_owner_id of this UserBase. | def bot_owner_id(self):
return self._bot_owner_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def owner(self) -> None:\n return self.bot.get_user(self.bot.config.owner_ids[0])",
"def owner_id(self) -> int:\n return self.proto.owner",
"def owner_id(self):\n return self._owner_id",
"def owner_id(self) -> str:\n return self.__owner_id",
"def owner_id(self) -> str:\n ... | [
"0.74863726",
"0.7462389",
"0.7429973",
"0.73903984",
"0.7214011",
"0.7123705",
"0.70963526",
"0.7041297",
"0.6885209",
"0.6862868",
"0.68442214",
"0.6656169",
"0.66238314",
"0.65125304",
"0.65125304",
"0.6489912",
"0.6465008",
"0.639576",
"0.636058",
"0.63590413",
"0.6319276... | 0.86790913 | 0 |
Sets the bot_owner_id of this UserBase. | def bot_owner_id(self, bot_owner_id):
self._bot_owner_id = bot_owner_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def owner_id(self, owner_id):\n\n self._owner_id = owner_id",
"def owner_id(self, owner_id):\n self._owner_id = owner_id",
"def bot_owner_id(self):\n return self._bot_owner_id",
"def set_owner(self, owner):\n self.__owner = owner",
"def owner_id(self, owner_id):\n if owne... | [
"0.73704034",
"0.733693",
"0.71219534",
"0.69730103",
"0.6940321",
"0.6678052",
"0.64090276",
"0.62162405",
"0.62162405",
"0.62162405",
"0.62162405",
"0.6192035",
"0.6192035",
"0.6192035",
"0.6192035",
"0.60748756",
"0.6034818",
"0.59885144",
"0.5901746",
"0.58401716",
"0.578... | 0.8572632 | 0 |
Gets the is_active of this UserBase. A boolean specifying whether the user account has been deactivated. | def is_active(self):
return self._is_active | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def active(self):\n if self._active is not None:\n return self._active\n # Try to get it from the userprofile\n try:\n self._active = self.userprofile.user.is_active\n except UserProfile.DoesNotExist:\n # User profile does not exist.\n # The d... | [
"0.7960439",
"0.77300847",
"0.76961887",
"0.76444125",
"0.73034716",
"0.7291146",
"0.7148115",
"0.7120933",
"0.7120933",
"0.7120933",
"0.7120933",
"0.7039014",
"0.70228976",
"0.6914976",
"0.68688226",
"0.6831247",
"0.6828009",
"0.67985916",
"0.67348653",
"0.6728246",
"0.67187... | 0.72787446 | 8 |
Sets the is_active of this UserBase. A boolean specifying whether the user account has been deactivated. | def is_active(self, is_active):
self._is_active = is_active | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_active(self, is_active: bool):\n if is_active is None:\n raise ValueError(\"Invalid value for `is_active`, must not be `None`\")\n\n self._is_active = is_active",
"def is_active(self, is_active):\n \n self._is_active = is_active",
"def is_active(self, is_active):\n... | [
"0.7834352",
"0.76405424",
"0.6955871",
"0.68170184",
"0.68170184",
"0.68170184",
"0.68170184",
"0.6813176",
"0.6730943",
"0.67180324",
"0.67115015",
"0.67037755",
"0.6689273",
"0.66405123",
"0.6595193",
"0.6499912",
"0.6499744",
"0.6490623",
"0.64750445",
"0.636067",
"0.6323... | 0.7561219 | 3 |
Gets the is_guest of this UserBase. A boolean specifying whether the user is a guest user. | def is_guest(self):
return self._is_guest | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guest(self):\n return self._guest",
"def is_guest(self, is_guest):\n\n self._is_guest = is_guest",
"def get_guest_user():\n\n guest = User.query.filter_by(username=\"guest\").first()\n\n if guest == None:\n guest = User(username=\"guest\",\n pas... | [
"0.67751104",
"0.652903",
"0.6333875",
"0.5840743",
"0.5831468",
"0.57090145",
"0.54347944",
"0.53395015",
"0.5297339",
"0.52234644",
"0.5145995",
"0.514241",
"0.5127566",
"0.5127566",
"0.50955236",
"0.50857407",
"0.5083316",
"0.5064882",
"0.5058896",
"0.5041641",
"0.50172037... | 0.78533375 | 0 |
Sets the is_guest of this UserBase. A boolean specifying whether the user is a guest user. | def is_guest(self, is_guest):
self._is_guest = is_guest | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guest(self, guest):\n if guest is None:\n raise ValueError(\"Invalid value for `guest`, must not be `None`\")\n\n self._guest = guest",
"def is_guest(self):\n return self._is_guest",
"def is_admin(self, is_admin):\n\n self._is_admin = is_admin",
"def is_admin(self, ... | [
"0.63713956",
"0.63543206",
"0.5549084",
"0.52629703",
"0.50986946",
"0.48912513",
"0.47999674",
"0.47975162",
"0.474734",
"0.4700092",
"0.46394247",
"0.46394247",
"0.4637681",
"0.46297148",
"0.45938712",
"0.4591176",
"0.45438093",
"0.4535325",
"0.45209828",
"0.45110002",
"0.... | 0.82178175 | 0 |
Gets the timezone of this UserBase. The time zone of the user. | def timezone(self):
return self._timezone | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timezone(self):\n return self._tz",
"def timezone(self) -> str:\n return self._tz",
"def timezone(self):\n return self.data.get(\"timezone\")",
"def TimeZone(self):\n if self.force_auto_sync:\n self.get('TimeZone')\n return self._TimeZone",
"def get_timezon... | [
"0.7857188",
"0.7602793",
"0.75864065",
"0.7564862",
"0.7543805",
"0.7350593",
"0.7301738",
"0.7264471",
"0.71459556",
"0.71003807",
"0.7097807",
"0.68156534",
"0.68122673",
"0.6797889",
"0.6775188",
"0.6735393",
"0.6680171",
"0.66326815",
"0.65203756",
"0.6517433",
"0.651403... | 0.7784589 | 3 |
Sets the timezone of this UserBase. The time zone of the user. | def timezone(self, timezone):
self._timezone = timezone | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_timezone():\n tz_name = request.vars.name\n # Validates the name.\n from pytz import all_timezones_set\n if tz_name in all_timezones_set:\n session.user_timezone = tz_name\n # If the user is logged in, sets also the timezone for the user.\n # Otherwise, it can happen that a... | [
"0.70524657",
"0.70524657",
"0.6869655",
"0.6587702",
"0.650735",
"0.64232886",
"0.63101465",
"0.6221063",
"0.6113634",
"0.6078929",
"0.6078929",
"0.6078929",
"0.58731836",
"0.5856435",
"0.5750898",
"0.57249284",
"0.5719738",
"0.5674356",
"0.5662734",
"0.5613859",
"0.55795693... | 0.7129376 | 4 |
Gets the date_joined of this UserBase. The time the user account was created. | def date_joined(self):
return self._date_joined | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_account_created_date(self):\n return self.account_created_date",
"def getJoiningTime(self):\n return self.__joinTime",
"def created_at(self):\n created_at = self.joined_at\n if created_at is None:\n created_at = DISCORD_EPOCH_START\n \n return create... | [
"0.62656933",
"0.6219153",
"0.59980553",
"0.59758735",
"0.5934436",
"0.587002",
"0.57954764",
"0.5775895",
"0.5775895",
"0.5775895",
"0.57507694",
"0.57064766",
"0.57064766",
"0.56547153",
"0.56547153",
"0.56422794",
"0.5618498",
"0.5597825",
"0.55175257",
"0.550172",
"0.5483... | 0.7982348 | 0 |
Sets the date_joined of this UserBase. The time the user account was created. | def date_joined(self, date_joined):
self._date_joined = date_joined | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_joined(self):\n return self._date_joined",
"def test_user_creation_old_date_joined(self):\n new_user = self.registration_profile.objects.create_inactive_user(\n site=Site.objects.get_current(), **self.user_info)\n self.assertEqual(new_user.get_username(), 'alice')\n ... | [
"0.66438895",
"0.581493",
"0.56453663",
"0.51747286",
"0.5124787",
"0.5048352",
"0.49426377",
"0.49251464",
"0.49251464",
"0.49176228",
"0.49075496",
"0.49066377",
"0.49043387",
"0.48563272",
"0.48563272",
"0.48563272",
"0.48529363",
"0.48464775",
"0.48464775",
"0.48464775",
... | 0.7769368 | 0 |
Gets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy. | def delivery_email(self):
return self._delivery_email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')",
"def email(self):\n billing_contact = self.owner.organization_user.user\n return billing_contact.email",
"def get_email(self):\n return self._email",
"def get... | [
"0.6896622",
"0.68197286",
"0.66776025",
"0.6648298",
"0.64765364",
"0.6463804",
"0.6460512",
"0.64135796",
"0.64135796",
"0.64135796",
"0.64135796",
"0.63343066",
"0.63343066",
"0.6321957",
"0.63091224",
"0.62989455",
"0.6274076",
"0.6220656",
"0.62095183",
"0.6136559",
"0.6... | 0.8150735 | 0 |
Sets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy. | def delivery_email(self, delivery_email):
self._delivery_email = delivery_email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delivery_email(self):\n return self._delivery_email",
"def delivery(self, delivery):\n if self.local_vars_configuration.client_side_validation and delivery is None: # noqa: E501\n raise ValueError(\"Invalid value for `delivery`, must not be `None`\") # noqa: E501\n\n self._d... | [
"0.69637316",
"0.6370568",
"0.59695375",
"0.59579545",
"0.58683085",
"0.5863861",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.582248",
"0.5751209",
"0.5748383",
"0.5698401",
"0.... | 0.812475 | 0 |
Gets the profile_data of this UserBase. A dictionary containing custom profile field data for the user. Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user's data for that field. Generally the data includes just a single `value` key; for those custom profile fields supporting Markdown, a `rendered_value` key will also be present. | def profile_data(self):
return self._profile_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_profile_data(id):\n user = User.query.get(id)\n return user.to_dict_profile()",
"def get_object_data(self, **kwargs):\n user = self.request.user\n return UserProfile.objects.get(user=user)",
"def profile(self) -> dict:\n endpoint = \"/api/users/profile/\"\n ret = self... | [
"0.69240314",
"0.6456976",
"0.64322084",
"0.6248396",
"0.6248396",
"0.62341315",
"0.622801",
"0.6204653",
"0.6138357",
"0.611971",
"0.6103204",
"0.6066835",
"0.6032334",
"0.60309625",
"0.5982074",
"0.5944301",
"0.59439224",
"0.5938915",
"0.5907476",
"0.58976126",
"0.5869983",... | 0.6958784 | 0 |
Sets the profile_data of this UserBase. A dictionary containing custom profile field data for the user. Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user's data for that field. Generally the data includes just a single `value` key; for those custom profile fields supporting Markdown, a `rendered_value` key will also be present. | def profile_data(self, profile_data):
self._profile_data = profile_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_user_data(self, user_data, user_info):\n self.user_info = AttrDict(user_info)\n self.user_data = AttrDict(user_data)\n self.score_user = self.scoresaber.get_user_data(self.user_data.id)",
"def update_user_profile(req_data):\n logger.debug(\"entering function update_user_profile\")... | [
"0.6163082",
"0.6090175",
"0.6075812",
"0.6008002",
"0.59890383",
"0.5896696",
"0.5854722",
"0.58466715",
"0.58388495",
"0.58365136",
"0.58214825",
"0.58029795",
"0.58013165",
"0.57626474",
"0.5759382",
"0.5732638",
"0.56859213",
"0.56347704",
"0.5612301",
"0.5607427",
"0.560... | 0.7260224 | 0 |
Problem 1 Version 3 Use a formula to determine the additional sum 15 integers at a time, then use the iterative approach for any remaining integers in the range. | def solution(resources, args):
retval = 0
repeats = [3, 5, 6, 9, 10, 12, 15]
i = 0
n = args.number - 1
while n > 15:
retval += sum(repeats)
retval += 15*len(repeats)*i
n -= 15
i += 1
while n >= 3:
if n % 3 == 0 or n % 5 == 0:
retval += 15*i + n
n -= 1
return retval | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def triangular_number_solution():\n return 5 * partial_sum(199) + 3 * partial_sum(333) - 15 * partial_sum(66)",
"def solveProblem021():\n total = 0\n for i in range(2, 10000):\n divs = getProperDivisors(i)\n s = sum(divs)\n # Skip stuff greater than, we'll get to it later if it's le... | [
"0.7452489",
"0.69697046",
"0.6922565",
"0.6716069",
"0.6671347",
"0.66690093",
"0.66667116",
"0.66388094",
"0.66203743",
"0.66162395",
"0.6604934",
"0.6604606",
"0.64996886",
"0.648764",
"0.64773923",
"0.64563894",
"0.6424136",
"0.6397848",
"0.6307458",
"0.62973",
"0.6296701... | 0.69348073 | 2 |
Check the northbound queue for RPC's queued by GUI or SOAP requests. A client should connect triggered by a CONNECTION_REQUEST and any RPC's queued by the northbound will be then added to the session queue by this function. | def add_nb_queue_to_session_queue(self, session):
rpc_list = []
client_id = get_element('cid', session['client'])
if client_id is not None and client_id in RPCS.Northbound_Queue:
# Check if all commands have been serviced
if RPCS.Northbound_Queue[client_id]:
# Get first request in the client queue, in the form:
# (Client_COMMAND, RESPONSE STREAM)
# TODO pop might be unresolved
nb_request = RPCS.Northbound_Queue[client_id].pop(0)
# Parse and queue request(s)
client_command = nb_request[0]
rpc_list.append(client_command)
# Insert nb commands to the front of queue
session['queue'] = queued_nb_methods + session['queue']
# Store stream which expects the client response in the session
session['nb_response_stream'] = nb_request[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_in(self):\n etree = self._encapsulate_request(self._generate_ping())\n self.zmq_scheduler_request_queue.put_nowait(etree)",
"def _check_queue(self):\n self._process_incoming_queue_messages()\n self._root.after(200, self._check_queue)",
"def request_already_queued(self, req... | [
"0.6413275",
"0.63343513",
"0.5929305",
"0.59155464",
"0.5869772",
"0.57600075",
"0.56298584",
"0.5565722",
"0.5554399",
"0.55359644",
"0.5532582",
"0.5485062",
"0.54757154",
"0.54550743",
"0.54375905",
"0.53650355",
"0.53436047",
"0.53087854",
"0.53064525",
"0.5301316",
"0.5... | 0.6457678 | 0 |
When NB requests are queued put them in the session queue. If there are RPCs in queue to be sent, return prepared RPC and move to ExpectResponse. Otherwise, go to Listening and send a 'done' RPC. | def run(self, session):
rpc = None
if session['client']['event'] == 'CONNECTION_REQUEST':
self.add_nb_queue_to_session_queue(session)
while rpc is None and session['queue']:
try:
# Loop through queue until there is an RPC to send, or until
# there are no more RPCs queued, or until an error occurs
session['rpc']['method'] = session['queue'].pop(0)
rpc = session['rpc']['method'].send_request(session)
except ClientMethodException:
# Failed to send this RPC, move on to the next
LOG.debug("Error during preparation of client method: %s" % str(session['rpc']['method']))
continue
except Exception:
traceback.print_exc()
LOG.debug("Unexpected error during preparation of client method: %s" % str(session['rpc']['method']))
return RPCS.SendingRpc, None
if rpc is not None:
# RPC ready: Send it and ExpectResponse
return RPCS.ExpectResponse, rpc
else:
# If there are no (more) RPCs to send, log ok
# and send done, indicating communication is complete
session['log'] = {'rc': 'ok', 'msg': ''}
session['db'].clear_dirtyflag(session['client']['cid'])
return RPCS.Listening, {'method': 'done'} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_nb_queue_to_session_queue(self, session):\n rpc_list = []\n client_id = get_element('cid', session['client'])\n\n if client_id is not None and client_id in RPCS.Northbound_Queue:\n # Check if all commands have been serviced\n if RPCS.Northbound_Queue[client_id]:\n... | [
"0.63733757",
"0.58320886",
"0.5644144",
"0.5606107",
"0.55666107",
"0.55509126",
"0.55193716",
"0.551203",
"0.5509601",
"0.5445808",
"0.5436328",
"0.5436328",
"0.5414003",
"0.5397534",
"0.5392256",
"0.5372994",
"0.53597814",
"0.5358608",
"0.52984124",
"0.5293183",
"0.5270412... | 0.6577181 | 0 |
Handle a response to an RPC. Independently of the outcome, we always move back to SendingRpc state so that the other RPCs in queue can have a chance to be handled | def handle_message(self, session, message):
rpc_id = get_element('id', message)
try:
if 'error' in session['rpc']['message']:
raise ClientResponseError(session['rpc']['message'], 'error')
if session['rpc']['id'] != rpc_id:
# RPC id in response does not match request, log and move on
data = str(session['rpc']['id']) + ' != ' + str(rpc_id)
raise ClientResponseError(session['rpc']['message'], 'wrong_rpc_id', data=data)
else:
# Handle response for the RPC method that was last sent to CLIENT
session['rpc']['method'].handle_response(session, message)
except (ClientMethodException, ClientResponseError) as err:
# Error parsing response, handle it and move on
LOG.debug("Error parsing client response: {!s}".format(err))
error_handler = getattr(session['rpc']['method'], "handle_error", None)
if callable(error_handler):
# Call this client Method's specific error handler, if defined
error_handler(session)
except (BrokenPipeError, Exception) as err:
if isinstance(err, BrokenPipeError):
# Silenced exception; client took too long to process and
# respond to the Northbound request
pass
else:
# Unexpected exception, log it with traceback and move on
LOG.debug('Unexpected error during client Response handling: %s', str(err))
LOG.debug(traceback.print_exc())
return RPCS.SendingRpc, None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_message(self, session, message):\n # Handle an RPC call\n # Reason should come from inform call.\n response = {}\n if message['method'] == 'done' and message['id'] is None:\n # Here we switch roles, becoming RPC Client\n next_state, response = RPCS.Sendi... | [
"0.7039859",
"0.7026062",
"0.690414",
"0.6804377",
"0.6649933",
"0.6590539",
"0.6588729",
"0.6510268",
"0.65001494",
"0.63618594",
"0.63517755",
"0.6349003",
"0.63440263",
"0.63440263",
"0.6343718",
"0.6316436",
"0.6311576",
"0.6277061",
"0.6267772",
"0.6266023",
"0.6261978",... | 0.67964923 | 4 |
Handle a input from a device | def handle_message(self, session, message):
# Handle an RPC call
# Reason should come from inform call.
response = {}
if message['method'] == 'done' and message['id'] is None:
# Here we switch roles, becoming RPC Client
next_state, response = RPCS.SendingRpc, None
else:
# We have a valid method.
# (VALID_METHODS checked in rpcsd:parse_message)
next_state = RPCS.ExpectRpc
response['error'] = {'code': -31998, 'message': 'Wrong request'}
response['id'] = message['id']
return next_state, response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_input(self, event):\n pass",
"def listen(device_input, callback):\n while True:\n time.sleep(0.01)\n event = readControlDataRaw(device_input)\n (control_id, control_type, event_type, value) = parseControlEvent(event)\n if control_id != -1:\n callback(co... | [
"0.69072264",
"0.6673858",
"0.6624353",
"0.6555153",
"0.6445983",
"0.6402754",
"0.6364852",
"0.6353404",
"0.6157712",
"0.6112686",
"0.6071804",
"0.606225",
"0.60263073",
"0.59862846",
"0.5978435",
"0.5901954",
"0.5878921",
"0.5858231",
"0.5857707",
"0.5841894",
"0.582443",
... | 0.0 | -1 |
Prepares session queue for communication | def queue_communication(self, session):
# Here we can queue all communication to be sent to the Client
# Examples follow...
session['queue'].append(GetObjects())
session['queue'].append(DeleteObjects())
session['queue'].append(RpcExecute())
session['queue'].append(GetDeviceInfo()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_session(self):\n if not self.session.container_id:\n self.start()\n self._check_fifo()\n self._update_container()",
"def init_session(self):\n pass",
"def init_session(self):\n pass",
"def session_preparation(self):\n self._test_channel_read()\n ... | [
"0.62144345",
"0.613409",
"0.613409",
"0.59782755",
"0.5936927",
"0.593133",
"0.59233063",
"0.58450776",
"0.58450776",
"0.582604",
"0.58232695",
"0.5806154",
"0.5799438",
"0.5799438",
"0.5799438",
"0.5795595",
"0.57882345",
"0.57882345",
"0.57882345",
"0.57882345",
"0.5788234... | 0.59243166 | 6 |
Parses a given protocol string to check if it is in proper formatting | def parse_protocol_version(self, version_string_list):
# Verify for every provided string if it is in proper versioning format
for version_string in version_string_list:
try:
parsed_version_string = version_string.split('.')
if len(parsed_version_string) == 1 and version_string.isdigit():
# No dots in version string, it is a simple integer.
continue
StrictVersion(version_string)
except (AttributeError, ValueError):
LOG.debug('Invalid protocol version string provided')
return version_string
# Check for malformatting
for i in range(len(parsed_version_string)):
if len(parsed_version_string[i]) > 1:
if parsed_version_string[i][0] == '0': # Leading 0's
return version_string
if len(parsed_version_string[i]) < 1: # Empty strings
return version_string
# Protocol version formating: OK
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _verify_format(s, format):\n r = re.compile(format)\n if r.match(s) is not None:\n return True\n return False",
"def proto_check(proto):\n # Check for TCP\n if proto == 6:\n return 'tcp'\n # Check for UDP\n elif proto == 17:\n return 'udp'\n else:\n return ... | [
"0.62597406",
"0.61697423",
"0.6072746",
"0.60350204",
"0.575354",
"0.57534987",
"0.5701303",
"0.5671702",
"0.5651911",
"0.5631964",
"0.56221384",
"0.55761224",
"0.55722475",
"0.55467844",
"0.55360466",
"0.5512623",
"0.54971683",
"0.5479753",
"0.54710925",
"0.543337",
"0.5420... | 0.5759088 | 4 |
This function determines the common supported protocol version. This is determined by a version supported by the RPCS server that is in the range of numbers that exist between the value of the first integer of the earliest supported protocol version and the value of the first integer of the latest supported protocol version. | def determine_supported_protocol(self, earliest, latest):
earliest = int(earliest.split('.')[0])
latest = int(latest.split('.')[0])
if earliest <= latest:
supported = range(earliest, latest + 1)
for version in (reversed(supported)):
if version in RPCS.SUPPORTED_PROTOCOL_VERSIONS:
return str(version)
# If no common protocol version is found, raise fatal error
raise ClientRequestError('NoValidProtocolVersionInCommon') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_protocol_versions(self, session):\n # First parse protocol version strings to check for invalid formatting\n invalid_string = self.parse_protocol_version(\n [self.earliest_protocol_version, self.latest_protocol_version])\n if invalid_string is not None:\n ... | [
"0.7081918",
"0.70504236",
"0.6895096",
"0.63376284",
"0.63264036",
"0.63264036",
"0.61619365",
"0.60787296",
"0.60647607",
"0.6016684",
"0.5973124",
"0.5794255",
"0.57867813",
"0.5767949",
"0.5725214",
"0.5694531",
"0.5666855",
"0.56289035",
"0.562115",
"0.5615987",
"0.56040... | 0.8174987 | 0 |
This function is responsible for parsing, validating and making all necessary comparisons between provided and supported protocol versions. | def compare_protocol_versions(self, session):
# First parse protocol version strings to check for invalid formatting
invalid_string = self.parse_protocol_version(
[self.earliest_protocol_version, self.latest_protocol_version])
if invalid_string is not None:
# Error during protocol string parsing
data = ('earliest_protocol_version'
if invalid_string == self.earliest_protocol_version else 'latest_protocol_version')
raise ClientRequestError('InvalidParameterValue', data=data)
# Check if protocol version is supported and define the one to use
self.protocol_version = self.determine_supported_protocol(
self.earliest_protocol_version, self.latest_protocol_version) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _sanityCheckProtocolVersions(other):\n if other.minVersion > other.maxVersion:\n raise ValueError(\"Versions set incorrectly\")\n if other.minVersion not in KNOWN_VERSIONS:\n raise ValueError(\"minVersion set incorrectly\")\n if other.maxVersion not in KNOWN_VERSIONS:... | [
"0.7269251",
"0.6852072",
"0.68450886",
"0.6574904",
"0.645231",
"0.6396166",
"0.63311136",
"0.6159254",
"0.61516625",
"0.6143125",
"0.6079563",
"0.6043297",
"0.6020891",
"0.5971723",
"0.5925532",
"0.5903397",
"0.58636093",
"0.57814234",
"0.57633996",
"0.5755667",
"0.57490414... | 0.7876382 | 0 |
If a client_id is provided together with the inform message, Now we have enough information to get the data from the database | def handle_client_id(self, session):
if session['client']['cid'] is not None:
# A subscriber ID may only contain letters, numbers, spaces and
# the following special characters: - _ \ / ( ) # .
p = re.compile('^[A-Za-z0-9-_\\\. #/()]+$')
if p.match(session['client']['cid']) is None:
raise ClientRequestError('InvalidClientId')
try:
session['client'] = session['db'].client_data_query(
session['client']['cid'])
except DbException as db_err:
session['log'] = {'rc': 'error', 'msg': 'Non matching ClientID'}
raise ClientRequestError('UnknownClient', data=session['client']['cid'] + ' does not match data in database')
if session['client'] is None:
# The client could not be found.
# It means that the client is not yet defined in the database.
msg = ' cid:' + session['client']['cid']
LOG.info("Client not in database, " + msg)
session['log'] = {'rc': 'ok', 'msg': 'Unknown CLIENT '}
raise ClientRequestError('UnknownClient', data='No entry for client in database') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_inform(self, session, request):\n # Verify the parameters\n params = get_element('params', request)\n # Default value for protocol_compression\n protocol_compression = 'NONE'\n response = {}\n\n if params is not None:\n try:\n # Fetch i... | [
"0.5811888",
"0.55938053",
"0.5496945",
"0.54101413",
"0.5383944",
"0.53775185",
"0.5357722",
"0.53567284",
"0.5239797",
"0.5234531",
"0.5225566",
"0.5214078",
"0.51944524",
"0.519301",
"0.518485",
"0.51753753",
"0.5170485",
"0.5164536",
"0.51571465",
"0.51501626",
"0.5137739... | 0.6117542 | 0 |
Validates received protocol compression parameter. Sets protocol compression to be used in session according to result of this validation. | def handle_protocol_compression(self, session):
if self.protocol_compression is not None:
valid = RPCS.VALID_COMPRESSION_METHODS
if self.protocol_compression not in valid:
self.protocol_compression = 'NONE'
raise ClientRequestError('InvalidParameterValue', data='protocol_compression')
else:
self.protocol_compression = 'NONE' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate(\n self,\n is_full_msg: bool,\n msg_type: Optional[bytes],\n header_len: int,\n payload_len: Optional[int],\n input_buffer: InputBuffer\n ) -> None:\n\n if self._connection_protocol_version >= self.FIRST_VALIDATING_VERSION:\n self._validat... | [
"0.51522434",
"0.513435",
"0.5105154",
"0.50020367",
"0.4987997",
"0.49288347",
"0.48937827",
"0.48890725",
"0.48640823",
"0.48285913",
"0.48197266",
"0.47871244",
"0.47853112",
"0.47634792",
"0.4761809",
"0.47489363",
"0.47361204",
"0.47114277",
"0.4680672",
"0.46734345",
"0... | 0.73079675 | 0 |
Handle a request from the device | def handle_inform(self, session, request):
# Verify the parameters
params = get_element('params', request)
# Default value for protocol_compression
protocol_compression = 'NONE'
response = {}
if params is not None:
try:
# Fetch inform parameters and load into session
self.fetch_inform_params(session, params)
# handle a possible subscriber id (MACless communication)
self.compare_protocol_versions(session)
# If protocol_compression method is provided, check if valid
self.handle_protocol_compression(session)
# Validate and check reason (event) for this session
self.handle_client_id(session)
# Parse provided protocol version parameters and check validity
self.handle_connection_event(session)
# Check for unknown parameters provided in RPC
for key in params:
if key not in RPCS.VALID_INFORM_PARAMETERS:
raise ClientRequestError("InvalidParameterName", data=key)
except ClientRequestError as inform_error:
next_state = inform_error.error['next_state']
error_message = {"error": inform_error.error['error']}
if inform_error.error_name == "InvalidClientId":
# As per defined in the protocol: Log in database
session['log'] = {'rc': 'error', 'msg': 'Invalid client_id value'}
LOG.debug("ExpectInform Error: " + str(inform_error))
return next_state, error_message
except DbException:
return (RPCS.ExpectInform, {
'error': {'code': -31997,
'message': 'Database access error'}})
# Everything is OK with Inform RPC
next_state = RPCS.ExpectRpc
response['result'] = {
'protocol_version': self.protocol_version,
'protocol_compression': protocol_compression
}
# No parameters provided with inform RPC
else:
next_state = RPCS.ExpectInform
response['error'] = {
'code': -32602, 'message': 'Invalid parameter'}
return next_state, response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle(self):\n data = self.request.recv(1024)\n self.request.send(data)",
"async def handle_request(self, request: aioweb.request.Request):",
"def handle_request(self, request: HttpParser) -> None:\n raise NotImplementedError() # pragma: no cover",
"def handle_request(self):\n\t... | [
"0.73241466",
"0.7304394",
"0.69043636",
"0.68481004",
"0.6837162",
"0.67897916",
"0.6763938",
"0.6763938",
"0.6755062",
"0.67278916",
"0.6716694",
"0.66799444",
"0.66772705",
"0.66192824",
"0.66020906",
"0.6588511",
"0.65734357",
"0.65640265",
"0.652787",
"0.65262365",
"0.65... | 0.0 | -1 |
Prepare session; attempts database connection, verify provided credentials and validate. | def prepare_session(self, writer, session):
# Get information about the CLIENT
session['client']['ip'], port = writer.get_extra_info('peername')
# Try Database connection
try:
self.connect_database(session)
except DbException as err:
LOG.debug('Could not prepare session: {!s}'.format(err))
return RPCS.Listening
# Get MAC Address (DNS field) from the certificate
peercert = writer.get_extra_info('peercert')
dns = get_element('subjectAltName', peercert)
try:
session['client']['did'] = dns[0][1] # currenlty not used but it should in the certificate
session['client']['mac'] = dns[1][1]
except IndexError:
# Disconnect when credentials cannot be obtained
LOG.info("Failed to obtain certificate credentials from ip " + session['client']['ip'])
return RPCS.Listening
return RPCS.ExpectInform | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def prepare(self):\n\n # Read the secure cookie which exists if we are in an authenticated\n # context (though not if the caimira webservice is running standalone).\n session = json.loads(self.get_secure_cookie('session') or 'null')\n\n if session:\n self.current_user =... | [
"0.6290233",
"0.6030922",
"0.594931",
"0.58703387",
"0.5845047",
"0.57664585",
"0.5687237",
"0.56795657",
"0.56795657",
"0.5650503",
"0.56293213",
"0.5617835",
"0.55368704",
"0.5494034",
"0.54863006",
"0.54586",
"0.54352534",
"0.5423377",
"0.5407348",
"0.5407348",
"0.5407348"... | 0.5441848 | 16 |
Create an SSL context suitable for accepting session requests | def __init__(self):
try:
context = ssl.create_default_context(
purpose=ssl.Purpose.CLIENT_AUTH)
context.options |= ssl.OP_NO_SSLv2
context.options |= ssl.OP_NO_SSLv3
context.options |= ssl.OP_NO_TLSv1
context.options |= ssl.OP_NO_TLSv1_1
context.options |= ssl.OP_NO_COMPRESSION
context.verify_mode = ssl.CERT_REQUIRED
# TODO do not use static configuration parameters
context.load_verify_locations(cafile='/sbin/rpcsd/root.cert.pem')
context.load_cert_chain(certfile='/sbin/rpcsd/gaps.pem')
context.set_ciphers('AES128-SHA256')
RPCS.context = context
except FileNotFoundError:
# If we can't set up TLS context, log error and exit
LOG.error("Could not setup TLS context: certificate file(s) "
"not present in the correct directory")
exit(1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_ssl_context(cfg):\n ctx = ssl.SSLContext(cfg.ssl_version)\n ctx.load_cert_chain(cfg.certfile, cfg.keyfile)\n ctx.verify_mode = cfg.cert_reqs\n if cfg.ca_certs:\n ctx.load_verify_locations(cfg.ca_certs)\n if cfg.ciphers:\n ctx.set_ciphers(cfg.ciph... | [
"0.7945872",
"0.7542444",
"0.74426365",
"0.7328456",
"0.7317657",
"0.7291481",
"0.7074744",
"0.7014252",
"0.69510484",
"0.6910048",
"0.67939",
"0.67733735",
"0.67338645",
"0.6712221",
"0.6710472",
"0.67098236",
"0.66667795",
"0.66622305",
"0.65952104",
"0.65731806",
"0.656536... | 0.65869004 | 19 |
(str) > bool Return True if correct service name | def is_service_name_correct(self, service):
return service in self.services | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_name(name, allow_services=False):",
"def istype(client, service_name: str):\n\n if is_client(client):\n return (\n client.meta.service_model.service_name.lower()\n == service_name.strip().lower()\n )\n return False",
"def definition_of_services(self):\r\n ... | [
"0.74874175",
"0.7102973",
"0.6658793",
"0.65929854",
"0.6531604",
"0.6523252",
"0.64808494",
"0.64768475",
"0.64768475",
"0.64768475",
"0.6421063",
"0.6411934",
"0.63543",
"0.63014257",
"0.62521374",
"0.6246466",
"0.61115396",
"0.60908616",
"0.60830384",
"0.60830384",
"0.606... | 0.83579403 | 0 |
(str) > bool Return True if correct class mail type | def is_class_mail_types_correct(self, class_mail_type):
return class_mail_type in self.class_mail_types | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_mail_types_correct(self, mail_type):\r\n return mail_type in self.mail_types",
"def email_type(verifield, required):\n return verifield is None or parseaddr(verifield) != ('','')",
"def __CheckType(self, t):\n t = string.upper(t)\n \"\"\" convert lower letters to upper letters \"... | [
"0.7468366",
"0.6942029",
"0.6129135",
"0.6121263",
"0.60874057",
"0.60748357",
"0.59902066",
"0.5907582",
"0.5859858",
"0.58163",
"0.5788119",
"0.57557553",
"0.5746743",
"0.57291144",
"0.5729054",
"0.5723128",
"0.5698093",
"0.56697905",
"0.56547284",
"0.55967015",
"0.5573413... | 0.7834716 | 0 |
(str) > bool Return True if correct container type | def is_container_type_correct(self, container):
return container in self.containers | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_container(item):\n if isinstance(item, str):\n return False\n elif hasattr(item, \"__iter__\"):\n return True\n\n return False",
"def is_str_or_coll(value):\n return bool(is_str(value)) or bool(is_tuple_or_list(value))",
"def is_iterable_container(value):\n # strings are ite... | [
"0.7596315",
"0.6735085",
"0.6629723",
"0.6603197",
"0.6592958",
"0.65436935",
"0.6490295",
"0.64833474",
"0.6360425",
"0.634218",
"0.6331468",
"0.633145",
"0.63053995",
"0.6277777",
"0.6248238",
"0.6234861",
"0.6221624",
"0.6171583",
"0.61659265",
"0.61386937",
"0.6130888",
... | 0.7524484 | 1 |
(class xml.etree.ElementTree.Element) > list Return dictionary with all Postage information | def get_postage_from_response(self, xml_response):
postages = xml_response.find("Package").findall("Postage")
postages_list = []
if postages:
for postage in postages:
postages_list.append(self.get_response_information(postage))
return postages_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xml_to_dict(self):\n medicine_node = ['medicines', 'dose', 'unit', 'unit_price', 'goods_num', 'dose_that',\n 'remark', 'm_usage', 'goods_norms', 'goods_orgin', 'MedPerDos', 'MedPerDay']\n dict_data = {}\n n = 0\n xq_childs = 0\n for child in self.root.... | [
"0.63759995",
"0.620662",
"0.6160831",
"0.6134572",
"0.6060549",
"0.6026878",
"0.60247046",
"0.5937487",
"0.5935178",
"0.5895591",
"0.5833998",
"0.58304346",
"0.5824379",
"0.58219045",
"0.5707903",
"0.5669245",
"0.5667443",
"0.56660455",
"0.5661833",
"0.5661833",
"0.5661279",... | 0.6353038 | 1 |
(str) > bool Return True if correct mail type | def is_mail_types_correct(self, mail_type):
return mail_type in self.mail_types | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email_type(verifield, required):\n return verifield is None or parseaddr(verifield) != ('','')",
"def is_class_mail_types_correct(self, class_mail_type):\r\n return class_mail_type in self.class_mail_types",
"def get_receive_mail_str(self):\n ret = False\n if self.__mail:\n ... | [
"0.73987883",
"0.6967432",
"0.67043835",
"0.62827927",
"0.62815034",
"0.61875695",
"0.60421157",
"0.5943893",
"0.590512",
"0.5892637",
"0.587241",
"0.5855261",
"0.5816171",
"0.5768737",
"0.56882554",
"0.56593686",
"0.56416327",
"0.56387013",
"0.5634344",
"0.55975133",
"0.5586... | 0.7832249 | 0 |
(class xml.etree.ElementTree.Element) > list Return dictionary with all Postage information | def get_postage_from_response(self, xml_response):
services = xml_response.find("Package").findall("Service")
postages_list = []
if services:
for postages in services:
postages_list.append(postages.find("Postage").text)
return postages_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xml_to_dict(self):\n medicine_node = ['medicines', 'dose', 'unit', 'unit_price', 'goods_num', 'dose_that',\n 'remark', 'm_usage', 'goods_norms', 'goods_orgin', 'MedPerDos', 'MedPerDay']\n dict_data = {}\n n = 0\n xq_childs = 0\n for child in self.root.... | [
"0.63759995",
"0.6353038",
"0.620662",
"0.6160831",
"0.6060549",
"0.6026878",
"0.60247046",
"0.5937487",
"0.5935178",
"0.5895591",
"0.5833998",
"0.58304346",
"0.5824379",
"0.58219045",
"0.5707903",
"0.5669245",
"0.5667443",
"0.56660455",
"0.5661833",
"0.5661833",
"0.5661279",... | 0.6134572 | 4 |
Get the event information for a Betfair market ID. | def get_event_info(self, market_id: str) -> Tuple[str, str, str]:
market_filter_ = market_filter(market_ids=[market_id])
event_type = (
self._client
.betting
.list_event_types(filter=market_filter_)[0]
.event_type
.name
)
event = (
self._client
.betting
.list_events(filter=market_filter_)[0]
.event
.name
)
competition = (
self._client
.betting
.list_competitions(filter=market_filter_)[0]
.competition
.name
)
return event_type, event, competition | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_market_info(\n self, market_id: str\n ) -> Tuple[str, datetime, Dict[int, str]]:\n market_filter_ = market_filter(market_ids=[market_id])\n\n market = (\n self._client\n .betting\n .list_market_catalogue(\n filter=market_filter_,\n... | [
"0.6362536",
"0.63047844",
"0.61040074",
"0.59841615",
"0.5915983",
"0.58161205",
"0.5800413",
"0.5745946",
"0.5725486",
"0.5675717",
"0.56645864",
"0.5656346",
"0.5621131",
"0.55494666",
"0.55292183",
"0.5473335",
"0.5443154",
"0.5440933",
"0.5433231",
"0.5430904",
"0.542923... | 0.78798735 | 0 |
Get the market information from a Betfair market ID. | def get_market_info(
self, market_id: str
) -> Tuple[str, datetime, Dict[int, str]]:
market_filter_ = market_filter(market_ids=[market_id])
market = (
self._client
.betting
.list_market_catalogue(
filter=market_filter_,
market_projection=['MARKET_START_TIME', 'RUNNER_DESCRIPTION']
)[0]
)
market_name = market.market_name
market_start_time = market.market_start_time
selections = {}
for runner in market.runners:
selections[runner.selection_id] = runner.runner_name
return market_name, market_start_time, selections | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_market_info_lite(self, market_id):\n req = BFExchangeFactory.create(\"ns1:GetMarketInfoReq\")\n req.marketId = market_id\n rsp = self._soapcall(BFExchangeService.getMarketInfo, req)\n if rsp.errorCode != GetMarketErrorEnum.OK:\n error_code = rsp.errorCode\n ... | [
"0.7296463",
"0.6786435",
"0.64976203",
"0.645441",
"0.6436033",
"0.6377452",
"0.6353565",
"0.6345084",
"0.6292913",
"0.6270462",
"0.6263126",
"0.62144077",
"0.6168539",
"0.6146066",
"0.6135332",
"0.6084566",
"0.6076271",
"0.6071816",
"0.6056507",
"0.6041295",
"0.5983031",
... | 0.74244684 | 0 |
Start the Betfair ladder stream. | def start_betfair_ladder_stream(
self, market_id: str, conflate_ms: float
) -> queue.Queue:
if self.stream is not None:
logger.info(
"There is already a Betfair market stream running. Before "
"starting a new stream, the existing one must be stopped."
)
ladder_queue = self.stream.listener.output_queue
return ladder_queue
logger.info("Initialising output queue.")
ladder_queue = queue.Queue()
logger.info("Initialising Betfair stream listener.")
listener = betfairlightweight.StreamListener(ladder_queue)
logger.info("Creating the Betfair market stream.")
stream = self._client.streaming.create_stream(listener=listener)
logger.info("Setting the market filter to market_id=%s.", market_id)
market_filter_ = streaming_market_filter(market_ids=[market_id])
logger.info("Initialising streaming market data filter.")
market_data_filter = streaming_market_data_filter(
# fields=['EX_MARKET_DEF', 'EX_ALL_OFFERS'], # Without virtual bets
fields=['EX_MARKET_DEF', 'EX_BEST_OFFERS_DISP'], # With virtual bets
ladder_levels=10
)
logger.info("Subscribing to the market.")
stream.subscribe_to_markets(
market_filter=market_filter_,
market_data_filter=market_data_filter,
conflate_ms=min(conflate_ms, 120000),
)
logger.info("Starting the Betfair market stream.")
stream.start(async_=True)
self.stream = stream
return ladder_queue | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start(self):\n\t\tself.stream.start_stream()",
"def start_stream(self):\n pass",
"def start(self) -> None:\n self._stream.start()",
"def start(self):\n self.stream.start()\n self.running = True\n self.update()",
"def run(self):\n self.arbiter.start()",
"def s... | [
"0.68951404",
"0.66808796",
"0.65393025",
"0.63553804",
"0.61745507",
"0.600255",
"0.5989746",
"0.59398526",
"0.59398526",
"0.59398526",
"0.59398526",
"0.58484846",
"0.57963586",
"0.57312804",
"0.57312804",
"0.5725943",
"0.57067126",
"0.5693756",
"0.5692279",
"0.5670867",
"0.... | 0.6352791 | 4 |
Stop a running Betfair ladder stream. | def stop_betfair_ladder_stream(self) -> None:
if self.stream is not None:
logger.info("Stopping the Betfair market stream.")
self.stream.stop()
self.stream.listener.output_queue.put("Terminate")
self.stream = None
else:
logger.info("No existing Betfair market stream to stop.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_stream(self):\n pass",
"def stop(self) -> None:\n self._stream.stop()",
"def stop(self):\n\t\tself.stream.stop_stream()",
"def stop(self):\n self.stream.stop()\n self.running = False",
"def stop(self) -> None:\n self._stream.stop()",
"def stop() -> None:",
"def s... | [
"0.8050214",
"0.80189526",
"0.7999657",
"0.7922578",
"0.7622994",
"0.7271031",
"0.7232619",
"0.71897453",
"0.71808064",
"0.7150011",
"0.71426904",
"0.7123477",
"0.7123477",
"0.7122764",
"0.7122764",
"0.71187675",
"0.7106935",
"0.7099712",
"0.7099712",
"0.7099712",
"0.7099712"... | 0.83448356 | 0 |
Returns class by interpreting input string as module path and class name. Module path should be separated by dots as usual. Separate class name from module by '/'. | def get_class(string):
logger = logman.getLogger(__name__)
if '/' not in string:
logger.error("The string is not properly formatted. Use '/' to separate module path from classname. String is: {}".format(string))
return
module_name, class_name = string.split('/')
try:
logger.debug('Retrieving class {} from module {}'.format(class_name, module_name))
temp_class = getattr(importlib.import_module(module_name), class_name)
except ModuleNotFoundError:
logger.error("Module not found: {}".format(module_name))
raise
except AttributeError:
logger.error("Class not found: {}".format(class_name))
raise
except:
logger.error("Unexpected error while loading {}".format(string))
raise
return temp_class | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_class(full_class_string):\r\n class_data = full_class_string.split(\".\")\r\n module_path = \".\".join(class_data[:-1])\r\n class_str = class_data[-1]\r\n module = importlib.import_module(module_path)\r\n return getattr(module, class_str)",
"def getClass(strname):\n \n modulename, c... | [
"0.7585165",
"0.7544114",
"0.7541174",
"0.7536624",
"0.75242513",
"0.74492747",
"0.7387409",
"0.7375805",
"0.73551124",
"0.7353887",
"0.7324937",
"0.72359395",
"0.72320575",
"0.72180814",
"0.71838266",
"0.71719867",
"0.7155751",
"0.7124456",
"0.711404",
"0.7071752",
"0.705921... | 0.87269014 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.