repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
googleapis/google-cloud-python
bigquery/samples/update_model.py
update_model
def update_model(client, model_id): """Sample ID: go/samples-tracker/1533""" # [START bigquery_update_model_description] from google.cloud import bigquery # TODO(developer): Construct a BigQuery client object. # client = bigquery.Client() # TODO(developer): Set model_id to the ID of the model...
python
def update_model(client, model_id): """Sample ID: go/samples-tracker/1533""" # [START bigquery_update_model_description] from google.cloud import bigquery # TODO(developer): Construct a BigQuery client object. # client = bigquery.Client() # TODO(developer): Set model_id to the ID of the model...
[ "def", "update_model", "(", "client", ",", "model_id", ")", ":", "# [START bigquery_update_model_description]", "from", "google", ".", "cloud", "import", "bigquery", "# TODO(developer): Construct a BigQuery client object.", "# client = bigquery.Client()", "# TODO(developer): Set mo...
Sample ID: go/samples-tracker/1533
[ "Sample", "ID", ":", "go", "/", "samples", "-", "tracker", "/", "1533" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/samples/update_model.py#L16-L37
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
_pb_from_query
def _pb_from_query(query): """Convert a Query instance to the corresponding protobuf. :type query: :class:`Query` :param query: The source query. :rtype: :class:`.query_pb2.Query` :returns: A protobuf that can be sent to the protobuf API. N.b. that it does not contain "in-flight" fi...
python
def _pb_from_query(query): """Convert a Query instance to the corresponding protobuf. :type query: :class:`Query` :param query: The source query. :rtype: :class:`.query_pb2.Query` :returns: A protobuf that can be sent to the protobuf API. N.b. that it does not contain "in-flight" fi...
[ "def", "_pb_from_query", "(", "query", ")", ":", "pb", "=", "query_pb2", ".", "Query", "(", ")", "for", "projection_name", "in", "query", ".", "projection", ":", "pb", ".", "projection", ".", "add", "(", ")", ".", "property", ".", "name", "=", "project...
Convert a Query instance to the corresponding protobuf. :type query: :class:`Query` :param query: The source query. :rtype: :class:`.query_pb2.Query` :returns: A protobuf that can be sent to the protobuf API. N.b. that it does not contain "in-flight" fields for ongoing query ...
[ "Convert", "a", "Query", "instance", "to", "the", "corresponding", "protobuf", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L543-L605
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.namespace
def namespace(self, value): """Update the query's namespace. :type value: str """ if not isinstance(value, str): raise ValueError("Namespace must be a string") self._namespace = value
python
def namespace(self, value): """Update the query's namespace. :type value: str """ if not isinstance(value, str): raise ValueError("Namespace must be a string") self._namespace = value
[ "def", "namespace", "(", "self", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "str", ")", ":", "raise", "ValueError", "(", "\"Namespace must be a string\"", ")", "self", ".", "_namespace", "=", "value" ]
Update the query's namespace. :type value: str
[ "Update", "the", "query", "s", "namespace", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L137-L144
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.kind
def kind(self, value): """Update the Kind of the Query. :type value: str :param value: updated kind for the query. .. note:: The protobuf specification allows for ``kind`` to be repeated, but the current implementation returns an error if more than one...
python
def kind(self, value): """Update the Kind of the Query. :type value: str :param value: updated kind for the query. .. note:: The protobuf specification allows for ``kind`` to be repeated, but the current implementation returns an error if more than one...
[ "def", "kind", "(", "self", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "str", ")", ":", "raise", "TypeError", "(", "\"Kind must be a string\"", ")", "self", ".", "_kind", "=", "value" ]
Update the Kind of the Query. :type value: str :param value: updated kind for the query. .. note:: The protobuf specification allows for ``kind`` to be repeated, but the current implementation returns an error if more than one value is passed. If the back-end...
[ "Update", "the", "Kind", "of", "the", "Query", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L156-L172
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.ancestor
def ancestor(self, value): """Set the ancestor for the query :type value: :class:`~google.cloud.datastore.key.Key` :param value: the new ancestor key """ if not isinstance(value, Key): raise TypeError("Ancestor must be a Key") self._ancestor = value
python
def ancestor(self, value): """Set the ancestor for the query :type value: :class:`~google.cloud.datastore.key.Key` :param value: the new ancestor key """ if not isinstance(value, Key): raise TypeError("Ancestor must be a Key") self._ancestor = value
[ "def", "ancestor", "(", "self", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "Key", ")", ":", "raise", "TypeError", "(", "\"Ancestor must be a Key\"", ")", "self", ".", "_ancestor", "=", "value" ]
Set the ancestor for the query :type value: :class:`~google.cloud.datastore.key.Key` :param value: the new ancestor key
[ "Set", "the", "ancestor", "for", "the", "query" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L184-L192
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.add_filter
def add_filter(self, property_name, operator, value): """Filter the query based on a property name, operator and a value. Expressions take the form of:: .add_filter('<property>', '<operator>', <value>) where property is a property stored on the entity in the datastore and op...
python
def add_filter(self, property_name, operator, value): """Filter the query based on a property name, operator and a value. Expressions take the form of:: .add_filter('<property>', '<operator>', <value>) where property is a property stored on the entity in the datastore and op...
[ "def", "add_filter", "(", "self", ",", "property_name", ",", "operator", ",", "value", ")", ":", "if", "self", ".", "OPERATORS", ".", "get", "(", "operator", ")", "is", "None", ":", "error_message", "=", "'Invalid expression: \"%s\"'", "%", "(", "operator", ...
Filter the query based on a property name, operator and a value. Expressions take the form of:: .add_filter('<property>', '<operator>', <value>) where property is a property stored on the entity in the datastore and operator is one of ``OPERATORS`` (ie, ``=``, ``<``, ``<=``,...
[ "Filter", "the", "query", "based", "on", "a", "property", "name", "operator", "and", "a", "value", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L209-L250
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.projection
def projection(self, projection): """Set the fields returned the query. :type projection: str or sequence of strings :param projection: Each value is a string giving the name of a property to be included in the projection query. """ if isinstance(proje...
python
def projection(self, projection): """Set the fields returned the query. :type projection: str or sequence of strings :param projection: Each value is a string giving the name of a property to be included in the projection query. """ if isinstance(proje...
[ "def", "projection", "(", "self", ",", "projection", ")", ":", "if", "isinstance", "(", "projection", ",", "str", ")", ":", "projection", "=", "[", "projection", "]", "self", ".", "_projection", "[", ":", "]", "=", "projection" ]
Set the fields returned the query. :type projection: str or sequence of strings :param projection: Each value is a string giving the name of a property to be included in the projection query.
[ "Set", "the", "fields", "returned", "the", "query", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L262-L271
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.order
def order(self, value): """Set the fields used to sort query results. Sort fields will be applied in the order specified. :type value: str or sequence of strings :param value: Each value is a string giving the name of the property on which to sort, optionally prec...
python
def order(self, value): """Set the fields used to sort query results. Sort fields will be applied in the order specified. :type value: str or sequence of strings :param value: Each value is a string giving the name of the property on which to sort, optionally prec...
[ "def", "order", "(", "self", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "str", ")", ":", "value", "=", "[", "value", "]", "self", ".", "_order", "[", ":", "]", "=", "value" ]
Set the fields used to sort query results. Sort fields will be applied in the order specified. :type value: str or sequence of strings :param value: Each value is a string giving the name of the property on which to sort, optionally preceded by a hyp...
[ "Set", "the", "fields", "used", "to", "sort", "query", "results", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L299-L312
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.distinct_on
def distinct_on(self, value): """Set fields used to group query results. :type value: str or sequence of strings :param value: Each value is a string giving the name of a property to use to group results together. """ if isinstance(value, str): ...
python
def distinct_on(self, value): """Set fields used to group query results. :type value: str or sequence of strings :param value: Each value is a string giving the name of a property to use to group results together. """ if isinstance(value, str): ...
[ "def", "distinct_on", "(", "self", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "str", ")", ":", "value", "=", "[", "value", "]", "self", ".", "_distinct_on", "[", ":", "]", "=", "value" ]
Set fields used to group query results. :type value: str or sequence of strings :param value: Each value is a string giving the name of a property to use to group results together.
[ "Set", "fields", "used", "to", "group", "query", "results", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L324-L333
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Query.fetch
def fetch( self, limit=None, offset=0, start_cursor=None, end_cursor=None, client=None, eventual=False, ): """Execute the Query; return an iterator for the matching entities. For example:: >>> from google.cloud import datastore ...
python
def fetch( self, limit=None, offset=0, start_cursor=None, end_cursor=None, client=None, eventual=False, ): """Execute the Query; return an iterator for the matching entities. For example:: >>> from google.cloud import datastore ...
[ "def", "fetch", "(", "self", ",", "limit", "=", "None", ",", "offset", "=", "0", ",", "start_cursor", "=", "None", ",", "end_cursor", "=", "None", ",", "client", "=", "None", ",", "eventual", "=", "False", ",", ")", ":", "if", "client", "is", "None...
Execute the Query; return an iterator for the matching entities. For example:: >>> from google.cloud import datastore >>> client = datastore.Client() >>> query = client.query(kind='Person') >>> query.add_filter('name', '=', 'Sally') >>> list(query.fetch()) ...
[ "Execute", "the", "Query", ";", "return", "an", "iterator", "for", "the", "matching", "entities", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L335-L393
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Iterator._build_protobuf
def _build_protobuf(self): """Build a query protobuf. Relies on the current state of the iterator. :rtype: :class:`.query_pb2.Query` :returns: The query protobuf object for the current state of the iterator. """ pb = _pb_from_query(self._qu...
python
def _build_protobuf(self): """Build a query protobuf. Relies on the current state of the iterator. :rtype: :class:`.query_pb2.Query` :returns: The query protobuf object for the current state of the iterator. """ pb = _pb_from_query(self._qu...
[ "def", "_build_protobuf", "(", "self", ")", ":", "pb", "=", "_pb_from_query", "(", "self", ".", "_query", ")", "start_cursor", "=", "self", ".", "next_page_token", "if", "start_cursor", "is", "not", "None", ":", "pb", ".", "start_cursor", "=", "base64", "....
Build a query protobuf. Relies on the current state of the iterator. :rtype: :class:`.query_pb2.Query` :returns: The query protobuf object for the current state of the iterator.
[ "Build", "a", "query", "protobuf", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L454-L484
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Iterator._process_query_results
def _process_query_results(self, response_pb): """Process the response from a datastore query. :type response_pb: :class:`.datastore_pb2.RunQueryResponse` :param response_pb: The protobuf response from a ``runQuery`` request. :rtype: iterable :returns: The next page of entity r...
python
def _process_query_results(self, response_pb): """Process the response from a datastore query. :type response_pb: :class:`.datastore_pb2.RunQueryResponse` :param response_pb: The protobuf response from a ``runQuery`` request. :rtype: iterable :returns: The next page of entity r...
[ "def", "_process_query_results", "(", "self", ",", "response_pb", ")", ":", "self", ".", "_skipped_results", "=", "response_pb", ".", "batch", ".", "skipped_results", "if", "response_pb", ".", "batch", ".", "more_results", "==", "_NO_MORE_RESULTS", ":", "self", ...
Process the response from a datastore query. :type response_pb: :class:`.datastore_pb2.RunQueryResponse` :param response_pb: The protobuf response from a ``runQuery`` request. :rtype: iterable :returns: The next page of entity results. :raises ValueError: If ``more_results`` is...
[ "Process", "the", "response", "from", "a", "datastore", "query", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L486-L513
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/query.py
Iterator._next_page
def _next_page(self): """Get the next page in the iterator. :rtype: :class:`~google.cloud.iterator.Page` :returns: The next page in the iterator (or :data:`None` if there are no pages left). """ if not self._more_results: return None query_...
python
def _next_page(self): """Get the next page in the iterator. :rtype: :class:`~google.cloud.iterator.Page` :returns: The next page in the iterator (or :data:`None` if there are no pages left). """ if not self._more_results: return None query_...
[ "def", "_next_page", "(", "self", ")", ":", "if", "not", "self", ".", "_more_results", ":", "return", "None", "query_pb", "=", "self", ".", "_build_protobuf", "(", ")", "transaction", "=", "self", ".", "client", ".", "current_transaction", "if", "transaction...
Get the next page in the iterator. :rtype: :class:`~google.cloud.iterator.Page` :returns: The next page in the iterator (or :data:`None` if there are no pages left).
[ "Get", "the", "next", "page", "in", "the", "iterator", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L515-L540
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/batch.py
_make_write_pb
def _make_write_pb(table, columns, values): """Helper for :meth:`Batch.insert` et aliae. :type table: str :param table: Name of the table to be modified. :type columns: list of str :param columns: Name of the table columns to be modified. :type values: list of lists :param values: Values ...
python
def _make_write_pb(table, columns, values): """Helper for :meth:`Batch.insert` et aliae. :type table: str :param table: Name of the table to be modified. :type columns: list of str :param columns: Name of the table columns to be modified. :type values: list of lists :param values: Values ...
[ "def", "_make_write_pb", "(", "table", ",", "columns", ",", "values", ")", ":", "return", "Mutation", ".", "Write", "(", "table", "=", "table", ",", "columns", "=", "columns", ",", "values", "=", "_make_list_value_pbs", "(", "values", ")", ")" ]
Helper for :meth:`Batch.insert` et aliae. :type table: str :param table: Name of the table to be modified. :type columns: list of str :param columns: Name of the table columns to be modified. :type values: list of lists :param values: Values to be modified. :rtype: :class:`google.cloud.s...
[ "Helper", "for", ":", "meth", ":", "Batch", ".", "insert", "et", "aliae", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L171-L188
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/batch.py
_BatchBase.update
def update(self, table, columns, values): """Update one or more existing table rows. :type table: str :param table: Name of the table to be modified. :type columns: list of str :param columns: Name of the table columns to be modified. :type values: list of lists ...
python
def update(self, table, columns, values): """Update one or more existing table rows. :type table: str :param table: Name of the table to be modified. :type columns: list of str :param columns: Name of the table columns to be modified. :type values: list of lists ...
[ "def", "update", "(", "self", ",", "table", ",", "columns", ",", "values", ")", ":", "self", ".", "_mutations", ".", "append", "(", "Mutation", "(", "update", "=", "_make_write_pb", "(", "table", ",", "columns", ",", "values", ")", ")", ")" ]
Update one or more existing table rows. :type table: str :param table: Name of the table to be modified. :type columns: list of str :param columns: Name of the table columns to be modified. :type values: list of lists :param values: Values to be modified.
[ "Update", "one", "or", "more", "existing", "table", "rows", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L64-L76
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/batch.py
_BatchBase.delete
def delete(self, table, keyset): """Delete one or more table rows. :type table: str :param table: Name of the table to be modified. :type keyset: :class:`~google.cloud.spanner_v1.keyset.Keyset` :param keyset: Keys/ranges identifying rows to delete. """ delete = ...
python
def delete(self, table, keyset): """Delete one or more table rows. :type table: str :param table: Name of the table to be modified. :type keyset: :class:`~google.cloud.spanner_v1.keyset.Keyset` :param keyset: Keys/ranges identifying rows to delete. """ delete = ...
[ "def", "delete", "(", "self", ",", "table", ",", "keyset", ")", ":", "delete", "=", "Mutation", ".", "Delete", "(", "table", "=", "table", ",", "key_set", "=", "keyset", ".", "_to_pb", "(", ")", ")", "self", ".", "_mutations", ".", "append", "(", "...
Delete one or more table rows. :type table: str :param table: Name of the table to be modified. :type keyset: :class:`~google.cloud.spanner_v1.keyset.Keyset` :param keyset: Keys/ranges identifying rows to delete.
[ "Delete", "one", "or", "more", "table", "rows", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L108-L118
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/batch.py
Batch.commit
def commit(self): """Commit mutations to the database. :rtype: datetime :returns: timestamp of the committed changes. """ self._check_state() database = self._session._database api = database.spanner_api metadata = _metadata_with_prefix(database.name) ...
python
def commit(self): """Commit mutations to the database. :rtype: datetime :returns: timestamp of the committed changes. """ self._check_state() database = self._session._database api = database.spanner_api metadata = _metadata_with_prefix(database.name) ...
[ "def", "commit", "(", "self", ")", ":", "self", ".", "_check_state", "(", ")", "database", "=", "self", ".", "_session", ".", "_database", "api", "=", "database", ".", "spanner_api", "metadata", "=", "_metadata_with_prefix", "(", "database", ".", "name", "...
Commit mutations to the database. :rtype: datetime :returns: timestamp of the committed changes.
[ "Commit", "mutations", "to", "the", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L139-L157
train
googleapis/google-cloud-python
bigquery/docs/snippets.py
dataset_exists
def dataset_exists(client, dataset_reference): """Return if a dataset exists. Args: client (google.cloud.bigquery.client.Client): A client to connect to the BigQuery API. dataset_reference (google.cloud.bigquery.dataset.DatasetReference): A reference to the dataset to lo...
python
def dataset_exists(client, dataset_reference): """Return if a dataset exists. Args: client (google.cloud.bigquery.client.Client): A client to connect to the BigQuery API. dataset_reference (google.cloud.bigquery.dataset.DatasetReference): A reference to the dataset to lo...
[ "def", "dataset_exists", "(", "client", ",", "dataset_reference", ")", ":", "from", "google", ".", "cloud", ".", "exceptions", "import", "NotFound", "try", ":", "client", ".", "get_dataset", "(", "dataset_reference", ")", "return", "True", "except", "NotFound", ...
Return if a dataset exists. Args: client (google.cloud.bigquery.client.Client): A client to connect to the BigQuery API. dataset_reference (google.cloud.bigquery.dataset.DatasetReference): A reference to the dataset to look for. Returns: bool: ``True`` if the da...
[ "Return", "if", "a", "dataset", "exists", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/docs/snippets.py#L178-L196
train
googleapis/google-cloud-python
bigquery/docs/snippets.py
table_exists
def table_exists(client, table_reference): """Return if a table exists. Args: client (google.cloud.bigquery.client.Client): A client to connect to the BigQuery API. table_reference (google.cloud.bigquery.table.TableReference): A reference to the table to look for. R...
python
def table_exists(client, table_reference): """Return if a table exists. Args: client (google.cloud.bigquery.client.Client): A client to connect to the BigQuery API. table_reference (google.cloud.bigquery.table.TableReference): A reference to the table to look for. R...
[ "def", "table_exists", "(", "client", ",", "table_reference", ")", ":", "from", "google", ".", "cloud", ".", "exceptions", "import", "NotFound", "try", ":", "client", ".", "get_table", "(", "table_reference", ")", "return", "True", "except", "NotFound", ":", ...
Return if a table exists. Args: client (google.cloud.bigquery.client.Client): A client to connect to the BigQuery API. table_reference (google.cloud.bigquery.table.TableReference): A reference to the table to look for. Returns: bool: ``True`` if the table exists...
[ "Return", "if", "a", "table", "exists", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/docs/snippets.py#L460-L478
train
googleapis/google-cloud-python
datastore/google/cloud/datastore_v1/gapic/datastore_client.py
DatastoreClient.run_query
def run_query( self, project_id, partition_id, read_options=None, query=None, gql_query=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Queries for enti...
python
def run_query( self, project_id, partition_id, read_options=None, query=None, gql_query=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Queries for enti...
[ "def", "run_query", "(", "self", ",", "project_id", ",", "partition_id", ",", "read_options", "=", "None", ",", "query", "=", "None", ",", "gql_query", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAU...
Queries for entities. Example: >>> from google.cloud import datastore_v1 >>> >>> client = datastore_v1.DatastoreClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>> # TODO: Initialize `parti...
[ "Queries", "for", "entities", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore_v1/gapic/datastore_client.py#L264-L368
train
googleapis/google-cloud-python
datastore/google/cloud/datastore_v1/gapic/datastore_client.py
DatastoreClient.commit
def commit( self, project_id, mode, mutations, transaction=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Commits a transaction, optionally creating, deleting ...
python
def commit( self, project_id, mode, mutations, transaction=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Commits a transaction, optionally creating, deleting ...
[ "def", "commit", "(", "self", ",", "project_id", ",", "mode", ",", "mutations", ",", "transaction", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core",...
Commits a transaction, optionally creating, deleting or modifying some entities. Example: >>> from google.cloud import datastore_v1 >>> from google.cloud.datastore_v1 import enums >>> >>> client = datastore_v1.DatastoreClient() >>> ...
[ "Commits", "a", "transaction", "optionally", "creating", "deleting", "or", "modifying", "some", "entities", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore_v1/gapic/datastore_client.py#L447-L555
train
googleapis/google-cloud-python
logging/google/cloud/logging/handlers/app_engine.py
AppEngineHandler.get_gae_resource
def get_gae_resource(self): """Return the GAE resource using the environment variables. :rtype: :class:`~google.cloud.logging.resource.Resource` :returns: Monitored resource for GAE. """ gae_resource = Resource( type="gae_app", labels={ "p...
python
def get_gae_resource(self): """Return the GAE resource using the environment variables. :rtype: :class:`~google.cloud.logging.resource.Resource` :returns: Monitored resource for GAE. """ gae_resource = Resource( type="gae_app", labels={ "p...
[ "def", "get_gae_resource", "(", "self", ")", ":", "gae_resource", "=", "Resource", "(", "type", "=", "\"gae_app\"", ",", "labels", "=", "{", "\"project_id\"", ":", "self", ".", "project_id", ",", "\"module_id\"", ":", "self", ".", "module_id", ",", "\"versio...
Return the GAE resource using the environment variables. :rtype: :class:`~google.cloud.logging.resource.Resource` :returns: Monitored resource for GAE.
[ "Return", "the", "GAE", "resource", "using", "the", "environment", "variables", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/app_engine.py#L72-L86
train
googleapis/google-cloud-python
logging/google/cloud/logging/handlers/app_engine.py
AppEngineHandler.get_gae_labels
def get_gae_labels(self): """Return the labels for GAE app. If the trace ID can be detected, it will be included as a label. Currently, no other labels are included. :rtype: dict :returns: Labels for GAE app. """ gae_labels = {} trace_id = get_trace_id(...
python
def get_gae_labels(self): """Return the labels for GAE app. If the trace ID can be detected, it will be included as a label. Currently, no other labels are included. :rtype: dict :returns: Labels for GAE app. """ gae_labels = {} trace_id = get_trace_id(...
[ "def", "get_gae_labels", "(", "self", ")", ":", "gae_labels", "=", "{", "}", "trace_id", "=", "get_trace_id", "(", ")", "if", "trace_id", "is", "not", "None", ":", "gae_labels", "[", "_TRACE_ID_LABEL", "]", "=", "trace_id", "return", "gae_labels" ]
Return the labels for GAE app. If the trace ID can be detected, it will be included as a label. Currently, no other labels are included. :rtype: dict :returns: Labels for GAE app.
[ "Return", "the", "labels", "for", "GAE", "app", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/app_engine.py#L88-L103
train
googleapis/google-cloud-python
logging/google/cloud/logging/handlers/app_engine.py
AppEngineHandler.emit
def emit(self, record): """Actually log the specified logging record. Overrides the default emit behavior of ``StreamHandler``. See https://docs.python.org/2/library/logging.html#handler-objects :type record: :class:`logging.LogRecord` :param record: The record to be logged. ...
python
def emit(self, record): """Actually log the specified logging record. Overrides the default emit behavior of ``StreamHandler``. See https://docs.python.org/2/library/logging.html#handler-objects :type record: :class:`logging.LogRecord` :param record: The record to be logged. ...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "message", "=", "super", "(", "AppEngineHandler", ",", "self", ")", ".", "format", "(", "record", ")", "gae_labels", "=", "self", ".", "get_gae_labels", "(", ")", "trace_id", "=", "(", "\"projects/%s/t...
Actually log the specified logging record. Overrides the default emit behavior of ``StreamHandler``. See https://docs.python.org/2/library/logging.html#handler-objects :type record: :class:`logging.LogRecord` :param record: The record to be logged.
[ "Actually", "log", "the", "specified", "logging", "record", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/app_engine.py#L105-L124
train
googleapis/google-cloud-python
iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py
IAMCredentialsClient.service_account_path
def service_account_path(cls, project, service_account): """Return a fully-qualified service_account string.""" return google.api_core.path_template.expand( "projects/{project}/serviceAccounts/{service_account}", project=project, service_account=service_account, ...
python
def service_account_path(cls, project, service_account): """Return a fully-qualified service_account string.""" return google.api_core.path_template.expand( "projects/{project}/serviceAccounts/{service_account}", project=project, service_account=service_account, ...
[ "def", "service_account_path", "(", "cls", ",", "project", ",", "service_account", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/serviceAccounts/{service_account}\"", ",", "project", "=", "project", ",",...
Return a fully-qualified service_account string.
[ "Return", "a", "fully", "-", "qualified", "service_account", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py#L82-L88
train
googleapis/google-cloud-python
iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py
IAMCredentialsClient.generate_access_token
def generate_access_token( self, name, scope, delegates=None, lifetime=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Generates an OAuth 2.0 access token for a...
python
def generate_access_token( self, name, scope, delegates=None, lifetime=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Generates an OAuth 2.0 access token for a...
[ "def", "generate_access_token", "(", "self", ",", "name", ",", "scope", ",", "delegates", "=", "None", ",", "lifetime", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "googl...
Generates an OAuth 2.0 access token for a service account. Example: >>> from google.cloud import iam_credentials_v1 >>> >>> client = iam_credentials_v1.IAMCredentialsClient() >>> >>> name = client.service_account_path('[PROJECT]', '[SERVICE_ACCOUNT]')...
[ "Generates", "an", "OAuth", "2", ".", "0", "access", "token", "for", "a", "service", "account", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py#L189-L286
train
googleapis/google-cloud-python
iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py
IAMCredentialsClient.generate_id_token
def generate_id_token( self, name, audience, delegates=None, include_email=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Generates an OpenID Connect ID token ...
python
def generate_id_token( self, name, audience, delegates=None, include_email=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Generates an OpenID Connect ID token ...
[ "def", "generate_id_token", "(", "self", ",", "name", ",", "audience", ",", "delegates", "=", "None", ",", "include_email", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "g...
Generates an OpenID Connect ID token for a service account. Example: >>> from google.cloud import iam_credentials_v1 >>> >>> client = iam_credentials_v1.IAMCredentialsClient() >>> >>> name = client.service_account_path('[PROJECT]', '[SERVICE_ACCOUNT]'...
[ "Generates", "an", "OpenID", "Connect", "ID", "token", "for", "a", "service", "account", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py#L288-L381
train
googleapis/google-cloud-python
iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py
IAMCredentialsClient.sign_blob
def sign_blob( self, name, payload, delegates=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Signs a blob using a service account's system-managed private key. ...
python
def sign_blob( self, name, payload, delegates=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Signs a blob using a service account's system-managed private key. ...
[ "def", "sign_blob", "(", "self", ",", "name", ",", "payload", ",", "delegates", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ...
Signs a blob using a service account's system-managed private key. Example: >>> from google.cloud import iam_credentials_v1 >>> >>> client = iam_credentials_v1.IAMCredentialsClient() >>> >>> name = client.service_account_path('[PROJECT]', '[SERVICE_AC...
[ "Signs", "a", "blob", "using", "a", "service", "account", "s", "system", "-", "managed", "private", "key", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py#L383-L469
train
googleapis/google-cloud-python
iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py
IAMCredentialsClient.generate_identity_binding_access_token
def generate_identity_binding_access_token( self, name, scope, jwt, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Exchange a JWT signed by third party identity provider to ...
python
def generate_identity_binding_access_token( self, name, scope, jwt, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Exchange a JWT signed by third party identity provider to ...
[ "def", "generate_identity_binding_access_token", "(", "self", ",", "name", ",", "scope", ",", "jwt", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1"...
Exchange a JWT signed by third party identity provider to an OAuth 2.0 access token Example: >>> from google.cloud import iam_credentials_v1 >>> >>> client = iam_credentials_v1.IAMCredentialsClient() >>> >>> name = client.service_account_path(...
[ "Exchange", "a", "JWT", "signed", "by", "third", "party", "identity", "provider", "to", "an", "OAuth", "2", ".", "0", "access", "token" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py#L559-L682
train
googleapis/google-cloud-python
datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py
DataCatalogClient.entry_path
def entry_path(cls, project, location, entry_group, entry): """Return a fully-qualified entry string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}", project=project, location=locatio...
python
def entry_path(cls, project, location, entry_group, entry): """Return a fully-qualified entry string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}", project=project, location=locatio...
[ "def", "entry_path", "(", "cls", ",", "project", ",", "location", ",", "entry_group", ",", "entry", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{ent...
Return a fully-qualified entry string.
[ "Return", "a", "fully", "-", "qualified", "entry", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py#L86-L94
train
googleapis/google-cloud-python
datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py
DataCatalogClient.lookup_entry
def lookup_entry( self, linked_resource=None, sql_resource=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Get an entry by target resource name. This method allows clients to u...
python
def lookup_entry( self, linked_resource=None, sql_resource=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Get an entry by target resource name. This method allows clients to u...
[ "def", "lookup_entry", "(", "self", ",", "linked_resource", "=", "None", ",", "sql_resource", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", ...
Get an entry by target resource name. This method allows clients to use the resource name from the source Google Cloud Platform service to get the Cloud Data Catalog Entry. Example: >>> from google.cloud import datacatalog_v1beta1 >>> >>> client = datacatalog...
[ "Get", "an", "entry", "by", "target", "resource", "name", ".", "This", "method", "allows", "clients", "to", "use", "the", "resource", "name", "from", "the", "source", "Google", "Cloud", "Platform", "service", "to", "get", "the", "Cloud", "Data", "Catalog", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py#L195-L272
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
_get_document_path
def _get_document_path(client, path): """Convert a path tuple into a full path string. Of the form: ``projects/{project_id}/databases/{database_id}/... documents/{document_path}`` Args: client (~.firestore_v1beta1.client.Client): The client that holds configurati...
python
def _get_document_path(client, path): """Convert a path tuple into a full path string. Of the form: ``projects/{project_id}/databases/{database_id}/... documents/{document_path}`` Args: client (~.firestore_v1beta1.client.Client): The client that holds configurati...
[ "def", "_get_document_path", "(", "client", ",", "path", ")", ":", "parts", "=", "(", "client", ".", "_database_string", ",", "\"documents\"", ")", "+", "path", "return", "_helpers", ".", "DOCUMENT_PATH_DELIMITER", ".", "join", "(", "parts", ")" ]
Convert a path tuple into a full path string. Of the form: ``projects/{project_id}/databases/{database_id}/... documents/{document_path}`` Args: client (~.firestore_v1beta1.client.Client): The client that holds configuration details and a GAPIC client object. ...
[ "Convert", "a", "path", "tuple", "into", "a", "full", "path", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L695-L712
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
_consume_single_get
def _consume_single_get(response_iterator): """Consume a gRPC stream that should contain a single response. The stream will correspond to a ``BatchGetDocuments`` request made for a single document. Args: response_iterator (~google.cloud.exceptions.GrpcRendezvous): A streaming itera...
python
def _consume_single_get(response_iterator): """Consume a gRPC stream that should contain a single response. The stream will correspond to a ``BatchGetDocuments`` request made for a single document. Args: response_iterator (~google.cloud.exceptions.GrpcRendezvous): A streaming itera...
[ "def", "_consume_single_get", "(", "response_iterator", ")", ":", "# Calling ``list()`` consumes the entire iterator.", "all_responses", "=", "list", "(", "response_iterator", ")", "if", "len", "(", "all_responses", ")", "!=", "1", ":", "raise", "ValueError", "(", "\"...
Consume a gRPC stream that should contain a single response. The stream will correspond to a ``BatchGetDocuments`` request made for a single document. Args: response_iterator (~google.cloud.exceptions.GrpcRendezvous): A streaming iterator returned from a ``BatchGetDocuments`` ...
[ "Consume", "a", "gRPC", "stream", "that", "should", "contain", "a", "single", "response", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L715-L743
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference._document_path
def _document_path(self): """Create and cache the full path for this document. Of the form: ``projects/{project_id}/databases/{database_id}/... documents/{document_path}`` Returns: str: The full document path. Raises: ValueError: ...
python
def _document_path(self): """Create and cache the full path for this document. Of the form: ``projects/{project_id}/databases/{database_id}/... documents/{document_path}`` Returns: str: The full document path. Raises: ValueError: ...
[ "def", "_document_path", "(", "self", ")", ":", "if", "self", ".", "_document_path_internal", "is", "None", ":", "if", "self", ".", "_client", "is", "None", ":", "raise", "ValueError", "(", "\"A document reference requires a `client`.\"", ")", "self", ".", "_doc...
Create and cache the full path for this document. Of the form: ``projects/{project_id}/databases/{database_id}/... documents/{document_path}`` Returns: str: The full document path. Raises: ValueError: If the current document reference has...
[ "Create", "and", "cache", "the", "full", "path", "for", "this", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L130-L149
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference.collection
def collection(self, collection_id): """Create a sub-collection underneath the current document. Args: collection_id (str): The sub-collection identifier (sometimes referred to as the "kind"). Returns: ~.firestore_v1beta1.collection.CollectionReference: ...
python
def collection(self, collection_id): """Create a sub-collection underneath the current document. Args: collection_id (str): The sub-collection identifier (sometimes referred to as the "kind"). Returns: ~.firestore_v1beta1.collection.CollectionReference: ...
[ "def", "collection", "(", "self", ",", "collection_id", ")", ":", "child_path", "=", "self", ".", "_path", "+", "(", "collection_id", ",", ")", "return", "self", ".", "_client", ".", "collection", "(", "*", "child_path", ")" ]
Create a sub-collection underneath the current document. Args: collection_id (str): The sub-collection identifier (sometimes referred to as the "kind"). Returns: ~.firestore_v1beta1.collection.CollectionReference: The child collection.
[ "Create", "a", "sub", "-", "collection", "underneath", "the", "current", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L171-L183
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference.create
def create(self, document_data): """Create the current document in the Firestore database. Args: document_data (dict): Property names and values to use for creating a document. Returns: google.cloud.firestore_v1beta1.types.WriteResult: The wr...
python
def create(self, document_data): """Create the current document in the Firestore database. Args: document_data (dict): Property names and values to use for creating a document. Returns: google.cloud.firestore_v1beta1.types.WriteResult: The wr...
[ "def", "create", "(", "self", ",", "document_data", ")", ":", "batch", "=", "self", ".", "_client", ".", "batch", "(", ")", "batch", ".", "create", "(", "self", ",", "document_data", ")", "write_results", "=", "batch", ".", "commit", "(", ")", "return"...
Create the current document in the Firestore database. Args: document_data (dict): Property names and values to use for creating a document. Returns: google.cloud.firestore_v1beta1.types.WriteResult: The write result corresponding to the committed do...
[ "Create", "the", "current", "document", "in", "the", "Firestore", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L185-L203
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference.set
def set(self, document_data, merge=False): """Replace the current document in the Firestore database. A write ``option`` can be specified to indicate preconditions of the "set" operation. If no ``option`` is specified and this document doesn't exist yet, this method will create it. ...
python
def set(self, document_data, merge=False): """Replace the current document in the Firestore database. A write ``option`` can be specified to indicate preconditions of the "set" operation. If no ``option`` is specified and this document doesn't exist yet, this method will create it. ...
[ "def", "set", "(", "self", ",", "document_data", ",", "merge", "=", "False", ")", ":", "batch", "=", "self", ".", "_client", ".", "batch", "(", ")", "batch", ".", "set", "(", "self", ",", "document_data", ",", "merge", "=", "merge", ")", "write_resul...
Replace the current document in the Firestore database. A write ``option`` can be specified to indicate preconditions of the "set" operation. If no ``option`` is specified and this document doesn't exist yet, this method will create it. Overwrites all content for the document with the ...
[ "Replace", "the", "current", "document", "in", "the", "Firestore", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L205-L234
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference.update
def update(self, field_updates, option=None): """Update an existing document in the Firestore database. By default, this method verifies that the document exists on the server before making updates. A write ``option`` can be specified to override these preconditions. Each key i...
python
def update(self, field_updates, option=None): """Update an existing document in the Firestore database. By default, this method verifies that the document exists on the server before making updates. A write ``option`` can be specified to override these preconditions. Each key i...
[ "def", "update", "(", "self", ",", "field_updates", ",", "option", "=", "None", ")", ":", "batch", "=", "self", ".", "_client", ".", "batch", "(", ")", "batch", ".", "update", "(", "self", ",", "field_updates", ",", "option", "=", "option", ")", "wri...
Update an existing document in the Firestore database. By default, this method verifies that the document exists on the server before making updates. A write ``option`` can be specified to override these preconditions. Each key in ``field_updates`` can either be a field name or a ...
[ "Update", "an", "existing", "document", "in", "the", "Firestore", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L236-L381
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference.delete
def delete(self, option=None): """Delete the current document in the Firestore database. Args: option (Optional[~.firestore_v1beta1.client.WriteOption]): A write option to make assertions / preconditions on the server state of the document before applying chang...
python
def delete(self, option=None): """Delete the current document in the Firestore database. Args: option (Optional[~.firestore_v1beta1.client.WriteOption]): A write option to make assertions / preconditions on the server state of the document before applying chang...
[ "def", "delete", "(", "self", ",", "option", "=", "None", ")", ":", "write_pb", "=", "_helpers", ".", "pb_for_delete", "(", "self", ".", "_document_path", ",", "option", ")", "commit_response", "=", "self", ".", "_client", ".", "_firestore_api", ".", "comm...
Delete the current document in the Firestore database. Args: option (Optional[~.firestore_v1beta1.client.WriteOption]): A write option to make assertions / preconditions on the server state of the document before applying changes. Returns: google.p...
[ "Delete", "the", "current", "document", "in", "the", "Firestore", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L383-L406
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference.get
def get(self, field_paths=None, transaction=None): """Retrieve a snapshot of the current document. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. If a ``transaction`` is used and it already has write operations added, this meth...
python
def get(self, field_paths=None, transaction=None): """Retrieve a snapshot of the current document. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. If a ``transaction`` is used and it already has write operations added, this meth...
[ "def", "get", "(", "self", ",", "field_paths", "=", "None", ",", "transaction", "=", "None", ")", ":", "if", "isinstance", "(", "field_paths", ",", "six", ".", "string_types", ")", ":", "raise", "ValueError", "(", "\"'field_paths' must be a sequence of paths, no...
Retrieve a snapshot of the current document. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. If a ``transaction`` is used and it already has write operations added, this method cannot be used (i.e. read-after-write is not allowe...
[ "Retrieve", "a", "snapshot", "of", "the", "current", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L408-L468
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentReference.collections
def collections(self, page_size=None): """List subcollections of the current document. Args: page_size (Optional[int]]): The maximum number of collections in each page of results from this request. Non-positive values are ignored. Defaults to a sensible value set by ...
python
def collections(self, page_size=None): """List subcollections of the current document. Args: page_size (Optional[int]]): The maximum number of collections in each page of results from this request. Non-positive values are ignored. Defaults to a sensible value set by ...
[ "def", "collections", "(", "self", ",", "page_size", "=", "None", ")", ":", "iterator", "=", "self", ".", "_client", ".", "_firestore_api", ".", "list_collection_ids", "(", "self", ".", "_document_path", ",", "page_size", "=", "page_size", ",", "metadata", "...
List subcollections of the current document. Args: page_size (Optional[int]]): The maximum number of collections 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", "subcollections", "of", "the", "current", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L470-L491
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/document.py
DocumentSnapshot.get
def get(self, field_path): """Get a value from the snapshot data. If the data is nested, for example: .. code-block:: python >>> snapshot.to_dict() { 'top1': { 'middle2': { 'bottom3': 20, 'bo...
python
def get(self, field_path): """Get a value from the snapshot data. If the data is nested, for example: .. code-block:: python >>> snapshot.to_dict() { 'top1': { 'middle2': { 'bottom3': 20, 'bo...
[ "def", "get", "(", "self", ",", "field_path", ")", ":", "if", "not", "self", ".", "_exists", ":", "return", "None", "nested_data", "=", "field_path_module", ".", "get_nested_value", "(", "field_path", ",", "self", ".", "_data", ")", "return", "copy", ".", ...
Get a value from the snapshot data. If the data is nested, for example: .. code-block:: python >>> snapshot.to_dict() { 'top1': { 'middle2': { 'bottom3': 20, 'bottom4': 22, }, ...
[ "Get", "a", "value", "from", "the", "snapshot", "data", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/document.py#L615-L677
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/session.py
_delay_until_retry
def _delay_until_retry(exc, deadline): """Helper for :meth:`Session.run_in_transaction`. Detect retryable abort, and impose server-supplied delay. :type exc: :class:`google.api_core.exceptions.Aborted` :param exc: exception for aborted transaction :type deadline: float :param deadline: maximu...
python
def _delay_until_retry(exc, deadline): """Helper for :meth:`Session.run_in_transaction`. Detect retryable abort, and impose server-supplied delay. :type exc: :class:`google.api_core.exceptions.Aborted` :param exc: exception for aborted transaction :type deadline: float :param deadline: maximu...
[ "def", "_delay_until_retry", "(", "exc", ",", "deadline", ")", ":", "cause", "=", "exc", ".", "errors", "[", "0", "]", "now", "=", "time", ".", "time", "(", ")", "if", "now", ">=", "deadline", ":", "raise", "delay", "=", "_get_retry_delay", "(", "cau...
Helper for :meth:`Session.run_in_transaction`. Detect retryable abort, and impose server-supplied delay. :type exc: :class:`google.api_core.exceptions.Aborted` :param exc: exception for aborted transaction :type deadline: float :param deadline: maximum timestamp to continue retrying the transacti...
[ "Helper", "for", ":", "meth", ":", "Session", ".", "run_in_transaction", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/session.py#L323-L347
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/session.py
_get_retry_delay
def _get_retry_delay(cause): """Helper for :func:`_delay_until_retry`. :type exc: :class:`grpc.Call` :param exc: exception for aborted transaction :rtype: float :returns: seconds to wait before retrying the transaction. """ metadata = dict(cause.trailing_metadata()) retry_info_pb = met...
python
def _get_retry_delay(cause): """Helper for :func:`_delay_until_retry`. :type exc: :class:`grpc.Call` :param exc: exception for aborted transaction :rtype: float :returns: seconds to wait before retrying the transaction. """ metadata = dict(cause.trailing_metadata()) retry_info_pb = met...
[ "def", "_get_retry_delay", "(", "cause", ")", ":", "metadata", "=", "dict", "(", "cause", ".", "trailing_metadata", "(", ")", ")", "retry_info_pb", "=", "metadata", ".", "get", "(", "\"google.rpc.retryinfo-bin\"", ")", "if", "retry_info_pb", "is", "not", "None...
Helper for :func:`_delay_until_retry`. :type exc: :class:`grpc.Call` :param exc: exception for aborted transaction :rtype: float :returns: seconds to wait before retrying the transaction.
[ "Helper", "for", ":", "func", ":", "_delay_until_retry", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/session.py#L353-L368
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py
DatabaseAdminClient.database_path
def database_path(cls, project, instance, database): """Return a fully-qualified database string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/databases/{database}", project=project, instance=instance, database=d...
python
def database_path(cls, project, instance, database): """Return a fully-qualified database string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/databases/{database}", project=project, instance=instance, database=d...
[ "def", "database_path", "(", "cls", ",", "project", ",", "instance", ",", "database", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}/databases/{database}\"", ",", "project", "=", "p...
Return a fully-qualified database string.
[ "Return", "a", "fully", "-", "qualified", "database", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py#L95-L102
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py
DatabaseAdminClient.create_database
def create_database( self, parent, create_statement, extra_statements=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new Cloud Spanner database and starts to...
python
def create_database( self, parent, create_statement, extra_statements=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new Cloud Spanner database and starts to...
[ "def", "create_database", "(", "self", ",", "parent", ",", "create_statement", ",", "extra_statements", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core",...
Creates a new Cloud Spanner database and starts to prepare it for serving. The returned ``long-running operation`` will have a name of the format ``<database_name>/operations/<operation_id>`` and can be used to track preparation of the database. The ``metadata`` field type is ``CreateDat...
[ "Creates", "a", "new", "Cloud", "Spanner", "database", "and", "starts", "to", "prepare", "it", "for", "serving", ".", "The", "returned", "long", "-", "running", "operation", "will", "have", "a", "name", "of", "the", "format", "<database_name", ">", "/", "o...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py#L307-L413
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py
DatabaseAdminClient.update_database_ddl
def update_database_ddl( self, database, statements, operation_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates the schema of a Cloud Spanner database by ...
python
def update_database_ddl( self, database, statements, operation_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates the schema of a Cloud Spanner database by ...
[ "def", "update_database_ddl", "(", "self", ",", "database", ",", "statements", ",", "operation_id", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", "...
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned ``long-running operation`` will have a name of the format ``<database_name>/operations/<operation_id>`` and can be used to track execution of the schema change(s). The...
[ "Updates", "the", "schema", "of", "a", "Cloud", "Spanner", "database", "by", "creating", "/", "altering", "/", "dropping", "tables", "columns", "indexes", "etc", ".", "The", "returned", "long", "-", "running", "operation", "will", "have", "a", "name", "of", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py#L485-L595
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/client.py
Client._get_scopes
def _get_scopes(self): """Get the scopes corresponding to admin / read-only state. Returns: Tuple[str, ...]: The tuple of scopes. """ if self._read_only: scopes = (READ_ONLY_SCOPE,) else: scopes = (DATA_SCOPE,) if self._admin: ...
python
def _get_scopes(self): """Get the scopes corresponding to admin / read-only state. Returns: Tuple[str, ...]: The tuple of scopes. """ if self._read_only: scopes = (READ_ONLY_SCOPE,) else: scopes = (DATA_SCOPE,) if self._admin: ...
[ "def", "_get_scopes", "(", "self", ")", ":", "if", "self", ".", "_read_only", ":", "scopes", "=", "(", "READ_ONLY_SCOPE", ",", ")", "else", ":", "scopes", "=", "(", "DATA_SCOPE", ",", ")", "if", "self", ".", "_admin", ":", "scopes", "+=", "(", "ADMIN...
Get the scopes corresponding to admin / read-only state. Returns: Tuple[str, ...]: The tuple of scopes.
[ "Get", "the", "scopes", "corresponding", "to", "admin", "/", "read", "-", "only", "state", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/client.py#L146-L160
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/client.py
Client.table_data_client
def table_data_client(self): """Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_table_data_client] :end-before: [END bigtable_table_data_client] :rtype: :class:`.bigtable_v2.Bigta...
python
def table_data_client(self): """Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_table_data_client] :end-before: [END bigtable_table_data_client] :rtype: :class:`.bigtable_v2.Bigta...
[ "def", "table_data_client", "(", "self", ")", ":", "if", "self", ".", "_table_data_client", "is", "None", ":", "self", ".", "_table_data_client", "=", "_create_gapic_client", "(", "bigtable_v2", ".", "BigtableClient", ")", "(", "self", ")", "return", "self", "...
Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_table_data_client] :end-before: [END bigtable_table_data_client] :rtype: :class:`.bigtable_v2.BigtableClient` :returns: A BigtableC...
[ "Getter", "for", "the", "gRPC", "stub", "used", "for", "the", "Table", "Admin", "API", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/client.py#L187-L203
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/client.py
Client.table_admin_client
def table_admin_client(self): """Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_table_admin_client] :end-before: [END bigtable_table_admin_client] :rtype: :class:`.bigtable_admin...
python
def table_admin_client(self): """Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_table_admin_client] :end-before: [END bigtable_table_admin_client] :rtype: :class:`.bigtable_admin...
[ "def", "table_admin_client", "(", "self", ")", ":", "if", "self", ".", "_table_admin_client", "is", "None", ":", "if", "not", "self", ".", "_admin", ":", "raise", "ValueError", "(", "\"Client is not an admin client.\"", ")", "self", ".", "_table_admin_client", "...
Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_table_admin_client] :end-before: [END bigtable_table_admin_client] :rtype: :class:`.bigtable_admin_pb2.BigtableTableAdmin` :returns...
[ "Getter", "for", "the", "gRPC", "stub", "used", "for", "the", "Table", "Admin", "API", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/client.py#L206-L227
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/client.py
Client.instance_admin_client
def instance_admin_client(self): """Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_instance_admin_client] :end-before: [END bigtable_instance_admin_client] :rtype: :class:`.bigta...
python
def instance_admin_client(self): """Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_instance_admin_client] :end-before: [END bigtable_instance_admin_client] :rtype: :class:`.bigta...
[ "def", "instance_admin_client", "(", "self", ")", ":", "if", "self", ".", "_instance_admin_client", "is", "None", ":", "if", "not", "self", ".", "_admin", ":", "raise", "ValueError", "(", "\"Client is not an admin client.\"", ")", "self", ".", "_instance_admin_cli...
Getter for the gRPC stub used for the Table Admin API. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_instance_admin_client] :end-before: [END bigtable_instance_admin_client] :rtype: :class:`.bigtable_admin_pb2.BigtableInstanceAdmin` ...
[ "Getter", "for", "the", "gRPC", "stub", "used", "for", "the", "Table", "Admin", "API", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/client.py#L230-L251
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/client.py
Client.instance
def instance(self, instance_id, display_name=None, instance_type=None, labels=None): """Factory to create a instance associated with this client. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_create_prod_instance] :end-before: [END bigtable_...
python
def instance(self, instance_id, display_name=None, instance_type=None, labels=None): """Factory to create a instance associated with this client. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_create_prod_instance] :end-before: [END bigtable_...
[ "def", "instance", "(", "self", ",", "instance_id", ",", "display_name", "=", "None", ",", "instance_type", "=", "None", ",", "labels", "=", "None", ")", ":", "return", "Instance", "(", "instance_id", ",", "self", ",", "display_name", "=", "display_name", ...
Factory to create a instance associated with this client. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_create_prod_instance] :end-before: [END bigtable_create_prod_instance] :type instance_id: str :param instance_id: The ID of the ...
[ "Factory", "to", "create", "a", "instance", "associated", "with", "this", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/client.py#L253-L300
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/client.py
Client.list_instances
def list_instances(self): """List instances owned by the project. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_list_instances] :end-before: [END bigtable_list_instances] :rtype: tuple :returns: (instances, faile...
python
def list_instances(self): """List instances owned by the project. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_list_instances] :end-before: [END bigtable_list_instances] :rtype: tuple :returns: (instances, faile...
[ "def", "list_instances", "(", "self", ")", ":", "resp", "=", "self", ".", "instance_admin_client", ".", "list_instances", "(", "self", ".", "project_path", ")", "instances", "=", "[", "Instance", ".", "from_pb", "(", "instance", ",", "self", ")", "for", "i...
List instances owned by the project. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_list_instances] :end-before: [END bigtable_list_instances] :rtype: tuple :returns: (instances, failed_locations), where 'instances' is li...
[ "List", "instances", "owned", "by", "the", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/client.py#L302-L320
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/client.py
Client.list_clusters
def list_clusters(self): """List the clusters in the project. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_list_clusters_in_project] :end-before: [END bigtable_list_clusters_in_project] :rtype: tuple :returns: (...
python
def list_clusters(self): """List the clusters in the project. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_list_clusters_in_project] :end-before: [END bigtable_list_clusters_in_project] :rtype: tuple :returns: (...
[ "def", "list_clusters", "(", "self", ")", ":", "resp", "=", "self", ".", "instance_admin_client", ".", "list_clusters", "(", "self", ".", "instance_admin_client", ".", "instance_path", "(", "self", ".", "project", ",", "\"-\"", ")", ")", "clusters", "=", "["...
List the clusters in the project. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_list_clusters_in_project] :end-before: [END bigtable_list_clusters_in_project] :rtype: tuple :returns: (clusters, failed_locations), where '...
[ "List", "the", "clusters", "in", "the", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/client.py#L322-L349
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/proto/metric_service_pb2_grpc.py
MetricServiceServicer.DeleteMetricDescriptor
def DeleteMetricDescriptor(self, request, context): """Deletes a metric descriptor. Only user-created [custom metrics](/monitoring/custom-metrics) can be deleted. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplement...
python
def DeleteMetricDescriptor(self, request, context): """Deletes a metric descriptor. Only user-created [custom metrics](/monitoring/custom-metrics) can be deleted. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplement...
[ "def", "DeleteMetricDescriptor", "(", "self", ",", "request", ",", "context", ")", ":", "context", ".", "set_code", "(", "grpc", ".", "StatusCode", ".", "UNIMPLEMENTED", ")", "context", ".", "set_details", "(", "\"Method not implemented!\"", ")", "raise", "NotIm...
Deletes a metric descriptor. Only user-created [custom metrics](/monitoring/custom-metrics) can be deleted.
[ "Deletes", "a", "metric", "descriptor", ".", "Only", "user", "-", "created", "[", "custom", "metrics", "]", "(", "/", "monitoring", "/", "custom", "-", "metrics", ")", "can", "be", "deleted", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/proto/metric_service_pb2_grpc.py#L113-L119
train
googleapis/google-cloud-python
container/google/cloud/container_v1/gapic/cluster_manager_client.py
ClusterManagerClient.list_clusters
def list_clusters( self, project_id, zone, parent=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Lists all clusters owned by a project in either the specified zone or ...
python
def list_clusters( self, project_id, zone, parent=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Lists all clusters owned by a project in either the specified zone or ...
[ "def", "list_clusters", "(", "self", ",", "project_id", ",", "zone", ",", "parent", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1"...
Lists all clusters owned by a project in either the specified zone or all zones. Example: >>> from google.cloud import container_v1 >>> >>> client = container_v1.ClusterManagerClient() >>> >>> # TODO: Initialize `project_id`: >>> p...
[ "Lists", "all", "clusters", "owned", "by", "a", "project", "in", "either", "the", "specified", "zone", "or", "all", "zones", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/container/google/cloud/container_v1/gapic/cluster_manager_client.py#L169-L241
train
googleapis/google-cloud-python
container/google/cloud/container_v1/gapic/cluster_manager_client.py
ClusterManagerClient.get_cluster
def get_cluster( self, project_id, zone, cluster_id, name=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Gets the details of a specific cluster. Examp...
python
def get_cluster( self, project_id, zone, cluster_id, name=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Gets the details of a specific cluster. Examp...
[ "def", "get_cluster", "(", "self", ",", "project_id", ",", "zone", ",", "cluster_id", ",", "name", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ...
Gets the details of a specific cluster. Example: >>> from google.cloud import container_v1 >>> >>> client = container_v1.ClusterManagerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>> # ...
[ "Gets", "the", "details", "of", "a", "specific", "cluster", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/container/google/cloud/container_v1/gapic/cluster_manager_client.py#L243-L319
train
googleapis/google-cloud-python
container/google/cloud/container_v1/gapic/cluster_manager_client.py
ClusterManagerClient.set_labels
def set_labels( self, project_id, zone, cluster_id, resource_labels, label_fingerprint, name=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Set...
python
def set_labels( self, project_id, zone, cluster_id, resource_labels, label_fingerprint, name=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Set...
[ "def", "set_labels", "(", "self", ",", "project_id", ",", "zone", ",", "cluster_id", ",", "resource_labels", ",", "label_fingerprint", ",", "name", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", "...
Sets labels on a cluster. Example: >>> from google.cloud import container_v1 >>> >>> client = container_v1.ClusterManagerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>> # TODO: Initiali...
[ "Sets", "labels", "on", "a", "cluster", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/container/google/cloud/container_v1/gapic/cluster_manager_client.py#L2191-L2287
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/metrics_service_v2_client.py
MetricsServiceV2Client.metric_path
def metric_path(cls, project, metric): """Return a fully-qualified metric string.""" return google.api_core.path_template.expand( "projects/{project}/metrics/{metric}", project=project, metric=metric )
python
def metric_path(cls, project, metric): """Return a fully-qualified metric string.""" return google.api_core.path_template.expand( "projects/{project}/metrics/{metric}", project=project, metric=metric )
[ "def", "metric_path", "(", "cls", ",", "project", ",", "metric", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/metrics/{metric}\"", ",", "project", "=", "project", ",", "metric", "=", "metric", "...
Return a fully-qualified metric string.
[ "Return", "a", "fully", "-", "qualified", "metric", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/metrics_service_v2_client.py#L87-L91
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/metrics_service_v2_client.py
MetricsServiceV2Client.get_log_metric
def get_log_metric( self, metric_name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Gets a logs-based metric. Example: >>> from google.cloud import logging_v2 ...
python
def get_log_metric( self, metric_name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Gets a logs-based metric. Example: >>> from google.cloud import logging_v2 ...
[ "def", "get_log_metric", "(", "self", ",", "metric_name", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "...
Gets a logs-based metric. Example: >>> from google.cloud import logging_v2 >>> >>> client = logging_v2.MetricsServiceV2Client() >>> >>> metric_name = client.metric_path('[PROJECT]', '[METRIC]') >>> >>> response = client.get_log...
[ "Gets", "a", "logs", "-", "based", "metric", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/metrics_service_v2_client.py#L299-L370
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py
MetricServiceClient.metric_descriptor_path
def metric_descriptor_path(cls, project, metric_descriptor): """Return a fully-qualified metric_descriptor string.""" return google.api_core.path_template.expand( "projects/{project}/metricDescriptors/{metric_descriptor=**}", project=project, metric_descriptor=metric_...
python
def metric_descriptor_path(cls, project, metric_descriptor): """Return a fully-qualified metric_descriptor string.""" return google.api_core.path_template.expand( "projects/{project}/metricDescriptors/{metric_descriptor=**}", project=project, metric_descriptor=metric_...
[ "def", "metric_descriptor_path", "(", "cls", ",", "project", ",", "metric_descriptor", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/metricDescriptors/{metric_descriptor=**}\"", ",", "project", "=", "proje...
Return a fully-qualified metric_descriptor string.
[ "Return", "a", "fully", "-", "qualified", "metric_descriptor", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py#L96-L102
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py
MetricServiceClient.monitored_resource_descriptor_path
def monitored_resource_descriptor_path(cls, project, monitored_resource_descriptor): """Return a fully-qualified monitored_resource_descriptor string.""" return google.api_core.path_template.expand( "projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}", ...
python
def monitored_resource_descriptor_path(cls, project, monitored_resource_descriptor): """Return a fully-qualified monitored_resource_descriptor string.""" return google.api_core.path_template.expand( "projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}", ...
[ "def", "monitored_resource_descriptor_path", "(", "cls", ",", "project", ",", "monitored_resource_descriptor", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/monitoredResourceDescriptors/{monitored_resource_descrip...
Return a fully-qualified monitored_resource_descriptor string.
[ "Return", "a", "fully", "-", "qualified", "monitored_resource_descriptor", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py#L105-L111
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/keyset.py
KeyRange._to_pb
def _to_pb(self): """Construct a KeyRange protobuf. :rtype: :class:`~google.cloud.spanner_v1.proto.keys_pb2.KeyRange` :returns: protobuf corresponding to this instance. """ kwargs = {} if self.start_open is not None: kwargs["start_open"] = _make_list_value_p...
python
def _to_pb(self): """Construct a KeyRange protobuf. :rtype: :class:`~google.cloud.spanner_v1.proto.keys_pb2.KeyRange` :returns: protobuf corresponding to this instance. """ kwargs = {} if self.start_open is not None: kwargs["start_open"] = _make_list_value_p...
[ "def", "_to_pb", "(", "self", ")", ":", "kwargs", "=", "{", "}", "if", "self", ".", "start_open", "is", "not", "None", ":", "kwargs", "[", "\"start_open\"", "]", "=", "_make_list_value_pb", "(", "self", ".", "start_open", ")", "if", "self", ".", "start...
Construct a KeyRange protobuf. :rtype: :class:`~google.cloud.spanner_v1.proto.keys_pb2.KeyRange` :returns: protobuf corresponding to this instance.
[ "Construct", "a", "KeyRange", "protobuf", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/keyset.py#L68-L88
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/keyset.py
KeyRange._to_dict
def _to_dict(self): """Return keyrange's state as a dict. :rtype: dict :returns: state of this instance. """ mapping = {} if self.start_open: mapping["start_open"] = self.start_open if self.start_closed: mapping["start_closed"] = self.st...
python
def _to_dict(self): """Return keyrange's state as a dict. :rtype: dict :returns: state of this instance. """ mapping = {} if self.start_open: mapping["start_open"] = self.start_open if self.start_closed: mapping["start_closed"] = self.st...
[ "def", "_to_dict", "(", "self", ")", ":", "mapping", "=", "{", "}", "if", "self", ".", "start_open", ":", "mapping", "[", "\"start_open\"", "]", "=", "self", ".", "start_open", "if", "self", ".", "start_closed", ":", "mapping", "[", "\"start_closed\"", "...
Return keyrange's state as a dict. :rtype: dict :returns: state of this instance.
[ "Return", "keyrange", "s", "state", "as", "a", "dict", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/keyset.py#L90-L110
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/keyset.py
KeySet._to_pb
def _to_pb(self): """Construct a KeySet protobuf. :rtype: :class:`~google.cloud.spanner_v1.proto.keys_pb2.KeySet` :returns: protobuf corresponding to this instance. """ if self.all_: return KeySetPB(all=True) kwargs = {} if self.keys: kwa...
python
def _to_pb(self): """Construct a KeySet protobuf. :rtype: :class:`~google.cloud.spanner_v1.proto.keys_pb2.KeySet` :returns: protobuf corresponding to this instance. """ if self.all_: return KeySetPB(all=True) kwargs = {} if self.keys: kwa...
[ "def", "_to_pb", "(", "self", ")", ":", "if", "self", ".", "all_", ":", "return", "KeySetPB", "(", "all", "=", "True", ")", "kwargs", "=", "{", "}", "if", "self", ".", "keys", ":", "kwargs", "[", "\"keys\"", "]", "=", "_make_list_value_pbs", "(", "...
Construct a KeySet protobuf. :rtype: :class:`~google.cloud.spanner_v1.proto.keys_pb2.KeySet` :returns: protobuf corresponding to this instance.
[ "Construct", "a", "KeySet", "protobuf", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/keyset.py#L139-L155
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/keyset.py
KeySet._to_dict
def _to_dict(self): """Return keyset's state as a dict. The result can be used to serialize the instance and reconstitute it later using :meth:`_from_dict`. :rtype: dict :returns: state of this instance. """ if self.all_: return {"all": True} ...
python
def _to_dict(self): """Return keyset's state as a dict. The result can be used to serialize the instance and reconstitute it later using :meth:`_from_dict`. :rtype: dict :returns: state of this instance. """ if self.all_: return {"all": True} ...
[ "def", "_to_dict", "(", "self", ")", ":", "if", "self", ".", "all_", ":", "return", "{", "\"all\"", ":", "True", "}", "return", "{", "\"keys\"", ":", "self", ".", "keys", ",", "\"ranges\"", ":", "[", "keyrange", ".", "_to_dict", "(", ")", "for", "k...
Return keyset's state as a dict. The result can be used to serialize the instance and reconstitute it later using :meth:`_from_dict`. :rtype: dict :returns: state of this instance.
[ "Return", "keyset", "s", "state", "as", "a", "dict", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/keyset.py#L157-L172
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/keyset.py
KeySet._from_dict
def _from_dict(cls, mapping): """Create an instance from the corresponding state mapping. :type mapping: dict :param mapping: the instance state. """ if mapping.get("all"): return cls(all_=True) r_mappings = mapping.get("ranges", ()) ranges = [KeyRan...
python
def _from_dict(cls, mapping): """Create an instance from the corresponding state mapping. :type mapping: dict :param mapping: the instance state. """ if mapping.get("all"): return cls(all_=True) r_mappings = mapping.get("ranges", ()) ranges = [KeyRan...
[ "def", "_from_dict", "(", "cls", ",", "mapping", ")", ":", "if", "mapping", ".", "get", "(", "\"all\"", ")", ":", "return", "cls", "(", "all_", "=", "True", ")", "r_mappings", "=", "mapping", ".", "get", "(", "\"ranges\"", ",", "(", ")", ")", "rang...
Create an instance from the corresponding state mapping. :type mapping: dict :param mapping: the instance state.
[ "Create", "an", "instance", "from", "the", "corresponding", "state", "mapping", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/keyset.py#L181-L193
train
googleapis/google-cloud-python
api_core/google/api_core/grpc_helpers.py
_wrap_unary_errors
def _wrap_unary_errors(callable_): """Map errors for Unary-Unary and Stream-Unary gRPC callables.""" _patch_callable_name(callable_) @six.wraps(callable_) def error_remapped_callable(*args, **kwargs): try: return callable_(*args, **kwargs) except grpc.RpcError as exc: ...
python
def _wrap_unary_errors(callable_): """Map errors for Unary-Unary and Stream-Unary gRPC callables.""" _patch_callable_name(callable_) @six.wraps(callable_) def error_remapped_callable(*args, **kwargs): try: return callable_(*args, **kwargs) except grpc.RpcError as exc: ...
[ "def", "_wrap_unary_errors", "(", "callable_", ")", ":", "_patch_callable_name", "(", "callable_", ")", "@", "six", ".", "wraps", "(", "callable_", ")", "def", "error_remapped_callable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "ret...
Map errors for Unary-Unary and Stream-Unary gRPC callables.
[ "Map", "errors", "for", "Unary", "-", "Unary", "and", "Stream", "-", "Unary", "gRPC", "callables", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/grpc_helpers.py#L50-L61
train
googleapis/google-cloud-python
api_core/google/api_core/grpc_helpers.py
_wrap_stream_errors
def _wrap_stream_errors(callable_): """Wrap errors for Unary-Stream and Stream-Stream gRPC callables. The callables that return iterators require a bit more logic to re-map errors when iterating. This wraps both the initial invocation and the iterator of the return value to re-map errors. """ _...
python
def _wrap_stream_errors(callable_): """Wrap errors for Unary-Stream and Stream-Stream gRPC callables. The callables that return iterators require a bit more logic to re-map errors when iterating. This wraps both the initial invocation and the iterator of the return value to re-map errors. """ _...
[ "def", "_wrap_stream_errors", "(", "callable_", ")", ":", "_patch_callable_name", "(", "callable_", ")", "@", "general_helpers", ".", "wraps", "(", "callable_", ")", "def", "error_remapped_callable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ...
Wrap errors for Unary-Stream and Stream-Stream gRPC callables. The callables that return iterators require a bit more logic to re-map errors when iterating. This wraps both the initial invocation and the iterator of the return value to re-map errors.
[ "Wrap", "errors", "for", "Unary", "-", "Stream", "and", "Stream", "-", "Stream", "gRPC", "callables", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/grpc_helpers.py#L113-L130
train
googleapis/google-cloud-python
api_core/google/api_core/grpc_helpers.py
create_channel
def create_channel( target, credentials=None, scopes=None, ssl_credentials=None, **kwargs ): """Create a secure channel with credentials. Args: target (str): The target service address in the format 'hostname:port'. credentials (google.auth.credentials.Credentials): The credentials. If ...
python
def create_channel( target, credentials=None, scopes=None, ssl_credentials=None, **kwargs ): """Create a secure channel with credentials. Args: target (str): The target service address in the format 'hostname:port'. credentials (google.auth.credentials.Credentials): The credentials. If ...
[ "def", "create_channel", "(", "target", ",", "credentials", "=", "None", ",", "scopes", "=", "None", ",", "ssl_credentials", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "credentials", "is", "None", ":", "credentials", ",", "_", "=", "google", ...
Create a secure channel with credentials. Args: target (str): The target service address in the format 'hostname:port'. credentials (google.auth.credentials.Credentials): The credentials. If not specified, then this function will attempt to ascertain the credentials from the...
[ "Create", "a", "secure", "channel", "with", "credentials", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/grpc_helpers.py#L155-L206
train
googleapis/google-cloud-python
api_core/google/api_core/grpc_helpers.py
_StreamingResponseIterator.next
def next(self): """Get the next response from the stream. Returns: protobuf.Message: A single response from the stream. """ try: return six.next(self._wrapped) except grpc.RpcError as exc: six.raise_from(exceptions.from_grpc_error(exc), exc)
python
def next(self): """Get the next response from the stream. Returns: protobuf.Message: A single response from the stream. """ try: return six.next(self._wrapped) except grpc.RpcError as exc: six.raise_from(exceptions.from_grpc_error(exc), exc)
[ "def", "next", "(", "self", ")", ":", "try", ":", "return", "six", ".", "next", "(", "self", ".", "_wrapped", ")", "except", "grpc", ".", "RpcError", "as", "exc", ":", "six", ".", "raise_from", "(", "exceptions", ".", "from_grpc_error", "(", "exc", "...
Get the next response from the stream. Returns: protobuf.Message: A single response from the stream.
[ "Get", "the", "next", "response", "from", "the", "stream", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/grpc_helpers.py#L72-L81
train
googleapis/google-cloud-python
api_core/google/api_core/general_helpers.py
wraps
def wraps(wrapped): """A functools.wraps helper that handles partial objects on Python 2.""" if isinstance(wrapped, functools.partial): return six.wraps(wrapped, assigned=_PARTIAL_VALID_ASSIGNMENTS) else: return six.wraps(wrapped)
python
def wraps(wrapped): """A functools.wraps helper that handles partial objects on Python 2.""" if isinstance(wrapped, functools.partial): return six.wraps(wrapped, assigned=_PARTIAL_VALID_ASSIGNMENTS) else: return six.wraps(wrapped)
[ "def", "wraps", "(", "wrapped", ")", ":", "if", "isinstance", "(", "wrapped", ",", "functools", ".", "partial", ")", ":", "return", "six", ".", "wraps", "(", "wrapped", ",", "assigned", "=", "_PARTIAL_VALID_ASSIGNMENTS", ")", "else", ":", "return", "six", ...
A functools.wraps helper that handles partial objects on Python 2.
[ "A", "functools", ".", "wraps", "helper", "that", "handles", "partial", "objects", "on", "Python", "2", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/general_helpers.py#L27-L32
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
_determine_default_project
def _determine_default_project(project=None): """Determine default project explicitly or implicitly as fall-back. In implicit case, supports four environments. In order of precedence, the implicit environments are: * DATASTORE_DATASET environment variable (for ``gcd`` / emulator testing) * GOOGLE_...
python
def _determine_default_project(project=None): """Determine default project explicitly or implicitly as fall-back. In implicit case, supports four environments. In order of precedence, the implicit environments are: * DATASTORE_DATASET environment variable (for ``gcd`` / emulator testing) * GOOGLE_...
[ "def", "_determine_default_project", "(", "project", "=", "None", ")", ":", "if", "project", "is", "None", ":", "project", "=", "_get_gcd_project", "(", ")", "if", "project", "is", "None", ":", "project", "=", "_base_default_project", "(", "project", "=", "p...
Determine default project explicitly or implicitly as fall-back. In implicit case, supports four environments. In order of precedence, the implicit environments are: * DATASTORE_DATASET environment variable (for ``gcd`` / emulator testing) * GOOGLE_CLOUD_PROJECT environment variable * Google App E...
[ "Determine", "default", "project", "explicitly", "or", "implicitly", "as", "fall", "-", "back", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L54-L77
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
_extended_lookup
def _extended_lookup( datastore_api, project, key_pbs, missing=None, deferred=None, eventual=False, transaction_id=None, ): """Repeat lookup until all keys found (unless stop requested). Helper function for :meth:`Client.get_multi`. :type datastore_api: :class:`google.c...
python
def _extended_lookup( datastore_api, project, key_pbs, missing=None, deferred=None, eventual=False, transaction_id=None, ): """Repeat lookup until all keys found (unless stop requested). Helper function for :meth:`Client.get_multi`. :type datastore_api: :class:`google.c...
[ "def", "_extended_lookup", "(", "datastore_api", ",", "project", ",", "key_pbs", ",", "missing", "=", "None", ",", "deferred", "=", "None", ",", "eventual", "=", "False", ",", "transaction_id", "=", "None", ",", ")", ":", "if", "missing", "is", "not", "N...
Repeat lookup until all keys found (unless stop requested). Helper function for :meth:`Client.get_multi`. :type datastore_api: :class:`google.cloud.datastore._http.HTTPDatastoreAPI` or :class:`google.cloud.datastore_v1.gapic.DatastoreClient` :param datastore_api: The datastore API object u...
[ "Repeat", "lookup", "until", "all", "keys", "found", "(", "unless", "stop", "requested", ")", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L80-L162
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client._datastore_api
def _datastore_api(self): """Getter for a wrapped API object.""" if self._datastore_api_internal is None: if self._use_grpc: self._datastore_api_internal = make_datastore_api(self) else: self._datastore_api_internal = HTTPDatastoreAPI(self) ...
python
def _datastore_api(self): """Getter for a wrapped API object.""" if self._datastore_api_internal is None: if self._use_grpc: self._datastore_api_internal = make_datastore_api(self) else: self._datastore_api_internal = HTTPDatastoreAPI(self) ...
[ "def", "_datastore_api", "(", "self", ")", ":", "if", "self", ".", "_datastore_api_internal", "is", "None", ":", "if", "self", ".", "_use_grpc", ":", "self", ".", "_datastore_api_internal", "=", "make_datastore_api", "(", "self", ")", "else", ":", "self", "....
Getter for a wrapped API object.
[ "Getter", "for", "a", "wrapped", "API", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L241-L248
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client.get
def get(self, key, missing=None, deferred=None, transaction=None, eventual=False): """Retrieve an entity from a single key (if it exists). .. note:: This is just a thin wrapper over :meth:`get_multi`. The backend API does not make a distinction between a single key or ...
python
def get(self, key, missing=None, deferred=None, transaction=None, eventual=False): """Retrieve an entity from a single key (if it exists). .. note:: This is just a thin wrapper over :meth:`get_multi`. The backend API does not make a distinction between a single key or ...
[ "def", "get", "(", "self", ",", "key", ",", "missing", "=", "None", ",", "deferred", "=", "None", ",", "transaction", "=", "None", ",", "eventual", "=", "False", ")", ":", "entities", "=", "self", ".", "get_multi", "(", "keys", "=", "[", "key", "]"...
Retrieve an entity from a single key (if it exists). .. note:: This is just a thin wrapper over :meth:`get_multi`. The backend API does not make a distinction between a single key or multiple keys in a lookup request. :type key: :class:`google.cloud.datastore.key.Key`...
[ "Retrieve", "an", "entity", "from", "a", "single", "key", "(", "if", "it", "exists", ")", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L296-L340
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client.get_multi
def get_multi( self, keys, missing=None, deferred=None, transaction=None, eventual=False ): """Retrieve entities, along with their attributes. :type keys: list of :class:`google.cloud.datastore.key.Key` :param keys: The keys to be retrieved from the datastore. :type missing...
python
def get_multi( self, keys, missing=None, deferred=None, transaction=None, eventual=False ): """Retrieve entities, along with their attributes. :type keys: list of :class:`google.cloud.datastore.key.Key` :param keys: The keys to be retrieved from the datastore. :type missing...
[ "def", "get_multi", "(", "self", ",", "keys", ",", "missing", "=", "None", ",", "deferred", "=", "None", ",", "transaction", "=", "None", ",", "eventual", "=", "False", ")", ":", "if", "not", "keys", ":", "return", "[", "]", "ids", "=", "set", "(",...
Retrieve entities, along with their attributes. :type keys: list of :class:`google.cloud.datastore.key.Key` :param keys: The keys to be retrieved from the datastore. :type missing: list :param missing: (Optional) If a list is passed, the key-only entities return...
[ "Retrieve", "entities", "along", "with", "their", "attributes", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L342-L407
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client.put_multi
def put_multi(self, entities): """Save entities in the Cloud Datastore. :type entities: list of :class:`google.cloud.datastore.entity.Entity` :param entities: The entities to be saved to the datastore. :raises: :class:`ValueError` if ``entities`` is a single entity. """ ...
python
def put_multi(self, entities): """Save entities in the Cloud Datastore. :type entities: list of :class:`google.cloud.datastore.entity.Entity` :param entities: The entities to be saved to the datastore. :raises: :class:`ValueError` if ``entities`` is a single entity. """ ...
[ "def", "put_multi", "(", "self", ",", "entities", ")", ":", "if", "isinstance", "(", "entities", ",", "Entity", ")", ":", "raise", "ValueError", "(", "\"Pass a sequence of entities\"", ")", "if", "not", "entities", ":", "return", "current", "=", "self", ".",...
Save entities in the Cloud Datastore. :type entities: list of :class:`google.cloud.datastore.entity.Entity` :param entities: The entities to be saved to the datastore. :raises: :class:`ValueError` if ``entities`` is a single entity.
[ "Save", "entities", "in", "the", "Cloud", "Datastore", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L423-L448
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client.delete_multi
def delete_multi(self, keys): """Delete keys from the Cloud Datastore. :type keys: list of :class:`google.cloud.datastore.key.Key` :param keys: The keys to be deleted from the Datastore. """ if not keys: return # We allow partial keys to attempt a delete, th...
python
def delete_multi(self, keys): """Delete keys from the Cloud Datastore. :type keys: list of :class:`google.cloud.datastore.key.Key` :param keys: The keys to be deleted from the Datastore. """ if not keys: return # We allow partial keys to attempt a delete, th...
[ "def", "delete_multi", "(", "self", ",", "keys", ")", ":", "if", "not", "keys", ":", "return", "# We allow partial keys to attempt a delete, the backend will fail.", "current", "=", "self", ".", "current_batch", "in_batch", "=", "current", "is", "not", "None", "if",...
Delete keys from the Cloud Datastore. :type keys: list of :class:`google.cloud.datastore.key.Key` :param keys: The keys to be deleted from the Datastore.
[ "Delete", "keys", "from", "the", "Cloud", "Datastore", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L464-L485
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client.allocate_ids
def allocate_ids(self, incomplete_key, num_ids): """Allocate a list of IDs from a partial key. :type incomplete_key: :class:`google.cloud.datastore.key.Key` :param incomplete_key: Partial key to use as base for allocated IDs. :type num_ids: int :param num_ids: The number of IDs...
python
def allocate_ids(self, incomplete_key, num_ids): """Allocate a list of IDs from a partial key. :type incomplete_key: :class:`google.cloud.datastore.key.Key` :param incomplete_key: Partial key to use as base for allocated IDs. :type num_ids: int :param num_ids: The number of IDs...
[ "def", "allocate_ids", "(", "self", ",", "incomplete_key", ",", "num_ids", ")", ":", "if", "not", "incomplete_key", ".", "is_partial", ":", "raise", "ValueError", "(", "(", "\"Key is not partial.\"", ",", "incomplete_key", ")", ")", "incomplete_key_pb", "=", "in...
Allocate a list of IDs from a partial key. :type incomplete_key: :class:`google.cloud.datastore.key.Key` :param incomplete_key: Partial key to use as base for allocated IDs. :type num_ids: int :param num_ids: The number of IDs to allocate. :rtype: list of :class:`google.cloud....
[ "Allocate", "a", "list", "of", "IDs", "from", "a", "partial", "key", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L487-L516
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client.key
def key(self, *path_args, **kwargs): """Proxy to :class:`google.cloud.datastore.key.Key`. Passes our ``project``. """ if "project" in kwargs: raise TypeError("Cannot pass project") kwargs["project"] = self.project if "namespace" not in kwargs: kwa...
python
def key(self, *path_args, **kwargs): """Proxy to :class:`google.cloud.datastore.key.Key`. Passes our ``project``. """ if "project" in kwargs: raise TypeError("Cannot pass project") kwargs["project"] = self.project if "namespace" not in kwargs: kwa...
[ "def", "key", "(", "self", ",", "*", "path_args", ",", "*", "*", "kwargs", ")", ":", "if", "\"project\"", "in", "kwargs", ":", "raise", "TypeError", "(", "\"Cannot pass project\"", ")", "kwargs", "[", "\"project\"", "]", "=", "self", ".", "project", "if"...
Proxy to :class:`google.cloud.datastore.key.Key`. Passes our ``project``.
[ "Proxy", "to", ":", "class", ":", "google", ".", "cloud", ".", "datastore", ".", "key", ".", "Key", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L518-L528
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/client.py
Client.query
def query(self, **kwargs): """Proxy to :class:`google.cloud.datastore.query.Query`. Passes our ``project``. Using query to search a datastore: .. testsetup:: query import os import uuid from google.cloud import datastore unique = os.g...
python
def query(self, **kwargs): """Proxy to :class:`google.cloud.datastore.query.Query`. Passes our ``project``. Using query to search a datastore: .. testsetup:: query import os import uuid from google.cloud import datastore unique = os.g...
[ "def", "query", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "\"client\"", "in", "kwargs", ":", "raise", "TypeError", "(", "\"Cannot pass client\"", ")", "if", "\"project\"", "in", "kwargs", ":", "raise", "TypeError", "(", "\"Cannot pass project\"", ...
Proxy to :class:`google.cloud.datastore.query.Query`. Passes our ``project``. Using query to search a datastore: .. testsetup:: query import os import uuid from google.cloud import datastore unique = os.getenv('CIRCLE_BUILD_NUM', str(uuid.uui...
[ "Proxy", "to", ":", "class", ":", "google", ".", "cloud", ".", "datastore", ".", "query", ".", "Query", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/client.py#L542-L624
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/batcher.py
MutationsBatcher.mutate
def mutate(self, row): """ Add a row to the batch. If the current batch meets one of the size limits, the batch is sent synchronously. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_batcher_mutate] :end-before: [END bigtable_batcher_m...
python
def mutate(self, row): """ Add a row to the batch. If the current batch meets one of the size limits, the batch is sent synchronously. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_batcher_mutate] :end-before: [END bigtable_batcher_m...
[ "def", "mutate", "(", "self", ",", "row", ")", ":", "mutation_count", "=", "len", "(", "row", ".", "_get_mutations", "(", ")", ")", "if", "mutation_count", ">", "MAX_MUTATIONS", ":", "raise", "MaxMutationsError", "(", "\"The row key {} exceeds the number of mutati...
Add a row to the batch. If the current batch meets one of the size limits, the batch is sent synchronously. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_batcher_mutate] :end-before: [END bigtable_batcher_mutate] :type row: class ...
[ "Add", "a", "row", "to", "the", "batch", ".", "If", "the", "current", "batch", "meets", "one", "of", "the", "size", "limits", "the", "batch", "is", "sent", "synchronously", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/batcher.py#L67-L104
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/batcher.py
MutationsBatcher.flush
def flush(self): """ Sends the current. batch to Cloud Bigtable. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_batcher_flush] :end-before: [END bigtable_batcher_flush] """ if len(self.rows) != 0: self.table.mutate...
python
def flush(self): """ Sends the current. batch to Cloud Bigtable. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_batcher_flush] :end-before: [END bigtable_batcher_flush] """ if len(self.rows) != 0: self.table.mutate...
[ "def", "flush", "(", "self", ")", ":", "if", "len", "(", "self", ".", "rows", ")", "!=", "0", ":", "self", ".", "table", ".", "mutate_rows", "(", "self", ".", "rows", ")", "self", ".", "total_mutation_count", "=", "0", "self", ".", "total_size", "=...
Sends the current. batch to Cloud Bigtable. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_batcher_flush] :end-before: [END bigtable_batcher_flush]
[ "Sends", "the", "current", ".", "batch", "to", "Cloud", "Bigtable", ".", "For", "example", ":" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/batcher.py#L130-L143
train
googleapis/google-cloud-python
storage/google/cloud/storage/notification.py
_parse_topic_path
def _parse_topic_path(topic_path): """Verify that a topic path is in the correct format. .. _resource manager docs: https://cloud.google.com/resource-manager/\ reference/rest/v1beta1/projects#\ Project.FIELDS.project_id .. _topic spec: https://c...
python
def _parse_topic_path(topic_path): """Verify that a topic path is in the correct format. .. _resource manager docs: https://cloud.google.com/resource-manager/\ reference/rest/v1beta1/projects#\ Project.FIELDS.project_id .. _topic spec: https://c...
[ "def", "_parse_topic_path", "(", "topic_path", ")", ":", "match", "=", "_TOPIC_REF_RE", ".", "match", "(", "topic_path", ")", "if", "match", "is", "None", ":", "raise", "ValueError", "(", "_BAD_TOPIC", ".", "format", "(", "topic_path", ")", ")", "return", ...
Verify that a topic path is in the correct format. .. _resource manager docs: https://cloud.google.com/resource-manager/\ reference/rest/v1beta1/projects#\ Project.FIELDS.project_id .. _topic spec: https://cloud.google.com/storage/docs/json_api/v1/\...
[ "Verify", "that", "a", "topic", "path", "is", "in", "the", "correct", "format", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/notification.py#L355-L389
train
googleapis/google-cloud-python
storage/google/cloud/storage/notification.py
BucketNotification.from_api_repr
def from_api_repr(cls, resource, bucket): """Construct an instance from the JSON repr returned by the server. See: https://cloud.google.com/storage/docs/json_api/v1/notifications :type resource: dict :param resource: JSON repr of the notification :type bucket: :class:`google.c...
python
def from_api_repr(cls, resource, bucket): """Construct an instance from the JSON repr returned by the server. See: https://cloud.google.com/storage/docs/json_api/v1/notifications :type resource: dict :param resource: JSON repr of the notification :type bucket: :class:`google.c...
[ "def", "from_api_repr", "(", "cls", ",", "resource", ",", "bucket", ")", ":", "topic_path", "=", "resource", ".", "get", "(", "\"topic\"", ")", "if", "topic_path", "is", "None", ":", "raise", "ValueError", "(", "\"Resource has no topic\"", ")", "name", ",", ...
Construct an instance from the JSON repr returned by the server. See: https://cloud.google.com/storage/docs/json_api/v1/notifications :type resource: dict :param resource: JSON repr of the notification :type bucket: :class:`google.cloud.storage.bucket.Bucket` :param bucket: Bu...
[ "Construct", "an", "instance", "from", "the", "JSON", "repr", "returned", "by", "the", "server", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/notification.py#L111-L133
train
googleapis/google-cloud-python
storage/google/cloud/storage/notification.py
BucketNotification._set_properties
def _set_properties(self, response): """Helper for :meth:`reload`. :type response: dict :param response: resource mapping from server """ self._properties.clear() self._properties.update(response)
python
def _set_properties(self, response): """Helper for :meth:`reload`. :type response: dict :param response: resource mapping from server """ self._properties.clear() self._properties.update(response)
[ "def", "_set_properties", "(", "self", ",", "response", ")", ":", "self", ".", "_properties", ".", "clear", "(", ")", "self", ".", "_properties", ".", "update", "(", "response", ")" ]
Helper for :meth:`reload`. :type response: dict :param response: resource mapping from server
[ "Helper", "for", ":", "meth", ":", "reload", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/notification.py#L215-L222
train
googleapis/google-cloud-python
storage/google/cloud/storage/notification.py
BucketNotification.create
def create(self, client=None): """API wrapper: create the notification. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/insert If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud....
python
def create(self, client=None): """API wrapper: create the notification. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/insert If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud....
[ "def", "create", "(", "self", ",", "client", "=", "None", ")", ":", "if", "self", ".", "notification_id", "is", "not", "None", ":", "raise", "ValueError", "(", "\"Notification already exists w/ id: {}\"", ".", "format", "(", "self", ".", "notification_id", ")"...
API wrapper: create the notification. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/insert If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` :param clie...
[ "API", "wrapper", ":", "create", "the", "notification", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/notification.py#L224-L253
train
googleapis/google-cloud-python
storage/google/cloud/storage/notification.py
BucketNotification.exists
def exists(self, client=None): """Test whether this notification exists. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/get If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.st...
python
def exists(self, client=None): """Test whether this notification exists. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/get If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.st...
[ "def", "exists", "(", "self", ",", "client", "=", "None", ")", ":", "if", "self", ".", "notification_id", "is", "None", ":", "raise", "ValueError", "(", "\"Notification not intialized by server\"", ")", "client", "=", "self", ".", "_require_client", "(", "clie...
Test whether this notification exists. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/get If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
[ "Test", "whether", "this", "notification", "exists", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/notification.py#L255-L289
train
googleapis/google-cloud-python
storage/google/cloud/storage/notification.py
BucketNotification.reload
def reload(self, client=None): """Update this notification from the server configuration. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/get If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:...
python
def reload(self, client=None): """Update this notification from the server configuration. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/get If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:...
[ "def", "reload", "(", "self", ",", "client", "=", "None", ")", ":", "if", "self", ".", "notification_id", "is", "None", ":", "raise", "ValueError", "(", "\"Notification not intialized by server\"", ")", "client", "=", "self", ".", "_require_client", "(", "clie...
Update this notification from the server configuration. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/get If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
[ "Update", "this", "notification", "from", "the", "server", "configuration", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/notification.py#L291-L321
train
googleapis/google-cloud-python
storage/google/cloud/storage/notification.py
BucketNotification.delete
def delete(self, client=None): """Delete this notification. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/delete If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.storage.clie...
python
def delete(self, client=None): """Delete this notification. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/delete If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.storage.clie...
[ "def", "delete", "(", "self", ",", "client", "=", "None", ")", ":", "if", "self", ".", "notification_id", "is", "None", ":", "raise", "ValueError", "(", "\"Notification not intialized by server\"", ")", "client", "=", "self", ".", "_require_client", "(", "clie...
Delete this notification. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/delete If :attr:`user_project` is set on the bucket, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``None...
[ "Delete", "this", "notification", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/notification.py#L323-L352
train
googleapis/google-cloud-python
redis/google/cloud/redis_v1/gapic/cloud_redis_client.py
CloudRedisClient.create_instance
def create_instance( self, parent, instance_id, instance, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a Redis instance based on the specified tier and memory size...
python
def create_instance( self, parent, instance_id, instance, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a Redis instance based on the specified tier and memory size...
[ "def", "create_instance", "(", "self", ",", "parent", ",", "instance_id", ",", "instance", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", ...
Creates a Redis instance based on the specified tier and memory size. By default, the instance is accessible from the project's `default network <https://cloud.google.com/compute/docs/networks-and-firewalls#networks>`__. The creation is executed asynchronously and callers may check the ...
[ "Creates", "a", "Redis", "instance", "based", "on", "the", "specified", "tier", "and", "memory", "size", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1/gapic/cloud_redis_client.py#L367-L471
train
googleapis/google-cloud-python
redis/google/cloud/redis_v1/gapic/cloud_redis_client.py
CloudRedisClient.import_instance
def import_instance( self, name, input_config, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Import a Redis RDB snapshot file from GCS into a Redis instance. Redis may sto...
python
def import_instance( self, name, input_config, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Import a Redis RDB snapshot file from GCS into a Redis instance. Redis may sto...
[ "def", "import_instance", "(", "self", ",", "name", ",", "input_config", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "D...
Import a Redis RDB snapshot file from GCS into a Redis instance. Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file. The returned operation is automatically delet...
[ "Import", "a", "Redis", "RDB", "snapshot", "file", "from", "GCS", "into", "a", "Redis", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1/gapic/cloud_redis_client.py#L646-L734
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py
NotificationChannelServiceClient.notification_channel_path
def notification_channel_path(cls, project, notification_channel): """Return a fully-qualified notification_channel string.""" return google.api_core.path_template.expand( "projects/{project}/notificationChannels/{notification_channel}", project=project, notification_...
python
def notification_channel_path(cls, project, notification_channel): """Return a fully-qualified notification_channel string.""" return google.api_core.path_template.expand( "projects/{project}/notificationChannels/{notification_channel}", project=project, notification_...
[ "def", "notification_channel_path", "(", "cls", ",", "project", ",", "notification_channel", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/notificationChannels/{notification_channel}\"", ",", "project", "=",...
Return a fully-qualified notification_channel string.
[ "Return", "a", "fully", "-", "qualified", "notification_channel", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py#L101-L107
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py
NotificationChannelServiceClient.notification_channel_descriptor_path
def notification_channel_descriptor_path(cls, project, channel_descriptor): """Return a fully-qualified notification_channel_descriptor string.""" return google.api_core.path_template.expand( "projects/{project}/notificationChannelDescriptors/{channel_descriptor}", project=projec...
python
def notification_channel_descriptor_path(cls, project, channel_descriptor): """Return a fully-qualified notification_channel_descriptor string.""" return google.api_core.path_template.expand( "projects/{project}/notificationChannelDescriptors/{channel_descriptor}", project=projec...
[ "def", "notification_channel_descriptor_path", "(", "cls", ",", "project", ",", "channel_descriptor", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/notificationChannelDescriptors/{channel_descriptor}\"", ",", ...
Return a fully-qualified notification_channel_descriptor string.
[ "Return", "a", "fully", "-", "qualified", "notification_channel_descriptor", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py#L110-L116
train
googleapis/google-cloud-python
logging/google/cloud/logging/logger.py
Logger.batch
def batch(self, client=None): """Return a batch to use as a context manager. :type client: :class:`~google.cloud.logging.client.Client` or ``NoneType`` :param client: the client to use. If not passed, falls back to the ``client`` stored on the curre...
python
def batch(self, client=None): """Return a batch to use as a context manager. :type client: :class:`~google.cloud.logging.client.Client` or ``NoneType`` :param client: the client to use. If not passed, falls back to the ``client`` stored on the curre...
[ "def", "batch", "(", "self", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "return", "Batch", "(", "self", ",", "client", ")" ]
Return a batch to use as a context manager. :type client: :class:`~google.cloud.logging.client.Client` or ``NoneType`` :param client: the client to use. If not passed, falls back to the ``client`` stored on the current topic. :rtype: :class:`Batch`...
[ "Return", "a", "batch", "to", "use", "as", "a", "context", "manager", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/logger.py#L102-L114
train
googleapis/google-cloud-python
logging/google/cloud/logging/logger.py
Logger._do_log
def _do_log(self, client, _entry_class, payload=None, **kw): """Helper for :meth:`log_empty`, :meth:`log_text`, etc. """ client = self._require_client(client) # Apply defaults kw["log_name"] = kw.pop("log_name", self.full_name) kw["labels"] = kw.pop("labels", self.labels...
python
def _do_log(self, client, _entry_class, payload=None, **kw): """Helper for :meth:`log_empty`, :meth:`log_text`, etc. """ client = self._require_client(client) # Apply defaults kw["log_name"] = kw.pop("log_name", self.full_name) kw["labels"] = kw.pop("labels", self.labels...
[ "def", "_do_log", "(", "self", ",", "client", ",", "_entry_class", ",", "payload", "=", "None", ",", "*", "*", "kw", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "# Apply defaults", "kw", "[", "\"log_name\"", "]", "=", "...
Helper for :meth:`log_empty`, :meth:`log_text`, etc.
[ "Helper", "for", ":", "meth", ":", "log_empty", ":", "meth", ":", "log_text", "etc", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/logger.py#L116-L132
train
googleapis/google-cloud-python
logging/google/cloud/logging/logger.py
Logger.log_text
def log_text(self, text, client=None, **kw): """API call: log a text message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write :type text: str :param text: the log message. :type client: :class:`~google.cloud.logging.clien...
python
def log_text(self, text, client=None, **kw): """API call: log a text message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write :type text: str :param text: the log message. :type client: :class:`~google.cloud.logging.clien...
[ "def", "log_text", "(", "self", ",", "text", ",", "client", "=", "None", ",", "*", "*", "kw", ")", ":", "self", ".", "_do_log", "(", "client", ",", "TextEntry", ",", "text", ",", "*", "*", "kw", ")" ]
API call: log a text message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write :type text: str :param text: the log message. :type client: :class:`~google.cloud.logging.client.Client` or ``NoneType`` ...
[ "API", "call", ":", "log", "a", "text", "message", "via", "a", "POST", "request" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/logger.py#L151-L169
train
googleapis/google-cloud-python
logging/google/cloud/logging/logger.py
Logger.log_struct
def log_struct(self, info, client=None, **kw): """API call: log a structured message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write :type info: dict :param info: the log entry information :type client: :class:`~google.c...
python
def log_struct(self, info, client=None, **kw): """API call: log a structured message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write :type info: dict :param info: the log entry information :type client: :class:`~google.c...
[ "def", "log_struct", "(", "self", ",", "info", ",", "client", "=", "None", ",", "*", "*", "kw", ")", ":", "self", ".", "_do_log", "(", "client", ",", "StructEntry", ",", "info", ",", "*", "*", "kw", ")" ]
API call: log a structured message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write :type info: dict :param info: the log entry information :type client: :class:`~google.cloud.logging.client.Client` or ``Non...
[ "API", "call", ":", "log", "a", "structured", "message", "via", "a", "POST", "request" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/logger.py#L171-L189
train
googleapis/google-cloud-python
logging/google/cloud/logging/logger.py
Logger.log_proto
def log_proto(self, message, client=None, **kw): """API call: log a protobuf message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list :type message: :class:`~google.protobuf.message.Message` :param message: The protobuf message to ...
python
def log_proto(self, message, client=None, **kw): """API call: log a protobuf message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list :type message: :class:`~google.protobuf.message.Message` :param message: The protobuf message to ...
[ "def", "log_proto", "(", "self", ",", "message", ",", "client", "=", "None", ",", "*", "*", "kw", ")", ":", "self", ".", "_do_log", "(", "client", ",", "ProtobufEntry", ",", "message", ",", "*", "*", "kw", ")" ]
API call: log a protobuf message via a POST request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list :type message: :class:`~google.protobuf.message.Message` :param message: The protobuf message to be logged. :type client: :class:`~google.cloud.logg...
[ "API", "call", ":", "log", "a", "protobuf", "message", "via", "a", "POST", "request" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/logger.py#L191-L209
train