partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | _determine_timeout | Determines how timeout should be applied to a wrapped method.
Args:
default_timeout (Optional[Timeout]): The default timeout specified
at method creation time.
specified_timeout (Optional[Timeout]): The timeout specified at
invocation time. If :attr:`DEFAULT`, this will be s... | api_core/google/api_core/gapic_v1/method.py | def _determine_timeout(default_timeout, specified_timeout, retry):
"""Determines how timeout should be applied to a wrapped method.
Args:
default_timeout (Optional[Timeout]): The default timeout specified
at method creation time.
specified_timeout (Optional[Timeout]): The timeout sp... | def _determine_timeout(default_timeout, specified_timeout, retry):
"""Determines how timeout should be applied to a wrapped method.
Args:
default_timeout (Optional[Timeout]): The default timeout specified
at method creation time.
specified_timeout (Optional[Timeout]): The timeout sp... | [
"Determines",
"how",
"timeout",
"should",
"be",
"applied",
"to",
"a",
"wrapped",
"method",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L50-L86 | [
"def",
"_determine_timeout",
"(",
"default_timeout",
",",
"specified_timeout",
",",
"retry",
")",
":",
"if",
"specified_timeout",
"is",
"DEFAULT",
":",
"specified_timeout",
"=",
"default_timeout",
"if",
"specified_timeout",
"is",
"default_timeout",
":",
"# If timeout is... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | wrap_method | Wrap an RPC method with common behavior.
This applies common error wrapping, retry, and timeout behavior a function.
The wrapped function will take optional ``retry`` and ``timeout``
arguments.
For example::
import google.api_core.gapic_v1.method
from google.api_core import retry
... | api_core/google/api_core/gapic_v1/method.py | def wrap_method(
func,
default_retry=None,
default_timeout=None,
client_info=client_info.DEFAULT_CLIENT_INFO,
):
"""Wrap an RPC method with common behavior.
This applies common error wrapping, retry, and timeout behavior a function.
The wrapped function will take optional ``retry`` and ``ti... | def wrap_method(
func,
default_retry=None,
default_timeout=None,
client_info=client_info.DEFAULT_CLIENT_INFO,
):
"""Wrap an RPC method with common behavior.
This applies common error wrapping, retry, and timeout behavior a function.
The wrapped function will take optional ``retry`` and ``ti... | [
"Wrap",
"an",
"RPC",
"method",
"with",
"common",
"behavior",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L146-L242 | [
"def",
"wrap_method",
"(",
"func",
",",
"default_retry",
"=",
"None",
",",
"default_timeout",
"=",
"None",
",",
"client_info",
"=",
"client_info",
".",
"DEFAULT_CLIENT_INFO",
",",
")",
":",
"func",
"=",
"grpc_helpers",
".",
"wrap_errors",
"(",
"func",
")",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _validate_name | Pre-flight ``Bucket`` name validation.
:type name: str or :data:`NoneType`
:param name: Proposed bucket name.
:rtype: str or :data:`NoneType`
:returns: ``name`` if valid. | storage/google/cloud/storage/_helpers.py | def _validate_name(name):
"""Pre-flight ``Bucket`` name validation.
:type name: str or :data:`NoneType`
:param name: Proposed bucket name.
:rtype: str or :data:`NoneType`
:returns: ``name`` if valid.
"""
if name is None:
return
# The first and las characters must be alphanumer... | def _validate_name(name):
"""Pre-flight ``Bucket`` name validation.
:type name: str or :data:`NoneType`
:param name: Proposed bucket name.
:rtype: str or :data:`NoneType`
:returns: ``name`` if valid.
"""
if name is None:
return
# The first and las characters must be alphanumer... | [
"Pre",
"-",
"flight",
"Bucket",
"name",
"validation",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L24-L39 | [
"def",
"_validate_name",
"(",
"name",
")",
":",
"if",
"name",
"is",
"None",
":",
"return",
"# The first and las characters must be alphanumeric.",
"if",
"not",
"all",
"(",
"[",
"name",
"[",
"0",
"]",
".",
"isalnum",
"(",
")",
",",
"name",
"[",
"-",
"1",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _scalar_property | Create a property descriptor around the :class:`_PropertyMixin` helpers. | storage/google/cloud/storage/_helpers.py | def _scalar_property(fieldname):
"""Create a property descriptor around the :class:`_PropertyMixin` helpers.
"""
def _getter(self):
"""Scalar property getter."""
return self._properties.get(fieldname)
def _setter(self, value):
"""Scalar property setter."""
self._patch_p... | def _scalar_property(fieldname):
"""Create a property descriptor around the :class:`_PropertyMixin` helpers.
"""
def _getter(self):
"""Scalar property getter."""
return self._properties.get(fieldname)
def _setter(self, value):
"""Scalar property setter."""
self._patch_p... | [
"Create",
"a",
"property",
"descriptor",
"around",
"the",
":",
"class",
":",
"_PropertyMixin",
"helpers",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L216-L228 | [
"def",
"_scalar_property",
"(",
"fieldname",
")",
":",
"def",
"_getter",
"(",
"self",
")",
":",
"\"\"\"Scalar property getter.\"\"\"",
"return",
"self",
".",
"_properties",
".",
"get",
"(",
"fieldname",
")",
"def",
"_setter",
"(",
"self",
",",
"value",
")",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _write_buffer_to_hash | Read blocks from a buffer and update a hash with them.
:type buffer_object: bytes buffer
:param buffer_object: Buffer containing bytes used to update a hash object.
:type hash_obj: object that implements update
:param hash_obj: A hash object (MD5 or CRC32-C).
:type digest_block_size: int
:par... | storage/google/cloud/storage/_helpers.py | def _write_buffer_to_hash(buffer_object, hash_obj, digest_block_size=8192):
"""Read blocks from a buffer and update a hash with them.
:type buffer_object: bytes buffer
:param buffer_object: Buffer containing bytes used to update a hash object.
:type hash_obj: object that implements update
:param h... | def _write_buffer_to_hash(buffer_object, hash_obj, digest_block_size=8192):
"""Read blocks from a buffer and update a hash with them.
:type buffer_object: bytes buffer
:param buffer_object: Buffer containing bytes used to update a hash object.
:type hash_obj: object that implements update
:param h... | [
"Read",
"blocks",
"from",
"a",
"buffer",
"and",
"update",
"a",
"hash",
"with",
"them",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L231-L249 | [
"def",
"_write_buffer_to_hash",
"(",
"buffer_object",
",",
"hash_obj",
",",
"digest_block_size",
"=",
"8192",
")",
":",
"block",
"=",
"buffer_object",
".",
"read",
"(",
"digest_block_size",
")",
"while",
"len",
"(",
"block",
")",
">",
"0",
":",
"hash_obj",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _base64_md5hash | Get MD5 hash of bytes (as base64).
:type buffer_object: bytes buffer
:param buffer_object: Buffer containing bytes used to compute an MD5
hash (as base64).
:rtype: str
:returns: A base64 encoded digest of the MD5 hash. | storage/google/cloud/storage/_helpers.py | def _base64_md5hash(buffer_object):
"""Get MD5 hash of bytes (as base64).
:type buffer_object: bytes buffer
:param buffer_object: Buffer containing bytes used to compute an MD5
hash (as base64).
:rtype: str
:returns: A base64 encoded digest of the MD5 hash.
"""
ha... | def _base64_md5hash(buffer_object):
"""Get MD5 hash of bytes (as base64).
:type buffer_object: bytes buffer
:param buffer_object: Buffer containing bytes used to compute an MD5
hash (as base64).
:rtype: str
:returns: A base64 encoded digest of the MD5 hash.
"""
ha... | [
"Get",
"MD5",
"hash",
"of",
"bytes",
"(",
"as",
"base64",
")",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L252-L265 | [
"def",
"_base64_md5hash",
"(",
"buffer_object",
")",
":",
"hash_obj",
"=",
"md5",
"(",
")",
"_write_buffer_to_hash",
"(",
"buffer_object",
",",
"hash_obj",
")",
"digest_bytes",
"=",
"hash_obj",
".",
"digest",
"(",
")",
"return",
"base64",
".",
"b64encode",
"("... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _PropertyMixin.reload | Reload properties from Cloud Storage.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
... | storage/google/cloud/storage/_helpers.py | def reload(self, client=None):
"""Reload properties from Cloud Storage.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: the client to use. If not pass... | def reload(self, client=None):
"""Reload properties from Cloud Storage.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: the client to use. If not pass... | [
"Reload",
"properties",
"from",
"Cloud",
"Storage",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L110-L132 | [
"def",
"reload",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"query_params",
"=",
"self",
".",
"_query_params",
"# Pass only '?projection=noAcl' here because 'acl' and related",
"# are handled v... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _PropertyMixin._patch_property | Update field of this object's properties.
This method will only update the field provided and will not
touch the other fields.
It **will not** reload the properties from the server. The behavior is
local only and syncing occurs via :meth:`patch`.
:type name: str
:param... | storage/google/cloud/storage/_helpers.py | def _patch_property(self, name, value):
"""Update field of this object's properties.
This method will only update the field provided and will not
touch the other fields.
It **will not** reload the properties from the server. The behavior is
local only and syncing occurs via :me... | def _patch_property(self, name, value):
"""Update field of this object's properties.
This method will only update the field provided and will not
touch the other fields.
It **will not** reload the properties from the server. The behavior is
local only and syncing occurs via :me... | [
"Update",
"field",
"of",
"this",
"object",
"s",
"properties",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L134-L150 | [
"def",
"_patch_property",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"self",
".",
"_changes",
".",
"add",
"(",
"name",
")",
"self",
".",
"_properties",
"[",
"name",
"]",
"=",
"value"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _PropertyMixin.patch | Sends all changed properties in a PATCH request.
Updates the ``_properties`` with the response from the backend.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:par... | storage/google/cloud/storage/_helpers.py | def patch(self, client=None):
"""Sends all changed properties in a PATCH request.
Updates the ``_properties`` with the response from the backend.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
... | def patch(self, client=None):
"""Sends all changed properties in a PATCH request.
Updates the ``_properties`` with the response from the backend.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
... | [
"Sends",
"all",
"changed",
"properties",
"in",
"a",
"PATCH",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L162-L189 | [
"def",
"patch",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"query_params",
"=",
"self",
".",
"_query_params",
"# Pass '?projection=full' here because 'PATCH' documented not",
"# to work properl... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _PropertyMixin.update | Sends all properties in a PUT request.
Updates the ``_properties`` with the response from the backend.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client:... | storage/google/cloud/storage/_helpers.py | def update(self, client=None):
"""Sends all properties in a PUT request.
Updates the ``_properties`` with the response from the backend.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
... | def update(self, client=None):
"""Sends all properties in a PUT request.
Updates the ``_properties`` with the response from the backend.
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
... | [
"Sends",
"all",
"properties",
"in",
"a",
"PUT",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L191-L213 | [
"def",
"update",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"query_params",
"=",
"self",
".",
"_query_params",
"query_params",
"[",
"\"projection\"",
"]",
"=",
"\"full\"",
"api_respon... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Dispatcher.start | Start a thread to dispatch requests queued up by callbacks.
Spawns a thread to run :meth:`dispatch_callback`. | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | def start(self):
"""Start a thread to dispatch requests queued up by callbacks.
Spawns a thread to run :meth:`dispatch_callback`.
"""
with self._operational_lock:
if self._thread is not None:
raise ValueError("Dispatcher is already running.")
flow... | def start(self):
"""Start a thread to dispatch requests queued up by callbacks.
Spawns a thread to run :meth:`dispatch_callback`.
"""
with self._operational_lock:
if self._thread is not None:
raise ValueError("Dispatcher is already running.")
flow... | [
"Start",
"a",
"thread",
"to",
"dispatch",
"requests",
"queued",
"up",
"by",
"callbacks",
".",
"Spawns",
"a",
"thread",
"to",
"run",
":",
"meth",
":",
"dispatch_callback",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L37-L57 | [
"def",
"start",
"(",
"self",
")",
":",
"with",
"self",
".",
"_operational_lock",
":",
"if",
"self",
".",
"_thread",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Dispatcher is already running.\"",
")",
"flow_control",
"=",
"self",
".",
"_manager",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Dispatcher.dispatch_callback | Map the callback request to the appropriate gRPC request.
Args:
action (str): The method to be invoked.
kwargs (Dict[str, Any]): The keyword arguments for the method
specified by ``action``.
Raises:
ValueError: If ``action`` isn't one of the expected... | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | def dispatch_callback(self, items):
"""Map the callback request to the appropriate gRPC request.
Args:
action (str): The method to be invoked.
kwargs (Dict[str, Any]): The keyword arguments for the method
specified by ``action``.
Raises:
Valu... | def dispatch_callback(self, items):
"""Map the callback request to the appropriate gRPC request.
Args:
action (str): The method to be invoked.
kwargs (Dict[str, Any]): The keyword arguments for the method
specified by ``action``.
Raises:
Valu... | [
"Map",
"the",
"callback",
"request",
"to",
"the",
"appropriate",
"gRPC",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L68-L101 | [
"def",
"dispatch_callback",
"(",
"self",
",",
"items",
")",
":",
"if",
"not",
"self",
".",
"_manager",
".",
"is_active",
":",
"return",
"batched_commands",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"for",
"item",
"in",
"items",
":",
"batche... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Dispatcher.ack | Acknowledge the given messages.
Args:
items(Sequence[AckRequest]): The items to acknowledge. | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | def ack(self, items):
"""Acknowledge the given messages.
Args:
items(Sequence[AckRequest]): The items to acknowledge.
"""
# If we got timing information, add it to the histogram.
for item in items:
time_to_ack = item.time_to_ack
if time_to_ack... | def ack(self, items):
"""Acknowledge the given messages.
Args:
items(Sequence[AckRequest]): The items to acknowledge.
"""
# If we got timing information, add it to the histogram.
for item in items:
time_to_ack = item.time_to_ack
if time_to_ack... | [
"Acknowledge",
"the",
"given",
"messages",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L103-L120 | [
"def",
"ack",
"(",
"self",
",",
"items",
")",
":",
"# If we got timing information, add it to the histogram.",
"for",
"item",
"in",
"items",
":",
"time_to_ack",
"=",
"item",
".",
"time_to_ack",
"if",
"time_to_ack",
"is",
"not",
"None",
":",
"self",
".",
"_manage... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Dispatcher.drop | Remove the given messages from lease management.
Args:
items(Sequence[DropRequest]): The items to drop. | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | def drop(self, items):
"""Remove the given messages from lease management.
Args:
items(Sequence[DropRequest]): The items to drop.
"""
self._manager.leaser.remove(items)
self._manager.maybe_resume_consumer() | def drop(self, items):
"""Remove the given messages from lease management.
Args:
items(Sequence[DropRequest]): The items to drop.
"""
self._manager.leaser.remove(items)
self._manager.maybe_resume_consumer() | [
"Remove",
"the",
"given",
"messages",
"from",
"lease",
"management",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L122-L129 | [
"def",
"drop",
"(",
"self",
",",
"items",
")",
":",
"self",
".",
"_manager",
".",
"leaser",
".",
"remove",
"(",
"items",
")",
"self",
".",
"_manager",
".",
"maybe_resume_consumer",
"(",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Dispatcher.lease | Add the given messages to lease management.
Args:
items(Sequence[LeaseRequest]): The items to lease. | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | def lease(self, items):
"""Add the given messages to lease management.
Args:
items(Sequence[LeaseRequest]): The items to lease.
"""
self._manager.leaser.add(items)
self._manager.maybe_pause_consumer() | def lease(self, items):
"""Add the given messages to lease management.
Args:
items(Sequence[LeaseRequest]): The items to lease.
"""
self._manager.leaser.add(items)
self._manager.maybe_pause_consumer() | [
"Add",
"the",
"given",
"messages",
"to",
"lease",
"management",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L131-L138 | [
"def",
"lease",
"(",
"self",
",",
"items",
")",
":",
"self",
".",
"_manager",
".",
"leaser",
".",
"add",
"(",
"items",
")",
"self",
".",
"_manager",
".",
"maybe_pause_consumer",
"(",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Dispatcher.modify_ack_deadline | Modify the ack deadline for the given messages.
Args:
items(Sequence[ModAckRequest]): The items to modify. | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | def modify_ack_deadline(self, items):
"""Modify the ack deadline for the given messages.
Args:
items(Sequence[ModAckRequest]): The items to modify.
"""
ack_ids = [item.ack_id for item in items]
seconds = [item.seconds for item in items]
request = types.Strea... | def modify_ack_deadline(self, items):
"""Modify the ack deadline for the given messages.
Args:
items(Sequence[ModAckRequest]): The items to modify.
"""
ack_ids = [item.ack_id for item in items]
seconds = [item.seconds for item in items]
request = types.Strea... | [
"Modify",
"the",
"ack",
"deadline",
"for",
"the",
"given",
"messages",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L140-L152 | [
"def",
"modify_ack_deadline",
"(",
"self",
",",
"items",
")",
":",
"ack_ids",
"=",
"[",
"item",
".",
"ack_id",
"for",
"item",
"in",
"items",
"]",
"seconds",
"=",
"[",
"item",
".",
"seconds",
"for",
"item",
"in",
"items",
"]",
"request",
"=",
"types",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Dispatcher.nack | Explicitly deny receipt of messages.
Args:
items(Sequence[NackRequest]): The items to deny. | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py | def nack(self, items):
"""Explicitly deny receipt of messages.
Args:
items(Sequence[NackRequest]): The items to deny.
"""
self.modify_ack_deadline(
[requests.ModAckRequest(ack_id=item.ack_id, seconds=0) for item in items]
)
self.drop([requests.Dro... | def nack(self, items):
"""Explicitly deny receipt of messages.
Args:
items(Sequence[NackRequest]): The items to deny.
"""
self.modify_ack_deadline(
[requests.ModAckRequest(ack_id=item.ack_id, seconds=0) for item in items]
)
self.drop([requests.Dro... | [
"Explicitly",
"deny",
"receipt",
"of",
"messages",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L154-L163 | [
"def",
"nack",
"(",
"self",
",",
"items",
")",
":",
"self",
".",
"modify_ack_deadline",
"(",
"[",
"requests",
".",
"ModAckRequest",
"(",
"ack_id",
"=",
"item",
".",
"ack_id",
",",
"seconds",
"=",
"0",
")",
"for",
"item",
"in",
"items",
"]",
")",
"sel... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | JobControllerClient.submit_job | Submits a job to a cluster.
Example:
>>> from google.cloud import dataproc_v1beta2
>>>
>>> client = dataproc_v1beta2.JobControllerClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
>>>
>>> # TODO:... | dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py | def submit_job(
self,
project_id,
region,
job,
request_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Submits a job to a cluster.
Example:
... | def submit_job(
self,
project_id,
region,
job,
request_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Submits a job to a cluster.
Example:
... | [
"Submits",
"a",
"job",
"to",
"a",
"cluster",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L175-L257 | [
"def",
"submit_job",
"(",
"self",
",",
"project_id",
",",
"region",
",",
"job",
",",
"request_id",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | JobControllerClient.update_job | Updates a job in a project.
Example:
>>> from google.cloud import dataproc_v1beta2
>>>
>>> client = dataproc_v1beta2.JobControllerClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
>>>
>>> # TODO:... | dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py | def update_job(
self,
project_id,
region,
job_id,
job,
update_mask,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates a job in a project.
Examp... | def update_job(
self,
project_id,
region,
job_id,
job,
update_mask,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates a job in a project.
Examp... | [
"Updates",
"a",
"job",
"in",
"a",
"project",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L454-L546 | [
"def",
"update_job",
"(",
"self",
",",
"project_id",
",",
"region",
",",
"job_id",
",",
"job",
",",
"update_mask",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | JobControllerClient.cancel_job | Starts a job cancellation request. To access the job resource after
cancellation, call
`regions/{region}/jobs.list <https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list>`__
or
`regions/{region}/jobs.get <https://cloud.google.com/dataproc/docs/reference... | dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py | def cancel_job(
self,
project_id,
region,
job_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Starts a job cancellation request. To access the job resource after
... | def cancel_job(
self,
project_id,
region,
job_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Starts a job cancellation request. To access the job resource after
... | [
"Starts",
"a",
"job",
"cancellation",
"request",
".",
"To",
"access",
"the",
"job",
"resource",
"after",
"cancellation",
"call",
"regions",
"/",
"{",
"region",
"}",
"/",
"jobs",
".",
"list",
"<https",
":",
"//",
"cloud",
".",
"google",
".",
"com",
"/",
... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L548-L620 | [
"def",
"cancel_job",
"(",
"self",
",",
"project_id",
",",
"region",
",",
"job_id",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.instance_path | Return a fully-qualified instance string. | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def instance_path(cls, project, instance):
"""Return a fully-qualified instance string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}",
project=project,
instance=instance,
) | def instance_path(cls, project, instance):
"""Return a fully-qualified instance string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}",
project=project,
instance=instance,
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"instance",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L93-L99 | [
"def",
"instance_path",
"(",
"cls",
",",
"project",
",",
"instance",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/instances/{instance}\"",
",",
"project",
"=",
"project",
",",
"instance",
"=",
"in... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.app_profile_path | Return a fully-qualified app_profile string. | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def app_profile_path(cls, project, instance, app_profile):
"""Return a fully-qualified app_profile string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/appProfiles/{app_profile}",
project=project,
instance=instance,
... | def app_profile_path(cls, project, instance, app_profile):
"""Return a fully-qualified app_profile string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/appProfiles/{app_profile}",
project=project,
instance=instance,
... | [
"Return",
"a",
"fully",
"-",
"qualified",
"app_profile",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L102-L109 | [
"def",
"app_profile_path",
"(",
"cls",
",",
"project",
",",
"instance",
",",
"app_profile",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/instances/{instance}/appProfiles/{app_profile}\"",
",",
"project",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.cluster_path | Return a fully-qualified cluster string. | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def cluster_path(cls, project, instance, cluster):
"""Return a fully-qualified cluster string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/clusters/{cluster}",
project=project,
instance=instance,
cluster=cluster... | def cluster_path(cls, project, instance, cluster):
"""Return a fully-qualified cluster string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/clusters/{cluster}",
project=project,
instance=instance,
cluster=cluster... | [
"Return",
"a",
"fully",
"-",
"qualified",
"cluster",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L112-L119 | [
"def",
"cluster_path",
"(",
"cls",
",",
"project",
",",
"instance",
",",
"cluster",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/instances/{instance}/clusters/{cluster}\"",
",",
"project",
"=",
"proje... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.list_instances | Lists information about instances in a project.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableInstanceAdminClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>>
>>> ... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def list_instances(
self,
parent,
page_token=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Lists information about instances in a project.
Example:
>>> f... | def list_instances(
self,
parent,
page_token=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Lists information about instances in a project.
Example:
>>> f... | [
"Lists",
"information",
"about",
"instances",
"in",
"a",
"project",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L413-L485 | [
"def",
"list_instances",
"(",
"self",
",",
"parent",
",",
"page_token",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"meth... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.update_instance | Updates an instance within a project.
Example:
>>> from google.cloud import bigtable_admin_v2
>>> from google.cloud.bigtable_admin_v2 import enums
>>>
>>> client = bigtable_admin_v2.BigtableInstanceAdminClient()
>>>
>>> name = client.insta... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def update_instance(
self,
name,
display_name,
type_,
labels,
state=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates an instance within a project... | def update_instance(
self,
name,
display_name,
type_,
labels,
state=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates an instance within a project... | [
"Updates",
"an",
"instance",
"within",
"a",
"project",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L487-L588 | [
"def",
"update_instance",
"(",
"self",
",",
"name",
",",
"display_name",
",",
"type_",
",",
"labels",
",",
"state",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.partial_update_instance | Partially updates an instance within a project.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableInstanceAdminClient()
>>>
>>> # TODO: Initialize `instance`:
>>> instance = {}
>... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def partial_update_instance(
self,
instance,
update_mask,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Partially updates an instance within a project.
Example:
... | def partial_update_instance(
self,
instance,
update_mask,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Partially updates an instance within a project.
Example:
... | [
"Partially",
"updates",
"an",
"instance",
"within",
"a",
"project",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L590-L687 | [
"def",
"partial_update_instance",
"(",
"self",
",",
"instance",
",",
"update_mask",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.create_cluster | Creates a cluster within an instance.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableInstanceAdminClient()
>>>
>>> parent = client.instance_path('[PROJECT]', '[INSTANCE]')
>>>
... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def create_cluster(
self,
parent,
cluster_id,
cluster,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a cluster within an instance.
Example:
>>>... | def create_cluster(
self,
parent,
cluster_id,
cluster,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a cluster within an instance.
Example:
>>>... | [
"Creates",
"a",
"cluster",
"within",
"an",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L756-L857 | [
"def",
"create_cluster",
"(",
"self",
",",
"parent",
",",
"cluster_id",
",",
"cluster",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"m... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.update_cluster | Updates a cluster within an instance.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableInstanceAdminClient()
>>>
>>> name = client.cluster_path('[PROJECT]', '[INSTANCE]', '[CLUSTER]')
>>>
... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def update_cluster(
self,
name,
serve_nodes,
location=None,
state=None,
default_storage_type=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates a c... | def update_cluster(
self,
name,
serve_nodes,
location=None,
state=None,
default_storage_type=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates a c... | [
"Updates",
"a",
"cluster",
"within",
"an",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1006-L1111 | [
"def",
"update_cluster",
"(",
"self",
",",
"name",
",",
"serve_nodes",
",",
"location",
"=",
"None",
",",
"state",
"=",
"None",
",",
"default_storage_type",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.create_app_profile | Creates an app profile within an instance.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableInstanceAdminClient()
>>>
>>> parent = client.instance_path('[PROJECT]', '[INSTANCE]')
>>>
... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def create_app_profile(
self,
parent,
app_profile_id,
app_profile,
ignore_warnings=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates an app profile within... | def create_app_profile(
self,
parent,
app_profile_id,
app_profile,
ignore_warnings=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates an app profile within... | [
"Creates",
"an",
"app",
"profile",
"within",
"an",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1180-L1271 | [
"def",
"create_app_profile",
"(",
"self",
",",
"parent",
",",
"app_profile_id",
",",
"app_profile",
",",
"ignore_warnings",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"googl... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableInstanceAdminClient.update_app_profile | Updates an app profile within an instance.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableInstanceAdminClient()
>>>
>>> # TODO: Initialize `app_profile`:
>>> app_profile = {}
... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py | def update_app_profile(
self,
app_profile,
update_mask,
ignore_warnings=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates an app profile within an instance.
... | def update_app_profile(
self,
app_profile,
update_mask,
ignore_warnings=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates an app profile within an instance.
... | [
"Updates",
"an",
"app",
"profile",
"within",
"an",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1447-L1548 | [
"def",
"update_app_profile",
"(",
"self",
",",
"app_profile",
",",
"update_mask",
",",
"ignore_warnings",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.annotation_spec_set_path | Return a fully-qualified annotation_spec_set string. | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def annotation_spec_set_path(cls, project, annotation_spec_set):
"""Return a fully-qualified annotation_spec_set string."""
return google.api_core.path_template.expand(
"projects/{project}/annotationSpecSets/{annotation_spec_set}",
project=project,
annotation_spec_set... | def annotation_spec_set_path(cls, project, annotation_spec_set):
"""Return a fully-qualified annotation_spec_set string."""
return google.api_core.path_template.expand(
"projects/{project}/annotationSpecSets/{annotation_spec_set}",
project=project,
annotation_spec_set... | [
"Return",
"a",
"fully",
"-",
"qualified",
"annotation_spec_set",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L93-L99 | [
"def",
"annotation_spec_set_path",
"(",
"cls",
",",
"project",
",",
"annotation_spec_set",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/annotationSpecSets/{annotation_spec_set}\"",
",",
"project",
"=",
"p... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.dataset_path | Return a fully-qualified dataset string. | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def dataset_path(cls, project, dataset):
"""Return a fully-qualified dataset string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}", project=project, dataset=dataset
) | def dataset_path(cls, project, dataset):
"""Return a fully-qualified dataset string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}", project=project, dataset=dataset
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"dataset",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L102-L106 | [
"def",
"dataset_path",
"(",
"cls",
",",
"project",
",",
"dataset",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/datasets/{dataset}\"",
",",
"project",
"=",
"project",
",",
"dataset",
"=",
"dataset... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.annotated_dataset_path | Return a fully-qualified annotated_dataset string. | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def annotated_dataset_path(cls, project, dataset, annotated_dataset):
"""Return a fully-qualified annotated_dataset string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}",
project=project,
... | def annotated_dataset_path(cls, project, dataset, annotated_dataset):
"""Return a fully-qualified annotated_dataset string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}",
project=project,
... | [
"Return",
"a",
"fully",
"-",
"qualified",
"annotated_dataset",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L109-L116 | [
"def",
"annotated_dataset_path",
"(",
"cls",
",",
"project",
",",
"dataset",
",",
"annotated_dataset",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}\"",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.example_path | Return a fully-qualified example string. | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def example_path(cls, project, dataset, annotated_dataset, example):
"""Return a fully-qualified example string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}",
project=project,
... | def example_path(cls, project, dataset, annotated_dataset, example):
"""Return a fully-qualified example string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}",
project=project,
... | [
"Return",
"a",
"fully",
"-",
"qualified",
"example",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L119-L127 | [
"def",
"example_path",
"(",
"cls",
",",
"project",
",",
"dataset",
",",
"annotated_dataset",
",",
"example",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_da... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.data_item_path | Return a fully-qualified data_item string. | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def data_item_path(cls, project, dataset, data_item):
"""Return a fully-qualified data_item string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/dataItems/{data_item}",
project=project,
dataset=dataset,
data_item=d... | def data_item_path(cls, project, dataset, data_item):
"""Return a fully-qualified data_item string."""
return google.api_core.path_template.expand(
"projects/{project}/datasets/{dataset}/dataItems/{data_item}",
project=project,
dataset=dataset,
data_item=d... | [
"Return",
"a",
"fully",
"-",
"qualified",
"data_item",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L130-L137 | [
"def",
"data_item_path",
"(",
"cls",
",",
"project",
",",
"dataset",
",",
"data_item",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/datasets/{dataset}/dataItems/{data_item}\"",
",",
"project",
"=",
"p... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.instruction_path | Return a fully-qualified instruction string. | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def instruction_path(cls, project, instruction):
"""Return a fully-qualified instruction string."""
return google.api_core.path_template.expand(
"projects/{project}/instructions/{instruction}",
project=project,
instruction=instruction,
) | def instruction_path(cls, project, instruction):
"""Return a fully-qualified instruction string."""
return google.api_core.path_template.expand(
"projects/{project}/instructions/{instruction}",
project=project,
instruction=instruction,
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"instruction",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L140-L146 | [
"def",
"instruction_path",
"(",
"cls",
",",
"project",
",",
"instruction",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/instructions/{instruction}\"",
",",
"project",
"=",
"project",
",",
"instruction... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.export_data | Exports data and annotations from dataset.
Example:
>>> from google.cloud import datalabeling_v1beta1
>>>
>>> client = datalabeling_v1beta1.DataLabelingServiceClient()
>>>
>>> name = client.dataset_path('[PROJECT]', '[DATASET]')
>>>
... | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def export_data(
self,
name,
annotated_dataset,
output_config,
filter_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Exports data and annotations from dataset... | def export_data(
self,
name,
annotated_dataset,
output_config,
filter_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Exports data and annotations from dataset... | [
"Exports",
"data",
"and",
"annotations",
"from",
"dataset",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L667-L774 | [
"def",
"export_data",
"(",
"self",
",",
"name",
",",
"annotated_dataset",
",",
"output_config",
",",
"filter_",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.label_image | Starts a labeling task for image. The type of image labeling task is
configured by feature in the request.
Example:
>>> from google.cloud import datalabeling_v1beta1
>>> from google.cloud.datalabeling_v1beta1 import enums
>>>
>>> client = datalabeling_v1b... | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def label_image(
self,
parent,
basic_config,
feature,
image_classification_config=None,
bounding_poly_config=None,
polyline_config=None,
segmentation_config=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_... | def label_image(
self,
parent,
basic_config,
feature,
image_classification_config=None,
bounding_poly_config=None,
polyline_config=None,
segmentation_config=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_... | [
"Starts",
"a",
"labeling",
"task",
"for",
"image",
".",
"The",
"type",
"of",
"image",
"labeling",
"task",
"is",
"configured",
"by",
"feature",
"in",
"the",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1131-L1274 | [
"def",
"label_image",
"(",
"self",
",",
"parent",
",",
"basic_config",
",",
"feature",
",",
"image_classification_config",
"=",
"None",
",",
"bounding_poly_config",
"=",
"None",
",",
"polyline_config",
"=",
"None",
",",
"segmentation_config",
"=",
"None",
",",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.label_video | Starts a labeling task for video. The type of video labeling task is
configured by feature in the request.
Example:
>>> from google.cloud import datalabeling_v1beta1
>>> from google.cloud.datalabeling_v1beta1 import enums
>>>
>>> client = datalabeling_v1b... | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def label_video(
self,
parent,
basic_config,
feature,
video_classification_config=None,
object_detection_config=None,
object_tracking_config=None,
event_config=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gap... | def label_video(
self,
parent,
basic_config,
feature,
video_classification_config=None,
object_detection_config=None,
object_tracking_config=None,
event_config=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gap... | [
"Starts",
"a",
"labeling",
"task",
"for",
"video",
".",
"The",
"type",
"of",
"video",
"labeling",
"task",
"is",
"configured",
"by",
"feature",
"in",
"the",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1276-L1419 | [
"def",
"label_video",
"(",
"self",
",",
"parent",
",",
"basic_config",
",",
"feature",
",",
"video_classification_config",
"=",
"None",
",",
"object_detection_config",
"=",
"None",
",",
"object_tracking_config",
"=",
"None",
",",
"event_config",
"=",
"None",
",",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.label_text | Starts a labeling task for text. The type of text labeling task is
configured by feature in the request.
Example:
>>> from google.cloud import datalabeling_v1beta1
>>> from google.cloud.datalabeling_v1beta1 import enums
>>>
>>> client = datalabeling_v1bet... | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def label_text(
self,
parent,
basic_config,
feature,
text_classification_config=None,
text_entity_extraction_config=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
... | def label_text(
self,
parent,
basic_config,
feature,
text_classification_config=None,
text_entity_extraction_config=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
... | [
"Starts",
"a",
"labeling",
"task",
"for",
"text",
".",
"The",
"type",
"of",
"text",
"labeling",
"task",
"is",
"configured",
"by",
"feature",
"in",
"the",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1421-L1546 | [
"def",
"label_text",
"(",
"self",
",",
"parent",
",",
"basic_config",
",",
"feature",
",",
"text_classification_config",
"=",
"None",
",",
"text_entity_extraction_config",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DataLabelingServiceClient.create_instruction | Creates an instruction for how data should be labeled.
Example:
>>> from google.cloud import datalabeling_v1beta1
>>>
>>> client = datalabeling_v1beta1.DataLabelingServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>>
... | datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py | def create_instruction(
self,
parent,
instruction,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates an instruction for how data should be labeled.
Example:
... | def create_instruction(
self,
parent,
instruction,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates an instruction for how data should be labeled.
Example:
... | [
"Creates",
"an",
"instruction",
"for",
"how",
"data",
"should",
"be",
"labeled",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L2157-L2249 | [
"def",
"create_instruction",
"(",
"self",
",",
"parent",
",",
"instruction",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Variable.from_api_repr | Factory: construct a Variable given its API representation
:type resource: dict
:param resource: change set representation returned from the API.
:type config: :class:`google.cloud.runtimeconfig.config.Config`
:param config: The config to which this variable belongs.
:rtype: ... | runtimeconfig/google/cloud/runtimeconfig/variable.py | def from_api_repr(cls, resource, config):
"""Factory: construct a Variable given its API representation
:type resource: dict
:param resource: change set representation returned from the API.
:type config: :class:`google.cloud.runtimeconfig.config.Config`
:param config: The con... | def from_api_repr(cls, resource, config):
"""Factory: construct a Variable given its API representation
:type resource: dict
:param resource: change set representation returned from the API.
:type config: :class:`google.cloud.runtimeconfig.config.Config`
:param config: The con... | [
"Factory",
":",
"construct",
"a",
"Variable",
"given",
"its",
"API",
"representation"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L73-L88 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"config",
")",
":",
"name",
"=",
"variable_name_from_full_name",
"(",
"resource",
".",
"get",
"(",
"\"name\"",
")",
")",
"variable",
"=",
"cls",
"(",
"name",
"=",
"name",
",",
"config",
"=",
"conf... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Variable.full_name | Fully-qualified name of this variable.
Example:
``projects/my-project/configs/my-config/variables/my-var``
:rtype: str
:returns: The full name based on config and variable names.
:raises: :class:`ValueError` if the variable is missing a name. | runtimeconfig/google/cloud/runtimeconfig/variable.py | def full_name(self):
"""Fully-qualified name of this variable.
Example:
``projects/my-project/configs/my-config/variables/my-var``
:rtype: str
:returns: The full name based on config and variable names.
:raises: :class:`ValueError` if the variable is missing a name.
... | def full_name(self):
"""Fully-qualified name of this variable.
Example:
``projects/my-project/configs/my-config/variables/my-var``
:rtype: str
:returns: The full name based on config and variable names.
:raises: :class:`ValueError` if the variable is missing a name.
... | [
"Fully",
"-",
"qualified",
"name",
"of",
"this",
"variable",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L91-L104 | [
"def",
"full_name",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"name",
":",
"raise",
"ValueError",
"(",
"\"Missing variable name.\"",
")",
"return",
"\"%s/variables/%s\"",
"%",
"(",
"self",
".",
"config",
".",
"full_name",
",",
"self",
".",
"name",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Variable.value | Value of the variable, as bytes.
See
https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables
:rtype: bytes or ``NoneType``
:returns: The value of the variable or ``None`` if the property
is not set locally. | runtimeconfig/google/cloud/runtimeconfig/variable.py | def value(self):
"""Value of the variable, as bytes.
See
https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables
:rtype: bytes or ``NoneType``
:returns: The value of the variable or ``None`` if the property
... | def value(self):
"""Value of the variable, as bytes.
See
https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables
:rtype: bytes or ``NoneType``
:returns: The value of the variable or ``None`` if the property
... | [
"Value",
"of",
"the",
"variable",
"as",
"bytes",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L121-L134 | [
"def",
"value",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"value\"",
")",
"if",
"value",
"is",
"not",
"None",
":",
"value",
"=",
"base64",
".",
"b64decode",
"(",
"value",
")",
"return",
"value"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Variable.update_time | Retrieve the timestamp at which the variable was updated.
See
https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables
Returns:
:class:`~api_core.datetime_helpers.DatetimeWithNanoseconds`,
:class:`datetime.dateti... | runtimeconfig/google/cloud/runtimeconfig/variable.py | def update_time(self):
"""Retrieve the timestamp at which the variable was updated.
See
https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables
Returns:
:class:`~api_core.datetime_helpers.DatetimeWithNanoseconds`,
... | def update_time(self):
"""Retrieve the timestamp at which the variable was updated.
See
https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables
Returns:
:class:`~api_core.datetime_helpers.DatetimeWithNanoseconds`,
... | [
"Retrieve",
"the",
"timestamp",
"at",
"which",
"the",
"variable",
"was",
"updated",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L151-L178 | [
"def",
"update_time",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"updateTime\"",
")",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"value"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Variable._set_properties | Update properties from resource in body of ``api_response``
:type resource: dict
:param resource: variable representation returned from the API. | runtimeconfig/google/cloud/runtimeconfig/variable.py | def _set_properties(self, resource):
"""Update properties from resource in body of ``api_response``
:type resource: dict
:param resource: variable representation returned from the API.
"""
self._properties.clear()
cleaned = resource.copy()
if "name" in cleaned:
... | def _set_properties(self, resource):
"""Update properties from resource in body of ``api_response``
:type resource: dict
:param resource: variable representation returned from the API.
"""
self._properties.clear()
cleaned = resource.copy()
if "name" in cleaned:
... | [
"Update",
"properties",
"from",
"resource",
"in",
"body",
"of",
"api_response"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L195-L205 | [
"def",
"_set_properties",
"(",
"self",
",",
"resource",
")",
":",
"self",
".",
"_properties",
".",
"clear",
"(",
")",
"cleaned",
"=",
"resource",
".",
"copy",
"(",
")",
"if",
"\"name\"",
"in",
"cleaned",
":",
"self",
".",
"name",
"=",
"variable_name_from... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | from_any_pb | Converts an ``Any`` protobuf to the specified message type.
Args:
pb_type (type): the type of the message that any_pb stores an instance
of.
any_pb (google.protobuf.any_pb2.Any): the object to be converted.
Returns:
pb_type: An instance of the pb_type message.
Raises:
... | api_core/google/api_core/protobuf_helpers.py | def from_any_pb(pb_type, any_pb):
"""Converts an ``Any`` protobuf to the specified message type.
Args:
pb_type (type): the type of the message that any_pb stores an instance
of.
any_pb (google.protobuf.any_pb2.Any): the object to be converted.
Returns:
pb_type: An insta... | def from_any_pb(pb_type, any_pb):
"""Converts an ``Any`` protobuf to the specified message type.
Args:
pb_type (type): the type of the message that any_pb stores an instance
of.
any_pb (google.protobuf.any_pb2.Any): the object to be converted.
Returns:
pb_type: An insta... | [
"Converts",
"an",
"Any",
"protobuf",
"to",
"the",
"specified",
"message",
"type",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L43-L74 | [
"def",
"from_any_pb",
"(",
"pb_type",
",",
"any_pb",
")",
":",
"msg",
"=",
"pb_type",
"(",
")",
"# Unwrap proto-plus wrapped messages.",
"if",
"callable",
"(",
"getattr",
"(",
"pb_type",
",",
"\"pb\"",
",",
"None",
")",
")",
":",
"msg_pb",
"=",
"pb_type",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | get_messages | Discovers all protobuf Message classes in a given import module.
Args:
module (module): A Python module; :func:`dir` will be run against this
module to find Message subclasses.
Returns:
dict[str, google.protobuf.message.Message]: A dictionary with the
Message class name... | api_core/google/api_core/protobuf_helpers.py | def get_messages(module):
"""Discovers all protobuf Message classes in a given import module.
Args:
module (module): A Python module; :func:`dir` will be run against this
module to find Message subclasses.
Returns:
dict[str, google.protobuf.message.Message]: A dictionary with t... | def get_messages(module):
"""Discovers all protobuf Message classes in a given import module.
Args:
module (module): A Python module; :func:`dir` will be run against this
module to find Message subclasses.
Returns:
dict[str, google.protobuf.message.Message]: A dictionary with t... | [
"Discovers",
"all",
"protobuf",
"Message",
"classes",
"in",
"a",
"given",
"import",
"module",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L99-L116 | [
"def",
"get_messages",
"(",
"module",
")",
":",
"answer",
"=",
"collections",
".",
"OrderedDict",
"(",
")",
"for",
"name",
"in",
"dir",
"(",
"module",
")",
":",
"candidate",
"=",
"getattr",
"(",
"module",
",",
"name",
")",
"if",
"inspect",
".",
"isclas... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _resolve_subkeys | Resolve a potentially nested key.
If the key contains the ``separator`` (e.g. ``.``) then the key will be
split on the first instance of the subkey::
>>> _resolve_subkeys('a.b.c')
('a', 'b.c')
>>> _resolve_subkeys('d|e|f', separator='|')
('d', 'e|f')
If not, the subkey will be... | api_core/google/api_core/protobuf_helpers.py | def _resolve_subkeys(key, separator="."):
"""Resolve a potentially nested key.
If the key contains the ``separator`` (e.g. ``.``) then the key will be
split on the first instance of the subkey::
>>> _resolve_subkeys('a.b.c')
('a', 'b.c')
>>> _resolve_subkeys('d|e|f', separator='|')
... | def _resolve_subkeys(key, separator="."):
"""Resolve a potentially nested key.
If the key contains the ``separator`` (e.g. ``.``) then the key will be
split on the first instance of the subkey::
>>> _resolve_subkeys('a.b.c')
('a', 'b.c')
>>> _resolve_subkeys('d|e|f', separator='|')
... | [
"Resolve",
"a",
"potentially",
"nested",
"key",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L119-L147 | [
"def",
"_resolve_subkeys",
"(",
"key",
",",
"separator",
"=",
"\".\"",
")",
":",
"parts",
"=",
"key",
".",
"split",
"(",
"separator",
",",
"1",
")",
"if",
"len",
"(",
"parts",
")",
">",
"1",
":",
"return",
"parts",
"else",
":",
"return",
"parts",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | get | Retrieve a key's value from a protobuf Message or dictionary.
Args:
mdg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the
object.
key (str): The key to retrieve from the object.
default (Any): If the key is not present on the object, and a default
is se... | api_core/google/api_core/protobuf_helpers.py | def get(msg_or_dict, key, default=_SENTINEL):
"""Retrieve a key's value from a protobuf Message or dictionary.
Args:
mdg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the
object.
key (str): The key to retrieve from the object.
default (Any): If the key is not p... | def get(msg_or_dict, key, default=_SENTINEL):
"""Retrieve a key's value from a protobuf Message or dictionary.
Args:
mdg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the
object.
key (str): The key to retrieve from the object.
default (Any): If the key is not p... | [
"Retrieve",
"a",
"key",
"s",
"value",
"from",
"a",
"protobuf",
"Message",
"or",
"dictionary",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L150-L198 | [
"def",
"get",
"(",
"msg_or_dict",
",",
"key",
",",
"default",
"=",
"_SENTINEL",
")",
":",
"# We may need to get a nested key. Resolve this.",
"key",
",",
"subkey",
"=",
"_resolve_subkeys",
"(",
"key",
")",
"# Attempt to get the value from the two types of objects we know ab... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _set_field_on_message | Set helper for protobuf Messages. | api_core/google/api_core/protobuf_helpers.py | def _set_field_on_message(msg, key, value):
"""Set helper for protobuf Messages."""
# Attempt to set the value on the types of objects we know how to deal
# with.
if isinstance(value, (collections_abc.MutableSequence, tuple)):
# Clear the existing repeated protobuf message of any elements
... | def _set_field_on_message(msg, key, value):
"""Set helper for protobuf Messages."""
# Attempt to set the value on the types of objects we know how to deal
# with.
if isinstance(value, (collections_abc.MutableSequence, tuple)):
# Clear the existing repeated protobuf message of any elements
... | [
"Set",
"helper",
"for",
"protobuf",
"Messages",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L201-L226 | [
"def",
"_set_field_on_message",
"(",
"msg",
",",
"key",
",",
"value",
")",
":",
"# Attempt to set the value on the types of objects we know how to deal",
"# with.",
"if",
"isinstance",
"(",
"value",
",",
"(",
"collections_abc",
".",
"MutableSequence",
",",
"tuple",
")",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | set | Set a key's value on a protobuf Message or dictionary.
Args:
msg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the
object.
key (str): The key to set.
value (Any): The value to set.
Raises:
TypeError: If ``msg_or_dict`` is not a Message or dictionary. | api_core/google/api_core/protobuf_helpers.py | def set(msg_or_dict, key, value):
"""Set a key's value on a protobuf Message or dictionary.
Args:
msg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the
object.
key (str): The key to set.
value (Any): The value to set.
Raises:
TypeError: If ``msg_or... | def set(msg_or_dict, key, value):
"""Set a key's value on a protobuf Message or dictionary.
Args:
msg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the
object.
key (str): The key to set.
value (Any): The value to set.
Raises:
TypeError: If ``msg_or... | [
"Set",
"a",
"key",
"s",
"value",
"on",
"a",
"protobuf",
"Message",
"or",
"dictionary",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L229-L263 | [
"def",
"set",
"(",
"msg_or_dict",
",",
"key",
",",
"value",
")",
":",
"# Sanity check: Is our target object valid?",
"if",
"not",
"isinstance",
"(",
"msg_or_dict",
",",
"(",
"collections_abc",
".",
"MutableMapping",
",",
"message",
".",
"Message",
")",
")",
":",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | setdefault | Set the key on a protobuf Message or dictionary to a given value if the
current value is falsy.
Because protobuf Messages do not distinguish between unset values and
falsy ones particularly well (by design), this method treats any falsy
value (e.g. 0, empty list) as a target to be overwritten, on both ... | api_core/google/api_core/protobuf_helpers.py | def setdefault(msg_or_dict, key, value):
"""Set the key on a protobuf Message or dictionary to a given value if the
current value is falsy.
Because protobuf Messages do not distinguish between unset values and
falsy ones particularly well (by design), this method treats any falsy
value (e.g. 0, emp... | def setdefault(msg_or_dict, key, value):
"""Set the key on a protobuf Message or dictionary to a given value if the
current value is falsy.
Because protobuf Messages do not distinguish between unset values and
falsy ones particularly well (by design), this method treats any falsy
value (e.g. 0, emp... | [
"Set",
"the",
"key",
"on",
"a",
"protobuf",
"Message",
"or",
"dictionary",
"to",
"a",
"given",
"value",
"if",
"the",
"current",
"value",
"is",
"falsy",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L266-L285 | [
"def",
"setdefault",
"(",
"msg_or_dict",
",",
"key",
",",
"value",
")",
":",
"if",
"not",
"get",
"(",
"msg_or_dict",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"set",
"(",
"msg_or_dict",
",",
"key",
",",
"value",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | field_mask | Create a field mask by comparing two messages.
Args:
original (~google.protobuf.message.Message): the original message.
If set to None, this field will be interpretted as an empty
message.
modified (~google.protobuf.message.Message): the modified message.
If set ... | api_core/google/api_core/protobuf_helpers.py | def field_mask(original, modified):
"""Create a field mask by comparing two messages.
Args:
original (~google.protobuf.message.Message): the original message.
If set to None, this field will be interpretted as an empty
message.
modified (~google.protobuf.message.Message)... | def field_mask(original, modified):
"""Create a field mask by comparing two messages.
Args:
original (~google.protobuf.message.Message): the original message.
If set to None, this field will be interpretted as an empty
message.
modified (~google.protobuf.message.Message)... | [
"Create",
"a",
"field",
"mask",
"by",
"comparing",
"two",
"messages",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L288-L326 | [
"def",
"field_mask",
"(",
"original",
",",
"modified",
")",
":",
"if",
"original",
"is",
"None",
"and",
"modified",
"is",
"None",
":",
"return",
"field_mask_pb2",
".",
"FieldMask",
"(",
")",
"if",
"original",
"is",
"None",
"and",
"modified",
"is",
"not",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SubscriberClient.topic_path | Return a fully-qualified topic string. | pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py | def topic_path(cls, project, topic):
"""Return a fully-qualified topic string."""
return google.api_core.path_template.expand(
"projects/{project}/topics/{topic}", project=project, topic=topic
) | def topic_path(cls, project, topic):
"""Return a fully-qualified topic string."""
return google.api_core.path_template.expand(
"projects/{project}/topics/{topic}", project=project, topic=topic
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"topic",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L98-L102 | [
"def",
"topic_path",
"(",
"cls",
",",
"project",
",",
"topic",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/topics/{topic}\"",
",",
"project",
"=",
"project",
",",
"topic",
"=",
"topic",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SubscriberClient.snapshot_path | Return a fully-qualified snapshot string. | pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py | def snapshot_path(cls, project, snapshot):
"""Return a fully-qualified snapshot string."""
return google.api_core.path_template.expand(
"projects/{project}/snapshots/{snapshot}",
project=project,
snapshot=snapshot,
) | def snapshot_path(cls, project, snapshot):
"""Return a fully-qualified snapshot string."""
return google.api_core.path_template.expand(
"projects/{project}/snapshots/{snapshot}",
project=project,
snapshot=snapshot,
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"snapshot",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L112-L118 | [
"def",
"snapshot_path",
"(",
"cls",
",",
"project",
",",
"snapshot",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/snapshots/{snapshot}\"",
",",
"project",
"=",
"project",
",",
"snapshot",
"=",
"sn... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SubscriberClient.create_subscription | Creates a subscription to a given topic. See the resource name rules. If
the subscription already exists, returns ``ALREADY_EXISTS``. If the
corresponding topic doesn't exist, returns ``NOT_FOUND``.
If the name is not provided in the request, the server will assign a
random name for thi... | pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py | def create_subscription(
self,
name,
topic,
push_config=None,
ack_deadline_seconds=None,
retain_acked_messages=None,
message_retention_duration=None,
labels=None,
enable_message_ordering=None,
expiration_policy=None,
retry=google.ap... | def create_subscription(
self,
name,
topic,
push_config=None,
ack_deadline_seconds=None,
retain_acked_messages=None,
message_retention_duration=None,
labels=None,
enable_message_ordering=None,
expiration_policy=None,
retry=google.ap... | [
"Creates",
"a",
"subscription",
"to",
"a",
"given",
"topic",
".",
"See",
"the",
"resource",
"name",
"rules",
".",
"If",
"the",
"subscription",
"already",
"exists",
"returns",
"ALREADY_EXISTS",
".",
"If",
"the",
"corresponding",
"topic",
"doesn",
"t",
"exist",
... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L219-L389 | [
"def",
"create_subscription",
"(",
"self",
",",
"name",
",",
"topic",
",",
"push_config",
"=",
"None",
",",
"ack_deadline_seconds",
"=",
"None",
",",
"retain_acked_messages",
"=",
"None",
",",
"message_retention_duration",
"=",
"None",
",",
"labels",
"=",
"None"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SubscriberClient.seek | Seeks an existing subscription to a point in time or to a given snapshot,
whichever is provided in the request. Snapshots are used in
<a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
operations, which allow
you to manage message acknowledgments in bulk. That is, yo... | pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py | def seek(
self,
subscription,
time=None,
snapshot=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Seeks an existing subscription to a point in time or to a given snapsh... | def seek(
self,
subscription,
time=None,
snapshot=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Seeks an existing subscription to a point in time or to a given snapsh... | [
"Seeks",
"an",
"existing",
"subscription",
"to",
"a",
"point",
"in",
"time",
"or",
"to",
"a",
"given",
"snapshot",
"whichever",
"is",
"provided",
"in",
"the",
"request",
".",
"Snapshots",
"are",
"used",
"in",
"<a",
"href",
"=",
"https",
":",
"//",
"cloud... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L1527-L1626 | [
"def",
"seek",
"(",
"self",
",",
"subscription",
",",
"time",
"=",
"None",
",",
"snapshot",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CompletionClient.complete_query | Completes the specified prefix with keyword suggestions.
Intended for use by a job search auto-complete search box.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.CompletionClient()
>>>
>>> name = client.p... | talent/google/cloud/talent_v4beta1/gapic/completion_client.py | def complete_query(
self,
name,
query,
page_size,
language_codes=None,
company_name=None,
scope=None,
type_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
... | def complete_query(
self,
name,
query,
page_size,
language_codes=None,
company_name=None,
scope=None,
type_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
... | [
"Completes",
"the",
"specified",
"prefix",
"with",
"keyword",
"suggestions",
".",
"Intended",
"for",
"use",
"by",
"a",
"job",
"search",
"auto",
"-",
"complete",
"search",
"box",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/completion_client.py#L179-L298 | [
"def",
"complete_query",
"(",
"self",
",",
"name",
",",
"query",
",",
"page_size",
",",
"language_codes",
"=",
"None",
",",
"company_name",
"=",
"None",
",",
"scope",
"=",
"None",
",",
"type_",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | AbstractSessionPool._new_session | Helper for concrete methods creating session instances.
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: new session instance. | spanner/google/cloud/spanner_v1/pool.py | def _new_session(self):
"""Helper for concrete methods creating session instances.
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: new session instance.
"""
if self.labels:
return self._database.session(labels=self.labels)
return self._dat... | def _new_session(self):
"""Helper for concrete methods creating session instances.
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: new session instance.
"""
if self.labels:
return self._database.session(labels=self.labels)
return self._dat... | [
"Helper",
"for",
"concrete",
"methods",
"creating",
"session",
"instances",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L102-L110 | [
"def",
"_new_session",
"(",
"self",
")",
":",
"if",
"self",
".",
"labels",
":",
"return",
"self",
".",
"_database",
".",
"session",
"(",
"labels",
"=",
"self",
".",
"labels",
")",
"return",
"self",
".",
"_database",
".",
"session",
"(",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | FixedSizePool.bind | Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed. | spanner/google/cloud/spanner_v1/pool.py | def bind(self, database):
"""Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed.
"""
self._database = database
... | def bind(self, database):
"""Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed.
"""
self._database = database
... | [
"Associate",
"the",
"pool",
"with",
"a",
"database",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L162-L174 | [
"def",
"bind",
"(",
"self",
",",
"database",
")",
":",
"self",
".",
"_database",
"=",
"database",
"while",
"not",
"self",
".",
"_sessions",
".",
"full",
"(",
")",
":",
"session",
"=",
"self",
".",
"_new_session",
"(",
")",
"session",
".",
"create",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | FixedSizePool.get | Check a session out from the pool.
:type timeout: int
:param timeout: seconds to block waiting for an available session
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session from the pool, or a newly-created
session.
:raises: ... | spanner/google/cloud/spanner_v1/pool.py | def get(self, timeout=None): # pylint: disable=arguments-differ
"""Check a session out from the pool.
:type timeout: int
:param timeout: seconds to block waiting for an available session
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session fr... | def get(self, timeout=None): # pylint: disable=arguments-differ
"""Check a session out from the pool.
:type timeout: int
:param timeout: seconds to block waiting for an available session
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session fr... | [
"Check",
"a",
"session",
"out",
"from",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L176-L196 | [
"def",
"get",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"# pylint: disable=arguments-differ",
"if",
"timeout",
"is",
"None",
":",
"timeout",
"=",
"self",
".",
"default_timeout",
"session",
"=",
"self",
".",
"_sessions",
".",
"get",
"(",
"block",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | FixedSizePool.clear | Delete all sessions in the pool. | spanner/google/cloud/spanner_v1/pool.py | def clear(self):
"""Delete all sessions in the pool."""
while True:
try:
session = self._sessions.get(block=False)
except queue.Empty:
break
else:
session.delete() | def clear(self):
"""Delete all sessions in the pool."""
while True:
try:
session = self._sessions.get(block=False)
except queue.Empty:
break
else:
session.delete() | [
"Delete",
"all",
"sessions",
"in",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L210-L219 | [
"def",
"clear",
"(",
"self",
")",
":",
"while",
"True",
":",
"try",
":",
"session",
"=",
"self",
".",
"_sessions",
".",
"get",
"(",
"block",
"=",
"False",
")",
"except",
"queue",
".",
"Empty",
":",
"break",
"else",
":",
"session",
".",
"delete",
"(... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BurstyPool.get | Check a session out from the pool.
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session from the pool, or a newly-created
session. | spanner/google/cloud/spanner_v1/pool.py | def get(self):
"""Check a session out from the pool.
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session from the pool, or a newly-created
session.
"""
try:
session = self._sessions.get_nowait()
except que... | def get(self):
"""Check a session out from the pool.
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session from the pool, or a newly-created
session.
"""
try:
session = self._sessions.get_nowait()
except que... | [
"Check",
"a",
"session",
"out",
"from",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L257-L273 | [
"def",
"get",
"(",
"self",
")",
":",
"try",
":",
"session",
"=",
"self",
".",
"_sessions",
".",
"get_nowait",
"(",
")",
"except",
"queue",
".",
"Empty",
":",
"session",
"=",
"self",
".",
"_new_session",
"(",
")",
"session",
".",
"create",
"(",
")",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BurstyPool.put | Return a session to the pool.
Never blocks: if the pool is full, the returned session is
discarded.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned. | spanner/google/cloud/spanner_v1/pool.py | def put(self, session):
"""Return a session to the pool.
Never blocks: if the pool is full, the returned session is
discarded.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
"""
try:
self... | def put(self, session):
"""Return a session to the pool.
Never blocks: if the pool is full, the returned session is
discarded.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
"""
try:
self... | [
"Return",
"a",
"session",
"to",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L275-L290 | [
"def",
"put",
"(",
"self",
",",
"session",
")",
":",
"try",
":",
"self",
".",
"_sessions",
".",
"put_nowait",
"(",
"session",
")",
"except",
"queue",
".",
"Full",
":",
"try",
":",
"session",
".",
"delete",
"(",
")",
"except",
"NotFound",
":",
"pass"
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PingingPool.bind | Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed. | spanner/google/cloud/spanner_v1/pool.py | def bind(self, database):
"""Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed.
"""
self._database = database
... | def bind(self, database):
"""Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed.
"""
self._database = database
... | [
"Associate",
"the",
"pool",
"with",
"a",
"database",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L346-L358 | [
"def",
"bind",
"(",
"self",
",",
"database",
")",
":",
"self",
".",
"_database",
"=",
"database",
"for",
"_",
"in",
"xrange",
"(",
"self",
".",
"size",
")",
":",
"session",
"=",
"self",
".",
"_new_session",
"(",
")",
"session",
".",
"create",
"(",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PingingPool.get | Check a session out from the pool.
:type timeout: int
:param timeout: seconds to block waiting for an available session
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session from the pool, or a newly-created
session.
:raises: ... | spanner/google/cloud/spanner_v1/pool.py | def get(self, timeout=None): # pylint: disable=arguments-differ
"""Check a session out from the pool.
:type timeout: int
:param timeout: seconds to block waiting for an available session
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session fr... | def get(self, timeout=None): # pylint: disable=arguments-differ
"""Check a session out from the pool.
:type timeout: int
:param timeout: seconds to block waiting for an available session
:rtype: :class:`~google.cloud.spanner_v1.session.Session`
:returns: an existing session fr... | [
"Check",
"a",
"session",
"out",
"from",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L360-L381 | [
"def",
"get",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"# pylint: disable=arguments-differ",
"if",
"timeout",
"is",
"None",
":",
"timeout",
"=",
"self",
".",
"default_timeout",
"ping_after",
",",
"session",
"=",
"self",
".",
"_sessions",
".",
"get... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PingingPool.put | Return a session to the pool.
Never blocks: if the pool is full, raises.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
:raises: :exc:`six.moves.queue.Full` if the queue is full. | spanner/google/cloud/spanner_v1/pool.py | def put(self, session):
"""Return a session to the pool.
Never blocks: if the pool is full, raises.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
:raises: :exc:`six.moves.queue.Full` if the queue is full.
... | def put(self, session):
"""Return a session to the pool.
Never blocks: if the pool is full, raises.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
:raises: :exc:`six.moves.queue.Full` if the queue is full.
... | [
"Return",
"a",
"session",
"to",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L383-L393 | [
"def",
"put",
"(",
"self",
",",
"session",
")",
":",
"self",
".",
"_sessions",
".",
"put_nowait",
"(",
"(",
"_NOW",
"(",
")",
"+",
"self",
".",
"_delta",
",",
"session",
")",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PingingPool.ping | Refresh maybe-expired sessions in the pool.
This method is designed to be called from a background thread,
or during the "idle" phase of an event loop. | spanner/google/cloud/spanner_v1/pool.py | def ping(self):
"""Refresh maybe-expired sessions in the pool.
This method is designed to be called from a background thread,
or during the "idle" phase of an event loop.
"""
while True:
try:
ping_after, session = self._sessions.get(block=False)
... | def ping(self):
"""Refresh maybe-expired sessions in the pool.
This method is designed to be called from a background thread,
or during the "idle" phase of an event loop.
"""
while True:
try:
ping_after, session = self._sessions.get(block=False)
... | [
"Refresh",
"maybe",
"-",
"expired",
"sessions",
"in",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L405-L424 | [
"def",
"ping",
"(",
"self",
")",
":",
"while",
"True",
":",
"try",
":",
"ping_after",
",",
"session",
"=",
"self",
".",
"_sessions",
".",
"get",
"(",
"block",
"=",
"False",
")",
"except",
"queue",
".",
"Empty",
":",
"# all sessions in use",
"break",
"i... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TransactionPingingPool.bind | Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed. | spanner/google/cloud/spanner_v1/pool.py | def bind(self, database):
"""Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed.
"""
super(TransactionPingingPool, self)... | def bind(self, database):
"""Associate the pool with a database.
:type database: :class:`~google.cloud.spanner_v1.database.Database`
:param database: database used by the pool: used to create sessions
when needed.
"""
super(TransactionPingingPool, self)... | [
"Associate",
"the",
"pool",
"with",
"a",
"database",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L463-L471 | [
"def",
"bind",
"(",
"self",
",",
"database",
")",
":",
"super",
"(",
"TransactionPingingPool",
",",
"self",
")",
".",
"bind",
"(",
"database",
")",
"self",
".",
"begin_pending_transactions",
"(",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TransactionPingingPool.put | Return a session to the pool.
Never blocks: if the pool is full, raises.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
:raises: :exc:`six.moves.queue.Full` if the queue is full. | spanner/google/cloud/spanner_v1/pool.py | def put(self, session):
"""Return a session to the pool.
Never blocks: if the pool is full, raises.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
:raises: :exc:`six.moves.queue.Full` if the queue is full.
... | def put(self, session):
"""Return a session to the pool.
Never blocks: if the pool is full, raises.
:type session: :class:`~google.cloud.spanner_v1.session.Session`
:param session: the session being returned.
:raises: :exc:`six.moves.queue.Full` if the queue is full.
... | [
"Return",
"a",
"session",
"to",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L473-L491 | [
"def",
"put",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_sessions",
".",
"full",
"(",
")",
":",
"raise",
"queue",
".",
"Full",
"txn",
"=",
"session",
".",
"_transaction",
"if",
"txn",
"is",
"None",
"or",
"txn",
".",
"committed",
"(... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TransactionPingingPool.begin_pending_transactions | Begin all transactions for sessions added to the pool. | spanner/google/cloud/spanner_v1/pool.py | def begin_pending_transactions(self):
"""Begin all transactions for sessions added to the pool."""
while not self._pending_sessions.empty():
session = self._pending_sessions.get()
session._transaction.begin()
super(TransactionPingingPool, self).put(session) | def begin_pending_transactions(self):
"""Begin all transactions for sessions added to the pool."""
while not self._pending_sessions.empty():
session = self._pending_sessions.get()
session._transaction.begin()
super(TransactionPingingPool, self).put(session) | [
"Begin",
"all",
"transactions",
"for",
"sessions",
"added",
"to",
"the",
"pool",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L493-L498 | [
"def",
"begin_pending_transactions",
"(",
"self",
")",
":",
"while",
"not",
"self",
".",
"_pending_sessions",
".",
"empty",
"(",
")",
":",
"session",
"=",
"self",
".",
"_pending_sessions",
".",
"get",
"(",
")",
"session",
".",
"_transaction",
".",
"begin",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | setup_logging | Attach a logging handler to the Python root logger
Excludes loggers that this library itself uses to avoid
infinite recursion.
:type handler: :class:`logging.handler`
:param handler: the handler to attach to the global handler
:type excluded_loggers: tuple
:param excluded_loggers: (Optional) ... | logging/google/cloud/logging/handlers/handlers.py | def setup_logging(
handler, excluded_loggers=EXCLUDED_LOGGER_DEFAULTS, log_level=logging.INFO
):
"""Attach a logging handler to the Python root logger
Excludes loggers that this library itself uses to avoid
infinite recursion.
:type handler: :class:`logging.handler`
:param handler: the handler... | def setup_logging(
handler, excluded_loggers=EXCLUDED_LOGGER_DEFAULTS, log_level=logging.INFO
):
"""Attach a logging handler to the Python root logger
Excludes loggers that this library itself uses to avoid
infinite recursion.
:type handler: :class:`logging.handler`
:param handler: the handler... | [
"Attach",
"a",
"logging",
"handler",
"to",
"the",
"Python",
"root",
"logger"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/handlers.py#L112-L156 | [
"def",
"setup_logging",
"(",
"handler",
",",
"excluded_loggers",
"=",
"EXCLUDED_LOGGER_DEFAULTS",
",",
"log_level",
"=",
"logging",
".",
"INFO",
")",
":",
"all_excluded_loggers",
"=",
"set",
"(",
"excluded_loggers",
"+",
"EXCLUDED_LOGGER_DEFAULTS",
")",
"logger",
"=... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudLoggingHandler.emit | Actually log the specified logging record.
Overrides the default emit behavior of ``StreamHandler``.
See https://docs.python.org/2/library/logging.html#handler-objects
:type record: :class:`logging.LogRecord`
:param record: The record to be logged. | logging/google/cloud/logging/handlers/handlers.py | def emit(self, record):
"""Actually log the specified logging record.
Overrides the default emit behavior of ``StreamHandler``.
See https://docs.python.org/2/library/logging.html#handler-objects
:type record: :class:`logging.LogRecord`
:param record: The record to be logged.
... | def emit(self, record):
"""Actually log the specified logging record.
Overrides the default emit behavior of ``StreamHandler``.
See https://docs.python.org/2/library/logging.html#handler-objects
:type record: :class:`logging.LogRecord`
:param record: The record to be logged.
... | [
"Actually",
"log",
"the",
"specified",
"logging",
"record",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/handlers.py#L98-L109 | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"message",
"=",
"super",
"(",
"CloudLoggingHandler",
",",
"self",
")",
".",
"format",
"(",
"record",
")",
"self",
".",
"transport",
".",
"send",
"(",
"record",
",",
"message",
",",
"resource",
"=",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _query_param_from_api_repr | Helper: construct concrete query parameter from JSON resource. | bigquery/google/cloud/bigquery/query.py | def _query_param_from_api_repr(resource):
"""Helper: construct concrete query parameter from JSON resource."""
qp_type = resource["parameterType"]
if "arrayType" in qp_type:
klass = ArrayQueryParameter
elif "structTypes" in qp_type:
klass = StructQueryParameter
else:
klass =... | def _query_param_from_api_repr(resource):
"""Helper: construct concrete query parameter from JSON resource."""
qp_type = resource["parameterType"]
if "arrayType" in qp_type:
klass = ArrayQueryParameter
elif "structTypes" in qp_type:
klass = StructQueryParameter
else:
klass =... | [
"Helper",
":",
"construct",
"concrete",
"query",
"parameter",
"from",
"JSON",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L616-L625 | [
"def",
"_query_param_from_api_repr",
"(",
"resource",
")",
":",
"qp_type",
"=",
"resource",
"[",
"\"parameterType\"",
"]",
"if",
"\"arrayType\"",
"in",
"qp_type",
":",
"klass",
"=",
"ArrayQueryParameter",
"elif",
"\"structTypes\"",
"in",
"qp_type",
":",
"klass",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ScalarQueryParameter.from_api_repr | Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ScalarQueryParameter`
:returns: instance | bigquery/google/cloud/bigquery/query.py | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ScalarQueryParameter`
:returns: instance
"""
name = resource.get("n... | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ScalarQueryParameter`
:returns: instance
"""
name = resource.get("n... | [
"Factory",
":",
"construct",
"parameter",
"from",
"JSON",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L118-L131 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"name",
"=",
"resource",
".",
"get",
"(",
"\"name\"",
")",
"type_",
"=",
"resource",
"[",
"\"parameterType\"",
"]",
"[",
"\"type\"",
"]",
"value",
"=",
"resource",
"[",
"\"parameterValue\"",
"]... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ScalarQueryParameter.to_api_repr | Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping | bigquery/google/cloud/bigquery/query.py | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
value = self.value
converter = _SCALAR_VALUE_TO_JSON_PARAM.get(self.type_)
if converter is not None:
value = converter(value)
... | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
value = self.value
converter = _SCALAR_VALUE_TO_JSON_PARAM.get(self.type_)
if converter is not None:
value = converter(value)
... | [
"Construct",
"JSON",
"API",
"representation",
"for",
"the",
"parameter",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L133-L149 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"value",
"converter",
"=",
"_SCALAR_VALUE_TO_JSON_PARAM",
".",
"get",
"(",
"self",
".",
"type_",
")",
"if",
"converter",
"is",
"not",
"None",
":",
"value",
"=",
"converter",
"(",
"va... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ArrayQueryParameter.from_api_repr | Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ArrayQueryParameter`
:returns: instance | bigquery/google/cloud/bigquery/query.py | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ArrayQueryParameter`
:returns: instance
"""
array_type = resource["... | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ArrayQueryParameter`
:returns: instance
"""
array_type = resource["... | [
"Factory",
":",
"construct",
"parameter",
"from",
"JSON",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L242-L254 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"array_type",
"=",
"resource",
"[",
"\"parameterType\"",
"]",
"[",
"\"arrayType\"",
"]",
"[",
"\"type\"",
"]",
"if",
"array_type",
"==",
"\"STRUCT\"",
":",
"return",
"cls",
".",
"_from_api_repr_str... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ArrayQueryParameter.to_api_repr | Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping | bigquery/google/cloud/bigquery/query.py | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
values = self.values
if self.array_type == "RECORD" or self.array_type == "STRUCT":
reprs = [value.to_api_repr() for value in values]
... | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
values = self.values
if self.array_type == "RECORD" or self.array_type == "STRUCT":
reprs = [value.to_api_repr() for value in values]
... | [
"Construct",
"JSON",
"API",
"representation",
"for",
"the",
"parameter",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L256-L279 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"values",
"=",
"self",
".",
"values",
"if",
"self",
".",
"array_type",
"==",
"\"RECORD\"",
"or",
"self",
".",
"array_type",
"==",
"\"STRUCT\"",
":",
"reprs",
"=",
"[",
"value",
".",
"to_api_repr",
"(",
")",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | StructQueryParameter.from_api_repr | Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.StructQueryParameter`
:returns: instance | bigquery/google/cloud/bigquery/query.py | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.StructQueryParameter`
:returns: instance
"""
name = resource.get("n... | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.StructQueryParameter`
:returns: instance
"""
name = resource.get("n... | [
"Factory",
":",
"construct",
"parameter",
"from",
"JSON",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L350-L388 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"name",
"=",
"resource",
".",
"get",
"(",
"\"name\"",
")",
"instance",
"=",
"cls",
"(",
"name",
")",
"type_resources",
"=",
"{",
"}",
"types",
"=",
"instance",
".",
"struct_types",
"for",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | StructQueryParameter.to_api_repr | Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping | bigquery/google/cloud/bigquery/query.py | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
s_types = {}
values = {}
for name, value in self.struct_values.items():
type_ = self.struct_types[name]
if type_ in ("ST... | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
s_types = {}
values = {}
for name, value in self.struct_values.items():
type_ = self.struct_types[name]
if type_ in ("ST... | [
"Construct",
"JSON",
"API",
"representation",
"for",
"the",
"parameter",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L390-L420 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"s_types",
"=",
"{",
"}",
"values",
"=",
"{",
"}",
"for",
"name",
",",
"value",
"in",
"self",
".",
"struct_values",
".",
"items",
"(",
")",
":",
"type_",
"=",
"self",
".",
"struct_types",
"[",
"name",
"]... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _QueryResults._set_properties | Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call | bigquery/google/cloud/bigquery/query.py | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
job_id_present = (
"jobReference" in api_response
and "jobId" in a... | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
job_id_present = (
"jobReference" in api_response
and "jobId" in a... | [
"Update",
"properties",
"from",
"resource",
"in",
"body",
"of",
"api_response"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L598-L613 | [
"def",
"_set_properties",
"(",
"self",
",",
"api_response",
")",
":",
"job_id_present",
"=",
"(",
"\"jobReference\"",
"in",
"api_response",
"and",
"\"jobId\"",
"in",
"api_response",
"[",
"\"jobReference\"",
"]",
"and",
"\"projectId\"",
"in",
"api_response",
"[",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ContainerEngineHandler.format | Format the message into JSON expected by fluentd.
:type record: :class:`~logging.LogRecord`
:param record: the log record
:rtype: str
:returns: A JSON string formatted for GKE fluentd. | logging/google/cloud/logging/handlers/container_engine.py | def format(self, record):
"""Format the message into JSON expected by fluentd.
:type record: :class:`~logging.LogRecord`
:param record: the log record
:rtype: str
:returns: A JSON string formatted for GKE fluentd.
"""
message = super(ContainerEngineHandler, self... | def format(self, record):
"""Format the message into JSON expected by fluentd.
:type record: :class:`~logging.LogRecord`
:param record: the log record
:rtype: str
:returns: A JSON string formatted for GKE fluentd.
"""
message = super(ContainerEngineHandler, self... | [
"Format",
"the",
"message",
"into",
"JSON",
"expected",
"by",
"fluentd",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/container_engine.py#L44-L54 | [
"def",
"format",
"(",
"self",
",",
"record",
")",
":",
"message",
"=",
"super",
"(",
"ContainerEngineHandler",
",",
"self",
")",
".",
"format",
"(",
"record",
")",
"return",
"format_stackdriver_json",
"(",
"record",
",",
"message",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | LanguageServiceClient.analyze_sentiment | Analyzes the sentiment of the provided text.
Example:
>>> from google.cloud import language_v1
>>>
>>> client = language_v1.LanguageServiceClient()
>>>
>>> # TODO: Initialize `document`:
>>> document = {}
>>>
>>> re... | language/google/cloud/language_v1/gapic/language_service_client.py | def analyze_sentiment(
self,
document,
encoding_type=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Analyzes the sentiment of the provided text.
Example:
... | def analyze_sentiment(
self,
document,
encoding_type=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Analyzes the sentiment of the provided text.
Example:
... | [
"Analyzes",
"the",
"sentiment",
"of",
"the",
"provided",
"text",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/language/google/cloud/language_v1/gapic/language_service_client.py#L169-L231 | [
"def",
"analyze_sentiment",
"(",
"self",
",",
"document",
",",
"encoding_type",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _commit_with_retry | Call ``Commit`` on the GAPIC client with retry / sleep.
Retries the ``Commit`` RPC on Unavailable. Usually this RPC-level
retry is handled by the underlying GAPICd client, but in this case it
doesn't because ``Commit`` is not always idempotent. But here we know it
is "idempotent"-like because it has a ... | firestore/google/cloud/firestore_v1beta1/transaction.py | def _commit_with_retry(client, write_pbs, transaction_id):
"""Call ``Commit`` on the GAPIC client with retry / sleep.
Retries the ``Commit`` RPC on Unavailable. Usually this RPC-level
retry is handled by the underlying GAPICd client, but in this case it
doesn't because ``Commit`` is not always idempote... | def _commit_with_retry(client, write_pbs, transaction_id):
"""Call ``Commit`` on the GAPIC client with retry / sleep.
Retries the ``Commit`` RPC on Unavailable. Usually this RPC-level
retry is handled by the underlying GAPICd client, but in this case it
doesn't because ``Commit`` is not always idempote... | [
"Call",
"Commit",
"on",
"the",
"GAPIC",
"client",
"with",
"retry",
"/",
"sleep",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L345-L384 | [
"def",
"_commit_with_retry",
"(",
"client",
",",
"write_pbs",
",",
"transaction_id",
")",
":",
"current_sleep",
"=",
"_INITIAL_SLEEP",
"while",
"True",
":",
"try",
":",
"return",
"client",
".",
"_firestore_api",
".",
"commit",
"(",
"client",
".",
"_database_stri... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _sleep | Sleep and produce a new sleep time.
.. _Exponential Backoff And Jitter: https://www.awsarchitectureblog.com/\
2015/03/backoff.html
Select a duration between zero and ``current_sleep``. It might seem
counterintuitive to have so much jitter, but
`Exponential Backo... | firestore/google/cloud/firestore_v1beta1/transaction.py | def _sleep(current_sleep, max_sleep=_MAX_SLEEP, multiplier=_MULTIPLIER):
"""Sleep and produce a new sleep time.
.. _Exponential Backoff And Jitter: https://www.awsarchitectureblog.com/\
2015/03/backoff.html
Select a duration between zero and ``current_sleep``. It mi... | def _sleep(current_sleep, max_sleep=_MAX_SLEEP, multiplier=_MULTIPLIER):
"""Sleep and produce a new sleep time.
.. _Exponential Backoff And Jitter: https://www.awsarchitectureblog.com/\
2015/03/backoff.html
Select a duration between zero and ``current_sleep``. It mi... | [
"Sleep",
"and",
"produce",
"a",
"new",
"sleep",
"time",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L387-L409 | [
"def",
"_sleep",
"(",
"current_sleep",
",",
"max_sleep",
"=",
"_MAX_SLEEP",
",",
"multiplier",
"=",
"_MULTIPLIER",
")",
":",
"actual_sleep",
"=",
"random",
".",
"uniform",
"(",
"0.0",
",",
"current_sleep",
")",
"time",
".",
"sleep",
"(",
"actual_sleep",
")",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Transaction._add_write_pbs | Add `Write`` protobufs to this transaction.
Args:
write_pbs (List[google.cloud.proto.firestore.v1beta1.\
write_pb2.Write]): A list of write protobufs to be added.
Raises:
ValueError: If this transaction is read-only. | firestore/google/cloud/firestore_v1beta1/transaction.py | def _add_write_pbs(self, write_pbs):
"""Add `Write`` protobufs to this transaction.
Args:
write_pbs (List[google.cloud.proto.firestore.v1beta1.\
write_pb2.Write]): A list of write protobufs to be added.
Raises:
ValueError: If this transaction is read-onl... | def _add_write_pbs(self, write_pbs):
"""Add `Write`` protobufs to this transaction.
Args:
write_pbs (List[google.cloud.proto.firestore.v1beta1.\
write_pb2.Write]): A list of write protobufs to be added.
Raises:
ValueError: If this transaction is read-onl... | [
"Add",
"Write",
"protobufs",
"to",
"this",
"transaction",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L65-L78 | [
"def",
"_add_write_pbs",
"(",
"self",
",",
"write_pbs",
")",
":",
"if",
"self",
".",
"_read_only",
":",
"raise",
"ValueError",
"(",
"_WRITE_READ_ONLY",
")",
"super",
"(",
"Transaction",
",",
"self",
")",
".",
"_add_write_pbs",
"(",
"write_pbs",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Transaction._options_protobuf | Convert the current object to protobuf.
The ``retry_id`` value is used when retrying a transaction that
failed (e.g. due to contention). It is intended to be the "first"
transaction that failed (i.e. if multiple retries are needed).
Args:
retry_id (Union[bytes, NoneType]): ... | firestore/google/cloud/firestore_v1beta1/transaction.py | def _options_protobuf(self, retry_id):
"""Convert the current object to protobuf.
The ``retry_id`` value is used when retrying a transaction that
failed (e.g. due to contention). It is intended to be the "first"
transaction that failed (i.e. if multiple retries are needed).
Arg... | def _options_protobuf(self, retry_id):
"""Convert the current object to protobuf.
The ``retry_id`` value is used when retrying a transaction that
failed (e.g. due to contention). It is intended to be the "first"
transaction that failed (i.e. if multiple retries are needed).
Arg... | [
"Convert",
"the",
"current",
"object",
"to",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L80-L114 | [
"def",
"_options_protobuf",
"(",
"self",
",",
"retry_id",
")",
":",
"if",
"retry_id",
"is",
"not",
"None",
":",
"if",
"self",
".",
"_read_only",
":",
"raise",
"ValueError",
"(",
"_CANT_RETRY_READ_ONLY",
")",
"return",
"types",
".",
"TransactionOptions",
"(",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Transaction._begin | Begin the transaction.
Args:
retry_id (Optional[bytes]): Transaction ID of a transaction to be
retried.
Raises:
ValueError: If the current transaction has already begun. | firestore/google/cloud/firestore_v1beta1/transaction.py | def _begin(self, retry_id=None):
"""Begin the transaction.
Args:
retry_id (Optional[bytes]): Transaction ID of a transaction to be
retried.
Raises:
ValueError: If the current transaction has already begun.
"""
if self.in_progress:
... | def _begin(self, retry_id=None):
"""Begin the transaction.
Args:
retry_id (Optional[bytes]): Transaction ID of a transaction to be
retried.
Raises:
ValueError: If the current transaction has already begun.
"""
if self.in_progress:
... | [
"Begin",
"the",
"transaction",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L135-L154 | [
"def",
"_begin",
"(",
"self",
",",
"retry_id",
"=",
"None",
")",
":",
"if",
"self",
".",
"in_progress",
":",
"msg",
"=",
"_CANT_BEGIN",
".",
"format",
"(",
"self",
".",
"_id",
")",
"raise",
"ValueError",
"(",
"msg",
")",
"transaction_response",
"=",
"s... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Transaction._rollback | Roll back the transaction.
Raises:
ValueError: If no transaction is in progress. | firestore/google/cloud/firestore_v1beta1/transaction.py | def _rollback(self):
"""Roll back the transaction.
Raises:
ValueError: If no transaction is in progress.
"""
if not self.in_progress:
raise ValueError(_CANT_ROLLBACK)
try:
# NOTE: The response is just ``google.protobuf.Empty``.
se... | def _rollback(self):
"""Roll back the transaction.
Raises:
ValueError: If no transaction is in progress.
"""
if not self.in_progress:
raise ValueError(_CANT_ROLLBACK)
try:
# NOTE: The response is just ``google.protobuf.Empty``.
se... | [
"Roll",
"back",
"the",
"transaction",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L164-L181 | [
"def",
"_rollback",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"in_progress",
":",
"raise",
"ValueError",
"(",
"_CANT_ROLLBACK",
")",
"try",
":",
"# NOTE: The response is just ``google.protobuf.Empty``.",
"self",
".",
"_client",
".",
"_firestore_api",
".",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Transaction._commit | Transactionally commit the changes accumulated.
Returns:
List[google.cloud.proto.firestore.v1beta1.\
write_pb2.WriteResult, ...]: The write results corresponding
to the changes committed, returned in the same order as the
changes were applied to this transact... | firestore/google/cloud/firestore_v1beta1/transaction.py | def _commit(self):
"""Transactionally commit the changes accumulated.
Returns:
List[google.cloud.proto.firestore.v1beta1.\
write_pb2.WriteResult, ...]: The write results corresponding
to the changes committed, returned in the same order as the
changes... | def _commit(self):
"""Transactionally commit the changes accumulated.
Returns:
List[google.cloud.proto.firestore.v1beta1.\
write_pb2.WriteResult, ...]: The write results corresponding
to the changes committed, returned in the same order as the
changes... | [
"Transactionally",
"commit",
"the",
"changes",
"accumulated",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L183-L202 | [
"def",
"_commit",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"in_progress",
":",
"raise",
"ValueError",
"(",
"_CANT_COMMIT",
")",
"commit_response",
"=",
"_commit_with_retry",
"(",
"self",
".",
"_client",
",",
"self",
".",
"_write_pbs",
",",
"self",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _Transactional._pre_commit | Begin transaction and call the wrapped callable.
If the callable raises an exception, the transaction will be rolled
back. If not, the transaction will be "ready" for ``Commit`` (i.e.
it will have staged writes).
Args:
transaction (~.firestore_v1beta1.transaction.Transactio... | firestore/google/cloud/firestore_v1beta1/transaction.py | def _pre_commit(self, transaction, *args, **kwargs):
"""Begin transaction and call the wrapped callable.
If the callable raises an exception, the transaction will be rolled
back. If not, the transaction will be "ready" for ``Commit`` (i.e.
it will have staged writes).
Args:
... | def _pre_commit(self, transaction, *args, **kwargs):
"""Begin transaction and call the wrapped callable.
If the callable raises an exception, the transaction will be rolled
back. If not, the transaction will be "ready" for ``Commit`` (i.e.
it will have staged writes).
Args:
... | [
"Begin",
"transaction",
"and",
"call",
"the",
"wrapped",
"callable",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L229-L264 | [
"def",
"_pre_commit",
"(",
"self",
",",
"transaction",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Force the ``transaction`` to be not \"in progress\".",
"transaction",
".",
"_clean_up",
"(",
")",
"transaction",
".",
"_begin",
"(",
"retry_id",
"=",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _Transactional._maybe_commit | Try to commit the transaction.
If the transaction is read-write and the ``Commit`` fails with the
``ABORTED`` status code, it will be retried. Any other failure will
not be caught.
Args:
transaction (~.firestore_v1beta1.transaction.Transaction): The
transact... | firestore/google/cloud/firestore_v1beta1/transaction.py | def _maybe_commit(self, transaction):
"""Try to commit the transaction.
If the transaction is read-write and the ``Commit`` fails with the
``ABORTED`` status code, it will be retried. Any other failure will
not be caught.
Args:
transaction (~.firestore_v1beta1.trans... | def _maybe_commit(self, transaction):
"""Try to commit the transaction.
If the transaction is read-write and the ``Commit`` fails with the
``ABORTED`` status code, it will be retried. Any other failure will
not be caught.
Args:
transaction (~.firestore_v1beta1.trans... | [
"Try",
"to",
"commit",
"the",
"transaction",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L266-L291 | [
"def",
"_maybe_commit",
"(",
"self",
",",
"transaction",
")",
":",
"try",
":",
"transaction",
".",
"_commit",
"(",
")",
"return",
"True",
"except",
"exceptions",
".",
"GoogleAPICallError",
"as",
"exc",
":",
"if",
"transaction",
".",
"_read_only",
":",
"raise... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProfileServiceClient.profile_path | Return a fully-qualified profile string. | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | def profile_path(cls, project, tenant, profile):
"""Return a fully-qualified profile string."""
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/profiles/{profile}",
project=project,
tenant=tenant,
profile=profile,
... | def profile_path(cls, project, tenant, profile):
"""Return a fully-qualified profile string."""
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/profiles/{profile}",
project=project,
tenant=tenant,
profile=profile,
... | [
"Return",
"a",
"fully",
"-",
"qualified",
"profile",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L98-L105 | [
"def",
"profile_path",
"(",
"cls",
",",
"project",
",",
"tenant",
",",
"profile",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/tenants/{tenant}/profiles/{profile}\"",
",",
"project",
"=",
"project",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProfileServiceClient.create_profile | Creates and returns a new profile.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.ProfileServiceClient()
>>>
>>> parent = client.tenant_path('[PROJECT]', '[TENANT]')
>>>
>>> # TODO: Initial... | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | def create_profile(
self,
parent,
profile,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new profile.
Example:
>>> from google.cloud impo... | def create_profile(
self,
parent,
profile,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new profile.
Example:
>>> from google.cloud impo... | [
"Creates",
"and",
"returns",
"a",
"new",
"profile",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L313-L384 | [
"def",
"create_profile",
"(",
"self",
",",
"parent",
",",
"profile",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAU... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProfileServiceClient.get_profile | Gets the specified profile.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.ProfileServiceClient()
>>>
>>> name = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]')
>>>
>>> response =... | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | def get_profile(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the specified profile.
Example:
>>> from google.cloud import talent_v4beta1
... | def get_profile(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the specified profile.
Example:
>>> from google.cloud import talent_v4beta1
... | [
"Gets",
"the",
"specified",
"profile",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L386-L446 | [
"def",
"get_profile",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadata",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProfileServiceClient.update_profile | Updates the specified profile and returns the updated result.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.ProfileServiceClient()
>>>
>>> # TODO: Initialize `profile`:
>>> profile = {}
>>... | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | def update_profile(
self,
profile,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the specified profile and returns the updated result.
Example:
... | def update_profile(
self,
profile,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the specified profile and returns the updated result.
Example:
... | [
"Updates",
"the",
"specified",
"profile",
"and",
"returns",
"the",
"updated",
"result",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L448-L545 | [
"def",
"update_profile",
"(",
"self",
",",
"profile",
",",
"update_mask",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProfileServiceClient.search_profiles | Searches for profiles within a tenant.
For example, search by raw queries "software engineer in Mountain View"
or search by structured filters (location filter, education filter,
etc.).
See ``SearchProfilesRequest`` for more information.
Example:
>>> from google.cl... | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | def search_profiles(
self,
parent,
request_metadata,
profile_query=None,
page_size=None,
offset=None,
disable_spell_check=None,
order_by=None,
case_sensitive_sort=None,
histogram_queries=None,
retry=google.api_core.gapic_v1.method.D... | def search_profiles(
self,
parent,
request_metadata,
profile_query=None,
page_size=None,
offset=None,
disable_spell_check=None,
order_by=None,
case_sensitive_sort=None,
histogram_queries=None,
retry=google.api_core.gapic_v1.method.D... | [
"Searches",
"for",
"profiles",
"within",
"a",
"tenant",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L606-L868 | [
"def",
"search_profiles",
"(",
"self",
",",
"parent",
",",
"request_metadata",
",",
"profile_query",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"offset",
"=",
"None",
",",
"disable_spell_check",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
"case_sen... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PredictionServiceClient.predict | Perform an online prediction. The prediction result will be directly
returned in the response. Available for following ML problems, and their
expected request payloads:
- Image Classification - Image in .JPEG, .GIF or .PNG format,
image\_bytes up to 30MB.
- Image Object Det... | automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py | def predict(
self,
name,
payload,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform an online prediction. The prediction result will be directly
re... | def predict(
self,
name,
payload,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform an online prediction. The prediction result will be directly
re... | [
"Perform",
"an",
"online",
"prediction",
".",
"The",
"prediction",
"result",
"will",
"be",
"directly",
"returned",
"in",
"the",
"response",
".",
"Available",
"for",
"following",
"ML",
"problems",
"and",
"their",
"expected",
"request",
"payloads",
":"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py#L201-L312 | [
"def",
"predict",
"(",
"self",
",",
"name",
",",
"payload",
",",
"params",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PredictionServiceClient.batch_predict | Perform a batch prediction. Unlike the online ``Predict``, batch
prediction result won't be immediately available in the response.
Instead, a long running operation object is returned. User can poll the
operation result via ``GetOperation`` method. Once the operation is
done, ``BatchPred... | automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py | def batch_predict(
self,
name,
input_config,
output_config,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform a batch prediction. Unlike the online... | def batch_predict(
self,
name,
input_config,
output_config,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform a batch prediction. Unlike the online... | [
"Perform",
"a",
"batch",
"prediction",
".",
"Unlike",
"the",
"online",
"Predict",
"batch",
"prediction",
"result",
"won",
"t",
"be",
"immediately",
"available",
"in",
"the",
"response",
".",
"Instead",
"a",
"long",
"running",
"operation",
"object",
"is",
"retu... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py#L314-L455 | [
"def",
"batch_predict",
"(",
"self",
",",
"name",
",",
"input_config",
",",
"output_config",
",",
"params",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"ap... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.