partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | JSONConnection._make_request | A low level method to send a request to the API.
Typically, you shouldn't need to use this method.
:type method: str
:param method: The HTTP method to use in the request.
:type url: str
:param url: The URL to send the request to.
:type data: str
:param data: T... | core/google/cloud/_http.py | def _make_request(
self,
method,
url,
data=None,
content_type=None,
headers=None,
target_object=None,
):
"""A low level method to send a request to the API.
Typically, you shouldn't need to use this method.
:type method: str
:... | def _make_request(
self,
method,
url,
data=None,
content_type=None,
headers=None,
target_object=None,
):
"""A low level method to send a request to the API.
Typically, you shouldn't need to use this method.
:type method: str
:... | [
"A",
"low",
"level",
"method",
"to",
"send",
"a",
"request",
"to",
"the",
"API",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/_http.py#L144-L192 | [
"def",
"_make_request",
"(",
"self",
",",
"method",
",",
"url",
",",
"data",
"=",
"None",
",",
"content_type",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"target_object",
"=",
"None",
",",
")",
":",
"headers",
"=",
"headers",
"or",
"{",
"}",
"hea... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | JSONConnection._do_request | Low-level helper: perform the actual API request over HTTP.
Allows batch context managers to override and defer a request.
:type method: str
:param method: The HTTP method to use in the request.
:type url: str
:param url: The URL to send the request to.
:type headers... | core/google/cloud/_http.py | def _do_request(
self, method, url, headers, data, target_object
): # pylint: disable=unused-argument
"""Low-level helper: perform the actual API request over HTTP.
Allows batch context managers to override and defer a request.
:type method: str
:param method: The HTTP me... | def _do_request(
self, method, url, headers, data, target_object
): # pylint: disable=unused-argument
"""Low-level helper: perform the actual API request over HTTP.
Allows batch context managers to override and defer a request.
:type method: str
:param method: The HTTP me... | [
"Low",
"-",
"level",
"helper",
":",
"perform",
"the",
"actual",
"API",
"request",
"over",
"HTTP",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/_http.py#L194-L221 | [
"def",
"_do_request",
"(",
"self",
",",
"method",
",",
"url",
",",
"headers",
",",
"data",
",",
"target_object",
")",
":",
"# pylint: disable=unused-argument",
"return",
"self",
".",
"http",
".",
"request",
"(",
"url",
"=",
"url",
",",
"method",
"=",
"meth... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | JSONConnection.api_request | Make a request over the HTTP transport to the API.
You shouldn't need to use this method, but if you plan to
interact with the API using these primitives, this is the
correct one to use.
:type method: str
:param method: The HTTP method name (ie, ``GET``, ``POST``, etc).
... | core/google/cloud/_http.py | def api_request(
self,
method,
path,
query_params=None,
data=None,
content_type=None,
headers=None,
api_base_url=None,
api_version=None,
expect_json=True,
_target_object=None,
):
"""Make a request over the HTTP transport... | def api_request(
self,
method,
path,
query_params=None,
data=None,
content_type=None,
headers=None,
api_base_url=None,
api_version=None,
expect_json=True,
_target_object=None,
):
"""Make a request over the HTTP transport... | [
"Make",
"a",
"request",
"over",
"the",
"HTTP",
"transport",
"to",
"the",
"API",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/_http.py#L223-L324 | [
"def",
"api_request",
"(",
"self",
",",
"method",
",",
"path",
",",
"query_params",
"=",
"None",
",",
"data",
"=",
"None",
",",
"content_type",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"api_base_url",
"=",
"None",
",",
"api_version",
"=",
"None",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _build_label_filter | Construct a filter string to filter on metric or resource labels. | monitoring/google/cloud/monitoring_v3/query.py | def _build_label_filter(category, *args, **kwargs):
"""Construct a filter string to filter on metric or resource labels."""
terms = list(args)
for key, value in six.iteritems(kwargs):
if value is None:
continue
suffix = None
if key.endswith(
("_prefix", "_suf... | def _build_label_filter(category, *args, **kwargs):
"""Construct a filter string to filter on metric or resource labels."""
terms = list(args)
for key, value in six.iteritems(kwargs):
if value is None:
continue
suffix = None
if key.endswith(
("_prefix", "_suf... | [
"Construct",
"a",
"filter",
"string",
"to",
"filter",
"on",
"metric",
"or",
"resource",
"labels",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L592-L627 | [
"def",
"_build_label_filter",
"(",
"category",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"terms",
"=",
"list",
"(",
"args",
")",
"for",
"key",
",",
"value",
"in",
"six",
".",
"iteritems",
"(",
"kwargs",
")",
":",
"if",
"value",
"is",
"No... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.select_interval | Copy the query and set the query time interval.
Example::
import datetime
now = datetime.datetime.utcnow()
query = query.select_interval(
end_time=now,
start_time=now - datetime.timedelta(minutes=5))
As a convenience, you can altern... | monitoring/google/cloud/monitoring_v3/query.py | def select_interval(self, end_time, start_time=None):
"""Copy the query and set the query time interval.
Example::
import datetime
now = datetime.datetime.utcnow()
query = query.select_interval(
end_time=now,
start_time=now - datetim... | def select_interval(self, end_time, start_time=None):
"""Copy the query and set the query time interval.
Example::
import datetime
now = datetime.datetime.utcnow()
query = query.select_interval(
end_time=now,
start_time=now - datetim... | [
"Copy",
"the",
"query",
"and",
"set",
"the",
"query",
"time",
"interval",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L134-L165 | [
"def",
"select_interval",
"(",
"self",
",",
"end_time",
",",
"start_time",
"=",
"None",
")",
":",
"new_query",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"new_query",
".",
"_end_time",
"=",
"end_time",
"new_query",
".",
"_start_time",
"=",
"start_time",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.select_group | Copy the query and add filtering by group.
Example::
query = query.select_group('1234567')
:type group_id: str
:param group_id: The ID of a group to filter by.
:rtype: :class:`Query`
:returns: The new query object. | monitoring/google/cloud/monitoring_v3/query.py | def select_group(self, group_id):
"""Copy the query and add filtering by group.
Example::
query = query.select_group('1234567')
:type group_id: str
:param group_id: The ID of a group to filter by.
:rtype: :class:`Query`
:returns: The new query object.
... | def select_group(self, group_id):
"""Copy the query and add filtering by group.
Example::
query = query.select_group('1234567')
:type group_id: str
:param group_id: The ID of a group to filter by.
:rtype: :class:`Query`
:returns: The new query object.
... | [
"Copy",
"the",
"query",
"and",
"add",
"filtering",
"by",
"group",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L167-L182 | [
"def",
"select_group",
"(",
"self",
",",
"group_id",
")",
":",
"new_query",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"new_query",
".",
"_filter",
".",
"group_id",
"=",
"group_id",
"return",
"new_query"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.select_projects | Copy the query and add filtering by monitored projects.
This is only useful if the target project represents a Stackdriver
account containing the specified monitored projects.
Examples::
query = query.select_projects('project-1')
query = query.select_projects('project-... | monitoring/google/cloud/monitoring_v3/query.py | def select_projects(self, *args):
"""Copy the query and add filtering by monitored projects.
This is only useful if the target project represents a Stackdriver
account containing the specified monitored projects.
Examples::
query = query.select_projects('project-1')
... | def select_projects(self, *args):
"""Copy the query and add filtering by monitored projects.
This is only useful if the target project represents a Stackdriver
account containing the specified monitored projects.
Examples::
query = query.select_projects('project-1')
... | [
"Copy",
"the",
"query",
"and",
"add",
"filtering",
"by",
"monitored",
"projects",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L184-L204 | [
"def",
"select_projects",
"(",
"self",
",",
"*",
"args",
")",
":",
"new_query",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"new_query",
".",
"_filter",
".",
"projects",
"=",
"args",
"return",
"new_query"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.select_resources | Copy the query and add filtering by resource labels.
Examples::
query = query.select_resources(zone='us-central1-a')
query = query.select_resources(zone_prefix='europe-')
query = query.select_resources(resource_type='gce_instance')
A keyword argument ``<label>=<val... | monitoring/google/cloud/monitoring_v3/query.py | def select_resources(self, *args, **kwargs):
"""Copy the query and add filtering by resource labels.
Examples::
query = query.select_resources(zone='us-central1-a')
query = query.select_resources(zone_prefix='europe-')
query = query.select_resources(resource_type='g... | def select_resources(self, *args, **kwargs):
"""Copy the query and add filtering by resource labels.
Examples::
query = query.select_resources(zone='us-central1-a')
query = query.select_resources(zone_prefix='europe-')
query = query.select_resources(resource_type='g... | [
"Copy",
"the",
"query",
"and",
"add",
"filtering",
"by",
"resource",
"labels",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L206-L262 | [
"def",
"select_resources",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"new_query",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"new_query",
".",
"_filter",
".",
"select_resources",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.select_metrics | Copy the query and add filtering by metric labels.
Examples::
query = query.select_metrics(instance_name='myinstance')
query = query.select_metrics(instance_name_prefix='mycluster-')
A keyword argument ``<label>=<value>`` ordinarily generates a filter
expression of the... | monitoring/google/cloud/monitoring_v3/query.py | def select_metrics(self, *args, **kwargs):
"""Copy the query and add filtering by metric labels.
Examples::
query = query.select_metrics(instance_name='myinstance')
query = query.select_metrics(instance_name_prefix='mycluster-')
A keyword argument ``<label>=<value>`` o... | def select_metrics(self, *args, **kwargs):
"""Copy the query and add filtering by metric labels.
Examples::
query = query.select_metrics(instance_name='myinstance')
query = query.select_metrics(instance_name_prefix='mycluster-')
A keyword argument ``<label>=<value>`` o... | [
"Copy",
"the",
"query",
"and",
"add",
"filtering",
"by",
"metric",
"labels",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L264-L321 | [
"def",
"select_metrics",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"new_query",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"new_query",
".",
"_filter",
".",
"select_metrics",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.align | Copy the query and add temporal alignment.
If ``per_series_aligner`` is not :data:`Aligner.ALIGN_NONE`, each time
series will contain data points only on the period boundaries.
Example::
from google.cloud.monitoring import enums
query = query.align(
enu... | monitoring/google/cloud/monitoring_v3/query.py | def align(self, per_series_aligner, seconds=0, minutes=0, hours=0):
"""Copy the query and add temporal alignment.
If ``per_series_aligner`` is not :data:`Aligner.ALIGN_NONE`, each time
series will contain data points only on the period boundaries.
Example::
from google.clo... | def align(self, per_series_aligner, seconds=0, minutes=0, hours=0):
"""Copy the query and add temporal alignment.
If ``per_series_aligner`` is not :data:`Aligner.ALIGN_NONE`, each time
series will contain data points only on the period boundaries.
Example::
from google.clo... | [
"Copy",
"the",
"query",
"and",
"add",
"temporal",
"alignment",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L323-L366 | [
"def",
"align",
"(",
"self",
",",
"per_series_aligner",
",",
"seconds",
"=",
"0",
",",
"minutes",
"=",
"0",
",",
"hours",
"=",
"0",
")",
":",
"new_query",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"new_query",
".",
"_per_series_aligner",
"=",
"pe... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.reduce | Copy the query and add cross-series reduction.
Cross-series reduction combines time series by aggregating their
data points.
For example, you could request an aggregated time series for each
combination of project and zone as follows::
from google.cloud.monitoring import e... | monitoring/google/cloud/monitoring_v3/query.py | def reduce(self, cross_series_reducer, *group_by_fields):
"""Copy the query and add cross-series reduction.
Cross-series reduction combines time series by aggregating their
data points.
For example, you could request an aggregated time series for each
combination of project and... | def reduce(self, cross_series_reducer, *group_by_fields):
"""Copy the query and add cross-series reduction.
Cross-series reduction combines time series by aggregating their
data points.
For example, you could request an aggregated time series for each
combination of project and... | [
"Copy",
"the",
"query",
"and",
"add",
"cross",
"-",
"series",
"reduction",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L368-L405 | [
"def",
"reduce",
"(",
"self",
",",
"cross_series_reducer",
",",
"*",
"group_by_fields",
")",
":",
"new_query",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
")",
"new_query",
".",
"_cross_series_reducer",
"=",
"cross_series_reducer",
"new_query",
".",
"_group_by_fiel... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.iter | Yield all time series objects selected by the query.
The generator returned iterates over
:class:`~google.cloud.monitoring_v3.types.TimeSeries` objects
containing points ordered from oldest to newest.
Note that the :class:`Query` object itself is an iterable, such that
the foll... | monitoring/google/cloud/monitoring_v3/query.py | def iter(self, headers_only=False, page_size=None):
"""Yield all time series objects selected by the query.
The generator returned iterates over
:class:`~google.cloud.monitoring_v3.types.TimeSeries` objects
containing points ordered from oldest to newest.
Note that the :class:`... | def iter(self, headers_only=False, page_size=None):
"""Yield all time series objects selected by the query.
The generator returned iterates over
:class:`~google.cloud.monitoring_v3.types.TimeSeries` objects
containing points ordered from oldest to newest.
Note that the :class:`... | [
"Yield",
"all",
"time",
"series",
"objects",
"selected",
"by",
"the",
"query",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L407-L441 | [
"def",
"iter",
"(",
"self",
",",
"headers_only",
"=",
"False",
",",
"page_size",
"=",
"None",
")",
":",
"if",
"self",
".",
"_end_time",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Query time interval not specified.\"",
")",
"params",
"=",
"self",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query._build_query_params | Return key-value pairs for the list_time_series API call.
:type headers_only: bool
:param headers_only:
Whether to omit the point data from the
:class:`~google.cloud.monitoring_v3.types.TimeSeries` objects.
:type page_size: int
:param page_size:
(O... | monitoring/google/cloud/monitoring_v3/query.py | def _build_query_params(self, headers_only=False, page_size=None):
"""Return key-value pairs for the list_time_series API call.
:type headers_only: bool
:param headers_only:
Whether to omit the point data from the
:class:`~google.cloud.monitoring_v3.types.TimeSeries` o... | def _build_query_params(self, headers_only=False, page_size=None):
"""Return key-value pairs for the list_time_series API call.
:type headers_only: bool
:param headers_only:
Whether to omit the point data from the
:class:`~google.cloud.monitoring_v3.types.TimeSeries` o... | [
"Return",
"key",
"-",
"value",
"pairs",
"for",
"the",
"list_time_series",
"API",
"call",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/query.py#L443-L485 | [
"def",
"_build_query_params",
"(",
"self",
",",
"headers_only",
"=",
"False",
",",
"page_size",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"name\"",
":",
"self",
".",
"_project_path",
",",
"\"filter_\"",
":",
"self",
".",
"filter",
"}",
"params",
"[",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Project.from_api_repr | Factory: construct a project given its API representation.
:type resource: dict
:param resource: project resource representation returned from the API
:type client: :class:`google.cloud.resource_manager.client.Client`
:param client: The Client used with this project.
:rtype: ... | resource_manager/google/cloud/resource_manager/project.py | def from_api_repr(cls, resource, client):
"""Factory: construct a project given its API representation.
:type resource: dict
:param resource: project resource representation returned from the API
:type client: :class:`google.cloud.resource_manager.client.Client`
:param client:... | def from_api_repr(cls, resource, client):
"""Factory: construct a project given its API representation.
:type resource: dict
:param resource: project resource representation returned from the API
:type client: :class:`google.cloud.resource_manager.client.Client`
:param client:... | [
"Factory",
":",
"construct",
"a",
"project",
"given",
"its",
"API",
"representation",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/project.py#L68-L82 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"project",
"=",
"cls",
"(",
"project_id",
"=",
"resource",
"[",
"\"projectId\"",
"]",
",",
"client",
"=",
"client",
")",
"project",
".",
"set_properties_from_api_repr",
"(",
"resou... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Project.set_properties_from_api_repr | Update specific properties from its API representation. | resource_manager/google/cloud/resource_manager/project.py | def set_properties_from_api_repr(self, resource):
"""Update specific properties from its API representation."""
self.name = resource.get("name")
self.number = resource["projectNumber"]
self.labels = resource.get("labels", {})
self.status = resource["lifecycleState"]
if "p... | def set_properties_from_api_repr(self, resource):
"""Update specific properties from its API representation."""
self.name = resource.get("name")
self.number = resource["projectNumber"]
self.labels = resource.get("labels", {})
self.status = resource["lifecycleState"]
if "p... | [
"Update",
"specific",
"properties",
"from",
"its",
"API",
"representation",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/project.py#L84-L91 | [
"def",
"set_properties_from_api_repr",
"(",
"self",
",",
"resource",
")",
":",
"self",
".",
"name",
"=",
"resource",
".",
"get",
"(",
"\"name\"",
")",
"self",
".",
"number",
"=",
"resource",
"[",
"\"projectNumber\"",
"]",
"self",
".",
"labels",
"=",
"resou... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Project.create | API call: create the project via a ``POST`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/create
:type client: :class:`google.cloud.resource_manager.client.Client` or
:data:`NoneType <types.NoneType>`
:param client: the cl... | resource_manager/google/cloud/resource_manager/project.py | def create(self, client=None):
"""API call: create the project via a ``POST`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/create
:type client: :class:`google.cloud.resource_manager.client.Client` or
:data:`NoneType <type... | def create(self, client=None):
"""API call: create the project via a ``POST`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/create
:type client: :class:`google.cloud.resource_manager.client.Client` or
:data:`NoneType <type... | [
"API",
"call",
":",
"create",
"the",
"project",
"via",
"a",
"POST",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/project.py#L120-L137 | [
"def",
"create",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"data",
"=",
"{",
"\"projectId\"",
":",
"self",
".",
"project_id",
",",
"\"name\"",
":",
"self",
".",
"name",
",",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Project.update | API call: update the project via a ``PUT`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/update
:type client: :class:`google.cloud.resource_manager.client.Client` or
:data:`NoneType <types.NoneType>`
:param client: the cli... | resource_manager/google/cloud/resource_manager/project.py | def update(self, client=None):
"""API call: update the project via a ``PUT`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/update
:type client: :class:`google.cloud.resource_manager.client.Client` or
:data:`NoneType <types... | def update(self, client=None):
"""API call: update the project via a ``PUT`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/update
:type client: :class:`google.cloud.resource_manager.client.Client` or
:data:`NoneType <types... | [
"API",
"call",
":",
"update",
"the",
"project",
"via",
"a",
"PUT",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/project.py#L193-L209 | [
"def",
"update",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"data",
"=",
"{",
"\"name\"",
":",
"self",
".",
"name",
",",
"\"labels\"",
":",
"self",
".",
"labels",
",",
"\"pare... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Project.delete | API call: delete the project via a ``DELETE`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/delete
This actually changes the status (``lifecycleState``) from ``ACTIVE``
to ``DELETE_REQUESTED``.
Later (it's not specified when), the proje... | resource_manager/google/cloud/resource_manager/project.py | def delete(self, client=None, reload_data=False):
"""API call: delete the project via a ``DELETE`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/delete
This actually changes the status (``lifecycleState``) from ``ACTIVE``
to ``DELETE_RE... | def delete(self, client=None, reload_data=False):
"""API call: delete the project via a ``DELETE`` request.
See
https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/delete
This actually changes the status (``lifecycleState``) from ``ACTIVE``
to ``DELETE_RE... | [
"API",
"call",
":",
"delete",
"the",
"project",
"via",
"a",
"DELETE",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/project.py#L211-L240 | [
"def",
"delete",
"(",
"self",
",",
"client",
"=",
"None",
",",
"reload_data",
"=",
"False",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"client",
".",
"_connection",
".",
"api_request",
"(",
"method",
"=",
"\"DELETE\"",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _get_meaning | Get the meaning from a protobuf value.
:type value_pb: :class:`.entity_pb2.Value`
:param value_pb: The protobuf value to be checked for an
associated meaning.
:type is_list: bool
:param is_list: Boolean indicating if the ``value_pb`` contains
a list value.
... | datastore/google/cloud/datastore/helpers.py | def _get_meaning(value_pb, is_list=False):
"""Get the meaning from a protobuf value.
:type value_pb: :class:`.entity_pb2.Value`
:param value_pb: The protobuf value to be checked for an
associated meaning.
:type is_list: bool
:param is_list: Boolean indicating if the ``value_pb... | def _get_meaning(value_pb, is_list=False):
"""Get the meaning from a protobuf value.
:type value_pb: :class:`.entity_pb2.Value`
:param value_pb: The protobuf value to be checked for an
associated meaning.
:type is_list: bool
:param is_list: Boolean indicating if the ``value_pb... | [
"Get",
"the",
"meaning",
"from",
"a",
"protobuf",
"value",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L35-L74 | [
"def",
"_get_meaning",
"(",
"value_pb",
",",
"is_list",
"=",
"False",
")",
":",
"meaning",
"=",
"None",
"if",
"is_list",
":",
"# An empty list will have no values, hence no shared meaning",
"# set among them.",
"if",
"len",
"(",
"value_pb",
".",
"array_value",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | entity_from_protobuf | Factory method for creating an entity based on a protobuf.
The protobuf should be one returned from the Cloud Datastore
Protobuf API.
:type pb: :class:`.entity_pb2.Entity`
:param pb: The Protobuf representing the entity.
:rtype: :class:`google.cloud.datastore.entity.Entity`
:returns: The enti... | datastore/google/cloud/datastore/helpers.py | def entity_from_protobuf(pb):
"""Factory method for creating an entity based on a protobuf.
The protobuf should be one returned from the Cloud Datastore
Protobuf API.
:type pb: :class:`.entity_pb2.Entity`
:param pb: The Protobuf representing the entity.
:rtype: :class:`google.cloud.datastore.... | def entity_from_protobuf(pb):
"""Factory method for creating an entity based on a protobuf.
The protobuf should be one returned from the Cloud Datastore
Protobuf API.
:type pb: :class:`.entity_pb2.Entity`
:param pb: The Protobuf representing the entity.
:rtype: :class:`google.cloud.datastore.... | [
"Factory",
"method",
"for",
"creating",
"an",
"entity",
"based",
"on",
"a",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L105-L159 | [
"def",
"entity_from_protobuf",
"(",
"pb",
")",
":",
"key",
"=",
"None",
"if",
"pb",
".",
"HasField",
"(",
"\"key\"",
")",
":",
"# Message field (Key)",
"key",
"=",
"key_from_protobuf",
"(",
"pb",
".",
"key",
")",
"entity_props",
"=",
"{",
"}",
"entity_mean... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _set_pb_meaning_from_entity | Add meaning information (from an entity) to a protobuf.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity to be turned into a protobuf.
:type name: str
:param name: The name of the property.
:type value: object
:param value: The current value stored as prop... | datastore/google/cloud/datastore/helpers.py | def _set_pb_meaning_from_entity(entity, name, value, value_pb, is_list=False):
"""Add meaning information (from an entity) to a protobuf.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity to be turned into a protobuf.
:type name: str
:param name: The name of the... | def _set_pb_meaning_from_entity(entity, name, value, value_pb, is_list=False):
"""Add meaning information (from an entity) to a protobuf.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity to be turned into a protobuf.
:type name: str
:param name: The name of the... | [
"Add",
"meaning",
"information",
"(",
"from",
"an",
"entity",
")",
"to",
"a",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L162-L199 | [
"def",
"_set_pb_meaning_from_entity",
"(",
"entity",
",",
"name",
",",
"value",
",",
"value_pb",
",",
"is_list",
"=",
"False",
")",
":",
"if",
"name",
"not",
"in",
"entity",
".",
"_meanings",
":",
"return",
"meaning",
",",
"orig_value",
"=",
"entity",
".",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | entity_to_protobuf | Converts an entity into a protobuf.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity to be turned into a protobuf.
:rtype: :class:`.entity_pb2.Entity`
:returns: The protobuf representing the entity. | datastore/google/cloud/datastore/helpers.py | def entity_to_protobuf(entity):
"""Converts an entity into a protobuf.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity to be turned into a protobuf.
:rtype: :class:`.entity_pb2.Entity`
:returns: The protobuf representing the entity.
"""
entity_pb = ent... | def entity_to_protobuf(entity):
"""Converts an entity into a protobuf.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity to be turned into a protobuf.
:rtype: :class:`.entity_pb2.Entity`
:returns: The protobuf representing the entity.
"""
entity_pb = ent... | [
"Converts",
"an",
"entity",
"into",
"a",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L202-L236 | [
"def",
"entity_to_protobuf",
"(",
"entity",
")",
":",
"entity_pb",
"=",
"entity_pb2",
".",
"Entity",
"(",
")",
"if",
"entity",
".",
"key",
"is",
"not",
"None",
":",
"key_pb",
"=",
"entity",
".",
"key",
".",
"to_protobuf",
"(",
")",
"entity_pb",
".",
"k... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | get_read_options | Validate rules for read options, and assign to the request.
Helper method for ``lookup()`` and ``run_query``.
:type eventual: bool
:param eventual: Flag indicating if ``EVENTUAL`` or ``STRONG``
consistency should be used.
:type transaction_id: bytes
:param transaction_id: A t... | datastore/google/cloud/datastore/helpers.py | def get_read_options(eventual, transaction_id):
"""Validate rules for read options, and assign to the request.
Helper method for ``lookup()`` and ``run_query``.
:type eventual: bool
:param eventual: Flag indicating if ``EVENTUAL`` or ``STRONG``
consistency should be used.
:ty... | def get_read_options(eventual, transaction_id):
"""Validate rules for read options, and assign to the request.
Helper method for ``lookup()`` and ``run_query``.
:type eventual: bool
:param eventual: Flag indicating if ``EVENTUAL`` or ``STRONG``
consistency should be used.
:ty... | [
"Validate",
"rules",
"for",
"read",
"options",
"and",
"assign",
"to",
"the",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L239-L267 | [
"def",
"get_read_options",
"(",
"eventual",
",",
"transaction_id",
")",
":",
"if",
"transaction_id",
"is",
"None",
":",
"if",
"eventual",
":",
"return",
"datastore_pb2",
".",
"ReadOptions",
"(",
"read_consistency",
"=",
"datastore_pb2",
".",
"ReadOptions",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | key_from_protobuf | Factory method for creating a key based on a protobuf.
The protobuf should be one returned from the Cloud Datastore
Protobuf API.
:type pb: :class:`.entity_pb2.Key`
:param pb: The Protobuf representing the key.
:rtype: :class:`google.cloud.datastore.key.Key`
:returns: a new `Key` instance | datastore/google/cloud/datastore/helpers.py | def key_from_protobuf(pb):
"""Factory method for creating a key based on a protobuf.
The protobuf should be one returned from the Cloud Datastore
Protobuf API.
:type pb: :class:`.entity_pb2.Key`
:param pb: The Protobuf representing the key.
:rtype: :class:`google.cloud.datastore.key.Key`
... | def key_from_protobuf(pb):
"""Factory method for creating a key based on a protobuf.
The protobuf should be one returned from the Cloud Datastore
Protobuf API.
:type pb: :class:`.entity_pb2.Key`
:param pb: The Protobuf representing the key.
:rtype: :class:`google.cloud.datastore.key.Key`
... | [
"Factory",
"method",
"for",
"creating",
"a",
"key",
"based",
"on",
"a",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L270-L299 | [
"def",
"key_from_protobuf",
"(",
"pb",
")",
":",
"path_args",
"=",
"[",
"]",
"for",
"element",
"in",
"pb",
".",
"path",
":",
"path_args",
".",
"append",
"(",
"element",
".",
"kind",
")",
"if",
"element",
".",
"id",
":",
"# Simple field (int64)",
"path_ar... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _pb_attr_value | Given a value, return the protobuf attribute name and proper value.
The Protobuf API uses different attribute names based on value types
rather than inferring the type. This function simply determines the
proper attribute name based on the type of the value provided and
returns the attribute name as w... | datastore/google/cloud/datastore/helpers.py | def _pb_attr_value(val):
"""Given a value, return the protobuf attribute name and proper value.
The Protobuf API uses different attribute names based on value types
rather than inferring the type. This function simply determines the
proper attribute name based on the type of the value provided and
... | def _pb_attr_value(val):
"""Given a value, return the protobuf attribute name and proper value.
The Protobuf API uses different attribute names based on value types
rather than inferring the type. This function simply determines the
proper attribute name based on the type of the value provided and
... | [
"Given",
"a",
"value",
"return",
"the",
"protobuf",
"attribute",
"name",
"and",
"proper",
"value",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L302-L368 | [
"def",
"_pb_attr_value",
"(",
"val",
")",
":",
"if",
"isinstance",
"(",
"val",
",",
"datetime",
".",
"datetime",
")",
":",
"name",
"=",
"\"timestamp\"",
"value",
"=",
"_datetime_to_pb_timestamp",
"(",
"val",
")",
"elif",
"isinstance",
"(",
"val",
",",
"Key... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _get_value_from_value_pb | Given a protobuf for a Value, get the correct value.
The Cloud Datastore Protobuf API returns a Property Protobuf which
has one value set and the rest blank. This function retrieves the
the one value provided.
Some work is done to coerce the return value into a more useful type
(particularly in t... | datastore/google/cloud/datastore/helpers.py | def _get_value_from_value_pb(value_pb):
"""Given a protobuf for a Value, get the correct value.
The Cloud Datastore Protobuf API returns a Property Protobuf which
has one value set and the rest blank. This function retrieves the
the one value provided.
Some work is done to coerce the return value... | def _get_value_from_value_pb(value_pb):
"""Given a protobuf for a Value, get the correct value.
The Cloud Datastore Protobuf API returns a Property Protobuf which
has one value set and the rest blank. This function retrieves the
the one value provided.
Some work is done to coerce the return value... | [
"Given",
"a",
"protobuf",
"for",
"a",
"Value",
"get",
"the",
"correct",
"value",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L371-L431 | [
"def",
"_get_value_from_value_pb",
"(",
"value_pb",
")",
":",
"value_type",
"=",
"value_pb",
".",
"WhichOneof",
"(",
"\"value_type\"",
")",
"if",
"value_type",
"==",
"\"timestamp_value\"",
":",
"result",
"=",
"_pb_timestamp_to_datetime",
"(",
"value_pb",
".",
"times... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _set_protobuf_value | Assign 'val' to the correct subfield of 'value_pb'.
The Protobuf API uses different attribute names based on value types
rather than inferring the type.
Some value types (entities, keys, lists) cannot be directly
assigned; this function handles them correctly.
:type value_pb: :class:`.entity_pb2.... | datastore/google/cloud/datastore/helpers.py | def _set_protobuf_value(value_pb, val):
"""Assign 'val' to the correct subfield of 'value_pb'.
The Protobuf API uses different attribute names based on value types
rather than inferring the type.
Some value types (entities, keys, lists) cannot be directly
assigned; this function handles them corre... | def _set_protobuf_value(value_pb, val):
"""Assign 'val' to the correct subfield of 'value_pb'.
The Protobuf API uses different attribute names based on value types
rather than inferring the type.
Some value types (entities, keys, lists) cannot be directly
assigned; this function handles them corre... | [
"Assign",
"val",
"to",
"the",
"correct",
"subfield",
"of",
"value_pb",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L434-L471 | [
"def",
"_set_protobuf_value",
"(",
"value_pb",
",",
"val",
")",
":",
"attr",
",",
"val",
"=",
"_pb_attr_value",
"(",
"val",
")",
"if",
"attr",
"==",
"\"key_value\"",
":",
"value_pb",
".",
"key_value",
".",
"CopyFrom",
"(",
"val",
")",
"elif",
"attr",
"==... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | GeoPoint.to_protobuf | Convert the current object to protobuf.
:rtype: :class:`google.type.latlng_pb2.LatLng`.
:returns: The current point as a protobuf. | datastore/google/cloud/datastore/helpers.py | def to_protobuf(self):
"""Convert the current object to protobuf.
:rtype: :class:`google.type.latlng_pb2.LatLng`.
:returns: The current point as a protobuf.
"""
return latlng_pb2.LatLng(latitude=self.latitude, longitude=self.longitude) | def to_protobuf(self):
"""Convert the current object to protobuf.
:rtype: :class:`google.type.latlng_pb2.LatLng`.
:returns: The current point as a protobuf.
"""
return latlng_pb2.LatLng(latitude=self.latitude, longitude=self.longitude) | [
"Convert",
"the",
"current",
"object",
"to",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/helpers.py#L488-L494 | [
"def",
"to_protobuf",
"(",
"self",
")",
":",
"return",
"latlng_pb2",
".",
"LatLng",
"(",
"latitude",
"=",
"self",
".",
"latitude",
",",
"longitude",
"=",
"self",
".",
"longitude",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | LogEntry.from_api_repr | Factory: construct an entry given its API representation
:type resource: dict
:param resource: text entry resource representation returned from
the API
:type client: :class:`google.cloud.logging.client.Client`
:param client: Client which holds credentials and ... | logging/google/cloud/logging/entries.py | def from_api_repr(cls, resource, client, loggers=None):
"""Factory: construct an entry given its API representation
:type resource: dict
:param resource: text entry resource representation returned from
the API
:type client: :class:`google.cloud.logging.client... | def from_api_repr(cls, resource, client, loggers=None):
"""Factory: construct an entry given its API representation
:type resource: dict
:param resource: text entry resource representation returned from
the API
:type client: :class:`google.cloud.logging.client... | [
"Factory",
":",
"construct",
"an",
"entry",
"given",
"its",
"API",
"representation"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/entries.py#L165-L232 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
",",
"loggers",
"=",
"None",
")",
":",
"if",
"loggers",
"is",
"None",
":",
"loggers",
"=",
"{",
"}",
"logger_fullname",
"=",
"resource",
"[",
"\"logName\"",
"]",
"logger",
"=",
"loggers"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | LogEntry.to_api_repr | API repr (JSON format) for entry. | logging/google/cloud/logging/entries.py | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = {}
if self.log_name is not None:
info["logName"] = self.log_name
if self.resource is not None:
info["resource"] = self.resource._to_dict()
if self.labels is not None:
... | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = {}
if self.log_name is not None:
info["logName"] = self.log_name
if self.resource is not None:
info["resource"] = self.resource._to_dict()
if self.labels is not None:
... | [
"API",
"repr",
"(",
"JSON",
"format",
")",
"for",
"entry",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/entries.py#L234-L264 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"info",
"=",
"{",
"}",
"if",
"self",
".",
"log_name",
"is",
"not",
"None",
":",
"info",
"[",
"\"logName\"",
"]",
"=",
"self",
".",
"log_name",
"if",
"self",
".",
"resource",
"is",
"not",
"None",
":",
"in... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TextEntry.to_api_repr | API repr (JSON format) for entry. | logging/google/cloud/logging/entries.py | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = super(TextEntry, self).to_api_repr()
info["textPayload"] = self.payload
return info | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = super(TextEntry, self).to_api_repr()
info["textPayload"] = self.payload
return info | [
"API",
"repr",
"(",
"JSON",
"format",
")",
"for",
"entry",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/entries.py#L287-L292 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"info",
"=",
"super",
"(",
"TextEntry",
",",
"self",
")",
".",
"to_api_repr",
"(",
")",
"info",
"[",
"\"textPayload\"",
"]",
"=",
"self",
".",
"payload",
"return",
"info"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | StructEntry.to_api_repr | API repr (JSON format) for entry. | logging/google/cloud/logging/entries.py | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = super(StructEntry, self).to_api_repr()
info["jsonPayload"] = self.payload
return info | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = super(StructEntry, self).to_api_repr()
info["jsonPayload"] = self.payload
return info | [
"API",
"repr",
"(",
"JSON",
"format",
")",
"for",
"entry",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/entries.py#L315-L320 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"info",
"=",
"super",
"(",
"StructEntry",
",",
"self",
")",
".",
"to_api_repr",
"(",
")",
"info",
"[",
"\"jsonPayload\"",
"]",
"=",
"self",
".",
"payload",
"return",
"info"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProtobufEntry.to_api_repr | API repr (JSON format) for entry. | logging/google/cloud/logging/entries.py | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = super(ProtobufEntry, self).to_api_repr()
info["protoPayload"] = MessageToDict(self.payload)
return info | def to_api_repr(self):
"""API repr (JSON format) for entry.
"""
info = super(ProtobufEntry, self).to_api_repr()
info["protoPayload"] = MessageToDict(self.payload)
return info | [
"API",
"repr",
"(",
"JSON",
"format",
")",
"for",
"entry",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/entries.py#L353-L358 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"info",
"=",
"super",
"(",
"ProtobufEntry",
",",
"self",
")",
".",
"to_api_repr",
"(",
")",
"info",
"[",
"\"protoPayload\"",
"]",
"=",
"MessageToDict",
"(",
"self",
".",
"payload",
")",
"return",
"info"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TimeFromTicks | Construct a DB-API time value from the given ticks value.
:type ticks: float
:param ticks:
a number of seconds since the epoch; see the documentation of the
standard Python time module for details.
:type tz: :class:`datetime.tzinfo`
:param tz: (Optional) time zone to use for conversion... | bigquery/google/cloud/bigquery/dbapi/types.py | def TimeFromTicks(ticks, tz=None):
"""Construct a DB-API time value from the given ticks value.
:type ticks: float
:param ticks:
a number of seconds since the epoch; see the documentation of the
standard Python time module for details.
:type tz: :class:`datetime.tzinfo`
:param tz: ... | def TimeFromTicks(ticks, tz=None):
"""Construct a DB-API time value from the given ticks value.
:type ticks: float
:param ticks:
a number of seconds since the epoch; see the documentation of the
standard Python time module for details.
:type tz: :class:`datetime.tzinfo`
:param tz: ... | [
"Construct",
"a",
"DB",
"-",
"API",
"time",
"value",
"from",
"the",
"given",
"ticks",
"value",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/types.py#L45-L60 | [
"def",
"TimeFromTicks",
"(",
"ticks",
",",
"tz",
"=",
"None",
")",
":",
"dt",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"ticks",
",",
"tz",
"=",
"tz",
")",
"return",
"dt",
".",
"timetz",
"(",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DeviceManagerClient.registry_path | Return a fully-qualified registry string. | iot/google/cloud/iot_v1/gapic/device_manager_client.py | def registry_path(cls, project, location, registry):
"""Return a fully-qualified registry string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/registries/{registry}",
project=project,
location=location,
registry=... | def registry_path(cls, project, location, registry):
"""Return a fully-qualified registry string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/registries/{registry}",
project=project,
location=location,
registry=... | [
"Return",
"a",
"fully",
"-",
"qualified",
"registry",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iot/google/cloud/iot_v1/gapic/device_manager_client.py#L86-L93 | [
"def",
"registry_path",
"(",
"cls",
",",
"project",
",",
"location",
",",
"registry",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/locations/{location}/registries/{registry}\"",
",",
"project",
"=",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DeviceManagerClient.device_path | Return a fully-qualified device string. | iot/google/cloud/iot_v1/gapic/device_manager_client.py | def device_path(cls, project, location, registry, device):
"""Return a fully-qualified device string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/registries/{registry}/devices/{device}",
project=project,
location=location,
... | def device_path(cls, project, location, registry, device):
"""Return a fully-qualified device string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/registries/{registry}/devices/{device}",
project=project,
location=location,
... | [
"Return",
"a",
"fully",
"-",
"qualified",
"device",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iot/google/cloud/iot_v1/gapic/device_manager_client.py#L96-L104 | [
"def",
"device_path",
"(",
"cls",
",",
"project",
",",
"location",
",",
"registry",
",",
"device",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/locations/{location}/registries/{registry}/devices/{device}\... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DeviceManagerClient.create_device | Creates a device in a device registry.
Example:
>>> from google.cloud import iot_v1
>>>
>>> client = iot_v1.DeviceManagerClient()
>>>
>>> parent = client.registry_path('[PROJECT]', '[LOCATION]', '[REGISTRY]')
>>>
>>> # TODO: In... | iot/google/cloud/iot_v1/gapic/device_manager_client.py | def create_device(
self,
parent,
device,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a device in a device registry.
Example:
>>> from google.cloud im... | def create_device(
self,
parent,
device,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a device in a device registry.
Example:
>>> from google.cloud im... | [
"Creates",
"a",
"device",
"in",
"a",
"device",
"registry",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iot/google/cloud/iot_v1/gapic/device_manager_client.py#L618-L697 | [
"def",
"create_device",
"(",
"self",
",",
"parent",
",",
"device",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DeviceManagerClient.set_iam_policy | Sets the access control policy on the specified resource. Replaces any
existing policy.
Example:
>>> from google.cloud import iot_v1
>>>
>>> client = iot_v1.DeviceManagerClient()
>>>
>>> resource = client.registry_path('[PROJECT]', '[LOCATION]... | iot/google/cloud/iot_v1/gapic/device_manager_client.py | def set_iam_policy(
self,
resource,
policy,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Sets the access control policy on the specified resource. Replaces any
existing po... | def set_iam_policy(
self,
resource,
policy,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Sets the access control policy on the specified resource. Replaces any
existing po... | [
"Sets",
"the",
"access",
"control",
"policy",
"on",
"the",
"specified",
"resource",
".",
"Replaces",
"any",
"existing",
"policy",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iot/google/cloud/iot_v1/gapic/device_manager_client.py#L1311-L1392 | [
"def",
"set_iam_policy",
"(",
"self",
",",
"resource",
",",
"policy",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFA... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DeviceManagerClient.bind_device_to_gateway | Associates the device with the gateway.
Example:
>>> from google.cloud import iot_v1
>>>
>>> client = iot_v1.DeviceManagerClient()
>>>
>>> parent = client.registry_path('[PROJECT]', '[LOCATION]', '[REGISTRY]')
>>>
>>> # TODO: I... | iot/google/cloud/iot_v1/gapic/device_manager_client.py | def bind_device_to_gateway(
self,
parent,
gateway_id,
device_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Associates the device with the gateway.
Example:
... | def bind_device_to_gateway(
self,
parent,
gateway_id,
device_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Associates the device with the gateway.
Example:
... | [
"Associates",
"the",
"device",
"with",
"the",
"gateway",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iot/google/cloud/iot_v1/gapic/device_manager_client.py#L1649-L1732 | [
"def",
"bind_device_to_gateway",
"(",
"self",
",",
"parent",
",",
"gateway_id",
",",
"device_id",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudTasksClient.queue_path | Return a fully-qualified queue string. | tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py | def queue_path(cls, project, location, queue):
"""Return a fully-qualified queue string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/queues/{queue}",
project=project,
location=location,
queue=queue,
) | def queue_path(cls, project, location, queue):
"""Return a fully-qualified queue string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/queues/{queue}",
project=project,
location=location,
queue=queue,
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"queue",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py#L97-L104 | [
"def",
"queue_path",
"(",
"cls",
",",
"project",
",",
"location",
",",
"queue",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/locations/{location}/queues/{queue}\"",
",",
"project",
"=",
"project",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudTasksClient.task_path | Return a fully-qualified task string. | tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py | def task_path(cls, project, location, queue, task):
"""Return a fully-qualified task string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/queues/{queue}/tasks/{task}",
project=project,
location=location,
queue=qu... | def task_path(cls, project, location, queue, task):
"""Return a fully-qualified task string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/queues/{queue}/tasks/{task}",
project=project,
location=location,
queue=qu... | [
"Return",
"a",
"fully",
"-",
"qualified",
"task",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py#L107-L115 | [
"def",
"task_path",
"(",
"cls",
",",
"project",
",",
"location",
",",
"queue",
",",
"task",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/locations/{location}/queues/{queue}/tasks/{task}\"",
",",
"proj... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudTasksClient.create_queue | Creates a queue.
Queues created with this method allow tasks to live for a maximum of 31
days. After a task is 31 days old, the task will be deleted regardless
of whether it was dispatched or not.
WARNING: Using this method may have unintended side effects if you are
using an A... | tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py | def create_queue(
self,
parent,
queue,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a queue.
Queues created with this method allow tasks to live for a maximum of ... | def create_queue(
self,
parent,
queue,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a queue.
Queues created with this method allow tasks to live for a maximum of ... | [
"Creates",
"a",
"queue",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py#L407-L502 | [
"def",
"create_queue",
"(",
"self",
",",
"parent",
",",
"queue",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudTasksClient.create_task | Creates a task and adds it to a queue.
Tasks cannot be updated after creation; there is no UpdateTask command.
- For ``App Engine queues``, the maximum task size is 100KB.
Example:
>>> from google.cloud import tasks_v2
>>>
>>> client = tasks_v2.CloudTasksC... | tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py | def create_task(
self,
parent,
task,
response_view=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a task and adds it to a queue.
Tasks cannot be updat... | def create_task(
self,
parent,
task,
response_view=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a task and adds it to a queue.
Tasks cannot be updat... | [
"Creates",
"a",
"task",
"and",
"adds",
"it",
"to",
"a",
"queue",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py#L1387-L1516 | [
"def",
"create_task",
"(",
"self",
",",
"parent",
",",
"task",
",",
"response_view",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _exponential_timeout_generator | A generator that yields exponential timeout values.
Args:
initial (float): The initial timeout.
maximum (float): The maximum timeout.
multiplier (float): The multiplier applied to the timeout.
deadline (float): The overall deadline across all invocations.
Yields:
float:... | api_core/google/api_core/timeout.py | def _exponential_timeout_generator(initial, maximum, multiplier, deadline):
"""A generator that yields exponential timeout values.
Args:
initial (float): The initial timeout.
maximum (float): The maximum timeout.
multiplier (float): The multiplier applied to the timeout.
deadlin... | def _exponential_timeout_generator(initial, maximum, multiplier, deadline):
"""A generator that yields exponential timeout values.
Args:
initial (float): The initial timeout.
maximum (float): The maximum timeout.
multiplier (float): The multiplier applied to the timeout.
deadlin... | [
"A",
"generator",
"that",
"yields",
"exponential",
"timeout",
"values",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/timeout.py#L110-L140 | [
"def",
"_exponential_timeout_generator",
"(",
"initial",
",",
"maximum",
",",
"multiplier",
",",
"deadline",
")",
":",
"if",
"deadline",
"is",
"not",
"None",
":",
"deadline_datetime",
"=",
"datetime_helpers",
".",
"utcnow",
"(",
")",
"+",
"datetime",
".",
"tim... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _format_operation_list | Formats parameters in operation in the way BigQuery expects.
The input operation will be a query like ``SELECT %s`` and the output
will be a query like ``SELECT ?``.
:type operation: str
:param operation: A Google BigQuery query string.
:type parameters: Sequence[Any]
:param parameters: Seque... | bigquery/google/cloud/bigquery/dbapi/cursor.py | def _format_operation_list(operation, parameters):
"""Formats parameters in operation in the way BigQuery expects.
The input operation will be a query like ``SELECT %s`` and the output
will be a query like ``SELECT ?``.
:type operation: str
:param operation: A Google BigQuery query string.
:t... | def _format_operation_list(operation, parameters):
"""Formats parameters in operation in the way BigQuery expects.
The input operation will be a query like ``SELECT %s`` and the output
will be a query like ``SELECT ?``.
:type operation: str
:param operation: A Google BigQuery query string.
:t... | [
"Formats",
"parameters",
"in",
"operation",
"in",
"the",
"way",
"BigQuery",
"expects",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L282-L305 | [
"def",
"_format_operation_list",
"(",
"operation",
",",
"parameters",
")",
":",
"formatted_params",
"=",
"[",
"\"?\"",
"for",
"_",
"in",
"parameters",
"]",
"try",
":",
"return",
"operation",
"%",
"tuple",
"(",
"formatted_params",
")",
"except",
"TypeError",
"a... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _format_operation_dict | Formats parameters in operation in the way BigQuery expects.
The input operation will be a query like ``SELECT %(namedparam)s`` and
the output will be a query like ``SELECT @namedparam``.
:type operation: str
:param operation: A Google BigQuery query string.
:type parameters: Mapping[str, Any]
... | bigquery/google/cloud/bigquery/dbapi/cursor.py | def _format_operation_dict(operation, parameters):
"""Formats parameters in operation in the way BigQuery expects.
The input operation will be a query like ``SELECT %(namedparam)s`` and
the output will be a query like ``SELECT @namedparam``.
:type operation: str
:param operation: A Google BigQuery... | def _format_operation_dict(operation, parameters):
"""Formats parameters in operation in the way BigQuery expects.
The input operation will be a query like ``SELECT %(namedparam)s`` and
the output will be a query like ``SELECT @namedparam``.
:type operation: str
:param operation: A Google BigQuery... | [
"Formats",
"parameters",
"in",
"operation",
"in",
"the",
"way",
"BigQuery",
"expects",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L308-L334 | [
"def",
"_format_operation_dict",
"(",
"operation",
",",
"parameters",
")",
":",
"formatted_params",
"=",
"{",
"}",
"for",
"name",
"in",
"parameters",
":",
"escaped_name",
"=",
"name",
".",
"replace",
"(",
"\"`\"",
",",
"r\"\\`\"",
")",
"formatted_params",
"[",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _format_operation | Formats parameters in operation in way BigQuery expects.
:type: str
:param operation: A Google BigQuery query string.
:type: Mapping[str, Any] or Sequence[Any]
:param parameters: Optional parameter values.
:rtype: str
:returns: A formatted query string.
:raises: :class:`~google.cloud.bigq... | bigquery/google/cloud/bigquery/dbapi/cursor.py | def _format_operation(operation, parameters=None):
"""Formats parameters in operation in way BigQuery expects.
:type: str
:param operation: A Google BigQuery query string.
:type: Mapping[str, Any] or Sequence[Any]
:param parameters: Optional parameter values.
:rtype: str
:returns: A forma... | def _format_operation(operation, parameters=None):
"""Formats parameters in operation in way BigQuery expects.
:type: str
:param operation: A Google BigQuery query string.
:type: Mapping[str, Any] or Sequence[Any]
:param parameters: Optional parameter values.
:rtype: str
:returns: A forma... | [
"Formats",
"parameters",
"in",
"operation",
"in",
"way",
"BigQuery",
"expects",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L337-L358 | [
"def",
"_format_operation",
"(",
"operation",
",",
"parameters",
"=",
"None",
")",
":",
"if",
"parameters",
"is",
"None",
":",
"return",
"operation",
"if",
"isinstance",
"(",
"parameters",
",",
"collections_abc",
".",
"Mapping",
")",
":",
"return",
"_format_op... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cursor._set_description | Set description from schema.
:type schema: Sequence[google.cloud.bigquery.schema.SchemaField]
:param schema: A description of fields in the schema. | bigquery/google/cloud/bigquery/dbapi/cursor.py | def _set_description(self, schema):
"""Set description from schema.
:type schema: Sequence[google.cloud.bigquery.schema.SchemaField]
:param schema: A description of fields in the schema.
"""
if schema is None:
self.description = None
return
self.... | def _set_description(self, schema):
"""Set description from schema.
:type schema: Sequence[google.cloud.bigquery.schema.SchemaField]
:param schema: A description of fields in the schema.
"""
if schema is None:
self.description = None
return
self.... | [
"Set",
"description",
"from",
"schema",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L72-L95 | [
"def",
"_set_description",
"(",
"self",
",",
"schema",
")",
":",
"if",
"schema",
"is",
"None",
":",
"self",
".",
"description",
"=",
"None",
"return",
"self",
".",
"description",
"=",
"tuple",
"(",
"[",
"Column",
"(",
"name",
"=",
"field",
".",
"name",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cursor._set_rowcount | Set the rowcount from query results.
Normally, this sets rowcount to the number of rows returned by the
query, but if it was a DML statement, it sets rowcount to the number
of modified rows.
:type query_results:
:class:`~google.cloud.bigquery.query._QueryResults`
:p... | bigquery/google/cloud/bigquery/dbapi/cursor.py | def _set_rowcount(self, query_results):
"""Set the rowcount from query results.
Normally, this sets rowcount to the number of rows returned by the
query, but if it was a DML statement, it sets rowcount to the number
of modified rows.
:type query_results:
:class:`~go... | def _set_rowcount(self, query_results):
"""Set the rowcount from query results.
Normally, this sets rowcount to the number of rows returned by the
query, but if it was a DML statement, it sets rowcount to the number
of modified rows.
:type query_results:
:class:`~go... | [
"Set",
"the",
"rowcount",
"from",
"query",
"results",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L97-L115 | [
"def",
"_set_rowcount",
"(",
"self",
",",
"query_results",
")",
":",
"total_rows",
"=",
"0",
"num_dml_affected_rows",
"=",
"query_results",
".",
"num_dml_affected_rows",
"if",
"query_results",
".",
"total_rows",
"is",
"not",
"None",
"and",
"query_results",
".",
"t... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cursor.execute | Prepare and execute a database operation.
.. note::
When setting query parameters, values which are "text"
(``unicode`` in Python2, ``str`` in Python3) will use
the 'STRING' BigQuery type. Values which are "bytes" (``str`` in
Python2, ``bytes`` in Python3), will ... | bigquery/google/cloud/bigquery/dbapi/cursor.py | def execute(self, operation, parameters=None, job_id=None):
"""Prepare and execute a database operation.
.. note::
When setting query parameters, values which are "text"
(``unicode`` in Python2, ``str`` in Python3) will use
the 'STRING' BigQuery type. Values which ar... | def execute(self, operation, parameters=None, job_id=None):
"""Prepare and execute a database operation.
.. note::
When setting query parameters, values which are "text"
(``unicode`` in Python2, ``str`` in Python3) will use
the 'STRING' BigQuery type. Values which ar... | [
"Prepare",
"and",
"execute",
"a",
"database",
"operation",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L117-L176 | [
"def",
"execute",
"(",
"self",
",",
"operation",
",",
"parameters",
"=",
"None",
",",
"job_id",
"=",
"None",
")",
":",
"self",
".",
"_query_data",
"=",
"None",
"self",
".",
"_query_job",
"=",
"None",
"client",
"=",
"self",
".",
"connection",
".",
"_cli... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cursor._try_fetch | Try to start fetching data, if not yet started.
Mutates self to indicate that iteration has started. | bigquery/google/cloud/bigquery/dbapi/cursor.py | def _try_fetch(self, size=None):
"""Try to start fetching data, if not yet started.
Mutates self to indicate that iteration has started.
"""
if self._query_job is None:
raise exceptions.InterfaceError(
"No query results: execute() must be called before fetch.... | def _try_fetch(self, size=None):
"""Try to start fetching data, if not yet started.
Mutates self to indicate that iteration has started.
"""
if self._query_job is None:
raise exceptions.InterfaceError(
"No query results: execute() must be called before fetch.... | [
"Try",
"to",
"start",
"fetching",
"data",
"if",
"not",
"yet",
"started",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L190-L215 | [
"def",
"_try_fetch",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"self",
".",
"_query_job",
"is",
"None",
":",
"raise",
"exceptions",
".",
"InterfaceError",
"(",
"\"No query results: execute() must be called before fetch.\"",
")",
"is_dml",
"=",
"(",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cursor.fetchmany | Fetch multiple results from the last ``execute*()`` call.
.. note::
The size parameter is not used for the request/response size.
Set the ``arraysize`` attribute before calling ``execute()`` to
set the batch size.
:type size: int
:param size:
(Op... | bigquery/google/cloud/bigquery/dbapi/cursor.py | def fetchmany(self, size=None):
"""Fetch multiple results from the last ``execute*()`` call.
.. note::
The size parameter is not used for the request/response size.
Set the ``arraysize`` attribute before calling ``execute()`` to
set the batch size.
:type siz... | def fetchmany(self, size=None):
"""Fetch multiple results from the last ``execute*()`` call.
.. note::
The size parameter is not used for the request/response size.
Set the ``arraysize`` attribute before calling ``execute()`` to
set the batch size.
:type siz... | [
"Fetch",
"multiple",
"results",
"from",
"the",
"last",
"execute",
"*",
"()",
"call",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/cursor.py#L233-L262 | [
"def",
"fetchmany",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"size",
"is",
"None",
":",
"size",
"=",
"self",
".",
"arraysize",
"self",
".",
"_try_fetch",
"(",
"size",
"=",
"size",
")",
"rows",
"=",
"[",
"]",
"for",
"row",
"in",
"sel... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SpannerGrpcTransport.create_channel | Create and return a gRPC channel object.
Args:
address (str): The host for the channel to use.
credentials (~.Credentials): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If
... | spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py | def create_channel(cls, address="spanner.googleapis.com:443", credentials=None):
"""Create and return a gRPC channel object.
Args:
address (str): The host for the channel to use.
credentials (~.Credentials): The
authorization credentials to attach to requests. Th... | def create_channel(cls, address="spanner.googleapis.com:443", credentials=None):
"""Create and return a gRPC channel object.
Args:
address (str): The host for the channel to use.
credentials (~.Credentials): The
authorization credentials to attach to requests. Th... | [
"Create",
"and",
"return",
"a",
"gRPC",
"channel",
"object",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py#L78-L98 | [
"def",
"create_channel",
"(",
"cls",
",",
"address",
"=",
"\"spanner.googleapis.com:443\"",
",",
"credentials",
"=",
"None",
")",
":",
"grpc_gcp_config",
"=",
"grpc_gcp",
".",
"api_config_from_text_pb",
"(",
"pkg_resources",
".",
"resource_string",
"(",
"__name__",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Sink._update_from_api_repr | Helper for API methods returning sink resources. | logging/google/cloud/logging/sink.py | def _update_from_api_repr(self, resource):
"""Helper for API methods returning sink resources."""
self.destination = resource["destination"]
self.filter_ = resource.get("filter")
self._writer_identity = resource.get("writerIdentity") | def _update_from_api_repr(self, resource):
"""Helper for API methods returning sink resources."""
self.destination = resource["destination"]
self.filter_ = resource.get("filter")
self._writer_identity = resource.get("writerIdentity") | [
"Helper",
"for",
"API",
"methods",
"returning",
"sink",
"resources",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/sink.py#L75-L79 | [
"def",
"_update_from_api_repr",
"(",
"self",
",",
"resource",
")",
":",
"self",
".",
"destination",
"=",
"resource",
"[",
"\"destination\"",
"]",
"self",
".",
"filter_",
"=",
"resource",
".",
"get",
"(",
"\"filter\"",
")",
"self",
".",
"_writer_identity",
"=... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Sink.from_api_repr | Factory: construct a sink given its API representation
:type resource: dict
:param resource: sink resource representation returned from the API
:type client: :class:`google.cloud.logging.client.Client`
:param client: Client which holds credentials and project
co... | logging/google/cloud/logging/sink.py | def from_api_repr(cls, resource, client):
"""Factory: construct a sink given its API representation
:type resource: dict
:param resource: sink resource representation returned from the API
:type client: :class:`google.cloud.logging.client.Client`
:param client: Client which ho... | def from_api_repr(cls, resource, client):
"""Factory: construct a sink given its API representation
:type resource: dict
:param resource: sink resource representation returned from the API
:type client: :class:`google.cloud.logging.client.Client`
:param client: Client which ho... | [
"Factory",
":",
"construct",
"a",
"sink",
"given",
"its",
"API",
"representation"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/sink.py#L82-L101 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"sink_name",
"=",
"resource",
"[",
"\"name\"",
"]",
"instance",
"=",
"cls",
"(",
"sink_name",
",",
"client",
"=",
"client",
")",
"instance",
".",
"_update_from_api_repr",
"(",
"r... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Sink.create | API call: create the sink via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls bac... | logging/google/cloud/logging/sink.py | def create(self, client=None, unique_writer_identity=False):
"""API call: create the sink via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneTy... | def create(self, client=None, unique_writer_identity=False):
"""API call: create the sink via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneTy... | [
"API",
"call",
":",
"create",
"the",
"sink",
"via",
"a",
"PUT",
"request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/sink.py#L118-L142 | [
"def",
"create",
"(",
"self",
",",
"client",
"=",
"None",
",",
"unique_writer_identity",
"=",
"False",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"resource",
"=",
"client",
".",
"sinks_api",
".",
"sink_create",
"(",
"self"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Sink.exists | API call: test for the existence of the sink via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not p... | logging/google/cloud/logging/sink.py | def exists(self, client=None):
"""API call: test for the existence of the sink via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:... | def exists(self, client=None):
"""API call: test for the existence of the sink via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:... | [
"API",
"call",
":",
"test",
"for",
"the",
"existence",
"of",
"the",
"sink",
"via",
"a",
"GET",
"request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/sink.py#L144-L165 | [
"def",
"exists",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"try",
":",
"client",
".",
"sinks_api",
".",
"sink_get",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
")"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Sink.reload | API call: sync local sink configuration via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not passed... | logging/google/cloud/logging/sink.py | def reload(self, client=None):
"""API call: sync local sink configuration via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param... | def reload(self, client=None):
"""API call: sync local sink configuration via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param... | [
"API",
"call",
":",
"sync",
"local",
"sink",
"configuration",
"via",
"a",
"GET",
"request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/sink.py#L167-L180 | [
"def",
"reload",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"resource",
"=",
"client",
".",
"sinks_api",
".",
"sink_get",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Sink.update | API call: update sink configuration via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not passed,... | logging/google/cloud/logging/sink.py | def update(self, client=None, unique_writer_identity=False):
"""API call: update sink configuration via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update
:type client: :class:`~google.cloud.logging.client.Client` or
... | def update(self, client=None, unique_writer_identity=False):
"""API call: update sink configuration via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update
:type client: :class:`~google.cloud.logging.client.Client` or
... | [
"API",
"call",
":",
"update",
"sink",
"configuration",
"via",
"a",
"PUT",
"request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/sink.py#L182-L206 | [
"def",
"update",
"(",
"self",
",",
"client",
"=",
"None",
",",
"unique_writer_identity",
"=",
"False",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"resource",
"=",
"client",
".",
"sinks_api",
".",
"sink_update",
"(",
"self"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Sink.delete | API call: delete a sink via a DELETE request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/delete
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls ba... | logging/google/cloud/logging/sink.py | def delete(self, client=None):
"""API call: delete a sink via a DELETE request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/delete
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: t... | def delete(self, client=None):
"""API call: delete a sink via a DELETE request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/delete
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: t... | [
"API",
"call",
":",
"delete",
"a",
"sink",
"via",
"a",
"DELETE",
"request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/sink.py#L208-L220 | [
"def",
"delete",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"client",
".",
"sinks_api",
".",
"sink_delete",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _merge_float64 | Helper for '_merge_by_type'. | spanner/google/cloud/spanner_v1/streamed.py | def _merge_float64(lhs, rhs, type_): # pylint: disable=unused-argument
"""Helper for '_merge_by_type'."""
lhs_kind = lhs.WhichOneof("kind")
if lhs_kind == "string_value":
return Value(string_value=lhs.string_value + rhs.string_value)
rhs_kind = rhs.WhichOneof("kind")
array_continuation = (
... | def _merge_float64(lhs, rhs, type_): # pylint: disable=unused-argument
"""Helper for '_merge_by_type'."""
lhs_kind = lhs.WhichOneof("kind")
if lhs_kind == "string_value":
return Value(string_value=lhs.string_value + rhs.string_value)
rhs_kind = rhs.WhichOneof("kind")
array_continuation = (
... | [
"Helper",
"for",
"_merge_by_type",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L222-L235 | [
"def",
"_merge_float64",
"(",
"lhs",
",",
"rhs",
",",
"type_",
")",
":",
"# pylint: disable=unused-argument",
"lhs_kind",
"=",
"lhs",
".",
"WhichOneof",
"(",
"\"kind\"",
")",
"if",
"lhs_kind",
"==",
"\"string_value\"",
":",
"return",
"Value",
"(",
"string_value"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _merge_string | Helper for '_merge_by_type'. | spanner/google/cloud/spanner_v1/streamed.py | def _merge_string(lhs, rhs, type_): # pylint: disable=unused-argument
"""Helper for '_merge_by_type'."""
return Value(string_value=lhs.string_value + rhs.string_value) | def _merge_string(lhs, rhs, type_): # pylint: disable=unused-argument
"""Helper for '_merge_by_type'."""
return Value(string_value=lhs.string_value + rhs.string_value) | [
"Helper",
"for",
"_merge_by_type",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L238-L240 | [
"def",
"_merge_string",
"(",
"lhs",
",",
"rhs",
",",
"type_",
")",
":",
"# pylint: disable=unused-argument",
"return",
"Value",
"(",
"string_value",
"=",
"lhs",
".",
"string_value",
"+",
"rhs",
".",
"string_value",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _merge_array | Helper for '_merge_by_type'. | spanner/google/cloud/spanner_v1/streamed.py | def _merge_array(lhs, rhs, type_):
"""Helper for '_merge_by_type'."""
element_type = type_.array_element_type
if element_type.code in _UNMERGEABLE_TYPES:
# Individual values cannot be merged, just concatenate
lhs.list_value.values.extend(rhs.list_value.values)
return lhs
lhs, rhs... | def _merge_array(lhs, rhs, type_):
"""Helper for '_merge_by_type'."""
element_type = type_.array_element_type
if element_type.code in _UNMERGEABLE_TYPES:
# Individual values cannot be merged, just concatenate
lhs.list_value.values.extend(rhs.list_value.values)
return lhs
lhs, rhs... | [
"Helper",
"for",
"_merge_by_type",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L246-L272 | [
"def",
"_merge_array",
"(",
"lhs",
",",
"rhs",
",",
"type_",
")",
":",
"element_type",
"=",
"type_",
".",
"array_element_type",
"if",
"element_type",
".",
"code",
"in",
"_UNMERGEABLE_TYPES",
":",
"# Individual values cannot be merged, just concatenate",
"lhs",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _merge_struct | Helper for '_merge_by_type'. | spanner/google/cloud/spanner_v1/streamed.py | def _merge_struct(lhs, rhs, type_):
"""Helper for '_merge_by_type'."""
fields = type_.struct_type.fields
lhs, rhs = list(lhs.list_value.values), list(rhs.list_value.values)
candidate_type = fields[len(lhs) - 1].type
first = rhs.pop(0)
if first.HasField("null_value") or candidate_type.code in _UN... | def _merge_struct(lhs, rhs, type_):
"""Helper for '_merge_by_type'."""
fields = type_.struct_type.fields
lhs, rhs = list(lhs.list_value.values), list(rhs.list_value.values)
candidate_type = fields[len(lhs) - 1].type
first = rhs.pop(0)
if first.HasField("null_value") or candidate_type.code in _UN... | [
"Helper",
"for",
"_merge_by_type",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L275-L286 | [
"def",
"_merge_struct",
"(",
"lhs",
",",
"rhs",
",",
"type_",
")",
":",
"fields",
"=",
"type_",
".",
"struct_type",
".",
"fields",
"lhs",
",",
"rhs",
"=",
"list",
"(",
"lhs",
".",
"list_value",
".",
"values",
")",
",",
"list",
"(",
"rhs",
".",
"lis... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _merge_by_type | Helper for '_merge_chunk'. | spanner/google/cloud/spanner_v1/streamed.py | def _merge_by_type(lhs, rhs, type_):
"""Helper for '_merge_chunk'."""
merger = _MERGE_BY_TYPE[type_.code]
return merger(lhs, rhs, type_) | def _merge_by_type(lhs, rhs, type_):
"""Helper for '_merge_chunk'."""
merger = _MERGE_BY_TYPE[type_.code]
return merger(lhs, rhs, type_) | [
"Helper",
"for",
"_merge_chunk",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L302-L305 | [
"def",
"_merge_by_type",
"(",
"lhs",
",",
"rhs",
",",
"type_",
")",
":",
"merger",
"=",
"_MERGE_BY_TYPE",
"[",
"type_",
".",
"code",
"]",
"return",
"merger",
"(",
"lhs",
",",
"rhs",
",",
"type_",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | StreamedResultSet._merge_chunk | Merge pending chunk with next value.
:type value: :class:`~google.protobuf.struct_pb2.Value`
:param value: continuation of chunked value from previous
partial result set.
:rtype: :class:`~google.protobuf.struct_pb2.Value`
:returns: the merged value | spanner/google/cloud/spanner_v1/streamed.py | def _merge_chunk(self, value):
"""Merge pending chunk with next value.
:type value: :class:`~google.protobuf.struct_pb2.Value`
:param value: continuation of chunked value from previous
partial result set.
:rtype: :class:`~google.protobuf.struct_pb2.Value`
... | def _merge_chunk(self, value):
"""Merge pending chunk with next value.
:type value: :class:`~google.protobuf.struct_pb2.Value`
:param value: continuation of chunked value from previous
partial result set.
:rtype: :class:`~google.protobuf.struct_pb2.Value`
... | [
"Merge",
"pending",
"chunk",
"with",
"next",
"value",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L80-L94 | [
"def",
"_merge_chunk",
"(",
"self",
",",
"value",
")",
":",
"current_column",
"=",
"len",
"(",
"self",
".",
"_current_row",
")",
"field",
"=",
"self",
".",
"fields",
"[",
"current_column",
"]",
"merged",
"=",
"_merge_by_type",
"(",
"self",
".",
"_pending_c... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | StreamedResultSet._merge_values | Merge values into rows.
:type values: list of :class:`~google.protobuf.struct_pb2.Value`
:param values: non-chunked values from partial result set. | spanner/google/cloud/spanner_v1/streamed.py | def _merge_values(self, values):
"""Merge values into rows.
:type values: list of :class:`~google.protobuf.struct_pb2.Value`
:param values: non-chunked values from partial result set.
"""
width = len(self.fields)
for value in values:
index = len(self._current... | def _merge_values(self, values):
"""Merge values into rows.
:type values: list of :class:`~google.protobuf.struct_pb2.Value`
:param values: non-chunked values from partial result set.
"""
width = len(self.fields)
for value in values:
index = len(self._current... | [
"Merge",
"values",
"into",
"rows",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L96-L109 | [
"def",
"_merge_values",
"(",
"self",
",",
"values",
")",
":",
"width",
"=",
"len",
"(",
"self",
".",
"fields",
")",
"for",
"value",
"in",
"values",
":",
"index",
"=",
"len",
"(",
"self",
".",
"_current_row",
")",
"field",
"=",
"self",
".",
"fields",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | StreamedResultSet._consume_next | Consume the next partial result set from the stream.
Parse the result set into new/existing rows in :attr:`_rows` | spanner/google/cloud/spanner_v1/streamed.py | def _consume_next(self):
"""Consume the next partial result set from the stream.
Parse the result set into new/existing rows in :attr:`_rows`
"""
response = six.next(self._response_iterator)
self._counter += 1
if self._metadata is None: # first response
met... | def _consume_next(self):
"""Consume the next partial result set from the stream.
Parse the result set into new/existing rows in :attr:`_rows`
"""
response = six.next(self._response_iterator)
self._counter += 1
if self._metadata is None: # first response
met... | [
"Consume",
"the",
"next",
"partial",
"result",
"set",
"from",
"the",
"stream",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L111-L136 | [
"def",
"_consume_next",
"(",
"self",
")",
":",
"response",
"=",
"six",
".",
"next",
"(",
"self",
".",
"_response_iterator",
")",
"self",
".",
"_counter",
"+=",
"1",
"if",
"self",
".",
"_metadata",
"is",
"None",
":",
"# first response",
"metadata",
"=",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | StreamedResultSet.one_or_none | Return exactly one result, or None if there are no results.
:raises: :exc:`ValueError`: If there are multiple results.
:raises: :exc:`RuntimeError`: If consumption has already occurred,
in whole or in part. | spanner/google/cloud/spanner_v1/streamed.py | def one_or_none(self):
"""Return exactly one result, or None if there are no results.
:raises: :exc:`ValueError`: If there are multiple results.
:raises: :exc:`RuntimeError`: If consumption has already occurred,
in whole or in part.
"""
# Sanity check: Has consumptio... | def one_or_none(self):
"""Return exactly one result, or None if there are no results.
:raises: :exc:`ValueError`: If there are multiple results.
:raises: :exc:`RuntimeError`: If consumption has already occurred,
in whole or in part.
"""
# Sanity check: Has consumptio... | [
"Return",
"exactly",
"one",
"result",
"or",
"None",
"if",
"there",
"are",
"no",
"results",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/streamed.py#L163-L192 | [
"def",
"one_or_none",
"(",
"self",
")",
":",
"# Sanity check: Has consumption of this query already started?",
"# If it has, then this is an exception.",
"if",
"self",
".",
"_metadata",
"is",
"not",
"None",
":",
"raise",
"RuntimeError",
"(",
"\"Can not call `.one` or `.one_or_n... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.product_set_path | Return a fully-qualified product_set string. | vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py | def product_set_path(cls, project, location, product_set):
"""Return a fully-qualified product_set string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/productSets/{product_set}",
project=project,
location=location,
... | def product_set_path(cls, project, location, product_set):
"""Return a fully-qualified product_set string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/productSets/{product_set}",
project=project,
location=location,
... | [
"Return",
"a",
"fully",
"-",
"qualified",
"product_set",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L101-L108 | [
"def",
"product_set_path",
"(",
"cls",
",",
"project",
",",
"location",
",",
"product_set",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/locations/{location}/productSets/{product_set}\"",
",",
"project",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.product_path | Return a fully-qualified product string. | vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py | 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 a fully-qualified product string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/products/{product}",
project=project,
location=location,
product=product... | [
"Return",
"a",
"fully",
"-",
"qualified",
"product",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L111-L118 | [
"def",
"product_path",
"(",
"cls",
",",
"project",
",",
"location",
",",
"product",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/locations/{location}/products/{product}\"",
",",
"project",
"=",
"proje... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.reference_image_path | Return a fully-qualified reference_image string. | vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py | 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 a fully-qualified reference_image string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}",
project=... | [
"Return",
"a",
"fully",
"-",
"qualified",
"reference_image",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L121-L129 | [
"def",
"reference_image_path",
"(",
"cls",
",",
"project",
",",
"location",
",",
"product",
",",
"reference_image",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/locations/{location}/products/{product}/ref... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.create_product_set | 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.... | vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py | 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.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new ProductSet resource.
Pos... | [
"Creates",
"and",
"returns",
"a",
"new",
"ProductSet",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L230-L322 | [
"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",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.create_reference_image | 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... | vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py | 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.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new ReferenceImage resour... | [
"Creates",
"and",
"returns",
"a",
"new",
"ReferenceImage",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L1136-L1246 | [
"def",
"create_reference_image",
"(",
"self",
",",
"parent",
",",
"reference_image",
",",
"reference_image_id",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.import_product_sets | 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... | vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py | 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.DEFAULT,
metadata=None,
):
"""
Asynchronous API that imports a list of reference images to specified
pro... | [
"Asynchronous",
"API",
"that",
"imports",
"a",
"list",
"of",
"reference",
"images",
"to",
"specified",
"product",
"sets",
"based",
"on",
"a",
"list",
"of",
"image",
"information",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py#L1800-L1904 | [
"def",
"import_product_sets",
"(",
"self",
",",
"parent",
",",
"input_config",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
"."... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _parse_log_entry | 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... | logging/google/cloud/logging/_gapic.py | 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):
"""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,
... | [
"Special",
"helper",
"to",
"parse",
"LogEntry",
"protobuf",
"into",
"a",
"dictionary",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L421-L447 | [
"def",
"_parse_log_entry",
"(",
"entry_pb",
")",
":",
"try",
":",
"return",
"MessageToDict",
"(",
"entry_pb",
")",
"except",
"TypeError",
":",
"if",
"entry_pb",
".",
"HasField",
"(",
"\"proto_payload\"",
")",
":",
"proto_payload",
"=",
"entry_pb",
".",
"proto_... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _item_to_entry | 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... | logging/google/cloud/logging/_gapic.py | 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):
"""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
... | [
"Convert",
"a",
"log",
"entry",
"protobuf",
"to",
"the",
"native",
"object",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L468-L496 | [
"def",
"_item_to_entry",
"(",
"iterator",
",",
"entry_pb",
",",
"loggers",
")",
":",
"resource",
"=",
"_parse_log_entry",
"(",
"entry_pb",
")",
"return",
"entry_from_resource",
"(",
"resource",
",",
"iterator",
".",
"client",
",",
"loggers",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _item_to_sink | 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: :... | logging/google/cloud/logging/_gapic.py | 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):
"""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... | [
"Convert",
"a",
"sink",
"protobuf",
"to",
"the",
"native",
"object",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L499-L515 | [
"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... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _item_to_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.
... | logging/google/cloud/logging/_gapic.py | 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):
"""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_... | [
"Convert",
"a",
"metric",
"protobuf",
"to",
"the",
"native",
"object",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L518-L534 | [
"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",
".",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | make_logging_api | 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. | logging/google/cloud/logging/_gapic.py | 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):
"""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",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L537-L549 | [
"def",
"make_logging_api",
"(",
"client",
")",
":",
"generated",
"=",
"LoggingServiceV2Client",
"(",
"credentials",
"=",
"client",
".",
"_credentials",
",",
"client_info",
"=",
"_CLIENT_INFO",
")",
"return",
"_LoggingAPI",
"(",
"generated",
",",
"client",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | make_metrics_api | 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. | logging/google/cloud/logging/_gapic.py | 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):
"""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",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L552-L564 | [
"def",
"make_metrics_api",
"(",
"client",
")",
":",
"generated",
"=",
"MetricsServiceV2Client",
"(",
"credentials",
"=",
"client",
".",
"_credentials",
",",
"client_info",
"=",
"_CLIENT_INFO",
")",
"return",
"_MetricsAPI",
"(",
"generated",
",",
"client",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | make_sinks_api | 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. | logging/google/cloud/logging/_gapic.py | 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):
"""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... | [
"Create",
"an",
"instance",
"of",
"the",
"Sinks",
"API",
"adapter",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L567-L579 | [
"def",
"make_sinks_api",
"(",
"client",
")",
":",
"generated",
"=",
"ConfigServiceV2Client",
"(",
"credentials",
"=",
"client",
".",
"_credentials",
",",
"client_info",
"=",
"_CLIENT_INFO",
")",
"return",
"_SinksAPI",
"(",
"generated",
",",
"client",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _LoggingAPI.list_entries | Return a page of log entry resources.
:type projects: list of strings
:param projects: project IDs to include. If not passed,
defaults to the project bound to the API's client.
:type filter_: str
:param filter_:
a filter expression. See
... | logging/google/cloud/logging/_gapic.py | def list_entries(
self, projects, filter_="", order_by="", page_size=0, page_token=None
):
"""Return a page of log entry resources.
:type projects: list of strings
:param projects: project IDs to include. If not passed,
defaults to the project bound to the A... | def list_entries(
self, projects, filter_="", order_by="", page_size=0, page_token=None
):
"""Return a page of log entry resources.
:type projects: list of strings
:param projects: project IDs to include. If not passed,
defaults to the project bound to the A... | [
"Return",
"a",
"page",
"of",
"log",
"entry",
"resources",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L58-L104 | [
"def",
"list_entries",
"(",
"self",
",",
"projects",
",",
"filter_",
"=",
"\"\"",
",",
"order_by",
"=",
"\"\"",
",",
"page_size",
"=",
"0",
",",
"page_token",
"=",
"None",
")",
":",
"page_iter",
"=",
"self",
".",
"_gapic_api",
".",
"list_log_entries",
"(... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _LoggingAPI.write_entries | API call: log an entry resource via a POST request
:type entries: sequence of mapping
:param entries: the log entry resources to log.
:type logger_name: str
:param logger_name: name of default logger to which to log the entries;
individual entries may overr... | logging/google/cloud/logging/_gapic.py | def write_entries(self, entries, logger_name=None, resource=None, labels=None):
"""API call: log an entry resource via a POST request
:type entries: sequence of mapping
:param entries: the log entry resources to log.
:type logger_name: str
:param logger_name: name of default l... | def write_entries(self, entries, logger_name=None, resource=None, labels=None):
"""API call: log an entry resource via a POST request
:type entries: sequence of mapping
:param entries: the log entry resources to log.
:type logger_name: str
:param logger_name: name of default l... | [
"API",
"call",
":",
"log",
"an",
"entry",
"resource",
"via",
"a",
"POST",
"request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L106-L132 | [
"def",
"write_entries",
"(",
"self",
",",
"entries",
",",
"logger_name",
"=",
"None",
",",
"resource",
"=",
"None",
",",
"labels",
"=",
"None",
")",
":",
"partial_success",
"=",
"False",
"entry_pbs",
"=",
"[",
"_log_entry_mapping_to_pb",
"(",
"entry",
")",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _LoggingAPI.logger_delete | API call: delete all entries in a logger via a DELETE request
:type project: str
:param project: ID of project containing the log entries to delete
:type logger_name: str
:param logger_name: name of logger containing the log entries to delete | logging/google/cloud/logging/_gapic.py | def logger_delete(self, project, logger_name):
"""API call: delete all entries in a logger via a DELETE request
:type project: str
:param project: ID of project containing the log entries to delete
:type logger_name: str
:param logger_name: name of logger containing the log en... | def logger_delete(self, project, logger_name):
"""API call: delete all entries in a logger via a DELETE request
:type project: str
:param project: ID of project containing the log entries to delete
:type logger_name: str
:param logger_name: name of logger containing the log en... | [
"API",
"call",
":",
"delete",
"all",
"entries",
"in",
"a",
"logger",
"via",
"a",
"DELETE",
"request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L134-L144 | [
"def",
"logger_delete",
"(",
"self",
",",
"project",
",",
"logger_name",
")",
":",
"path",
"=",
"\"projects/%s/logs/%s\"",
"%",
"(",
"project",
",",
"logger_name",
")",
"self",
".",
"_gapic_api",
".",
"delete_log",
"(",
"path",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _SinksAPI.list_sinks | List sinks for the project associated with this client.
:type project: str
:param project: ID of the project whose sinks are to be listed.
:type page_size: int
:param page_size: maximum number of sinks to return, If not passed,
defaults to a value set by the A... | logging/google/cloud/logging/_gapic.py | def list_sinks(self, project, page_size=0, page_token=None):
"""List sinks for the project associated with this client.
:type project: str
:param project: ID of the project whose sinks are to be listed.
:type page_size: int
:param page_size: maximum number of sinks to return, I... | def list_sinks(self, project, page_size=0, page_token=None):
"""List sinks for the project associated with this client.
:type project: str
:param project: ID of the project whose sinks are to be listed.
:type page_size: int
:param page_size: maximum number of sinks to return, I... | [
"List",
"sinks",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L162-L187 | [
"def",
"list_sinks",
"(",
"self",
",",
"project",
",",
"page_size",
"=",
"0",
",",
"page_token",
"=",
"None",
")",
":",
"path",
"=",
"\"projects/%s\"",
"%",
"(",
"project",
",",
")",
"page_iter",
"=",
"self",
".",
"_gapic_api",
".",
"list_sinks",
"(",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _SinksAPI.sink_create | API call: create a sink resource.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create
:type project: str
:param project: ID of the project in which to create the sink.
:type sink_name: str
:param sink_name: the name of the sink
... | logging/google/cloud/logging/_gapic.py | def sink_create(
self, project, sink_name, filter_, destination, unique_writer_identity=False
):
"""API call: create a sink resource.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create
:type project: str
:param project: ID of the p... | def sink_create(
self, project, sink_name, filter_, destination, unique_writer_identity=False
):
"""API call: create a sink resource.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create
:type project: str
:param project: ID of the p... | [
"API",
"call",
":",
"create",
"a",
"sink",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L189-L225 | [
"def",
"sink_create",
"(",
"self",
",",
"project",
",",
"sink_name",
",",
"filter_",
",",
"destination",
",",
"unique_writer_identity",
"=",
"False",
")",
":",
"parent",
"=",
"\"projects/%s\"",
"%",
"(",
"project",
",",
")",
"sink_pb",
"=",
"LogSink",
"(",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _SinksAPI.sink_get | API call: retrieve a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the sink
:rtype: dict
:returns: The sink object returned from the API (converted from a
p... | logging/google/cloud/logging/_gapic.py | def sink_get(self, project, sink_name):
"""API call: retrieve a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the sink
:rtype: dict
:returns: The sink object returned... | def sink_get(self, project, sink_name):
"""API call: retrieve a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the sink
:rtype: dict
:returns: The sink object returned... | [
"API",
"call",
":",
"retrieve",
"a",
"sink",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L227-L244 | [
"def",
"sink_get",
"(",
"self",
",",
"project",
",",
"sink_name",
")",
":",
"path",
"=",
"\"projects/%s/sinks/%s\"",
"%",
"(",
"project",
",",
"sink_name",
")",
"sink_pb",
"=",
"self",
".",
"_gapic_api",
".",
"get_sink",
"(",
"path",
")",
"# NOTE: LogSink me... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _SinksAPI.sink_update | API call: update a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the sink
:type filter_: str
:param filter_: the advanced logs filter expression defining the
... | logging/google/cloud/logging/_gapic.py | def sink_update(
self, project, sink_name, filter_, destination, unique_writer_identity=False
):
"""API call: update a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the si... | def sink_update(
self, project, sink_name, filter_, destination, unique_writer_identity=False
):
"""API call: update a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the si... | [
"API",
"call",
":",
"update",
"a",
"sink",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L246-L281 | [
"def",
"sink_update",
"(",
"self",
",",
"project",
",",
"sink_name",
",",
"filter_",
",",
"destination",
",",
"unique_writer_identity",
"=",
"False",
")",
":",
"path",
"=",
"\"projects/%s/sinks/%s\"",
"%",
"(",
"project",
",",
"sink_name",
")",
"sink_pb",
"=",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _SinksAPI.sink_delete | API call: delete a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the sink | logging/google/cloud/logging/_gapic.py | def sink_delete(self, project, sink_name):
"""API call: delete a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the sink
"""
path = "projects/%s/sinks/%s" % (project, s... | def sink_delete(self, project, sink_name):
"""API call: delete a sink resource.
:type project: str
:param project: ID of the project containing the sink.
:type sink_name: str
:param sink_name: the name of the sink
"""
path = "projects/%s/sinks/%s" % (project, s... | [
"API",
"call",
":",
"delete",
"a",
"sink",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L283-L293 | [
"def",
"sink_delete",
"(",
"self",
",",
"project",
",",
"sink_name",
")",
":",
"path",
"=",
"\"projects/%s/sinks/%s\"",
"%",
"(",
"project",
",",
"sink_name",
")",
"self",
".",
"_gapic_api",
".",
"delete_sink",
"(",
"path",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _MetricsAPI.list_metrics | List metrics for the project associated with this client.
:type project: str
:param project: ID of the project whose metrics are to be listed.
:type page_size: int
:param page_size: maximum number of metrics to return, If not passed,
defaults to a value set by... | logging/google/cloud/logging/_gapic.py | def list_metrics(self, project, page_size=0, page_token=None):
"""List metrics for the project associated with this client.
:type project: str
:param project: ID of the project whose metrics are to be listed.
:type page_size: int
:param page_size: maximum number of metrics to r... | def list_metrics(self, project, page_size=0, page_token=None):
"""List metrics for the project associated with this client.
:type project: str
:param project: ID of the project whose metrics are to be listed.
:type page_size: int
:param page_size: maximum number of metrics to r... | [
"List",
"metrics",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L312-L337 | [
"def",
"list_metrics",
"(",
"self",
",",
"project",
",",
"page_size",
"=",
"0",
",",
"page_token",
"=",
"None",
")",
":",
"path",
"=",
"\"projects/%s\"",
"%",
"(",
"project",
",",
")",
"page_iter",
"=",
"self",
".",
"_gapic_api",
".",
"list_log_metrics",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _MetricsAPI.metric_create | API call: create a metric resource.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create
:type project: str
:param project: ID of the project in which to create the metric.
:type metric_name: str
:param metric_name: the name of the me... | logging/google/cloud/logging/_gapic.py | def metric_create(self, project, metric_name, filter_, description):
"""API call: create a metric resource.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create
:type project: str
:param project: ID of the project in which to create the metric... | def metric_create(self, project, metric_name, filter_, description):
"""API call: create a metric resource.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create
:type project: str
:param project: ID of the project in which to create the metric... | [
"API",
"call",
":",
"create",
"a",
"metric",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L339-L360 | [
"def",
"metric_create",
"(",
"self",
",",
"project",
",",
"metric_name",
",",
"filter_",
",",
"description",
")",
":",
"parent",
"=",
"\"projects/%s\"",
"%",
"(",
"project",
",",
")",
"metric_pb",
"=",
"LogMetric",
"(",
"name",
"=",
"metric_name",
",",
"fi... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _MetricsAPI.metric_get | API call: retrieve a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
:rtype: dict
:returns: The metric object returned from the API (converted from a
... | logging/google/cloud/logging/_gapic.py | def metric_get(self, project, metric_name):
"""API call: retrieve a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
:rtype: dict
:returns: The metric... | def metric_get(self, project, metric_name):
"""API call: retrieve a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
:rtype: dict
:returns: The metric... | [
"API",
"call",
":",
"retrieve",
"a",
"metric",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L362-L379 | [
"def",
"metric_get",
"(",
"self",
",",
"project",
",",
"metric_name",
")",
":",
"path",
"=",
"\"projects/%s/metrics/%s\"",
"%",
"(",
"project",
",",
"metric_name",
")",
"metric_pb",
"=",
"self",
".",
"_gapic_api",
".",
"get_log_metric",
"(",
"path",
")",
"# ... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _MetricsAPI.metric_update | API call: update a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
:type filter_: str
:param filter_: the advanced logs filter expression defining the
... | logging/google/cloud/logging/_gapic.py | def metric_update(self, project, metric_name, filter_, description):
"""API call: update a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
:type filter_: str... | def metric_update(self, project, metric_name, filter_, description):
"""API call: update a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
:type filter_: str... | [
"API",
"call",
":",
"update",
"a",
"metric",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L381-L406 | [
"def",
"metric_update",
"(",
"self",
",",
"project",
",",
"metric_name",
",",
"filter_",
",",
"description",
")",
":",
"path",
"=",
"\"projects/%s/metrics/%s\"",
"%",
"(",
"project",
",",
"metric_name",
")",
"metric_pb",
"=",
"LogMetric",
"(",
"name",
"=",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _MetricsAPI.metric_delete | API call: delete a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric | logging/google/cloud/logging/_gapic.py | def metric_delete(self, project, metric_name):
"""API call: delete a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
"""
path = "projects/%s/metrics/%... | def metric_delete(self, project, metric_name):
"""API call: delete a metric resource.
:type project: str
:param project: ID of the project containing the metric.
:type metric_name: str
:param metric_name: the name of the metric
"""
path = "projects/%s/metrics/%... | [
"API",
"call",
":",
"delete",
"a",
"metric",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L408-L418 | [
"def",
"metric_delete",
"(",
"self",
",",
"project",
",",
"metric_name",
")",
":",
"path",
"=",
"\"projects/%s/metrics/%s\"",
"%",
"(",
"project",
",",
"metric_name",
")",
"self",
".",
"_gapic_api",
".",
"delete_log_metric",
"(",
"path",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TenantServiceClient.tenant_path | Return a fully-qualified tenant string. | talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py | 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 a fully-qualified tenant string."""
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}", project=project, tenant=tenant
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"tenant",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L100-L104 | [
"def",
"tenant_path",
"(",
"cls",
",",
"project",
",",
"tenant",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/tenants/{tenant}\"",
",",
"project",
"=",
"project",
",",
"tenant",
"=",
"tenant",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TenantServiceClient.create_tenant | Creates a new tenant entity.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.TenantServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>>
>>> # TODO: Initialize `tenant`:
... | talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py | 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,
metadata=None,
):
"""
Creates a new tenant entity.
Example:
>>> from google.cloud import talen... | [
"Creates",
"a",
"new",
"tenant",
"entity",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L205-L274 | [
"def",
"create_tenant",
"(",
"self",
",",
"parent",
",",
"tenant",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TenantServiceClient.get_tenant | Retrieves specified tenant.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.TenantServiceClient()
>>>
>>> name = client.tenant_path('[PROJECT]', '[TENANT]')
>>>
>>> response = client.get_ten... | talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py | 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=None,
):
"""
Retrieves specified tenant.
Example:
>>> from google.cloud import talent_v4beta1
... | [
"Retrieves",
"specified",
"tenant",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L276-L335 | [
"def",
"get_tenant",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadata",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TenantServiceClient.update_tenant | Updates specified tenant.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.TenantServiceClient()
>>>
>>> # TODO: Initialize `tenant`:
>>> tenant = {}
>>>
>>> response = client.upd... | talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py | 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.method.DEFAULT,
metadata=None,
):
"""
Updates specified tenant.
Example:
>>> from google.cloud impor... | [
"Updates",
"specified",
"tenant",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L337-L410 | [
"def",
"update_tenant",
"(",
"self",
",",
"tenant",
",",
"update_mask",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"meth... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _apply_decorators | Apply a list of decorators to a given function.
``decorators`` may contain items that are ``None`` or ``False`` which will
be ignored. | api_core/google/api_core/gapic_v1/method.py | 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):
"""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... | [
"Apply",
"a",
"list",
"of",
"decorators",
"to",
"a",
"given",
"function",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L36-L47 | [
"def",
"_apply_decorators",
"(",
"func",
",",
"decorators",
")",
":",
"decorators",
"=",
"filter",
"(",
"_is_not_none_or_false",
",",
"reversed",
"(",
"decorators",
")",
")",
"for",
"decorator",
"in",
"decorators",
":",
"func",
"=",
"decorator",
"(",
"func",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.