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 | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.document | def document(self, document_id=None):
"""Create a sub-document underneath the current collection.
Args:
document_id (Optional[str]): The document identifier
within the current collection. If not provided, will default
to a random 20 character string composed ... | python | def document(self, document_id=None):
"""Create a sub-document underneath the current collection.
Args:
document_id (Optional[str]): The document identifier
within the current collection. If not provided, will default
to a random 20 character string composed ... | [
"def",
"document",
"(",
"self",
",",
"document_id",
"=",
"None",
")",
":",
"if",
"document_id",
"is",
"None",
":",
"document_id",
"=",
"_auto_id",
"(",
")",
"child_path",
"=",
"self",
".",
"_path",
"+",
"(",
"document_id",
",",
")",
"return",
"self",
"... | Create a sub-document underneath the current collection.
Args:
document_id (Optional[str]): The document identifier
within the current collection. If not provided, will default
to a random 20 character string composed of digits,
uppercase and lowercas... | [
"Create",
"a",
"sub",
"-",
"document",
"underneath",
"the",
"current",
"collection",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L94-L111 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference._parent_info | def _parent_info(self):
"""Get fully-qualified parent path and prefix for this collection.
Returns:
Tuple[str, str]: Pair of
* the fully-qualified (with database and project) path to the
parent of this collection (will either be the database path
or ... | python | def _parent_info(self):
"""Get fully-qualified parent path and prefix for this collection.
Returns:
Tuple[str, str]: Pair of
* the fully-qualified (with database and project) path to the
parent of this collection (will either be the database path
or ... | [
"def",
"_parent_info",
"(",
"self",
")",
":",
"parent_doc",
"=",
"self",
".",
"parent",
"if",
"parent_doc",
"is",
"None",
":",
"parent_path",
"=",
"_helpers",
".",
"DOCUMENT_PATH_DELIMITER",
".",
"join",
"(",
"(",
"self",
".",
"_client",
".",
"_database_stri... | Get fully-qualified parent path and prefix for this collection.
Returns:
Tuple[str, str]: Pair of
* the fully-qualified (with database and project) path to the
parent of this collection (will either be the database path
or a document path).
* the... | [
"Get",
"fully",
"-",
"qualified",
"parent",
"path",
"and",
"prefix",
"for",
"this",
"collection",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L113-L133 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.add | def add(self, document_data, document_id=None):
"""Create a document in the Firestore database with the provided data.
Args:
document_data (dict): Property names and values to use for
creating the document.
document_id (Optional[str]): The document identifier wit... | python | def add(self, document_data, document_id=None):
"""Create a document in the Firestore database with the provided data.
Args:
document_data (dict): Property names and values to use for
creating the document.
document_id (Optional[str]): The document identifier wit... | [
"def",
"add",
"(",
"self",
",",
"document_data",
",",
"document_id",
"=",
"None",
")",
":",
"if",
"document_id",
"is",
"None",
":",
"parent_path",
",",
"expected_prefix",
"=",
"self",
".",
"_parent_info",
"(",
")",
"document_pb",
"=",
"document_pb2",
".",
... | Create a document in the Firestore database with the provided data.
Args:
document_data (dict): Property names and values to use for
creating the document.
document_id (Optional[str]): The document identifier within the
current collection. If not provided... | [
"Create",
"a",
"document",
"in",
"the",
"Firestore",
"database",
"with",
"the",
"provided",
"data",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L135-L180 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.list_documents | def list_documents(self, page_size=None):
"""List all subdocuments of the current collection.
Args:
page_size (Optional[int]]): The maximum number of documents
in each page of results from this request. Non-positive values
are ignored. Defaults to a sensible value se... | python | def list_documents(self, page_size=None):
"""List all subdocuments of the current collection.
Args:
page_size (Optional[int]]): The maximum number of documents
in each page of results from this request. Non-positive values
are ignored. Defaults to a sensible value se... | [
"def",
"list_documents",
"(",
"self",
",",
"page_size",
"=",
"None",
")",
":",
"parent",
",",
"_",
"=",
"self",
".",
"_parent_info",
"(",
")",
"iterator",
"=",
"self",
".",
"_client",
".",
"_firestore_api",
".",
"list_documents",
"(",
"parent",
",",
"sel... | List all subdocuments of the current collection.
Args:
page_size (Optional[int]]): The maximum number of documents
in each page of results from this request. Non-positive values
are ignored. Defaults to a sensible value set by the API.
Returns:
Sequence[... | [
"List",
"all",
"subdocuments",
"of",
"the",
"current",
"collection",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L182-L207 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.select | def select(self, field_paths):
"""Create a "select" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.select` for
more information on this method.
Args:
field_paths (Iterable[str, ...]): An iterable of field paths
(``.`... | python | def select(self, field_paths):
"""Create a "select" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.select` for
more information on this method.
Args:
field_paths (Iterable[str, ...]): An iterable of field paths
(``.`... | [
"def",
"select",
"(",
"self",
",",
"field_paths",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"select",
"(",
"field_paths",
")"
] | Create a "select" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.select` for
more information on this method.
Args:
field_paths (Iterable[str, ...]): An iterable of field paths
(``.``-delimited list of field names) to use as... | [
"Create",
"a",
"select",
"query",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L209-L225 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.where | def where(self, field_path, op_string, value):
"""Create a "where" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.where` for
more information on this method.
Args:
field_path (str): A field path (``.``-delimited list of
... | python | def where(self, field_path, op_string, value):
"""Create a "where" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.where` for
more information on this method.
Args:
field_path (str): A field path (``.``-delimited list of
... | [
"def",
"where",
"(",
"self",
",",
"field_path",
",",
"op_string",
",",
"value",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"where",
"(",
"field_path",
",",
"op_string",
",",
"value",
")"
] | Create a "where" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.where` for
more information on this method.
Args:
field_path (str): A field path (``.``-delimited list of
field names) for the field to filter on.
o... | [
"Create",
"a",
"where",
"query",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L227-L248 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.order_by | def order_by(self, field_path, **kwargs):
"""Create an "order by" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.order_by` for
more information on this method.
Args:
field_path (str): A field path (``.``-delimited list of
... | python | def order_by(self, field_path, **kwargs):
"""Create an "order by" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.order_by` for
more information on this method.
Args:
field_path (str): A field path (``.``-delimited list of
... | [
"def",
"order_by",
"(",
"self",
",",
"field_path",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"order_by",
"(",
"field_path",
",",
"*",
"*",
"kwargs",
")"
] | Create an "order by" query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.order_by` for
more information on this method.
Args:
field_path (str): A field path (``.``-delimited list of
field names) on which to order the query result... | [
"Create",
"an",
"order",
"by",
"query",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L250-L269 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.limit | def limit(self, count):
"""Create a limited query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.limit` for
more information on this method.
Args:
count (int): Maximum number of documents to return that match
the query.
... | python | def limit(self, count):
"""Create a limited query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.limit` for
more information on this method.
Args:
count (int): Maximum number of documents to return that match
the query.
... | [
"def",
"limit",
"(",
"self",
",",
"count",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"limit",
"(",
"count",
")"
] | Create a limited query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.limit` for
more information on this method.
Args:
count (int): Maximum number of documents to return that match
the query.
Returns:
~.fires... | [
"Create",
"a",
"limited",
"query",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L271-L286 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.offset | def offset(self, num_to_skip):
"""Skip to an offset in a query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.offset` for
more information on this method.
Args:
num_to_skip (int): The number of results to skip at the beginning
... | python | def offset(self, num_to_skip):
"""Skip to an offset in a query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.offset` for
more information on this method.
Args:
num_to_skip (int): The number of results to skip at the beginning
... | [
"def",
"offset",
"(",
"self",
",",
"num_to_skip",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"offset",
"(",
"num_to_skip",
")"
] | Skip to an offset in a query with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.offset` for
more information on this method.
Args:
num_to_skip (int): The number of results to skip at the beginning
of query results. (Must be non-negati... | [
"Skip",
"to",
"an",
"offset",
"in",
"a",
"query",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L288-L303 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.start_at | def start_at(self, document_fields):
"""Start query at a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.start_at` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.Docu... | python | def start_at(self, document_fields):
"""Start query at a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.start_at` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.Docu... | [
"def",
"start_at",
"(",
"self",
",",
"document_fields",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"start_at",
"(",
"document_fields",
")"
] | Start query at a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.start_at` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.DocumentSnapshot, dict, list, tuple]): a document
... | [
"Start",
"query",
"at",
"a",
"cursor",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L305-L323 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.start_after | def start_after(self, document_fields):
"""Start query after a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.start_after` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
docu... | python | def start_after(self, document_fields):
"""Start query after a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.start_after` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
docu... | [
"def",
"start_after",
"(",
"self",
",",
"document_fields",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"start_after",
"(",
"document_fields",
")"
] | Start query after a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.start_after` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.DocumentSnapshot, dict, list, tuple]): a docum... | [
"Start",
"query",
"after",
"a",
"cursor",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L325-L343 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.end_before | def end_before(self, document_fields):
"""End query before a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.end_before` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
documen... | python | def end_before(self, document_fields):
"""End query before a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.end_before` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
documen... | [
"def",
"end_before",
"(",
"self",
",",
"document_fields",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"end_before",
"(",
"document_fields",
")"
] | End query before a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.end_before` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.DocumentSnapshot, dict, list, tuple]): a documen... | [
"End",
"query",
"before",
"a",
"cursor",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L345-L363 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.end_at | def end_at(self, document_fields):
"""End query at a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.end_at` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.DocumentSn... | python | def end_at(self, document_fields):
"""End query at a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.end_at` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.DocumentSn... | [
"def",
"end_at",
"(",
"self",
",",
"document_fields",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"end_at",
"(",
"document_fields",
")"
] | End query at a cursor with this collection as parent.
See
:meth:`~.firestore_v1beta1.query.Query.end_at` for
more information on this method.
Args:
document_fields (Union[~.firestore_v1beta1.\
document.DocumentSnapshot, dict, list, tuple]): a document
... | [
"End",
"query",
"at",
"a",
"cursor",
"with",
"this",
"collection",
"as",
"parent",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L365-L383 | train |
googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/collection.py | CollectionReference.stream | def stream(self, transaction=None):
"""Read the documents in this collection.
This sends a ``RunQuery`` RPC and then returns an iterator which
consumes each document returned in the stream of ``RunQueryResponse``
messages.
.. note::
The underlying stream of response... | python | def stream(self, transaction=None):
"""Read the documents in this collection.
This sends a ``RunQuery`` RPC and then returns an iterator which
consumes each document returned in the stream of ``RunQueryResponse``
messages.
.. note::
The underlying stream of response... | [
"def",
"stream",
"(",
"self",
",",
"transaction",
"=",
"None",
")",
":",
"query",
"=",
"query_mod",
".",
"Query",
"(",
"self",
")",
"return",
"query",
".",
"stream",
"(",
"transaction",
"=",
"transaction",
")"
] | Read the documents in this collection.
This sends a ``RunQuery`` RPC and then returns an iterator which
consumes each document returned in the stream of ``RunQueryResponse``
messages.
.. note::
The underlying stream of responses will time out after
the ``max_rpc_... | [
"Read",
"the",
"documents",
"in",
"this",
"collection",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/collection.py#L394-L422 | train |
googleapis/google-cloud-python | translate/google/cloud/translate_v2/client.py | Client.get_languages | def get_languages(self, target_language=None):
"""Get list of supported languages for translation.
Response
See
https://cloud.google.com/translate/docs/discovering-supported-languages
:type target_language: str
:param target_language: (Optional) The language used to lo... | python | def get_languages(self, target_language=None):
"""Get list of supported languages for translation.
Response
See
https://cloud.google.com/translate/docs/discovering-supported-languages
:type target_language: str
:param target_language: (Optional) The language used to lo... | [
"def",
"get_languages",
"(",
"self",
",",
"target_language",
"=",
"None",
")",
":",
"query_params",
"=",
"{",
"}",
"if",
"target_language",
"is",
"None",
":",
"target_language",
"=",
"self",
".",
"target_language",
"if",
"target_language",
"is",
"not",
"None",... | Get list of supported languages for translation.
Response
See
https://cloud.google.com/translate/docs/discovering-supported-languages
:type target_language: str
:param target_language: (Optional) The language used to localize
returned language n... | [
"Get",
"list",
"of",
"supported",
"languages",
"for",
"translation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v2/client.py#L67-L95 | train |
googleapis/google-cloud-python | translate/google/cloud/translate_v2/client.py | Client.detect_language | def detect_language(self, values):
"""Detect the language of a string or list of strings.
See https://cloud.google.com/translate/docs/detecting-language
:type values: str or list
:param values: String or list of strings that will have
language detected.
... | python | def detect_language(self, values):
"""Detect the language of a string or list of strings.
See https://cloud.google.com/translate/docs/detecting-language
:type values: str or list
:param values: String or list of strings that will have
language detected.
... | [
"def",
"detect_language",
"(",
"self",
",",
"values",
")",
":",
"single_value",
"=",
"False",
"if",
"isinstance",
"(",
"values",
",",
"six",
".",
"string_types",
")",
":",
"single_value",
"=",
"True",
"values",
"=",
"[",
"values",
"]",
"data",
"=",
"{",
... | Detect the language of a string or list of strings.
See https://cloud.google.com/translate/docs/detecting-language
:type values: str or list
:param values: String or list of strings that will have
language detected.
:rtype: dict or list
:returns: A list ... | [
"Detect",
"the",
"language",
"of",
"a",
"string",
"or",
"list",
"of",
"strings",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v2/client.py#L97-L163 | train |
googleapis/google-cloud-python | translate/google/cloud/translate_v2/client.py | Client.translate | def translate(
self,
values,
target_language=None,
format_=None,
source_language=None,
customization_ids=(),
model=None,
):
"""Translate a string or list of strings.
See https://cloud.google.com/translate/docs/translating-text
:type v... | python | def translate(
self,
values,
target_language=None,
format_=None,
source_language=None,
customization_ids=(),
model=None,
):
"""Translate a string or list of strings.
See https://cloud.google.com/translate/docs/translating-text
:type v... | [
"def",
"translate",
"(",
"self",
",",
"values",
",",
"target_language",
"=",
"None",
",",
"format_",
"=",
"None",
",",
"source_language",
"=",
"None",
",",
"customization_ids",
"=",
"(",
")",
",",
"model",
"=",
"None",
",",
")",
":",
"single_value",
"=",... | Translate a string or list of strings.
See https://cloud.google.com/translate/docs/translating-text
:type values: str or list
:param values: String or list of strings to translate.
:type target_language: str
:param target_language: The language to translate results into. This
... | [
"Translate",
"a",
"string",
"or",
"list",
"of",
"strings",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v2/client.py#L165-L252 | train |
googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py | Leaser.add | def add(self, items):
"""Add messages to be managed by the leaser."""
for item in items:
# Add the ack ID to the set of managed ack IDs, and increment
# the size counter.
if item.ack_id not in self._leased_messages:
self._leased_messages[item.ack_id] =... | python | def add(self, items):
"""Add messages to be managed by the leaser."""
for item in items:
# Add the ack ID to the set of managed ack IDs, and increment
# the size counter.
if item.ack_id not in self._leased_messages:
self._leased_messages[item.ack_id] =... | [
"def",
"add",
"(",
"self",
",",
"items",
")",
":",
"for",
"item",
"in",
"items",
":",
"# Add the ack ID to the set of managed ack IDs, and increment",
"# the size counter.",
"if",
"item",
".",
"ack_id",
"not",
"in",
"self",
".",
"_leased_messages",
":",
"self",
".... | Add messages to be managed by the leaser. | [
"Add",
"messages",
"to",
"be",
"managed",
"by",
"the",
"leaser",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py#L65-L76 | train |
googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py | Leaser.remove | def remove(self, items):
"""Remove messages from lease management."""
# Remove the ack ID from lease management, and decrement the
# byte counter.
for item in items:
if self._leased_messages.pop(item.ack_id, None) is not None:
self._bytes -= item.byte_size
... | python | def remove(self, items):
"""Remove messages from lease management."""
# Remove the ack ID from lease management, and decrement the
# byte counter.
for item in items:
if self._leased_messages.pop(item.ack_id, None) is not None:
self._bytes -= item.byte_size
... | [
"def",
"remove",
"(",
"self",
",",
"items",
")",
":",
"# Remove the ack ID from lease management, and decrement the",
"# byte counter.",
"for",
"item",
"in",
"items",
":",
"if",
"self",
".",
"_leased_messages",
".",
"pop",
"(",
"item",
".",
"ack_id",
",",
"None",
... | Remove messages from lease management. | [
"Remove",
"messages",
"from",
"lease",
"management",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py#L78-L90 | train |
googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py | Leaser.maintain_leases | def maintain_leases(self):
"""Maintain all of the leases being managed.
This method modifies the ack deadline for all of the managed
ack IDs, then waits for most of that time (but with jitter), and
repeats.
"""
while self._manager.is_active and not self._stop_event.is_se... | python | def maintain_leases(self):
"""Maintain all of the leases being managed.
This method modifies the ack deadline for all of the managed
ack IDs, then waits for most of that time (but with jitter), and
repeats.
"""
while self._manager.is_active and not self._stop_event.is_se... | [
"def",
"maintain_leases",
"(",
"self",
")",
":",
"while",
"self",
".",
"_manager",
".",
"is_active",
"and",
"not",
"self",
".",
"_stop_event",
".",
"is_set",
"(",
")",
":",
"# Determine the appropriate duration for the lease. This is",
"# based off of how long previous ... | Maintain all of the leases being managed.
This method modifies the ack deadline for all of the managed
ack IDs, then waits for most of that time (but with jitter), and
repeats. | [
"Maintain",
"all",
"of",
"the",
"leases",
"being",
"managed",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py#L92-L159 | train |
googleapis/google-cloud-python | error_reporting/google/cloud/error_reporting/_gapic.py | make_report_error_api | def make_report_error_api(client):
"""Create an instance of the gapic Logging API.
:type client::class:`google.cloud.error_reporting.Client`
:param client: Error Reporting client.
:rtype: :class:_ErrorReportingGapicApi
:returns: An Error Reporting API instance.
"""
gax_client = report_erro... | python | def make_report_error_api(client):
"""Create an instance of the gapic Logging API.
:type client::class:`google.cloud.error_reporting.Client`
:param client: Error Reporting client.
:rtype: :class:_ErrorReportingGapicApi
:returns: An Error Reporting API instance.
"""
gax_client = report_erro... | [
"def",
"make_report_error_api",
"(",
"client",
")",
":",
"gax_client",
"=",
"report_errors_service_client",
".",
"ReportErrorsServiceClient",
"(",
"credentials",
"=",
"client",
".",
"_credentials",
",",
"client_info",
"=",
"_CLIENT_INFO",
")",
"return",
"_ErrorReporting... | Create an instance of the gapic Logging API.
:type client::class:`google.cloud.error_reporting.Client`
:param client: Error Reporting client.
:rtype: :class:_ErrorReportingGapicApi
:returns: An Error Reporting API instance. | [
"Create",
"an",
"instance",
"of",
"the",
"gapic",
"Logging",
"API",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/error_reporting/_gapic.py#L27-L39 | train |
googleapis/google-cloud-python | error_reporting/google/cloud/error_reporting/_gapic.py | _ErrorReportingGapicApi.report_error_event | def report_error_event(self, error_report):
"""Uses the gapic client to report the error.
:type error_report: dict
:param error_report:
payload of the error report formatted according to
https://cloud.google.com/error-reporting/docs/formatting-error-messages
... | python | def report_error_event(self, error_report):
"""Uses the gapic client to report the error.
:type error_report: dict
:param error_report:
payload of the error report formatted according to
https://cloud.google.com/error-reporting/docs/formatting-error-messages
... | [
"def",
"report_error_event",
"(",
"self",
",",
"error_report",
")",
":",
"project_name",
"=",
"self",
".",
"_gapic_api",
".",
"project_path",
"(",
"self",
".",
"_project",
")",
"error_report_payload",
"=",
"report_errors_service_pb2",
".",
"ReportedErrorEvent",
"(",... | Uses the gapic client to report the error.
:type error_report: dict
:param error_report:
payload of the error report formatted according to
https://cloud.google.com/error-reporting/docs/formatting-error-messages
This object should be built using
Use
... | [
"Uses",
"the",
"gapic",
"client",
"to",
"report",
"the",
"error",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/error_reporting/google/cloud/error_reporting/_gapic.py#L57-L71 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py | BigtableClient.table_path | def table_path(cls, project, instance, table):
"""Return a fully-qualified table string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/tables/{table}",
project=project,
instance=instance,
table=table,
) | python | def table_path(cls, project, instance, table):
"""Return a fully-qualified table string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/tables/{table}",
project=project,
instance=instance,
table=table,
) | [
"def",
"table_path",
"(",
"cls",
",",
"project",
",",
"instance",
",",
"table",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/instances/{instance}/tables/{table}\"",
",",
"project",
"=",
"project",
"... | Return a fully-qualified table string. | [
"Return",
"a",
"fully",
"-",
"qualified",
"table",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py#L70-L77 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py | BigtableClient.read_rows | def read_rows(
self,
table_name,
app_profile_id=None,
rows=None,
filter_=None,
rows_limit=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Streams back t... | python | def read_rows(
self,
table_name,
app_profile_id=None,
rows=None,
filter_=None,
rows_limit=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Streams back t... | [
"def",
"read_rows",
"(",
"self",
",",
"table_name",
",",
"app_profile_id",
"=",
"None",
",",
"rows",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"rows_limit",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
... | Streams back the contents of all requested rows in key order, optionally
applying the same Reader filter to each. Depending on their size,
rows and cells may be broken up across multiple responses, but
atomicity of each row will still be preserved. See the
ReadRowsResponse documentation ... | [
"Streams",
"back",
"the",
"contents",
"of",
"all",
"requested",
"rows",
"in",
"key",
"order",
"optionally",
"applying",
"the",
"same",
"Reader",
"filter",
"to",
"each",
".",
"Depending",
"on",
"their",
"size",
"rows",
"and",
"cells",
"may",
"be",
"broken",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py#L178-L275 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py | BigtableClient.mutate_rows | def mutate_rows(
self,
table_name,
entries,
app_profile_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Mutates multiple rows in a batch. Each individual row is muta... | python | def mutate_rows(
self,
table_name,
entries,
app_profile_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Mutates multiple rows in a batch. Each individual row is muta... | [
"def",
"mutate_rows",
"(",
"self",
",",
"table_name",
",",
"entries",
",",
"app_profile_id",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"... | Mutates multiple rows in a batch. Each individual row is mutated
atomically as in MutateRow, but the entire batch is not executed
atomically.
Example:
>>> from google.cloud import bigtable_v2
>>>
>>> client = bigtable_v2.BigtableClient()
>>>
... | [
"Mutates",
"multiple",
"rows",
"in",
"a",
"batch",
".",
"Each",
"individual",
"row",
"is",
"mutated",
"atomically",
"as",
"in",
"MutateRow",
"but",
"the",
"entire",
"batch",
"is",
"not",
"executed",
"atomically",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py#L452-L540 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py | BigtableClient.check_and_mutate_row | def check_and_mutate_row(
self,
table_name,
row_key,
app_profile_id=None,
predicate_filter=None,
true_mutations=None,
false_mutations=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
meta... | python | def check_and_mutate_row(
self,
table_name,
row_key,
app_profile_id=None,
predicate_filter=None,
true_mutations=None,
false_mutations=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
meta... | [
"def",
"check_and_mutate_row",
"(",
"self",
",",
"table_name",
",",
"row_key",
",",
"app_profile_id",
"=",
"None",
",",
"predicate_filter",
"=",
"None",
",",
"true_mutations",
"=",
"None",
",",
"false_mutations",
"=",
"None",
",",
"retry",
"=",
"google",
".",
... | Mutates a row atomically based on the output of a predicate Reader filter.
Example:
>>> from google.cloud import bigtable_v2
>>>
>>> client = bigtable_v2.BigtableClient()
>>>
>>> table_name = client.table_path('[PROJECT]', '[INSTANCE]', '[TABLE]')
... | [
"Mutates",
"a",
"row",
"atomically",
"based",
"on",
"the",
"output",
"of",
"a",
"predicate",
"Reader",
"filter",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py#L542-L652 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance._update_from_pb | def _update_from_pb(self, instance_pb):
"""Refresh self from the server-provided protobuf.
Helper for :meth:`from_pb` and :meth:`reload`.
"""
if not instance_pb.display_name: # Simple field (string)
raise ValueError("Instance protobuf does not contain display_name")
... | python | def _update_from_pb(self, instance_pb):
"""Refresh self from the server-provided protobuf.
Helper for :meth:`from_pb` and :meth:`reload`.
"""
if not instance_pb.display_name: # Simple field (string)
raise ValueError("Instance protobuf does not contain display_name")
... | [
"def",
"_update_from_pb",
"(",
"self",
",",
"instance_pb",
")",
":",
"if",
"not",
"instance_pb",
".",
"display_name",
":",
"# Simple field (string)",
"raise",
"ValueError",
"(",
"\"Instance protobuf does not contain display_name\"",
")",
"self",
".",
"display_name",
"="... | Refresh self from the server-provided protobuf.
Helper for :meth:`from_pb` and :meth:`reload`. | [
"Refresh",
"self",
"from",
"the",
"server",
"-",
"provided",
"protobuf",
".",
"Helper",
"for",
":",
"meth",
":",
"from_pb",
"and",
":",
"meth",
":",
"reload",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L118-L127 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.name | def name(self):
"""Instance name used in requests.
.. note::
This property will not change if ``instance_id`` does not,
but the return value is not cached.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_instance_name]
... | python | def name(self):
"""Instance name used in requests.
.. note::
This property will not change if ``instance_id`` does not,
but the return value is not cached.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_instance_name]
... | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_client",
".",
"instance_admin_client",
".",
"instance_path",
"(",
"project",
"=",
"self",
".",
"_client",
".",
"project",
",",
"instance",
"=",
"self",
".",
"instance_id",
")"
] | Instance name used in requests.
.. note::
This property will not change if ``instance_id`` does not,
but the return value is not cached.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_instance_name]
:end-before: [END bigt... | [
"Instance",
"name",
"used",
"in",
"requests",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L170-L192 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.create | def create(
self,
location_id=None,
serve_nodes=None,
default_storage_type=None,
clusters=None,
):
"""Create this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_prod_instance]
:end-... | python | def create(
self,
location_id=None,
serve_nodes=None,
default_storage_type=None,
clusters=None,
):
"""Create this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_prod_instance]
:end-... | [
"def",
"create",
"(",
"self",
",",
"location_id",
"=",
"None",
",",
"serve_nodes",
"=",
"None",
",",
"default_storage_type",
"=",
"None",
",",
"clusters",
"=",
"None",
",",
")",
":",
"if",
"clusters",
"is",
"None",
":",
"warnings",
".",
"warn",
"(",
"_... | Create this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_prod_instance]
:end-before: [END bigtable_create_prod_instance]
.. note::
Uses the ``project`` and ``instance_id`` on the current
:class:`In... | [
"Create",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L221-L325 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.exists | def exists(self):
"""Check whether the instance already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_instance_exists]
:end-before: [END bigtable_check_instance_exists]
:rtype: bool
:returns: True if the table ... | python | def exists(self):
"""Check whether the instance already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_instance_exists]
:end-before: [END bigtable_check_instance_exists]
:rtype: bool
:returns: True if the table ... | [
"def",
"exists",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_client",
".",
"instance_admin_client",
".",
"get_instance",
"(",
"name",
"=",
"self",
".",
"name",
")",
"return",
"True",
"# NOTE: There could be other exceptions that are returned to the user.",
"ex... | Check whether the instance already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_instance_exists]
:end-before: [END bigtable_check_instance_exists]
:rtype: bool
:returns: True if the table exists, else False. | [
"Check",
"whether",
"the",
"instance",
"already",
"exists",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L327-L344 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.reload | def reload(self):
"""Reload the metadata for this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_instance]
:end-before: [END bigtable_reload_instance]
"""
instance_pb = self._client.instance_admin_client.get_i... | python | def reload(self):
"""Reload the metadata for this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_instance]
:end-before: [END bigtable_reload_instance]
"""
instance_pb = self._client.instance_admin_client.get_i... | [
"def",
"reload",
"(",
"self",
")",
":",
"instance_pb",
"=",
"self",
".",
"_client",
".",
"instance_admin_client",
".",
"get_instance",
"(",
"self",
".",
"name",
")",
"# NOTE: _update_from_pb does not check that the project and",
"# instance ID on the response match th... | Reload the metadata for this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_instance]
:end-before: [END bigtable_reload_instance] | [
"Reload",
"the",
"metadata",
"for",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L346-L359 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.update | def update(self):
"""Updates an instance within a project.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_instance]
:end-before: [END bigtable_update_instance]
.. note::
Updates any or all of the following values:... | python | def update(self):
"""Updates an instance within a project.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_instance]
:end-before: [END bigtable_update_instance]
.. note::
Updates any or all of the following values:... | [
"def",
"update",
"(",
"self",
")",
":",
"update_mask_pb",
"=",
"field_mask_pb2",
".",
"FieldMask",
"(",
")",
"if",
"self",
".",
"display_name",
"is",
"not",
"None",
":",
"update_mask_pb",
".",
"paths",
".",
"append",
"(",
"\"display_name\"",
")",
"if",
"se... | Updates an instance within a project.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_instance]
:end-before: [END bigtable_update_instance]
.. note::
Updates any or all of the following values:
``display_name``... | [
"Updates",
"an",
"instance",
"within",
"a",
"project",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L361-L405 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.get_iam_policy | def get_iam_policy(self):
"""Gets the access control policy for an instance resource.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_get_iam_policy]
:end-before: [END bigtable_get_iam_policy]
:rtype: :class:`google.cloud.bigtable.pol... | python | def get_iam_policy(self):
"""Gets the access control policy for an instance resource.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_get_iam_policy]
:end-before: [END bigtable_get_iam_policy]
:rtype: :class:`google.cloud.bigtable.pol... | [
"def",
"get_iam_policy",
"(",
"self",
")",
":",
"instance_admin_client",
"=",
"self",
".",
"_client",
".",
"instance_admin_client",
"resp",
"=",
"instance_admin_client",
".",
"get_iam_policy",
"(",
"resource",
"=",
"self",
".",
"name",
")",
"return",
"Policy",
"... | Gets the access control policy for an instance resource.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_get_iam_policy]
:end-before: [END bigtable_get_iam_policy]
:rtype: :class:`google.cloud.bigtable.policy.Policy`
:returns: The cur... | [
"Gets",
"the",
"access",
"control",
"policy",
"for",
"an",
"instance",
"resource",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L437-L451 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.set_iam_policy | def set_iam_policy(self, policy):
"""Sets the access control policy on an instance resource. Replaces any
existing policy.
For more information about policy, please see documentation of
class `google.cloud.bigtable.policy.Policy`
For example:
.. literalinclude:: snippe... | python | def set_iam_policy(self, policy):
"""Sets the access control policy on an instance resource. Replaces any
existing policy.
For more information about policy, please see documentation of
class `google.cloud.bigtable.policy.Policy`
For example:
.. literalinclude:: snippe... | [
"def",
"set_iam_policy",
"(",
"self",
",",
"policy",
")",
":",
"instance_admin_client",
"=",
"self",
".",
"_client",
".",
"instance_admin_client",
"resp",
"=",
"instance_admin_client",
".",
"set_iam_policy",
"(",
"resource",
"=",
"self",
".",
"name",
",",
"polic... | Sets the access control policy on an instance resource. Replaces any
existing policy.
For more information about policy, please see documentation of
class `google.cloud.bigtable.policy.Policy`
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtab... | [
"Sets",
"the",
"access",
"control",
"policy",
"on",
"an",
"instance",
"resource",
".",
"Replaces",
"any",
"existing",
"policy",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L453-L477 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.cluster | def cluster(
self, cluster_id, location_id=None, serve_nodes=None, default_storage_type=None
):
"""Factory to create a cluster associated with this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-befo... | python | def cluster(
self, cluster_id, location_id=None, serve_nodes=None, default_storage_type=None
):
"""Factory to create a cluster associated with this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-befo... | [
"def",
"cluster",
"(",
"self",
",",
"cluster_id",
",",
"location_id",
"=",
"None",
",",
"serve_nodes",
"=",
"None",
",",
"default_storage_type",
"=",
"None",
")",
":",
"return",
"Cluster",
"(",
"cluster_id",
",",
"self",
",",
"location_id",
"=",
"location_id... | Factory to create a cluster associated with this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-before: [END bigtable_create_cluster]
:type cluster_id: str
:param cluster_id: The ID of the cluster.
... | [
"Factory",
"to",
"create",
"a",
"cluster",
"associated",
"with",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L507-L553 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.list_clusters | def list_clusters(self):
"""List the clusters in this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_clusters_on_instance]
:end-before: [END bigtable_list_clusters_on_instance]
:rtype: tuple
:returns:
... | python | def list_clusters(self):
"""List the clusters in this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_clusters_on_instance]
:end-before: [END bigtable_list_clusters_on_instance]
:rtype: tuple
:returns:
... | [
"def",
"list_clusters",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_client",
".",
"instance_admin_client",
".",
"list_clusters",
"(",
"self",
".",
"name",
")",
"clusters",
"=",
"[",
"Cluster",
".",
"from_pb",
"(",
"cluster",
",",
"self",
")",
"for... | List the clusters in this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_clusters_on_instance]
:end-before: [END bigtable_list_clusters_on_instance]
:rtype: tuple
:returns:
(clusters, failed_locations), whe... | [
"List",
"the",
"clusters",
"in",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L555-L573 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.table | def table(self, table_id, mutation_timeout=None, app_profile_id=None):
"""Factory to create a table associated with this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_table]
:end-before: [END bigtable_create_table]
... | python | def table(self, table_id, mutation_timeout=None, app_profile_id=None):
"""Factory to create a table associated with this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_table]
:end-before: [END bigtable_create_table]
... | [
"def",
"table",
"(",
"self",
",",
"table_id",
",",
"mutation_timeout",
"=",
"None",
",",
"app_profile_id",
"=",
"None",
")",
":",
"return",
"Table",
"(",
"table_id",
",",
"self",
",",
"app_profile_id",
"=",
"app_profile_id",
",",
"mutation_timeout",
"=",
"mu... | Factory to create a table associated with this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_table]
:end-before: [END bigtable_create_table]
:type table_id: str
:param table_id: The ID of the table.
:type a... | [
"Factory",
"to",
"create",
"a",
"table",
"associated",
"with",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L575-L598 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.list_tables | def list_tables(self):
"""List the tables in this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_tables]
:end-before: [END bigtable_list_tables]
:rtype: list of :class:`Table <google.cloud.bigtable.table.Table>`
... | python | def list_tables(self):
"""List the tables in this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_tables]
:end-before: [END bigtable_list_tables]
:rtype: list of :class:`Table <google.cloud.bigtable.table.Table>`
... | [
"def",
"list_tables",
"(",
"self",
")",
":",
"table_list_pb",
"=",
"self",
".",
"_client",
".",
"table_admin_client",
".",
"list_tables",
"(",
"self",
".",
"name",
")",
"result",
"=",
"[",
"]",
"for",
"table_pb",
"in",
"table_list_pb",
":",
"table_prefix",
... | List the tables in this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_tables]
:end-before: [END bigtable_list_tables]
:rtype: list of :class:`Table <google.cloud.bigtable.table.Table>`
:returns: The list of tables own... | [
"List",
"the",
"tables",
"in",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L600-L626 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.app_profile | def app_profile(
self,
app_profile_id,
routing_policy_type=None,
description=None,
cluster_id=None,
allow_transactional_writes=None,
):
"""Factory to create AppProfile associated with this instance.
For example:
.. literalinclude:: snippets.p... | python | def app_profile(
self,
app_profile_id,
routing_policy_type=None,
description=None,
cluster_id=None,
allow_transactional_writes=None,
):
"""Factory to create AppProfile associated with this instance.
For example:
.. literalinclude:: snippets.p... | [
"def",
"app_profile",
"(",
"self",
",",
"app_profile_id",
",",
"routing_policy_type",
"=",
"None",
",",
"description",
"=",
"None",
",",
"cluster_id",
"=",
"None",
",",
"allow_transactional_writes",
"=",
"None",
",",
")",
":",
"return",
"AppProfile",
"(",
"app... | Factory to create AppProfile associated with this instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_app_profile]
:end-before: [END bigtable_create_app_profile]
:type app_profile_id: str
:param app_profile_id: The ID of ... | [
"Factory",
"to",
"create",
"AppProfile",
"associated",
"with",
"this",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L628-L679 | train |
googleapis/google-cloud-python | bigtable/google/cloud/bigtable/instance.py | Instance.list_app_profiles | def list_app_profiles(self):
"""Lists information about AppProfiles in an instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_app_profiles]
:end-before: [END bigtable_list_app_profiles]
:rtype: :list:[`~google.cloud.bigtabl... | python | def list_app_profiles(self):
"""Lists information about AppProfiles in an instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_app_profiles]
:end-before: [END bigtable_list_app_profiles]
:rtype: :list:[`~google.cloud.bigtabl... | [
"def",
"list_app_profiles",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_client",
".",
"instance_admin_client",
".",
"list_app_profiles",
"(",
"self",
".",
"name",
")",
"return",
"[",
"AppProfile",
".",
"from_pb",
"(",
"app_profile",
",",
"self",
")",
... | Lists information about AppProfiles in an instance.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_list_app_profiles]
:end-before: [END bigtable_list_app_profiles]
:rtype: :list:[`~google.cloud.bigtable.app_profile.AppProfile`]
:retu... | [
"Lists",
"information",
"about",
"AppProfiles",
"in",
"an",
"instance",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/instance.py#L681-L697 | train |
googleapis/google-cloud-python | bigtable/noxfile.py | system | def system(session):
"""Run the system test suite."""
system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")
# Sanity check: Only run tests if the environment variable is set.
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
... | python | def system(session):
"""Run the system test suite."""
system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")
# Sanity check: Only run tests if the environment variable is set.
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
... | [
"def",
"system",
"(",
"session",
")",
":",
"system_test_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"\"tests\"",
",",
"\"system.py\"",
")",
"system_test_folder_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"\"tests\"",
",",
"\"system\"",
")",
"# Sa... | Run the system test suite. | [
"Run",
"the",
"system",
"test",
"suite",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/noxfile.py#L94-L123 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _reference_getter | def _reference_getter(table):
"""A :class:`~google.cloud.bigquery.table.TableReference` pointing to
this table.
Returns:
google.cloud.bigquery.table.TableReference: pointer to this table.
"""
from google.cloud.bigquery import dataset
dataset_ref = dataset.DatasetReference(table.project... | python | def _reference_getter(table):
"""A :class:`~google.cloud.bigquery.table.TableReference` pointing to
this table.
Returns:
google.cloud.bigquery.table.TableReference: pointer to this table.
"""
from google.cloud.bigquery import dataset
dataset_ref = dataset.DatasetReference(table.project... | [
"def",
"_reference_getter",
"(",
"table",
")",
":",
"from",
"google",
".",
"cloud",
".",
"bigquery",
"import",
"dataset",
"dataset_ref",
"=",
"dataset",
".",
"DatasetReference",
"(",
"table",
".",
"project",
",",
"table",
".",
"dataset_id",
")",
"return",
"T... | A :class:`~google.cloud.bigquery.table.TableReference` pointing to
this table.
Returns:
google.cloud.bigquery.table.TableReference: pointer to this table. | [
"A",
":",
"class",
":",
"~google",
".",
"cloud",
".",
"bigquery",
".",
"table",
".",
"TableReference",
"pointing",
"to",
"this",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L80-L90 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _view_use_legacy_sql_getter | def _view_use_legacy_sql_getter(table):
"""bool: Specifies whether to execute the view with Legacy or Standard SQL.
This boolean specifies whether to execute the view with Legacy SQL
(:data:`True`) or Standard SQL (:data:`False`). The client side default is
:data:`False`. The server-side default is :da... | python | def _view_use_legacy_sql_getter(table):
"""bool: Specifies whether to execute the view with Legacy or Standard SQL.
This boolean specifies whether to execute the view with Legacy SQL
(:data:`True`) or Standard SQL (:data:`False`). The client side default is
:data:`False`. The server-side default is :da... | [
"def",
"_view_use_legacy_sql_getter",
"(",
"table",
")",
":",
"view",
"=",
"table",
".",
"_properties",
".",
"get",
"(",
"\"view\"",
")",
"if",
"view",
"is",
"not",
"None",
":",
"# The server-side default for useLegacySql is True.",
"return",
"view",
".",
"get",
... | bool: Specifies whether to execute the view with Legacy or Standard SQL.
This boolean specifies whether to execute the view with Legacy SQL
(:data:`True`) or Standard SQL (:data:`False`). The client side default is
:data:`False`. The server-side default is :data:`True`. If this table is
not a view, :da... | [
"bool",
":",
"Specifies",
"whether",
"to",
"execute",
"the",
"view",
"with",
"Legacy",
"or",
"Standard",
"SQL",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L93-L112 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _row_from_mapping | def _row_from_mapping(mapping, schema):
"""Convert a mapping to a row tuple using the schema.
Args:
mapping (Dict[str, object])
Mapping of row data: must contain keys for all required fields in
the schema. Keys which do not correspond to a field in the schema
are ign... | python | def _row_from_mapping(mapping, schema):
"""Convert a mapping to a row tuple using the schema.
Args:
mapping (Dict[str, object])
Mapping of row data: must contain keys for all required fields in
the schema. Keys which do not correspond to a field in the schema
are ign... | [
"def",
"_row_from_mapping",
"(",
"mapping",
",",
"schema",
")",
":",
"if",
"len",
"(",
"schema",
")",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"_TABLE_HAS_NO_SCHEMA",
")",
"row",
"=",
"[",
"]",
"for",
"field",
"in",
"schema",
":",
"if",
"field",
"."... | Convert a mapping to a row tuple using the schema.
Args:
mapping (Dict[str, object])
Mapping of row data: must contain keys for all required fields in
the schema. Keys which do not correspond to a field in the schema
are ignored.
schema (List[google.cloud.bigquer... | [
"Convert",
"a",
"mapping",
"to",
"a",
"row",
"tuple",
"using",
"the",
"schema",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1105-L1136 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _item_to_row | def _item_to_row(iterator, resource):
"""Convert a JSON row to the native object.
.. note::
This assumes that the ``schema`` attribute has been
added to the iterator after being created, which
should be done by the caller.
:type iterator: :class:`~google.api_core.page_iterator.Ite... | python | def _item_to_row(iterator, resource):
"""Convert a JSON row to the native object.
.. note::
This assumes that the ``schema`` attribute has been
added to the iterator after being created, which
should be done by the caller.
:type iterator: :class:`~google.api_core.page_iterator.Ite... | [
"def",
"_item_to_row",
"(",
"iterator",
",",
"resource",
")",
":",
"return",
"Row",
"(",
"_helpers",
".",
"_row_tuple_from_json",
"(",
"resource",
",",
"iterator",
".",
"schema",
")",
",",
"iterator",
".",
"_field_to_index",
",",
")"
] | Convert a JSON row to the native object.
.. note::
This assumes that the ``schema`` attribute has been
added to the iterator after being created, which
should be done by the caller.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that... | [
"Convert",
"a",
"JSON",
"row",
"to",
"the",
"native",
"object",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1882-L1903 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _rows_page_start | def _rows_page_start(iterator, page, response):
"""Grab total rows when :class:`~google.cloud.iterator.Page` starts.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that is currently in use.
:type page: :class:`~google.api_core.page_iterator.Page`
:pa... | python | def _rows_page_start(iterator, page, response):
"""Grab total rows when :class:`~google.cloud.iterator.Page` starts.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that is currently in use.
:type page: :class:`~google.api_core.page_iterator.Page`
:pa... | [
"def",
"_rows_page_start",
"(",
"iterator",
",",
"page",
",",
"response",
")",
":",
"total_rows",
"=",
"response",
".",
"get",
"(",
"\"totalRows\"",
")",
"if",
"total_rows",
"is",
"not",
"None",
":",
"total_rows",
"=",
"int",
"(",
"total_rows",
")",
"itera... | Grab total rows when :class:`~google.cloud.iterator.Page` starts.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that is currently in use.
:type page: :class:`~google.api_core.page_iterator.Page`
:param page: The page that was just created.
:type re... | [
"Grab",
"total",
"rows",
"when",
":",
"class",
":",
"~google",
".",
"cloud",
".",
"iterator",
".",
"Page",
"starts",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1907-L1922 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _table_arg_to_table_ref | def _table_arg_to_table_ref(value, default_project=None):
"""Helper to convert a string or Table to TableReference.
This function keeps TableReference and other kinds of objects unchanged.
"""
if isinstance(value, six.string_types):
value = TableReference.from_string(value, default_project=defa... | python | def _table_arg_to_table_ref(value, default_project=None):
"""Helper to convert a string or Table to TableReference.
This function keeps TableReference and other kinds of objects unchanged.
"""
if isinstance(value, six.string_types):
value = TableReference.from_string(value, default_project=defa... | [
"def",
"_table_arg_to_table_ref",
"(",
"value",
",",
"default_project",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
":",
"value",
"=",
"TableReference",
".",
"from_string",
"(",
"value",
",",
"default_project"... | Helper to convert a string or Table to TableReference.
This function keeps TableReference and other kinds of objects unchanged. | [
"Helper",
"to",
"convert",
"a",
"string",
"or",
"Table",
"to",
"TableReference",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1928-L1937 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _table_arg_to_table | def _table_arg_to_table(value, default_project=None):
"""Helper to convert a string or TableReference to a Table.
This function keeps Table and other kinds of objects unchanged.
"""
if isinstance(value, six.string_types):
value = TableReference.from_string(value, default_project=default_project... | python | def _table_arg_to_table(value, default_project=None):
"""Helper to convert a string or TableReference to a Table.
This function keeps Table and other kinds of objects unchanged.
"""
if isinstance(value, six.string_types):
value = TableReference.from_string(value, default_project=default_project... | [
"def",
"_table_arg_to_table",
"(",
"value",
",",
"default_project",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
":",
"value",
"=",
"TableReference",
".",
"from_string",
"(",
"value",
",",
"default_project",
... | Helper to convert a string or TableReference to a Table.
This function keeps Table and other kinds of objects unchanged. | [
"Helper",
"to",
"convert",
"a",
"string",
"or",
"TableReference",
"to",
"a",
"Table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1940-L1954 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | TableReference.from_string | def from_string(cls, table_id, default_project=None):
"""Construct a table reference from table ID string.
Args:
table_id (str):
A table ID in standard SQL format. If ``default_project``
is not specified, this must included a project ID, dataset
... | python | def from_string(cls, table_id, default_project=None):
"""Construct a table reference from table ID string.
Args:
table_id (str):
A table ID in standard SQL format. If ``default_project``
is not specified, this must included a project ID, dataset
... | [
"def",
"from_string",
"(",
"cls",
",",
"table_id",
",",
"default_project",
"=",
"None",
")",
":",
"from",
"google",
".",
"cloud",
".",
"bigquery",
".",
"dataset",
"import",
"DatasetReference",
"(",
"output_project_id",
",",
"output_dataset_id",
",",
"output_tabl... | Construct a table reference from table ID string.
Args:
table_id (str):
A table ID in standard SQL format. If ``default_project``
is not specified, this must included a project ID, dataset
ID, and table ID, each separated by ``.``.
default... | [
"Construct",
"a",
"table",
"reference",
"from",
"table",
"ID",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L224-L260 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | TableReference.from_api_repr | def from_api_repr(cls, resource):
"""Factory: construct a table reference given its API representation
Args:
resource (Dict[str, object]):
Table reference representation returned from the API
Returns:
google.cloud.bigquery.table.TableReference:
... | python | def from_api_repr(cls, resource):
"""Factory: construct a table reference given its API representation
Args:
resource (Dict[str, object]):
Table reference representation returned from the API
Returns:
google.cloud.bigquery.table.TableReference:
... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"from",
"google",
".",
"cloud",
".",
"bigquery",
".",
"dataset",
"import",
"DatasetReference",
"project",
"=",
"resource",
"[",
"\"projectId\"",
"]",
"dataset_id",
"=",
"resource",
"[",
"\"datasetI... | Factory: construct a table reference given its API representation
Args:
resource (Dict[str, object]):
Table reference representation returned from the API
Returns:
google.cloud.bigquery.table.TableReference:
Table reference parsed from ``resourc... | [
"Factory",
":",
"construct",
"a",
"table",
"reference",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L263-L279 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | TableReference.to_bqstorage | def to_bqstorage(self):
"""Construct a BigQuery Storage API representation of this table.
Install the ``google-cloud-bigquery-storage`` package to use this
feature.
If the ``table_id`` contains a partition identifier (e.g.
``my_table$201812``) or a snapshot identifier (e.g.
... | python | def to_bqstorage(self):
"""Construct a BigQuery Storage API representation of this table.
Install the ``google-cloud-bigquery-storage`` package to use this
feature.
If the ``table_id`` contains a partition identifier (e.g.
``my_table$201812``) or a snapshot identifier (e.g.
... | [
"def",
"to_bqstorage",
"(",
"self",
")",
":",
"if",
"bigquery_storage_v1beta1",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"_NO_BQSTORAGE_ERROR",
")",
"table_ref",
"=",
"bigquery_storage_v1beta1",
".",
"types",
".",
"TableReference",
"(",
")",
"table_ref",
"."... | Construct a BigQuery Storage API representation of this table.
Install the ``google-cloud-bigquery-storage`` package to use this
feature.
If the ``table_id`` contains a partition identifier (e.g.
``my_table$201812``) or a snapshot identifier (e.g.
``mytable@1234567890``), it is... | [
"Construct",
"a",
"BigQuery",
"Storage",
"API",
"representation",
"of",
"this",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L293-L332 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.encryption_configuration | def encryption_configuration(self):
"""google.cloud.bigquery.table.EncryptionConfiguration: Custom
encryption configuration for the table.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
if using default encryption.
See `protecting data with Cloud KMS key... | python | def encryption_configuration(self):
"""google.cloud.bigquery.table.EncryptionConfiguration: Custom
encryption configuration for the table.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
if using default encryption.
See `protecting data with Cloud KMS key... | [
"def",
"encryption_configuration",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"encryptionConfiguration\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"EncryptionConfiguration",
".",
"from_api_repr",
"(",
"... | google.cloud.bigquery.table.EncryptionConfiguration: Custom
encryption configuration for the table.
Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
if using default encryption.
See `protecting data with Cloud KMS keys
<https://cloud.google.com/bigquery/do... | [
"google",
".",
"cloud",
".",
"bigquery",
".",
"table",
".",
"EncryptionConfiguration",
":",
"Custom",
"encryption",
"configuration",
"for",
"the",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L471-L485 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.time_partitioning | def time_partitioning(self):
"""google.cloud.bigquery.table.TimePartitioning: Configures time-based
partitioning for a table.
Raises:
ValueError:
If the value is not :class:`TimePartitioning` or :data:`None`.
"""
prop = self._properties.get("timeParti... | python | def time_partitioning(self):
"""google.cloud.bigquery.table.TimePartitioning: Configures time-based
partitioning for a table.
Raises:
ValueError:
If the value is not :class:`TimePartitioning` or :data:`None`.
"""
prop = self._properties.get("timeParti... | [
"def",
"time_partitioning",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"timePartitioning\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"return",
"TimePartitioning",
".",
"from_api_repr",
"(",
"prop",
")"
] | google.cloud.bigquery.table.TimePartitioning: Configures time-based
partitioning for a table.
Raises:
ValueError:
If the value is not :class:`TimePartitioning` or :data:`None`. | [
"google",
".",
"cloud",
".",
"bigquery",
".",
"table",
".",
"TimePartitioning",
":",
"Configures",
"time",
"-",
"based",
"partitioning",
"for",
"a",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L565-L575 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.partition_expiration | def partition_expiration(self):
"""Union[int, None]: Expiration time in milliseconds for a partition.
If :attr:`partition_expiration` is set and :attr:`type_` is
not set, :attr:`type_` will default to
:attr:`~google.cloud.bigquery.table.TimePartitioningType.DAY`.
"""
war... | python | def partition_expiration(self):
"""Union[int, None]: Expiration time in milliseconds for a partition.
If :attr:`partition_expiration` is set and :attr:`type_` is
not set, :attr:`type_` will default to
:attr:`~google.cloud.bigquery.table.TimePartitioningType.DAY`.
"""
war... | [
"def",
"partition_expiration",
"(",
"self",
")",
":",
"warnings",
".",
"warn",
"(",
"\"This method will be deprecated in future versions. Please use \"",
"\"Table.time_partitioning.expiration_ms instead.\"",
",",
"PendingDeprecationWarning",
",",
"stacklevel",
"=",
"2",
",",
")... | Union[int, None]: Expiration time in milliseconds for a partition.
If :attr:`partition_expiration` is set and :attr:`type_` is
not set, :attr:`type_` will default to
:attr:`~google.cloud.bigquery.table.TimePartitioningType.DAY`. | [
"Union",
"[",
"int",
"None",
"]",
":",
"Expiration",
"time",
"in",
"milliseconds",
"for",
"a",
"partition",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L618-L632 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.clustering_fields | def clustering_fields(self):
"""Union[List[str], None]: Fields defining clustering for the table
(Defaults to :data:`None`).
Clustering fields are immutable after table creation.
.. note::
As of 2018-06-29, clustering fields cannot be set on a table
which does n... | python | def clustering_fields(self):
"""Union[List[str], None]: Fields defining clustering for the table
(Defaults to :data:`None`).
Clustering fields are immutable after table creation.
.. note::
As of 2018-06-29, clustering fields cannot be set on a table
which does n... | [
"def",
"clustering_fields",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"clustering\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"return",
"list",
"(",
"prop",
".",
"get",
"(",
"\"fields\"",
",",
"(",
")",
"... | Union[List[str], None]: Fields defining clustering for the table
(Defaults to :data:`None`).
Clustering fields are immutable after table creation.
.. note::
As of 2018-06-29, clustering fields cannot be set on a table
which does not also have time partioning defined. | [
"Union",
"[",
"List",
"[",
"str",
"]",
"None",
"]",
":",
"Fields",
"defining",
"clustering",
"for",
"the",
"table"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L647-L661 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.clustering_fields | def clustering_fields(self, value):
"""Union[List[str], None]: Fields defining clustering for the table
(Defaults to :data:`None`).
"""
if value is not None:
prop = self._properties.setdefault("clustering", {})
prop["fields"] = value
else:
if ... | python | def clustering_fields(self, value):
"""Union[List[str], None]: Fields defining clustering for the table
(Defaults to :data:`None`).
"""
if value is not None:
prop = self._properties.setdefault("clustering", {})
prop["fields"] = value
else:
if ... | [
"def",
"clustering_fields",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"prop",
"=",
"self",
".",
"_properties",
".",
"setdefault",
"(",
"\"clustering\"",
",",
"{",
"}",
")",
"prop",
"[",
"\"fields\"",
"]",
"=",
"value... | Union[List[str], None]: Fields defining clustering for the table
(Defaults to :data:`None`). | [
"Union",
"[",
"List",
"[",
"str",
"]",
"None",
"]",
":",
"Fields",
"defining",
"clustering",
"for",
"the",
"table"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L664-L674 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.expires | def expires(self):
"""Union[datetime.datetime, None]: Datetime at which the table will be
deleted.
Raises:
ValueError: For invalid value types.
"""
expiration_time = self._properties.get("expirationTime")
if expiration_time is not None:
# expirati... | python | def expires(self):
"""Union[datetime.datetime, None]: Datetime at which the table will be
deleted.
Raises:
ValueError: For invalid value types.
"""
expiration_time = self._properties.get("expirationTime")
if expiration_time is not None:
# expirati... | [
"def",
"expires",
"(",
"self",
")",
":",
"expiration_time",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"expirationTime\"",
")",
"if",
"expiration_time",
"is",
"not",
"None",
":",
"# expiration_time will be in milliseconds.",
"return",
"google",
".",
"clou... | Union[datetime.datetime, None]: Datetime at which the table will be
deleted.
Raises:
ValueError: For invalid value types. | [
"Union",
"[",
"datetime",
".",
"datetime",
"None",
"]",
":",
"Datetime",
"at",
"which",
"the",
"table",
"will",
"be",
"deleted",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L693-L705 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.external_data_configuration | def external_data_configuration(self):
"""Union[google.cloud.bigquery.ExternalConfig, None]: Configuration for
an external data source (defaults to :data:`None`).
Raises:
ValueError: For invalid value types.
"""
prop = self._properties.get("externalDataConfiguration"... | python | def external_data_configuration(self):
"""Union[google.cloud.bigquery.ExternalConfig, None]: Configuration for
an external data source (defaults to :data:`None`).
Raises:
ValueError: For invalid value types.
"""
prop = self._properties.get("externalDataConfiguration"... | [
"def",
"external_data_configuration",
"(",
"self",
")",
":",
"prop",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"externalDataConfiguration\"",
")",
"if",
"prop",
"is",
"not",
"None",
":",
"prop",
"=",
"ExternalConfig",
".",
"from_api_repr",
"(",
"prop... | Union[google.cloud.bigquery.ExternalConfig, None]: Configuration for
an external data source (defaults to :data:`None`).
Raises:
ValueError: For invalid value types. | [
"Union",
"[",
"google",
".",
"cloud",
".",
"bigquery",
".",
"ExternalConfig",
"None",
"]",
":",
"Configuration",
"for",
"an",
"external",
"data",
"source",
"(",
"defaults",
"to",
":",
"data",
":",
"None",
")",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L790-L800 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Table.from_api_repr | def from_api_repr(cls, resource):
"""Factory: construct a table given its API representation
Args:
resource (Dict[str, object]):
Table resource representation from the API
Returns:
google.cloud.bigquery.table.Table: Table parsed from ``resource``.
... | python | def from_api_repr(cls, resource):
"""Factory: construct a table given its API representation
Args:
resource (Dict[str, object]):
Table resource representation from the API
Returns:
google.cloud.bigquery.table.Table: Table parsed from ``resource``.
... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
")",
":",
"from",
"google",
".",
"cloud",
".",
"bigquery",
"import",
"dataset",
"if",
"(",
"\"tableReference\"",
"not",
"in",
"resource",
"or",
"\"tableId\"",
"not",
"in",
"resource",
"[",
"\"tableReference\... | Factory: construct a table given its API representation
Args:
resource (Dict[str, object]):
Table resource representation from the API
Returns:
google.cloud.bigquery.table.Table: Table parsed from ``resource``.
Raises:
KeyError:
... | [
"Factory",
":",
"construct",
"a",
"table",
"given",
"its",
"API",
"representation"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L836-L870 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | TableListItem.partitioning_type | def partitioning_type(self):
"""Union[str, None]: Time partitioning of the table if it is
partitioned (Defaults to :data:`None`).
"""
warnings.warn(
"This method will be deprecated in future versions. Please use "
"TableListItem.time_partitioning.type_ instead.",
... | python | def partitioning_type(self):
"""Union[str, None]: Time partitioning of the table if it is
partitioned (Defaults to :data:`None`).
"""
warnings.warn(
"This method will be deprecated in future versions. Please use "
"TableListItem.time_partitioning.type_ instead.",
... | [
"def",
"partitioning_type",
"(",
"self",
")",
":",
"warnings",
".",
"warn",
"(",
"\"This method will be deprecated in future versions. Please use \"",
"\"TableListItem.time_partitioning.type_ instead.\"",
",",
"PendingDeprecationWarning",
",",
"stacklevel",
"=",
"2",
",",
")",
... | Union[str, None]: Time partitioning of the table if it is
partitioned (Defaults to :data:`None`). | [
"Union",
"[",
"str",
"None",
"]",
":",
"Time",
"partitioning",
"of",
"the",
"table",
"if",
"it",
"is",
"partitioned",
"(",
"Defaults",
"to",
":",
"data",
":",
"None",
")",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1016-L1027 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Row.items | def items(self):
"""Return items as ``(key, value)`` pairs.
Returns:
Iterable[Tuple[str, object]]:
The ``(key, value)`` pairs representing this row.
Examples:
>>> list(Row(('a', 'b'), {'x': 0, 'y': 1}).items())
[('x', 'a'), ('y', 'b')]
... | python | def items(self):
"""Return items as ``(key, value)`` pairs.
Returns:
Iterable[Tuple[str, object]]:
The ``(key, value)`` pairs representing this row.
Examples:
>>> list(Row(('a', 'b'), {'x': 0, 'y': 1}).items())
[('x', 'a'), ('y', 'b')]
... | [
"def",
"items",
"(",
"self",
")",
":",
"for",
"key",
",",
"index",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"_xxx_field_to_index",
")",
":",
"yield",
"(",
"key",
",",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"_xxx_values",
"[",
"index",
"]"... | Return items as ``(key, value)`` pairs.
Returns:
Iterable[Tuple[str, object]]:
The ``(key, value)`` pairs representing this row.
Examples:
>>> list(Row(('a', 'b'), {'x': 0, 'y': 1}).items())
[('x', 'a'), ('y', 'b')] | [
"Return",
"items",
"as",
"(",
"key",
"value",
")",
"pairs",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1198-L1211 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | Row.get | def get(self, key, default=None):
"""Return a value for key, with a default value if it does not exist.
Args:
key (str): The key of the column to access
default (object):
The default value to use if the key does not exist. (Defaults
to :data:`None... | python | def get(self, key, default=None):
"""Return a value for key, with a default value if it does not exist.
Args:
key (str): The key of the column to access
default (object):
The default value to use if the key does not exist. (Defaults
to :data:`None... | [
"def",
"get",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"index",
"=",
"self",
".",
"_xxx_field_to_index",
".",
"get",
"(",
"key",
")",
"if",
"index",
"is",
"None",
":",
"return",
"default",
"return",
"self",
".",
"_xxx_values",
... | Return a value for key, with a default value if it does not exist.
Args:
key (str): The key of the column to access
default (object):
The default value to use if the key does not exist. (Defaults
to :data:`None`.)
Returns:
object:
... | [
"Return",
"a",
"value",
"for",
"key",
"with",
"a",
"default",
"value",
"if",
"it",
"does",
"not",
"exist",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1213-L1248 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | RowIterator._get_next_page_response | def _get_next_page_response(self):
"""Requests the next page from the path provided.
Returns:
Dict[str, object]:
The parsed JSON response of the next page's contents.
"""
params = self._get_query_params()
if self._page_size is not None:
pa... | python | def _get_next_page_response(self):
"""Requests the next page from the path provided.
Returns:
Dict[str, object]:
The parsed JSON response of the next page's contents.
"""
params = self._get_query_params()
if self._page_size is not None:
pa... | [
"def",
"_get_next_page_response",
"(",
"self",
")",
":",
"params",
"=",
"self",
".",
"_get_query_params",
"(",
")",
"if",
"self",
".",
"_page_size",
"is",
"not",
"None",
":",
"params",
"[",
"\"maxResults\"",
"]",
"=",
"self",
".",
"_page_size",
"return",
"... | Requests the next page from the path provided.
Returns:
Dict[str, object]:
The parsed JSON response of the next page's contents. | [
"Requests",
"the",
"next",
"page",
"from",
"the",
"path",
"provided",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1357-L1369 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | RowIterator._to_dataframe_tabledata_list | def _to_dataframe_tabledata_list(self, dtypes, progress_bar=None):
"""Use (slower, but free) tabledata.list to construct a DataFrame."""
column_names = [field.name for field in self.schema]
frames = []
for page in iter(self.pages):
current_frame = self._to_dataframe_dtypes(p... | python | def _to_dataframe_tabledata_list(self, dtypes, progress_bar=None):
"""Use (slower, but free) tabledata.list to construct a DataFrame."""
column_names = [field.name for field in self.schema]
frames = []
for page in iter(self.pages):
current_frame = self._to_dataframe_dtypes(p... | [
"def",
"_to_dataframe_tabledata_list",
"(",
"self",
",",
"dtypes",
",",
"progress_bar",
"=",
"None",
")",
":",
"column_names",
"=",
"[",
"field",
".",
"name",
"for",
"field",
"in",
"self",
".",
"schema",
"]",
"frames",
"=",
"[",
"]",
"for",
"page",
"in",... | Use (slower, but free) tabledata.list to construct a DataFrame. | [
"Use",
"(",
"slower",
"but",
"free",
")",
"tabledata",
".",
"list",
"to",
"construct",
"a",
"DataFrame",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1390-L1410 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | RowIterator._to_dataframe_bqstorage | def _to_dataframe_bqstorage(self, bqstorage_client, dtypes, progress_bar=None):
"""Use (faster, but billable) BQ Storage API to construct DataFrame."""
if bigquery_storage_v1beta1 is None:
raise ValueError(_NO_BQSTORAGE_ERROR)
if "$" in self._table.table_id:
raise ValueE... | python | def _to_dataframe_bqstorage(self, bqstorage_client, dtypes, progress_bar=None):
"""Use (faster, but billable) BQ Storage API to construct DataFrame."""
if bigquery_storage_v1beta1 is None:
raise ValueError(_NO_BQSTORAGE_ERROR)
if "$" in self._table.table_id:
raise ValueE... | [
"def",
"_to_dataframe_bqstorage",
"(",
"self",
",",
"bqstorage_client",
",",
"dtypes",
",",
"progress_bar",
"=",
"None",
")",
":",
"if",
"bigquery_storage_v1beta1",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"_NO_BQSTORAGE_ERROR",
")",
"if",
"\"$\"",
"in",
"... | Use (faster, but billable) BQ Storage API to construct DataFrame. | [
"Use",
"(",
"faster",
"but",
"billable",
")",
"BQ",
"Storage",
"API",
"to",
"construct",
"DataFrame",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1480-L1580 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | RowIterator._get_progress_bar | def _get_progress_bar(self, progress_bar_type):
"""Construct a tqdm progress bar object, if tqdm is installed."""
if tqdm is None:
if progress_bar_type is not None:
warnings.warn(_NO_TQDM_ERROR, UserWarning, stacklevel=3)
return None
description = "Downlo... | python | def _get_progress_bar(self, progress_bar_type):
"""Construct a tqdm progress bar object, if tqdm is installed."""
if tqdm is None:
if progress_bar_type is not None:
warnings.warn(_NO_TQDM_ERROR, UserWarning, stacklevel=3)
return None
description = "Downlo... | [
"def",
"_get_progress_bar",
"(",
"self",
",",
"progress_bar_type",
")",
":",
"if",
"tqdm",
"is",
"None",
":",
"if",
"progress_bar_type",
"is",
"not",
"None",
":",
"warnings",
".",
"warn",
"(",
"_NO_TQDM_ERROR",
",",
"UserWarning",
",",
"stacklevel",
"=",
"3"... | Construct a tqdm progress bar object, if tqdm is installed. | [
"Construct",
"a",
"tqdm",
"progress",
"bar",
"object",
"if",
"tqdm",
"is",
"installed",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1582-L1606 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | RowIterator.to_dataframe | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Create a pandas DataFrame by loading all pages of a query.
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Beta Fe... | python | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Create a pandas DataFrame by loading all pages of a query.
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Beta Fe... | [
"def",
"to_dataframe",
"(",
"self",
",",
"bqstorage_client",
"=",
"None",
",",
"dtypes",
"=",
"None",
",",
"progress_bar_type",
"=",
"None",
")",
":",
"if",
"pandas",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"_NO_PANDAS_ERROR",
")",
"if",
"dtypes",
"... | Create a pandas DataFrame by loading all pages of a query.
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Beta Feature** Optional. A BigQuery Storage API client. If
supplied, use the faster Bi... | [
"Create",
"a",
"pandas",
"DataFrame",
"by",
"loading",
"all",
"pages",
"of",
"a",
"query",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1608-L1695 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | _EmptyRowIterator.to_dataframe | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Create an empty dataframe.
Args:
bqstorage_client (Any):
Ignored. Added for compatibility with RowIterator.
dtypes (Any):
Ignored. Added for compatibility with ... | python | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Create an empty dataframe.
Args:
bqstorage_client (Any):
Ignored. Added for compatibility with RowIterator.
dtypes (Any):
Ignored. Added for compatibility with ... | [
"def",
"to_dataframe",
"(",
"self",
",",
"bqstorage_client",
"=",
"None",
",",
"dtypes",
"=",
"None",
",",
"progress_bar_type",
"=",
"None",
")",
":",
"if",
"pandas",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"_NO_PANDAS_ERROR",
")",
"return",
"pandas",... | Create an empty dataframe.
Args:
bqstorage_client (Any):
Ignored. Added for compatibility with RowIterator.
dtypes (Any):
Ignored. Added for compatibility with RowIterator.
progress_bar_type (Any):
Ignored. Added for compatibil... | [
"Create",
"an",
"empty",
"dataframe",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1710-L1727 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/table.py | TimePartitioning.from_api_repr | def from_api_repr(cls, api_repr):
"""Return a :class:`TimePartitioning` object deserialized from a dict.
This method creates a new ``TimePartitioning`` instance that points to
the ``api_repr`` parameter as its internal properties dict. This means
that when a ``TimePartitioning`` instanc... | python | def from_api_repr(cls, api_repr):
"""Return a :class:`TimePartitioning` object deserialized from a dict.
This method creates a new ``TimePartitioning`` instance that points to
the ``api_repr`` parameter as its internal properties dict. This means
that when a ``TimePartitioning`` instanc... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"api_repr",
")",
":",
"instance",
"=",
"cls",
"(",
"api_repr",
"[",
"\"type\"",
"]",
")",
"instance",
".",
"_properties",
"=",
"api_repr",
"return",
"instance"
] | Return a :class:`TimePartitioning` object deserialized from a dict.
This method creates a new ``TimePartitioning`` instance that points to
the ``api_repr`` parameter as its internal properties dict. This means
that when a ``TimePartitioning`` instance is stored as a property of
another ... | [
"Return",
"a",
":",
"class",
":",
"TimePartitioning",
"object",
"deserialized",
"from",
"a",
"dict",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/table.py#L1820-L1846 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/batch.py | _generate_faux_mime_message | def _generate_faux_mime_message(parser, response):
"""Convert response, content -> (multipart) email.message.
Helper for _unpack_batch_response.
"""
# We coerce to bytes to get consistent concat across
# Py2 and Py3. Percent formatting is insufficient since
# it includes the b in Py3.
conte... | python | def _generate_faux_mime_message(parser, response):
"""Convert response, content -> (multipart) email.message.
Helper for _unpack_batch_response.
"""
# We coerce to bytes to get consistent concat across
# Py2 and Py3. Percent formatting is insufficient since
# it includes the b in Py3.
conte... | [
"def",
"_generate_faux_mime_message",
"(",
"parser",
",",
"response",
")",
":",
"# We coerce to bytes to get consistent concat across",
"# Py2 and Py3. Percent formatting is insufficient since",
"# it includes the b in Py3.",
"content_type",
"=",
"_helpers",
".",
"_to_bytes",
"(",
... | Convert response, content -> (multipart) email.message.
Helper for _unpack_batch_response. | [
"Convert",
"response",
"content",
"-",
">",
"(",
"multipart",
")",
"email",
".",
"message",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/batch.py#L284-L301 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/batch.py | _unpack_batch_response | def _unpack_batch_response(response):
"""Convert requests.Response -> [(headers, payload)].
Creates a generator of tuples of emulating the responses to
:meth:`requests.Session.request`.
:type response: :class:`requests.Response`
:param response: HTTP response / headers from a request.
"""
... | python | def _unpack_batch_response(response):
"""Convert requests.Response -> [(headers, payload)].
Creates a generator of tuples of emulating the responses to
:meth:`requests.Session.request`.
:type response: :class:`requests.Response`
:param response: HTTP response / headers from a request.
"""
... | [
"def",
"_unpack_batch_response",
"(",
"response",
")",
":",
"parser",
"=",
"Parser",
"(",
")",
"message",
"=",
"_generate_faux_mime_message",
"(",
"parser",
",",
"response",
")",
"if",
"not",
"isinstance",
"(",
"message",
".",
"_payload",
",",
"list",
")",
"... | Convert requests.Response -> [(headers, payload)].
Creates a generator of tuples of emulating the responses to
:meth:`requests.Session.request`.
:type response: :class:`requests.Response`
:param response: HTTP response / headers from a request. | [
"Convert",
"requests",
".",
"Response",
"-",
">",
"[",
"(",
"headers",
"payload",
")",
"]",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/batch.py#L304-L335 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/batch.py | Batch._do_request | def _do_request(self, method, url, headers, data, target_object):
"""Override Connection: defer actual HTTP request.
Only allow up to ``_MAX_BATCH_SIZE`` requests to be deferred.
:type method: str
:param method: The HTTP method to use in the request.
:type url: str
:p... | python | def _do_request(self, method, url, headers, data, target_object):
"""Override Connection: defer actual HTTP request.
Only allow up to ``_MAX_BATCH_SIZE`` requests to be deferred.
:type method: str
:param method: The HTTP method to use in the request.
:type url: str
:p... | [
"def",
"_do_request",
"(",
"self",
",",
"method",
",",
"url",
",",
"headers",
",",
"data",
",",
"target_object",
")",
":",
"if",
"len",
"(",
"self",
".",
"_requests",
")",
">=",
"self",
".",
"_MAX_BATCH_SIZE",
":",
"raise",
"ValueError",
"(",
"\"Too many... | Override Connection: defer actual HTTP request.
Only allow up to ``_MAX_BATCH_SIZE`` requests to be deferred.
:type method: str
:param method: The HTTP method to use in the request.
:type url: str
:param url: The URL to send the request to.
:type headers: dict
... | [
"Override",
"Connection",
":",
"defer",
"actual",
"HTTP",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/batch.py#L153-L189 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/batch.py | Batch._prepare_batch_request | def _prepare_batch_request(self):
"""Prepares headers and body for a batch request.
:rtype: tuple (dict, str)
:returns: The pair of headers and body of the batch request to be sent.
:raises: :class:`ValueError` if no requests have been deferred.
"""
if len(self._requests... | python | def _prepare_batch_request(self):
"""Prepares headers and body for a batch request.
:rtype: tuple (dict, str)
:returns: The pair of headers and body of the batch request to be sent.
:raises: :class:`ValueError` if no requests have been deferred.
"""
if len(self._requests... | [
"def",
"_prepare_batch_request",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"_requests",
")",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"No deferred requests\"",
")",
"multi",
"=",
"MIMEMultipart",
"(",
")",
"for",
"method",
",",
"uri",
",",... | Prepares headers and body for a batch request.
:rtype: tuple (dict, str)
:returns: The pair of headers and body of the batch request to be sent.
:raises: :class:`ValueError` if no requests have been deferred. | [
"Prepares",
"headers",
"and",
"body",
"for",
"a",
"batch",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/batch.py#L191-L218 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/batch.py | Batch._finish_futures | def _finish_futures(self, responses):
"""Apply all the batch responses to the futures created.
:type responses: list of (headers, payload) tuples.
:param responses: List of headers and payloads from each response in
the batch.
:raises: :class:`ValueError` if n... | python | def _finish_futures(self, responses):
"""Apply all the batch responses to the futures created.
:type responses: list of (headers, payload) tuples.
:param responses: List of headers and payloads from each response in
the batch.
:raises: :class:`ValueError` if n... | [
"def",
"_finish_futures",
"(",
"self",
",",
"responses",
")",
":",
"# If a bad status occurs, we track it, but don't raise an exception",
"# until all futures have been populated.",
"exception_args",
"=",
"None",
"if",
"len",
"(",
"self",
".",
"_target_objects",
")",
"!=",
... | Apply all the batch responses to the futures created.
:type responses: list of (headers, payload) tuples.
:param responses: List of headers and payloads from each response in
the batch.
:raises: :class:`ValueError` if no requests have been deferred. | [
"Apply",
"all",
"the",
"batch",
"responses",
"to",
"the",
"futures",
"created",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/batch.py#L220-L246 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/batch.py | Batch.finish | def finish(self):
"""Submit a single `multipart/mixed` request with deferred requests.
:rtype: list of tuples
:returns: one ``(headers, payload)`` tuple per deferred request.
"""
headers, body = self._prepare_batch_request()
url = "%s/batch/storage/v1" % self.API_BASE_U... | python | def finish(self):
"""Submit a single `multipart/mixed` request with deferred requests.
:rtype: list of tuples
:returns: one ``(headers, payload)`` tuple per deferred request.
"""
headers, body = self._prepare_batch_request()
url = "%s/batch/storage/v1" % self.API_BASE_U... | [
"def",
"finish",
"(",
"self",
")",
":",
"headers",
",",
"body",
"=",
"self",
".",
"_prepare_batch_request",
"(",
")",
"url",
"=",
"\"%s/batch/storage/v1\"",
"%",
"self",
".",
"API_BASE_URL",
"# Use the private ``_base_connection`` rather than the property",
"# ``_connec... | Submit a single `multipart/mixed` request with deferred requests.
:rtype: list of tuples
:returns: one ``(headers, payload)`` tuple per deferred request. | [
"Submit",
"a",
"single",
"multipart",
"/",
"mixed",
"request",
"with",
"deferred",
"requests",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/batch.py#L248-L266 | train |
googleapis/google-cloud-python | spanner/google/cloud/spanner_v1/snapshot.py | _restart_on_unavailable | def _restart_on_unavailable(restart):
"""Restart iteration after :exc:`.ServiceUnavailable`.
:type restart: callable
:param restart: curried function returning iterator
"""
resume_token = b""
item_buffer = []
iterator = restart()
while True:
try:
for item in iterator... | python | def _restart_on_unavailable(restart):
"""Restart iteration after :exc:`.ServiceUnavailable`.
:type restart: callable
:param restart: curried function returning iterator
"""
resume_token = b""
item_buffer = []
iterator = restart()
while True:
try:
for item in iterator... | [
"def",
"_restart_on_unavailable",
"(",
"restart",
")",
":",
"resume_token",
"=",
"b\"\"",
"item_buffer",
"=",
"[",
"]",
"iterator",
"=",
"restart",
"(",
")",
"while",
"True",
":",
"try",
":",
"for",
"item",
"in",
"iterator",
":",
"item_buffer",
".",
"appen... | Restart iteration after :exc:`.ServiceUnavailable`.
:type restart: callable
:param restart: curried function returning iterator | [
"Restart",
"iteration",
"after",
":",
"exc",
":",
".",
"ServiceUnavailable",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/snapshot.py#L34-L61 | train |
googleapis/google-cloud-python | spanner/google/cloud/spanner_v1/snapshot.py | _SnapshotBase.read | def read(self, table, columns, keyset, index="", limit=0, partition=None):
"""Perform a ``StreamingRead`` API request for rows in a table.
:type table: str
:param table: name of the table from which to fetch data
:type columns: list of str
:param columns: names of columns to be... | python | def read(self, table, columns, keyset, index="", limit=0, partition=None):
"""Perform a ``StreamingRead`` API request for rows in a table.
:type table: str
:param table: name of the table from which to fetch data
:type columns: list of str
:param columns: names of columns to be... | [
"def",
"read",
"(",
"self",
",",
"table",
",",
"columns",
",",
"keyset",
",",
"index",
"=",
"\"\"",
",",
"limit",
"=",
"0",
",",
"partition",
"=",
"None",
")",
":",
"if",
"self",
".",
"_read_request_count",
">",
"0",
":",
"if",
"not",
"self",
".",
... | Perform a ``StreamingRead`` API request for rows in a table.
:type table: str
:param table: name of the table from which to fetch data
:type columns: list of str
:param columns: names of columns to be retrieved
:type keyset: :class:`~google.cloud.spanner_v1.keyset.KeySet`
... | [
"Perform",
"a",
"StreamingRead",
"API",
"request",
"for",
"rows",
"in",
"a",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/snapshot.py#L89-L152 | train |
googleapis/google-cloud-python | spanner/google/cloud/spanner_v1/snapshot.py | _SnapshotBase.execute_sql | def execute_sql(
self,
sql,
params=None,
param_types=None,
query_mode=None,
partition=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
):
"""Perform an ``ExecuteStreamingSql`` API request.
... | python | def execute_sql(
self,
sql,
params=None,
param_types=None,
query_mode=None,
partition=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
):
"""Perform an ``ExecuteStreamingSql`` API request.
... | [
"def",
"execute_sql",
"(",
"self",
",",
"sql",
",",
"params",
"=",
"None",
",",
"param_types",
"=",
"None",
",",
"query_mode",
"=",
"None",
",",
"partition",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
"."... | Perform an ``ExecuteStreamingSql`` API request.
:type sql: str
:param sql: SQL query statement
:type params: dict, {str -> column value}
:param params: values for parameter replacement. Keys must match
the names used in ``sql``.
:type param_types: dict[... | [
"Perform",
"an",
"ExecuteStreamingSql",
"API",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/snapshot.py#L154-L237 | train |
googleapis/google-cloud-python | spanner/google/cloud/spanner_v1/snapshot.py | _SnapshotBase.partition_read | def partition_read(
self,
table,
columns,
keyset,
index="",
partition_size_bytes=None,
max_partitions=None,
):
"""Perform a ``ParitionRead`` API request for rows in a table.
:type table: str
:param table: name of the table from which t... | python | def partition_read(
self,
table,
columns,
keyset,
index="",
partition_size_bytes=None,
max_partitions=None,
):
"""Perform a ``ParitionRead`` API request for rows in a table.
:type table: str
:param table: name of the table from which t... | [
"def",
"partition_read",
"(",
"self",
",",
"table",
",",
"columns",
",",
"keyset",
",",
"index",
"=",
"\"\"",
",",
"partition_size_bytes",
"=",
"None",
",",
"max_partitions",
"=",
"None",
",",
")",
":",
"if",
"not",
"self",
".",
"_multi_use",
":",
"raise... | Perform a ``ParitionRead`` API request for rows in a table.
:type table: str
:param table: name of the table from which to fetch data
:type columns: list of str
:param columns: names of columns to be retrieved
:type keyset: :class:`~google.cloud.spanner_v1.keyset.KeySet`
... | [
"Perform",
"a",
"ParitionRead",
"API",
"request",
"for",
"rows",
"in",
"a",
"table",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/snapshot.py#L239-L306 | train |
googleapis/google-cloud-python | spanner/google/cloud/spanner_v1/snapshot.py | _SnapshotBase.partition_query | def partition_query(
self,
sql,
params=None,
param_types=None,
partition_size_bytes=None,
max_partitions=None,
):
"""Perform a ``ParitionQuery`` API request.
:type sql: str
:param sql: SQL query statement
:type params: dict, {str -> c... | python | def partition_query(
self,
sql,
params=None,
param_types=None,
partition_size_bytes=None,
max_partitions=None,
):
"""Perform a ``ParitionQuery`` API request.
:type sql: str
:param sql: SQL query statement
:type params: dict, {str -> c... | [
"def",
"partition_query",
"(",
"self",
",",
"sql",
",",
"params",
"=",
"None",
",",
"param_types",
"=",
"None",
",",
"partition_size_bytes",
"=",
"None",
",",
"max_partitions",
"=",
"None",
",",
")",
":",
"if",
"not",
"self",
".",
"_multi_use",
":",
"rai... | Perform a ``ParitionQuery`` API request.
:type sql: str
:param sql: SQL query statement
:type params: dict, {str -> column value}
:param params: values for parameter replacement. Keys must match
the names used in ``sql``.
:type param_types: dict[str -> ... | [
"Perform",
"a",
"ParitionQuery",
"API",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/snapshot.py#L308-L381 | train |
googleapis/google-cloud-python | spanner/google/cloud/spanner_v1/snapshot.py | Snapshot._make_txn_selector | def _make_txn_selector(self):
"""Helper for :meth:`read`."""
if self._transaction_id is not None:
return TransactionSelector(id=self._transaction_id)
if self._read_timestamp:
key = "read_timestamp"
value = _datetime_to_pb_timestamp(self._read_timestamp)
... | python | def _make_txn_selector(self):
"""Helper for :meth:`read`."""
if self._transaction_id is not None:
return TransactionSelector(id=self._transaction_id)
if self._read_timestamp:
key = "read_timestamp"
value = _datetime_to_pb_timestamp(self._read_timestamp)
... | [
"def",
"_make_txn_selector",
"(",
"self",
")",
":",
"if",
"self",
".",
"_transaction_id",
"is",
"not",
"None",
":",
"return",
"TransactionSelector",
"(",
"id",
"=",
"self",
".",
"_transaction_id",
")",
"if",
"self",
".",
"_read_timestamp",
":",
"key",
"=",
... | Helper for :meth:`read`. | [
"Helper",
"for",
":",
"meth",
":",
"read",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/snapshot.py#L449-L477 | train |
googleapis/google-cloud-python | spanner/google/cloud/spanner_v1/snapshot.py | Snapshot.begin | def begin(self):
"""Begin a read-only transaction on the database.
:rtype: bytes
:returns: the ID for the newly-begun transaction.
:raises ValueError:
if the transaction is already begun, committed, or rolled back.
"""
if not self._multi_use:
rai... | python | def begin(self):
"""Begin a read-only transaction on the database.
:rtype: bytes
:returns: the ID for the newly-begun transaction.
:raises ValueError:
if the transaction is already begun, committed, or rolled back.
"""
if not self._multi_use:
rai... | [
"def",
"begin",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_multi_use",
":",
"raise",
"ValueError",
"(",
"\"Cannot call 'begin' on single-use snapshots\"",
")",
"if",
"self",
".",
"_transaction_id",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
... | Begin a read-only transaction on the database.
:rtype: bytes
:returns: the ID for the newly-begun transaction.
:raises ValueError:
if the transaction is already begun, committed, or rolled back. | [
"Begin",
"a",
"read",
"-",
"only",
"transaction",
"on",
"the",
"database",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/snapshot.py#L479-L505 | train |
googleapis/google-cloud-python | api_core/google/api_core/gapic_v1/client_info.py | ClientInfo.to_user_agent | def to_user_agent(self):
"""Returns the user-agent string for this client info."""
# Note: the order here is important as the internal metrics system
# expects these items to be in specific locations.
ua = ""
if self.user_agent is not None:
ua += "{user_agent} "
... | python | def to_user_agent(self):
"""Returns the user-agent string for this client info."""
# Note: the order here is important as the internal metrics system
# expects these items to be in specific locations.
ua = ""
if self.user_agent is not None:
ua += "{user_agent} "
... | [
"def",
"to_user_agent",
"(",
"self",
")",
":",
"# Note: the order here is important as the internal metrics system",
"# expects these items to be in specific locations.",
"ua",
"=",
"\"\"",
"if",
"self",
".",
"user_agent",
"is",
"not",
"None",
":",
"ua",
"+=",
"\"{user_agen... | Returns the user-agent string for this client info. | [
"Returns",
"the",
"user",
"-",
"agent",
"string",
"for",
"this",
"client",
"info",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/client_info.py#L75-L98 | train |
googleapis/google-cloud-python | bigquery_storage/google/cloud/bigquery_storage_v1beta1/client.py | BigQueryStorageClient.read_rows | def read_rows(
self,
read_position,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Reads rows from the table in the format prescribed by the read
session. Each response contains one... | python | def read_rows(
self,
read_position,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Reads rows from the table in the format prescribed by the read
session. Each response contains one... | [
"def",
"read_rows",
"(",
"self",
",",
"read_position",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"met... | Reads rows from the table in the format prescribed by the read
session. Each response contains one or more table rows, up to a
maximum of 10 MiB per response; read requests which attempt to read
individual rows larger than this will fail.
Each request also returns a set of stream statis... | [
"Reads",
"rows",
"from",
"the",
"table",
"in",
"the",
"format",
"prescribed",
"by",
"the",
"read",
"session",
".",
"Each",
"response",
"contains",
"one",
"or",
"more",
"table",
"rows",
"up",
"to",
"a",
"maximum",
"of",
"10",
"MiB",
"per",
"response",
";"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/client.py#L42-L126 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/v1/_gapic.py | make_trace_api | def make_trace_api(client):
"""
Create an instance of the gapic Trace API.
Args:
client (~google.cloud.trace.client.Client): The client that holds
configuration details.
Returns:
A :class:`~google.cloud.trace._gapic._TraceAPI` instance with the
proper configurations... | python | def make_trace_api(client):
"""
Create an instance of the gapic Trace API.
Args:
client (~google.cloud.trace.client.Client): The client that holds
configuration details.
Returns:
A :class:`~google.cloud.trace._gapic._TraceAPI` instance with the
proper configurations... | [
"def",
"make_trace_api",
"(",
"client",
")",
":",
"generated",
"=",
"trace_service_client",
".",
"TraceServiceClient",
"(",
"credentials",
"=",
"client",
".",
"_credentials",
",",
"client_info",
"=",
"_CLIENT_INFO",
")",
"return",
"_TraceAPI",
"(",
"generated",
",... | Create an instance of the gapic Trace API.
Args:
client (~google.cloud.trace.client.Client): The client that holds
configuration details.
Returns:
A :class:`~google.cloud.trace._gapic._TraceAPI` instance with the
proper configurations. | [
"Create",
"an",
"instance",
"of",
"the",
"gapic",
"Trace",
"API",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/_gapic.py#L168-L183 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/v1/_gapic.py | _TraceAPI.patch_traces | def patch_traces(self, project_id, traces):
"""
Sends new traces to Stackdriver Trace or updates existing traces.
Args:
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored.
traces (dict): Required. The traces to be patched i... | python | def patch_traces(self, project_id, traces):
"""
Sends new traces to Stackdriver Trace or updates existing traces.
Args:
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored.
traces (dict): Required. The traces to be patched i... | [
"def",
"patch_traces",
"(",
"self",
",",
"project_id",
",",
"traces",
")",
":",
"traces_pb",
"=",
"_traces_mapping_to_pb",
"(",
"traces",
")",
"self",
".",
"_gapic_api",
".",
"patch_traces",
"(",
"project_id",
",",
"traces_pb",
")"
] | Sends new traces to Stackdriver Trace or updates existing traces.
Args:
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored.
traces (dict): Required. The traces to be patched in the API call. | [
"Sends",
"new",
"traces",
"to",
"Stackdriver",
"Trace",
"or",
"updates",
"existing",
"traces",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/_gapic.py#L47-L57 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/v1/_gapic.py | _TraceAPI.get_trace | def get_trace(self, project_id, trace_id):
"""
Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace dict.
... | python | def get_trace(self, project_id, trace_id):
"""
Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace dict.
... | [
"def",
"get_trace",
"(",
"self",
",",
"project_id",
",",
"trace_id",
")",
":",
"trace_pb",
"=",
"self",
".",
"_gapic_api",
".",
"get_trace",
"(",
"project_id",
",",
"trace_id",
")",
"trace_mapping",
"=",
"_parse_trace_pb",
"(",
"trace_pb",
")",
"return",
"tr... | Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace dict. | [
"Gets",
"a",
"single",
"trace",
"by",
"its",
"ID",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/_gapic.py#L59-L73 | train |
googleapis/google-cloud-python | trace/google/cloud/trace/v1/_gapic.py | _TraceAPI.list_traces | def list_traces(
self,
project_id,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
page_token=None,
):
"""
Returns of a list of traces that match the filter conditions.
Args:
... | python | def list_traces(
self,
project_id,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
page_token=None,
):
"""
Returns of a list of traces that match the filter conditions.
Args:
... | [
"def",
"list_traces",
"(",
"self",
",",
"project_id",
",",
"view",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
"page_token",
"... | Returns of a list of traces that match the filter conditions.
Args:
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored.
view (Optional[~google.cloud.trace_v1.gapic.enums.
ListTracesRequest.ViewType]): Type of data returned... | [
"Returns",
"of",
"a",
"list",
"of",
"traces",
"that",
"match",
"the",
"filter",
"conditions",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/_gapic.py#L75-L133 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/client.py | _item_to_bucket | def _item_to_bucket(iterator, item):
"""Convert a JSON bucket to the native object.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that has retrieved the item.
:type item: dict
:param item: An item to be converted to a bucket.
:rtype: :class:`.B... | python | def _item_to_bucket(iterator, item):
"""Convert a JSON bucket to the native object.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that has retrieved the item.
:type item: dict
:param item: An item to be converted to a bucket.
:rtype: :class:`.B... | [
"def",
"_item_to_bucket",
"(",
"iterator",
",",
"item",
")",
":",
"name",
"=",
"item",
".",
"get",
"(",
"\"name\"",
")",
"bucket",
"=",
"Bucket",
"(",
"iterator",
".",
"client",
",",
"name",
")",
"bucket",
".",
"_set_properties",
"(",
"item",
")",
"ret... | Convert a JSON bucket to the native object.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that has retrieved the item.
:type item: dict
:param item: An item to be converted to a bucket.
:rtype: :class:`.Bucket`
:returns: The next bucket in the ... | [
"Convert",
"a",
"JSON",
"bucket",
"to",
"the",
"native",
"object",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/client.py#L374-L389 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/client.py | Client.create_anonymous_client | def create_anonymous_client(cls):
"""Factory: return client with anonymous credentials.
.. note::
Such a client has only limited access to "public" buckets:
listing their contents and downloading their blobs.
:rtype: :class:`google.cloud.storage.client.Client`
:r... | python | def create_anonymous_client(cls):
"""Factory: return client with anonymous credentials.
.. note::
Such a client has only limited access to "public" buckets:
listing their contents and downloading their blobs.
:rtype: :class:`google.cloud.storage.client.Client`
:r... | [
"def",
"create_anonymous_client",
"(",
"cls",
")",
":",
"client",
"=",
"cls",
"(",
"project",
"=",
"\"<none>\"",
",",
"credentials",
"=",
"AnonymousCredentials",
"(",
")",
")",
"client",
".",
"project",
"=",
"None",
"return",
"client"
] | Factory: return client with anonymous credentials.
.. note::
Such a client has only limited access to "public" buckets:
listing their contents and downloading their blobs.
:rtype: :class:`google.cloud.storage.client.Client`
:returns: Instance w/ anonymous credentials and... | [
"Factory",
":",
"return",
"client",
"with",
"anonymous",
"credentials",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/client.py#L81-L94 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/client.py | Client.get_service_account_email | def get_service_account_email(self, project=None):
"""Get the email address of the project's GCS service account
:type project: str
:param project:
(Optional) Project ID to use for retreiving GCS service account
email address. Defaults to the client's project.
... | python | def get_service_account_email(self, project=None):
"""Get the email address of the project's GCS service account
:type project: str
:param project:
(Optional) Project ID to use for retreiving GCS service account
email address. Defaults to the client's project.
... | [
"def",
"get_service_account_email",
"(",
"self",
",",
"project",
"=",
"None",
")",
":",
"if",
"project",
"is",
"None",
":",
"project",
"=",
"self",
".",
"project",
"path",
"=",
"\"/projects/%s/serviceAccount\"",
"%",
"(",
"project",
",",
")",
"api_response",
... | Get the email address of the project's GCS service account
:type project: str
:param project:
(Optional) Project ID to use for retreiving GCS service account
email address. Defaults to the client's project.
:rtype: str
:returns: service account email address | [
"Get",
"the",
"email",
"address",
"of",
"the",
"project",
"s",
"GCS",
"service",
"account"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/client.py#L157-L172 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/client.py | Client.bucket | def bucket(self, bucket_name, user_project=None):
"""Factory constructor for bucket object.
.. note::
This will not make an HTTP request; it simply instantiates
a bucket object owned by this client.
:type bucket_name: str
:param bucket_name: The name of the bucket t... | python | def bucket(self, bucket_name, user_project=None):
"""Factory constructor for bucket object.
.. note::
This will not make an HTTP request; it simply instantiates
a bucket object owned by this client.
:type bucket_name: str
:param bucket_name: The name of the bucket t... | [
"def",
"bucket",
"(",
"self",
",",
"bucket_name",
",",
"user_project",
"=",
"None",
")",
":",
"return",
"Bucket",
"(",
"client",
"=",
"self",
",",
"name",
"=",
"bucket_name",
",",
"user_project",
"=",
"user_project",
")"
] | Factory constructor for bucket object.
.. note::
This will not make an HTTP request; it simply instantiates
a bucket object owned by this client.
:type bucket_name: str
:param bucket_name: The name of the bucket to be instantiated.
:type user_project: str
:... | [
"Factory",
"constructor",
"for",
"bucket",
"object",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/client.py#L174-L191 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/client.py | Client.get_bucket | def get_bucket(self, bucket_name):
"""Get a bucket by name.
If the bucket isn't found, this will raise a
:class:`google.cloud.exceptions.NotFound`.
For example:
.. literalinclude:: snippets.py
:start-after: [START get_bucket]
:end-before: [END get_bucke... | python | def get_bucket(self, bucket_name):
"""Get a bucket by name.
If the bucket isn't found, this will raise a
:class:`google.cloud.exceptions.NotFound`.
For example:
.. literalinclude:: snippets.py
:start-after: [START get_bucket]
:end-before: [END get_bucke... | [
"def",
"get_bucket",
"(",
"self",
",",
"bucket_name",
")",
":",
"bucket",
"=",
"Bucket",
"(",
"self",
",",
"name",
"=",
"bucket_name",
")",
"bucket",
".",
"reload",
"(",
"client",
"=",
"self",
")",
"return",
"bucket"
] | Get a bucket by name.
If the bucket isn't found, this will raise a
:class:`google.cloud.exceptions.NotFound`.
For example:
.. literalinclude:: snippets.py
:start-after: [START get_bucket]
:end-before: [END get_bucket]
This implements "storage.buckets.g... | [
"Get",
"a",
"bucket",
"by",
"name",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/client.py#L205-L228 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/client.py | Client.create_bucket | def create_bucket(self, bucket_name, requester_pays=None, project=None):
"""Create a new bucket.
For example:
.. literalinclude:: snippets.py
:start-after: [START create_bucket]
:end-before: [END create_bucket]
This implements "storage.buckets.insert".
... | python | def create_bucket(self, bucket_name, requester_pays=None, project=None):
"""Create a new bucket.
For example:
.. literalinclude:: snippets.py
:start-after: [START create_bucket]
:end-before: [END create_bucket]
This implements "storage.buckets.insert".
... | [
"def",
"create_bucket",
"(",
"self",
",",
"bucket_name",
",",
"requester_pays",
"=",
"None",
",",
"project",
"=",
"None",
")",
":",
"bucket",
"=",
"Bucket",
"(",
"self",
",",
"name",
"=",
"bucket_name",
")",
"if",
"requester_pays",
"is",
"not",
"None",
"... | Create a new bucket.
For example:
.. literalinclude:: snippets.py
:start-after: [START create_bucket]
:end-before: [END create_bucket]
This implements "storage.buckets.insert".
If the bucket already exists, will raise
:class:`google.cloud.exceptions.Co... | [
"Create",
"a",
"new",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/client.py#L251-L288 | train |
googleapis/google-cloud-python | storage/google/cloud/storage/client.py | Client.list_buckets | def list_buckets(
self,
max_results=None,
page_token=None,
prefix=None,
projection="noAcl",
fields=None,
project=None,
):
"""Get all buckets in the project associated to the client.
This will not populate the list of blobs available in each
... | python | def list_buckets(
self,
max_results=None,
page_token=None,
prefix=None,
projection="noAcl",
fields=None,
project=None,
):
"""Get all buckets in the project associated to the client.
This will not populate the list of blobs available in each
... | [
"def",
"list_buckets",
"(",
"self",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
",",
"prefix",
"=",
"None",
",",
"projection",
"=",
"\"noAcl\"",
",",
"fields",
"=",
"None",
",",
"project",
"=",
"None",
",",
")",
":",
"if",
"project... | Get all buckets in the project associated to the client.
This will not populate the list of blobs available in each
bucket.
.. literalinclude:: snippets.py
:start-after: [START list_buckets]
:end-before: [END list_buckets]
This implements "storage.buckets.list"... | [
"Get",
"all",
"buckets",
"in",
"the",
"project",
"associated",
"to",
"the",
"client",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/client.py#L290-L371 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/client.py | _make_job_id | def _make_job_id(job_id, prefix=None):
"""Construct an ID for a new job.
:type job_id: str or ``NoneType``
:param job_id: the user-provided job ID
:type prefix: str or ``NoneType``
:param prefix: (Optional) the user-provided prefix for a job ID
:rtype: str
:returns: A job ID
"""
i... | python | def _make_job_id(job_id, prefix=None):
"""Construct an ID for a new job.
:type job_id: str or ``NoneType``
:param job_id: the user-provided job ID
:type prefix: str or ``NoneType``
:param prefix: (Optional) the user-provided prefix for a job ID
:rtype: str
:returns: A job ID
"""
i... | [
"def",
"_make_job_id",
"(",
"job_id",
",",
"prefix",
"=",
"None",
")",
":",
"if",
"job_id",
"is",
"not",
"None",
":",
"return",
"job_id",
"elif",
"prefix",
"is",
"not",
"None",
":",
"return",
"str",
"(",
"prefix",
")",
"+",
"str",
"(",
"uuid",
".",
... | Construct an ID for a new job.
:type job_id: str or ``NoneType``
:param job_id: the user-provided job ID
:type prefix: str or ``NoneType``
:param prefix: (Optional) the user-provided prefix for a job ID
:rtype: str
:returns: A job ID | [
"Construct",
"an",
"ID",
"for",
"a",
"new",
"job",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/client.py#L2059-L2076 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/client.py | _check_mode | def _check_mode(stream):
"""Check that a stream was opened in read-binary mode.
:type stream: IO[bytes]
:param stream: A bytes IO object open for reading.
:raises: :exc:`ValueError` if the ``stream.mode`` is a valid attribute
and is not among ``rb``, ``r+b`` or ``rb+``.
"""
mode =... | python | def _check_mode(stream):
"""Check that a stream was opened in read-binary mode.
:type stream: IO[bytes]
:param stream: A bytes IO object open for reading.
:raises: :exc:`ValueError` if the ``stream.mode`` is a valid attribute
and is not among ``rb``, ``r+b`` or ``rb+``.
"""
mode =... | [
"def",
"_check_mode",
"(",
"stream",
")",
":",
"mode",
"=",
"getattr",
"(",
"stream",
",",
"\"mode\"",
",",
"None",
")",
"if",
"isinstance",
"(",
"stream",
",",
"gzip",
".",
"GzipFile",
")",
":",
"if",
"mode",
"!=",
"gzip",
".",
"READ",
":",
"raise",... | Check that a stream was opened in read-binary mode.
:type stream: IO[bytes]
:param stream: A bytes IO object open for reading.
:raises: :exc:`ValueError` if the ``stream.mode`` is a valid attribute
and is not among ``rb``, ``r+b`` or ``rb+``. | [
"Check",
"that",
"a",
"stream",
"was",
"opened",
"in",
"read",
"-",
"binary",
"mode",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/client.py#L2079-L2101 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/client.py | Client.get_service_account_email | def get_service_account_email(self, project=None):
"""Get the email address of the project's BigQuery service account
Note:
This is the service account that BigQuery uses to manage tables
encrypted by a key in KMS.
Args:
project (str, optional):
... | python | def get_service_account_email(self, project=None):
"""Get the email address of the project's BigQuery service account
Note:
This is the service account that BigQuery uses to manage tables
encrypted by a key in KMS.
Args:
project (str, optional):
... | [
"def",
"get_service_account_email",
"(",
"self",
",",
"project",
"=",
"None",
")",
":",
"if",
"project",
"is",
"None",
":",
"project",
"=",
"self",
".",
"project",
"path",
"=",
"\"/projects/%s/serviceAccount\"",
"%",
"(",
"project",
",",
")",
"api_response",
... | Get the email address of the project's BigQuery service account
Note:
This is the service account that BigQuery uses to manage tables
encrypted by a key in KMS.
Args:
project (str, optional):
Project ID to use for retreiving service account email.
... | [
"Get",
"the",
"email",
"address",
"of",
"the",
"project",
"s",
"BigQuery",
"service",
"account"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/client.py#L164-L191 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/client.py | Client.list_projects | def list_projects(self, max_results=None, page_token=None, retry=DEFAULT_RETRY):
"""List projects for the project associated with this client.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/projects/list
:type max_results: int
:param max_results: (Optional) maximu... | python | def list_projects(self, max_results=None, page_token=None, retry=DEFAULT_RETRY):
"""List projects for the project associated with this client.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/projects/list
:type max_results: int
:param max_results: (Optional) maximu... | [
"def",
"list_projects",
"(",
"self",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY",
")",
":",
"return",
"page_iterator",
".",
"HTTPIterator",
"(",
"client",
"=",
"self",
",",
"api_request",
"=",
"functool... | List projects for the project associated with this client.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/projects/list
:type max_results: int
:param max_results: (Optional) maximum number of projects to return,
If not passed, defaults to a val... | [
"List",
"projects",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/client.py#L193-L227 | train |
googleapis/google-cloud-python | bigquery/google/cloud/bigquery/client.py | Client.list_datasets | def list_datasets(
self,
project=None,
include_all=False,
filter=None,
max_results=None,
page_token=None,
retry=DEFAULT_RETRY,
):
"""List datasets for the project associated with this client.
See
https://cloud.google.com/bigquery/docs/... | python | def list_datasets(
self,
project=None,
include_all=False,
filter=None,
max_results=None,
page_token=None,
retry=DEFAULT_RETRY,
):
"""List datasets for the project associated with this client.
See
https://cloud.google.com/bigquery/docs/... | [
"def",
"list_datasets",
"(",
"self",
",",
"project",
"=",
"None",
",",
"include_all",
"=",
"False",
",",
"filter",
"=",
"None",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
",",
"retry",
"=",
"DEFAULT_RETRY",
",",
")",
":",
"extra_par... | List datasets for the project associated with this client.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/list
Args:
project (str):
Optional. Project ID to use for retreiving datasets. Defaults
to the client's project.
... | [
"List",
"datasets",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/client.py#L229-L291 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.