id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
28,200
googleapis/google-cloud-python
dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py
WorkflowTemplateServiceClient.get_workflow_template
def get_workflow_template( self, name, version=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Retrieves the latest workflow template. Can retrieve previously instanti...
python
def get_workflow_template( self, name, version=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Retrieves the latest workflow template. Can retrieve previously instanti...
[ "def", "get_workflow_template", "(", "self", ",", "name", ",", "version", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "me...
Retrieves the latest workflow template. Can retrieve previously instantiated template by specifying optional version parameter. Example: >>> from google.cloud import dataproc_v1beta2 >>> >>> client = dataproc_v1beta2.WorkflowTemplateServiceClient() ...
[ "Retrieves", "the", "latest", "workflow", "template", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L270-L336
28,201
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/schema.py
_parse_schema_resource
def _parse_schema_resource(info): """Parse a resource fragment into a schema field. Args: info: (Mapping[str->dict]): should contain a "fields" key to be parsed Returns: (Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None]) a list of parsed fields, or ``None...
python
def _parse_schema_resource(info): """Parse a resource fragment into a schema field. Args: info: (Mapping[str->dict]): should contain a "fields" key to be parsed Returns: (Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None]) a list of parsed fields, or ``None...
[ "def", "_parse_schema_resource", "(", "info", ")", ":", "if", "\"fields\"", "not", "in", "info", ":", "return", "(", ")", "schema", "=", "[", "]", "for", "r_field", "in", "info", "[", "\"fields\"", "]", ":", "name", "=", "r_field", "[", "\"name\"", "]"...
Parse a resource fragment into a schema field. Args: info: (Mapping[str->dict]): should contain a "fields" key to be parsed Returns: (Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None]) a list of parsed fields, or ``None`` if no "fields" key found.
[ "Parse", "a", "resource", "fragment", "into", "a", "schema", "field", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L164-L185
28,202
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/schema.py
SchemaField.from_api_repr
def from_api_repr(cls, api_repr): """Return a ``SchemaField`` object deserialized from a dictionary. Args: api_repr (Mapping[str, str]): The serialized representation of the SchemaField, such as what is output by :meth:`to_api_repr`. Returns: ...
python
def from_api_repr(cls, api_repr): """Return a ``SchemaField`` object deserialized from a dictionary. Args: api_repr (Mapping[str, str]): The serialized representation of the SchemaField, such as what is output by :meth:`to_api_repr`. Returns: ...
[ "def", "from_api_repr", "(", "cls", ",", "api_repr", ")", ":", "# Handle optional properties with default values", "mode", "=", "api_repr", ".", "get", "(", "\"mode\"", ",", "\"NULLABLE\"", ")", "description", "=", "api_repr", ".", "get", "(", "\"description\"", "...
Return a ``SchemaField`` object deserialized from a dictionary. Args: api_repr (Mapping[str, str]): The serialized representation of the SchemaField, such as what is output by :meth:`to_api_repr`. Returns: google.cloud.biquery.schema.SchemaField:...
[ "Return", "a", "SchemaField", "object", "deserialized", "from", "a", "dictionary", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L44-L66
28,203
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/schema.py
SchemaField.to_api_repr
def to_api_repr(self): """Return a dictionary representing this schema field. Returns: dict: A dictionary representing the SchemaField in a serialized form. """ # Put together the basic representation. See http://bit.ly/2hOAT5u. answer = { ...
python
def to_api_repr(self): """Return a dictionary representing this schema field. Returns: dict: A dictionary representing the SchemaField in a serialized form. """ # Put together the basic representation. See http://bit.ly/2hOAT5u. answer = { ...
[ "def", "to_api_repr", "(", "self", ")", ":", "# Put together the basic representation. See http://bit.ly/2hOAT5u.", "answer", "=", "{", "\"mode\"", ":", "self", ".", "mode", ".", "upper", "(", ")", ",", "\"name\"", ":", "self", ".", "name", ",", "\"type\"", ":",...
Return a dictionary representing this schema field. Returns: dict: A dictionary representing the SchemaField in a serialized form.
[ "Return", "a", "dictionary", "representing", "this", "schema", "field", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L109-L130
28,204
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
parse_options
def parse_options(): """Parses options.""" parser = argparse.ArgumentParser() parser.add_argument('command', help='The YCSB command.') parser.add_argument('benchmark', help='The YCSB benchmark.') parser.add_argument('-P', '--workload', action='store', dest='workload', default...
python
def parse_options(): """Parses options.""" parser = argparse.ArgumentParser() parser.add_argument('command', help='The YCSB command.') parser.add_argument('benchmark', help='The YCSB benchmark.') parser.add_argument('-P', '--workload', action='store', dest='workload', default...
[ "def", "parse_options", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "parser", ".", "add_argument", "(", "'command'", ",", "help", "=", "'The YCSB command.'", ")", "parser", ".", "add_argument", "(", "'benchmark'", ",", "help", ...
Parses options.
[ "Parses", "options", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L51-L81
28,205
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
load_keys
def load_keys(database, parameters): """Loads keys from database.""" keys = [] with database.snapshot() as snapshot: results = snapshot.execute_sql( 'SELECT u.id FROM %s u' % parameters['table']) for row in results: keys.append(row[0]) return keys
python
def load_keys(database, parameters): """Loads keys from database.""" keys = [] with database.snapshot() as snapshot: results = snapshot.execute_sql( 'SELECT u.id FROM %s u' % parameters['table']) for row in results: keys.append(row[0]) return keys
[ "def", "load_keys", "(", "database", ",", "parameters", ")", ":", "keys", "=", "[", "]", "with", "database", ".", "snapshot", "(", ")", "as", "snapshot", ":", "results", "=", "snapshot", ".", "execute_sql", "(", "'SELECT u.id FROM %s u'", "%", "parameters", ...
Loads keys from database.
[ "Loads", "keys", "from", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L96-L106
28,206
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
read
def read(database, table, key): """Does a single read operation.""" with database.snapshot() as snapshot: result = snapshot.execute_sql('SELECT u.* FROM %s u WHERE u.id="%s"' % (table, key)) for row in result: key = row[0] for i in range(...
python
def read(database, table, key): """Does a single read operation.""" with database.snapshot() as snapshot: result = snapshot.execute_sql('SELECT u.* FROM %s u WHERE u.id="%s"' % (table, key)) for row in result: key = row[0] for i in range(...
[ "def", "read", "(", "database", ",", "table", ",", "key", ")", ":", "with", "database", ".", "snapshot", "(", ")", "as", "snapshot", ":", "result", "=", "snapshot", ".", "execute_sql", "(", "'SELECT u.* FROM %s u WHERE u.id=\"%s\"'", "%", "(", "table", ",", ...
Does a single read operation.
[ "Does", "a", "single", "read", "operation", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L109-L117
28,207
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
update
def update(database, table, key): """Does a single update operation.""" field = random.randrange(10) value = ''.join(random.choice(string.printable) for i in range(100)) with database.batch() as batch: batch.update(table=table, columns=('id', 'field%d' % field), values=[(key...
python
def update(database, table, key): """Does a single update operation.""" field = random.randrange(10) value = ''.join(random.choice(string.printable) for i in range(100)) with database.batch() as batch: batch.update(table=table, columns=('id', 'field%d' % field), values=[(key...
[ "def", "update", "(", "database", ",", "table", ",", "key", ")", ":", "field", "=", "random", ".", "randrange", "(", "10", ")", "value", "=", "''", ".", "join", "(", "random", ".", "choice", "(", "string", ".", "printable", ")", "for", "i", "in", ...
Does a single update operation.
[ "Does", "a", "single", "update", "operation", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L120-L126
28,208
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
do_operation
def do_operation(database, keys, table, operation, latencies_ms): """Does a single operation and records latency.""" key = random.choice(keys) start = timeit.default_timer() if operation == 'read': read(database, table, key) elif operation == 'update': update(database, table, key) ...
python
def do_operation(database, keys, table, operation, latencies_ms): """Does a single operation and records latency.""" key = random.choice(keys) start = timeit.default_timer() if operation == 'read': read(database, table, key) elif operation == 'update': update(database, table, key) ...
[ "def", "do_operation", "(", "database", ",", "keys", ",", "table", ",", "operation", ",", "latencies_ms", ")", ":", "key", "=", "random", ".", "choice", "(", "keys", ")", "start", "=", "timeit", ".", "default_timer", "(", ")", "if", "operation", "==", ...
Does a single operation and records latency.
[ "Does", "a", "single", "operation", "and", "records", "latency", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L129-L140
28,209
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
aggregate_metrics
def aggregate_metrics(latencies_ms, duration_ms, num_bucket): """Aggregates metrics.""" overall_op_count = 0 op_counts = {operation : len(latency) for operation, latency in latencies_ms.iteritems()} overall_op_count = sum([op_count for op_count in op_counts.itervalues()]) print('[O...
python
def aggregate_metrics(latencies_ms, duration_ms, num_bucket): """Aggregates metrics.""" overall_op_count = 0 op_counts = {operation : len(latency) for operation, latency in latencies_ms.iteritems()} overall_op_count = sum([op_count for op_count in op_counts.itervalues()]) print('[O...
[ "def", "aggregate_metrics", "(", "latencies_ms", ",", "duration_ms", ",", "num_bucket", ")", ":", "overall_op_count", "=", "0", "op_counts", "=", "{", "operation", ":", "len", "(", "latency", ")", "for", "operation", ",", "latency", "in", "latencies_ms", ".", ...
Aggregates metrics.
[ "Aggregates", "metrics", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L143-L181
28,210
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
run_workload
def run_workload(database, keys, parameters): """Runs workload against the database.""" total_weight = 0.0 weights = [] operations = [] latencies_ms = {} for operation in OPERATIONS: weight = float(parameters[operation]) if weight <= 0.0: continue total_weight...
python
def run_workload(database, keys, parameters): """Runs workload against the database.""" total_weight = 0.0 weights = [] operations = [] latencies_ms = {} for operation in OPERATIONS: weight = float(parameters[operation]) if weight <= 0.0: continue total_weight...
[ "def", "run_workload", "(", "database", ",", "keys", ",", "parameters", ")", ":", "total_weight", "=", "0.0", "weights", "=", "[", "]", "operations", "=", "[", "]", "latencies_ms", "=", "{", "}", "for", "operation", "in", "OPERATIONS", ":", "weight", "="...
Runs workload against the database.
[ "Runs", "workload", "against", "the", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L219-L253
28,211
googleapis/google-cloud-python
spanner/benchmark/ycsb.py
WorkloadThread.run
def run(self): """Run a single thread of the workload.""" i = 0 operation_count = int(self._parameters['operationcount']) while i < operation_count: i += 1 weight = random.uniform(0, self._total_weight) for j in range(len(self._weights)): ...
python
def run(self): """Run a single thread of the workload.""" i = 0 operation_count = int(self._parameters['operationcount']) while i < operation_count: i += 1 weight = random.uniform(0, self._total_weight) for j in range(len(self._weights)): ...
[ "def", "run", "(", "self", ")", ":", "i", "=", "0", "operation_count", "=", "int", "(", "self", ".", "_parameters", "[", "'operationcount'", "]", ")", "while", "i", "<", "operation_count", ":", "i", "+=", "1", "weight", "=", "random", ".", "uniform", ...
Run a single thread of the workload.
[ "Run", "a", "single", "thread", "of", "the", "workload", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L200-L212
28,212
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/_gapic.py
add_methods
def add_methods(source_class, blacklist=()): """Add wrapped versions of the `api` member's methods to the class. Any methods passed in `blacklist` are not added. Additionally, any methods explicitly defined on the wrapped class are not added. """ def wrap(wrapped_fx): """Wrap a GAPIC m...
python
def add_methods(source_class, blacklist=()): """Add wrapped versions of the `api` member's methods to the class. Any methods passed in `blacklist` are not added. Additionally, any methods explicitly defined on the wrapped class are not added. """ def wrap(wrapped_fx): """Wrap a GAPIC m...
[ "def", "add_methods", "(", "source_class", ",", "blacklist", "=", "(", ")", ")", ":", "def", "wrap", "(", "wrapped_fx", ")", ":", "\"\"\"Wrap a GAPIC method; preserve its name and docstring.\"\"\"", "# If this is a static or class method, then we need to *not*", "# send self as...
Add wrapped versions of the `api` member's methods to the class. Any methods passed in `blacklist` are not added. Additionally, any methods explicitly defined on the wrapped class are not added.
[ "Add", "wrapped", "versions", "of", "the", "api", "member", "s", "methods", "to", "the", "class", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/_gapic.py#L20-L77
28,213
googleapis/google-cloud-python
vision/google/cloud/vision_v1/gapic/product_search_client.py
ProductSearchClient.create_product
def create_product( self, parent, product, product_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates and returns a new product resource. Possible erro...
python
def create_product( self, parent, product, product_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates and returns a new product resource. Possible erro...
[ "def", "create_product", "(", "self", ",", "parent", ",", "product", ",", "product_id", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic...
Creates and returns a new product resource. Possible errors: - Returns INVALID\_ARGUMENT if display\_name is missing or longer than 4096 characters. - Returns INVALID\_ARGUMENT if description is longer than 4096 characters. - Returns INVALID\_ARGUMENT if produc...
[ "Creates", "and", "returns", "a", "new", "product", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1/gapic/product_search_client.py#L230-L322
28,214
googleapis/google-cloud-python
vision/google/cloud/vision_v1/gapic/product_search_client.py
ProductSearchClient.update_product
def update_product( self, product, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Makes changes to a Product resource. Only the ``display_name``, ``descrip...
python
def update_product( self, product, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Makes changes to a Product resource. Only the ``display_name``, ``descrip...
[ "def", "update_product", "(", "self", ",", "product", ",", "update_mask", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "me...
Makes changes to a Product resource. Only the ``display_name``, ``description``, and ``labels`` fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: - Returns NOT\_FOUND if the Product ...
[ "Makes", "changes", "to", "a", "Product", "resource", ".", "Only", "the", "display_name", "description", "and", "labels", "fields", "can", "be", "updated", "right", "now", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1/gapic/product_search_client.py#L509-L604
28,215
googleapis/google-cloud-python
datastore/google/cloud/datastore/batch.py
_assign_entity_to_pb
def _assign_entity_to_pb(entity_pb, entity): """Copy ``entity`` into ``entity_pb``. Helper method for ``Batch.put``. :type entity_pb: :class:`.entity_pb2.Entity` :param entity_pb: The entity owned by a mutation. :type entity: :class:`google.cloud.datastore.entity.Entity` :param entity: The en...
python
def _assign_entity_to_pb(entity_pb, entity): """Copy ``entity`` into ``entity_pb``. Helper method for ``Batch.put``. :type entity_pb: :class:`.entity_pb2.Entity` :param entity_pb: The entity owned by a mutation. :type entity: :class:`google.cloud.datastore.entity.Entity` :param entity: The en...
[ "def", "_assign_entity_to_pb", "(", "entity_pb", ",", "entity", ")", ":", "bare_entity_pb", "=", "helpers", ".", "entity_to_protobuf", "(", "entity", ")", "bare_entity_pb", ".", "key", ".", "CopyFrom", "(", "bare_entity_pb", ".", "key", ")", "entity_pb", ".", ...
Copy ``entity`` into ``entity_pb``. Helper method for ``Batch.put``. :type entity_pb: :class:`.entity_pb2.Entity` :param entity_pb: The entity owned by a mutation. :type entity: :class:`google.cloud.datastore.entity.Entity` :param entity: The entity being updated within the batch / transaction.
[ "Copy", "entity", "into", "entity_pb", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L309-L322
28,216
googleapis/google-cloud-python
datastore/google/cloud/datastore/batch.py
_parse_commit_response
def _parse_commit_response(commit_response_pb): """Extract response data from a commit response. :type commit_response_pb: :class:`.datastore_pb2.CommitResponse` :param commit_response_pb: The protobuf response from a commit request. :rtype: tuple :returns: The pair of the number of index updates ...
python
def _parse_commit_response(commit_response_pb): """Extract response data from a commit response. :type commit_response_pb: :class:`.datastore_pb2.CommitResponse` :param commit_response_pb: The protobuf response from a commit request. :rtype: tuple :returns: The pair of the number of index updates ...
[ "def", "_parse_commit_response", "(", "commit_response_pb", ")", ":", "mut_results", "=", "commit_response_pb", ".", "mutation_results", "index_updates", "=", "commit_response_pb", ".", "index_updates", "completed_keys", "=", "[", "mut_result", ".", "key", "for", "mut_r...
Extract response data from a commit response. :type commit_response_pb: :class:`.datastore_pb2.CommitResponse` :param commit_response_pb: The protobuf response from a commit request. :rtype: tuple :returns: The pair of the number of index updates and a list of :class:`.entity_pb2.Key` fo...
[ "Extract", "response", "data", "from", "a", "commit", "response", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L325-L341
28,217
googleapis/google-cloud-python
datastore/google/cloud/datastore/batch.py
Batch._add_partial_key_entity_pb
def _add_partial_key_entity_pb(self): """Adds a new mutation for an entity with a partial key. :rtype: :class:`.entity_pb2.Entity` :returns: The newly created entity protobuf that will be updated and sent with a commit. """ new_mutation = _datastore_pb2.Mutatio...
python
def _add_partial_key_entity_pb(self): """Adds a new mutation for an entity with a partial key. :rtype: :class:`.entity_pb2.Entity` :returns: The newly created entity protobuf that will be updated and sent with a commit. """ new_mutation = _datastore_pb2.Mutatio...
[ "def", "_add_partial_key_entity_pb", "(", "self", ")", ":", "new_mutation", "=", "_datastore_pb2", ".", "Mutation", "(", ")", "self", ".", "_mutations", ".", "append", "(", "new_mutation", ")", "return", "new_mutation", ".", "insert" ]
Adds a new mutation for an entity with a partial key. :rtype: :class:`.entity_pb2.Entity` :returns: The newly created entity protobuf that will be updated and sent with a commit.
[ "Adds", "a", "new", "mutation", "for", "an", "entity", "with", "a", "partial", "key", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L107-L116
28,218
googleapis/google-cloud-python
datastore/google/cloud/datastore/batch.py
Batch._add_complete_key_entity_pb
def _add_complete_key_entity_pb(self): """Adds a new mutation for an entity with a completed key. :rtype: :class:`.entity_pb2.Entity` :returns: The newly created entity protobuf that will be updated and sent with a commit. """ # We use ``upsert`` for entities w...
python
def _add_complete_key_entity_pb(self): """Adds a new mutation for an entity with a completed key. :rtype: :class:`.entity_pb2.Entity` :returns: The newly created entity protobuf that will be updated and sent with a commit. """ # We use ``upsert`` for entities w...
[ "def", "_add_complete_key_entity_pb", "(", "self", ")", ":", "# We use ``upsert`` for entities with completed keys, rather than", "# ``insert`` or ``update``, in order not to create race conditions", "# based on prior existence / removal of the entity.", "new_mutation", "=", "_datastore_pb2", ...
Adds a new mutation for an entity with a completed key. :rtype: :class:`.entity_pb2.Entity` :returns: The newly created entity protobuf that will be updated and sent with a commit.
[ "Adds", "a", "new", "mutation", "for", "an", "entity", "with", "a", "completed", "key", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L118-L130
28,219
googleapis/google-cloud-python
datastore/google/cloud/datastore/batch.py
Batch._add_delete_key_pb
def _add_delete_key_pb(self): """Adds a new mutation for a key to be deleted. :rtype: :class:`.entity_pb2.Key` :returns: The newly created key protobuf that will be deleted when sent with a commit. """ new_mutation = _datastore_pb2.Mutation() self._muta...
python
def _add_delete_key_pb(self): """Adds a new mutation for a key to be deleted. :rtype: :class:`.entity_pb2.Key` :returns: The newly created key protobuf that will be deleted when sent with a commit. """ new_mutation = _datastore_pb2.Mutation() self._muta...
[ "def", "_add_delete_key_pb", "(", "self", ")", ":", "new_mutation", "=", "_datastore_pb2", ".", "Mutation", "(", ")", "self", ".", "_mutations", ".", "append", "(", "new_mutation", ")", "return", "new_mutation", ".", "delete" ]
Adds a new mutation for a key to be deleted. :rtype: :class:`.entity_pb2.Key` :returns: The newly created key protobuf that will be deleted when sent with a commit.
[ "Adds", "a", "new", "mutation", "for", "a", "key", "to", "be", "deleted", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L132-L141
28,220
googleapis/google-cloud-python
datastore/google/cloud/datastore/batch.py
Batch.rollback
def rollback(self): """Rolls back the current batch. Marks the batch as aborted (can't be used again). Overridden by :class:`google.cloud.datastore.transaction.Transaction`. :raises: :class:`~exceptions.ValueError` if the batch is not in progress. """ ...
python
def rollback(self): """Rolls back the current batch. Marks the batch as aborted (can't be used again). Overridden by :class:`google.cloud.datastore.transaction.Transaction`. :raises: :class:`~exceptions.ValueError` if the batch is not in progress. """ ...
[ "def", "rollback", "(", "self", ")", ":", "if", "self", ".", "_status", "!=", "self", ".", "_IN_PROGRESS", ":", "raise", "ValueError", "(", "\"Batch must be in progress to rollback()\"", ")", "self", ".", "_status", "=", "self", ".", "_ABORTED" ]
Rolls back the current batch. Marks the batch as aborted (can't be used again). Overridden by :class:`google.cloud.datastore.transaction.Transaction`. :raises: :class:`~exceptions.ValueError` if the batch is not in progress.
[ "Rolls", "back", "the", "current", "batch", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L278-L291
28,221
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py
BigtableTableAdminClient.create_table
def create_table( self, parent, table_id, table, initial_splits=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new table in the specified instance. ...
python
def create_table( self, parent, table_id, table, initial_splits=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new table in the specified instance. ...
[ "def", "create_table", "(", "self", ",", "parent", ",", "table_id", ",", "table", ",", "initial_splits", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_c...
Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableTableAdminClient()...
[ "Creates", "a", "new", "table", "in", "the", "specified", "instance", ".", "The", "table", "can", "be", "created", "with", "a", "full", "set", "of", "initial", "column", "families", "specified", "in", "the", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L231-L339
28,222
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py
BigtableTableAdminClient.create_table_from_snapshot
def create_table_from_snapshot( self, parent, table_id, source_snapshot, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new table from the specified snapshot. The ...
python
def create_table_from_snapshot( self, parent, table_id, source_snapshot, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new table from the specified snapshot. The ...
[ "def", "create_table_from_snapshot", "(", "self", ",", "parent", ",", "table_id", ",", "source_snapshot", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapi...
Creates a new table from the specified snapshot. The target table must not exist. The snapshot and the table must be in the same instance. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This fe...
[ "Creates", "a", "new", "table", "from", "the", "specified", "snapshot", ".", "The", "target", "table", "must", "not", "exist", ".", "The", "snapshot", "and", "the", "table", "must", "be", "in", "the", "same", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L341-L447
28,223
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py
BigtableTableAdminClient.snapshot_table
def snapshot_table( self, name, cluster, snapshot_id, description, ttl=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new snapshot in the spe...
python
def snapshot_table( self, name, cluster, snapshot_id, description, ttl=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new snapshot in the spe...
[ "def", "snapshot_table", "(", "self", ",", "name", ",", "cluster", ",", "snapshot_id", ",", "description", ",", "ttl", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google...
Creates a new snapshot in the specified cluster from the specified source table. The cluster and the table must be in the same instance. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feat...
[ "Creates", "a", "new", "snapshot", "in", "the", "specified", "cluster", "from", "the", "specified", "source", "table", ".", "The", "cluster", "and", "the", "table", "must", "be", "in", "the", "same", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L1022-L1146
28,224
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/company_service_client.py
CompanyServiceClient.company_path
def company_path(cls, project, company): """Return a fully-qualified company string.""" return google.api_core.path_template.expand( "projects/{project}/companies/{company}", project=project, company=company )
python
def company_path(cls, project, company): """Return a fully-qualified company string.""" return google.api_core.path_template.expand( "projects/{project}/companies/{company}", project=project, company=company )
[ "def", "company_path", "(", "cls", ",", "project", ",", "company", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/companies/{company}\"", ",", "project", "=", "project", ",", "company", "=", "compan...
Return a fully-qualified company string.
[ "Return", "a", "fully", "-", "qualified", "company", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L81-L85
28,225
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/company_service_client.py
CompanyServiceClient.create_company
def create_company( self, parent, company, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new company entity. Example: >>> from google.cloud import ta...
python
def create_company( self, parent, company, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new company entity. Example: >>> from google.cloud import ta...
[ "def", "create_company", "(", "self", ",", "parent", ",", "company", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAU...
Creates a new company entity. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.CompanyServiceClient() >>> >>> parent = client.project_path('[PROJECT]') >>> >>> # TODO: Initialize `company`: ...
[ "Creates", "a", "new", "company", "entity", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L186-L257
28,226
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/company_service_client.py
CompanyServiceClient.update_company
def update_company( self, company, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates specified company. Example: >>> from google.cloud im...
python
def update_company( self, company, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates specified company. Example: >>> from google.cloud im...
[ "def", "update_company", "(", "self", ",", "company", ",", "update_mask", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "me...
Updates specified company. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.CompanyServiceClient() >>> >>> # TODO: Initialize `company`: >>> company = {} >>> >>> response = client...
[ "Updates", "specified", "company", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L320-L393
28,227
googleapis/google-cloud-python
dns/google/cloud/dns/client.py
Client.quotas
def quotas(self): """Return DNS quotas for the project associated with this client. See https://cloud.google.com/dns/api/v1/projects/get :rtype: mapping :returns: keys for the mapping correspond to those of the ``quota`` sub-mapping of the project resource. ...
python
def quotas(self): """Return DNS quotas for the project associated with this client. See https://cloud.google.com/dns/api/v1/projects/get :rtype: mapping :returns: keys for the mapping correspond to those of the ``quota`` sub-mapping of the project resource. ...
[ "def", "quotas", "(", "self", ")", ":", "path", "=", "\"/projects/%s\"", "%", "(", "self", ".", "project", ",", ")", "resp", "=", "self", ".", "_connection", ".", "api_request", "(", "method", "=", "\"GET\"", ",", "path", "=", "path", ")", "return", ...
Return DNS quotas for the project associated with this client. See https://cloud.google.com/dns/api/v1/projects/get :rtype: mapping :returns: keys for the mapping correspond to those of the ``quota`` sub-mapping of the project resource.
[ "Return", "DNS", "quotas", "for", "the", "project", "associated", "with", "this", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L57-L72
28,228
googleapis/google-cloud-python
dns/google/cloud/dns/client.py
Client.list_zones
def list_zones(self, max_results=None, page_token=None): """List zones for the project associated with this client. See https://cloud.google.com/dns/api/v1/managedZones/list :type max_results: int :param max_results: maximum number of zones to return, If not ...
python
def list_zones(self, max_results=None, page_token=None): """List zones for the project associated with this client. See https://cloud.google.com/dns/api/v1/managedZones/list :type max_results: int :param max_results: maximum number of zones to return, If not ...
[ "def", "list_zones", "(", "self", ",", "max_results", "=", "None", ",", "page_token", "=", "None", ")", ":", "path", "=", "\"/projects/%s/managedZones\"", "%", "(", "self", ".", "project", ",", ")", "return", "page_iterator", ".", "HTTPIterator", "(", "clien...
List zones for the project associated with this client. See https://cloud.google.com/dns/api/v1/managedZones/list :type max_results: int :param max_results: maximum number of zones to return, If not passed, defaults to a value set by the API. :type ...
[ "List", "zones", "for", "the", "project", "associated", "with", "this", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L74-L104
28,229
googleapis/google-cloud-python
dns/google/cloud/dns/client.py
Client.zone
def zone(self, name, dns_name=None, description=None): """Construct a zone bound to this client. :type name: str :param name: Name of the zone. :type dns_name: str :param dns_name: (Optional) DNS name of the zone. If not passed, then calls to :meth:`zon...
python
def zone(self, name, dns_name=None, description=None): """Construct a zone bound to this client. :type name: str :param name: Name of the zone. :type dns_name: str :param dns_name: (Optional) DNS name of the zone. If not passed, then calls to :meth:`zon...
[ "def", "zone", "(", "self", ",", "name", ",", "dns_name", "=", "None", ",", "description", "=", "None", ")", ":", "return", "ManagedZone", "(", "name", ",", "dns_name", ",", "client", "=", "self", ",", "description", "=", "description", ")" ]
Construct a zone bound to this client. :type name: str :param name: Name of the zone. :type dns_name: str :param dns_name: (Optional) DNS name of the zone. If not passed, then calls to :meth:`zone.create` will fail. :type description: str :para...
[ "Construct", "a", "zone", "bound", "to", "this", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L106-L125
28,230
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
28,231
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
28,232
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
28,233
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
28,234
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
28,235
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
28,236
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
28,237
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
28,238
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
28,239
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
28,240
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
28,241
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
28,242
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
28,243
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
28,244
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
28,245
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
28,246
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
28,247
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
28,248
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
28,249
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
28,250
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
28,251
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
28,252
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
28,253
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
28,254
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
28,255
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
28,256
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
28,257
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
28,258
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
28,259
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
28,260
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
28,261
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
28,262
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
28,263
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
28,264
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
28,265
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
28,266
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
28,267
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
28,268
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
28,269
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
28,270
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
28,271
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
28,272
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
28,273
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
28,274
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
28,275
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
28,276
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
28,277
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
28,278
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
28,279
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
28,280
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
28,281
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
28,282
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
28,283
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
28,284
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
28,285
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
28,286
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
28,287
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
28,288
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
28,289
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
28,290
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
28,291
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
28,292
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
28,293
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
28,294
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
28,295
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
28,296
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
28,297
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
28,298
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
28,299
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