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 | bigquery/google/cloud/bigquery/query.py | ScalarQueryParameter.to_api_repr | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
value = self.value
converter = _SCALAR_VALUE_TO_JSON_PARAM.get(self.type_)
if converter is not None:
value = converter(value)
... | python | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
value = self.value
converter = _SCALAR_VALUE_TO_JSON_PARAM.get(self.type_)
if converter is not None:
value = converter(value)
... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"value",
"converter",
"=",
"_SCALAR_VALUE_TO_JSON_PARAM",
".",
"get",
"(",
"self",
".",
"type_",
")",
"if",
"converter",
"is",
"not",
"None",
":",
"value",
"=",
"converter",
"(",
"va... | Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping | [
"Construct",
"JSON",
"API",
"representation",
"for",
"the",
"parameter",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L133-L149 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/query.py | ArrayQueryParameter.from_api_repr | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ArrayQueryParameter`
:returns: instance
"""
array_type = resource["... | python | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ArrayQueryParameter`
:returns: instance
"""
array_type = resource["... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"array_type",
"=",
"resource",
"[",
"\"parameterType\"",
"]",
"[",
"\"arrayType\"",
"]",
"[",
"\"type\"",
"]",
"if",
"array_type",
"==",
"\"STRUCT\"",
":",
"return",
"cls",
".",
"_from_api_repr_str... | Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.ArrayQueryParameter`
:returns: instance | [
"Factory",
":",
"construct",
"parameter",
"from",
"JSON",
"resource",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L242-L254 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/query.py | ArrayQueryParameter.to_api_repr | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
values = self.values
if self.array_type == "RECORD" or self.array_type == "STRUCT":
reprs = [value.to_api_repr() for value in values]
... | python | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
values = self.values
if self.array_type == "RECORD" or self.array_type == "STRUCT":
reprs = [value.to_api_repr() for value in values]
... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"values",
"=",
"self",
".",
"values",
"if",
"self",
".",
"array_type",
"==",
"\"RECORD\"",
"or",
"self",
".",
"array_type",
"==",
"\"STRUCT\"",
":",
"reprs",
"=",
"[",
"value",
".",
"to_api_repr",
"(",
")",
... | Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping | [
"Construct",
"JSON",
"API",
"representation",
"for",
"the",
"parameter",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L256-L279 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/query.py | StructQueryParameter.from_api_repr | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.StructQueryParameter`
:returns: instance
"""
name = resource.get("n... | python | def from_api_repr(cls, resource):
"""Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.StructQueryParameter`
:returns: instance
"""
name = resource.get("n... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"name",
"=",
"resource",
".",
"get",
"(",
"\"name\"",
")",
"instance",
"=",
"cls",
"(",
"name",
")",
"type_resources",
"=",
"{",
"}",
"types",
"=",
"instance",
".",
"struct_types",
"for",
"... | Factory: construct parameter from JSON resource.
:type resource: dict
:param resource: JSON mapping of parameter
:rtype: :class:`~google.cloud.bigquery.query.StructQueryParameter`
:returns: instance | [
"Factory",
":",
"construct",
"parameter",
"from",
"JSON",
"resource",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L350-L388 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/query.py | StructQueryParameter.to_api_repr | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
s_types = {}
values = {}
for name, value in self.struct_values.items():
type_ = self.struct_types[name]
if type_ in ("ST... | python | def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
s_types = {}
values = {}
for name, value in self.struct_values.items():
type_ = self.struct_types[name]
if type_ in ("ST... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"s_types",
"=",
"{",
"}",
"values",
"=",
"{",
"}",
"for",
"name",
",",
"value",
"in",
"self",
".",
"struct_values",
".",
"items",
"(",
")",
":",
"type_",
"=",
"self",
".",
"struct_types",
"[",
"name",
"]... | Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping | [
"Construct",
"JSON",
"API",
"representation",
"for",
"the",
"parameter",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L390-L420 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/query.py | _QueryResults._set_properties | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
job_id_present = (
"jobReference" in api_response
and "jobId" in a... | python | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
job_id_present = (
"jobReference" in api_response
and "jobId" in a... | [
"def",
"_set_properties",
"(",
"self",
",",
"api_response",
")",
":",
"job_id_present",
"=",
"(",
"\"jobReference\"",
"in",
"api_response",
"and",
"\"jobId\"",
"in",
"api_response",
"[",
"\"jobReference\"",
"]",
"and",
"\"projectId\"",
"in",
"api_response",
"[",
"... | Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call | [
"Update",
"properties",
"from",
"resource",
"in",
"body",
"of",
"api_response"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L598-L613 | train |
googleapis/google-cloud-python | logging/google/cloud/logging/handlers/container_engine.py | ContainerEngineHandler.format | def format(self, record):
"""Format the message into JSON expected by fluentd.
:type record: :class:`~logging.LogRecord`
:param record: the log record
:rtype: str
:returns: A JSON string formatted for GKE fluentd.
"""
message = super(ContainerEngineHandler, self... | python | def format(self, record):
"""Format the message into JSON expected by fluentd.
:type record: :class:`~logging.LogRecord`
:param record: the log record
:rtype: str
:returns: A JSON string formatted for GKE fluentd.
"""
message = super(ContainerEngineHandler, self... | [
"def",
"format",
"(",
"self",
",",
"record",
")",
":",
"message",
"=",
"super",
"(",
"ContainerEngineHandler",
",",
"self",
")",
".",
"format",
"(",
"record",
")",
"return",
"format_stackdriver_json",
"(",
"record",
",",
"message",
")"
] | Format the message into JSON expected by fluentd.
:type record: :class:`~logging.LogRecord`
:param record: the log record
:rtype: str
:returns: A JSON string formatted for GKE fluentd. | [
"Format",
"the",
"message",
"into",
"JSON",
"expected",
"by",
"fluentd",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/container_engine.py#L44-L54 | train |
googleapis/google-cloud-python | language/google/cloud/language_v1/gapic/language_service_client.py | LanguageServiceClient.analyze_sentiment | def analyze_sentiment(
self,
document,
encoding_type=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Analyzes the sentiment of the provided text.
Example:
... | python | def analyze_sentiment(
self,
document,
encoding_type=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Analyzes the sentiment of the provided text.
Example:
... | [
"def",
"analyze_sentiment",
"(",
"self",
",",
"document",
",",
"encoding_type",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",... | Analyzes the sentiment of the provided text.
Example:
>>> from google.cloud import language_v1
>>>
>>> client = language_v1.LanguageServiceClient()
>>>
>>> # TODO: Initialize `document`:
>>> document = {}
>>>
>>> re... | [
"Analyzes",
"the",
"sentiment",
"of",
"the",
"provided",
"text",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/language/google/cloud/language_v1/gapic/language_service_client.py#L169-L231 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | _commit_with_retry | def _commit_with_retry(client, write_pbs, transaction_id):
"""Call ``Commit`` on the GAPIC client with retry / sleep.
Retries the ``Commit`` RPC on Unavailable. Usually this RPC-level
retry is handled by the underlying GAPICd client, but in this case it
doesn't because ``Commit`` is not always idempote... | python | def _commit_with_retry(client, write_pbs, transaction_id):
"""Call ``Commit`` on the GAPIC client with retry / sleep.
Retries the ``Commit`` RPC on Unavailable. Usually this RPC-level
retry is handled by the underlying GAPICd client, but in this case it
doesn't because ``Commit`` is not always idempote... | [
"def",
"_commit_with_retry",
"(",
"client",
",",
"write_pbs",
",",
"transaction_id",
")",
":",
"current_sleep",
"=",
"_INITIAL_SLEEP",
"while",
"True",
":",
"try",
":",
"return",
"client",
".",
"_firestore_api",
".",
"commit",
"(",
"client",
".",
"_database_stri... | Call ``Commit`` on the GAPIC client with retry / sleep.
Retries the ``Commit`` RPC on Unavailable. Usually this RPC-level
retry is handled by the underlying GAPICd client, but in this case it
doesn't because ``Commit`` is not always idempotent. But here we know it
is "idempotent"-like because it has a ... | [
"Call",
"Commit",
"on",
"the",
"GAPIC",
"client",
"with",
"retry",
"/",
"sleep",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L345-L384 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | _sleep | def _sleep(current_sleep, max_sleep=_MAX_SLEEP, multiplier=_MULTIPLIER):
"""Sleep and produce a new sleep time.
.. _Exponential Backoff And Jitter: https://www.awsarchitectureblog.com/\
2015/03/backoff.html
Select a duration between zero and ``current_sleep``. It mi... | python | def _sleep(current_sleep, max_sleep=_MAX_SLEEP, multiplier=_MULTIPLIER):
"""Sleep and produce a new sleep time.
.. _Exponential Backoff And Jitter: https://www.awsarchitectureblog.com/\
2015/03/backoff.html
Select a duration between zero and ``current_sleep``. It mi... | [
"def",
"_sleep",
"(",
"current_sleep",
",",
"max_sleep",
"=",
"_MAX_SLEEP",
",",
"multiplier",
"=",
"_MULTIPLIER",
")",
":",
"actual_sleep",
"=",
"random",
".",
"uniform",
"(",
"0.0",
",",
"current_sleep",
")",
"time",
".",
"sleep",
"(",
"actual_sleep",
")",... | Sleep and produce a new sleep time.
.. _Exponential Backoff And Jitter: https://www.awsarchitectureblog.com/\
2015/03/backoff.html
Select a duration between zero and ``current_sleep``. It might seem
counterintuitive to have so much jitter, but
`Exponential Backo... | [
"Sleep",
"and",
"produce",
"a",
"new",
"sleep",
"time",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L387-L409 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | Transaction._add_write_pbs | def _add_write_pbs(self, write_pbs):
"""Add `Write`` protobufs to this transaction.
Args:
write_pbs (List[google.cloud.proto.firestore.v1beta1.\
write_pb2.Write]): A list of write protobufs to be added.
Raises:
ValueError: If this transaction is read-onl... | python | def _add_write_pbs(self, write_pbs):
"""Add `Write`` protobufs to this transaction.
Args:
write_pbs (List[google.cloud.proto.firestore.v1beta1.\
write_pb2.Write]): A list of write protobufs to be added.
Raises:
ValueError: If this transaction is read-onl... | [
"def",
"_add_write_pbs",
"(",
"self",
",",
"write_pbs",
")",
":",
"if",
"self",
".",
"_read_only",
":",
"raise",
"ValueError",
"(",
"_WRITE_READ_ONLY",
")",
"super",
"(",
"Transaction",
",",
"self",
")",
".",
"_add_write_pbs",
"(",
"write_pbs",
")"
] | Add `Write`` protobufs to this transaction.
Args:
write_pbs (List[google.cloud.proto.firestore.v1beta1.\
write_pb2.Write]): A list of write protobufs to be added.
Raises:
ValueError: If this transaction is read-only. | [
"Add",
"Write",
"protobufs",
"to",
"this",
"transaction",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L65-L78 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | Transaction._options_protobuf | def _options_protobuf(self, retry_id):
"""Convert the current object to protobuf.
The ``retry_id`` value is used when retrying a transaction that
failed (e.g. due to contention). It is intended to be the "first"
transaction that failed (i.e. if multiple retries are needed).
Arg... | python | def _options_protobuf(self, retry_id):
"""Convert the current object to protobuf.
The ``retry_id`` value is used when retrying a transaction that
failed (e.g. due to contention). It is intended to be the "first"
transaction that failed (i.e. if multiple retries are needed).
Arg... | [
"def",
"_options_protobuf",
"(",
"self",
",",
"retry_id",
")",
":",
"if",
"retry_id",
"is",
"not",
"None",
":",
"if",
"self",
".",
"_read_only",
":",
"raise",
"ValueError",
"(",
"_CANT_RETRY_READ_ONLY",
")",
"return",
"types",
".",
"TransactionOptions",
"(",
... | Convert the current object to protobuf.
The ``retry_id`` value is used when retrying a transaction that
failed (e.g. due to contention). It is intended to be the "first"
transaction that failed (i.e. if multiple retries are needed).
Args:
retry_id (Union[bytes, NoneType]): ... | [
"Convert",
"the",
"current",
"object",
"to",
"protobuf",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L80-L114 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | Transaction._begin | def _begin(self, retry_id=None):
"""Begin the transaction.
Args:
retry_id (Optional[bytes]): Transaction ID of a transaction to be
retried.
Raises:
ValueError: If the current transaction has already begun.
"""
if self.in_progress:
... | python | def _begin(self, retry_id=None):
"""Begin the transaction.
Args:
retry_id (Optional[bytes]): Transaction ID of a transaction to be
retried.
Raises:
ValueError: If the current transaction has already begun.
"""
if self.in_progress:
... | [
"def",
"_begin",
"(",
"self",
",",
"retry_id",
"=",
"None",
")",
":",
"if",
"self",
".",
"in_progress",
":",
"msg",
"=",
"_CANT_BEGIN",
".",
"format",
"(",
"self",
".",
"_id",
")",
"raise",
"ValueError",
"(",
"msg",
")",
"transaction_response",
"=",
"s... | Begin the transaction.
Args:
retry_id (Optional[bytes]): Transaction ID of a transaction to be
retried.
Raises:
ValueError: If the current transaction has already begun. | [
"Begin",
"the",
"transaction",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L135-L154 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | Transaction._rollback | def _rollback(self):
"""Roll back the transaction.
Raises:
ValueError: If no transaction is in progress.
"""
if not self.in_progress:
raise ValueError(_CANT_ROLLBACK)
try:
# NOTE: The response is just ``google.protobuf.Empty``.
se... | python | def _rollback(self):
"""Roll back the transaction.
Raises:
ValueError: If no transaction is in progress.
"""
if not self.in_progress:
raise ValueError(_CANT_ROLLBACK)
try:
# NOTE: The response is just ``google.protobuf.Empty``.
se... | [
"def",
"_rollback",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"in_progress",
":",
"raise",
"ValueError",
"(",
"_CANT_ROLLBACK",
")",
"try",
":",
"# NOTE: The response is just ``google.protobuf.Empty``.",
"self",
".",
"_client",
".",
"_firestore_api",
".",
"... | Roll back the transaction.
Raises:
ValueError: If no transaction is in progress. | [
"Roll",
"back",
"the",
"transaction",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L164-L181 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | Transaction._commit | def _commit(self):
"""Transactionally commit the changes accumulated.
Returns:
List[google.cloud.proto.firestore.v1beta1.\
write_pb2.WriteResult, ...]: The write results corresponding
to the changes committed, returned in the same order as the
changes... | python | def _commit(self):
"""Transactionally commit the changes accumulated.
Returns:
List[google.cloud.proto.firestore.v1beta1.\
write_pb2.WriteResult, ...]: The write results corresponding
to the changes committed, returned in the same order as the
changes... | [
"def",
"_commit",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"in_progress",
":",
"raise",
"ValueError",
"(",
"_CANT_COMMIT",
")",
"commit_response",
"=",
"_commit_with_retry",
"(",
"self",
".",
"_client",
",",
"self",
".",
"_write_pbs",
",",
"self",
... | Transactionally commit the changes accumulated.
Returns:
List[google.cloud.proto.firestore.v1beta1.\
write_pb2.WriteResult, ...]: The write results corresponding
to the changes committed, returned in the same order as the
changes were applied to this transact... | [
"Transactionally",
"commit",
"the",
"changes",
"accumulated",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L183-L202 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | _Transactional._pre_commit | def _pre_commit(self, transaction, *args, **kwargs):
"""Begin transaction and call the wrapped callable.
If the callable raises an exception, the transaction will be rolled
back. If not, the transaction will be "ready" for ``Commit`` (i.e.
it will have staged writes).
Args:
... | python | def _pre_commit(self, transaction, *args, **kwargs):
"""Begin transaction and call the wrapped callable.
If the callable raises an exception, the transaction will be rolled
back. If not, the transaction will be "ready" for ``Commit`` (i.e.
it will have staged writes).
Args:
... | [
"def",
"_pre_commit",
"(",
"self",
",",
"transaction",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Force the ``transaction`` to be not \"in progress\".",
"transaction",
".",
"_clean_up",
"(",
")",
"transaction",
".",
"_begin",
"(",
"retry_id",
"=",
"... | Begin transaction and call the wrapped callable.
If the callable raises an exception, the transaction will be rolled
back. If not, the transaction will be "ready" for ``Commit`` (i.e.
it will have staged writes).
Args:
transaction (~.firestore_v1beta1.transaction.Transactio... | [
"Begin",
"transaction",
"and",
"call",
"the",
"wrapped",
"callable",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L229-L264 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/transaction.py | _Transactional._maybe_commit | def _maybe_commit(self, transaction):
"""Try to commit the transaction.
If the transaction is read-write and the ``Commit`` fails with the
``ABORTED`` status code, it will be retried. Any other failure will
not be caught.
Args:
transaction (~.firestore_v1beta1.trans... | python | def _maybe_commit(self, transaction):
"""Try to commit the transaction.
If the transaction is read-write and the ``Commit`` fails with the
``ABORTED`` status code, it will be retried. Any other failure will
not be caught.
Args:
transaction (~.firestore_v1beta1.trans... | [
"def",
"_maybe_commit",
"(",
"self",
",",
"transaction",
")",
":",
"try",
":",
"transaction",
".",
"_commit",
"(",
")",
"return",
"True",
"except",
"exceptions",
".",
"GoogleAPICallError",
"as",
"exc",
":",
"if",
"transaction",
".",
"_read_only",
":",
"raise... | Try to commit the transaction.
If the transaction is read-write and the ``Commit`` fails with the
``ABORTED`` status code, it will be retried. Any other failure will
not be caught.
Args:
transaction (~.firestore_v1beta1.transaction.Transaction): The
transact... | [
"Try",
"to",
"commit",
"the",
"transaction",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/transaction.py#L266-L291 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | ProfileServiceClient.profile_path | def profile_path(cls, project, tenant, profile):
"""Return a fully-qualified profile string."""
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/profiles/{profile}",
project=project,
tenant=tenant,
profile=profile,
... | python | def profile_path(cls, project, tenant, profile):
"""Return a fully-qualified profile string."""
return google.api_core.path_template.expand(
"projects/{project}/tenants/{tenant}/profiles/{profile}",
project=project,
tenant=tenant,
profile=profile,
... | [
"def",
"profile_path",
"(",
"cls",
",",
"project",
",",
"tenant",
",",
"profile",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/tenants/{tenant}/profiles/{profile}\"",
",",
"project",
"=",
"project",
... | Return a fully-qualified profile string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"profile",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L98-L105 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | ProfileServiceClient.create_profile | def create_profile(
self,
parent,
profile,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new profile.
Example:
>>> from google.cloud impo... | python | def create_profile(
self,
parent,
profile,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new profile.
Example:
>>> from google.cloud impo... | [
"def",
"create_profile",
"(",
"self",
",",
"parent",
",",
"profile",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAU... | Creates and returns a new profile.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.ProfileServiceClient()
>>>
>>> parent = client.tenant_path('[PROJECT]', '[TENANT]')
>>>
>>> # TODO: Initial... | [
"Creates",
"and",
"returns",
"a",
"new",
"profile",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L313-L384 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | ProfileServiceClient.get_profile | def get_profile(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the specified profile.
Example:
>>> from google.cloud import talent_v4beta1
... | python | def get_profile(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the specified profile.
Example:
>>> from google.cloud import talent_v4beta1
... | [
"def",
"get_profile",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadata",... | Gets the specified profile.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.ProfileServiceClient()
>>>
>>> name = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]')
>>>
>>> response =... | [
"Gets",
"the",
"specified",
"profile",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L386-L446 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | ProfileServiceClient.update_profile | def update_profile(
self,
profile,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the specified profile and returns the updated result.
Example:
... | python | def update_profile(
self,
profile,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the specified profile and returns the updated result.
Example:
... | [
"def",
"update_profile",
"(",
"self",
",",
"profile",
",",
"update_mask",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | Updates the specified profile and returns the updated result.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.ProfileServiceClient()
>>>
>>> # TODO: Initialize `profile`:
>>> profile = {}
>>... | [
"Updates",
"the",
"specified",
"profile",
"and",
"returns",
"the",
"updated",
"result",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L448-L545 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py | ProfileServiceClient.search_profiles | def search_profiles(
self,
parent,
request_metadata,
profile_query=None,
page_size=None,
offset=None,
disable_spell_check=None,
order_by=None,
case_sensitive_sort=None,
histogram_queries=None,
retry=google.api_core.gapic_v1.method.D... | python | def search_profiles(
self,
parent,
request_metadata,
profile_query=None,
page_size=None,
offset=None,
disable_spell_check=None,
order_by=None,
case_sensitive_sort=None,
histogram_queries=None,
retry=google.api_core.gapic_v1.method.D... | [
"def",
"search_profiles",
"(",
"self",
",",
"parent",
",",
"request_metadata",
",",
"profile_query",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"offset",
"=",
"None",
",",
"disable_spell_check",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
"case_sen... | Searches for profiles within a tenant.
For example, search by raw queries "software engineer in Mountain View"
or search by structured filters (location filter, education filter,
etc.).
See ``SearchProfilesRequest`` for more information.
Example:
>>> from google.cl... | [
"Searches",
"for",
"profiles",
"within",
"a",
"tenant",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py#L606-L868 | train |
googleapis/google-cloud-python | automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py | PredictionServiceClient.predict | def predict(
self,
name,
payload,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform an online prediction. The prediction result will be directly
re... | python | def predict(
self,
name,
payload,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform an online prediction. The prediction result will be directly
re... | [
"def",
"predict",
"(",
"self",
",",
"name",
",",
"payload",
",",
"params",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
... | Perform an online prediction. The prediction result will be directly
returned in the response. Available for following ML problems, and their
expected request payloads:
- Image Classification - Image in .JPEG, .GIF or .PNG format,
image\_bytes up to 30MB.
- Image Object Det... | [
"Perform",
"an",
"online",
"prediction",
".",
"The",
"prediction",
"result",
"will",
"be",
"directly",
"returned",
"in",
"the",
"response",
".",
"Available",
"for",
"following",
"ML",
"problems",
"and",
"their",
"expected",
"request",
"payloads",
":"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py#L201-L312 | train |
googleapis/google-cloud-python | automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py | PredictionServiceClient.batch_predict | def batch_predict(
self,
name,
input_config,
output_config,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform a batch prediction. Unlike the online... | python | def batch_predict(
self,
name,
input_config,
output_config,
params=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Perform a batch prediction. Unlike the online... | [
"def",
"batch_predict",
"(",
"self",
",",
"name",
",",
"input_config",
",",
"output_config",
",",
"params",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"ap... | Perform a batch prediction. Unlike the online ``Predict``, batch
prediction result won't be immediately available in the response.
Instead, a long running operation object is returned. User can poll the
operation result via ``GetOperation`` method. Once the operation is
done, ``BatchPred... | [
"Perform",
"a",
"batch",
"prediction",
".",
"Unlike",
"the",
"online",
"Predict",
"batch",
"prediction",
"result",
"won",
"t",
"be",
"immediately",
"available",
"in",
"the",
"response",
".",
"Instead",
"a",
"long",
"running",
"operation",
"object",
"is",
"retu... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py#L314-L455 | train |
googleapis/google-cloud-python | core/google/cloud/client.py | _ClientFactoryMixin.from_service_account_json | def from_service_account_json(cls, json_credentials_path, *args, **kwargs):
"""Factory to retrieve JSON credentials while creating client.
:type json_credentials_path: str
:param json_credentials_path: The path to a private key file (this file
was given to ... | python | def from_service_account_json(cls, json_credentials_path, *args, **kwargs):
"""Factory to retrieve JSON credentials while creating client.
:type json_credentials_path: str
:param json_credentials_path: The path to a private key file (this file
was given to ... | [
"def",
"from_service_account_json",
"(",
"cls",
",",
"json_credentials_path",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"\"credentials\"",
"in",
"kwargs",
":",
"raise",
"TypeError",
"(",
"\"credentials must not be in keyword arguments\"",
")",
"with... | Factory to retrieve JSON credentials while creating client.
:type json_credentials_path: str
:param json_credentials_path: The path to a private key file (this file
was given to you when you created the
service account). This f... | [
"Factory",
"to",
"retrieve",
"JSON",
"credentials",
"while",
"creating",
"client",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/client.py#L48-L82 | train |
googleapis/google-cloud-python | core/google/cloud/client.py | Client._http | def _http(self):
"""Getter for object used for HTTP transport.
:rtype: :class:`~requests.Session`
:returns: An HTTP object.
"""
if self._http_internal is None:
self._http_internal = google.auth.transport.requests.AuthorizedSession(
self._credentials
... | python | def _http(self):
"""Getter for object used for HTTP transport.
:rtype: :class:`~requests.Session`
:returns: An HTTP object.
"""
if self._http_internal is None:
self._http_internal = google.auth.transport.requests.AuthorizedSession(
self._credentials
... | [
"def",
"_http",
"(",
"self",
")",
":",
"if",
"self",
".",
"_http_internal",
"is",
"None",
":",
"self",
".",
"_http_internal",
"=",
"google",
".",
"auth",
".",
"transport",
".",
"requests",
".",
"AuthorizedSession",
"(",
"self",
".",
"_credentials",
")",
... | Getter for object used for HTTP transport.
:rtype: :class:`~requests.Session`
:returns: An HTTP object. | [
"Getter",
"for",
"object",
"used",
"for",
"HTTP",
"transport",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/client.py#L148-L158 | train |
googleapis/google-cloud-python | monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py | AlertPolicyServiceClient.alert_policy_path | def alert_policy_path(cls, project, alert_policy):
"""Return a fully-qualified alert_policy string."""
return google.api_core.path_template.expand(
"projects/{project}/alertPolicies/{alert_policy}",
project=project,
alert_policy=alert_policy,
) | python | def alert_policy_path(cls, project, alert_policy):
"""Return a fully-qualified alert_policy string."""
return google.api_core.path_template.expand(
"projects/{project}/alertPolicies/{alert_policy}",
project=project,
alert_policy=alert_policy,
) | [
"def",
"alert_policy_path",
"(",
"cls",
",",
"project",
",",
"alert_policy",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/alertPolicies/{alert_policy}\"",
",",
"project",
"=",
"project",
",",
"alert_p... | Return a fully-qualified alert_policy string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"alert_policy",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py#L96-L102 | train |
googleapis/google-cloud-python | monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py | AlertPolicyServiceClient.alert_policy_condition_path | def alert_policy_condition_path(cls, project, alert_policy, condition):
"""Return a fully-qualified alert_policy_condition string."""
return google.api_core.path_template.expand(
"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}",
project=project,
... | python | def alert_policy_condition_path(cls, project, alert_policy, condition):
"""Return a fully-qualified alert_policy_condition string."""
return google.api_core.path_template.expand(
"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}",
project=project,
... | [
"def",
"alert_policy_condition_path",
"(",
"cls",
",",
"project",
",",
"alert_policy",
",",
"condition",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}\"",
... | Return a fully-qualified alert_policy_condition string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"alert_policy_condition",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py#L105-L112 | train |
googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/helper_threads.py | _get_many | def _get_many(queue_, max_items=None, max_latency=0):
"""Get multiple items from a Queue.
Gets at least one (blocking) and at most ``max_items`` items
(non-blocking) from a given Queue. Does not mark the items as done.
Args:
queue_ (~queue.Queue`): The Queue to get items from.
max_item... | python | def _get_many(queue_, max_items=None, max_latency=0):
"""Get multiple items from a Queue.
Gets at least one (blocking) and at most ``max_items`` items
(non-blocking) from a given Queue. Does not mark the items as done.
Args:
queue_ (~queue.Queue`): The Queue to get items from.
max_item... | [
"def",
"_get_many",
"(",
"queue_",
",",
"max_items",
"=",
"None",
",",
"max_latency",
"=",
"0",
")",
":",
"start",
"=",
"time",
".",
"time",
"(",
")",
"# Always return at least one item.",
"items",
"=",
"[",
"queue_",
".",
"get",
"(",
")",
"]",
"while",
... | Get multiple items from a Queue.
Gets at least one (blocking) and at most ``max_items`` items
(non-blocking) from a given Queue. Does not mark the items as done.
Args:
queue_ (~queue.Queue`): The Queue to get items from.
max_items (int): The maximum number of items to get. If ``None``, the... | [
"Get",
"multiple",
"items",
"from",
"a",
"Queue",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/helper_threads.py#L34-L61 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _error_result_to_exception | def _error_result_to_exception(error_result):
"""Maps BigQuery error reasons to an exception.
The reasons and their matching HTTP status codes are documented on
the `troubleshooting errors`_ page.
.. _troubleshooting errors: https://cloud.google.com/bigquery\
/troubleshooting-errors
:type... | python | def _error_result_to_exception(error_result):
"""Maps BigQuery error reasons to an exception.
The reasons and their matching HTTP status codes are documented on
the `troubleshooting errors`_ page.
.. _troubleshooting errors: https://cloud.google.com/bigquery\
/troubleshooting-errors
:type... | [
"def",
"_error_result_to_exception",
"(",
"error_result",
")",
":",
"reason",
"=",
"error_result",
".",
"get",
"(",
"\"reason\"",
")",
"status_code",
"=",
"_ERROR_REASON_TO_EXCEPTION",
".",
"get",
"(",
"reason",
",",
"http_client",
".",
"INTERNAL_SERVER_ERROR",
")",... | Maps BigQuery error reasons to an exception.
The reasons and their matching HTTP status codes are documented on
the `troubleshooting errors`_ page.
.. _troubleshooting errors: https://cloud.google.com/bigquery\
/troubleshooting-errors
:type error_result: Mapping[str, str]
:param error_res... | [
"Maps",
"BigQuery",
"error",
"reasons",
"to",
"an",
"exception",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L71-L92 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _JobReference._from_api_repr | def _from_api_repr(cls, resource):
"""Returns a job reference for an API resource representation."""
job_id = resource.get("jobId")
project = resource.get("projectId")
location = resource.get("location")
job_ref = cls(job_id, project, location)
return job_ref | python | def _from_api_repr(cls, resource):
"""Returns a job reference for an API resource representation."""
job_id = resource.get("jobId")
project = resource.get("projectId")
location = resource.get("location")
job_ref = cls(job_id, project, location)
return job_ref | [
"def",
"_from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"job_id",
"=",
"resource",
".",
"get",
"(",
"\"jobId\"",
")",
"project",
"=",
"resource",
".",
"get",
"(",
"\"projectId\"",
")",
"location",
"=",
"resource",
".",
"get",
"(",
"\"location\"",
... | Returns a job reference for an API resource representation. | [
"Returns",
"a",
"job",
"reference",
"for",
"an",
"API",
"resource",
"representation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L269-L275 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.created | def created(self):
"""Datetime at which the job was created.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the creation time (None until set from the server).
"""
statistics = self._properties.get("statistics")
if statistics is not None:
millis = s... | python | def created(self):
"""Datetime at which the job was created.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the creation time (None until set from the server).
"""
statistics = self._properties.get("statistics")
if statistics is not None:
millis = s... | [
"def",
"created",
"(",
"self",
")",
":",
"statistics",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"statistics\"",
")",
"if",
"statistics",
"is",
"not",
"None",
":",
"millis",
"=",
"statistics",
".",
"get",
"(",
"\"creationTime\"",
")",
"if",
"mi... | Datetime at which the job was created.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the creation time (None until set from the server). | [
"Datetime",
"at",
"which",
"the",
"job",
"was",
"created",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L389-L399 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.started | def started(self):
"""Datetime at which the job was started.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the start time (None until set from the server).
"""
statistics = self._properties.get("statistics")
if statistics is not None:
millis = stat... | python | def started(self):
"""Datetime at which the job was started.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the start time (None until set from the server).
"""
statistics = self._properties.get("statistics")
if statistics is not None:
millis = stat... | [
"def",
"started",
"(",
"self",
")",
":",
"statistics",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"statistics\"",
")",
"if",
"statistics",
"is",
"not",
"None",
":",
"millis",
"=",
"statistics",
".",
"get",
"(",
"\"startTime\"",
")",
"if",
"milli... | Datetime at which the job was started.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the start time (None until set from the server). | [
"Datetime",
"at",
"which",
"the",
"job",
"was",
"started",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L402-L412 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.ended | def ended(self):
"""Datetime at which the job finished.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the end time (None until set from the server).
"""
statistics = self._properties.get("statistics")
if statistics is not None:
millis = statistics.... | python | def ended(self):
"""Datetime at which the job finished.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the end time (None until set from the server).
"""
statistics = self._properties.get("statistics")
if statistics is not None:
millis = statistics.... | [
"def",
"ended",
"(",
"self",
")",
":",
"statistics",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"statistics\"",
")",
"if",
"statistics",
"is",
"not",
"None",
":",
"millis",
"=",
"statistics",
".",
"get",
"(",
"\"endTime\"",
")",
"if",
"millis",
... | Datetime at which the job finished.
:rtype: ``datetime.datetime``, or ``NoneType``
:returns: the end time (None until set from the server). | [
"Datetime",
"at",
"which",
"the",
"job",
"finished",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L415-L425 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob._job_statistics | def _job_statistics(self):
"""Helper for job-type specific statistics-based properties."""
statistics = self._properties.get("statistics", {})
return statistics.get(self._JOB_TYPE, {}) | python | def _job_statistics(self):
"""Helper for job-type specific statistics-based properties."""
statistics = self._properties.get("statistics", {})
return statistics.get(self._JOB_TYPE, {}) | [
"def",
"_job_statistics",
"(",
"self",
")",
":",
"statistics",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"statistics\"",
",",
"{",
"}",
")",
"return",
"statistics",
".",
"get",
"(",
"self",
".",
"_JOB_TYPE",
",",
"{",
"}",
")"
] | Helper for job-type specific statistics-based properties. | [
"Helper",
"for",
"job",
"-",
"type",
"specific",
"statistics",
"-",
"based",
"properties",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L427-L430 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob._set_properties | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
cleaned = api_response.copy()
self._scrub_local_properties(cleaned)
stati... | python | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
cleaned = api_response.copy()
self._scrub_local_properties(cleaned)
stati... | [
"def",
"_set_properties",
"(",
"self",
",",
"api_response",
")",
":",
"cleaned",
"=",
"api_response",
".",
"copy",
"(",
")",
"self",
".",
"_scrub_local_properties",
"(",
"cleaned",
")",
"statistics",
"=",
"cleaned",
".",
"get",
"(",
"\"statistics\"",
",",
"{... | Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call | [
"Update",
"properties",
"from",
"resource",
"in",
"body",
"of",
"api_response"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L473-L495 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob._get_resource_config | def _get_resource_config(cls, resource):
"""Helper for :meth:`from_api_repr`
:type resource: dict
:param resource: resource for the job
:rtype: dict
:returns: tuple (string, dict), where the first element is the
job ID and the second contains job-specific conf... | python | def _get_resource_config(cls, resource):
"""Helper for :meth:`from_api_repr`
:type resource: dict
:param resource: resource for the job
:rtype: dict
:returns: tuple (string, dict), where the first element is the
job ID and the second contains job-specific conf... | [
"def",
"_get_resource_config",
"(",
"cls",
",",
"resource",
")",
":",
"if",
"\"jobReference\"",
"not",
"in",
"resource",
"or",
"\"jobId\"",
"not",
"in",
"resource",
"[",
"\"jobReference\"",
"]",
":",
"raise",
"KeyError",
"(",
"\"Resource lacks required identity info... | Helper for :meth:`from_api_repr`
:type resource: dict
:param resource: resource for the job
:rtype: dict
:returns: tuple (string, dict), where the first element is the
job ID and the second contains job-specific configuration.
:raises: :class:`KeyError` if the... | [
"Helper",
"for",
":",
"meth",
":",
"from_api_repr"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L498-L524 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob._begin | def _begin(self, client=None, retry=DEFAULT_RETRY):
"""API call: begin the job via a POST request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param c... | python | def _begin(self, client=None, retry=DEFAULT_RETRY):
"""API call: begin the job via a POST request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param c... | [
"def",
"_begin",
"(",
"self",
",",
"client",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"if",
"self",
".",
"state",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Job already begun.\"",
")",
"client",
"=",
"self",
".",
"_require... | API call: begin the job via a POST request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
... | [
"API",
"call",
":",
"begin",
"the",
"job",
"via",
"a",
"POST",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L532-L559 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.exists | def exists(self, client=None, retry=DEFAULT_RETRY):
"""API call: test for the existence of the job via a GET request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
... | python | def exists(self, client=None, retry=DEFAULT_RETRY):
"""API call: test for the existence of the job via a GET request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
... | [
"def",
"exists",
"(",
"self",
",",
"client",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"extra_params",
"=",
"{",
"\"fields\"",
":",
"\"id\"",
"}",
"if",
"self",
".",
"l... | API call: test for the existence of the job via a GET request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls... | [
"API",
"call",
":",
"test",
"for",
"the",
"existence",
"of",
"the",
"job",
"via",
"a",
"GET",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L561-L591 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.reload | def reload(self, client=None, retry=DEFAULT_RETRY):
"""API call: refresh job properties via a GET request.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:p... | python | def reload(self, client=None, retry=DEFAULT_RETRY):
"""API call: refresh job properties via a GET request.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:p... | [
"def",
"reload",
"(",
"self",
",",
"client",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"extra_params",
"=",
"{",
"}",
"if",
"self",
".",
"location",
":",
"extra_params",
... | API call: refresh job properties via a GET request.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to t... | [
"API",
"call",
":",
"refresh",
"job",
"properties",
"via",
"a",
"GET",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L593-L616 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.cancel | def cancel(self, client=None):
"""API call: cancel job via a POST request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/cancel
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use... | python | def cancel(self, client=None):
"""API call: cancel job via a POST request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/cancel
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use... | [
"def",
"cancel",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"extra_params",
"=",
"{",
"}",
"if",
"self",
".",
"location",
":",
"extra_params",
"[",
"\"location\"",
"]",
"=",
"se... | API call: cancel job via a POST request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/cancel
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
... | [
"API",
"call",
":",
"cancel",
"job",
"via",
"a",
"POST",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L618-L644 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob._set_future_result | def _set_future_result(self):
"""Set the result or exception from the job if it is complete."""
# This must be done in a lock to prevent the polling thread
# and main thread from both executing the completion logic
# at the same time.
with self._completion_lock:
# If ... | python | def _set_future_result(self):
"""Set the result or exception from the job if it is complete."""
# This must be done in a lock to prevent the polling thread
# and main thread from both executing the completion logic
# at the same time.
with self._completion_lock:
# If ... | [
"def",
"_set_future_result",
"(",
"self",
")",
":",
"# This must be done in a lock to prevent the polling thread",
"# and main thread from both executing the completion logic",
"# at the same time.",
"with",
"self",
".",
"_completion_lock",
":",
"# If the operation isn't complete or if t... | Set the result or exception from the job if it is complete. | [
"Set",
"the",
"result",
"or",
"exception",
"from",
"the",
"job",
"if",
"it",
"is",
"complete",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L651-L668 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.done | def done(self, retry=DEFAULT_RETRY):
"""Refresh the job and checks if it is complete.
:type retry: :class:`google.api_core.retry.Retry`
:param retry: (Optional) How to retry the RPC.
:rtype: bool
:returns: True if the job is complete, False otherwise.
"""
# Do n... | python | def done(self, retry=DEFAULT_RETRY):
"""Refresh the job and checks if it is complete.
:type retry: :class:`google.api_core.retry.Retry`
:param retry: (Optional) How to retry the RPC.
:rtype: bool
:returns: True if the job is complete, False otherwise.
"""
# Do n... | [
"def",
"done",
"(",
"self",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"# Do not refresh is the state is already done, as the job will not",
"# change once complete.",
"if",
"self",
".",
"state",
"!=",
"_DONE_STATE",
":",
"self",
".",
"reload",
"(",
"retry",
"=",
... | Refresh the job and checks if it is complete.
:type retry: :class:`google.api_core.retry.Retry`
:param retry: (Optional) How to retry the RPC.
:rtype: bool
:returns: True if the job is complete, False otherwise. | [
"Refresh",
"the",
"job",
"and",
"checks",
"if",
"it",
"is",
"complete",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L670-L683 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _AsyncJob.result | def result(self, timeout=None, retry=DEFAULT_RETRY):
"""Start the job and wait for it to complete and get the result.
:type timeout: float
:param timeout:
How long (in seconds) to wait for job to complete before raising
a :class:`concurrent.futures.TimeoutError`.
... | python | def result(self, timeout=None, retry=DEFAULT_RETRY):
"""Start the job and wait for it to complete and get the result.
:type timeout: float
:param timeout:
How long (in seconds) to wait for job to complete before raising
a :class:`concurrent.futures.TimeoutError`.
... | [
"def",
"result",
"(",
"self",
",",
"timeout",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"if",
"self",
".",
"state",
"is",
"None",
":",
"self",
".",
"_begin",
"(",
"retry",
"=",
"retry",
")",
"# TODO: modify PollingFuture so it can pass a ret... | Start the job and wait for it to complete and get the result.
:type timeout: float
:param timeout:
How long (in seconds) to wait for job to complete before raising
a :class:`concurrent.futures.TimeoutError`.
:type retry: :class:`google.api_core.retry.Retry`
:par... | [
"Start",
"the",
"job",
"and",
"wait",
"for",
"it",
"to",
"complete",
"and",
"get",
"the",
"result",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L685-L707 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _JobConfig._get_sub_prop | def _get_sub_prop(self, key, default=None):
"""Get a value in the ``self._properties[self._job_type]`` dictionary.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to access
those properties::
s... | python | def _get_sub_prop(self, key, default=None):
"""Get a value in the ``self._properties[self._job_type]`` dictionary.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to access
those properties::
s... | [
"def",
"_get_sub_prop",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"return",
"_helpers",
".",
"_get_sub_prop",
"(",
"self",
".",
"_properties",
",",
"[",
"self",
".",
"_job_type",
",",
"key",
"]",
",",
"default",
"=",
"default",
")... | Get a value in the ``self._properties[self._job_type]`` dictionary.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to access
those properties::
self._get_sub_prop('destinationTable')
This is ... | [
"Get",
"a",
"value",
"in",
"the",
"self",
".",
"_properties",
"[",
"self",
".",
"_job_type",
"]",
"dictionary",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L757-L784 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _JobConfig._set_sub_prop | def _set_sub_prop(self, key, value):
"""Set a value in the ``self._properties[self._job_type]`` dictionary.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to set
those properties::
self._set_s... | python | def _set_sub_prop(self, key, value):
"""Set a value in the ``self._properties[self._job_type]`` dictionary.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to set
those properties::
self._set_s... | [
"def",
"_set_sub_prop",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"_helpers",
".",
"_set_sub_prop",
"(",
"self",
".",
"_properties",
",",
"[",
"self",
".",
"_job_type",
",",
"key",
"]",
",",
"value",
")"
] | Set a value in the ``self._properties[self._job_type]`` dictionary.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to set
those properties::
self._set_sub_prop('useLegacySql', False)
This is ... | [
"Set",
"a",
"value",
"in",
"the",
"self",
".",
"_properties",
"[",
"self",
".",
"_job_type",
"]",
"dictionary",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L786-L806 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _JobConfig._del_sub_prop | def _del_sub_prop(self, key):
"""Remove ``key`` from the ``self._properties[self._job_type]`` dict.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to clear
those properties::
self._del_sub_pro... | python | def _del_sub_prop(self, key):
"""Remove ``key`` from the ``self._properties[self._job_type]`` dict.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to clear
those properties::
self._del_sub_pro... | [
"def",
"_del_sub_prop",
"(",
"self",
",",
"key",
")",
":",
"_helpers",
".",
"_del_sub_prop",
"(",
"self",
".",
"_properties",
",",
"[",
"self",
".",
"_job_type",
",",
"key",
"]",
")"
] | Remove ``key`` from the ``self._properties[self._job_type]`` dict.
Most job properties are inside the dictionary related to the job type
(e.g. 'copy', 'extract', 'load', 'query'). Use this method to clear
those properties::
self._del_sub_prop('useLegacySql')
This is equiva... | [
"Remove",
"key",
"from",
"the",
"self",
".",
"_properties",
"[",
"self",
".",
"_job_type",
"]",
"dict",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L808-L827 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _JobConfig._fill_from_default | def _fill_from_default(self, default_job_config):
"""Merge this job config with a default job config.
The keys in this object take precedence over the keys in the default
config. The merge is done at the top-level as well as for keys one
level below the job type.
Arguments:
... | python | def _fill_from_default(self, default_job_config):
"""Merge this job config with a default job config.
The keys in this object take precedence over the keys in the default
config. The merge is done at the top-level as well as for keys one
level below the job type.
Arguments:
... | [
"def",
"_fill_from_default",
"(",
"self",
",",
"default_job_config",
")",
":",
"if",
"self",
".",
"_job_type",
"!=",
"default_job_config",
".",
"_job_type",
":",
"raise",
"TypeError",
"(",
"\"attempted to merge two incompatible job types: \"",
"+",
"repr",
"(",
"self"... | Merge this job config with a default job config.
The keys in this object take precedence over the keys in the default
config. The merge is done at the top-level as well as for keys one
level below the job type.
Arguments:
default_job_config (google.cloud.bigquery.job._JobCo... | [
"Merge",
"this",
"job",
"config",
"with",
"a",
"default",
"job",
"config",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L837-L869 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | _JobConfig.from_api_repr | def from_api_repr(cls, resource):
"""Factory: construct a job configuration given its API representation
:type resource: dict
:param resource:
An extract job configuration in the same representation as is
returned from the API.
:rtype: :class:`google.cloud.bigqu... | python | def from_api_repr(cls, resource):
"""Factory: construct a job configuration given its API representation
:type resource: dict
:param resource:
An extract job configuration in the same representation as is
returned from the API.
:rtype: :class:`google.cloud.bigqu... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"config",
"=",
"cls",
"(",
")",
"config",
".",
"_properties",
"=",
"copy",
".",
"deepcopy",
"(",
"resource",
")",
"return",
"config"
] | Factory: construct a job configuration given its API representation
:type resource: dict
:param resource:
An extract job configuration in the same representation as is
returned from the API.
:rtype: :class:`google.cloud.bigquery.job._JobConfig`
:returns: Configu... | [
"Factory",
":",
"construct",
"a",
"job",
"configuration",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L872-L885 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | LoadJobConfig.destination_encryption_configuration | def destination_encryption_configuration(self):
"""google.cloud.bigquery.table.EncryptionConfiguration: Custom
encryption configuration for the destination table.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
if using default encryption.
See
htt... | python | def destination_encryption_configuration(self):
"""google.cloud.bigquery.table.EncryptionConfiguration: Custom
encryption configuration for the destination table.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
if using default encryption.
See
htt... | [
"def",
"destination_encryption_configuration",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_get_sub_prop",
"(",
"\"destinationEncryptionConfiguration\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"EncryptionConfiguration",
".",
"from_api_repr",
... | google.cloud.bigquery.table.EncryptionConfiguration: Custom
encryption configuration for the destination table.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
if using default encryption.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#... | [
"google",
".",
"cloud",
".",
"bigquery",
".",
"table",
".",
"EncryptionConfiguration",
":",
"Custom",
"encryption",
"configuration",
"for",
"the",
"destination",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L981-L994 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | LoadJobConfig.schema | def schema(self):
"""List[google.cloud.bigquery.schema.SchemaField]: Schema of the
destination table.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.load.schema
"""
schema = _helpers._get_sub_prop(self._properties, ["load", "schema", "fie... | python | def schema(self):
"""List[google.cloud.bigquery.schema.SchemaField]: Schema of the
destination table.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.load.schema
"""
schema = _helpers._get_sub_prop(self._properties, ["load", "schema", "fie... | [
"def",
"schema",
"(",
"self",
")",
":",
"schema",
"=",
"_helpers",
".",
"_get_sub_prop",
"(",
"self",
".",
"_properties",
",",
"[",
"\"load\"",
",",
"\"schema\"",
",",
"\"fields\"",
"]",
")",
"if",
"schema",
"is",
"None",
":",
"return",
"return",
"[",
... | List[google.cloud.bigquery.schema.SchemaField]: Schema of the
destination table.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.load.schema | [
"List",
"[",
"google",
".",
"cloud",
".",
"bigquery",
".",
"schema",
".",
"SchemaField",
"]",
":",
"Schema",
"of",
"the",
"destination",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1123-L1133 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | LoadJobConfig.time_partitioning | def time_partitioning(self):
"""google.cloud.bigquery.table.TimePartitioning: Specifies time-based
partitioning for the destination table.
"""
prop = self._get_sub_prop("timePartitioning")
if prop is not None:
prop = TimePartitioning.from_api_repr(prop)
return... | python | def time_partitioning(self):
"""google.cloud.bigquery.table.TimePartitioning: Specifies time-based
partitioning for the destination table.
"""
prop = self._get_sub_prop("timePartitioning")
if prop is not None:
prop = TimePartitioning.from_api_repr(prop)
return... | [
"def",
"time_partitioning",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_get_sub_prop",
"(",
"\"timePartitioning\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"TimePartitioning",
".",
"from_api_repr",
"(",
"prop",
")",
"return",
"prop"
... | google.cloud.bigquery.table.TimePartitioning: Specifies time-based
partitioning for the destination table. | [
"google",
".",
"cloud",
".",
"bigquery",
".",
"table",
".",
"TimePartitioning",
":",
"Specifies",
"time",
"-",
"based",
"partitioning",
"for",
"the",
"destination",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1184-L1191 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | LoadJob.to_api_repr | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
configuration = self._configuration.to_api_repr()
if self.source_uris is not None:
_helpers._set_sub_prop(
configuration, ["load", "sourceUris"], self.source_uris
)
_helpers._set_... | python | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
configuration = self._configuration.to_api_repr()
if self.source_uris is not None:
_helpers._set_sub_prop(
configuration, ["load", "sourceUris"], self.source_uris
)
_helpers._set_... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"configuration",
"=",
"self",
".",
"_configuration",
".",
"to_api_repr",
"(",
")",
"if",
"self",
".",
"source_uris",
"is",
"not",
"None",
":",
"_helpers",
".",
"_set_sub_prop",
"(",
"configuration",
",",
"[",
"\... | Generate a resource for :meth:`_begin`. | [
"Generate",
"a",
"resource",
"for",
":",
"meth",
":",
"_begin",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1482-L1496 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | LoadJob.from_api_repr | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation ... | python | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation ... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"config_resource",
"=",
"resource",
".",
"get",
"(",
"\"configuration\"",
",",
"{",
"}",
")",
"config",
"=",
"LoadJobConfig",
".",
"from_api_repr",
"(",
"config_resource",
")",
"# ... | Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation returned from the API
:type client: :class:`... | [
"Factory",
":",
"construct",
"a",
"job",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1503-L1532 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | CopyJob.to_api_repr | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
source_refs = [
{
"projectId": table.project,
"datasetId": table.dataset_id,
"tableId": table.table_id,
}
for table in self.sources
]
... | python | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
source_refs = [
{
"projectId": table.project,
"datasetId": table.dataset_id,
"tableId": table.table_id,
}
for table in self.sources
]
... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"source_refs",
"=",
"[",
"{",
"\"projectId\"",
":",
"table",
".",
"project",
",",
"\"datasetId\"",
":",
"table",
".",
"dataset_id",
",",
"\"tableId\"",
":",
"table",
".",
"table_id",
",",
"}",
"for",
"table",
... | Generate a resource for :meth:`_begin`. | [
"Generate",
"a",
"resource",
"for",
":",
"meth",
":",
"_begin",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1658-L1685 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | CopyJob.from_api_repr | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation ... | python | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation ... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"job_id",
",",
"config_resource",
"=",
"cls",
".",
"_get_resource_config",
"(",
"resource",
")",
"config",
"=",
"CopyJobConfig",
".",
"from_api_repr",
"(",
"config_resource",
")",
"#... | Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation returned from the API
:type client: :class:`... | [
"Factory",
":",
"construct",
"a",
"job",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1692-L1727 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | ExtractJob.destination_uri_file_counts | def destination_uri_file_counts(self):
"""Return file counts from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.extract.destinationUriFileCounts
Returns:
a list of integer counts, each representing the number of fi... | python | def destination_uri_file_counts(self):
"""Return file counts from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.extract.destinationUriFileCounts
Returns:
a list of integer counts, each representing the number of fi... | [
"def",
"destination_uri_file_counts",
"(",
"self",
")",
":",
"counts",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"destinationUriFileCounts\"",
")",
"if",
"counts",
"is",
"not",
"None",
":",
"return",
"[",
"int",
"(",
"count",
")",
"... | Return file counts from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.extract.destinationUriFileCounts
Returns:
a list of integer counts, each representing the number of files
per destination URI or URI pattern... | [
"Return",
"file",
"counts",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1859-L1875 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | ExtractJob.to_api_repr | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
source_ref = {
"projectId": self.source.project,
"datasetId": self.source.dataset_id,
"tableId": self.source.table_id,
}
configuration = self._configuration.to_api_repr()
_h... | python | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
source_ref = {
"projectId": self.source.project,
"datasetId": self.source.dataset_id,
"tableId": self.source.table_id,
}
configuration = self._configuration.to_api_repr()
_h... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"source_ref",
"=",
"{",
"\"projectId\"",
":",
"self",
".",
"source",
".",
"project",
",",
"\"datasetId\"",
":",
"self",
".",
"source",
".",
"dataset_id",
",",
"\"tableId\"",
":",
"self",
".",
"source",
".",
"t... | Generate a resource for :meth:`_begin`. | [
"Generate",
"a",
"resource",
"for",
":",
"meth",
":",
"_begin",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1877-L1895 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | ExtractJob.from_api_repr | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation ... | python | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation ... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"job_id",
",",
"config_resource",
"=",
"cls",
".",
"_get_resource_config",
"(",
"resource",
")",
"config",
"=",
"ExtractJobConfig",
".",
"from_api_repr",
"(",
"config_resource",
")",
... | Factory: construct a job given its API representation
.. note:
This method assumes that the project found in the resource matches
the client's project.
:type resource: dict
:param resource: dataset job representation returned from the API
:type client: :class:`... | [
"Factory",
":",
"construct",
"a",
"job",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L1902-L1935 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJobConfig.default_dataset | def default_dataset(self):
"""google.cloud.bigquery.dataset.DatasetReference: the default dataset
to use for unqualified table names in the query or :data:`None` if not
set.
The ``default_dataset`` setter accepts:
- a :class:`~google.cloud.bigquery.dataset.Dataset`, or
... | python | def default_dataset(self):
"""google.cloud.bigquery.dataset.DatasetReference: the default dataset
to use for unqualified table names in the query or :data:`None` if not
set.
The ``default_dataset`` setter accepts:
- a :class:`~google.cloud.bigquery.dataset.Dataset`, or
... | [
"def",
"default_dataset",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_get_sub_prop",
"(",
"\"defaultDataset\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"DatasetReference",
".",
"from_api_repr",
"(",
"prop",
")",
"return",
"prop"
] | google.cloud.bigquery.dataset.DatasetReference: the default dataset
to use for unqualified table names in the query or :data:`None` if not
set.
The ``default_dataset`` setter accepts:
- a :class:`~google.cloud.bigquery.dataset.Dataset`, or
- a :class:`~google.cloud.bigquery.dat... | [
"google",
".",
"cloud",
".",
"bigquery",
".",
"dataset",
".",
"DatasetReference",
":",
"the",
"default",
"dataset",
"to",
"use",
"for",
"unqualified",
"table",
"names",
"in",
"the",
"query",
"or",
":",
"data",
":",
"None",
"if",
"not",
"set",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2028-L2047 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJobConfig.destination | def destination(self):
"""google.cloud.bigquery.table.TableReference: table where results are
written or :data:`None` if not set.
The ``destination`` setter accepts:
- a :class:`~google.cloud.bigquery.table.Table`, or
- a :class:`~google.cloud.bigquery.table.TableReference`, or... | python | def destination(self):
"""google.cloud.bigquery.table.TableReference: table where results are
written or :data:`None` if not set.
The ``destination`` setter accepts:
- a :class:`~google.cloud.bigquery.table.Table`, or
- a :class:`~google.cloud.bigquery.table.TableReference`, or... | [
"def",
"destination",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_get_sub_prop",
"(",
"\"destinationTable\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"TableReference",
".",
"from_api_repr",
"(",
"prop",
")",
"return",
"prop"
] | google.cloud.bigquery.table.TableReference: table where results are
written or :data:`None` if not set.
The ``destination`` setter accepts:
- a :class:`~google.cloud.bigquery.table.Table`, or
- a :class:`~google.cloud.bigquery.table.TableReference`, or
- a :class:`str` of the f... | [
"google",
".",
"cloud",
".",
"bigquery",
".",
"table",
".",
"TableReference",
":",
"table",
"where",
"results",
"are",
"written",
"or",
":",
"data",
":",
"None",
"if",
"not",
"set",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2065-L2084 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJobConfig.table_definitions | def table_definitions(self):
"""Dict[str, google.cloud.bigquery.external_config.ExternalConfig]:
Definitions for external tables or :data:`None` if not set.
See
https://g.co/cloud/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions
"""
prop = self._... | python | def table_definitions(self):
"""Dict[str, google.cloud.bigquery.external_config.ExternalConfig]:
Definitions for external tables or :data:`None` if not set.
See
https://g.co/cloud/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions
"""
prop = self._... | [
"def",
"table_definitions",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_get_sub_prop",
"(",
"\"tableDefinitions\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"_from_api_repr_table_defs",
"(",
"prop",
")",
"return",
"prop"
] | Dict[str, google.cloud.bigquery.external_config.ExternalConfig]:
Definitions for external tables or :data:`None` if not set.
See
https://g.co/cloud/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions | [
"Dict",
"[",
"str",
"google",
".",
"cloud",
".",
"bigquery",
".",
"external_config",
".",
"ExternalConfig",
"]",
":",
"Definitions",
"for",
"external",
"tables",
"or",
":",
"data",
":",
"None",
"if",
"not",
"set",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2238-L2248 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJobConfig.to_api_repr | def to_api_repr(self):
"""Build an API representation of the query job config.
Returns:
dict: A dictionary in the format used by the BigQuery API.
"""
resource = copy.deepcopy(self._properties)
# Query parameters have an addition property associated with them
... | python | def to_api_repr(self):
"""Build an API representation of the query job config.
Returns:
dict: A dictionary in the format used by the BigQuery API.
"""
resource = copy.deepcopy(self._properties)
# Query parameters have an addition property associated with them
... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"resource",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"_properties",
")",
"# Query parameters have an addition property associated with them",
"# to indicate if the query is using named or positional parameters.",
"query_paramete... | Build an API representation of the query job config.
Returns:
dict: A dictionary in the format used by the BigQuery API. | [
"Build",
"an",
"API",
"representation",
"of",
"the",
"query",
"job",
"config",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2311-L2328 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.to_api_repr | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
configuration = self._configuration.to_api_repr()
resource = {
"jobReference": self._properties["jobReference"],
"configuration": configuration,
}
configuration["query"]["query"] = self.... | python | def to_api_repr(self):
"""Generate a resource for :meth:`_begin`."""
configuration = self._configuration.to_api_repr()
resource = {
"jobReference": self._properties["jobReference"],
"configuration": configuration,
}
configuration["query"]["query"] = self.... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"configuration",
"=",
"self",
".",
"_configuration",
".",
"to_api_repr",
"(",
")",
"resource",
"=",
"{",
"\"jobReference\"",
":",
"self",
".",
"_properties",
"[",
"\"jobReference\"",
"]",
",",
"\"configuration\"",
"... | Generate a resource for :meth:`_begin`. | [
"Generate",
"a",
"resource",
"for",
":",
"meth",
":",
"_begin",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2518-L2528 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.from_api_repr | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
:type resource: dict
:param resource: dataset job representation returned from the API
:type client: :class:`google.cloud.bigquery.client.Client`
:param client: Client which hold... | python | def from_api_repr(cls, resource, client):
"""Factory: construct a job given its API representation
:type resource: dict
:param resource: dataset job representation returned from the API
:type client: :class:`google.cloud.bigquery.client.Client`
:param client: Client which hold... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"job_id",
",",
"config",
"=",
"cls",
".",
"_get_resource_config",
"(",
"resource",
")",
"query",
"=",
"config",
"[",
"\"query\"",
"]",
"[",
"\"query\"",
"]",
"job",
"=",
"cls",... | Factory: construct a job given its API representation
:type resource: dict
:param resource: dataset job representation returned from the API
:type client: :class:`google.cloud.bigquery.client.Client`
:param client: Client which holds credentials and project
conf... | [
"Factory",
":",
"construct",
"a",
"job",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2535-L2552 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.query_plan | def query_plan(self):
"""Return query plan from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.queryPlan
:rtype: list of :class:`QueryPlanEntry`
:returns: mappings describing the query plan, or an empty list
... | python | def query_plan(self):
"""Return query plan from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.queryPlan
:rtype: list of :class:`QueryPlanEntry`
:returns: mappings describing the query plan, or an empty list
... | [
"def",
"query_plan",
"(",
"self",
")",
":",
"plan_entries",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"queryPlan\"",
",",
"(",
")",
")",
"return",
"[",
"QueryPlanEntry",
".",
"from_api_repr",
"(",
"entry",
")",
"for",
"entry",
"in... | Return query plan from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.queryPlan
:rtype: list of :class:`QueryPlanEntry`
:returns: mappings describing the query plan, or an empty list
if the query has not... | [
"Return",
"query",
"plan",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2555-L2566 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.timeline | def timeline(self):
"""List(TimelineEntry): Return the query execution timeline
from job statistics.
"""
raw = self._job_statistics().get("timeline", ())
return [TimelineEntry.from_api_repr(entry) for entry in raw] | python | def timeline(self):
"""List(TimelineEntry): Return the query execution timeline
from job statistics.
"""
raw = self._job_statistics().get("timeline", ())
return [TimelineEntry.from_api_repr(entry) for entry in raw] | [
"def",
"timeline",
"(",
"self",
")",
":",
"raw",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"timeline\"",
",",
"(",
")",
")",
"return",
"[",
"TimelineEntry",
".",
"from_api_repr",
"(",
"entry",
")",
"for",
"entry",
"in",
"raw",
... | List(TimelineEntry): Return the query execution timeline
from job statistics. | [
"List",
"(",
"TimelineEntry",
")",
":",
"Return",
"the",
"query",
"execution",
"timeline",
"from",
"job",
"statistics",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2569-L2574 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.total_bytes_processed | def total_bytes_processed(self):
"""Return total bytes processed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesProcessed
:rtype: int or None
:returns: total bytes processed by the job, or None if j... | python | def total_bytes_processed(self):
"""Return total bytes processed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesProcessed
:rtype: int or None
:returns: total bytes processed by the job, or None if j... | [
"def",
"total_bytes_processed",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"totalBytesProcessed\"",
")",
"if",
"result",
"is",
"not",
"None",
":",
"result",
"=",
"int",
"(",
"result",
")",
"return",
... | Return total bytes processed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesProcessed
:rtype: int or None
:returns: total bytes processed by the job, or None if job is not
yet complete. | [
"Return",
"total",
"bytes",
"processed",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2577-L2590 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.total_bytes_billed | def total_bytes_billed(self):
"""Return total bytes billed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesBilled
:rtype: int or None
:returns: total bytes processed by the job, or None if job is not... | python | def total_bytes_billed(self):
"""Return total bytes billed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesBilled
:rtype: int or None
:returns: total bytes processed by the job, or None if job is not... | [
"def",
"total_bytes_billed",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"totalBytesBilled\"",
")",
"if",
"result",
"is",
"not",
"None",
":",
"result",
"=",
"int",
"(",
"result",
")",
"return",
"resu... | Return total bytes billed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesBilled
:rtype: int or None
:returns: total bytes processed by the job, or None if job is not
yet complete. | [
"Return",
"total",
"bytes",
"billed",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2593-L2606 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.ddl_target_table | def ddl_target_table(self):
"""Optional[TableReference]: Return the DDL target table, present
for CREATE/DROP TABLE/VIEW queries.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.ddlTargetTable
"""
prop = self._job_statistics().get(... | python | def ddl_target_table(self):
"""Optional[TableReference]: Return the DDL target table, present
for CREATE/DROP TABLE/VIEW queries.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.ddlTargetTable
"""
prop = self._job_statistics().get(... | [
"def",
"ddl_target_table",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"ddlTargetTable\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"TableReference",
".",
"from_api_repr",
"(",
"prop",
... | Optional[TableReference]: Return the DDL target table, present
for CREATE/DROP TABLE/VIEW queries.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.ddlTargetTable | [
"Optional",
"[",
"TableReference",
"]",
":",
"Return",
"the",
"DDL",
"target",
"table",
"present",
"for",
"CREATE",
"/",
"DROP",
"TABLE",
"/",
"VIEW",
"queries",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2645-L2655 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.num_dml_affected_rows | def num_dml_affected_rows(self):
"""Return the number of DML rows affected by the job.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.numDmlAffectedRows
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is ... | python | def num_dml_affected_rows(self):
"""Return the number of DML rows affected by the job.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.numDmlAffectedRows
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is ... | [
"def",
"num_dml_affected_rows",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"numDmlAffectedRows\"",
")",
"if",
"result",
"is",
"not",
"None",
":",
"result",
"=",
"int",
"(",
"result",
")",
"return",
... | Return the number of DML rows affected by the job.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.numDmlAffectedRows
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is not
yet complete. | [
"Return",
"the",
"number",
"of",
"DML",
"rows",
"affected",
"by",
"the",
"job",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2658-L2671 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.referenced_tables | def referenced_tables(self):
"""Return referenced tables from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.referencedTables
:rtype: list of dict
:returns: mappings describing the query plan, or an empty list
... | python | def referenced_tables(self):
"""Return referenced tables from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.referencedTables
:rtype: list of dict
:returns: mappings describing the query plan, or an empty list
... | [
"def",
"referenced_tables",
"(",
"self",
")",
":",
"tables",
"=",
"[",
"]",
"datasets_by_project_name",
"=",
"{",
"}",
"for",
"table",
"in",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"referencedTables\"",
",",
"(",
")",
")",
":",
"t_pr... | Return referenced tables from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.referencedTables
:rtype: list of dict
:returns: mappings describing the query plan, or an empty list
if the query has not yet ... | [
"Return",
"referenced",
"tables",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2692-L2718 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.undeclared_query_parameters | def undeclared_query_parameters(self):
"""Return undeclared query parameters from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.undeclaredQueryParameters
:rtype:
list of
:class:`~google.cloud.bigq... | python | def undeclared_query_parameters(self):
"""Return undeclared query parameters from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.undeclaredQueryParameters
:rtype:
list of
:class:`~google.cloud.bigq... | [
"def",
"undeclared_query_parameters",
"(",
"self",
")",
":",
"parameters",
"=",
"[",
"]",
"undeclared",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"undeclaredQueryParameters\"",
",",
"(",
")",
")",
"for",
"parameter",
"in",
"undeclared",... | Return undeclared query parameters from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.undeclaredQueryParameters
:rtype:
list of
:class:`~google.cloud.bigquery.ArrayQueryParameter`,
:class:`~go... | [
"Return",
"undeclared",
"query",
"parameters",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2721-L2750 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.estimated_bytes_processed | def estimated_bytes_processed(self):
"""Return the estimated number of bytes processed by the query.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.estimatedBytesProcessed
:rtype: int or None
:returns: number of DML rows affected by the job,... | python | def estimated_bytes_processed(self):
"""Return the estimated number of bytes processed by the query.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.estimatedBytesProcessed
:rtype: int or None
:returns: number of DML rows affected by the job,... | [
"def",
"estimated_bytes_processed",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"estimatedBytesProcessed\"",
")",
"if",
"result",
"is",
"not",
"None",
":",
"result",
"=",
"int",
"(",
"result",
")",
"re... | Return the estimated number of bytes processed by the query.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.estimatedBytesProcessed
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is not
yet com... | [
"Return",
"the",
"estimated",
"number",
"of",
"bytes",
"processed",
"by",
"the",
"query",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2753-L2766 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.done | def done(self, retry=DEFAULT_RETRY):
"""Refresh the job and checks if it is complete.
:rtype: bool
:returns: True if the job is complete, False otherwise.
"""
# Since the API to getQueryResults can hang up to the timeout value
# (default of 10 seconds), set the timeout p... | python | def done(self, retry=DEFAULT_RETRY):
"""Refresh the job and checks if it is complete.
:rtype: bool
:returns: True if the job is complete, False otherwise.
"""
# Since the API to getQueryResults can hang up to the timeout value
# (default of 10 seconds), set the timeout p... | [
"def",
"done",
"(",
"self",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"# Since the API to getQueryResults can hang up to the timeout value",
"# (default of 10 seconds), set the timeout parameter to ensure that",
"# the timeout from the futures API is respected. See:",
"# https://github... | Refresh the job and checks if it is complete.
:rtype: bool
:returns: True if the job is complete, False otherwise. | [
"Refresh",
"the",
"job",
"and",
"checks",
"if",
"it",
"is",
"complete",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2768-L2804 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.result | def result(self, timeout=None, retry=DEFAULT_RETRY):
"""Start the job and wait for it to complete and get the result.
:type timeout: float
:param timeout:
How long (in seconds) to wait for job to complete before raising
a :class:`concurrent.futures.TimeoutError`.
... | python | def result(self, timeout=None, retry=DEFAULT_RETRY):
"""Start the job and wait for it to complete and get the result.
:type timeout: float
:param timeout:
How long (in seconds) to wait for job to complete before raising
a :class:`concurrent.futures.TimeoutError`.
... | [
"def",
"result",
"(",
"self",
",",
"timeout",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"super",
"(",
"QueryJob",
",",
"self",
")",
".",
"result",
"(",
"timeout",
"=",
"timeout",
")",
"# Return an iterator instead of returning the job.",
"if",... | Start the job and wait for it to complete and get the result.
:type timeout: float
:param timeout:
How long (in seconds) to wait for job to complete before raising
a :class:`concurrent.futures.TimeoutError`.
:type retry: :class:`google.api_core.retry.Retry`
:par... | [
"Start",
"the",
"job",
"and",
"wait",
"for",
"it",
"to",
"complete",
"and",
"get",
"the",
"result",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2810-L2852 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.to_dataframe | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Return a pandas DataFrame from a QueryJob
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Alpha Feature** Optional... | python | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Return a pandas DataFrame from a QueryJob
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Alpha Feature** Optional... | [
"def",
"to_dataframe",
"(",
"self",
",",
"bqstorage_client",
"=",
"None",
",",
"dtypes",
"=",
"None",
",",
"progress_bar_type",
"=",
"None",
")",
":",
"return",
"self",
".",
"result",
"(",
")",
".",
"to_dataframe",
"(",
"bqstorage_client",
"=",
"bqstorage_cl... | Return a pandas DataFrame from a QueryJob
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Alpha Feature** Optional. A BigQuery Storage API client. If
supplied, use the faster BigQuery Storage A... | [
"Return",
"a",
"pandas",
"DataFrame",
"from",
"a",
"QueryJob"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2854-L2904 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryPlanEntryStep.from_api_repr | def from_api_repr(cls, resource):
"""Factory: construct instance from the JSON repr.
:type resource: dict
:param resource: JSON representation of the entry
:rtype: :class:`QueryPlanEntryStep`
:return: new instance built from the resource
"""
return cls(kind=reso... | python | def from_api_repr(cls, resource):
"""Factory: construct instance from the JSON repr.
:type resource: dict
:param resource: JSON representation of the entry
:rtype: :class:`QueryPlanEntryStep`
:return: new instance built from the resource
"""
return cls(kind=reso... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"return",
"cls",
"(",
"kind",
"=",
"resource",
".",
"get",
"(",
"\"kind\"",
")",
",",
"substeps",
"=",
"resource",
".",
"get",
"(",
"\"substeps\"",
",",
"(",
")",
")",
")"
] | Factory: construct instance from the JSON repr.
:type resource: dict
:param resource: JSON representation of the entry
:rtype: :class:`QueryPlanEntryStep`
:return: new instance built from the resource | [
"Factory",
":",
"construct",
"instance",
"from",
"the",
"JSON",
"repr",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2925-L2934 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryPlanEntry.start | def start(self):
"""Union[Datetime, None]: Datetime when the stage started."""
if self._properties.get("startMs") is None:
return None
return _helpers._datetime_from_microseconds(
int(self._properties.get("startMs")) * 1000.0
) | python | def start(self):
"""Union[Datetime, None]: Datetime when the stage started."""
if self._properties.get("startMs") is None:
return None
return _helpers._datetime_from_microseconds(
int(self._properties.get("startMs")) * 1000.0
) | [
"def",
"start",
"(",
"self",
")",
":",
"if",
"self",
".",
"_properties",
".",
"get",
"(",
"\"startMs\"",
")",
"is",
"None",
":",
"return",
"None",
"return",
"_helpers",
".",
"_datetime_from_microseconds",
"(",
"int",
"(",
"self",
".",
"_properties",
".",
... | Union[Datetime, None]: Datetime when the stage started. | [
"Union",
"[",
"Datetime",
"None",
"]",
":",
"Datetime",
"when",
"the",
"stage",
"started",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2981-L2987 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryPlanEntry.end | def end(self):
"""Union[Datetime, None]: Datetime when the stage ended."""
if self._properties.get("endMs") is None:
return None
return _helpers._datetime_from_microseconds(
int(self._properties.get("endMs")) * 1000.0
) | python | def end(self):
"""Union[Datetime, None]: Datetime when the stage ended."""
if self._properties.get("endMs") is None:
return None
return _helpers._datetime_from_microseconds(
int(self._properties.get("endMs")) * 1000.0
) | [
"def",
"end",
"(",
"self",
")",
":",
"if",
"self",
".",
"_properties",
".",
"get",
"(",
"\"endMs\"",
")",
"is",
"None",
":",
"return",
"None",
"return",
"_helpers",
".",
"_datetime_from_microseconds",
"(",
"int",
"(",
"self",
".",
"_properties",
".",
"ge... | Union[Datetime, None]: Datetime when the stage ended. | [
"Union",
"[",
"Datetime",
"None",
"]",
":",
"Datetime",
"when",
"the",
"stage",
"ended",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2990-L2996 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryPlanEntry.input_stages | def input_stages(self):
"""List(int): Entry IDs for stages that were inputs for this stage."""
if self._properties.get("inputStages") is None:
return []
return [
_helpers._int_or_none(entry)
for entry in self._properties.get("inputStages")
] | python | def input_stages(self):
"""List(int): Entry IDs for stages that were inputs for this stage."""
if self._properties.get("inputStages") is None:
return []
return [
_helpers._int_or_none(entry)
for entry in self._properties.get("inputStages")
] | [
"def",
"input_stages",
"(",
"self",
")",
":",
"if",
"self",
".",
"_properties",
".",
"get",
"(",
"\"inputStages\"",
")",
"is",
"None",
":",
"return",
"[",
"]",
"return",
"[",
"_helpers",
".",
"_int_or_none",
"(",
"entry",
")",
"for",
"entry",
"in",
"se... | List(int): Entry IDs for stages that were inputs for this stage. | [
"List",
"(",
"int",
")",
":",
"Entry",
"IDs",
"for",
"stages",
"that",
"were",
"inputs",
"for",
"this",
"stage",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2999-L3006 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | UnknownJob.from_api_repr | def from_api_repr(cls, resource, client):
"""Construct an UnknownJob from the JSON representation.
Args:
resource (dict): JSON representation of a job.
client (google.cloud.bigquery.client.Client):
Client connected to BigQuery API.
Returns:
U... | python | def from_api_repr(cls, resource, client):
"""Construct an UnknownJob from the JSON representation.
Args:
resource (dict): JSON representation of a job.
client (google.cloud.bigquery.client.Client):
Client connected to BigQuery API.
Returns:
U... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"job_ref_properties",
"=",
"resource",
".",
"get",
"(",
"\"jobReference\"",
",",
"{",
"\"projectId\"",
":",
"client",
".",
"project",
"}",
")",
"job_ref",
"=",
"_JobReference",
"."... | Construct an UnknownJob from the JSON representation.
Args:
resource (dict): JSON representation of a job.
client (google.cloud.bigquery.client.Client):
Client connected to BigQuery API.
Returns:
UnknownJob: Job corresponding to the resource. | [
"Construct",
"an",
"UnknownJob",
"from",
"the",
"JSON",
"representation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L3244-L3262 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.from_api_repr | def from_api_repr(cls, resource, client):
"""Factory: construct a zone given its API representation
:type resource: dict
:param resource: zone resource representation returned from the API
:type client: :class:`google.cloud.dns.client.Client`
:param client: Client which holds ... | python | def from_api_repr(cls, resource, client):
"""Factory: construct a zone given its API representation
:type resource: dict
:param resource: zone resource representation returned from the API
:type client: :class:`google.cloud.dns.client.Client`
:param client: Client which holds ... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"name",
"=",
"resource",
".",
"get",
"(",
"\"name\"",
")",
"dns_name",
"=",
"resource",
".",
"get",
"(",
"\"dnsName\"",
")",
"if",
"name",
"is",
"None",
"or",
"dns_name",
"is... | Factory: construct a zone given its API representation
:type resource: dict
:param resource: zone resource representation returned from the API
:type client: :class:`google.cloud.dns.client.Client`
:param client: Client which holds credentials and project
config... | [
"Factory",
":",
"construct",
"a",
"zone",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L60-L81 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.description | def description(self, value):
"""Update description of the zone.
:type value: str
:param value: (Optional) new description
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError("Pa... | python | def description(self, value):
"""Update description of the zone.
:type value: str
:param value: (Optional) new description
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError("Pa... | [
"def",
"description",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
"and",
"value",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Pass a string, or None\"",
")",
"self",
".",
... | Update description of the zone.
:type value: str
:param value: (Optional) new description
:raises: ValueError for invalid value types. | [
"Update",
"description",
"of",
"the",
"zone",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L138-L148 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.name_server_set | def name_server_set(self, value):
"""Update named set of DNS name servers.
:type value: str
:param value: (Optional) new title
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError... | python | def name_server_set(self, value):
"""Update named set of DNS name servers.
:type value: str
:param value: (Optional) new title
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError... | [
"def",
"name_server_set",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
"and",
"value",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Pass a string, or None\"",
")",
"self",
"... | Update named set of DNS name servers.
:type value: str
:param value: (Optional) new title
:raises: ValueError for invalid value types. | [
"Update",
"named",
"set",
"of",
"DNS",
"name",
"servers",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L165-L175 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.resource_record_set | def resource_record_set(self, name, record_type, ttl, rrdatas):
"""Construct a resource record set bound to this zone.
:type name: str
:param name: Name of the record set.
:type record_type: str
:param record_type: RR type
:type ttl: int
:param ttl: TTL for the... | python | def resource_record_set(self, name, record_type, ttl, rrdatas):
"""Construct a resource record set bound to this zone.
:type name: str
:param name: Name of the record set.
:type record_type: str
:param record_type: RR type
:type ttl: int
:param ttl: TTL for the... | [
"def",
"resource_record_set",
"(",
"self",
",",
"name",
",",
"record_type",
",",
"ttl",
",",
"rrdatas",
")",
":",
"return",
"ResourceRecordSet",
"(",
"name",
",",
"record_type",
",",
"ttl",
",",
"rrdatas",
",",
"zone",
"=",
"self",
")"
] | Construct a resource record set bound to this zone.
:type name: str
:param name: Name of the record set.
:type record_type: str
:param record_type: RR type
:type ttl: int
:param ttl: TTL for the RR, in seconds
:type rrdatas: list of string
:param rrdat... | [
"Construct",
"a",
"resource",
"record",
"set",
"bound",
"to",
"this",
"zone",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L177-L195 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone._set_properties | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
self._properties.clear()
cleaned = api_response.copy()
self.dns_name = cle... | python | def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call
"""
self._properties.clear()
cleaned = api_response.copy()
self.dns_name = cle... | [
"def",
"_set_properties",
"(",
"self",
",",
"api_response",
")",
":",
"self",
".",
"_properties",
".",
"clear",
"(",
")",
"cleaned",
"=",
"api_response",
".",
"copy",
"(",
")",
"self",
".",
"dns_name",
"=",
"cleaned",
".",
"pop",
"(",
"\"dnsName\"",
",",... | Update properties from resource in body of ``api_response``
:type api_response: dict
:param api_response: response returned from an API call | [
"Update",
"properties",
"from",
"resource",
"in",
"body",
"of",
"api_response"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L220-L231 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone._build_resource | def _build_resource(self):
"""Generate a resource for ``create`` or ``update``."""
resource = {"name": self.name}
if self.dns_name is not None:
resource["dnsName"] = self.dns_name
if self.description is not None:
resource["description"] = self.description
... | python | def _build_resource(self):
"""Generate a resource for ``create`` or ``update``."""
resource = {"name": self.name}
if self.dns_name is not None:
resource["dnsName"] = self.dns_name
if self.description is not None:
resource["description"] = self.description
... | [
"def",
"_build_resource",
"(",
"self",
")",
":",
"resource",
"=",
"{",
"\"name\"",
":",
"self",
".",
"name",
"}",
"if",
"self",
".",
"dns_name",
"is",
"not",
"None",
":",
"resource",
"[",
"\"dnsName\"",
"]",
"=",
"self",
".",
"dns_name",
"if",
"self",
... | Generate a resource for ``create`` or ``update``. | [
"Generate",
"a",
"resource",
"for",
"create",
"or",
"update",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L233-L246 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.create | def create(self, client=None):
"""API call: create the zone via a PUT request
See
https://cloud.google.com/dns/api/v1/managedZones/create
:type client: :class:`google.cloud.dns.client.Client`
:param client:
(Optional) the client to use. If not passed, falls back t... | python | def create(self, client=None):
"""API call: create the zone via a PUT request
See
https://cloud.google.com/dns/api/v1/managedZones/create
:type client: :class:`google.cloud.dns.client.Client`
:param client:
(Optional) the client to use. If not passed, falls back t... | [
"def",
"create",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"path",
"=",
"\"/projects/%s/managedZones\"",
"%",
"(",
"self",
".",
"project",
",",
")",
"api_response",
"=",
"client",
... | API call: create the zone via a PUT request
See
https://cloud.google.com/dns/api/v1/managedZones/create
:type client: :class:`google.cloud.dns.client.Client`
:param client:
(Optional) the client to use. If not passed, falls back to the
``client`` stored on the... | [
"API",
"call",
":",
"create",
"the",
"zone",
"via",
"a",
"PUT",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L248-L264 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.delete | def delete(self, client=None):
"""API call: delete the zone via a DELETE request
See
https://cloud.google.com/dns/api/v1/managedZones/delete
:type client: :class:`google.cloud.dns.client.Client`
:param client:
(Optional) the client to use. If not passed, falls bac... | python | def delete(self, client=None):
"""API call: delete the zone via a DELETE request
See
https://cloud.google.com/dns/api/v1/managedZones/delete
:type client: :class:`google.cloud.dns.client.Client`
:param client:
(Optional) the client to use. If not passed, falls bac... | [
"def",
"delete",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"client",
".",
"_connection",
".",
"api_request",
"(",
"method",
"=",
"\"DELETE\"",
",",
"path",
"=",
"self",
".",
"p... | API call: delete the zone via a DELETE request
See
https://cloud.google.com/dns/api/v1/managedZones/delete
:type client: :class:`google.cloud.dns.client.Client`
:param client:
(Optional) the client to use. If not passed, falls back to the
``client`` stored on ... | [
"API",
"call",
":",
"delete",
"the",
"zone",
"via",
"a",
"DELETE",
"request"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L305-L317 | train |
googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.list_resource_record_sets | def list_resource_record_sets(self, max_results=None, page_token=None, client=None):
"""List resource record sets for this zone.
See
https://cloud.google.com/dns/api/v1/resourceRecordSets/list
:type max_results: int
:param max_results: Optional. The maximum number of resource r... | python | def list_resource_record_sets(self, max_results=None, page_token=None, client=None):
"""List resource record sets for this zone.
See
https://cloud.google.com/dns/api/v1/resourceRecordSets/list
:type max_results: int
:param max_results: Optional. The maximum number of resource r... | [
"def",
"list_resource_record_sets",
"(",
"self",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"path",
"=",
"\"/projects/%s/managedZones... | List resource record sets for this zone.
See
https://cloud.google.com/dns/api/v1/resourceRecordSets/list
:type max_results: int
:param max_results: Optional. The maximum number of resource record
sets to return. Defaults to a sensible value
... | [
"List",
"resource",
"record",
"sets",
"for",
"this",
"zone",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L319-L358 | train |
googleapis/google-cloud-python | vision/google/cloud/vision_helpers/__init__.py | VisionHelpers.annotate_image | def annotate_image(self, request, retry=None, timeout=None):
"""Run image detection and annotation for an image.
Example:
>>> from google.cloud.vision_v1 import ImageAnnotatorClient
>>> client = ImageAnnotatorClient()
>>> request = {
... 'image': {
... | python | def annotate_image(self, request, retry=None, timeout=None):
"""Run image detection and annotation for an image.
Example:
>>> from google.cloud.vision_v1 import ImageAnnotatorClient
>>> client = ImageAnnotatorClient()
>>> request = {
... 'image': {
... | [
"def",
"annotate_image",
"(",
"self",
",",
"request",
",",
"retry",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"# If the image is a file handler, set the content.",
"image",
"=",
"protobuf",
".",
"get",
"(",
"request",
",",
"\"image\"",
")",
"if",
"ha... | Run image detection and annotation for an image.
Example:
>>> from google.cloud.vision_v1 import ImageAnnotatorClient
>>> client = ImageAnnotatorClient()
>>> request = {
... 'image': {
... 'source': {'image_uri': 'https://foo.com/image.jpg... | [
"Run",
"image",
"detection",
"and",
"annotation",
"for",
"an",
"image",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_helpers/__init__.py#L29-L73 | train |
googleapis/google-cloud-python | bigquery/samples/delete_model.py | delete_model | def delete_model(client, model_id):
"""Sample ID: go/samples-tracker/1534"""
# [START bigquery_delete_model]
from google.cloud import bigquery
# TODO(developer): Construct a BigQuery client object.
# client = bigquery.Client()
# TODO(developer): Set model_id to the ID of the model to fetch.
... | python | def delete_model(client, model_id):
"""Sample ID: go/samples-tracker/1534"""
# [START bigquery_delete_model]
from google.cloud import bigquery
# TODO(developer): Construct a BigQuery client object.
# client = bigquery.Client()
# TODO(developer): Set model_id to the ID of the model to fetch.
... | [
"def",
"delete_model",
"(",
"client",
",",
"model_id",
")",
":",
"# [START bigquery_delete_model]",
"from",
"google",
".",
"cloud",
"import",
"bigquery",
"# TODO(developer): Construct a BigQuery client object.",
"# client = bigquery.Client()",
"# TODO(developer): Set model_id to th... | Sample ID: go/samples-tracker/1534 | [
"Sample",
"ID",
":",
"go",
"/",
"samples",
"-",
"tracker",
"/",
"1534"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/samples/delete_model.py#L16-L29 | train |
googleapis/google-cloud-python | bigquery/samples/list_models.py | list_models | def list_models(client, dataset_id):
"""Sample ID: go/samples-tracker/1512"""
# [START bigquery_list_models]
from google.cloud import bigquery
# TODO(developer): Construct a BigQuery client object.
# client = bigquery.Client()
# TODO(developer): Set dataset_id to the ID of the dataset that co... | python | def list_models(client, dataset_id):
"""Sample ID: go/samples-tracker/1512"""
# [START bigquery_list_models]
from google.cloud import bigquery
# TODO(developer): Construct a BigQuery client object.
# client = bigquery.Client()
# TODO(developer): Set dataset_id to the ID of the dataset that co... | [
"def",
"list_models",
"(",
"client",
",",
"dataset_id",
")",
":",
"# [START bigquery_list_models]",
"from",
"google",
".",
"cloud",
"import",
"bigquery",
"# TODO(developer): Construct a BigQuery client object.",
"# client = bigquery.Client()",
"# TODO(developer): Set dataset_id to ... | Sample ID: go/samples-tracker/1512 | [
"Sample",
"ID",
":",
"go",
"/",
"samples",
"-",
"tracker",
"/",
"1512"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/samples/list_models.py#L16-L37 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.job_path | def job_path(cls, project, jobs):
"""Return a fully-qualified job string."""
return google.api_core.path_template.expand(
"projects/{project}/jobs/{jobs}", project=project, jobs=jobs
) | python | def job_path(cls, project, jobs):
"""Return a fully-qualified job string."""
return google.api_core.path_template.expand(
"projects/{project}/jobs/{jobs}", project=project, jobs=jobs
) | [
"def",
"job_path",
"(",
"cls",
",",
"project",
",",
"jobs",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/jobs/{jobs}\"",
",",
"project",
"=",
"project",
",",
"jobs",
"=",
"jobs",
")"
] | Return a fully-qualified job string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"job",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L92-L96 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.create_job | def create_job(
self,
parent,
job,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may tak... | python | def create_job(
self,
parent,
job,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may tak... | [
"def",
"create_job",
"(",
"self",
",",
"parent",
",",
"job",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
"... | Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may take
up to 5 minutes.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.JobServiceClient()
>>>
>>> parent = clie... | [
"Creates",
"a",
"new",
"job",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L197-L269 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.get_job | def get_job(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the specified job, whose status is OPEN or recently EXPIRED
within the last 90 days.
Examp... | python | def get_job(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the specified job, whose status is OPEN or recently EXPIRED
within the last 90 days.
Examp... | [
"def",
"get_job",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadata",
"... | Retrieves the specified job, whose status is OPEN or recently EXPIRED
within the last 90 days.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.JobServiceClient()
>>>
>>> name = client.job_path('[PROJECT]', ... | [
"Retrieves",
"the",
"specified",
"job",
"whose",
"status",
"is",
"OPEN",
"or",
"recently",
"EXPIRED",
"within",
"the",
"last",
"90",
"days",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L271-L331 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.batch_delete_jobs | def batch_delete_jobs(
self,
parent,
filter_,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a list of ``Job``\ s by filter.
Example:
>>> from google.cl... | python | def batch_delete_jobs(
self,
parent,
filter_,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a list of ``Job``\ s by filter.
Example:
>>> from google.cl... | [
"def",
"batch_delete_jobs",
"(",
"self",
",",
"parent",
",",
"filter_",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DE... | Deletes a list of ``Job``\ s by filter.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.JobServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>>
>>> # TODO: Initialize `filte... | [
"Deletes",
"a",
"list",
"of",
"Job",
"\\",
"s",
"by",
"filter",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L595-L668 | train |
googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.search_jobs | def search_jobs(
self,
parent,
request_metadata,
search_mode=None,
job_query=None,
enable_broadening=None,
require_precise_result_size=None,
histogram_queries=None,
job_view=None,
offset=None,
page_size=None,
order_by=None,
... | python | def search_jobs(
self,
parent,
request_metadata,
search_mode=None,
job_query=None,
enable_broadening=None,
require_precise_result_size=None,
histogram_queries=None,
job_view=None,
offset=None,
page_size=None,
order_by=None,
... | [
"def",
"search_jobs",
"(",
"self",
",",
"parent",
",",
"request_metadata",
",",
"search_mode",
"=",
"None",
",",
"job_query",
"=",
"None",
",",
"enable_broadening",
"=",
"None",
",",
"require_precise_result_size",
"=",
"None",
",",
"histogram_queries",
"=",
"Non... | Searches for jobs using the provided ``SearchJobsRequest``.
This call constrains the ``visibility`` of jobs present in the database,
and only returns jobs that the caller has permission to search against.
Example:
>>> from google.cloud import talent_v4beta1
>>>
... | [
"Searches",
"for",
"jobs",
"using",
"the",
"provided",
"SearchJobsRequest",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L670-L1024 | train |
googleapis/google-cloud-python | core/google/cloud/operation.py | _compute_type_url | def _compute_type_url(klass, prefix=_GOOGLE_APIS_PREFIX):
"""Compute a type URL for a klass.
:type klass: type
:param klass: class to be used as a factory for the given type
:type prefix: str
:param prefix: URL prefix for the type
:rtype: str
:returns: the URL, prefixed as appropriate
... | python | def _compute_type_url(klass, prefix=_GOOGLE_APIS_PREFIX):
"""Compute a type URL for a klass.
:type klass: type
:param klass: class to be used as a factory for the given type
:type prefix: str
:param prefix: URL prefix for the type
:rtype: str
:returns: the URL, prefixed as appropriate
... | [
"def",
"_compute_type_url",
"(",
"klass",
",",
"prefix",
"=",
"_GOOGLE_APIS_PREFIX",
")",
":",
"name",
"=",
"klass",
".",
"DESCRIPTOR",
".",
"full_name",
"return",
"\"%s/%s\"",
"%",
"(",
"prefix",
",",
"name",
")"
] | Compute a type URL for a klass.
:type klass: type
:param klass: class to be used as a factory for the given type
:type prefix: str
:param prefix: URL prefix for the type
:rtype: str
:returns: the URL, prefixed as appropriate | [
"Compute",
"a",
"type",
"URL",
"for",
"a",
"klass",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L26-L39 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.