id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
27,700
googleapis/google-cloud-python
vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py
ProductSearchClient.product_path
def product_path(cls, project, location, product): """Return a fully-qualified product string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/products/{product}", project=project, location=location, product=product...
python
def product_path(cls, project, location, product): """Return a fully-qualified product string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/products/{product}", project=project, location=location, product=product...
[ "def", "product_path", "(", "cls", ",", "project", ",", "location", ",", "product", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/products/{product}\"", ",", "project", "=", "proje...
Return a fully-qualified product string.
[ "Return", "a", "fully", "-", "qualified", "product", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L111-L118
27,701
googleapis/google-cloud-python
vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py
ProductSearchClient.reference_image_path
def reference_image_path(cls, project, location, product, reference_image): """Return a fully-qualified reference_image string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}", project=...
python
def reference_image_path(cls, project, location, product, reference_image): """Return a fully-qualified reference_image string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}", project=...
[ "def", "reference_image_path", "(", "cls", ",", "project", ",", "location", ",", "product", ",", "reference_image", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/products/{product}/ref...
Return a fully-qualified reference_image string.
[ "Return", "a", "fully", "-", "qualified", "reference_image", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L121-L129
27,702
googleapis/google-cloud-python
vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py
ProductSearchClient.create_product_set
def create_product_set( self, parent, product_set, product_set_id, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates and returns a new ProductSet resource. Pos...
python
def create_product_set( self, parent, product_set, product_set_id, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates and returns a new ProductSet resource. Pos...
[ "def", "create_product_set", "(", "self", ",", "parent", ",", "product_set", ",", "product_set_id", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1",...
Creates and returns a new ProductSet resource. Possible errors: - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer than 4096 characters. Example: >>> from google.cloud import vision_v1p3beta1 >>> >>> client = vision_v1p3beta1....
[ "Creates", "and", "returns", "a", "new", "ProductSet", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L230-L322
27,703
googleapis/google-cloud-python
vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py
ProductSearchClient.create_reference_image
def create_reference_image( self, parent, reference_image, reference_image_id, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates and returns a new ReferenceImage resour...
python
def create_reference_image( self, parent, reference_image, reference_image_id, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates and returns a new ReferenceImage resour...
[ "def", "create_reference_image", "(", "self", ",", "parent", ",", "reference_image", ",", "reference_image_id", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", ...
Creates and returns a new ReferenceImage resource. The ``bounding_poly`` field is optional. If ``bounding_poly`` is not specified, the system will try to detect regions of interest in the image that are compatible with the product\_category on the parent product. If it is specified, det...
[ "Creates", "and", "returns", "a", "new", "ReferenceImage", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L1136-L1246
27,704
googleapis/google-cloud-python
vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py
ProductSearchClient.import_product_sets
def import_product_sets( self, parent, input_config, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Asynchronous API that imports a list of reference images to specified pro...
python
def import_product_sets( self, parent, input_config, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Asynchronous API that imports a list of reference images to specified pro...
[ "def", "import_product_sets", "(", "self", ",", "parent", ",", "input_config", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", "."...
Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. The ``google.longrunning.Operation`` API can be used to keep track of the progress and results of the request. ``Operation.metadata`` contains ``BatchOperationMetadat...
[ "Asynchronous", "API", "that", "imports", "a", "list", "of", "reference", "images", "to", "specified", "product", "sets", "based", "on", "a", "list", "of", "image", "information", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L1800-L1904
27,705
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_parse_log_entry
def _parse_log_entry(entry_pb): """Special helper to parse ``LogEntry`` protobuf into a dictionary. The ``proto_payload`` field in ``LogEntry`` is of type ``Any``. This can be problematic if the type URL in the payload isn't in the ``google.protobuf`` registry. To help with parsing unregistered types, ...
python
def _parse_log_entry(entry_pb): """Special helper to parse ``LogEntry`` protobuf into a dictionary. The ``proto_payload`` field in ``LogEntry`` is of type ``Any``. This can be problematic if the type URL in the payload isn't in the ``google.protobuf`` registry. To help with parsing unregistered types, ...
[ "def", "_parse_log_entry", "(", "entry_pb", ")", ":", "try", ":", "return", "MessageToDict", "(", "entry_pb", ")", "except", "TypeError", ":", "if", "entry_pb", ".", "HasField", "(", "\"proto_payload\"", ")", ":", "proto_payload", "=", "entry_pb", ".", "proto_...
Special helper to parse ``LogEntry`` protobuf into a dictionary. The ``proto_payload`` field in ``LogEntry`` is of type ``Any``. This can be problematic if the type URL in the payload isn't in the ``google.protobuf`` registry. To help with parsing unregistered types, this function will remove ``proto_p...
[ "Special", "helper", "to", "parse", "LogEntry", "protobuf", "into", "a", "dictionary", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L421-L447
27,706
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_item_to_entry
def _item_to_entry(iterator, entry_pb, loggers): """Convert a log entry protobuf to the native object. .. note:: This method does not have the correct signature to be used as the ``item_to_value`` argument to :class:`~google.api_core.page_iterator.Iterator`. It is intended to be ...
python
def _item_to_entry(iterator, entry_pb, loggers): """Convert a log entry protobuf to the native object. .. note:: This method does not have the correct signature to be used as the ``item_to_value`` argument to :class:`~google.api_core.page_iterator.Iterator`. It is intended to be ...
[ "def", "_item_to_entry", "(", "iterator", ",", "entry_pb", ",", "loggers", ")", ":", "resource", "=", "_parse_log_entry", "(", "entry_pb", ")", "return", "entry_from_resource", "(", "resource", ",", "iterator", ".", "client", ",", "loggers", ")" ]
Convert a log entry protobuf to the native object. .. note:: This method does not have the correct signature to be used as the ``item_to_value`` argument to :class:`~google.api_core.page_iterator.Iterator`. It is intended to be patched with a mutable ``loggers`` argument that can b...
[ "Convert", "a", "log", "entry", "protobuf", "to", "the", "native", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L468-L496
27,707
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_item_to_sink
def _item_to_sink(iterator, log_sink_pb): """Convert a sink protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_sink_pb: :class:`.logging_config_pb2.LogSink` :param log_sink_pb: Si...
python
def _item_to_sink(iterator, log_sink_pb): """Convert a sink protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_sink_pb: :class:`.logging_config_pb2.LogSink` :param log_sink_pb: Si...
[ "def", "_item_to_sink", "(", "iterator", ",", "log_sink_pb", ")", ":", "# NOTE: LogSink message type does not have an ``Any`` field", "# so `MessageToDict`` can safely be used.", "resource", "=", "MessageToDict", "(", "log_sink_pb", ")", "return", "Sink", ".", "from_api_r...
Convert a sink protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_sink_pb: :class:`.logging_config_pb2.LogSink` :param log_sink_pb: Sink protobuf returned from the API. :rtype: :...
[ "Convert", "a", "sink", "protobuf", "to", "the", "native", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L499-L515
27,708
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_item_to_metric
def _item_to_metric(iterator, log_metric_pb): """Convert a metric protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_metric_pb: :class:`.logging_metrics_pb2.LogMetric` :param log_...
python
def _item_to_metric(iterator, log_metric_pb): """Convert a metric protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_metric_pb: :class:`.logging_metrics_pb2.LogMetric` :param log_...
[ "def", "_item_to_metric", "(", "iterator", ",", "log_metric_pb", ")", ":", "# NOTE: LogMetric message type does not have an ``Any`` field", "# so `MessageToDict`` can safely be used.", "resource", "=", "MessageToDict", "(", "log_metric_pb", ")", "return", "Metric", ".", "...
Convert a metric protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_metric_pb: :class:`.logging_metrics_pb2.LogMetric` :param log_metric_pb: Metric protobuf returned from the API. ...
[ "Convert", "a", "metric", "protobuf", "to", "the", "native", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L518-L534
27,709
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
make_logging_api
def make_logging_api(client): """Create an instance of the Logging API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_LoggingAPI` :returns: A metrics API instance with the proper credentials. """ ...
python
def make_logging_api(client): """Create an instance of the Logging API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_LoggingAPI` :returns: A metrics API instance with the proper credentials. """ ...
[ "def", "make_logging_api", "(", "client", ")", ":", "generated", "=", "LoggingServiceV2Client", "(", "credentials", "=", "client", ".", "_credentials", ",", "client_info", "=", "_CLIENT_INFO", ")", "return", "_LoggingAPI", "(", "generated", ",", "client", ")" ]
Create an instance of the Logging API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_LoggingAPI` :returns: A metrics API instance with the proper credentials.
[ "Create", "an", "instance", "of", "the", "Logging", "API", "adapter", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L537-L549
27,710
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
make_metrics_api
def make_metrics_api(client): """Create an instance of the Metrics API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_MetricsAPI` :returns: A metrics API instance with the proper credentials. """ ...
python
def make_metrics_api(client): """Create an instance of the Metrics API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_MetricsAPI` :returns: A metrics API instance with the proper credentials. """ ...
[ "def", "make_metrics_api", "(", "client", ")", ":", "generated", "=", "MetricsServiceV2Client", "(", "credentials", "=", "client", ".", "_credentials", ",", "client_info", "=", "_CLIENT_INFO", ")", "return", "_MetricsAPI", "(", "generated", ",", "client", ")" ]
Create an instance of the Metrics API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_MetricsAPI` :returns: A metrics API instance with the proper credentials.
[ "Create", "an", "instance", "of", "the", "Metrics", "API", "adapter", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L552-L564
27,711
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
make_sinks_api
def make_sinks_api(client): """Create an instance of the Sinks API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_SinksAPI` :returns: A metrics API instance with the proper credentials. """ ge...
python
def make_sinks_api(client): """Create an instance of the Sinks API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_SinksAPI` :returns: A metrics API instance with the proper credentials. """ ge...
[ "def", "make_sinks_api", "(", "client", ")", ":", "generated", "=", "ConfigServiceV2Client", "(", "credentials", "=", "client", ".", "_credentials", ",", "client_info", "=", "_CLIENT_INFO", ")", "return", "_SinksAPI", "(", "generated", ",", "client", ")" ]
Create an instance of the Sinks API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_SinksAPI` :returns: A metrics API instance with the proper credentials.
[ "Create", "an", "instance", "of", "the", "Sinks", "API", "adapter", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L567-L579
27,712
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.tenant_path
def tenant_path(cls, project, tenant): """Return a fully-qualified tenant string.""" return google.api_core.path_template.expand( "projects/{project}/tenants/{tenant}", project=project, tenant=tenant )
python
def tenant_path(cls, project, tenant): """Return a fully-qualified tenant string.""" return google.api_core.path_template.expand( "projects/{project}/tenants/{tenant}", project=project, tenant=tenant )
[ "def", "tenant_path", "(", "cls", ",", "project", ",", "tenant", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/tenants/{tenant}\"", ",", "project", "=", "project", ",", "tenant", "=", "tenant", "...
Return a fully-qualified tenant string.
[ "Return", "a", "fully", "-", "qualified", "tenant", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L100-L104
27,713
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.create_tenant
def create_tenant( self, parent, tenant, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new tenant entity. Example: >>> from google.cloud import talen...
python
def create_tenant( self, parent, tenant, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new tenant entity. Example: >>> from google.cloud import talen...
[ "def", "create_tenant", "(", "self", ",", "parent", ",", "tenant", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT...
Creates a new tenant entity. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.TenantServiceClient() >>> >>> parent = client.project_path('[PROJECT]') >>> >>> # TODO: Initialize `tenant`: ...
[ "Creates", "a", "new", "tenant", "entity", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L205-L274
27,714
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.get_tenant
def get_tenant( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Retrieves specified tenant. Example: >>> from google.cloud import talent_v4beta1 ...
python
def get_tenant( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Retrieves specified tenant. Example: >>> from google.cloud import talent_v4beta1 ...
[ "def", "get_tenant", "(", "self", ",", "name", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "metadata", ...
Retrieves specified tenant. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.TenantServiceClient() >>> >>> name = client.tenant_path('[PROJECT]', '[TENANT]') >>> >>> response = client.get_ten...
[ "Retrieves", "specified", "tenant", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L276-L335
27,715
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.update_tenant
def update_tenant( self, tenant, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates specified tenant. Example: >>> from google.cloud impor...
python
def update_tenant( self, tenant, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates specified tenant. Example: >>> from google.cloud impor...
[ "def", "update_tenant", "(", "self", ",", "tenant", ",", "update_mask", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "meth...
Updates specified tenant. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.TenantServiceClient() >>> >>> # TODO: Initialize `tenant`: >>> tenant = {} >>> >>> response = client.upd...
[ "Updates", "specified", "tenant", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L337-L410
27,716
googleapis/google-cloud-python
api_core/google/api_core/gapic_v1/method.py
_apply_decorators
def _apply_decorators(func, decorators): """Apply a list of decorators to a given function. ``decorators`` may contain items that are ``None`` or ``False`` which will be ignored. """ decorators = filter(_is_not_none_or_false, reversed(decorators)) for decorator in decorators: func = de...
python
def _apply_decorators(func, decorators): """Apply a list of decorators to a given function. ``decorators`` may contain items that are ``None`` or ``False`` which will be ignored. """ decorators = filter(_is_not_none_or_false, reversed(decorators)) for decorator in decorators: func = de...
[ "def", "_apply_decorators", "(", "func", ",", "decorators", ")", ":", "decorators", "=", "filter", "(", "_is_not_none_or_false", ",", "reversed", "(", "decorators", ")", ")", "for", "decorator", "in", "decorators", ":", "func", "=", "decorator", "(", "func", ...
Apply a list of decorators to a given function. ``decorators`` may contain items that are ``None`` or ``False`` which will be ignored.
[ "Apply", "a", "list", "of", "decorators", "to", "a", "given", "function", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L36-L47
27,717
googleapis/google-cloud-python
api_core/google/api_core/gapic_v1/method.py
_determine_timeout
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...
python
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", ")", ":", "if", "specified_timeout", "is", "DEFAULT", ":", "specified_timeout", "=", "default_timeout", "if", "specified_timeout", "is", "default_timeout", ":", "# If timeout is...
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...
[ "Determines", "how", "timeout", "should", "be", "applied", "to", "a", "wrapped", "method", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L50-L86
27,718
googleapis/google-cloud-python
api_core/google/api_core/gapic_v1/method.py
wrap_method
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...
python
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", ",", ")", ":", "func", "=", "grpc_helpers", ".", "wrap_errors", "(", "func", ")", "...
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 ...
[ "Wrap", "an", "RPC", "method", "with", "common", "behavior", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L146-L242
27,719
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_validate_name
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...
python
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", ")", ":", "if", "name", "is", "None", ":", "return", "# The first and las characters must be alphanumeric.", "if", "not", "all", "(", "[", "name", "[", "0", "]", ".", "isalnum", "(", ")", ",", "name", "[", "-", "1", ...
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.
[ "Pre", "-", "flight", "Bucket", "name", "validation", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L24-L39
27,720
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_write_buffer_to_hash
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...
python
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", ")", ":", "block", "=", "buffer_object", ".", "read", "(", "digest_block_size", ")", "while", "len", "(", "block", ")", ">", "0", ":", "hash_obj", "...
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...
[ "Read", "blocks", "from", "a", "buffer", "and", "update", "a", "hash", "with", "them", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L231-L249
27,721
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_PropertyMixin.reload
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...
python
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", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "self", ".", "_query_params", "# Pass only '?projection=noAcl' here because 'acl' and related", "# are handled v...
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 ...
[ "Reload", "properties", "from", "Cloud", "Storage", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L110-L132
27,722
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_PropertyMixin._patch_property
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...
python
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", ")", ":", "self", ".", "_changes", ".", "add", "(", "name", ")", "self", ".", "_properties", "[", "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 :meth:`patch`. :type name: str :param...
[ "Update", "field", "of", "this", "object", "s", "properties", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L134-L150
27,723
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_PropertyMixin.update
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 ...
python
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", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "self", ".", "_query_params", "query_params", "[", "\"projection\"", "]", "=", "\"full\"", "api_respon...
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:...
[ "Sends", "all", "properties", "in", "a", "PUT", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L191-L213
27,724
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.dispatch_callback
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...
python
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", ")", ":", "if", "not", "self", ".", "_manager", ".", "is_active", ":", "return", "batched_commands", "=", "collections", ".", "defaultdict", "(", "list", ")", "for", "item", "in", "items", ":", "batche...
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...
[ "Map", "the", "callback", "request", "to", "the", "appropriate", "gRPC", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L68-L101
27,725
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.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...
python
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", ")", ":", "# 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...
Acknowledge the given messages. Args: items(Sequence[AckRequest]): The items to acknowledge.
[ "Acknowledge", "the", "given", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L103-L120
27,726
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.drop
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()
python
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", ")", ":", "self", ".", "_manager", ".", "leaser", ".", "remove", "(", "items", ")", "self", ".", "_manager", ".", "maybe_resume_consumer", "(", ")" ]
Remove the given messages from lease management. Args: items(Sequence[DropRequest]): The items to drop.
[ "Remove", "the", "given", "messages", "from", "lease", "management", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L122-L129
27,727
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.lease
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()
python
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", ")", ":", "self", ".", "_manager", ".", "leaser", ".", "add", "(", "items", ")", "self", ".", "_manager", ".", "maybe_pause_consumer", "(", ")" ]
Add the given messages to lease management. Args: items(Sequence[LeaseRequest]): The items to lease.
[ "Add", "the", "given", "messages", "to", "lease", "management", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L131-L138
27,728
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.modify_ack_deadline
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...
python
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", ")", ":", "ack_ids", "=", "[", "item", ".", "ack_id", "for", "item", "in", "items", "]", "seconds", "=", "[", "item", ".", "seconds", "for", "item", "in", "items", "]", "request", "=", "types", ...
Modify the ack deadline for the given messages. Args: items(Sequence[ModAckRequest]): The items to modify.
[ "Modify", "the", "ack", "deadline", "for", "the", "given", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L140-L152
27,729
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.nack
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...
python
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", ")", ":", "self", ".", "modify_ack_deadline", "(", "[", "requests", ".", "ModAckRequest", "(", "ack_id", "=", "item", ".", "ack_id", ",", "seconds", "=", "0", ")", "for", "item", "in", "items", "]", ")", "sel...
Explicitly deny receipt of messages. Args: items(Sequence[NackRequest]): The items to deny.
[ "Explicitly", "deny", "receipt", "of", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L154-L163
27,730
googleapis/google-cloud-python
dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py
JobControllerClient.submit_job
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: ...
python
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", ...
Submits a job to a cluster. Example: >>> from google.cloud import dataproc_v1beta2 >>> >>> client = dataproc_v1beta2.JobControllerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>> # TODO:...
[ "Submits", "a", "job", "to", "a", "cluster", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L175-L257
27,731
googleapis/google-cloud-python
dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py
JobControllerClient.update_job
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...
python
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...
Updates a job in a project. Example: >>> from google.cloud import dataproc_v1beta2 >>> >>> client = dataproc_v1beta2.JobControllerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>> # TODO:...
[ "Updates", "a", "job", "in", "a", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L454-L546
27,732
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.instance_path
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, )
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}\"", ",", "project", "=", "project", ",", "instance", "=", "in...
Return a fully-qualified instance string.
[ "Return", "a", "fully", "-", "qualified", "instance", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L93-L99
27,733
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.app_profile_path
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, ...
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}/appProfiles/{app_profile}\"", ",", "project", ...
Return a fully-qualified app_profile string.
[ "Return", "a", "fully", "-", "qualified", "app_profile", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L102-L109
27,734
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.cluster_path
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...
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}/clusters/{cluster}\"", ",", "project", "=", "proje...
Return a fully-qualified cluster string.
[ "Return", "a", "fully", "-", "qualified", "cluster", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L112-L119
27,735
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.list_instances
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...
python
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", ".", "meth...
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]') >>> >>> ...
[ "Lists", "information", "about", "instances", "in", "a", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L413-L485
27,736
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.partial_update_instance
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: ...
python
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", ...
Partially updates an instance within a project. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> # TODO: Initialize `instance`: >>> instance = {} >...
[ "Partially", "updates", "an", "instance", "within", "a", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L590-L687
27,737
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.create_cluster
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: >>>...
python
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", ".", "m...
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]') >>> ...
[ "Creates", "a", "cluster", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L756-L857
27,738
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.update_cluster
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...
python
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", ".", "...
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]') >>> ...
[ "Updates", "a", "cluster", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1006-L1111
27,739
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.create_app_profile
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...
python
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", "=", "googl...
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]') >>> ...
[ "Creates", "an", "app", "profile", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1180-L1271
27,740
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.update_app_profile
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. ...
python
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...
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 = {} ...
[ "Updates", "an", "app", "profile", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1447-L1548
27,741
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.annotation_spec_set_path
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...
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/annotationSpecSets/{annotation_spec_set}\"", ",", "project", "=", "p...
Return a fully-qualified annotation_spec_set string.
[ "Return", "a", "fully", "-", "qualified", "annotation_spec_set", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L93-L99
27,742
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.dataset_path
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 )
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}\"", ",", "project", "=", "project", ",", "dataset", "=", "dataset...
Return a fully-qualified dataset string.
[ "Return", "a", "fully", "-", "qualified", "dataset", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L102-L106
27,743
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.annotated_dataset_path
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, ...
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}\"",...
Return a fully-qualified annotated_dataset string.
[ "Return", "a", "fully", "-", "qualified", "annotated_dataset", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L109-L116
27,744
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.example_path
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, ...
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_da...
Return a fully-qualified example string.
[ "Return", "a", "fully", "-", "qualified", "example", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L119-L127
27,745
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.data_item_path
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...
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}/dataItems/{data_item}\"", ",", "project", "=", "p...
Return a fully-qualified data_item string.
[ "Return", "a", "fully", "-", "qualified", "data_item", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L130-L137
27,746
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.instruction_path
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, )
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instructions/{instruction}\"", ",", "project", "=", "project", ",", "instruction...
Return a fully-qualified instruction string.
[ "Return", "a", "fully", "-", "qualified", "instruction", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L140-L146
27,747
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.export_data
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...
python
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", ".", ...
Exports data and annotations from dataset. Example: >>> from google.cloud import datalabeling_v1beta1 >>> >>> client = datalabeling_v1beta1.DataLabelingServiceClient() >>> >>> name = client.dataset_path('[PROJECT]', '[DATASET]') >>> ...
[ "Exports", "data", "and", "annotations", "from", "dataset", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L667-L774
27,748
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.label_image
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_...
python
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", ",", "...
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...
[ "Starts", "a", "labeling", "task", "for", "image", ".", "The", "type", "of", "image", "labeling", "task", "is", "configured", "by", "feature", "in", "the", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1131-L1274
27,749
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.label_video
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...
python
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", ",", ...
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...
[ "Starts", "a", "labeling", "task", "for", "video", ".", "The", "type", "of", "video", "labeling", "task", "is", "configured", "by", "feature", "in", "the", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1276-L1419
27,750
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.label_text
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, ): ...
python
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",...
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...
[ "Starts", "a", "labeling", "task", "for", "text", ".", "The", "type", "of", "text", "labeling", "task", "is", "configured", "by", "feature", "in", "the", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1421-L1546
27,751
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.create_instruction
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: ...
python
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", ".", ...
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]') >>> ...
[ "Creates", "an", "instruction", "for", "how", "data", "should", "be", "labeled", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L2157-L2249
27,752
googleapis/google-cloud-python
runtimeconfig/google/cloud/runtimeconfig/variable.py
Variable.value
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 ...
python
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", "=", "self", ".", "_properties", ".", "get", "(", "\"value\"", ")", "if", "value", "is", "not", "None", ":", "value", "=", "base64", ".", "b64decode", "(", "value", ")", "return", "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.
[ "Value", "of", "the", "variable", "as", "bytes", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L121-L134
27,753
googleapis/google-cloud-python
runtimeconfig/google/cloud/runtimeconfig/variable.py
Variable.update_time
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`, ...
python
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", ")", ":", "value", "=", "self", ".", "_properties", ".", "get", "(", "\"updateTime\"", ")", "if", "value", "is", "not", "None", ":", "try", ":", "value", "=", "datetime", ".", "datetime", ".", "strptime", "(", "value"...
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...
[ "Retrieve", "the", "timestamp", "at", "which", "the", "variable", "was", "updated", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L151-L178
27,754
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
from_any_pb
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...
python
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", ")", ":", "msg", "=", "pb_type", "(", ")", "# Unwrap proto-plus wrapped messages.", "if", "callable", "(", "getattr", "(", "pb_type", ",", "\"pb\"", ",", "None", ")", ")", ":", "msg_pb", "=", "pb_type", ...
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: ...
[ "Converts", "an", "Any", "protobuf", "to", "the", "specified", "message", "type", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L43-L74
27,755
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
get_messages
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...
python
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", ")", ":", "answer", "=", "collections", ".", "OrderedDict", "(", ")", "for", "name", "in", "dir", "(", "module", ")", ":", "candidate", "=", "getattr", "(", "module", ",", "name", ")", "if", "inspect", ".", "isclas...
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...
[ "Discovers", "all", "protobuf", "Message", "classes", "in", "a", "given", "import", "module", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L99-L116
27,756
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
_resolve_subkeys
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='|') ...
python
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", "=", "\".\"", ")", ":", "parts", "=", "key", ".", "split", "(", "separator", ",", "1", ")", "if", "len", "(", "parts", ")", ">", "1", ":", "return", "parts", "else", ":", "return", "parts", "...
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...
[ "Resolve", "a", "potentially", "nested", "key", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L119-L147
27,757
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
get
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...
python
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", ")", ":", "# 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...
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...
[ "Retrieve", "a", "key", "s", "value", "from", "a", "protobuf", "Message", "or", "dictionary", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L150-L198
27,758
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
_set_field_on_message
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 ...
python
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", ")", ":", "# Attempt to set the value on the types of objects we know how to deal", "# with.", "if", "isinstance", "(", "value", ",", "(", "collections_abc", ".", "MutableSequence", ",", "tuple", ")",...
Set helper for protobuf Messages.
[ "Set", "helper", "for", "protobuf", "Messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L201-L226
27,759
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
set
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...
python
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", ")", ":", "# Sanity check: Is our target object valid?", "if", "not", "isinstance", "(", "msg_or_dict", ",", "(", "collections_abc", ".", "MutableMapping", ",", "message", ".", "Message", ")", ")", ":",...
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.
[ "Set", "a", "key", "s", "value", "on", "a", "protobuf", "Message", "or", "dictionary", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L229-L263
27,760
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
setdefault
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...
python
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", ")", ":", "if", "not", "get", "(", "msg_or_dict", ",", "key", ",", "default", "=", "None", ")", ":", "set", "(", "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, empty list) as a target to be overwritten, on both ...
[ "Set", "the", "key", "on", "a", "protobuf", "Message", "or", "dictionary", "to", "a", "given", "value", "if", "the", "current", "value", "is", "falsy", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L266-L285
27,761
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
field_mask
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)...
python
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", ")", ":", "if", "original", "is", "None", "and", "modified", "is", "None", ":", "return", "field_mask_pb2", ".", "FieldMask", "(", ")", "if", "original", "is", "None", "and", "modified", "is", "not", ...
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 ...
[ "Create", "a", "field", "mask", "by", "comparing", "two", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L288-L326
27,762
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
SubscriberClient.topic_path
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 )
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/topics/{topic}\"", ",", "project", "=", "project", ",", "topic", "=", "topic", ")" ]
Return a fully-qualified topic string.
[ "Return", "a", "fully", "-", "qualified", "topic", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L98-L102
27,763
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
SubscriberClient.create_subscription
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...
python
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"...
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...
[ "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", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L219-L389
27,764
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/completion_client.py
CompletionClient.complete_query
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, ): ...
python
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", ...
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...
[ "Completes", "the", "specified", "prefix", "with", "keyword", "suggestions", ".", "Intended", "for", "use", "by", "a", "job", "search", "auto", "-", "complete", "search", "box", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/completion_client.py#L179-L298
27,765
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
AbstractSessionPool._new_session
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...
python
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", ")", ":", "if", "self", ".", "labels", ":", "return", "self", ".", "_database", ".", "session", "(", "labels", "=", "self", ".", "labels", ")", "return", "self", ".", "_database", ".", "session", "(", ")" ]
Helper for concrete methods creating session instances. :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: new session instance.
[ "Helper", "for", "concrete", "methods", "creating", "session", "instances", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L102-L110
27,766
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
FixedSizePool.clear
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()
python
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", ")", ":", "while", "True", ":", "try", ":", "session", "=", "self", ".", "_sessions", ".", "get", "(", "block", "=", "False", ")", "except", "queue", ".", "Empty", ":", "break", "else", ":", "session", ".", "delete", "(...
Delete all sessions in the pool.
[ "Delete", "all", "sessions", "in", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L210-L219
27,767
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
PingingPool.ping
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) ...
python
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", ")", ":", "while", "True", ":", "try", ":", "ping_after", ",", "session", "=", "self", ".", "_sessions", ".", "get", "(", "block", "=", "False", ")", "except", "queue", ".", "Empty", ":", "# all sessions in use", "break", "i...
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.
[ "Refresh", "maybe", "-", "expired", "sessions", "in", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L405-L424
27,768
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
TransactionPingingPool.begin_pending_transactions
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)
python
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", ")", ":", "while", "not", "self", ".", "_pending_sessions", ".", "empty", "(", ")", ":", "session", "=", "self", ".", "_pending_sessions", ".", "get", "(", ")", "session", ".", "_transaction", ".", "begin", ...
Begin all transactions for sessions added to the pool.
[ "Begin", "all", "transactions", "for", "sessions", "added", "to", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L493-L498
27,769
googleapis/google-cloud-python
logging/google/cloud/logging/handlers/handlers.py
setup_logging
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...
python
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", ")", ":", "all_excluded_loggers", "=", "set", "(", "excluded_loggers", "+", "EXCLUDED_LOGGER_DEFAULTS", ")", "logger", "=...
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) ...
[ "Attach", "a", "logging", "handler", "to", "the", "Python", "root", "logger" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/handlers.py#L112-L156
27,770
googleapis/google-cloud-python
logging/google/cloud/logging/handlers/container_engine.py
ContainerEngineHandler.format
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...
python
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", ")", ":", "message", "=", "super", "(", "ContainerEngineHandler", ",", "self", ")", ".", "format", "(", "record", ")", "return", "format_stackdriver_json", "(", "record", ",", "message", ")" ]
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.
[ "Format", "the", "message", "into", "JSON", "expected", "by", "fluentd", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/container_engine.py#L44-L54
27,771
googleapis/google-cloud-python
language/google/cloud/language_v1/gapic/language_service_client.py
LanguageServiceClient.analyze_sentiment
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: ...
python
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", ".",...
Analyzes the sentiment of the provided text. Example: >>> from google.cloud import language_v1 >>> >>> client = language_v1.LanguageServiceClient() >>> >>> # TODO: Initialize `document`: >>> document = {} >>> >>> re...
[ "Analyzes", "the", "sentiment", "of", "the", "provided", "text", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/language/google/cloud/language_v1/gapic/language_service_client.py#L169-L231
27,772
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/transaction.py
_sleep
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...
python
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", ")", ":", "actual_sleep", "=", "random", ".", "uniform", "(", "0.0", ",", "current_sleep", ")", "time", ".", "sleep", "(", "actual_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...
[ "Sleep", "and", "produce", "a", "new", "sleep", "time", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L387-L409
27,773
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/transaction.py
Transaction._add_write_pbs
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...
python
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", ")", ":", "if", "self", ".", "_read_only", ":", "raise", "ValueError", "(", "_WRITE_READ_ONLY", ")", "super", "(", "Transaction", ",", "self", ")", ".", "_add_write_pbs", "(", "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.
[ "Add", "Write", "protobufs", "to", "this", "transaction", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L65-L78
27,774
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/transaction.py
Transaction._begin
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: ...
python
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", ")", ":", "if", "self", ".", "in_progress", ":", "msg", "=", "_CANT_BEGIN", ".", "format", "(", "self", ".", "_id", ")", "raise", "ValueError", "(", "msg", ")", "transaction_response", "=", "s...
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.
[ "Begin", "the", "transaction", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L135-L154
27,775
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/transaction.py
Transaction._rollback
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...
python
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", ")", ":", "if", "not", "self", ".", "in_progress", ":", "raise", "ValueError", "(", "_CANT_ROLLBACK", ")", "try", ":", "# NOTE: The response is just ``google.protobuf.Empty``.", "self", ".", "_client", ".", "_firestore_api", ".", "...
Roll back the transaction. Raises: ValueError: If no transaction is in progress.
[ "Roll", "back", "the", "transaction", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L164-L181
27,776
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/transaction.py
Transaction._commit
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...
python
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", ")", ":", "if", "not", "self", ".", "in_progress", ":", "raise", "ValueError", "(", "_CANT_COMMIT", ")", "commit_response", "=", "_commit_with_retry", "(", "self", ".", "_client", ",", "self", ".", "_write_pbs", ",", "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 were applied to this transact...
[ "Transactionally", "commit", "the", "changes", "accumulated", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L183-L202
27,777
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/transaction.py
_Transactional._pre_commit
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: ...
python
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", ")", ":", "# Force the ``transaction`` to be not \"in progress\".", "transaction", ".", "_clean_up", "(", ")", "transaction", ".", "_begin", "(", "retry_id", "=", "...
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...
[ "Begin", "transaction", "and", "call", "the", "wrapped", "callable", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L229-L264
27,778
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/transaction.py
_Transactional._maybe_commit
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...
python
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", ":", "transaction", ".", "_commit", "(", ")", "return", "True", "except", "exceptions", ".", "GoogleAPICallError", "as", "exc", ":", "if", "transaction", ".", "_read_only", ":", "raise...
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...
[ "Try", "to", "commit", "the", "transaction", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L266-L291
27,779
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py
ProfileServiceClient.profile_path
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, ...
python
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", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/tenants/{tenant}/profiles/{profile}\"", ",", "project", "=", "project", ...
Return a fully-qualified profile string.
[ "Return", "a", "fully", "-", "qualified", "profile", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L98-L105
27,780
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py
ProfileServiceClient.create_profile
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...
python
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", ".", "DEFAU...
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...
[ "Creates", "and", "returns", "a", "new", "profile", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L313-L384
27,781
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py
ProfileServiceClient.get_profile
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 ...
python
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",...
Gets the specified profile. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.ProfileServiceClient() >>> >>> name = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]') >>> >>> response =...
[ "Gets", "the", "specified", "profile", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L386-L446
27,782
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py
ProfileServiceClient.update_profile
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: ...
python
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", ".", "me...
Updates the specified profile and returns the updated result. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.ProfileServiceClient() >>> >>> # TODO: Initialize `profile`: >>> profile = {} >>...
[ "Updates", "the", "specified", "profile", "and", "returns", "the", "updated", "result", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L448-L545
27,783
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py
ProfileServiceClient.search_profiles
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...
python
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_sen...
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...
[ "Searches", "for", "profiles", "within", "a", "tenant", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L606-L868
27,784
googleapis/google-cloud-python
core/google/cloud/client.py
_ClientFactoryMixin.from_service_account_json
def from_service_account_json(cls, json_credentials_path, *args, **kwargs): """Factory to retrieve JSON credentials while creating client. :type json_credentials_path: str :param json_credentials_path: The path to a private key file (this file was given to ...
python
def from_service_account_json(cls, json_credentials_path, *args, **kwargs): """Factory to retrieve JSON credentials while creating client. :type json_credentials_path: str :param json_credentials_path: The path to a private key file (this file was given to ...
[ "def", "from_service_account_json", "(", "cls", ",", "json_credentials_path", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "\"credentials\"", "in", "kwargs", ":", "raise", "TypeError", "(", "\"credentials must not be in keyword arguments\"", ")", "with...
Factory to retrieve JSON credentials while creating client. :type json_credentials_path: str :param json_credentials_path: The path to a private key file (this file was given to you when you created the service account). This f...
[ "Factory", "to", "retrieve", "JSON", "credentials", "while", "creating", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/client.py#L48-L82
27,785
googleapis/google-cloud-python
core/google/cloud/client.py
Client._http
def _http(self): """Getter for object used for HTTP transport. :rtype: :class:`~requests.Session` :returns: An HTTP object. """ if self._http_internal is None: self._http_internal = google.auth.transport.requests.AuthorizedSession( self._credentials ...
python
def _http(self): """Getter for object used for HTTP transport. :rtype: :class:`~requests.Session` :returns: An HTTP object. """ if self._http_internal is None: self._http_internal = google.auth.transport.requests.AuthorizedSession( self._credentials ...
[ "def", "_http", "(", "self", ")", ":", "if", "self", ".", "_http_internal", "is", "None", ":", "self", ".", "_http_internal", "=", "google", ".", "auth", ".", "transport", ".", "requests", ".", "AuthorizedSession", "(", "self", ".", "_credentials", ")", ...
Getter for object used for HTTP transport. :rtype: :class:`~requests.Session` :returns: An HTTP object.
[ "Getter", "for", "object", "used", "for", "HTTP", "transport", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/client.py#L148-L158
27,786
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py
AlertPolicyServiceClient.alert_policy_path
def alert_policy_path(cls, project, alert_policy): """Return a fully-qualified alert_policy string.""" return google.api_core.path_template.expand( "projects/{project}/alertPolicies/{alert_policy}", project=project, alert_policy=alert_policy, )
python
def alert_policy_path(cls, project, alert_policy): """Return a fully-qualified alert_policy string.""" return google.api_core.path_template.expand( "projects/{project}/alertPolicies/{alert_policy}", project=project, alert_policy=alert_policy, )
[ "def", "alert_policy_path", "(", "cls", ",", "project", ",", "alert_policy", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/alertPolicies/{alert_policy}\"", ",", "project", "=", "project", ",", "alert_p...
Return a fully-qualified alert_policy string.
[ "Return", "a", "fully", "-", "qualified", "alert_policy", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py#L96-L102
27,787
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py
AlertPolicyServiceClient.alert_policy_condition_path
def alert_policy_condition_path(cls, project, alert_policy, condition): """Return a fully-qualified alert_policy_condition string.""" return google.api_core.path_template.expand( "projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}", project=project, ...
python
def alert_policy_condition_path(cls, project, alert_policy, condition): """Return a fully-qualified alert_policy_condition string.""" return google.api_core.path_template.expand( "projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}", project=project, ...
[ "def", "alert_policy_condition_path", "(", "cls", ",", "project", ",", "alert_policy", ",", "condition", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}\"", ...
Return a fully-qualified alert_policy_condition string.
[ "Return", "a", "fully", "-", "qualified", "alert_policy_condition", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py#L105-L112
27,788
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_error_result_to_exception
def _error_result_to_exception(error_result): """Maps BigQuery error reasons to an exception. The reasons and their matching HTTP status codes are documented on the `troubleshooting errors`_ page. .. _troubleshooting errors: https://cloud.google.com/bigquery\ /troubleshooting-errors :type...
python
def _error_result_to_exception(error_result): """Maps BigQuery error reasons to an exception. The reasons and their matching HTTP status codes are documented on the `troubleshooting errors`_ page. .. _troubleshooting errors: https://cloud.google.com/bigquery\ /troubleshooting-errors :type...
[ "def", "_error_result_to_exception", "(", "error_result", ")", ":", "reason", "=", "error_result", ".", "get", "(", "\"reason\"", ")", "status_code", "=", "_ERROR_REASON_TO_EXCEPTION", ".", "get", "(", "reason", ",", "http_client", ".", "INTERNAL_SERVER_ERROR", ")",...
Maps BigQuery error reasons to an exception. The reasons and their matching HTTP status codes are documented on the `troubleshooting errors`_ page. .. _troubleshooting errors: https://cloud.google.com/bigquery\ /troubleshooting-errors :type error_result: Mapping[str, str] :param error_res...
[ "Maps", "BigQuery", "error", "reasons", "to", "an", "exception", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L71-L92
27,789
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_JobReference._from_api_repr
def _from_api_repr(cls, resource): """Returns a job reference for an API resource representation.""" job_id = resource.get("jobId") project = resource.get("projectId") location = resource.get("location") job_ref = cls(job_id, project, location) return job_ref
python
def _from_api_repr(cls, resource): """Returns a job reference for an API resource representation.""" job_id = resource.get("jobId") project = resource.get("projectId") location = resource.get("location") job_ref = cls(job_id, project, location) return job_ref
[ "def", "_from_api_repr", "(", "cls", ",", "resource", ")", ":", "job_id", "=", "resource", ".", "get", "(", "\"jobId\"", ")", "project", "=", "resource", ".", "get", "(", "\"projectId\"", ")", "location", "=", "resource", ".", "get", "(", "\"location\"", ...
Returns a job reference for an API resource representation.
[ "Returns", "a", "job", "reference", "for", "an", "API", "resource", "representation", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L269-L275
27,790
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_AsyncJob.created
def created(self): """Datetime at which the job was created. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the creation time (None until set from the server). """ statistics = self._properties.get("statistics") if statistics is not None: millis = s...
python
def created(self): """Datetime at which the job was created. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the creation time (None until set from the server). """ statistics = self._properties.get("statistics") if statistics is not None: millis = s...
[ "def", "created", "(", "self", ")", ":", "statistics", "=", "self", ".", "_properties", ".", "get", "(", "\"statistics\"", ")", "if", "statistics", "is", "not", "None", ":", "millis", "=", "statistics", ".", "get", "(", "\"creationTime\"", ")", "if", "mi...
Datetime at which the job was created. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the creation time (None until set from the server).
[ "Datetime", "at", "which", "the", "job", "was", "created", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L389-L399
27,791
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_AsyncJob.started
def started(self): """Datetime at which the job was started. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the start time (None until set from the server). """ statistics = self._properties.get("statistics") if statistics is not None: millis = stat...
python
def started(self): """Datetime at which the job was started. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the start time (None until set from the server). """ statistics = self._properties.get("statistics") if statistics is not None: millis = stat...
[ "def", "started", "(", "self", ")", ":", "statistics", "=", "self", ".", "_properties", ".", "get", "(", "\"statistics\"", ")", "if", "statistics", "is", "not", "None", ":", "millis", "=", "statistics", ".", "get", "(", "\"startTime\"", ")", "if", "milli...
Datetime at which the job was started. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the start time (None until set from the server).
[ "Datetime", "at", "which", "the", "job", "was", "started", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L402-L412
27,792
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_AsyncJob.ended
def ended(self): """Datetime at which the job finished. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the end time (None until set from the server). """ statistics = self._properties.get("statistics") if statistics is not None: millis = statistics....
python
def ended(self): """Datetime at which the job finished. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the end time (None until set from the server). """ statistics = self._properties.get("statistics") if statistics is not None: millis = statistics....
[ "def", "ended", "(", "self", ")", ":", "statistics", "=", "self", ".", "_properties", ".", "get", "(", "\"statistics\"", ")", "if", "statistics", "is", "not", "None", ":", "millis", "=", "statistics", ".", "get", "(", "\"endTime\"", ")", "if", "millis", ...
Datetime at which the job finished. :rtype: ``datetime.datetime``, or ``NoneType`` :returns: the end time (None until set from the server).
[ "Datetime", "at", "which", "the", "job", "finished", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L415-L425
27,793
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_AsyncJob._job_statistics
def _job_statistics(self): """Helper for job-type specific statistics-based properties.""" statistics = self._properties.get("statistics", {}) return statistics.get(self._JOB_TYPE, {})
python
def _job_statistics(self): """Helper for job-type specific statistics-based properties.""" statistics = self._properties.get("statistics", {}) return statistics.get(self._JOB_TYPE, {})
[ "def", "_job_statistics", "(", "self", ")", ":", "statistics", "=", "self", ".", "_properties", ".", "get", "(", "\"statistics\"", ",", "{", "}", ")", "return", "statistics", ".", "get", "(", "self", ".", "_JOB_TYPE", ",", "{", "}", ")" ]
Helper for job-type specific statistics-based properties.
[ "Helper", "for", "job", "-", "type", "specific", "statistics", "-", "based", "properties", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L427-L430
27,794
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_AsyncJob._set_future_result
def _set_future_result(self): """Set the result or exception from the job if it is complete.""" # This must be done in a lock to prevent the polling thread # and main thread from both executing the completion logic # at the same time. with self._completion_lock: # If ...
python
def _set_future_result(self): """Set the result or exception from the job if it is complete.""" # This must be done in a lock to prevent the polling thread # and main thread from both executing the completion logic # at the same time. with self._completion_lock: # If ...
[ "def", "_set_future_result", "(", "self", ")", ":", "# This must be done in a lock to prevent the polling thread", "# and main thread from both executing the completion logic", "# at the same time.", "with", "self", ".", "_completion_lock", ":", "# If the operation isn't complete or if t...
Set the result or exception from the job if it is complete.
[ "Set", "the", "result", "or", "exception", "from", "the", "job", "if", "it", "is", "complete", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L651-L668
27,795
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
_JobConfig._fill_from_default
def _fill_from_default(self, default_job_config): """Merge this job config with a default job config. The keys in this object take precedence over the keys in the default config. The merge is done at the top-level as well as for keys one level below the job type. Arguments: ...
python
def _fill_from_default(self, default_job_config): """Merge this job config with a default job config. The keys in this object take precedence over the keys in the default config. The merge is done at the top-level as well as for keys one level below the job type. Arguments: ...
[ "def", "_fill_from_default", "(", "self", ",", "default_job_config", ")", ":", "if", "self", ".", "_job_type", "!=", "default_job_config", ".", "_job_type", ":", "raise", "TypeError", "(", "\"attempted to merge two incompatible job types: \"", "+", "repr", "(", "self"...
Merge this job config with a default job config. The keys in this object take precedence over the keys in the default config. The merge is done at the top-level as well as for keys one level below the job type. Arguments: default_job_config (google.cloud.bigquery.job._JobCo...
[ "Merge", "this", "job", "config", "with", "a", "default", "job", "config", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L837-L869
27,796
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
ExtractJob.destination_uri_file_counts
def destination_uri_file_counts(self): """Return file counts from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.extract.destinationUriFileCounts Returns: a list of integer counts, each representing the number of fi...
python
def destination_uri_file_counts(self): """Return file counts from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.extract.destinationUriFileCounts Returns: a list of integer counts, each representing the number of fi...
[ "def", "destination_uri_file_counts", "(", "self", ")", ":", "counts", "=", "self", ".", "_job_statistics", "(", ")", ".", "get", "(", "\"destinationUriFileCounts\"", ")", "if", "counts", "is", "not", "None", ":", "return", "[", "int", "(", "count", ")", "...
Return file counts from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.extract.destinationUriFileCounts Returns: a list of integer counts, each representing the number of files per destination URI or URI pattern...
[ "Return", "file", "counts", "from", "job", "statistics", "if", "present", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1859-L1875
27,797
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
QueryJobConfig.to_api_repr
def to_api_repr(self): """Build an API representation of the query job config. Returns: dict: A dictionary in the format used by the BigQuery API. """ resource = copy.deepcopy(self._properties) # Query parameters have an addition property associated with them ...
python
def to_api_repr(self): """Build an API representation of the query job config. Returns: dict: A dictionary in the format used by the BigQuery API. """ resource = copy.deepcopy(self._properties) # Query parameters have an addition property associated with them ...
[ "def", "to_api_repr", "(", "self", ")", ":", "resource", "=", "copy", ".", "deepcopy", "(", "self", ".", "_properties", ")", "# Query parameters have an addition property associated with them", "# to indicate if the query is using named or positional parameters.", "query_paramete...
Build an API representation of the query job config. Returns: dict: A dictionary in the format used by the BigQuery API.
[ "Build", "an", "API", "representation", "of", "the", "query", "job", "config", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2311-L2328
27,798
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
QueryJob.query_plan
def query_plan(self): """Return query plan from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.queryPlan :rtype: list of :class:`QueryPlanEntry` :returns: mappings describing the query plan, or an empty list ...
python
def query_plan(self): """Return query plan from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.queryPlan :rtype: list of :class:`QueryPlanEntry` :returns: mappings describing the query plan, or an empty list ...
[ "def", "query_plan", "(", "self", ")", ":", "plan_entries", "=", "self", ".", "_job_statistics", "(", ")", ".", "get", "(", "\"queryPlan\"", ",", "(", ")", ")", "return", "[", "QueryPlanEntry", ".", "from_api_repr", "(", "entry", ")", "for", "entry", "in...
Return query plan from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.queryPlan :rtype: list of :class:`QueryPlanEntry` :returns: mappings describing the query plan, or an empty list if the query has not...
[ "Return", "query", "plan", "from", "job", "statistics", "if", "present", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2555-L2566
27,799
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/job.py
QueryJob.total_bytes_processed
def total_bytes_processed(self): """Return total bytes processed from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesProcessed :rtype: int or None :returns: total bytes processed by the job, or None if j...
python
def total_bytes_processed(self): """Return total bytes processed from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesProcessed :rtype: int or None :returns: total bytes processed by the job, or None if j...
[ "def", "total_bytes_processed", "(", "self", ")", ":", "result", "=", "self", ".", "_job_statistics", "(", ")", ".", "get", "(", "\"totalBytesProcessed\"", ")", "if", "result", "is", "not", "None", ":", "result", "=", "int", "(", "result", ")", "return", ...
Return total bytes processed from job statistics, if present. See: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesProcessed :rtype: int or None :returns: total bytes processed by the job, or None if job is not yet complete.
[ "Return", "total", "bytes", "processed", "from", "job", "statistics", "if", "present", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2577-L2590