repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
googleapis/google-cloud-python | error_reporting/google/cloud/error_reporting/client.py | Client.report_errors_api | def report_errors_api(self):
"""Helper for logging-related API calls.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs
:rtype:
:class:`_gapic._ErrorReportingGapicApi`
... | python | def report_errors_api(self):
"""Helper for logging-related API calls.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs
:rtype:
:class:`_gapic._ErrorReportingGapicApi`
... | [
"def",
"report_errors_api",
"(",
"self",
")",
":",
"if",
"self",
".",
"_report_errors_api",
"is",
"None",
":",
"if",
"self",
".",
"_use_grpc",
":",
"self",
".",
"_report_errors_api",
"=",
"make_report_error_api",
"(",
"self",
")",
"else",
":",
"self",
".",
... | Helper for logging-related API calls.
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs
:rtype:
:class:`_gapic._ErrorReportingGapicApi`
or
:class:`._logging... | [
"Helper",
"for",
"logging",
"-",
"related",
"API",
"calls",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/error_reporting/client.py#L162-L182 | train |
googleapis/google-cloud-python | error_reporting/google/cloud/error_reporting/client.py | Client._build_error_report | def _build_error_report(
self, message, report_location=None, http_context=None, user=None
):
"""Builds the Error Reporting object to report.
This builds the object according to
https://cloud.google.com/error-reporting/docs/formatting-error-messages
:type message: str
... | python | def _build_error_report(
self, message, report_location=None, http_context=None, user=None
):
"""Builds the Error Reporting object to report.
This builds the object according to
https://cloud.google.com/error-reporting/docs/formatting-error-messages
:type message: str
... | [
"def",
"_build_error_report",
"(",
"self",
",",
"message",
",",
"report_location",
"=",
"None",
",",
"http_context",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"\"serviceContext\"",
":",
"{",
"\"service\"",
":",
"self",
".",
"ser... | Builds the Error Reporting object to report.
This builds the object according to
https://cloud.google.com/error-reporting/docs/formatting-error-messages
:type message: str
:param message: The stack trace that was reported or logged by the
service.
:type rep... | [
"Builds",
"the",
"Error",
"Reporting",
"object",
"to",
"report",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/error_reporting/client.py#L184-L247 | train |
googleapis/google-cloud-python | error_reporting/google/cloud/error_reporting/client.py | Client._send_error_report | def _send_error_report(
self, message, report_location=None, http_context=None, user=None
):
"""Makes the call to the Error Reporting API.
This is the lower-level interface to build and send the payload,
generally users will use either report() or report_exception() to
autom... | python | def _send_error_report(
self, message, report_location=None, http_context=None, user=None
):
"""Makes the call to the Error Reporting API.
This is the lower-level interface to build and send the payload,
generally users will use either report() or report_exception() to
autom... | [
"def",
"_send_error_report",
"(",
"self",
",",
"message",
",",
"report_location",
"=",
"None",
",",
"http_context",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"error_report",
"=",
"self",
".",
"_build_error_report",
"(",
"message",
",",
"report_location"... | Makes the call to the Error Reporting API.
This is the lower-level interface to build and send the payload,
generally users will use either report() or report_exception() to
automatically gather the parameters for this method.
:type message: str
:param message: The stack trace ... | [
"Makes",
"the",
"call",
"to",
"the",
"Error",
"Reporting",
"API",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/error_reporting/client.py#L249-L288 | train |
googleapis/google-cloud-python | error_reporting/google/cloud/error_reporting/client.py | Client.report | def report(self, message, http_context=None, user=None):
""" Reports a message to Stackdriver Error Reporting
https://cloud.google.com/error-reporting/docs/formatting-error-messages
:type message: str
:param message: A user-supplied message to report
:type http_context: :class... | python | def report(self, message, http_context=None, user=None):
""" Reports a message to Stackdriver Error Reporting
https://cloud.google.com/error-reporting/docs/formatting-error-messages
:type message: str
:param message: A user-supplied message to report
:type http_context: :class... | [
"def",
"report",
"(",
"self",
",",
"message",
",",
"http_context",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"stack",
"=",
"traceback",
".",
"extract_stack",
"(",
")",
"last_call",
"=",
"stack",
"[",
"-",
"2",
"]",
"file_path",
"=",
"last_call",... | Reports a message to Stackdriver Error Reporting
https://cloud.google.com/error-reporting/docs/formatting-error-messages
:type message: str
:param message: A user-supplied message to report
:type http_context: :class`google.cloud.error_reporting.HTTPContext`
:param http_contex... | [
"Reports",
"a",
"message",
"to",
"Stackdriver",
"Error",
"Reporting"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/error_reporting/client.py#L290-L333 | train |
googleapis/google-cloud-python | error_reporting/google/cloud/error_reporting/client.py | Client.report_exception | def report_exception(self, http_context=None, user=None):
""" Reports the details of the latest exceptions to Stackdriver Error
Reporting.
:type http_context: :class`google.cloud.error_reporting.HTTPContext`
:param http_context: The HTTP request which was processed when the
... | python | def report_exception(self, http_context=None, user=None):
""" Reports the details of the latest exceptions to Stackdriver Error
Reporting.
:type http_context: :class`google.cloud.error_reporting.HTTPContext`
:param http_context: The HTTP request which was processed when the
... | [
"def",
"report_exception",
"(",
"self",
",",
"http_context",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"self",
".",
"_send_error_report",
"(",
"traceback",
".",
"format_exc",
"(",
")",
",",
"http_context",
"=",
"http_context",
",",
"user",
"=",
"use... | Reports the details of the latest exceptions to Stackdriver Error
Reporting.
:type http_context: :class`google.cloud.error_reporting.HTTPContext`
:param http_context: The HTTP request which was processed when the
error was triggered.
:type user:... | [
"Reports",
"the",
"details",
"of",
"the",
"latest",
"exceptions",
"to",
"Stackdriver",
"Error",
"Reporting",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/error_reporting/client.py#L335-L361 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/transaction.py | Transaction.current | def current(self):
"""Return the topmost transaction.
.. note::
If the topmost element on the stack is not a transaction,
returns None.
:rtype: :class:`google.cloud.datastore.transaction.Transaction` or None
:returns: The current transaction (if any are active)... | python | def current(self):
"""Return the topmost transaction.
.. note::
If the topmost element on the stack is not a transaction,
returns None.
:rtype: :class:`google.cloud.datastore.transaction.Transaction` or None
:returns: The current transaction (if any are active)... | [
"def",
"current",
"(",
"self",
")",
":",
"top",
"=",
"super",
"(",
"Transaction",
",",
"self",
")",
".",
"current",
"(",
")",
"if",
"isinstance",
"(",
"top",
",",
"Transaction",
")",
":",
"return",
"top"
] | Return the topmost transaction.
.. note::
If the topmost element on the stack is not a transaction,
returns None.
:rtype: :class:`google.cloud.datastore.transaction.Transaction` or None
:returns: The current transaction (if any are active). | [
"Return",
"the",
"topmost",
"transaction",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/transaction.py#L181-L194 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/transaction.py | Transaction.begin | def begin(self):
"""Begins a transaction.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
:raises: :class:`~exceptions.ValueError` if the transaction has
already... | python | def begin(self):
"""Begins a transaction.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
:raises: :class:`~exceptions.ValueError` if the transaction has
already... | [
"def",
"begin",
"(",
"self",
")",
":",
"super",
"(",
"Transaction",
",",
"self",
")",
".",
"begin",
"(",
")",
"try",
":",
"response_pb",
"=",
"self",
".",
"_client",
".",
"_datastore_api",
".",
"begin_transaction",
"(",
"self",
".",
"project",
")",
"se... | Begins a transaction.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
:raises: :class:`~exceptions.ValueError` if the transaction has
already begun. | [
"Begins",
"a",
"transaction",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/transaction.py#L196-L212 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/transaction.py | Transaction.rollback | def rollback(self):
"""Rolls back the current transaction.
This method has necessary side-effects:
- Sets the current transaction's ID to None.
"""
try:
# No need to use the response it contains nothing.
self._client._datastore_api.rollback(self.project,... | python | def rollback(self):
"""Rolls back the current transaction.
This method has necessary side-effects:
- Sets the current transaction's ID to None.
"""
try:
# No need to use the response it contains nothing.
self._client._datastore_api.rollback(self.project,... | [
"def",
"rollback",
"(",
"self",
")",
":",
"try",
":",
"# No need to use the response it contains nothing.",
"self",
".",
"_client",
".",
"_datastore_api",
".",
"rollback",
"(",
"self",
".",
"project",
",",
"self",
".",
"_id",
")",
"finally",
":",
"super",
"(",... | Rolls back the current transaction.
This method has necessary side-effects:
- Sets the current transaction's ID to None. | [
"Rolls",
"back",
"the",
"current",
"transaction",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/transaction.py#L214-L227 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/transaction.py | Transaction.put | def put(self, entity):
"""Adds an entity to be committed.
Ensures the transaction is not marked readonly.
Please see documentation at
:meth:`~google.cloud.datastore.batch.Batch.put`
:type entity: :class:`~google.cloud.datastore.entity.Entity`
:param entity: the entity t... | python | def put(self, entity):
"""Adds an entity to be committed.
Ensures the transaction is not marked readonly.
Please see documentation at
:meth:`~google.cloud.datastore.batch.Batch.put`
:type entity: :class:`~google.cloud.datastore.entity.Entity`
:param entity: the entity t... | [
"def",
"put",
"(",
"self",
",",
"entity",
")",
":",
"if",
"self",
".",
"_options",
".",
"HasField",
"(",
"\"read_only\"",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Transaction is read only\"",
")",
"else",
":",
"super",
"(",
"Transaction",
",",
"self",
")... | Adds an entity to be committed.
Ensures the transaction is not marked readonly.
Please see documentation at
:meth:`~google.cloud.datastore.batch.Batch.put`
:type entity: :class:`~google.cloud.datastore.entity.Entity`
:param entity: the entity to be saved.
:raises: :cla... | [
"Adds",
"an",
"entity",
"to",
"be",
"committed",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/transaction.py#L246-L262 | train |
googleapis/google-cloud-python | securitycenter/google/cloud/securitycenter_v1beta1/gapic/security_center_client.py | SecurityCenterClient.list_findings | def list_findings(
self,
parent,
filter_=None,
order_by=None,
read_time=None,
field_mask=None,
page_size=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""... | python | def list_findings(
self,
parent,
filter_=None,
order_by=None,
read_time=None,
field_mask=None,
page_size=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""... | [
"def",
"list_findings",
"(",
"self",
",",
"parent",
",",
"filter_",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
"read_time",
"=",
"None",
",",
"field_mask",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
"... | Lists an organization or source's findings.
To list across all sources provide a ``-`` as the source id. Example:
/v1beta1/organizations/123/sources/-/findings
Example:
>>> from google.cloud import securitycenter_v1beta1
>>>
>>> client = securitycenter_v1bet... | [
"Lists",
"an",
"organization",
"or",
"source",
"s",
"findings",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/securitycenter/google/cloud/securitycenter_v1beta1/gapic/security_center_client.py#L1157-L1320 | train |
googleapis/google-cloud-python | logging/google/cloud/logging/metric.py | Metric.from_api_repr | def from_api_repr(cls, resource, client):
"""Factory: construct a metric given its API representation
:type resource: dict
:param resource: metric resource representation returned from the API
:type client: :class:`google.cloud.logging.client.Client`
:param client: Client whic... | python | def from_api_repr(cls, resource, client):
"""Factory: construct a metric given its API representation
:type resource: dict
:param resource: metric resource representation returned from the API
:type client: :class:`google.cloud.logging.client.Client`
:param client: Client whic... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"metric_name",
"=",
"resource",
"[",
"\"name\"",
"]",
"filter_",
"=",
"resource",
"[",
"\"filter\"",
"]",
"description",
"=",
"resource",
".",
"get",
"(",
"\"description\"",
",",
... | Factory: construct a metric given its API representation
:type resource: dict
:param resource: metric resource representation returned from the API
:type client: :class:`google.cloud.logging.client.Client`
:param client: Client which holds credentials and project
... | [
"Factory",
":",
"construct",
"a",
"metric",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/metric.py#L69-L85 | train |
googleapis/google-cloud-python | logging/google/cloud/logging/metric.py | Metric.create | def create(self, client=None):
"""API call: create the metric via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client... | python | def create(self, client=None):
"""API call: create the metric via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client... | [
"def",
"create",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"client",
".",
"metrics_api",
".",
"metric_create",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
",",
"self... | API call: create the metric via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls... | [
"API",
"call",
":",
"create",
"the",
"metric",
"via",
"a",
"PUT",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/metric.py#L102-L116 | train |
googleapis/google-cloud-python | logging/google/cloud/logging/metric.py | Metric.exists | def exists(self, client=None):
"""API call: test for the existence of the metric via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
... | python | def exists(self, client=None):
"""API call: test for the existence of the metric via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
... | [
"def",
"exists",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"try",
":",
"client",
".",
"metrics_api",
".",
"metric_get",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
... | API call: test for the existence of the metric via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If n... | [
"API",
"call",
":",
"test",
"for",
"the",
"existence",
"of",
"the",
"metric",
"via",
"a",
"GET",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/metric.py#L118-L139 | train |
googleapis/google-cloud-python | logging/google/cloud/logging/metric.py | Metric.reload | def reload(self, client=None):
"""API call: sync local metric configuration via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:p... | python | def reload(self, client=None):
"""API call: sync local metric configuration via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:p... | [
"def",
"reload",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"data",
"=",
"client",
".",
"metrics_api",
".",
"metric_get",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
... | API call: sync local metric configuration via a GET request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/get
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not pa... | [
"API",
"call",
":",
"sync",
"local",
"metric",
"configuration",
"via",
"a",
"GET",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/metric.py#L141-L155 | train |
googleapis/google-cloud-python | logging/google/cloud/logging/metric.py | Metric.update | def update(self, client=None):
"""API call: update metric configuration via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/update
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:pa... | python | def update(self, client=None):
"""API call: update metric configuration via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/update
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:pa... | [
"def",
"update",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"client",
".",
"metrics_api",
".",
"metric_update",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
",",
"self... | API call: update metric configuration via a PUT request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/update
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not pas... | [
"API",
"call",
":",
"update",
"metric",
"configuration",
"via",
"a",
"PUT",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/metric.py#L157-L171 | train |
googleapis/google-cloud-python | logging/google/cloud/logging/metric.py | Metric.delete | def delete(self, client=None):
"""API call: delete a metric via a DELETE request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/delete
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param clien... | python | def delete(self, client=None):
"""API call: delete a metric via a DELETE request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/delete
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param clien... | [
"def",
"delete",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"client",
".",
"metrics_api",
".",
"metric_delete",
"(",
"self",
".",
"project",
",",
"self",
".",
"name",
")"
] | API call: delete a metric via a DELETE request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/delete
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: the client to use. If not passed, fall... | [
"API",
"call",
":",
"delete",
"a",
"metric",
"via",
"a",
"DELETE",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/metric.py#L173-L185 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/_gapic.py | _dict_mapping_to_pb | def _dict_mapping_to_pb(mapping, proto_type):
"""
Convert a dict to protobuf.
Args:
mapping (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of the specified protobuf.
"""
converted_pb = getattr(trac... | python | def _dict_mapping_to_pb(mapping, proto_type):
"""
Convert a dict to protobuf.
Args:
mapping (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of the specified protobuf.
"""
converted_pb = getattr(trac... | [
"def",
"_dict_mapping_to_pb",
"(",
"mapping",
",",
"proto_type",
")",
":",
"converted_pb",
"=",
"getattr",
"(",
"trace_pb2",
",",
"proto_type",
")",
"(",
")",
"ParseDict",
"(",
"mapping",
",",
"converted_pb",
")",
"return",
"converted_pb"
] | Convert a dict to protobuf.
Args:
mapping (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of the specified protobuf. | [
"Convert",
"a",
"dict",
"to",
"protobuf",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/_gapic.py#L245-L258 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/_gapic.py | _span_attrs_to_pb | def _span_attrs_to_pb(span_attr, proto_type):
"""
Convert a span attribute dict to protobuf, including Links, Attributes,
TimeEvents.
Args:
span_attr (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of t... | python | def _span_attrs_to_pb(span_attr, proto_type):
"""
Convert a span attribute dict to protobuf, including Links, Attributes,
TimeEvents.
Args:
span_attr (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of t... | [
"def",
"_span_attrs_to_pb",
"(",
"span_attr",
",",
"proto_type",
")",
":",
"attr_pb",
"=",
"getattr",
"(",
"trace_pb2",
".",
"Span",
",",
"proto_type",
")",
"(",
")",
"ParseDict",
"(",
"span_attr",
",",
"attr_pb",
")",
"return",
"attr_pb"
] | Convert a span attribute dict to protobuf, including Links, Attributes,
TimeEvents.
Args:
span_attr (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of the specified protobuf. | [
"Convert",
"a",
"span",
"attribute",
"dict",
"to",
"protobuf",
"including",
"Links",
"Attributes",
"TimeEvents",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/_gapic.py#L261-L275 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/_gapic.py | _value_to_pb | def _value_to_pb(value, proto_type):
"""
Convert a value to protobuf. e.g. BoolValue, Int32Value.
Args:
value (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of the specified protobuf.
"""
data_type... | python | def _value_to_pb(value, proto_type):
"""
Convert a value to protobuf. e.g. BoolValue, Int32Value.
Args:
value (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of the specified protobuf.
"""
data_type... | [
"def",
"_value_to_pb",
"(",
"value",
",",
"proto_type",
")",
":",
"data_type_pb",
"=",
"getattr",
"(",
"google_dot_protobuf_dot_wrappers__pb2",
",",
"proto_type",
")",
"(",
")",
"ParseDict",
"(",
"value",
",",
"data_type_pb",
")",
"return",
"data_type_pb"
] | Convert a value to protobuf. e.g. BoolValue, Int32Value.
Args:
value (dict): A dict that needs to be converted to protobuf.
proto_type (str): The type of the Protobuf.
Returns:
An instance of the specified protobuf. | [
"Convert",
"a",
"value",
"to",
"protobuf",
".",
"e",
".",
"g",
".",
"BoolValue",
"Int32Value",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/_gapic.py#L293-L306 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/_gapic.py | _TraceAPI.batch_write_spans | def batch_write_spans(
self, name, spans, retry=method.DEFAULT, timeout=method.DEFAULT
):
"""
Sends new spans to Stackdriver Trace or updates existing traces. If the
name of a trace that you send matches that of an existing trace, new
spans are added to the existing trace. At... | python | def batch_write_spans(
self, name, spans, retry=method.DEFAULT, timeout=method.DEFAULT
):
"""
Sends new spans to Stackdriver Trace or updates existing traces. If the
name of a trace that you send matches that of an existing trace, new
spans are added to the existing trace. At... | [
"def",
"batch_write_spans",
"(",
"self",
",",
"name",
",",
"spans",
",",
"retry",
"=",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"method",
".",
"DEFAULT",
")",
":",
"spans_pb_list",
"=",
"[",
"]",
"for",
"span_mapping",
"in",
"spans",
"[",
"\"spans\... | Sends new spans to Stackdriver Trace or updates existing traces. If the
name of a trace that you send matches that of an existing trace, new
spans are added to the existing trace. Attempt to update existing spans
results undefined behavior. If the name does not match, a new trace is
crea... | [
"Sends",
"new",
"spans",
"to",
"Stackdriver",
"Trace",
"or",
"updates",
"existing",
"traces",
".",
"If",
"the",
"name",
"of",
"a",
"trace",
"that",
"you",
"send",
"matches",
"that",
"of",
"an",
"existing",
"trace",
"new",
"spans",
"are",
"added",
"to",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/_gapic.py#L51-L90 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/_gapic.py | _TraceAPI.create_span | def create_span(
self,
name,
span_id,
display_name,
start_time,
end_time,
parent_span_id=None,
attributes=None,
stack_trace=None,
time_events=None,
links=None,
status=None,
same_process_as_parent_span=None,
c... | python | def create_span(
self,
name,
span_id,
display_name,
start_time,
end_time,
parent_span_id=None,
attributes=None,
stack_trace=None,
time_events=None,
links=None,
status=None,
same_process_as_parent_span=None,
c... | [
"def",
"create_span",
"(",
"self",
",",
"name",
",",
"span_id",
",",
"display_name",
",",
"start_time",
",",
"end_time",
",",
"parent_span_id",
"=",
"None",
",",
"attributes",
"=",
"None",
",",
"stack_trace",
"=",
"None",
",",
"time_events",
"=",
"None",
"... | Creates a new Span.
Example:
>>> from google.cloud import trace_v2
>>>
>>> client = trace_v2.TraceServiceClient()
>>>
>>> name = client.span_path('[PROJECT]', '[TRACE]', '[SPAN]')
>>> span_id = ''
>>> display_name = {}
... | [
"Creates",
"a",
"new",
"Span",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/_gapic.py#L92-L242 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster.from_pb | def from_pb(cls, cluster_pb, instance):
"""Creates an cluster instance from a protobuf.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_cluster_from_pb]
:end-before: [END bigtable_cluster_from_pb]
:type cluster_pb: :class:`instance_pb... | python | def from_pb(cls, cluster_pb, instance):
"""Creates an cluster instance from a protobuf.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_cluster_from_pb]
:end-before: [END bigtable_cluster_from_pb]
:type cluster_pb: :class:`instance_pb... | [
"def",
"from_pb",
"(",
"cls",
",",
"cluster_pb",
",",
"instance",
")",
":",
"match_cluster_name",
"=",
"_CLUSTER_NAME_RE",
".",
"match",
"(",
"cluster_pb",
".",
"name",
")",
"if",
"match_cluster_name",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Cluster ... | Creates an cluster instance from a protobuf.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_cluster_from_pb]
:end-before: [END bigtable_cluster_from_pb]
:type cluster_pb: :class:`instance_pb2.Cluster`
:param cluster_pb: An instance p... | [
"Creates",
"an",
"cluster",
"instance",
"from",
"a",
"protobuf",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L94-L137 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster._update_from_pb | def _update_from_pb(self, cluster_pb):
"""Refresh self from the server-provided protobuf.
Helper for :meth:`from_pb` and :meth:`reload`.
"""
self.location_id = cluster_pb.location.split("/")[-1]
self.serve_nodes = cluster_pb.serve_nodes
self.default_storage_type = cluste... | python | def _update_from_pb(self, cluster_pb):
"""Refresh self from the server-provided protobuf.
Helper for :meth:`from_pb` and :meth:`reload`.
"""
self.location_id = cluster_pb.location.split("/")[-1]
self.serve_nodes = cluster_pb.serve_nodes
self.default_storage_type = cluste... | [
"def",
"_update_from_pb",
"(",
"self",
",",
"cluster_pb",
")",
":",
"self",
".",
"location_id",
"=",
"cluster_pb",
".",
"location",
".",
"split",
"(",
"\"/\"",
")",
"[",
"-",
"1",
"]",
"self",
".",
"serve_nodes",
"=",
"cluster_pb",
".",
"serve_nodes",
"s... | Refresh self from the server-provided protobuf.
Helper for :meth:`from_pb` and :meth:`reload`. | [
"Refresh",
"self",
"from",
"the",
"server",
"-",
"provided",
"protobuf",
".",
"Helper",
"for",
":",
"meth",
":",
"from_pb",
"and",
":",
"meth",
":",
"reload",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L139-L147 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster.name | def name(self):
"""Cluster name used in requests.
.. note::
This property will not change if ``_instance`` and ``cluster_id``
do not, but the return value is not cached.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_cluster_... | python | def name(self):
"""Cluster name used in requests.
.. note::
This property will not change if ``_instance`` and ``cluster_id``
do not, but the return value is not cached.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_cluster_... | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_instance",
".",
"_client",
".",
"instance_admin_client",
".",
"cluster_path",
"(",
"self",
".",
"_instance",
".",
"_client",
".",
"project",
",",
"self",
".",
"_instance",
".",
"instance_id",
"... | Cluster name used in requests.
.. note::
This property will not change if ``_instance`` and ``cluster_id``
do not, but the return value is not cached.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_cluster_name]
:end-befo... | [
"Cluster",
"name",
"used",
"in",
"requests",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L150-L172 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster.reload | def reload(self):
"""Reload the metadata for this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_cluster]
:end-before: [END bigtable_reload_cluster]
"""
cluster_pb = self._instance._client.instance_admin_client... | python | def reload(self):
"""Reload the metadata for this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_cluster]
:end-before: [END bigtable_reload_cluster]
"""
cluster_pb = self._instance._client.instance_admin_client... | [
"def",
"reload",
"(",
"self",
")",
":",
"cluster_pb",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"instance_admin_client",
".",
"get_cluster",
"(",
"self",
".",
"name",
")",
"# NOTE: _update_from_pb does not check that the project and",
"# cluster ID on th... | Reload the metadata for this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_cluster]
:end-before: [END bigtable_reload_cluster] | [
"Reload",
"the",
"metadata",
"for",
"this",
"cluster",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L201-L214 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster.exists | def exists(self):
"""Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_cluster_exists]
:end-before: [END bigtable_check_cluster_exists]
:rtype: bool
:returns: True if the table exi... | python | def exists(self):
"""Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_cluster_exists]
:end-before: [END bigtable_check_cluster_exists]
:rtype: bool
:returns: True if the table exi... | [
"def",
"exists",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"try",
":",
"client",
".",
"instance_admin_client",
".",
"get_cluster",
"(",
"name",
"=",
"self",
".",
"name",
")",
"return",
"True",
"# NOTE: There could be oth... | Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_cluster_exists]
:end-before: [END bigtable_check_cluster_exists]
:rtype: bool
:returns: True if the table exists, else False. | [
"Check",
"whether",
"the",
"cluster",
"already",
"exists",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L216-L234 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster.create | def create(self):
"""Create this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-before: [END bigtable_create_cluster]
.. note::
Uses the ``project``, ``instance`` and ``cluster_id`` on the
... | python | def create(self):
"""Create this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-before: [END bigtable_create_cluster]
.. note::
Uses the ``project``, ``instance`` and ``cluster_id`` on the
... | [
"def",
"create",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"cluster_pb",
"=",
"self",
".",
"_to_pb",
"(",
")",
"return",
"client",
".",
"instance_admin_client",
".",
"create_cluster",
"(",
"self",
".",
"_instance",
"."... | Create this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-before: [END bigtable_create_cluster]
.. note::
Uses the ``project``, ``instance`` and ``cluster_id`` on the
current :class:`Cl... | [
"Create",
"this",
"cluster",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L236-L267 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster.update | def update(self):
"""Update this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_cluster]
:end-before: [END bigtable_update_cluster]
.. note::
Updates the ``serve_nodes``. If you'd like to
chan... | python | def update(self):
"""Update this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_cluster]
:end-before: [END bigtable_update_cluster]
.. note::
Updates the ``serve_nodes``. If you'd like to
chan... | [
"def",
"update",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"# We are passing `None` for second argument location.",
"# Location is set only at the time of creation of a cluster",
"# and can not be changed after cluster has been created.",
"return... | Update this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_cluster]
:end-before: [END bigtable_update_cluster]
.. note::
Updates the ``serve_nodes``. If you'd like to
change them before updating, rese... | [
"Update",
"this",
"cluster",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L269-L311 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster.delete | def delete(self):
"""Delete this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_delete_cluster]
:end-before: [END bigtable_delete_cluster]
Marks a cluster and all of its tables for permanent deletion in 7 days.
Imme... | python | def delete(self):
"""Delete this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_delete_cluster]
:end-before: [END bigtable_delete_cluster]
Marks a cluster and all of its tables for permanent deletion in 7 days.
Imme... | [
"def",
"delete",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"client",
".",
"instance_admin_client",
".",
"delete_cluster",
"(",
"self",
".",
"name",
")"
] | Delete this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_delete_cluster]
:end-before: [END bigtable_delete_cluster]
Marks a cluster and all of its tables for permanent deletion in 7 days.
Immediately upon completion of th... | [
"Delete",
"this",
"cluster",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L313-L340 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/cluster.py | Cluster._to_pb | def _to_pb(self):
""" Create cluster proto buff message for API calls """
client = self._instance._client
location = client.instance_admin_client.location_path(
client.project, self.location_id
)
cluster_pb = instance_pb2.Cluster(
location=location,
... | python | def _to_pb(self):
""" Create cluster proto buff message for API calls """
client = self._instance._client
location = client.instance_admin_client.location_path(
client.project, self.location_id
)
cluster_pb = instance_pb2.Cluster(
location=location,
... | [
"def",
"_to_pb",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"location",
"=",
"client",
".",
"instance_admin_client",
".",
"location_path",
"(",
"client",
".",
"project",
",",
"self",
".",
"location_id",
")",
"cluster_pb",... | Create cluster proto buff message for API calls | [
"Create",
"cluster",
"proto",
"buff",
"message",
"for",
"API",
"calls"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L342-L353 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | Cell.from_pb | def from_pb(cls, cell_pb):
"""Create a new cell from a Cell protobuf.
:type cell_pb: :class:`._generated.data_pb2.Cell`
:param cell_pb: The protobuf to convert.
:rtype: :class:`Cell`
:returns: The cell corresponding to the protobuf.
"""
if cell_pb.labels:
... | python | def from_pb(cls, cell_pb):
"""Create a new cell from a Cell protobuf.
:type cell_pb: :class:`._generated.data_pb2.Cell`
:param cell_pb: The protobuf to convert.
:rtype: :class:`Cell`
:returns: The cell corresponding to the protobuf.
"""
if cell_pb.labels:
... | [
"def",
"from_pb",
"(",
"cls",
",",
"cell_pb",
")",
":",
"if",
"cell_pb",
".",
"labels",
":",
"return",
"cls",
"(",
"cell_pb",
".",
"value",
",",
"cell_pb",
".",
"timestamp_micros",
",",
"labels",
"=",
"cell_pb",
".",
"labels",
")",
"else",
":",
"return... | Create a new cell from a Cell protobuf.
:type cell_pb: :class:`._generated.data_pb2.Cell`
:param cell_pb: The protobuf to convert.
:rtype: :class:`Cell`
:returns: The cell corresponding to the protobuf. | [
"Create",
"a",
"new",
"cell",
"from",
"a",
"Cell",
"protobuf",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L59-L71 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowData.to_dict | def to_dict(self):
"""Convert the cells to a dictionary.
This is intended to be used with HappyBase, so the column family and
column qualiers are combined (with ``:``).
:rtype: dict
:returns: Dictionary containing all the data in the cells of this row.
"""
resul... | python | def to_dict(self):
"""Convert the cells to a dictionary.
This is intended to be used with HappyBase, so the column family and
column qualiers are combined (with ``:``).
:rtype: dict
:returns: Dictionary containing all the data in the cells of this row.
"""
resul... | [
"def",
"to_dict",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"for",
"column_family_id",
",",
"columns",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"_cells",
")",
":",
"for",
"column_qual",
",",
"cells",
"in",
"six",
".",
"iteritems",
"(",
... | Convert the cells to a dictionary.
This is intended to be used with HappyBase, so the column family and
column qualiers are combined (with ``:``).
:rtype: dict
:returns: Dictionary containing all the data in the cells of this row. | [
"Convert",
"the",
"cells",
"to",
"a",
"dictionary",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L157-L171 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowData.find_cells | def find_cells(self, column_family_id, column):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_find_cells]
:end-before: [END bigtable_row_find_cells]
Args:
... | python | def find_cells(self, column_family_id, column):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_find_cells]
:end-before: [END bigtable_row_find_cells]
Args:
... | [
"def",
"find_cells",
"(",
"self",
",",
"column_family_id",
",",
"column",
")",
":",
"try",
":",
"column_family",
"=",
"self",
".",
"_cells",
"[",
"column_family_id",
"]",
"except",
"KeyError",
":",
"raise",
"KeyError",
"(",
"_MISSING_COLUMN_FAMILY",
".",
"form... | Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_find_cells]
:end-before: [END bigtable_row_find_cells]
Args:
column_family_id (str): The ID of the column family. Must b... | [
"Get",
"a",
"time",
"series",
"of",
"cells",
"stored",
"on",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L200-L235 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowData.cell_value | def cell_value(self, column_family_id, column, index=0):
"""Get a single cell value stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_value]
:end-before: [END bigtable_row_cell_value]
Args:
... | python | def cell_value(self, column_family_id, column, index=0):
"""Get a single cell value stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_value]
:end-before: [END bigtable_row_cell_value]
Args:
... | [
"def",
"cell_value",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"index",
"=",
"0",
")",
":",
"cells",
"=",
"self",
".",
"find_cells",
"(",
"column_family_id",
",",
"column",
")",
"try",
":",
"cell",
"=",
"cells",
"[",
"index",
"]",
"exce... | Get a single cell value stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_value]
:end-before: [END bigtable_row_cell_value]
Args:
column_family_id (str): The ID of the column family. Must be o... | [
"Get",
"a",
"single",
"cell",
"value",
"stored",
"on",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L237-L276 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowData.cell_values | def cell_values(self, column_family_id, column, max_count=None):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_values]
:end-before: [END bigtable_row_cell_values]
... | python | def cell_values(self, column_family_id, column, max_count=None):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_values]
:end-before: [END bigtable_row_cell_values]
... | [
"def",
"cell_values",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"max_count",
"=",
"None",
")",
":",
"cells",
"=",
"self",
".",
"find_cells",
"(",
"column_family_id",
",",
"column",
")",
"if",
"max_count",
"is",
"None",
":",
"max_count",
"="... | Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_values]
:end-before: [END bigtable_row_cell_values]
Args:
column_family_id (str): The ID of the column family. Must... | [
"Get",
"a",
"time",
"series",
"of",
"cells",
"stored",
"on",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L278-L312 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowsData.consume_all | def consume_all(self, max_loops=None):
"""Consume the streamed responses until there are no more.
.. warning::
This method will be removed in future releases. Please use this
class as a generator instead.
:type max_loops: int
:param max_loops: (Optional) Maximum ... | python | def consume_all(self, max_loops=None):
"""Consume the streamed responses until there are no more.
.. warning::
This method will be removed in future releases. Please use this
class as a generator instead.
:type max_loops: int
:param max_loops: (Optional) Maximum ... | [
"def",
"consume_all",
"(",
"self",
",",
"max_loops",
"=",
"None",
")",
":",
"for",
"row",
"in",
"self",
":",
"self",
".",
"rows",
"[",
"row",
".",
"row_key",
"]",
"=",
"row"
] | Consume the streamed responses until there are no more.
.. warning::
This method will be removed in future releases. Please use this
class as a generator instead.
:type max_loops: int
:param max_loops: (Optional) Maximum number of times to try to consume
... | [
"Consume",
"the",
"streamed",
"responses",
"until",
"there",
"are",
"no",
"more",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L417-L430 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowsData._create_retry_request | def _create_retry_request(self):
"""Helper for :meth:`__iter__`."""
req_manager = _ReadRowsRequestManager(
self.request, self.last_scanned_row_key, self._counter
)
return req_manager.build_updated_request() | python | def _create_retry_request(self):
"""Helper for :meth:`__iter__`."""
req_manager = _ReadRowsRequestManager(
self.request, self.last_scanned_row_key, self._counter
)
return req_manager.build_updated_request() | [
"def",
"_create_retry_request",
"(",
"self",
")",
":",
"req_manager",
"=",
"_ReadRowsRequestManager",
"(",
"self",
".",
"request",
",",
"self",
".",
"last_scanned_row_key",
",",
"self",
".",
"_counter",
")",
"return",
"req_manager",
".",
"build_updated_request",
"... | Helper for :meth:`__iter__`. | [
"Helper",
"for",
":",
"meth",
":",
"__iter__",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L432-L437 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowsData._on_error | def _on_error(self, exc):
"""Helper for :meth:`__iter__`."""
# restart the read scan from AFTER the last successfully read row
retry_request = self.request
if self.last_scanned_row_key:
retry_request = self._create_retry_request()
self.response_iterator = self.read_m... | python | def _on_error(self, exc):
"""Helper for :meth:`__iter__`."""
# restart the read scan from AFTER the last successfully read row
retry_request = self.request
if self.last_scanned_row_key:
retry_request = self._create_retry_request()
self.response_iterator = self.read_m... | [
"def",
"_on_error",
"(",
"self",
",",
"exc",
")",
":",
"# restart the read scan from AFTER the last successfully read row",
"retry_request",
"=",
"self",
".",
"request",
"if",
"self",
".",
"last_scanned_row_key",
":",
"retry_request",
"=",
"self",
".",
"_create_retry_re... | Helper for :meth:`__iter__`. | [
"Helper",
"for",
":",
"meth",
":",
"__iter__",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L439-L446 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowsData._save_current_cell | def _save_current_cell(self):
"""Helper for :meth:`consume_next`."""
row, cell = self._row, self._cell
family = row._cells.setdefault(cell.family_name, {})
qualified = family.setdefault(cell.qualifier, [])
complete = Cell.from_pb(cell)
qualified.append(complete)
s... | python | def _save_current_cell(self):
"""Helper for :meth:`consume_next`."""
row, cell = self._row, self._cell
family = row._cells.setdefault(cell.family_name, {})
qualified = family.setdefault(cell.qualifier, [])
complete = Cell.from_pb(cell)
qualified.append(complete)
s... | [
"def",
"_save_current_cell",
"(",
"self",
")",
":",
"row",
",",
"cell",
"=",
"self",
".",
"_row",
",",
"self",
".",
"_cell",
"family",
"=",
"row",
".",
"_cells",
".",
"setdefault",
"(",
"cell",
".",
"family_name",
",",
"{",
"}",
")",
"qualified",
"="... | Helper for :meth:`consume_next`. | [
"Helper",
"for",
":",
"meth",
":",
"consume_next",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L560-L567 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | PartialRowsData._copy_from_previous | def _copy_from_previous(self, cell):
"""Helper for :meth:`consume_next`."""
previous = self._previous_cell
if previous is not None:
if not cell.row_key:
cell.row_key = previous.row_key
if not cell.family_name:
cell.family_name = pre... | python | def _copy_from_previous(self, cell):
"""Helper for :meth:`consume_next`."""
previous = self._previous_cell
if previous is not None:
if not cell.row_key:
cell.row_key = previous.row_key
if not cell.family_name:
cell.family_name = pre... | [
"def",
"_copy_from_previous",
"(",
"self",
",",
"cell",
")",
":",
"previous",
"=",
"self",
".",
"_previous_cell",
"if",
"previous",
"is",
"not",
"None",
":",
"if",
"not",
"cell",
".",
"row_key",
":",
"cell",
".",
"row_key",
"=",
"previous",
".",
"row_key... | Helper for :meth:`consume_next`. | [
"Helper",
"for",
":",
"meth",
":",
"consume_next",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L569-L579 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | _ReadRowsRequestManager.build_updated_request | def build_updated_request(self):
""" Updates the given message request as per last scanned key
"""
r_kwargs = {
"table_name": self.message.table_name,
"filter": self.message.filter,
}
if self.message.rows_limit != 0:
r_kwargs["rows_limit"] = m... | python | def build_updated_request(self):
""" Updates the given message request as per last scanned key
"""
r_kwargs = {
"table_name": self.message.table_name,
"filter": self.message.filter,
}
if self.message.rows_limit != 0:
r_kwargs["rows_limit"] = m... | [
"def",
"build_updated_request",
"(",
"self",
")",
":",
"r_kwargs",
"=",
"{",
"\"table_name\"",
":",
"self",
".",
"message",
".",
"table_name",
",",
"\"filter\"",
":",
"self",
".",
"message",
".",
"filter",
",",
"}",
"if",
"self",
".",
"message",
".",
"ro... | Updates the given message request as per last scanned key | [
"Updates",
"the",
"given",
"message",
"request",
"as",
"per",
"last",
"scanned",
"key"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L604-L629 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | _ReadRowsRequestManager._filter_rows_keys | def _filter_rows_keys(self):
""" Helper for :meth:`build_updated_request`"""
return [
row_key
for row_key in self.message.rows.row_keys
if row_key > self.last_scanned_key
] | python | def _filter_rows_keys(self):
""" Helper for :meth:`build_updated_request`"""
return [
row_key
for row_key in self.message.rows.row_keys
if row_key > self.last_scanned_key
] | [
"def",
"_filter_rows_keys",
"(",
"self",
")",
":",
"return",
"[",
"row_key",
"for",
"row_key",
"in",
"self",
".",
"message",
".",
"rows",
".",
"row_keys",
"if",
"row_key",
">",
"self",
".",
"last_scanned_key",
"]"
] | Helper for :meth:`build_updated_request` | [
"Helper",
"for",
":",
"meth",
":",
"build_updated_request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L631-L637 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row_data.py | _ReadRowsRequestManager._filter_row_ranges | def _filter_row_ranges(self):
""" Helper for :meth:`build_updated_request`"""
new_row_ranges = []
for row_range in self.message.rows.row_ranges:
# if current end_key (open or closed) is set, return its value,
# if not, set to empty string ('').
# NOTE: Empty ... | python | def _filter_row_ranges(self):
""" Helper for :meth:`build_updated_request`"""
new_row_ranges = []
for row_range in self.message.rows.row_ranges:
# if current end_key (open or closed) is set, return its value,
# if not, set to empty string ('').
# NOTE: Empty ... | [
"def",
"_filter_row_ranges",
"(",
"self",
")",
":",
"new_row_ranges",
"=",
"[",
"]",
"for",
"row_range",
"in",
"self",
".",
"message",
".",
"rows",
".",
"row_ranges",
":",
"# if current end_key (open or closed) is set, return its value,",
"# if not, set to empty string ('... | Helper for :meth:`build_updated_request` | [
"Helper",
"for",
":",
"meth",
":",
"build_updated_request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L639-L668 | train |
googleapis/google-cloud-python | trace/google/cloud/trace_v1/gapic/trace_service_client.py | TraceServiceClient.patch_traces | def patch_traces(
self,
project_id,
traces,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Sends new traces to Stackdriver Trace or updates existing traces. If the ID
of a t... | python | def patch_traces(
self,
project_id,
traces,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Sends new traces to Stackdriver Trace or updates existing traces. If the ID
of a t... | [
"def",
"patch_traces",
"(",
"self",
",",
"project_id",
",",
"traces",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFA... | Sends new traces to Stackdriver Trace or updates existing traces. If the ID
of a trace that you send matches that of an existing trace, any fields
in the existing trace and its spans are overwritten by the provided values,
and any new fields provided are merged with the existing trace data. If t... | [
"Sends",
"new",
"traces",
"to",
"Stackdriver",
"Trace",
"or",
"updates",
"existing",
"traces",
".",
"If",
"the",
"ID",
"of",
"a",
"trace",
"that",
"you",
"send",
"matches",
"that",
"of",
"an",
"existing",
"trace",
"any",
"fields",
"in",
"the",
"existing",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace_v1/gapic/trace_service_client.py#L177-L254 | train |
googleapis/google-cloud-python | trace/google/cloud/trace_v1/gapic/trace_service_client.py | TraceServiceClient.get_trace | def get_trace(
self,
project_id,
trace_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets a single trace by its ID.
Example:
>>> from google.cloud import t... | python | def get_trace(
self,
project_id,
trace_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets a single trace by its ID.
Example:
>>> from google.cloud import t... | [
"def",
"get_trace",
"(",
"self",
",",
"project_id",
",",
"trace_id",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAU... | Gets a single trace by its ID.
Example:
>>> from google.cloud import trace_v1
>>>
>>> client = trace_v1.TraceServiceClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
>>>
>>> # TODO: Initialize `t... | [
"Gets",
"a",
"single",
"trace",
"by",
"its",
"ID",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace_v1/gapic/trace_service_client.py#L256-L316 | train |
googleapis/google-cloud-python | trace/google/cloud/trace_v1/gapic/trace_service_client.py | TraceServiceClient.list_traces | def list_traces(
self,
project_id,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None... | python | def list_traces(
self,
project_id,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None... | [
"def",
"list_traces",
"(",
"self",
",",
"project_id",
",",
"view",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
"retry",
"=",
... | Returns of a list of traces that match the specified filter conditions.
Example:
>>> from google.cloud import trace_v1
>>>
>>> client = trace_v1.TraceServiceClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
... | [
"Returns",
"of",
"a",
"list",
"of",
"traces",
"that",
"match",
"the",
"specified",
"filter",
"conditions",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace_v1/gapic/trace_service_client.py#L318-L486 | train |
googleapis/google-cloud-python | redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py | CloudRedisClient.get_instance | def get_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the details of a specific Redis instance.
Example:
>>> from google.cloud import redis_... | python | def get_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the details of a specific Redis instance.
Example:
>>> from google.cloud import redis_... | [
"def",
"get_instance",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadata"... | Gets the details of a specific Redis instance.
Example:
>>> from google.cloud import redis_v1beta1
>>>
>>> client = redis_v1beta1.CloudRedisClient()
>>>
>>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]')
>>>
... | [
"Gets",
"the",
"details",
"of",
"a",
"specific",
"Redis",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py#L310-L366 | train |
googleapis/google-cloud-python | redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py | CloudRedisClient.update_instance | def update_instance(
self,
update_mask,
instance,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the metadata and configuration of a specific Redis instance.
Comple... | python | def update_instance(
self,
update_mask,
instance,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the metadata and configuration of a specific Redis instance.
Comple... | [
"def",
"update_instance",
"(",
"self",
",",
"update_mask",
",",
"instance",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
... | Updates the metadata and configuration of a specific Redis instance.
Completed longrunning.Operation will contain the new instance object
in the response field. The returned operation is automatically deleted
after a few hours, so there is no need to call DeleteOperation.
Example:
... | [
"Updates",
"the",
"metadata",
"and",
"configuration",
"of",
"a",
"specific",
"Redis",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py#L474-L567 | train |
googleapis/google-cloud-python | redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py | CloudRedisClient.delete_instance | def delete_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a specific Redis instance. Instance stops serving and data is
deleted.
Example:
... | python | def delete_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a specific Redis instance. Instance stops serving and data is
deleted.
Example:
... | [
"def",
"delete_instance",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metada... | Deletes a specific Redis instance. Instance stops serving and data is
deleted.
Example:
>>> from google.cloud import redis_v1beta1
>>>
>>> client = redis_v1beta1.CloudRedisClient()
>>>
>>> name = client.instance_path('[PROJECT]', '[LOCATION]'... | [
"Deletes",
"a",
"specific",
"Redis",
"instance",
".",
"Instance",
"stops",
"serving",
"and",
"data",
"is",
"deleted",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py#L569-L641 | train |
googleapis/google-cloud-python | speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py | SpeechClient.recognize | def recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs synchronous speech recognition: receive results after all audio
has been sent and... | python | def recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs synchronous speech recognition: receive results after all audio
has been sent and... | [
"def",
"recognize",
"(",
"self",
",",
"config",
",",
"audio",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
... | Performs synchronous speech recognition: receive results after all audio
has been sent and processed.
Example:
>>> from google.cloud import speech_v1p1beta1
>>> from google.cloud.speech_v1p1beta1 import enums
>>>
>>> client = speech_v1p1beta1.SpeechClient... | [
"Performs",
"synchronous",
"speech",
"recognition",
":",
"receive",
"results",
"after",
"all",
"audio",
"has",
"been",
"sent",
"and",
"processed",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py#L170-L240 | train |
googleapis/google-cloud-python | speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py | SpeechClient.long_running_recognize | def long_running_recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs asynchronous speech recognition: receive results via the
google.long... | python | def long_running_recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs asynchronous speech recognition: receive results via the
google.long... | [
"def",
"long_running_recognize",
"(",
"self",
",",
"config",
",",
"audio",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
... | Performs asynchronous speech recognition: receive results via the
google.longrunning.Operations interface. Returns either an
``Operation.error`` or an ``Operation.response`` which contains a
``LongRunningRecognizeResponse`` message.
Example:
>>> from google.cloud import spee... | [
"Performs",
"asynchronous",
"speech",
"recognition",
":",
"receive",
"results",
"via",
"the",
"google",
".",
"longrunning",
".",
"Operations",
"interface",
".",
"Returns",
"either",
"an",
"Operation",
".",
"error",
"or",
"an",
"Operation",
".",
"response",
"whic... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py#L242-L331 | train |
googleapis/google-cloud-python | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | WorkflowTemplateServiceClient.region_path | def region_path(cls, project, region):
"""Return a fully-qualified region string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}", project=project, region=region
) | python | def region_path(cls, project, region):
"""Return a fully-qualified region string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}", project=project, region=region
) | [
"def",
"region_path",
"(",
"cls",
",",
"project",
",",
"region",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/regions/{region}\"",
",",
"project",
"=",
"project",
",",
"region",
"=",
"region",
"... | Return a fully-qualified region string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"region",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L87-L91 | train |
googleapis/google-cloud-python | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | WorkflowTemplateServiceClient.workflow_template_path | def workflow_template_path(cls, project, region, workflow_template):
"""Return a fully-qualified workflow_template string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}/workflowTemplates/{workflow_template}",
project=project,
reg... | python | def workflow_template_path(cls, project, region, workflow_template):
"""Return a fully-qualified workflow_template string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}/workflowTemplates/{workflow_template}",
project=project,
reg... | [
"def",
"workflow_template_path",
"(",
"cls",
",",
"project",
",",
"region",
",",
"workflow_template",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/regions/{region}/workflowTemplates/{workflow_template}\"",
... | Return a fully-qualified workflow_template string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"workflow_template",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L94-L101 | train |
googleapis/google-cloud-python | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | WorkflowTemplateServiceClient.create_workflow_template | def create_workflow_template(
self,
parent,
template,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates new workflow template.
Example:
>>> from google.clo... | python | def create_workflow_template(
self,
parent,
template,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates new workflow template.
Example:
>>> from google.clo... | [
"def",
"create_workflow_template",
"(",
"self",
",",
"parent",
",",
"template",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".... | Creates new workflow template.
Example:
>>> from google.cloud import dataproc_v1beta2
>>>
>>> client = dataproc_v1beta2.WorkflowTemplateServiceClient()
>>>
>>> parent = client.region_path('[PROJECT]', '[REGION]')
>>>
>>> # TODO... | [
"Creates",
"new",
"workflow",
"template",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L202-L268 | train |
googleapis/google-cloud-python | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | WorkflowTemplateServiceClient.get_workflow_template | def get_workflow_template(
self,
name,
version=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the latest workflow template.
Can retrieve previously instanti... | python | def get_workflow_template(
self,
name,
version=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the latest workflow template.
Can retrieve previously instanti... | [
"def",
"get_workflow_template",
"(",
"self",
",",
"name",
",",
"version",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | Retrieves the latest workflow template.
Can retrieve previously instantiated template by specifying optional
version parameter.
Example:
>>> from google.cloud import dataproc_v1beta2
>>>
>>> client = dataproc_v1beta2.WorkflowTemplateServiceClient()
... | [
"Retrieves",
"the",
"latest",
"workflow",
"template",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L270-L336 | train |
googleapis/google-cloud-python | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | WorkflowTemplateServiceClient.instantiate_workflow_template | def instantiate_workflow_template(
self,
name,
version=None,
instance_id=None,
request_id=None,
parameters=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
... | python | def instantiate_workflow_template(
self,
name,
version=None,
instance_id=None,
request_id=None,
parameters=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
... | [
"def",
"instantiate_workflow_template",
"(",
"self",
",",
"name",
",",
"version",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"request_id",
"=",
"None",
",",
"parameters",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
"... | Instantiates a template and begins execution.
The returned Operation can be used to track execution of workflow by
polling ``operations.get``. The Operation will complete when entire
workflow is finished.
The running workflow can be aborted via ``operations.cancel``. This will
... | [
"Instantiates",
"a",
"template",
"and",
"begins",
"execution",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L338-L451 | train |
googleapis/google-cloud-python | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | WorkflowTemplateServiceClient.instantiate_inline_workflow_template | def instantiate_inline_workflow_template(
self,
parent,
template,
instance_id=None,
request_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Instantiates a te... | python | def instantiate_inline_workflow_template(
self,
parent,
template,
instance_id=None,
request_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Instantiates a te... | [
"def",
"instantiate_inline_workflow_template",
"(",
"self",
",",
"parent",
",",
"template",
",",
"instance_id",
"=",
"None",
",",
"request_id",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"t... | Instantiates a template and begins execution.
This method is equivalent to executing the sequence
``CreateWorkflowTemplate``, ``InstantiateWorkflowTemplate``,
``DeleteWorkflowTemplate``.
The returned Operation can be used to track execution of workflow by
polling ``operations.g... | [
"Instantiates",
"a",
"template",
"and",
"begins",
"execution",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L453-L569 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/schema.py | _parse_schema_resource | def _parse_schema_resource(info):
"""Parse a resource fragment into a schema field.
Args:
info: (Mapping[str->dict]): should contain a "fields" key to be parsed
Returns:
(Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None])
a list of parsed fields, or ``None... | python | def _parse_schema_resource(info):
"""Parse a resource fragment into a schema field.
Args:
info: (Mapping[str->dict]): should contain a "fields" key to be parsed
Returns:
(Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None])
a list of parsed fields, or ``None... | [
"def",
"_parse_schema_resource",
"(",
"info",
")",
":",
"if",
"\"fields\"",
"not",
"in",
"info",
":",
"return",
"(",
")",
"schema",
"=",
"[",
"]",
"for",
"r_field",
"in",
"info",
"[",
"\"fields\"",
"]",
":",
"name",
"=",
"r_field",
"[",
"\"name\"",
"]"... | Parse a resource fragment into a schema field.
Args:
info: (Mapping[str->dict]): should contain a "fields" key to be parsed
Returns:
(Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None])
a list of parsed fields, or ``None`` if no "fields" key found. | [
"Parse",
"a",
"resource",
"fragment",
"into",
"a",
"schema",
"field",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L164-L185 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/schema.py | SchemaField.from_api_repr | def from_api_repr(cls, api_repr):
"""Return a ``SchemaField`` object deserialized from a dictionary.
Args:
api_repr (Mapping[str, str]): The serialized representation
of the SchemaField, such as what is output by
:meth:`to_api_repr`.
Returns:
... | python | def from_api_repr(cls, api_repr):
"""Return a ``SchemaField`` object deserialized from a dictionary.
Args:
api_repr (Mapping[str, str]): The serialized representation
of the SchemaField, such as what is output by
:meth:`to_api_repr`.
Returns:
... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"api_repr",
")",
":",
"# Handle optional properties with default values",
"mode",
"=",
"api_repr",
".",
"get",
"(",
"\"mode\"",
",",
"\"NULLABLE\"",
")",
"description",
"=",
"api_repr",
".",
"get",
"(",
"\"description\"",
"... | Return a ``SchemaField`` object deserialized from a dictionary.
Args:
api_repr (Mapping[str, str]): The serialized representation
of the SchemaField, such as what is output by
:meth:`to_api_repr`.
Returns:
google.cloud.biquery.schema.SchemaField:... | [
"Return",
"a",
"SchemaField",
"object",
"deserialized",
"from",
"a",
"dictionary",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L44-L66 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/schema.py | SchemaField.to_api_repr | def to_api_repr(self):
"""Return a dictionary representing this schema field.
Returns:
dict: A dictionary representing the SchemaField in a serialized
form.
"""
# Put together the basic representation. See http://bit.ly/2hOAT5u.
answer = {
... | python | def to_api_repr(self):
"""Return a dictionary representing this schema field.
Returns:
dict: A dictionary representing the SchemaField in a serialized
form.
"""
# Put together the basic representation. See http://bit.ly/2hOAT5u.
answer = {
... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"# Put together the basic representation. See http://bit.ly/2hOAT5u.",
"answer",
"=",
"{",
"\"mode\"",
":",
"self",
".",
"mode",
".",
"upper",
"(",
")",
",",
"\"name\"",
":",
"self",
".",
"name",
",",
"\"type\"",
":",... | Return a dictionary representing this schema field.
Returns:
dict: A dictionary representing the SchemaField in a serialized
form. | [
"Return",
"a",
"dictionary",
"representing",
"this",
"schema",
"field",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L109-L130 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/schema.py | SchemaField._key | def _key(self):
"""A tuple key that uniquely describes this field.
Used to compute this instance's hashcode and evaluate equality.
Returns:
tuple: The contents of this
:class:`~google.cloud.bigquery.schema.SchemaField`.
"""
return (
se... | python | def _key(self):
"""A tuple key that uniquely describes this field.
Used to compute this instance's hashcode and evaluate equality.
Returns:
tuple: The contents of this
:class:`~google.cloud.bigquery.schema.SchemaField`.
"""
return (
se... | [
"def",
"_key",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_name",
",",
"self",
".",
"_field_type",
".",
"upper",
"(",
")",
",",
"self",
".",
"_mode",
".",
"upper",
"(",
")",
",",
"self",
".",
"_description",
",",
"self",
".",
"_fields",
... | A tuple key that uniquely describes this field.
Used to compute this instance's hashcode and evaluate equality.
Returns:
tuple: The contents of this
:class:`~google.cloud.bigquery.schema.SchemaField`. | [
"A",
"tuple",
"key",
"that",
"uniquely",
"describes",
"this",
"field",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L132-L147 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | parse_options | def parse_options():
"""Parses options."""
parser = argparse.ArgumentParser()
parser.add_argument('command', help='The YCSB command.')
parser.add_argument('benchmark', help='The YCSB benchmark.')
parser.add_argument('-P', '--workload', action='store', dest='workload',
default... | python | def parse_options():
"""Parses options."""
parser = argparse.ArgumentParser()
parser.add_argument('command', help='The YCSB command.')
parser.add_argument('benchmark', help='The YCSB benchmark.')
parser.add_argument('-P', '--workload', action='store', dest='workload',
default... | [
"def",
"parse_options",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'command'",
",",
"help",
"=",
"'The YCSB command.'",
")",
"parser",
".",
"add_argument",
"(",
"'benchmark'",
",",
"help",
... | Parses options. | [
"Parses",
"options",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L51-L81 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | open_database | def open_database(parameters):
"""Opens a database specified by the parameters from parse_options()."""
spanner_client = spanner.Client()
instance_id = parameters['cloudspanner.instance']
instance = spanner_client.instance(instance_id)
database_id = parameters['cloudspanner.database']
pool = spa... | python | def open_database(parameters):
"""Opens a database specified by the parameters from parse_options()."""
spanner_client = spanner.Client()
instance_id = parameters['cloudspanner.instance']
instance = spanner_client.instance(instance_id)
database_id = parameters['cloudspanner.database']
pool = spa... | [
"def",
"open_database",
"(",
"parameters",
")",
":",
"spanner_client",
"=",
"spanner",
".",
"Client",
"(",
")",
"instance_id",
"=",
"parameters",
"[",
"'cloudspanner.instance'",
"]",
"instance",
"=",
"spanner_client",
".",
"instance",
"(",
"instance_id",
")",
"d... | Opens a database specified by the parameters from parse_options(). | [
"Opens",
"a",
"database",
"specified",
"by",
"the",
"parameters",
"from",
"parse_options",
"()",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L84-L93 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | load_keys | def load_keys(database, parameters):
"""Loads keys from database."""
keys = []
with database.snapshot() as snapshot:
results = snapshot.execute_sql(
'SELECT u.id FROM %s u' % parameters['table'])
for row in results:
keys.append(row[0])
return keys | python | def load_keys(database, parameters):
"""Loads keys from database."""
keys = []
with database.snapshot() as snapshot:
results = snapshot.execute_sql(
'SELECT u.id FROM %s u' % parameters['table'])
for row in results:
keys.append(row[0])
return keys | [
"def",
"load_keys",
"(",
"database",
",",
"parameters",
")",
":",
"keys",
"=",
"[",
"]",
"with",
"database",
".",
"snapshot",
"(",
")",
"as",
"snapshot",
":",
"results",
"=",
"snapshot",
".",
"execute_sql",
"(",
"'SELECT u.id FROM %s u'",
"%",
"parameters",
... | Loads keys from database. | [
"Loads",
"keys",
"from",
"database",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L96-L106 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | read | def read(database, table, key):
"""Does a single read operation."""
with database.snapshot() as snapshot:
result = snapshot.execute_sql('SELECT u.* FROM %s u WHERE u.id="%s"' %
(table, key))
for row in result:
key = row[0]
for i in range(... | python | def read(database, table, key):
"""Does a single read operation."""
with database.snapshot() as snapshot:
result = snapshot.execute_sql('SELECT u.* FROM %s u WHERE u.id="%s"' %
(table, key))
for row in result:
key = row[0]
for i in range(... | [
"def",
"read",
"(",
"database",
",",
"table",
",",
"key",
")",
":",
"with",
"database",
".",
"snapshot",
"(",
")",
"as",
"snapshot",
":",
"result",
"=",
"snapshot",
".",
"execute_sql",
"(",
"'SELECT u.* FROM %s u WHERE u.id=\"%s\"'",
"%",
"(",
"table",
",",
... | Does a single read operation. | [
"Does",
"a",
"single",
"read",
"operation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L109-L117 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | update | def update(database, table, key):
"""Does a single update operation."""
field = random.randrange(10)
value = ''.join(random.choice(string.printable) for i in range(100))
with database.batch() as batch:
batch.update(table=table, columns=('id', 'field%d' % field),
values=[(key... | python | def update(database, table, key):
"""Does a single update operation."""
field = random.randrange(10)
value = ''.join(random.choice(string.printable) for i in range(100))
with database.batch() as batch:
batch.update(table=table, columns=('id', 'field%d' % field),
values=[(key... | [
"def",
"update",
"(",
"database",
",",
"table",
",",
"key",
")",
":",
"field",
"=",
"random",
".",
"randrange",
"(",
"10",
")",
"value",
"=",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"string",
".",
"printable",
")",
"for",
"i",
"in",
... | Does a single update operation. | [
"Does",
"a",
"single",
"update",
"operation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L120-L126 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | do_operation | def do_operation(database, keys, table, operation, latencies_ms):
"""Does a single operation and records latency."""
key = random.choice(keys)
start = timeit.default_timer()
if operation == 'read':
read(database, table, key)
elif operation == 'update':
update(database, table, key)
... | python | def do_operation(database, keys, table, operation, latencies_ms):
"""Does a single operation and records latency."""
key = random.choice(keys)
start = timeit.default_timer()
if operation == 'read':
read(database, table, key)
elif operation == 'update':
update(database, table, key)
... | [
"def",
"do_operation",
"(",
"database",
",",
"keys",
",",
"table",
",",
"operation",
",",
"latencies_ms",
")",
":",
"key",
"=",
"random",
".",
"choice",
"(",
"keys",
")",
"start",
"=",
"timeit",
".",
"default_timer",
"(",
")",
"if",
"operation",
"==",
... | Does a single operation and records latency. | [
"Does",
"a",
"single",
"operation",
"and",
"records",
"latency",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L129-L140 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | aggregate_metrics | def aggregate_metrics(latencies_ms, duration_ms, num_bucket):
"""Aggregates metrics."""
overall_op_count = 0
op_counts = {operation : len(latency) for operation,
latency in latencies_ms.iteritems()}
overall_op_count = sum([op_count for op_count in op_counts.itervalues()])
print('[O... | python | def aggregate_metrics(latencies_ms, duration_ms, num_bucket):
"""Aggregates metrics."""
overall_op_count = 0
op_counts = {operation : len(latency) for operation,
latency in latencies_ms.iteritems()}
overall_op_count = sum([op_count for op_count in op_counts.itervalues()])
print('[O... | [
"def",
"aggregate_metrics",
"(",
"latencies_ms",
",",
"duration_ms",
",",
"num_bucket",
")",
":",
"overall_op_count",
"=",
"0",
"op_counts",
"=",
"{",
"operation",
":",
"len",
"(",
"latency",
")",
"for",
"operation",
",",
"latency",
"in",
"latencies_ms",
".",
... | Aggregates metrics. | [
"Aggregates",
"metrics",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L143-L181 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | run_workload | def run_workload(database, keys, parameters):
"""Runs workload against the database."""
total_weight = 0.0
weights = []
operations = []
latencies_ms = {}
for operation in OPERATIONS:
weight = float(parameters[operation])
if weight <= 0.0:
continue
total_weight... | python | def run_workload(database, keys, parameters):
"""Runs workload against the database."""
total_weight = 0.0
weights = []
operations = []
latencies_ms = {}
for operation in OPERATIONS:
weight = float(parameters[operation])
if weight <= 0.0:
continue
total_weight... | [
"def",
"run_workload",
"(",
"database",
",",
"keys",
",",
"parameters",
")",
":",
"total_weight",
"=",
"0.0",
"weights",
"=",
"[",
"]",
"operations",
"=",
"[",
"]",
"latencies_ms",
"=",
"{",
"}",
"for",
"operation",
"in",
"OPERATIONS",
":",
"weight",
"="... | Runs workload against the database. | [
"Runs",
"workload",
"against",
"the",
"database",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L219-L253 | train |
googleapis/google-cloud-python | spanner/benchmark/ycsb.py | WorkloadThread.run | def run(self):
"""Run a single thread of the workload."""
i = 0
operation_count = int(self._parameters['operationcount'])
while i < operation_count:
i += 1
weight = random.uniform(0, self._total_weight)
for j in range(len(self._weights)):
... | python | def run(self):
"""Run a single thread of the workload."""
i = 0
operation_count = int(self._parameters['operationcount'])
while i < operation_count:
i += 1
weight = random.uniform(0, self._total_weight)
for j in range(len(self._weights)):
... | [
"def",
"run",
"(",
"self",
")",
":",
"i",
"=",
"0",
"operation_count",
"=",
"int",
"(",
"self",
".",
"_parameters",
"[",
"'operationcount'",
"]",
")",
"while",
"i",
"<",
"operation_count",
":",
"i",
"+=",
"1",
"weight",
"=",
"random",
".",
"uniform",
... | Run a single thread of the workload. | [
"Run",
"a",
"single",
"thread",
"of",
"the",
"workload",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L200-L212 | train |
googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/_gapic.py | add_methods | def add_methods(source_class, blacklist=()):
"""Add wrapped versions of the `api` member's methods to the class.
Any methods passed in `blacklist` are not added.
Additionally, any methods explicitly defined on the wrapped class are
not added.
"""
def wrap(wrapped_fx):
"""Wrap a GAPIC m... | python | def add_methods(source_class, blacklist=()):
"""Add wrapped versions of the `api` member's methods to the class.
Any methods passed in `blacklist` are not added.
Additionally, any methods explicitly defined on the wrapped class are
not added.
"""
def wrap(wrapped_fx):
"""Wrap a GAPIC m... | [
"def",
"add_methods",
"(",
"source_class",
",",
"blacklist",
"=",
"(",
")",
")",
":",
"def",
"wrap",
"(",
"wrapped_fx",
")",
":",
"\"\"\"Wrap a GAPIC method; preserve its name and docstring.\"\"\"",
"# If this is a static or class method, then we need to *not*",
"# send self as... | Add wrapped versions of the `api` member's methods to the class.
Any methods passed in `blacklist` are not added.
Additionally, any methods explicitly defined on the wrapped class are
not added. | [
"Add",
"wrapped",
"versions",
"of",
"the",
"api",
"member",
"s",
"methods",
"to",
"the",
"class",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/_gapic.py#L20-L77 | train |
googleapis/google-cloud-python | vision/google/cloud/vision_v1/gapic/product_search_client.py | ProductSearchClient.create_product | def create_product(
self,
parent,
product,
product_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new product resource.
Possible erro... | python | def create_product(
self,
parent,
product,
product_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new product resource.
Possible erro... | [
"def",
"create_product",
"(",
"self",
",",
"parent",
",",
"product",
",",
"product_id",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic... | Creates and returns a new product resource.
Possible errors:
- Returns INVALID\_ARGUMENT if display\_name is missing or longer than
4096 characters.
- Returns INVALID\_ARGUMENT if description is longer than 4096
characters.
- Returns INVALID\_ARGUMENT if produc... | [
"Creates",
"and",
"returns",
"a",
"new",
"product",
"resource",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1/gapic/product_search_client.py#L230-L322 | train |
googleapis/google-cloud-python | vision/google/cloud/vision_v1/gapic/product_search_client.py | ProductSearchClient.update_product | def update_product(
self,
product,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Makes changes to a Product resource. Only the ``display_name``,
``descrip... | python | def update_product(
self,
product,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Makes changes to a Product resource. Only the ``display_name``,
``descrip... | [
"def",
"update_product",
"(",
"self",
",",
"product",
",",
"update_mask",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | Makes changes to a Product resource. Only the ``display_name``,
``description``, and ``labels`` fields can be updated right now.
If labels are updated, the change will not be reflected in queries until
the next index time.
Possible errors:
- Returns NOT\_FOUND if the Product ... | [
"Makes",
"changes",
"to",
"a",
"Product",
"resource",
".",
"Only",
"the",
"display_name",
"description",
"and",
"labels",
"fields",
"can",
"be",
"updated",
"right",
"now",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1/gapic/product_search_client.py#L509-L604 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | _assign_entity_to_pb | def _assign_entity_to_pb(entity_pb, entity):
"""Copy ``entity`` into ``entity_pb``.
Helper method for ``Batch.put``.
:type entity_pb: :class:`.entity_pb2.Entity`
:param entity_pb: The entity owned by a mutation.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The en... | python | def _assign_entity_to_pb(entity_pb, entity):
"""Copy ``entity`` into ``entity_pb``.
Helper method for ``Batch.put``.
:type entity_pb: :class:`.entity_pb2.Entity`
:param entity_pb: The entity owned by a mutation.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The en... | [
"def",
"_assign_entity_to_pb",
"(",
"entity_pb",
",",
"entity",
")",
":",
"bare_entity_pb",
"=",
"helpers",
".",
"entity_to_protobuf",
"(",
"entity",
")",
"bare_entity_pb",
".",
"key",
".",
"CopyFrom",
"(",
"bare_entity_pb",
".",
"key",
")",
"entity_pb",
".",
... | Copy ``entity`` into ``entity_pb``.
Helper method for ``Batch.put``.
:type entity_pb: :class:`.entity_pb2.Entity`
:param entity_pb: The entity owned by a mutation.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity being updated within the batch / transaction. | [
"Copy",
"entity",
"into",
"entity_pb",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L309-L322 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | _parse_commit_response | def _parse_commit_response(commit_response_pb):
"""Extract response data from a commit response.
:type commit_response_pb: :class:`.datastore_pb2.CommitResponse`
:param commit_response_pb: The protobuf response from a commit request.
:rtype: tuple
:returns: The pair of the number of index updates ... | python | def _parse_commit_response(commit_response_pb):
"""Extract response data from a commit response.
:type commit_response_pb: :class:`.datastore_pb2.CommitResponse`
:param commit_response_pb: The protobuf response from a commit request.
:rtype: tuple
:returns: The pair of the number of index updates ... | [
"def",
"_parse_commit_response",
"(",
"commit_response_pb",
")",
":",
"mut_results",
"=",
"commit_response_pb",
".",
"mutation_results",
"index_updates",
"=",
"commit_response_pb",
".",
"index_updates",
"completed_keys",
"=",
"[",
"mut_result",
".",
"key",
"for",
"mut_r... | Extract response data from a commit response.
:type commit_response_pb: :class:`.datastore_pb2.CommitResponse`
:param commit_response_pb: The protobuf response from a commit request.
:rtype: tuple
:returns: The pair of the number of index updates and a list of
:class:`.entity_pb2.Key` fo... | [
"Extract",
"response",
"data",
"from",
"a",
"commit",
"response",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L325-L341 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch._add_partial_key_entity_pb | def _add_partial_key_entity_pb(self):
"""Adds a new mutation for an entity with a partial key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
new_mutation = _datastore_pb2.Mutatio... | python | def _add_partial_key_entity_pb(self):
"""Adds a new mutation for an entity with a partial key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
new_mutation = _datastore_pb2.Mutatio... | [
"def",
"_add_partial_key_entity_pb",
"(",
"self",
")",
":",
"new_mutation",
"=",
"_datastore_pb2",
".",
"Mutation",
"(",
")",
"self",
".",
"_mutations",
".",
"append",
"(",
"new_mutation",
")",
"return",
"new_mutation",
".",
"insert"
] | Adds a new mutation for an entity with a partial key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit. | [
"Adds",
"a",
"new",
"mutation",
"for",
"an",
"entity",
"with",
"a",
"partial",
"key",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L107-L116 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch._add_complete_key_entity_pb | def _add_complete_key_entity_pb(self):
"""Adds a new mutation for an entity with a completed key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
# We use ``upsert`` for entities w... | python | def _add_complete_key_entity_pb(self):
"""Adds a new mutation for an entity with a completed key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
# We use ``upsert`` for entities w... | [
"def",
"_add_complete_key_entity_pb",
"(",
"self",
")",
":",
"# We use ``upsert`` for entities with completed keys, rather than",
"# ``insert`` or ``update``, in order not to create race conditions",
"# based on prior existence / removal of the entity.",
"new_mutation",
"=",
"_datastore_pb2",
... | Adds a new mutation for an entity with a completed key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit. | [
"Adds",
"a",
"new",
"mutation",
"for",
"an",
"entity",
"with",
"a",
"completed",
"key",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L118-L130 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch._add_delete_key_pb | def _add_delete_key_pb(self):
"""Adds a new mutation for a key to be deleted.
:rtype: :class:`.entity_pb2.Key`
:returns: The newly created key protobuf that will be
deleted when sent with a commit.
"""
new_mutation = _datastore_pb2.Mutation()
self._muta... | python | def _add_delete_key_pb(self):
"""Adds a new mutation for a key to be deleted.
:rtype: :class:`.entity_pb2.Key`
:returns: The newly created key protobuf that will be
deleted when sent with a commit.
"""
new_mutation = _datastore_pb2.Mutation()
self._muta... | [
"def",
"_add_delete_key_pb",
"(",
"self",
")",
":",
"new_mutation",
"=",
"_datastore_pb2",
".",
"Mutation",
"(",
")",
"self",
".",
"_mutations",
".",
"append",
"(",
"new_mutation",
")",
"return",
"new_mutation",
".",
"delete"
] | Adds a new mutation for a key to be deleted.
:rtype: :class:`.entity_pb2.Key`
:returns: The newly created key protobuf that will be
deleted when sent with a commit. | [
"Adds",
"a",
"new",
"mutation",
"for",
"a",
"key",
"to",
"be",
"deleted",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L132-L141 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch.put | def put(self, entity):
"""Remember an entity's state to be saved during :meth:`commit`.
.. note::
Any existing properties for the entity will be replaced by those
currently set on this instance. Already-stored properties which do
not correspond to keys set on this inst... | python | def put(self, entity):
"""Remember an entity's state to be saved during :meth:`commit`.
.. note::
Any existing properties for the entity will be replaced by those
currently set on this instance. Already-stored properties which do
not correspond to keys set on this inst... | [
"def",
"put",
"(",
"self",
",",
"entity",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to put()\"",
")",
"if",
"entity",
".",
"key",
"is",
"None",
":",
"raise",
"Va... | Remember an entity's state to be saved during :meth:`commit`.
.. note::
Any existing properties for the entity will be replaced by those
currently set on this instance. Already-stored properties which do
not correspond to keys set on this instance will be removed from
... | [
"Remember",
"an",
"entity",
"s",
"state",
"to",
"be",
"saved",
"during",
":",
"meth",
":",
"commit",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L159-L200 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch.delete | def delete(self, key):
"""Remember a key to be deleted during :meth:`commit`.
:type key: :class:`google.cloud.datastore.key.Key`
:param key: the key to be deleted.
:raises: :class:`~exceptions.ValueError` if the batch is not in
progress, if key is not complete, or if t... | python | def delete(self, key):
"""Remember a key to be deleted during :meth:`commit`.
:type key: :class:`google.cloud.datastore.key.Key`
:param key: the key to be deleted.
:raises: :class:`~exceptions.ValueError` if the batch is not in
progress, if key is not complete, or if t... | [
"def",
"delete",
"(",
"self",
",",
"key",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to delete()\"",
")",
"if",
"key",
".",
"is_partial",
":",
"raise",
"ValueError",
... | Remember a key to be deleted during :meth:`commit`.
:type key: :class:`google.cloud.datastore.key.Key`
:param key: the key to be deleted.
:raises: :class:`~exceptions.ValueError` if the batch is not in
progress, if key is not complete, or if the key's
``projec... | [
"Remember",
"a",
"key",
"to",
"be",
"deleted",
"during",
":",
"meth",
":",
"commit",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L202-L222 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch.begin | def begin(self):
"""Begins a batch.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :clas... | python | def begin(self):
"""Begins a batch.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :clas... | [
"def",
"begin",
"(",
"self",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_INITIAL",
":",
"raise",
"ValueError",
"(",
"\"Batch already started previously.\"",
")",
"self",
".",
"_status",
"=",
"self",
".",
"_IN_PROGRESS"
] | Begins a batch.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`ValueError` if the batch ... | [
"Begins",
"a",
"batch",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L224-L237 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch._commit | def _commit(self):
"""Commits the batch.
This is called by :meth:`commit`.
"""
if self._id is None:
mode = _datastore_pb2.CommitRequest.NON_TRANSACTIONAL
else:
mode = _datastore_pb2.CommitRequest.TRANSACTIONAL
commit_response_pb = self._client._d... | python | def _commit(self):
"""Commits the batch.
This is called by :meth:`commit`.
"""
if self._id is None:
mode = _datastore_pb2.CommitRequest.NON_TRANSACTIONAL
else:
mode = _datastore_pb2.CommitRequest.TRANSACTIONAL
commit_response_pb = self._client._d... | [
"def",
"_commit",
"(",
"self",
")",
":",
"if",
"self",
".",
"_id",
"is",
"None",
":",
"mode",
"=",
"_datastore_pb2",
".",
"CommitRequest",
".",
"NON_TRANSACTIONAL",
"else",
":",
"mode",
"=",
"_datastore_pb2",
".",
"CommitRequest",
".",
"TRANSACTIONAL",
"comm... | Commits the batch.
This is called by :meth:`commit`. | [
"Commits",
"the",
"batch",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L239-L258 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch.commit | def commit(self):
"""Commits the batch.
This is called automatically upon exiting a with statement,
however it can be called explicitly if you don't want to use a
context manager.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
... | python | def commit(self):
"""Commits the batch.
This is called automatically upon exiting a with statement,
however it can be called explicitly if you don't want to use a
context manager.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
... | [
"def",
"commit",
"(",
"self",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to commit()\"",
")",
"try",
":",
"self",
".",
"_commit",
"(",
")",
"finally",
":",
"self",
... | Commits the batch.
This is called automatically upon exiting a with statement,
however it can be called explicitly if you don't want to use a
context manager.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress. | [
"Commits",
"the",
"batch",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L260-L276 | train |
googleapis/google-cloud-python | datastore/google/cloud/datastore/batch.py | Batch.rollback | def rollback(self):
"""Rolls back the current batch.
Marks the batch as aborted (can't be used again).
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
"""
... | python | def rollback(self):
"""Rolls back the current batch.
Marks the batch as aborted (can't be used again).
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
"""
... | [
"def",
"rollback",
"(",
"self",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to rollback()\"",
")",
"self",
".",
"_status",
"=",
"self",
".",
"_ABORTED"
] | Rolls back the current batch.
Marks the batch as aborted (can't be used again).
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress. | [
"Rolls",
"back",
"the",
"current",
"batch",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L278-L291 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | BigtableTableAdminClient.snapshot_path | def snapshot_path(cls, project, instance, cluster, snapshot):
"""Return a fully-qualified snapshot string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}",
project=project,
instance=inst... | python | def snapshot_path(cls, project, instance, cluster, snapshot):
"""Return a fully-qualified snapshot string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}",
project=project,
instance=inst... | [
"def",
"snapshot_path",
"(",
"cls",
",",
"project",
",",
"instance",
",",
"cluster",
",",
"snapshot",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapsh... | Return a fully-qualified snapshot string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"snapshot",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L112-L120 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | BigtableTableAdminClient.create_table | def create_table(
self,
parent,
table_id,
table,
initial_splits=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table in the specified instance.
... | python | def create_table(
self,
parent,
table_id,
table,
initial_splits=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table in the specified instance.
... | [
"def",
"create_table",
"(",
"self",
",",
"parent",
",",
"table_id",
",",
"table",
",",
"initial_splits",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_c... | Creates a new table in the specified instance.
The table can be created with a full set of initial column families,
specified in the request.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableTableAdminClient()... | [
"Creates",
"a",
"new",
"table",
"in",
"the",
"specified",
"instance",
".",
"The",
"table",
"can",
"be",
"created",
"with",
"a",
"full",
"set",
"of",
"initial",
"column",
"families",
"specified",
"in",
"the",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L231-L339 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | BigtableTableAdminClient.create_table_from_snapshot | def create_table_from_snapshot(
self,
parent,
table_id,
source_snapshot,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table from the specified snapshot. The ... | python | def create_table_from_snapshot(
self,
parent,
table_id,
source_snapshot,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table from the specified snapshot. The ... | [
"def",
"create_table_from_snapshot",
"(",
"self",
",",
"parent",
",",
"table_id",
",",
"source_snapshot",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapi... | Creates a new table from the specified snapshot. The target table must
not exist. The snapshot and the table must be in the same instance.
Note: This is a private alpha release of Cloud Bigtable snapshots. This
feature is not currently available to most Cloud Bigtable customers. This
fe... | [
"Creates",
"a",
"new",
"table",
"from",
"the",
"specified",
"snapshot",
".",
"The",
"target",
"table",
"must",
"not",
"exist",
".",
"The",
"snapshot",
"and",
"the",
"table",
"must",
"be",
"in",
"the",
"same",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L341-L447 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | BigtableTableAdminClient.drop_row_range | def drop_row_range(
self,
name,
row_key_prefix=None,
delete_all_data_from_table=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Permanently drop/delete a row range from... | python | def drop_row_range(
self,
name,
row_key_prefix=None,
delete_all_data_from_table=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Permanently drop/delete a row range from... | [
"def",
"drop_row_range",
"(",
"self",
",",
"name",
",",
"row_key_prefix",
"=",
"None",
",",
"delete_all_data_from_table",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google"... | Permanently drop/delete a row range from a specified table. The request can
specify whether to delete all rows in a table, or only those that match a
particular prefix.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2... | [
"Permanently",
"drop",
"/",
"delete",
"a",
"row",
"range",
"from",
"a",
"specified",
"table",
".",
"The",
"request",
"can",
"specify",
"whether",
"to",
"delete",
"all",
"rows",
"in",
"a",
"table",
"or",
"only",
"those",
"that",
"match",
"a",
"particular",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L780-L864 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | BigtableTableAdminClient.snapshot_table | def snapshot_table(
self,
name,
cluster,
snapshot_id,
description,
ttl=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new snapshot in the spe... | python | def snapshot_table(
self,
name,
cluster,
snapshot_id,
description,
ttl=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new snapshot in the spe... | [
"def",
"snapshot_table",
"(",
"self",
",",
"name",
",",
"cluster",
",",
"snapshot_id",
",",
"description",
",",
"ttl",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google... | Creates a new snapshot in the specified cluster from the specified
source table. The cluster and the table must be in the same instance.
Note: This is a private alpha release of Cloud Bigtable snapshots. This
feature is not currently available to most Cloud Bigtable customers. This
feat... | [
"Creates",
"a",
"new",
"snapshot",
"in",
"the",
"specified",
"cluster",
"from",
"the",
"specified",
"source",
"table",
".",
"The",
"cluster",
"and",
"the",
"table",
"must",
"be",
"in",
"the",
"same",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L1022-L1146 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | CompanyServiceClient.company_path | def company_path(cls, project, company):
"""Return a fully-qualified company string."""
return google.api_core.path_template.expand(
"projects/{project}/companies/{company}", project=project, company=company
) | python | def company_path(cls, project, company):
"""Return a fully-qualified company string."""
return google.api_core.path_template.expand(
"projects/{project}/companies/{company}", project=project, company=company
) | [
"def",
"company_path",
"(",
"cls",
",",
"project",
",",
"company",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/companies/{company}\"",
",",
"project",
"=",
"project",
",",
"company",
"=",
"compan... | Return a fully-qualified company string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"company",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L81-L85 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | CompanyServiceClient.create_company | def create_company(
self,
parent,
company,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new company entity.
Example:
>>> from google.cloud import ta... | python | def create_company(
self,
parent,
company,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new company entity.
Example:
>>> from google.cloud import ta... | [
"def",
"create_company",
"(",
"self",
",",
"parent",
",",
"company",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAU... | Creates a new company entity.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>>
>>> # TODO: Initialize `company`:
... | [
"Creates",
"a",
"new",
"company",
"entity",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L186-L257 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | CompanyServiceClient.update_company | def update_company(
self,
company,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates specified company.
Example:
>>> from google.cloud im... | python | def update_company(
self,
company,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates specified company.
Example:
>>> from google.cloud im... | [
"def",
"update_company",
"(",
"self",
",",
"company",
",",
"update_mask",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | Updates specified company.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> # TODO: Initialize `company`:
>>> company = {}
>>>
>>> response = client... | [
"Updates",
"specified",
"company",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L320-L393 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | CompanyServiceClient.delete_company | def delete_company(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes specified company.
Prerequisite: The company has no jobs associated with it.
Example:... | python | def delete_company(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes specified company.
Prerequisite: The company has no jobs associated with it.
Example:... | [
"def",
"delete_company",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadat... | Deletes specified company.
Prerequisite: The company has no jobs associated with it.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> name = client.company_path('[PROJECT]', '[... | [
"Deletes",
"specified",
"company",
".",
"Prerequisite",
":",
"The",
"company",
"has",
"no",
"jobs",
"associated",
"with",
"it",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L395-L452 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/client.py | Client.quotas | def quotas(self):
"""Return DNS quotas for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/projects/get
:rtype: mapping
:returns: keys for the mapping correspond to those of the ``quota``
sub-mapping of the project resource.
... | python | def quotas(self):
"""Return DNS quotas for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/projects/get
:rtype: mapping
:returns: keys for the mapping correspond to those of the ``quota``
sub-mapping of the project resource.
... | [
"def",
"quotas",
"(",
"self",
")",
":",
"path",
"=",
"\"/projects/%s\"",
"%",
"(",
"self",
".",
"project",
",",
")",
"resp",
"=",
"self",
".",
"_connection",
".",
"api_request",
"(",
"method",
"=",
"\"GET\"",
",",
"path",
"=",
"path",
")",
"return",
... | Return DNS quotas for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/projects/get
:rtype: mapping
:returns: keys for the mapping correspond to those of the ``quota``
sub-mapping of the project resource. | [
"Return",
"DNS",
"quotas",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L57-L72 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/client.py | Client.list_zones | def list_zones(self, max_results=None, page_token=None):
"""List zones for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/managedZones/list
:type max_results: int
:param max_results: maximum number of zones to return, If not
... | python | def list_zones(self, max_results=None, page_token=None):
"""List zones for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/managedZones/list
:type max_results: int
:param max_results: maximum number of zones to return, If not
... | [
"def",
"list_zones",
"(",
"self",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
")",
":",
"path",
"=",
"\"/projects/%s/managedZones\"",
"%",
"(",
"self",
".",
"project",
",",
")",
"return",
"page_iterator",
".",
"HTTPIterator",
"(",
"clien... | List zones for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/managedZones/list
:type max_results: int
:param max_results: maximum number of zones to return, If not
passed, defaults to a value set by the API.
:type ... | [
"List",
"zones",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L74-L104 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/client.py | Client.zone | def zone(self, name, dns_name=None, description=None):
"""Construct a zone bound to this client.
:type name: str
:param name: Name of the zone.
:type dns_name: str
:param dns_name:
(Optional) DNS name of the zone. If not passed, then calls to
:meth:`zon... | python | def zone(self, name, dns_name=None, description=None):
"""Construct a zone bound to this client.
:type name: str
:param name: Name of the zone.
:type dns_name: str
:param dns_name:
(Optional) DNS name of the zone. If not passed, then calls to
:meth:`zon... | [
"def",
"zone",
"(",
"self",
",",
"name",
",",
"dns_name",
"=",
"None",
",",
"description",
"=",
"None",
")",
":",
"return",
"ManagedZone",
"(",
"name",
",",
"dns_name",
",",
"client",
"=",
"self",
",",
"description",
"=",
"description",
")"
] | Construct a zone bound to this client.
:type name: str
:param name: Name of the zone.
:type dns_name: str
:param dns_name:
(Optional) DNS name of the zone. If not passed, then calls to
:meth:`zone.create` will fail.
:type description: str
:para... | [
"Construct",
"a",
"zone",
"bound",
"to",
"this",
"client",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L106-L125 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/v1/client.py | Client.patch_traces | def patch_traces(self, traces, project_id=None):
"""Sends new traces to Stackdriver Trace or updates existing traces.
Args:
traces (dict): Required. The traces to be patched in the API call.
project_id (Optional[str]): ID of the Cloud project where the trace
dat... | python | def patch_traces(self, traces, project_id=None):
"""Sends new traces to Stackdriver Trace or updates existing traces.
Args:
traces (dict): Required. The traces to be patched in the API call.
project_id (Optional[str]): ID of the Cloud project where the trace
dat... | [
"def",
"patch_traces",
"(",
"self",
",",
"traces",
",",
"project_id",
"=",
"None",
")",
":",
"if",
"project_id",
"is",
"None",
":",
"project_id",
"=",
"self",
".",
"project",
"self",
".",
"trace_api",
".",
"patch_traces",
"(",
"project_id",
"=",
"project_i... | Sends new traces to Stackdriver Trace or updates existing traces.
Args:
traces (dict): Required. The traces to be patched in the API call.
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored. | [
"Sends",
"new",
"traces",
"to",
"Stackdriver",
"Trace",
"or",
"updates",
"existing",
"traces",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/client.py#L60-L72 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/v1/client.py | Client.get_trace | def get_trace(self, trace_id, project_id=None):
"""
Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace ... | python | def get_trace(self, trace_id, project_id=None):
"""
Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace ... | [
"def",
"get_trace",
"(",
"self",
",",
"trace_id",
",",
"project_id",
"=",
"None",
")",
":",
"if",
"project_id",
"is",
"None",
":",
"project_id",
"=",
"self",
".",
"project",
"return",
"self",
".",
"trace_api",
".",
"get_trace",
"(",
"project_id",
"=",
"p... | Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace dict. | [
"Gets",
"a",
"single",
"trace",
"by",
"its",
"ID",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/client.py#L74-L90 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/v1/client.py | Client.list_traces | def list_traces(
self,
project_id=None,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
page_token=None,
):
"""
Returns of a list of traces that match the filter conditions.
Args:... | python | def list_traces(
self,
project_id=None,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
page_token=None,
):
"""
Returns of a list of traces that match the filter conditions.
Args:... | [
"def",
"list_traces",
"(",
"self",
",",
"project_id",
"=",
"None",
",",
"view",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
... | Returns of a list of traces that match the filter conditions.
Args:
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored.
view (Optional[~google.cloud.trace_v1.gapic.enums.
ListTracesRequest.ViewType]): Type of data returned... | [
"Returns",
"of",
"a",
"list",
"of",
"traces",
"that",
"match",
"the",
"filter",
"conditions",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/client.py#L92-L157 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/resume_service_client.py | ResumeServiceClient.parse_resume | def parse_resume(
self,
parent,
resume,
region_code=None,
language_code=None,
options_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Parses a resume i... | python | def parse_resume(
self,
parent,
resume,
region_code=None,
language_code=None,
options_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Parses a resume i... | [
"def",
"parse_resume",
"(",
"self",
",",
"parent",
",",
"resume",
",",
"region_code",
"=",
"None",
",",
"language_code",
"=",
"None",
",",
"options_",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAUL... | Parses a resume into a ``Profile``. The API attempts to fill out the
following profile fields if present within the resume:
- personNames
- addresses
- emailAddress
- phoneNumbers
- personalUris
- employmentRecords
- educationRecords
- ski... | [
"Parses",
"a",
"resume",
"into",
"a",
"Profile",
".",
"The",
"API",
"attempts",
"to",
"fill",
"out",
"the",
"following",
"profile",
"fields",
"if",
"present",
"within",
"the",
"resume",
":"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/resume_service_client.py#L193-L321 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.