partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
scalar_to_query_parameter
Convert a scalar value into a query parameter. :type value: any :param value: A scalar value to convert into a query parameter. :type name: str :param name: (Optional) Name of the query parameter. :rtype: :class:`~google.cloud.bigquery.ScalarQueryParameter` :returns: A query parameter...
bigquery/google/cloud/bigquery/dbapi/_helpers.py
def scalar_to_query_parameter(value, name=None): """Convert a scalar value into a query parameter. :type value: any :param value: A scalar value to convert into a query parameter. :type name: str :param name: (Optional) Name of the query parameter. :rtype: :class:`~google.cloud.bigquery.Scala...
def scalar_to_query_parameter(value, name=None): """Convert a scalar value into a query parameter. :type value: any :param value: A scalar value to convert into a query parameter. :type name: str :param name: (Optional) Name of the query parameter. :rtype: :class:`~google.cloud.bigquery.Scala...
[ "Convert", "a", "scalar", "value", "into", "a", "query", "parameter", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/_helpers.py#L30-L72
[ "def", "scalar_to_query_parameter", "(", "value", ",", "name", "=", "None", ")", ":", "parameter_type", "=", "None", "if", "isinstance", "(", "value", ",", "bool", ")", ":", "parameter_type", "=", "\"BOOL\"", "elif", "isinstance", "(", "value", ",", "numbers...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
to_query_parameters_dict
Converts a dictionary of parameter values into query parameters. :type parameters: Mapping[str, Any] :param parameters: Dictionary of query parameter values. :rtype: List[google.cloud.bigquery.query._AbstractQueryParameter] :returns: A list of named query parameters.
bigquery/google/cloud/bigquery/dbapi/_helpers.py
def to_query_parameters_dict(parameters): """Converts a dictionary of parameter values into query parameters. :type parameters: Mapping[str, Any] :param parameters: Dictionary of query parameter values. :rtype: List[google.cloud.bigquery.query._AbstractQueryParameter] :returns: A list of named que...
def to_query_parameters_dict(parameters): """Converts a dictionary of parameter values into query parameters. :type parameters: Mapping[str, Any] :param parameters: Dictionary of query parameter values. :rtype: List[google.cloud.bigquery.query._AbstractQueryParameter] :returns: A list of named que...
[ "Converts", "a", "dictionary", "of", "parameter", "values", "into", "query", "parameters", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/_helpers.py#L87-L99
[ "def", "to_query_parameters_dict", "(", "parameters", ")", ":", "return", "[", "scalar_to_query_parameter", "(", "value", ",", "name", "=", "name", ")", "for", "name", ",", "value", "in", "six", ".", "iteritems", "(", "parameters", ")", "]" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
to_query_parameters
Converts DB-API parameter values into query parameters. :type parameters: Mapping[str, Any] or Sequence[Any] :param parameters: A dictionary or sequence of query parameter values. :rtype: List[google.cloud.bigquery.query._AbstractQueryParameter] :returns: A list of query parameters.
bigquery/google/cloud/bigquery/dbapi/_helpers.py
def to_query_parameters(parameters): """Converts DB-API parameter values into query parameters. :type parameters: Mapping[str, Any] or Sequence[Any] :param parameters: A dictionary or sequence of query parameter values. :rtype: List[google.cloud.bigquery.query._AbstractQueryParameter] :returns: A ...
def to_query_parameters(parameters): """Converts DB-API parameter values into query parameters. :type parameters: Mapping[str, Any] or Sequence[Any] :param parameters: A dictionary or sequence of query parameter values. :rtype: List[google.cloud.bigquery.query._AbstractQueryParameter] :returns: A ...
[ "Converts", "DB", "-", "API", "parameter", "values", "into", "query", "parameters", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dbapi/_helpers.py#L102-L117
[ "def", "to_query_parameters", "(", "parameters", ")", ":", "if", "parameters", "is", "None", ":", "return", "[", "]", "if", "isinstance", "(", "parameters", ",", "collections_abc", ".", "Mapping", ")", ":", "return", "to_query_parameters_dict", "(", "parameters"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_refresh_http
Refresh an operation using a JSON/HTTP client. Args: api_request (Callable): A callable used to make an API request. This should generally be :meth:`google.cloud._http.Connection.api_request`. operation_name (str): The name of the operation. Returns: google.long...
api_core/google/api_core/operation.py
def _refresh_http(api_request, operation_name): """Refresh an operation using a JSON/HTTP client. Args: api_request (Callable): A callable used to make an API request. This should generally be :meth:`google.cloud._http.Connection.api_request`. operation_name (str): The n...
def _refresh_http(api_request, operation_name): """Refresh an operation using a JSON/HTTP client. Args: api_request (Callable): A callable used to make an API request. This should generally be :meth:`google.cloud._http.Connection.api_request`. operation_name (str): The n...
[ "Refresh", "an", "operation", "using", "a", "JSON", "/", "HTTP", "client", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L187-L201
[ "def", "_refresh_http", "(", "api_request", ",", "operation_name", ")", ":", "path", "=", "\"operations/{}\"", ".", "format", "(", "operation_name", ")", "api_response", "=", "api_request", "(", "method", "=", "\"GET\"", ",", "path", "=", "path", ")", "return"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_cancel_http
Cancel an operation using a JSON/HTTP client. Args: api_request (Callable): A callable used to make an API request. This should generally be :meth:`google.cloud._http.Connection.api_request`. operation_name (str): The name of the operation.
api_core/google/api_core/operation.py
def _cancel_http(api_request, operation_name): """Cancel an operation using a JSON/HTTP client. Args: api_request (Callable): A callable used to make an API request. This should generally be :meth:`google.cloud._http.Connection.api_request`. operation_name (str): The nam...
def _cancel_http(api_request, operation_name): """Cancel an operation using a JSON/HTTP client. Args: api_request (Callable): A callable used to make an API request. This should generally be :meth:`google.cloud._http.Connection.api_request`. operation_name (str): The nam...
[ "Cancel", "an", "operation", "using", "a", "JSON", "/", "HTTP", "client", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L204-L214
[ "def", "_cancel_http", "(", "api_request", ",", "operation_name", ")", ":", "path", "=", "\"operations/{}:cancel\"", ".", "format", "(", "operation_name", ")", "api_request", "(", "method", "=", "\"POST\"", ",", "path", "=", "path", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
from_http_json
Create an operation future using a HTTP/JSON client. This interacts with the long-running operations `service`_ (specific to a given API) via `HTTP/JSON`_. .. _HTTP/JSON: https://cloud.google.com/speech/reference/rest/\ v1beta1/operations#Operation Args: operation (dict): Operatio...
api_core/google/api_core/operation.py
def from_http_json(operation, api_request, result_type, **kwargs): """Create an operation future using a HTTP/JSON client. This interacts with the long-running operations `service`_ (specific to a given API) via `HTTP/JSON`_. .. _HTTP/JSON: https://cloud.google.com/speech/reference/rest/\ ...
def from_http_json(operation, api_request, result_type, **kwargs): """Create an operation future using a HTTP/JSON client. This interacts with the long-running operations `service`_ (specific to a given API) via `HTTP/JSON`_. .. _HTTP/JSON: https://cloud.google.com/speech/reference/rest/\ ...
[ "Create", "an", "operation", "future", "using", "a", "HTTP", "/", "JSON", "client", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L217-L241
[ "def", "from_http_json", "(", "operation", ",", "api_request", ",", "result_type", ",", "*", "*", "kwargs", ")", ":", "operation_proto", "=", "json_format", ".", "ParseDict", "(", "operation", ",", "operations_pb2", ".", "Operation", "(", ")", ")", "refresh", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_refresh_grpc
Refresh an operation using a gRPC client. Args: operations_stub (google.longrunning.operations_pb2.OperationsStub): The gRPC operations stub. operation_name (str): The name of the operation. Returns: google.longrunning.operations_pb2.Operation: The operation.
api_core/google/api_core/operation.py
def _refresh_grpc(operations_stub, operation_name): """Refresh an operation using a gRPC client. Args: operations_stub (google.longrunning.operations_pb2.OperationsStub): The gRPC operations stub. operation_name (str): The name of the operation. Returns: google.longrunn...
def _refresh_grpc(operations_stub, operation_name): """Refresh an operation using a gRPC client. Args: operations_stub (google.longrunning.operations_pb2.OperationsStub): The gRPC operations stub. operation_name (str): The name of the operation. Returns: google.longrunn...
[ "Refresh", "an", "operation", "using", "a", "gRPC", "client", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L244-L256
[ "def", "_refresh_grpc", "(", "operations_stub", ",", "operation_name", ")", ":", "request_pb", "=", "operations_pb2", ".", "GetOperationRequest", "(", "name", "=", "operation_name", ")", "return", "operations_stub", ".", "GetOperation", "(", "request_pb", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_cancel_grpc
Cancel an operation using a gRPC client. Args: operations_stub (google.longrunning.operations_pb2.OperationsStub): The gRPC operations stub. operation_name (str): The name of the operation.
api_core/google/api_core/operation.py
def _cancel_grpc(operations_stub, operation_name): """Cancel an operation using a gRPC client. Args: operations_stub (google.longrunning.operations_pb2.OperationsStub): The gRPC operations stub. operation_name (str): The name of the operation. """ request_pb = operations_pb2...
def _cancel_grpc(operations_stub, operation_name): """Cancel an operation using a gRPC client. Args: operations_stub (google.longrunning.operations_pb2.OperationsStub): The gRPC operations stub. operation_name (str): The name of the operation. """ request_pb = operations_pb2...
[ "Cancel", "an", "operation", "using", "a", "gRPC", "client", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L259-L268
[ "def", "_cancel_grpc", "(", "operations_stub", ",", "operation_name", ")", ":", "request_pb", "=", "operations_pb2", ".", "CancelOperationRequest", "(", "name", "=", "operation_name", ")", "operations_stub", ".", "CancelOperation", "(", "request_pb", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
from_grpc
Create an operation future using a gRPC client. This interacts with the long-running operations `service`_ (specific to a given API) via gRPC. .. _service: https://github.com/googleapis/googleapis/blob/\ 050400df0fdb16f63b63e9dee53819044bffc857/\ google/longrunning/operat...
api_core/google/api_core/operation.py
def from_grpc(operation, operations_stub, result_type, **kwargs): """Create an operation future using a gRPC client. This interacts with the long-running operations `service`_ (specific to a given API) via gRPC. .. _service: https://github.com/googleapis/googleapis/blob/\ 050400df0fdb...
def from_grpc(operation, operations_stub, result_type, **kwargs): """Create an operation future using a gRPC client. This interacts with the long-running operations `service`_ (specific to a given API) via gRPC. .. _service: https://github.com/googleapis/googleapis/blob/\ 050400df0fdb...
[ "Create", "an", "operation", "future", "using", "a", "gRPC", "client", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L271-L294
[ "def", "from_grpc", "(", "operation", ",", "operations_stub", ",", "result_type", ",", "*", "*", "kwargs", ")", ":", "refresh", "=", "functools", ".", "partial", "(", "_refresh_grpc", ",", "operations_stub", ",", "operation", ".", "name", ")", "cancel", "=",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
from_gapic
Create an operation future from a gapic client. This interacts with the long-running operations `service`_ (specific to a given API) via a gapic client. .. _service: https://github.com/googleapis/googleapis/blob/\ 050400df0fdb16f63b63e9dee53819044bffc857/\ google/longrunn...
api_core/google/api_core/operation.py
def from_gapic(operation, operations_client, result_type, **kwargs): """Create an operation future from a gapic client. This interacts with the long-running operations `service`_ (specific to a given API) via a gapic client. .. _service: https://github.com/googleapis/googleapis/blob/\ ...
def from_gapic(operation, operations_client, result_type, **kwargs): """Create an operation future from a gapic client. This interacts with the long-running operations `service`_ (specific to a given API) via a gapic client. .. _service: https://github.com/googleapis/googleapis/blob/\ ...
[ "Create", "an", "operation", "future", "from", "a", "gapic", "client", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L297-L320
[ "def", "from_gapic", "(", "operation", ",", "operations_client", ",", "result_type", ",", "*", "*", "kwargs", ")", ":", "refresh", "=", "functools", ".", "partial", "(", "operations_client", ".", "get_operation", ",", "operation", ".", "name", ")", "cancel", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Operation.metadata
google.protobuf.Message: the current operation metadata.
api_core/google/api_core/operation.py
def metadata(self): """google.protobuf.Message: the current operation metadata.""" if not self._operation.HasField("metadata"): return None return protobuf_helpers.from_any_pb( self._metadata_type, self._operation.metadata )
def metadata(self): """google.protobuf.Message: the current operation metadata.""" if not self._operation.HasField("metadata"): return None return protobuf_helpers.from_any_pb( self._metadata_type, self._operation.metadata )
[ "google", ".", "protobuf", ".", "Message", ":", "the", "current", "operation", "metadata", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L95-L102
[ "def", "metadata", "(", "self", ")", ":", "if", "not", "self", ".", "_operation", ".", "HasField", "(", "\"metadata\"", ")", ":", "return", "None", "return", "protobuf_helpers", ".", "from_any_pb", "(", "self", ".", "_metadata_type", ",", "self", ".", "_op...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Operation._set_result_from_operation
Set the result or exception from the operation if it is complete.
api_core/google/api_core/operation.py
def _set_result_from_operation(self): """Set the result or exception from the operation if it is complete.""" # This must be done in a lock to prevent the polling thread # and main thread from both executing the completion logic # at the same time. with self._completion_lock: ...
def _set_result_from_operation(self): """Set the result or exception from the operation if it is complete.""" # This must be done in a lock to prevent the polling thread # and main thread from both executing the completion logic # at the same time. with self._completion_lock: ...
[ "Set", "the", "result", "or", "exception", "from", "the", "operation", "if", "it", "is", "complete", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L116-L146
[ "def", "_set_result_from_operation", "(", "self", ")", ":", "# This must be done in a lock to prevent the polling thread", "# and main thread from both executing the completion logic", "# at the same time.", "with", "self", ".", "_completion_lock", ":", "# If the operation isn't complete...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Operation._refresh_and_update
Refresh the operation and update the result if needed.
api_core/google/api_core/operation.py
def _refresh_and_update(self): """Refresh the operation and update the result if needed.""" # If the currently cached operation is done, no need to make another # RPC as it will not change once done. if not self._operation.done: self._operation = self._refresh() s...
def _refresh_and_update(self): """Refresh the operation and update the result if needed.""" # If the currently cached operation is done, no need to make another # RPC as it will not change once done. if not self._operation.done: self._operation = self._refresh() s...
[ "Refresh", "the", "operation", "and", "update", "the", "result", "if", "needed", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L148-L154
[ "def", "_refresh_and_update", "(", "self", ")", ":", "# If the currently cached operation is done, no need to make another", "# RPC as it will not change once done.", "if", "not", "self", ".", "_operation", ".", "done", ":", "self", ".", "_operation", "=", "self", ".", "_...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Operation.cancelled
True if the operation was cancelled.
api_core/google/api_core/operation.py
def cancelled(self): """True if the operation was cancelled.""" self._refresh_and_update() return ( self._operation.HasField("error") and self._operation.error.code == code_pb2.CANCELLED )
def cancelled(self): """True if the operation was cancelled.""" self._refresh_and_update() return ( self._operation.HasField("error") and self._operation.error.code == code_pb2.CANCELLED )
[ "True", "if", "the", "operation", "was", "cancelled", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/operation.py#L178-L184
[ "def", "cancelled", "(", "self", ")", ":", "self", ".", "_refresh_and_update", "(", ")", "return", "(", "self", ".", "_operation", ".", "HasField", "(", "\"error\"", ")", "and", "self", ".", "_operation", ".", "error", ".", "code", "==", "code_pb2", ".",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_ACLEntity.revoke
Remove a role from the entity. :type role: str :param role: The role to remove from the entity.
storage/google/cloud/storage/acl.py
def revoke(self, role): """Remove a role from the entity. :type role: str :param role: The role to remove from the entity. """ if role in self.roles: self.roles.remove(role)
def revoke(self, role): """Remove a role from the entity. :type role: str :param role: The role to remove from the entity. """ if role in self.roles: self.roles.remove(role)
[ "Remove", "a", "role", "from", "the", "entity", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L133-L140
[ "def", "revoke", "(", "self", ",", "role", ")", ":", "if", "role", "in", "self", ".", "roles", ":", "self", ".", "roles", ".", "remove", "(", "role", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.validate_predefined
Ensures predefined is in list of predefined json values :type predefined: str :param predefined: name of a predefined acl :type predefined: str :param predefined: validated JSON name of predefined acl :raises: :exc: `ValueError`: If predefined is not a valid acl
storage/google/cloud/storage/acl.py
def validate_predefined(cls, predefined): """Ensures predefined is in list of predefined json values :type predefined: str :param predefined: name of a predefined acl :type predefined: str :param predefined: validated JSON name of predefined acl :raises: :exc: `ValueEr...
def validate_predefined(cls, predefined): """Ensures predefined is in list of predefined json values :type predefined: str :param predefined: name of a predefined acl :type predefined: str :param predefined: validated JSON name of predefined acl :raises: :exc: `ValueEr...
[ "Ensures", "predefined", "is", "in", "list", "of", "predefined", "json", "values" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L215-L229
[ "def", "validate_predefined", "(", "cls", ",", "predefined", ")", ":", "predefined", "=", "cls", ".", "PREDEFINED_XML_ACLS", ".", "get", "(", "predefined", ",", "predefined", ")", "if", "predefined", "and", "predefined", "not", "in", "cls", ".", "PREDEFINED_JS...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.entity_from_dict
Build an _ACLEntity object from a dictionary of data. An entity is a mutable object that represents a list of roles belonging to either a user or group or the special types for all users and all authenticated users. :type entity_dict: dict :param entity_dict: Dictionary full of...
storage/google/cloud/storage/acl.py
def entity_from_dict(self, entity_dict): """Build an _ACLEntity object from a dictionary of data. An entity is a mutable object that represents a list of roles belonging to either a user or group or the special types for all users and all authenticated users. :type entity_dict:...
def entity_from_dict(self, entity_dict): """Build an _ACLEntity object from a dictionary of data. An entity is a mutable object that represents a list of roles belonging to either a user or group or the special types for all users and all authenticated users. :type entity_dict:...
[ "Build", "an", "_ACLEntity", "object", "from", "a", "dictionary", "of", "data", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L244-L274
[ "def", "entity_from_dict", "(", "self", ",", "entity_dict", ")", ":", "entity", "=", "entity_dict", "[", "\"entity\"", "]", "role", "=", "entity_dict", "[", "\"role\"", "]", "if", "entity", "==", "\"allUsers\"", ":", "entity", "=", "self", ".", "all", "(",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.get_entity
Gets an entity object from the ACL. :type entity: :class:`_ACLEntity` or string :param entity: The entity to get lookup in the ACL. :type default: anything :param default: This value will be returned if the entity doesn't exist. :rtype: :class:`_ACLEnti...
storage/google/cloud/storage/acl.py
def get_entity(self, entity, default=None): """Gets an entity object from the ACL. :type entity: :class:`_ACLEntity` or string :param entity: The entity to get lookup in the ACL. :type default: anything :param default: This value will be returned if the entity ...
def get_entity(self, entity, default=None): """Gets an entity object from the ACL. :type entity: :class:`_ACLEntity` or string :param entity: The entity to get lookup in the ACL. :type default: anything :param default: This value will be returned if the entity ...
[ "Gets", "an", "entity", "object", "from", "the", "ACL", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L288-L303
[ "def", "get_entity", "(", "self", ",", "entity", ",", "default", "=", "None", ")", ":", "self", ".", "_ensure_loaded", "(", ")", "return", "self", ".", "entities", ".", "get", "(", "str", "(", "entity", ")", ",", "default", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.add_entity
Add an entity to the ACL. :type entity: :class:`_ACLEntity` :param entity: The entity to add to this ACL.
storage/google/cloud/storage/acl.py
def add_entity(self, entity): """Add an entity to the ACL. :type entity: :class:`_ACLEntity` :param entity: The entity to add to this ACL. """ self._ensure_loaded() self.entities[str(entity)] = entity
def add_entity(self, entity): """Add an entity to the ACL. :type entity: :class:`_ACLEntity` :param entity: The entity to add to this ACL. """ self._ensure_loaded() self.entities[str(entity)] = entity
[ "Add", "an", "entity", "to", "the", "ACL", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L305-L312
[ "def", "add_entity", "(", "self", ",", "entity", ")", ":", "self", ".", "_ensure_loaded", "(", ")", "self", ".", "entities", "[", "str", "(", "entity", ")", "]", "=", "entity" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.entity
Factory method for creating an Entity. If an entity with the same type and identifier already exists, this will return a reference to that entity. If not, it will create a new one and add it to the list of known entities for this ACL. :type entity_type: str :param enti...
storage/google/cloud/storage/acl.py
def entity(self, entity_type, identifier=None): """Factory method for creating an Entity. If an entity with the same type and identifier already exists, this will return a reference to that entity. If not, it will create a new one and add it to the list of known entities for th...
def entity(self, entity_type, identifier=None): """Factory method for creating an Entity. If an entity with the same type and identifier already exists, this will return a reference to that entity. If not, it will create a new one and add it to the list of known entities for th...
[ "Factory", "method", "for", "creating", "an", "Entity", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L314-L338
[ "def", "entity", "(", "self", ",", "entity_type", ",", "identifier", "=", "None", ")", ":", "entity", "=", "_ACLEntity", "(", "entity_type", "=", "entity_type", ",", "identifier", "=", "identifier", ")", "if", "self", ".", "has_entity", "(", "entity", ")",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.reload
Reload the ACL data from Cloud Storage. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client: Optional. The client to use. If not passed, falls back ...
storage/google/cloud/storage/acl.py
def reload(self, client=None): """Reload the ACL data from Cloud Storage. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client: Optional. The client to use. ...
def reload(self, client=None): """Reload the ACL data from Cloud Storage. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client: Optional. The client to use. ...
[ "Reload", "the", "ACL", "data", "from", "Cloud", "Storage", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L418-L442
[ "def", "reload", "(", "self", ",", "client", "=", "None", ")", ":", "path", "=", "self", ".", "reload_path", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "{", "}", "if", "self", ".", "user_project", "is", "not...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL._save
Helper for :meth:`save` and :meth:`save_predefined`. :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list. :param acl: The ACL object to save. If left blank, this will save current entries. :type predefined: str :param predefined: (Opt...
storage/google/cloud/storage/acl.py
def _save(self, acl, predefined, client): """Helper for :meth:`save` and :meth:`save_predefined`. :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list. :param acl: The ACL object to save. If left blank, this will save current entries. :type predef...
def _save(self, acl, predefined, client): """Helper for :meth:`save` and :meth:`save_predefined`. :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list. :param acl: The ACL object to save. If left blank, this will save current entries. :type predef...
[ "Helper", "for", ":", "meth", ":", "save", "and", ":", "meth", ":", "save_predefined", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L444-L481
[ "def", "_save", "(", "self", ",", "acl", ",", "predefined", ",", "client", ")", ":", "query_params", "=", "{", "\"projection\"", ":", "\"full\"", "}", "if", "predefined", "is", "not", "None", ":", "acl", "=", "[", "]", "query_params", "[", "self", ".",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.save
Save this ACL for the current bucket. If :attr:`user_project` is set, bills the API request to that project. :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list. :param acl: The ACL object to save. If left blank, this will save current entries. ...
storage/google/cloud/storage/acl.py
def save(self, acl=None, client=None): """Save this ACL for the current bucket. If :attr:`user_project` is set, bills the API request to that project. :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list. :param acl: The ACL object to save. If left blank, this will s...
def save(self, acl=None, client=None): """Save this ACL for the current bucket. If :attr:`user_project` is set, bills the API request to that project. :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list. :param acl: The ACL object to save. If left blank, this will s...
[ "Save", "this", "ACL", "for", "the", "current", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L483-L504
[ "def", "save", "(", "self", ",", "acl", "=", "None", ",", "client", "=", "None", ")", ":", "if", "acl", "is", "None", ":", "acl", "=", "self", "save_to_backend", "=", "acl", ".", "loaded", "else", ":", "save_to_backend", "=", "True", "if", "save_to_b...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ACL.save_predefined
Save this ACL for the current bucket using a predefined ACL. If :attr:`user_project` is set, bills the API request to that project. :type predefined: str :param predefined: An identifier for a predefined ACL. Must be one of the keys in :attr:`PREDEFINED_JSON_ACLS` ...
storage/google/cloud/storage/acl.py
def save_predefined(self, predefined, client=None): """Save this ACL for the current bucket using a predefined ACL. If :attr:`user_project` is set, bills the API request to that project. :type predefined: str :param predefined: An identifier for a predefined ACL. Must be one ...
def save_predefined(self, predefined, client=None): """Save this ACL for the current bucket using a predefined ACL. If :attr:`user_project` is set, bills the API request to that project. :type predefined: str :param predefined: An identifier for a predefined ACL. Must be one ...
[ "Save", "this", "ACL", "for", "the", "current", "bucket", "using", "a", "predefined", "ACL", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/acl.py#L506-L524
[ "def", "save_predefined", "(", "self", ",", "predefined", ",", "client", "=", "None", ")", ":", "predefined", "=", "self", ".", "validate_predefined", "(", "predefined", ")", "self", ".", "_save", "(", "None", ",", "predefined", ",", "client", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.incident_path
Return a fully-qualified incident string.
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def incident_path(cls, project, incident): """Return a fully-qualified incident string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}", project=project, incident=incident, )
def incident_path(cls, project, incident): """Return a fully-qualified incident string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}", project=project, incident=incident, )
[ "Return", "a", "fully", "-", "qualified", "incident", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L82-L88
[ "def", "incident_path", "(", "cls", ",", "project", ",", "incident", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/incidents/{incident}\"", ",", "project", "=", "project", ",", "incident", "=", "in...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.annotation_path
Return a fully-qualified annotation string.
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def annotation_path(cls, project, incident, annotation): """Return a fully-qualified annotation string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/annotations/{annotation}", project=project, incident=incident, ...
def annotation_path(cls, project, incident, annotation): """Return a fully-qualified annotation string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/annotations/{annotation}", project=project, incident=incident, ...
[ "Return", "a", "fully", "-", "qualified", "annotation", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L91-L98
[ "def", "annotation_path", "(", "cls", ",", "project", ",", "incident", ",", "annotation", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/incidents/{incident}/annotations/{annotation}\"", ",", "project", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.artifact_path
Return a fully-qualified artifact string.
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def artifact_path(cls, project, incident, artifact): """Return a fully-qualified artifact string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/artifacts/{artifact}", project=project, incident=incident, artifact=a...
def artifact_path(cls, project, incident, artifact): """Return a fully-qualified artifact string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/artifacts/{artifact}", project=project, incident=incident, artifact=a...
[ "Return", "a", "fully", "-", "qualified", "artifact", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L101-L108
[ "def", "artifact_path", "(", "cls", ",", "project", ",", "incident", ",", "artifact", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/incidents/{incident}/artifacts/{artifact}\"", ",", "project", "=", "p...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.role_assignment_path
Return a fully-qualified role_assignment string.
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def role_assignment_path(cls, project, incident, role_assignment): """Return a fully-qualified role_assignment string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/roleAssignments/{role_assignment}", project=project, inciden...
def role_assignment_path(cls, project, incident, role_assignment): """Return a fully-qualified role_assignment string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/roleAssignments/{role_assignment}", project=project, inciden...
[ "Return", "a", "fully", "-", "qualified", "role_assignment", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L111-L118
[ "def", "role_assignment_path", "(", "cls", ",", "project", ",", "incident", ",", "role_assignment", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/incidents/{incident}/roleAssignments/{role_assignment}\"", ",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.subscription_path
Return a fully-qualified subscription string.
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def subscription_path(cls, project, incident, subscription): """Return a fully-qualified subscription string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/subscriptions/{subscription}", project=project, incident=incident, ...
def subscription_path(cls, project, incident, subscription): """Return a fully-qualified subscription string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/subscriptions/{subscription}", project=project, incident=incident, ...
[ "Return", "a", "fully", "-", "qualified", "subscription", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L121-L128
[ "def", "subscription_path", "(", "cls", ",", "project", ",", "incident", ",", "subscription", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/incidents/{incident}/subscriptions/{subscription}\"", ",", "proje...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.tag_path
Return a fully-qualified tag string.
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def tag_path(cls, project, incident, tag): """Return a fully-qualified tag string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/tags/{tag}", project=project, incident=incident, tag=tag, )
def tag_path(cls, project, incident, tag): """Return a fully-qualified tag string.""" return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/tags/{tag}", project=project, incident=incident, tag=tag, )
[ "Return", "a", "fully", "-", "qualified", "tag", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L131-L138
[ "def", "tag_path", "(", "cls", ",", "project", ",", "incident", ",", "tag", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/incidents/{incident}/tags/{tag}\"", ",", "project", "=", "project", ",", "i...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.signal_path
Return a fully-qualified signal string.
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def signal_path(cls, project, signal): """Return a fully-qualified signal string.""" return google.api_core.path_template.expand( "projects/{project}/signals/{signal}", project=project, signal=signal )
def signal_path(cls, project, signal): """Return a fully-qualified signal string.""" return google.api_core.path_template.expand( "projects/{project}/signals/{signal}", project=project, signal=signal )
[ "Return", "a", "fully", "-", "qualified", "signal", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L141-L145
[ "def", "signal_path", "(", "cls", ",", "project", ",", "signal", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/signals/{signal}\"", ",", "project", "=", "project", ",", "signal", "=", "signal", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.create_annotation
Creates an annotation on an existing incident. Only 'text/plain' and 'text/markdown' annotations can be created via this method. Example: >>> from google.cloud import irm_v1alpha2 >>> >>> client = irm_v1alpha2.IncidentServiceClient() >>> >>> p...
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def create_annotation( self, parent, annotation, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an annotation on an existing incident. Only 'text/plain' and 'text/ma...
def create_annotation( self, parent, annotation, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an annotation on an existing incident. Only 'text/plain' and 'text/ma...
[ "Creates", "an", "annotation", "on", "an", "existing", "incident", ".", "Only", "text", "/", "plain", "and", "text", "/", "markdown", "annotations", "can", "be", "created", "via", "this", "method", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L755-L834
[ "def", "create_annotation", "(", "self", ",", "parent", ",", "annotation", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.escalate_incident
Escalates an incident. Example: >>> from google.cloud import irm_v1alpha2 >>> >>> client = irm_v1alpha2.IncidentServiceClient() >>> >>> # TODO: Initialize `incident`: >>> incident = {} >>> >>> response = client.esca...
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def escalate_incident( self, incident, update_mask=None, subscriptions=None, tags=None, roles=None, artifacts=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
def escalate_incident( self, incident, update_mask=None, subscriptions=None, tags=None, roles=None, artifacts=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
[ "Escalates", "an", "incident", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L1527-L1632
[ "def", "escalate_incident", "(", "self", ",", "incident", ",", "update_mask", "=", "None", ",", "subscriptions", "=", "None", ",", "tags", "=", "None", ",", "roles", "=", "None", ",", "artifacts", "=", "None", ",", "retry", "=", "google", ".", "api_core"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IncidentServiceClient.send_shift_handoff
Sends a summary of the shift for oncall handoff. Example: >>> from google.cloud import irm_v1alpha2 >>> >>> client = irm_v1alpha2.IncidentServiceClient() >>> >>> parent = client.project_path('[PROJECT]') >>> >>> # TODO: Initial...
irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py
def send_shift_handoff( self, parent, recipients, subject, cc=None, notes_content_type=None, notes_content=None, incidents=None, preview_only=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.meth...
def send_shift_handoff( self, parent, recipients, subject, cc=None, notes_content_type=None, notes_content=None, incidents=None, preview_only=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.meth...
[ "Sends", "a", "summary", "of", "the", "shift", "for", "oncall", "handoff", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py#L1964-L2066
[ "def", "send_shift_handoff", "(", "self", ",", "parent", ",", "recipients", ",", "subject", ",", "cc", "=", "None", ",", "notes_content_type", "=", "None", ",", "notes_content", "=", "None", ",", "incidents", "=", "None", ",", "preview_only", "=", "None", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.bigtable_admins
Access to bigtable.admin role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_admins_policy] :end-before: [END bigtable_admins_policy]
bigtable/google/cloud/bigtable/policy.py
def bigtable_admins(self): """Access to bigtable.admin role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_admins_policy] :end-before: [END bigtable_admins_policy] """ result = set() for member in self._bindin...
def bigtable_admins(self): """Access to bigtable.admin role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_admins_policy] :end-before: [END bigtable_admins_policy] """ result = set() for member in self._bindin...
[ "Access", "to", "bigtable", ".", "admin", "role", "memebers" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L83-L95
[ "def", "bigtable_admins", "(", "self", ")", ":", "result", "=", "set", "(", ")", "for", "member", "in", "self", ".", "_bindings", ".", "get", "(", "BIGTABLE_ADMIN_ROLE", ",", "(", ")", ")", ":", "result", ".", "add", "(", "member", ")", "return", "fr...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.bigtable_readers
Access to bigtable.reader role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_readers_policy] :end-before: [END bigtable_readers_policy]
bigtable/google/cloud/bigtable/policy.py
def bigtable_readers(self): """Access to bigtable.reader role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_readers_policy] :end-before: [END bigtable_readers_policy] """ result = set() for member in self._bi...
def bigtable_readers(self): """Access to bigtable.reader role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_readers_policy] :end-before: [END bigtable_readers_policy] """ result = set() for member in self._bi...
[ "Access", "to", "bigtable", ".", "reader", "role", "memebers" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L98-L110
[ "def", "bigtable_readers", "(", "self", ")", ":", "result", "=", "set", "(", ")", "for", "member", "in", "self", ".", "_bindings", ".", "get", "(", "BIGTABLE_READER_ROLE", ",", "(", ")", ")", ":", "result", ".", "add", "(", "member", ")", "return", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.bigtable_users
Access to bigtable.user role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_users_policy] :end-before: [END bigtable_users_policy]
bigtable/google/cloud/bigtable/policy.py
def bigtable_users(self): """Access to bigtable.user role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_users_policy] :end-before: [END bigtable_users_policy] """ result = set() for member in self._bindings.g...
def bigtable_users(self): """Access to bigtable.user role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_users_policy] :end-before: [END bigtable_users_policy] """ result = set() for member in self._bindings.g...
[ "Access", "to", "bigtable", ".", "user", "role", "memebers" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L113-L125
[ "def", "bigtable_users", "(", "self", ")", ":", "result", "=", "set", "(", ")", "for", "member", "in", "self", ".", "_bindings", ".", "get", "(", "BIGTABLE_USER_ROLE", ",", "(", ")", ")", ":", "result", ".", "add", "(", "member", ")", "return", "froz...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.bigtable_viewers
Access to bigtable.viewer role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_viewers_policy] :end-before: [END bigtable_viewers_policy]
bigtable/google/cloud/bigtable/policy.py
def bigtable_viewers(self): """Access to bigtable.viewer role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_viewers_policy] :end-before: [END bigtable_viewers_policy] """ result = set() for member in self._bi...
def bigtable_viewers(self): """Access to bigtable.viewer role memebers For example: .. literalinclude:: snippets.py :start-after: [START bigtable_viewers_policy] :end-before: [END bigtable_viewers_policy] """ result = set() for member in self._bi...
[ "Access", "to", "bigtable", ".", "viewer", "role", "memebers" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L128-L140
[ "def", "bigtable_viewers", "(", "self", ")", ":", "result", "=", "set", "(", ")", "for", "member", "in", "self", ".", "_bindings", ".", "get", "(", "BIGTABLE_VIEWER_ROLE", ",", "(", ")", ")", ":", "result", ".", "add", "(", "member", ")", "return", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.from_pb
Factory: create a policy from a protobuf message. Args: policy_pb (google.iam.policy_pb2.Policy): message returned by ``get_iam_policy`` gRPC API. Returns: :class:`Policy`: the parsed policy
bigtable/google/cloud/bigtable/policy.py
def from_pb(cls, policy_pb): """Factory: create a policy from a protobuf message. Args: policy_pb (google.iam.policy_pb2.Policy): message returned by ``get_iam_policy`` gRPC API. Returns: :class:`Policy`: the parsed policy """ policy = cls(po...
def from_pb(cls, policy_pb): """Factory: create a policy from a protobuf message. Args: policy_pb (google.iam.policy_pb2.Policy): message returned by ``get_iam_policy`` gRPC API. Returns: :class:`Policy`: the parsed policy """ policy = cls(po...
[ "Factory", ":", "create", "a", "policy", "from", "a", "protobuf", "message", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L143-L158
[ "def", "from_pb", "(", "cls", ",", "policy_pb", ")", ":", "policy", "=", "cls", "(", "policy_pb", ".", "etag", ",", "policy_pb", ".", "version", ")", "for", "binding", "in", "policy_pb", ".", "bindings", ":", "policy", "[", "binding", ".", "role", "]",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.to_pb
Render a protobuf message. Returns: google.iam.policy_pb2.Policy: a message to be passed to the ``set_iam_policy`` gRPC API.
bigtable/google/cloud/bigtable/policy.py
def to_pb(self): """Render a protobuf message. Returns: google.iam.policy_pb2.Policy: a message to be passed to the ``set_iam_policy`` gRPC API. """ return policy_pb2.Policy( etag=self.etag, version=self.version or 0, bindings...
def to_pb(self): """Render a protobuf message. Returns: google.iam.policy_pb2.Policy: a message to be passed to the ``set_iam_policy`` gRPC API. """ return policy_pb2.Policy( etag=self.etag, version=self.version or 0, bindings...
[ "Render", "a", "protobuf", "message", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L160-L175
[ "def", "to_pb", "(", "self", ")", ":", "return", "policy_pb2", ".", "Policy", "(", "etag", "=", "self", ".", "etag", ",", "version", "=", "self", ".", "version", "or", "0", ",", "bindings", "=", "[", "policy_pb2", ".", "Binding", "(", "role", "=", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.from_api_repr
Factory: create a policy from a JSON resource. Overrides the base class version to store :attr:`etag` as bytes. Args: resource (dict): JSON policy resource returned by the ``getIamPolicy`` REST API. Returns: :class:`Policy`: the parsed policy
bigtable/google/cloud/bigtable/policy.py
def from_api_repr(cls, resource): """Factory: create a policy from a JSON resource. Overrides the base class version to store :attr:`etag` as bytes. Args: resource (dict): JSON policy resource returned by the ``getIamPolicy`` REST API. Returns: :cla...
def from_api_repr(cls, resource): """Factory: create a policy from a JSON resource. Overrides the base class version to store :attr:`etag` as bytes. Args: resource (dict): JSON policy resource returned by the ``getIamPolicy`` REST API. Returns: :cla...
[ "Factory", ":", "create", "a", "policy", "from", "a", "JSON", "resource", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L178-L196
[ "def", "from_api_repr", "(", "cls", ",", "resource", ")", ":", "etag", "=", "resource", ".", "get", "(", "\"etag\"", ")", "if", "etag", "is", "not", "None", ":", "resource", "=", "resource", ".", "copy", "(", ")", "resource", "[", "\"etag\"", "]", "=...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Policy.to_api_repr
Render a JSON policy resource. Overrides the base class version to convert :attr:`etag` from bytes to JSON-compatible base64-encoded text. Returns: dict: a JSON resource to be passed to the ``setIamPolicy`` REST API.
bigtable/google/cloud/bigtable/policy.py
def to_api_repr(self): """Render a JSON policy resource. Overrides the base class version to convert :attr:`etag` from bytes to JSON-compatible base64-encoded text. Returns: dict: a JSON resource to be passed to the ``setIamPolicy`` REST API. """ ...
def to_api_repr(self): """Render a JSON policy resource. Overrides the base class version to convert :attr:`etag` from bytes to JSON-compatible base64-encoded text. Returns: dict: a JSON resource to be passed to the ``setIamPolicy`` REST API. """ ...
[ "Render", "a", "JSON", "policy", "resource", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/policy.py#L198-L213
[ "def", "to_api_repr", "(", "self", ")", ":", "resource", "=", "super", "(", "Policy", ",", "self", ")", ".", "to_api_repr", "(", ")", "if", "self", ".", "etag", "is", "not", "None", ":", "resource", "[", "\"etag\"", "]", "=", "base64", ".", "b64encod...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_check_ddl_statements
Validate DDL Statements used to define database schema. See https://cloud.google.com/spanner/docs/data-definition-language :type value: list of string :param value: DDL statements, excluding the 'CREATE DATABSE' statement :rtype: tuple :returns: tuple of validated DDL statement strings. :...
spanner/google/cloud/spanner_v1/database.py
def _check_ddl_statements(value): """Validate DDL Statements used to define database schema. See https://cloud.google.com/spanner/docs/data-definition-language :type value: list of string :param value: DDL statements, excluding the 'CREATE DATABSE' statement :rtype: tuple :returns: tuple ...
def _check_ddl_statements(value): """Validate DDL Statements used to define database schema. See https://cloud.google.com/spanner/docs/data-definition-language :type value: list of string :param value: DDL statements, excluding the 'CREATE DATABSE' statement :rtype: tuple :returns: tuple ...
[ "Validate", "DDL", "Statements", "used", "to", "define", "database", "schema", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L790-L811
[ "def", "_check_ddl_statements", "(", "value", ")", ":", "if", "not", "all", "(", "isinstance", "(", "line", ",", "six", ".", "string_types", ")", "for", "line", "in", "value", ")", ":", "raise", "ValueError", "(", "\"Pass a list of strings\"", ")", "if", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.from_pb
Creates an instance of this class from a protobuf. :type database_pb: :class:`google.spanner.v2.spanner_instance_admin_pb2.Instance` :param database_pb: A instance protobuf object. :type instance: :class:`~google.cloud.spanner_v1.instance.Instance` :param instance: The inst...
spanner/google/cloud/spanner_v1/database.py
def from_pb(cls, database_pb, instance, pool=None): """Creates an instance of this class from a protobuf. :type database_pb: :class:`google.spanner.v2.spanner_instance_admin_pb2.Instance` :param database_pb: A instance protobuf object. :type instance: :class:`~google.cloud....
def from_pb(cls, database_pb, instance, pool=None): """Creates an instance of this class from a protobuf. :type database_pb: :class:`google.spanner.v2.spanner_instance_admin_pb2.Instance` :param database_pb: A instance protobuf object. :type instance: :class:`~google.cloud....
[ "Creates", "an", "instance", "of", "this", "class", "from", "a", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L102-L143
[ "def", "from_pb", "(", "cls", ",", "database_pb", ",", "instance", ",", "pool", "=", "None", ")", ":", "match", "=", "_DATABASE_NAME_RE", ".", "match", "(", "database_pb", ".", "name", ")", "if", "match", "is", "None", ":", "raise", "ValueError", "(", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.spanner_api
Helper for session-related API calls.
spanner/google/cloud/spanner_v1/database.py
def spanner_api(self): """Helper for session-related API calls.""" if self._spanner_api is None: credentials = self._instance._client.credentials if isinstance(credentials, google.auth.credentials.Scoped): credentials = credentials.with_scopes((SPANNER_DATA_SCOPE,...
def spanner_api(self): """Helper for session-related API calls.""" if self._spanner_api is None: credentials = self._instance._client.credentials if isinstance(credentials, google.auth.credentials.Scoped): credentials = credentials.with_scopes((SPANNER_DATA_SCOPE,...
[ "Helper", "for", "session", "-", "related", "API", "calls", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L176-L185
[ "def", "spanner_api", "(", "self", ")", ":", "if", "self", ".", "_spanner_api", "is", "None", ":", "credentials", "=", "self", ".", "_instance", ".", "_client", ".", "credentials", "if", "isinstance", "(", "credentials", ",", "google", ".", "auth", ".", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.create
Create this database within its instance Inclues any configured schema assigned to :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase :rtype: :class:`~google.api_core...
spanner/google/cloud/spanner_v1/database.py
def create(self): """Create this database within its instance Inclues any configured schema assigned to :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase :rt...
def create(self): """Create this database within its instance Inclues any configured schema assigned to :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase :rt...
[ "Create", "this", "database", "within", "its", "instance" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L197-L222
[ "def", "create", "(", "self", ")", ":", "api", "=", "self", ".", "_instance", ".", "_client", ".", "database_admin_api", "metadata", "=", "_metadata_with_prefix", "(", "self", ".", "name", ")", "db_name", "=", "self", ".", "database_id", "if", "\"-\"", "in...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.exists
Test whether this database exists. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDDL :rtype: bool :returns: True if the database exists, else false.
spanner/google/cloud/spanner_v1/database.py
def exists(self): """Test whether this database exists. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDDL :rtype: bool :returns: True if the database exists, else false. """ ...
def exists(self): """Test whether this database exists. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDDL :rtype: bool :returns: True if the database exists, else false. """ ...
[ "Test", "whether", "this", "database", "exists", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L224-L240
[ "def", "exists", "(", "self", ")", ":", "api", "=", "self", ".", "_instance", ".", "_client", ".", "database_admin_api", "metadata", "=", "_metadata_with_prefix", "(", "self", ".", "name", ")", "try", ":", "api", ".", "get_database_ddl", "(", "self", ".", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.reload
Reload this database. Refresh any configured schema into :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDDL :raises NotFound: if the database does not exist
spanner/google/cloud/spanner_v1/database.py
def reload(self): """Reload this database. Refresh any configured schema into :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDDL :raises NotFound: if the data...
def reload(self): """Reload this database. Refresh any configured schema into :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDDL :raises NotFound: if the data...
[ "Reload", "this", "database", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L242-L255
[ "def", "reload", "(", "self", ")", ":", "api", "=", "self", ".", "_instance", ".", "_client", ".", "database_admin_api", "metadata", "=", "_metadata_with_prefix", "(", "self", ".", "name", ")", "response", "=", "api", ".", "get_database_ddl", "(", "self", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.update_ddl
Update DDL for this database. Apply any configured schema from :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase :type ddl_statements: Sequence[str] :param d...
spanner/google/cloud/spanner_v1/database.py
def update_ddl(self, ddl_statements, operation_id=""): """Update DDL for this database. Apply any configured schema from :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.UpdateData...
def update_ddl(self, ddl_statements, operation_id=""): """Update DDL for this database. Apply any configured schema from :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.UpdateData...
[ "Update", "DDL", "for", "this", "database", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L257-L281
[ "def", "update_ddl", "(", "self", ",", "ddl_statements", ",", "operation_id", "=", "\"\"", ")", ":", "client", "=", "self", ".", "_instance", ".", "_client", "api", "=", "client", ".", "database_admin_api", "metadata", "=", "_metadata_with_prefix", "(", "self"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.drop
Drop this database. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase
spanner/google/cloud/spanner_v1/database.py
def drop(self): """Drop this database. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase """ api = self._instance._client.database_admin_api metadata = _metadata_with_prefix(sel...
def drop(self): """Drop this database. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase """ api = self._instance._client.database_admin_api metadata = _metadata_with_prefix(sel...
[ "Drop", "this", "database", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L283-L291
[ "def", "drop", "(", "self", ")", ":", "api", "=", "self", ".", "_instance", ".", "_client", ".", "database_admin_api", "metadata", "=", "_metadata_with_prefix", "(", "self", ".", "name", ")", "api", ".", "drop_database", "(", "self", ".", "name", ",", "m...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.execute_partitioned_dml
Execute a partitionable DML statement. :type dml: str :param dml: DML statement :type params: dict, {str -> column value} :param params: values for parameter replacement. Keys must match the names used in ``dml``. :type param_types: dict[str -> Union[di...
spanner/google/cloud/spanner_v1/database.py
def execute_partitioned_dml(self, dml, params=None, param_types=None): """Execute a partitionable DML statement. :type dml: str :param dml: DML statement :type params: dict, {str -> column value} :param params: values for parameter replacement. Keys must match ...
def execute_partitioned_dml(self, dml, params=None, param_types=None): """Execute a partitionable DML statement. :type dml: str :param dml: DML statement :type params: dict, {str -> column value} :param params: values for parameter replacement. Keys must match ...
[ "Execute", "a", "partitionable", "DML", "statement", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L293-L349
[ "def", "execute_partitioned_dml", "(", "self", ",", "dml", ",", "params", "=", "None", ",", "param_types", "=", "None", ")", ":", "if", "params", "is", "not", "None", ":", "if", "param_types", "is", "None", ":", "raise", "ValueError", "(", "\"Specify 'para...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.batch_snapshot
Return an object which wraps a batch read / query. :type read_timestamp: :class:`datetime.datetime` :param read_timestamp: Execute all reads at the given timestamp. :type exact_staleness: :class:`datetime.timedelta` :param exact_staleness: Execute all reads at a timestamp that is ...
spanner/google/cloud/spanner_v1/database.py
def batch_snapshot(self, read_timestamp=None, exact_staleness=None): """Return an object which wraps a batch read / query. :type read_timestamp: :class:`datetime.datetime` :param read_timestamp: Execute all reads at the given timestamp. :type exact_staleness: :class:`datetime.timedelta...
def batch_snapshot(self, read_timestamp=None, exact_staleness=None): """Return an object which wraps a batch read / query. :type read_timestamp: :class:`datetime.datetime` :param read_timestamp: Execute all reads at the given timestamp. :type exact_staleness: :class:`datetime.timedelta...
[ "Return", "an", "object", "which", "wraps", "a", "batch", "read", "/", "query", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L392-L407
[ "def", "batch_snapshot", "(", "self", ",", "read_timestamp", "=", "None", ",", "exact_staleness", "=", "None", ")", ":", "return", "BatchSnapshot", "(", "self", ",", "read_timestamp", "=", "read_timestamp", ",", "exact_staleness", "=", "exact_staleness", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Database.run_in_transaction
Perform a unit of work in a transaction, retrying on abort. :type func: callable :param func: takes a required positional argument, the transaction, and additional positional / keyword arguments as supplied by the caller. :type args: tuple :par...
spanner/google/cloud/spanner_v1/database.py
def run_in_transaction(self, func, *args, **kw): """Perform a unit of work in a transaction, retrying on abort. :type func: callable :param func: takes a required positional argument, the transaction, and additional positional / keyword arguments as supplied ...
def run_in_transaction(self, func, *args, **kw): """Perform a unit of work in a transaction, retrying on abort. :type func: callable :param func: takes a required positional argument, the transaction, and additional positional / keyword arguments as supplied ...
[ "Perform", "a", "unit", "of", "work", "in", "a", "transaction", "retrying", "on", "abort", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L409-L441
[ "def", "run_in_transaction", "(", "self", ",", "func", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "# Sanity check: Is there a transaction already running?", "# If there is, then raise a red flag. Otherwise, mark that this one", "# is running.", "if", "getattr", "(", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot.from_dict
Reconstruct an instance from a mapping. :type database: :class:`~google.cloud.spanner.database.Database` :param database: database to use :type mapping: mapping :param mapping: serialized state of the instance :rtype: :class:`BatchSnapshot`
spanner/google/cloud/spanner_v1/database.py
def from_dict(cls, database, mapping): """Reconstruct an instance from a mapping. :type database: :class:`~google.cloud.spanner.database.Database` :param database: database to use :type mapping: mapping :param mapping: serialized state of the instance :rtype: :class:`B...
def from_dict(cls, database, mapping): """Reconstruct an instance from a mapping. :type database: :class:`~google.cloud.spanner.database.Database` :param database: database to use :type mapping: mapping :param mapping: serialized state of the instance :rtype: :class:`B...
[ "Reconstruct", "an", "instance", "from", "a", "mapping", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L531-L547
[ "def", "from_dict", "(", "cls", ",", "database", ",", "mapping", ")", ":", "instance", "=", "cls", "(", "database", ")", "session", "=", "instance", ".", "_session", "=", "database", ".", "session", "(", ")", "session", ".", "_session_id", "=", "mapping"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot.to_dict
Return state as a dictionary. Result can be used to serialize the instance and reconstitute it later using :meth:`from_dict`. :rtype: dict
spanner/google/cloud/spanner_v1/database.py
def to_dict(self): """Return state as a dictionary. Result can be used to serialize the instance and reconstitute it later using :meth:`from_dict`. :rtype: dict """ session = self._get_session() snapshot = self._get_snapshot() return { "sessi...
def to_dict(self): """Return state as a dictionary. Result can be used to serialize the instance and reconstitute it later using :meth:`from_dict`. :rtype: dict """ session = self._get_session() snapshot = self._get_snapshot() return { "sessi...
[ "Return", "state", "as", "a", "dictionary", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L549-L562
[ "def", "to_dict", "(", "self", ")", ":", "session", "=", "self", ".", "_get_session", "(", ")", "snapshot", "=", "self", ".", "_get_snapshot", "(", ")", "return", "{", "\"session_id\"", ":", "session", ".", "_session_id", ",", "\"transaction_id\"", ":", "s...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot._get_session
Create session as needed. .. note:: Caller is responsible for cleaning up the session after all partitions have been processed.
spanner/google/cloud/spanner_v1/database.py
def _get_session(self): """Create session as needed. .. note:: Caller is responsible for cleaning up the session after all partitions have been processed. """ if self._session is None: session = self._session = self._database.session() sess...
def _get_session(self): """Create session as needed. .. note:: Caller is responsible for cleaning up the session after all partitions have been processed. """ if self._session is None: session = self._session = self._database.session() sess...
[ "Create", "session", "as", "needed", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L564-L575
[ "def", "_get_session", "(", "self", ")", ":", "if", "self", ".", "_session", "is", "None", ":", "session", "=", "self", ".", "_session", "=", "self", ".", "_database", ".", "session", "(", ")", "session", ".", "create", "(", ")", "return", "self", "....
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot._get_snapshot
Create snapshot if needed.
spanner/google/cloud/spanner_v1/database.py
def _get_snapshot(self): """Create snapshot if needed.""" if self._snapshot is None: self._snapshot = self._get_session().snapshot( read_timestamp=self._read_timestamp, exact_staleness=self._exact_staleness, multi_use=True, ) ...
def _get_snapshot(self): """Create snapshot if needed.""" if self._snapshot is None: self._snapshot = self._get_session().snapshot( read_timestamp=self._read_timestamp, exact_staleness=self._exact_staleness, multi_use=True, ) ...
[ "Create", "snapshot", "if", "needed", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L577-L586
[ "def", "_get_snapshot", "(", "self", ")", ":", "if", "self", ".", "_snapshot", "is", "None", ":", "self", ".", "_snapshot", "=", "self", ".", "_get_session", "(", ")", ".", "snapshot", "(", "read_timestamp", "=", "self", ".", "_read_timestamp", ",", "exa...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot.generate_read_batches
Start a partitioned batch read operation. Uses the ``PartitionRead`` API request to initiate the partitioned read. Returns a list of batch information needed to perform the actual reads. :type table: str :param table: name of the table from which to fetch data :type c...
spanner/google/cloud/spanner_v1/database.py
def generate_read_batches( self, table, columns, keyset, index="", partition_size_bytes=None, max_partitions=None, ): """Start a partitioned batch read operation. Uses the ``PartitionRead`` API request to initiate the partitioned read....
def generate_read_batches( self, table, columns, keyset, index="", partition_size_bytes=None, max_partitions=None, ): """Start a partitioned batch read operation. Uses the ``PartitionRead`` API request to initiate the partitioned read....
[ "Start", "a", "partitioned", "batch", "read", "operation", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L602-L662
[ "def", "generate_read_batches", "(", "self", ",", "table", ",", "columns", ",", "keyset", ",", "index", "=", "\"\"", ",", "partition_size_bytes", "=", "None", ",", "max_partitions", "=", "None", ",", ")", ":", "partitions", "=", "self", ".", "_get_snapshot",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot.process_read_batch
Process a single, partitioned read. :type batch: mapping :param batch: one of the mappings returned from an earlier call to :meth:`generate_read_batches`. :rtype: :class:`~google.cloud.spanner_v1.streamed.StreamedResultSet` :returns: a result set instance which ...
spanner/google/cloud/spanner_v1/database.py
def process_read_batch(self, batch): """Process a single, partitioned read. :type batch: mapping :param batch: one of the mappings returned from an earlier call to :meth:`generate_read_batches`. :rtype: :class:`~google.cloud.spanner_v1.streamed.StreamedResultSet...
def process_read_batch(self, batch): """Process a single, partitioned read. :type batch: mapping :param batch: one of the mappings returned from an earlier call to :meth:`generate_read_batches`. :rtype: :class:`~google.cloud.spanner_v1.streamed.StreamedResultSet...
[ "Process", "a", "single", "partitioned", "read", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L664-L678
[ "def", "process_read_batch", "(", "self", ",", "batch", ")", ":", "kwargs", "=", "copy", ".", "deepcopy", "(", "batch", "[", "\"read\"", "]", ")", "keyset_dict", "=", "kwargs", ".", "pop", "(", "\"keyset\"", ")", "kwargs", "[", "\"keyset\"", "]", "=", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot.generate_query_batches
Start a partitioned query operation. Uses the ``PartitionQuery`` API request to start a partitioned query operation. Returns a list of batch information needed to peform the actual queries. :type sql: str :param sql: SQL query statement :type params: dict, {str -> col...
spanner/google/cloud/spanner_v1/database.py
def generate_query_batches( self, sql, params=None, param_types=None, partition_size_bytes=None, max_partitions=None, ): """Start a partitioned query operation. Uses the ``PartitionQuery`` API request to start a partitioned query operation. R...
def generate_query_batches( self, sql, params=None, param_types=None, partition_size_bytes=None, max_partitions=None, ): """Start a partitioned query operation. Uses the ``PartitionQuery`` API request to start a partitioned query operation. R...
[ "Start", "a", "partitioned", "query", "operation", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L680-L741
[ "def", "generate_query_batches", "(", "self", ",", "sql", ",", "params", "=", "None", ",", "param_types", "=", "None", ",", "partition_size_bytes", "=", "None", ",", "max_partitions", "=", "None", ",", ")", ":", "partitions", "=", "self", ".", "_get_snapshot...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BatchSnapshot.process
Process a single, partitioned query or read. :type batch: mapping :param batch: one of the mappings returned from an earlier call to :meth:`generate_query_batches`. :rtype: :class:`~google.cloud.spanner_v1.streamed.StreamedResultSet` :returns: a result set insta...
spanner/google/cloud/spanner_v1/database.py
def process(self, batch): """Process a single, partitioned query or read. :type batch: mapping :param batch: one of the mappings returned from an earlier call to :meth:`generate_query_batches`. :rtype: :class:`~google.cloud.spanner_v1.streamed.StreamedResultSet`...
def process(self, batch): """Process a single, partitioned query or read. :type batch: mapping :param batch: one of the mappings returned from an earlier call to :meth:`generate_query_batches`. :rtype: :class:`~google.cloud.spanner_v1.streamed.StreamedResultSet`...
[ "Process", "a", "single", "partitioned", "query", "or", "read", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/database.py#L758-L774
[ "def", "process", "(", "self", ",", "batch", ")", ":", "if", "\"query\"", "in", "batch", ":", "return", "self", ".", "process_query_batch", "(", "batch", ")", "if", "\"read\"", "in", "batch", ":", "return", "self", ".", "process_read_batch", "(", "batch", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.location_path
Return a fully-qualified location string.
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def location_path(cls, project, location): """Return a fully-qualified location string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}", project=project, location=location, )
def location_path(cls, project, location): """Return a fully-qualified location string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}", project=project, location=location, )
[ "Return", "a", "fully", "-", "qualified", "location", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L101-L107
[ "def", "location_path", "(", "cls", ",", "project", ",", "location", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}\"", ",", "project", "=", "project", ",", "location", "=", "lo...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.model_path
Return a fully-qualified model string.
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def model_path(cls, project, location, model): """Return a fully-qualified model string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/models/{model}", project=project, location=location, model=model, )
def model_path(cls, project, location, model): """Return a fully-qualified model string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/models/{model}", project=project, location=location, model=model, )
[ "Return", "a", "fully", "-", "qualified", "model", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L120-L127
[ "def", "model_path", "(", "cls", ",", "project", ",", "location", ",", "model", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/models/{model}\"", ",", "project", "=", "project", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.model_evaluation_path
Return a fully-qualified model_evaluation string.
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def model_evaluation_path(cls, project, location, model, model_evaluation): """Return a fully-qualified model_evaluation string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}", project=p...
def model_evaluation_path(cls, project, location, model, model_evaluation): """Return a fully-qualified model_evaluation string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}", project=p...
[ "Return", "a", "fully", "-", "qualified", "model_evaluation", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L130-L138
[ "def", "model_evaluation_path", "(", "cls", ",", "project", ",", "location", ",", "model", ",", "model_evaluation", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/models/{model}/modelEv...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.annotation_spec_path
Return a fully-qualified annotation_spec string.
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def annotation_spec_path(cls, project, location, dataset, annotation_spec): """Return a fully-qualified annotation_spec string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}", project=...
def annotation_spec_path(cls, project, location, dataset, annotation_spec): """Return a fully-qualified annotation_spec string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}", project=...
[ "Return", "a", "fully", "-", "qualified", "annotation_spec", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L141-L149
[ "def", "annotation_spec_path", "(", "cls", ",", "project", ",", "location", ",", "dataset", ",", "annotation_spec", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/datasets/{dataset}/ann...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.table_spec_path
Return a fully-qualified table_spec string.
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def table_spec_path(cls, project, location, dataset, table_spec): """Return a fully-qualified table_spec string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}", project=project, loca...
def table_spec_path(cls, project, location, dataset, table_spec): """Return a fully-qualified table_spec string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}", project=project, loca...
[ "Return", "a", "fully", "-", "qualified", "table_spec", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L152-L160
[ "def", "table_spec_path", "(", "cls", ",", "project", ",", "location", ",", "dataset", ",", "table_spec", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{t...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.column_spec_path
Return a fully-qualified column_spec string.
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def column_spec_path(cls, project, location, dataset, table_spec, column_spec): """Return a fully-qualified column_spec string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}", ...
def column_spec_path(cls, project, location, dataset, table_spec, column_spec): """Return a fully-qualified column_spec string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}", ...
[ "Return", "a", "fully", "-", "qualified", "column_spec", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L163-L172
[ "def", "column_spec_path", "(", "cls", ",", "project", ",", "location", ",", "dataset", ",", "table_spec", ",", "column_spec", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/dataset...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.create_dataset
Creates a dataset. Example: >>> from google.cloud import automl_v1beta1 >>> >>> client = automl_v1beta1.AutoMlClient() >>> >>> parent = client.location_path('[PROJECT]', '[LOCATION]') >>> >>> # TODO: Initialize `dataset`: ...
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def create_dataset( self, parent, dataset, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a dataset. Example: >>> from google.cloud import automl_v1beta...
def create_dataset( self, parent, dataset, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a dataset. Example: >>> from google.cloud import automl_v1beta...
[ "Creates", "a", "dataset", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L273-L348
[ "def", "create_dataset", "(", "self", ",", "parent", ",", "dataset", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAU...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.delete_dataset
Deletes a dataset and all of its contents. Returns empty response in the ``response`` field when it completes, and ``delete_details`` in the ``metadata`` field. Example: >>> from google.cloud import automl_v1beta1 >>> >>> client = automl_v1beta1.AutoMlClient(...
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def delete_dataset( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a dataset and all of its contents. Returns empty response in the ``response`` field when it co...
def delete_dataset( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a dataset and all of its contents. Returns empty response in the ``response`` field when it co...
[ "Deletes", "a", "dataset", "and", "all", "of", "its", "contents", ".", "Returns", "empty", "response", "in", "the", "response", "field", "when", "it", "completes", "and", "delete_details", "in", "the", "metadata", "field", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L615-L699
[ "def", "delete_dataset", "(", "self", ",", "name", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "metadat...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AutoMlClient.create_model
Creates a model. Returns a Model in the ``response`` field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec. Example: >>> from google.cloud import automl_v1beta1 ...
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
def create_model( self, parent, model, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a model. Returns a Model in the ``response`` field when it completes. When you ...
def create_model( self, parent, model, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a model. Returns a Model in the ``response`` field when it completes. When you ...
[ "Creates", "a", "model", ".", "Returns", "a", "Model", "in", "the", "response", "field", "when", "it", "completes", ".", "When", "you", "create", "a", "model", "several", "model", "evaluations", "are", "created", "for", "it", ":", "a", "global", "evaluatio...
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py#L895-L988
[ "def", "create_model", "(", "self", ",", "parent", ",", "model", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
exponential_sleep_generator
Generates sleep intervals based on the exponential back-off algorithm. This implements the `Truncated Exponential Back-off`_ algorithm. .. _Truncated Exponential Back-off: https://cloud.google.com/storage/docs/exponential-backoff Args: initial (float): The minimum about of time to delay. ...
api_core/google/api_core/retry.py
def exponential_sleep_generator(initial, maximum, multiplier=_DEFAULT_DELAY_MULTIPLIER): """Generates sleep intervals based on the exponential back-off algorithm. This implements the `Truncated Exponential Back-off`_ algorithm. .. _Truncated Exponential Back-off: https://cloud.google.com/storage/d...
def exponential_sleep_generator(initial, maximum, multiplier=_DEFAULT_DELAY_MULTIPLIER): """Generates sleep intervals based on the exponential back-off algorithm. This implements the `Truncated Exponential Back-off`_ algorithm. .. _Truncated Exponential Back-off: https://cloud.google.com/storage/d...
[ "Generates", "sleep", "intervals", "based", "on", "the", "exponential", "back", "-", "off", "algorithm", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/retry.py#L116-L138
[ "def", "exponential_sleep_generator", "(", "initial", ",", "maximum", ",", "multiplier", "=", "_DEFAULT_DELAY_MULTIPLIER", ")", ":", "delay", "=", "initial", "while", "True", ":", "# Introduce jitter by yielding a delay that is uniformly distributed", "# to average out to the d...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
retry_target
Call a function and retry if it fails. This is the lowest-level retry helper. Generally, you'll use the higher-level retry helper :class:`Retry`. Args: target(Callable): The function to call and retry. This must be a nullary function - apply arguments with `functools.partial`. ...
api_core/google/api_core/retry.py
def retry_target(target, predicate, sleep_generator, deadline, on_error=None): """Call a function and retry if it fails. This is the lowest-level retry helper. Generally, you'll use the higher-level retry helper :class:`Retry`. Args: target(Callable): The function to call and retry. This must ...
def retry_target(target, predicate, sleep_generator, deadline, on_error=None): """Call a function and retry if it fails. This is the lowest-level retry helper. Generally, you'll use the higher-level retry helper :class:`Retry`. Args: target(Callable): The function to call and retry. This must ...
[ "Call", "a", "function", "and", "retry", "if", "it", "fails", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/retry.py#L141-L207
[ "def", "retry_target", "(", "target", ",", "predicate", ",", "sleep_generator", ",", "deadline", ",", "on_error", "=", "None", ")", ":", "if", "deadline", "is", "not", "None", ":", "deadline_datetime", "=", "datetime_helpers", ".", "utcnow", "(", ")", "+", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BidiRpc.open
Opens the stream.
api_core/google/api_core/bidi.py
def open(self): """Opens the stream.""" if self.is_active: raise ValueError("Can not open an already open stream.") request_generator = _RequestQueueGenerator( self._request_queue, initial_request=self._initial_request ) call = self._start_rpc(iter(reques...
def open(self): """Opens the stream.""" if self.is_active: raise ValueError("Can not open an already open stream.") request_generator = _RequestQueueGenerator( self._request_queue, initial_request=self._initial_request ) call = self._start_rpc(iter(reques...
[ "Opens", "the", "stream", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/bidi.py#L202-L222
[ "def", "open", "(", "self", ")", ":", "if", "self", ".", "is_active", ":", "raise", "ValueError", "(", "\"Can not open an already open stream.\"", ")", "request_generator", "=", "_RequestQueueGenerator", "(", "self", ".", "_request_queue", ",", "initial_request", "=...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BidiRpc.close
Closes the stream.
api_core/google/api_core/bidi.py
def close(self): """Closes the stream.""" if self.call is None: return self._request_queue.put(None) self.call.cancel() self._request_generator = None
def close(self): """Closes the stream.""" if self.call is None: return self._request_queue.put(None) self.call.cancel() self._request_generator = None
[ "Closes", "the", "stream", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/bidi.py#L224-L231
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "call", "is", "None", ":", "return", "self", ".", "_request_queue", ".", "put", "(", "None", ")", "self", ".", "call", ".", "cancel", "(", ")", "self", ".", "_request_generator", "=", "None" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BidiRpc.send
Queue a message to be sent on the stream. Send is non-blocking. If the underlying RPC has been closed, this will raise. Args: request (protobuf.Message): The request to send.
api_core/google/api_core/bidi.py
def send(self, request): """Queue a message to be sent on the stream. Send is non-blocking. If the underlying RPC has been closed, this will raise. Args: request (protobuf.Message): The request to send. """ if self.call is None: raise ValueError...
def send(self, request): """Queue a message to be sent on the stream. Send is non-blocking. If the underlying RPC has been closed, this will raise. Args: request (protobuf.Message): The request to send. """ if self.call is None: raise ValueError...
[ "Queue", "a", "message", "to", "be", "sent", "on", "the", "stream", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/bidi.py#L235-L254
[ "def", "send", "(", "self", ",", "request", ")", ":", "if", "self", ".", "call", "is", "None", ":", "raise", "ValueError", "(", "\"Can not send() on an RPC that has never been open()ed.\"", ")", "# Don't use self.is_active(), as ResumableBidiRpc will overload it", "# to mea...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ResumableBidiRpc._recoverable
Wraps a method to recover the stream and retry on error. If a retryable error occurs while making the call, then the stream will be re-opened and the method will be retried. This happens indefinitely so long as the error is a retryable one. If an error occurs while re-opening the stream...
api_core/google/api_core/bidi.py
def _recoverable(self, method, *args, **kwargs): """Wraps a method to recover the stream and retry on error. If a retryable error occurs while making the call, then the stream will be re-opened and the method will be retried. This happens indefinitely so long as the error is a retryable...
def _recoverable(self, method, *args, **kwargs): """Wraps a method to recover the stream and retry on error. If a retryable error occurs while making the call, then the stream will be re-opened and the method will be retried. This happens indefinitely so long as the error is a retryable...
[ "Wraps", "a", "method", "to", "recover", "the", "stream", "and", "retry", "on", "error", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/bidi.py#L387-L416
[ "def", "_recoverable", "(", "self", ",", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "while", "True", ":", "try", ":", "return", "method", "(", "*", "args", ",", "*", "*", "kwargs", ")", "except", "Exception", "as", "exc", ":", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BackgroundConsumer.start
Start the background thread and begin consuming the thread.
api_core/google/api_core/bidi.py
def start(self): """Start the background thread and begin consuming the thread.""" with self._operational_lock: ready = threading.Event() thread = threading.Thread( name=_BIDIRECTIONAL_CONSUMER_NAME, target=self._thread_main, args=(...
def start(self): """Start the background thread and begin consuming the thread.""" with self._operational_lock: ready = threading.Event() thread = threading.Thread( name=_BIDIRECTIONAL_CONSUMER_NAME, target=self._thread_main, args=(...
[ "Start", "the", "background", "thread", "and", "begin", "consuming", "the", "thread", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/bidi.py#L569-L586
[ "def", "start", "(", "self", ")", ":", "with", "self", ".", "_operational_lock", ":", "ready", "=", "threading", ".", "Event", "(", ")", "thread", "=", "threading", ".", "Thread", "(", "name", "=", "_BIDIRECTIONAL_CONSUMER_NAME", ",", "target", "=", "self"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BackgroundConsumer.stop
Stop consuming the stream and shutdown the background thread.
api_core/google/api_core/bidi.py
def stop(self): """Stop consuming the stream and shutdown the background thread.""" with self._operational_lock: self._bidi_rpc.close() if self._thread is not None: # Resume the thread to wake it up in case it is sleeping. self.resume() ...
def stop(self): """Stop consuming the stream and shutdown the background thread.""" with self._operational_lock: self._bidi_rpc.close() if self._thread is not None: # Resume the thread to wake it up in case it is sleeping. self.resume() ...
[ "Stop", "consuming", "the", "stream", "and", "shutdown", "the", "background", "thread", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/bidi.py#L588-L598
[ "def", "stop", "(", "self", ")", ":", "with", "self", ".", "_operational_lock", ":", "self", ".", "_bidi_rpc", ".", "close", "(", ")", "if", "self", ".", "_thread", "is", "not", "None", ":", "# Resume the thread to wake it up in case it is sleeping.", "self", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BackgroundConsumer.resume
Resumes the response stream.
api_core/google/api_core/bidi.py
def resume(self): """Resumes the response stream.""" with self._wake: self._paused = False self._wake.notifyAll()
def resume(self): """Resumes the response stream.""" with self._wake: self._paused = False self._wake.notifyAll()
[ "Resumes", "the", "response", "stream", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/bidi.py#L613-L617
[ "def", "resume", "(", "self", ")", ":", "with", "self", ".", "_wake", ":", "self", ".", "_paused", "=", "False", "self", ".", "_wake", ".", "notifyAll", "(", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
OsLoginServiceClient.project_path
Return a fully-qualified project string.
oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py
def project_path(cls, user, project): """Return a fully-qualified project string.""" return google.api_core.path_template.expand( "users/{user}/projects/{project}", user=user, project=project )
def project_path(cls, user, project): """Return a fully-qualified project string.""" return google.api_core.path_template.expand( "users/{user}/projects/{project}", user=user, project=project )
[ "Return", "a", "fully", "-", "qualified", "project", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py#L81-L85
[ "def", "project_path", "(", "cls", ",", "user", ",", "project", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"users/{user}/projects/{project}\"", ",", "user", "=", "user", ",", "project", "=", "project", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
OsLoginServiceClient.fingerprint_path
Return a fully-qualified fingerprint string.
oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py
def fingerprint_path(cls, user, fingerprint): """Return a fully-qualified fingerprint string.""" return google.api_core.path_template.expand( "users/{user}/sshPublicKeys/{fingerprint}", user=user, fingerprint=fingerprint, )
def fingerprint_path(cls, user, fingerprint): """Return a fully-qualified fingerprint string.""" return google.api_core.path_template.expand( "users/{user}/sshPublicKeys/{fingerprint}", user=user, fingerprint=fingerprint, )
[ "Return", "a", "fully", "-", "qualified", "fingerprint", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py#L88-L94
[ "def", "fingerprint_path", "(", "cls", ",", "user", ",", "fingerprint", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"users/{user}/sshPublicKeys/{fingerprint}\"", ",", "user", "=", "user", ",", "fingerprint", "=", "f...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
OsLoginServiceClient.delete_posix_account
Deletes a POSIX account. Example: >>> from google.cloud import oslogin_v1 >>> >>> client = oslogin_v1.OsLoginServiceClient() >>> >>> name = client.project_path('[USER]', '[PROJECT]') >>> >>> client.delete_posix_account(name) ...
oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py
def delete_posix_account( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a POSIX account. Example: >>> from google.cloud import oslogin_v1 ...
def delete_posix_account( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a POSIX account. Example: >>> from google.cloud import oslogin_v1 ...
[ "Deletes", "a", "POSIX", "account", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py#L195-L248
[ "def", "delete_posix_account", "(", "self", ",", "name", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "m...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
OsLoginServiceClient.import_ssh_public_key
Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile. Example: >>> from google.cloud import oslogin_v1 >>> >>> client = oslogin_v1.OsLoginServiceClient...
oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py
def import_ssh_public_key( self, parent, ssh_public_key, project_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Adds an SSH public key and returns the profile infor...
def import_ssh_public_key( self, parent, ssh_public_key, project_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Adds an SSH public key and returns the profile infor...
[ "Adds", "an", "SSH", "public", "key", "and", "returns", "the", "profile", "information", ".", "Default", "POSIX", "account", "information", "is", "set", "when", "no", "username", "and", "UID", "exist", "as", "part", "of", "the", "login", "profile", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py#L420-L488
[ "def", "import_ssh_public_key", "(", "self", ",", "parent", ",", "ssh_public_key", ",", "project_id", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
OsLoginServiceClient.update_ssh_public_key
Updates an SSH public key and returns the profile information. This method supports patch semantics. Example: >>> from google.cloud import oslogin_v1 >>> >>> client = oslogin_v1.OsLoginServiceClient() >>> >>> name = client.fingerprint_path('[U...
oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py
def update_ssh_public_key( self, name, ssh_public_key, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an SSH public key and returns the profile inf...
def update_ssh_public_key( self, name, ssh_public_key, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an SSH public key and returns the profile inf...
[ "Updates", "an", "SSH", "public", "key", "and", "returns", "the", "profile", "information", ".", "This", "method", "supports", "patch", "semantics", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/oslogin/google/cloud/oslogin_v1/gapic/os_login_service_client.py#L490-L562
[ "def", "update_ssh_public_key", "(", "self", ",", "name", ",", "ssh_public_key", ",", "update_mask", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_gc_rule_from_pb
Convert a protobuf GC rule to a native object. :type gc_rule_pb: :class:`.table_v2_pb2.GcRule` :param gc_rule_pb: The GC rule to convert. :rtype: :class:`GarbageCollectionRule` or :data:`NoneType <types.NoneType>` :returns: An instance of one of the native rules defined in :module:`colum...
bigtable/google/cloud/bigtable/column_family.py
def _gc_rule_from_pb(gc_rule_pb): """Convert a protobuf GC rule to a native object. :type gc_rule_pb: :class:`.table_v2_pb2.GcRule` :param gc_rule_pb: The GC rule to convert. :rtype: :class:`GarbageCollectionRule` or :data:`NoneType <types.NoneType>` :returns: An instance of one of the native rule...
def _gc_rule_from_pb(gc_rule_pb): """Convert a protobuf GC rule to a native object. :type gc_rule_pb: :class:`.table_v2_pb2.GcRule` :param gc_rule_pb: The GC rule to convert. :rtype: :class:`GarbageCollectionRule` or :data:`NoneType <types.NoneType>` :returns: An instance of one of the native rule...
[ "Convert", "a", "protobuf", "GC", "rule", "to", "a", "native", "object", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/column_family.py#L323-L351
[ "def", "_gc_rule_from_pb", "(", "gc_rule_pb", ")", ":", "rule_name", "=", "gc_rule_pb", ".", "WhichOneof", "(", "\"rule\"", ")", "if", "rule_name", "is", "None", ":", "return", "None", "if", "rule_name", "==", "\"max_num_versions\"", ":", "return", "MaxVersionsG...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
MaxAgeGCRule.to_pb
Converts the garbage collection rule to a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object.
bigtable/google/cloud/bigtable/column_family.py
def to_pb(self): """Converts the garbage collection rule to a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object. """ max_age = _helpers._timedelta_to_duration_pb(self.max_age) return table_v2_pb2.GcRule(max_age=max_age)
def to_pb(self): """Converts the garbage collection rule to a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object. """ max_age = _helpers._timedelta_to_duration_pb(self.max_age) return table_v2_pb2.GcRule(max_age=max_age)
[ "Converts", "the", "garbage", "collection", "rule", "to", "a", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/column_family.py#L100-L107
[ "def", "to_pb", "(", "self", ")", ":", "max_age", "=", "_helpers", ".", "_timedelta_to_duration_pb", "(", "self", ".", "max_age", ")", "return", "table_v2_pb2", ".", "GcRule", "(", "max_age", "=", "max_age", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
GCRuleUnion.to_pb
Converts the union into a single GC rule as a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object.
bigtable/google/cloud/bigtable/column_family.py
def to_pb(self): """Converts the union into a single GC rule as a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object. """ union = table_v2_pb2.GcRule.Union(rules=[rule.to_pb() for rule in self.rules]) return table_v2_pb2.GcRule(union=u...
def to_pb(self): """Converts the union into a single GC rule as a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object. """ union = table_v2_pb2.GcRule.Union(rules=[rule.to_pb() for rule in self.rules]) return table_v2_pb2.GcRule(union=u...
[ "Converts", "the", "union", "into", "a", "single", "GC", "rule", "as", "a", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/column_family.py#L134-L141
[ "def", "to_pb", "(", "self", ")", ":", "union", "=", "table_v2_pb2", ".", "GcRule", ".", "Union", "(", "rules", "=", "[", "rule", ".", "to_pb", "(", ")", "for", "rule", "in", "self", ".", "rules", "]", ")", "return", "table_v2_pb2", ".", "GcRule", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
GCRuleIntersection.to_pb
Converts the intersection into a single GC rule as a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object.
bigtable/google/cloud/bigtable/column_family.py
def to_pb(self): """Converts the intersection into a single GC rule as a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object. """ intersection = table_v2_pb2.GcRule.Intersection( rules=[rule.to_pb() for rule in self.rules] )...
def to_pb(self): """Converts the intersection into a single GC rule as a protobuf. :rtype: :class:`.table_v2_pb2.GcRule` :returns: The converted current object. """ intersection = table_v2_pb2.GcRule.Intersection( rules=[rule.to_pb() for rule in self.rules] )...
[ "Converts", "the", "intersection", "into", "a", "single", "GC", "rule", "as", "a", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/column_family.py#L168-L177
[ "def", "to_pb", "(", "self", ")", ":", "intersection", "=", "table_v2_pb2", ".", "GcRule", ".", "Intersection", "(", "rules", "=", "[", "rule", ".", "to_pb", "(", ")", "for", "rule", "in", "self", ".", "rules", "]", ")", "return", "table_v2_pb2", ".", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ColumnFamily.to_pb
Converts the column family to a protobuf. :rtype: :class:`.table_v2_pb2.ColumnFamily` :returns: The converted current object.
bigtable/google/cloud/bigtable/column_family.py
def to_pb(self): """Converts the column family to a protobuf. :rtype: :class:`.table_v2_pb2.ColumnFamily` :returns: The converted current object. """ if self.gc_rule is None: return table_v2_pb2.ColumnFamily() else: return table_v2_pb2.ColumnFamil...
def to_pb(self): """Converts the column family to a protobuf. :rtype: :class:`.table_v2_pb2.ColumnFamily` :returns: The converted current object. """ if self.gc_rule is None: return table_v2_pb2.ColumnFamily() else: return table_v2_pb2.ColumnFamil...
[ "Converts", "the", "column", "family", "to", "a", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/column_family.py#L242-L251
[ "def", "to_pb", "(", "self", ")", ":", "if", "self", ".", "gc_rule", "is", "None", ":", "return", "table_v2_pb2", ".", "ColumnFamily", "(", ")", "else", ":", "return", "table_v2_pb2", ".", "ColumnFamily", "(", "gc_rule", "=", "self", ".", "gc_rule", ".",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ColumnFamily.create
Create this column family. For example: .. literalinclude:: snippets_table.py :start-after: [START bigtable_create_column_family] :end-before: [END bigtable_create_column_family]
bigtable/google/cloud/bigtable/column_family.py
def create(self): """Create this column family. For example: .. literalinclude:: snippets_table.py :start-after: [START bigtable_create_column_family] :end-before: [END bigtable_create_column_family] """ column_family = self.to_pb() modification...
def create(self): """Create this column family. For example: .. literalinclude:: snippets_table.py :start-after: [START bigtable_create_column_family] :end-before: [END bigtable_create_column_family] """ column_family = self.to_pb() modification...
[ "Create", "this", "column", "family", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/column_family.py#L253-L273
[ "def", "create", "(", "self", ")", ":", "column_family", "=", "self", ".", "to_pb", "(", ")", "modification", "=", "table_admin_v2_pb2", ".", "ModifyColumnFamiliesRequest", ".", "Modification", "(", "id", "=", "self", ".", "column_family_id", ",", "create", "=...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ColumnFamily.delete
Delete this column family. For example: .. literalinclude:: snippets_table.py :start-after: [START bigtable_delete_column_family] :end-before: [END bigtable_delete_column_family]
bigtable/google/cloud/bigtable/column_family.py
def delete(self): """Delete this column family. For example: .. literalinclude:: snippets_table.py :start-after: [START bigtable_delete_column_family] :end-before: [END bigtable_delete_column_family] """ modification = table_admin_v2_pb2.ModifyColumnFam...
def delete(self): """Delete this column family. For example: .. literalinclude:: snippets_table.py :start-after: [START bigtable_delete_column_family] :end-before: [END bigtable_delete_column_family] """ modification = table_admin_v2_pb2.ModifyColumnFam...
[ "Delete", "this", "column", "family", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/column_family.py#L301-L320
[ "def", "delete", "(", "self", ")", ":", "modification", "=", "table_admin_v2_pb2", ".", "ModifyColumnFamiliesRequest", ".", "Modification", "(", "id", "=", "self", ".", "column_family_id", ",", "drop", "=", "True", ")", "client", "=", "self", ".", "_table", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_maybe_wrap_exception
Wraps a gRPC exception class, if needed.
firestore/google/cloud/firestore_v1beta1/watch.py
def _maybe_wrap_exception(exception): """Wraps a gRPC exception class, if needed.""" if isinstance(exception, grpc.RpcError): return exceptions.from_grpc_error(exception) return exception
def _maybe_wrap_exception(exception): """Wraps a gRPC exception class, if needed.""" if isinstance(exception, grpc.RpcError): return exceptions.from_grpc_error(exception) return exception
[ "Wraps", "a", "gRPC", "exception", "class", "if", "needed", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L144-L148
[ "def", "_maybe_wrap_exception", "(", "exception", ")", ":", "if", "isinstance", "(", "exception", ",", "grpc", ".", "RpcError", ")", ":", "return", "exceptions", ".", "from_grpc_error", "(", "exception", ")", "return", "exception" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Watch.close
Stop consuming messages and shutdown all helper threads. This method is idempotent. Additional calls will have no effect. Args: reason (Any): The reason to close this. If None, this is considered an "intentional" shutdown.
firestore/google/cloud/firestore_v1beta1/watch.py
def close(self, reason=None): """Stop consuming messages and shutdown all helper threads. This method is idempotent. Additional calls will have no effect. Args: reason (Any): The reason to close this. If None, this is considered an "intentional" shutdown. ""...
def close(self, reason=None): """Stop consuming messages and shutdown all helper threads. This method is idempotent. Additional calls will have no effect. Args: reason (Any): The reason to close this. If None, this is considered an "intentional" shutdown. ""...
[ "Stop", "consuming", "messages", "and", "shutdown", "all", "helper", "threads", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L262-L291
[ "def", "close", "(", "self", ",", "reason", "=", "None", ")", ":", "with", "self", ".", "_closing", ":", "if", "self", ".", "_closed", ":", "return", "# Stop consuming messages.", "if", "self", ".", "is_active", ":", "_LOGGER", ".", "debug", "(", "\"Stop...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Watch._on_rpc_done
Triggered whenever the underlying RPC terminates without recovery. This is typically triggered from one of two threads: the background consumer thread (when calling ``recv()`` produces a non-recoverable error) or the grpc management thread (when cancelling the RPC). This method is *non...
firestore/google/cloud/firestore_v1beta1/watch.py
def _on_rpc_done(self, future): """Triggered whenever the underlying RPC terminates without recovery. This is typically triggered from one of two threads: the background consumer thread (when calling ``recv()`` produces a non-recoverable error) or the grpc management thread (when cancel...
def _on_rpc_done(self, future): """Triggered whenever the underlying RPC terminates without recovery. This is typically triggered from one of two threads: the background consumer thread (when calling ``recv()`` produces a non-recoverable error) or the grpc management thread (when cancel...
[ "Triggered", "whenever", "the", "underlying", "RPC", "terminates", "without", "recovery", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L293-L310
[ "def", "_on_rpc_done", "(", "self", ",", "future", ")", ":", "_LOGGER", ".", "info", "(", "\"RPC termination has signaled manager shutdown.\"", ")", "future", "=", "_maybe_wrap_exception", "(", "future", ")", "thread", "=", "threading", ".", "Thread", "(", "name",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Watch.for_document
Creates a watch snapshot listener for a document. snapshot_callback receives a DocumentChange object, but may also start to get targetChange and such soon Args: document_ref: Reference to Document snapshot_callback: callback to be called on snapshot snapshot_...
firestore/google/cloud/firestore_v1beta1/watch.py
def for_document( cls, document_ref, snapshot_callback, snapshot_class_instance, reference_class_instance, ): """ Creates a watch snapshot listener for a document. snapshot_callback receives a DocumentChange object, but may also start to get ta...
def for_document( cls, document_ref, snapshot_callback, snapshot_class_instance, reference_class_instance, ): """ Creates a watch snapshot listener for a document. snapshot_callback receives a DocumentChange object, but may also start to get ta...
[ "Creates", "a", "watch", "snapshot", "listener", "for", "a", "document", ".", "snapshot_callback", "receives", "a", "DocumentChange", "object", "but", "may", "also", "start", "to", "get", "targetChange", "and", "such", "soon" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L316-L348
[ "def", "for_document", "(", "cls", ",", "document_ref", ",", "snapshot_callback", ",", "snapshot_class_instance", ",", "reference_class_instance", ",", ")", ":", "return", "cls", "(", "document_ref", ",", "document_ref", ".", "_client", ",", "{", "\"documents\"", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Watch.on_snapshot
Called everytime there is a response from listen. Collect changes and 'push' the changes in a batch to the customer when we receive 'current' from the listen response. Args: listen_response(`google.cloud.firestore_v1beta1.types.ListenResponse`): Callback method that ...
firestore/google/cloud/firestore_v1beta1/watch.py
def on_snapshot(self, proto): """ Called everytime there is a response from listen. Collect changes and 'push' the changes in a batch to the customer when we receive 'current' from the listen response. Args: listen_response(`google.cloud.firestore_v1beta1.types.Liste...
def on_snapshot(self, proto): """ Called everytime there is a response from listen. Collect changes and 'push' the changes in a batch to the customer when we receive 'current' from the listen response. Args: listen_response(`google.cloud.firestore_v1beta1.types.Liste...
[ "Called", "everytime", "there", "is", "a", "response", "from", "listen", ".", "Collect", "changes", "and", "push", "the", "changes", "in", "a", "batch", "to", "the", "customer", "when", "we", "receive", "current", "from", "the", "listen", "response", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L408-L527
[ "def", "on_snapshot", "(", "self", ",", "proto", ")", ":", "TargetChange", "=", "firestore_pb2", ".", "TargetChange", "target_changetype_dispatch", "=", "{", "TargetChange", ".", "NO_CHANGE", ":", "self", ".", "_on_snapshot_target_change_no_change", ",", "TargetChange...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Watch.push
Assembles a new snapshot from the current set of changes and invokes the user's callback. Clears the current changes on completion.
firestore/google/cloud/firestore_v1beta1/watch.py
def push(self, read_time, next_resume_token): """ Assembles a new snapshot from the current set of changes and invokes the user's callback. Clears the current changes on completion. """ deletes, adds, updates = Watch._extract_changes( self.doc_map, self.change_map, re...
def push(self, read_time, next_resume_token): """ Assembles a new snapshot from the current set of changes and invokes the user's callback. Clears the current changes on completion. """ deletes, adds, updates = Watch._extract_changes( self.doc_map, self.change_map, re...
[ "Assembles", "a", "new", "snapshot", "from", "the", "current", "set", "of", "changes", "and", "invokes", "the", "user", "s", "callback", ".", "Clears", "the", "current", "changes", "on", "completion", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L529-L558
[ "def", "push", "(", "self", ",", "read_time", ",", "next_resume_token", ")", ":", "deletes", ",", "adds", ",", "updates", "=", "Watch", ".", "_extract_changes", "(", "self", ".", "doc_map", ",", "self", ".", "change_map", ",", "read_time", ")", "updated_tr...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Watch._current_size
Returns the current count of all documents, including the changes from the current changeMap.
firestore/google/cloud/firestore_v1beta1/watch.py
def _current_size(self): """ Returns the current count of all documents, including the changes from the current changeMap. """ deletes, adds, _ = Watch._extract_changes(self.doc_map, self.change_map, None) return len(self.doc_map) + len(adds) - len(deletes)
def _current_size(self): """ Returns the current count of all documents, including the changes from the current changeMap. """ deletes, adds, _ = Watch._extract_changes(self.doc_map, self.change_map, None) return len(self.doc_map) + len(adds) - len(deletes)
[ "Returns", "the", "current", "count", "of", "all", "documents", "including", "the", "changes", "from", "the", "current", "changeMap", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L700-L706
[ "def", "_current_size", "(", "self", ")", ":", "deletes", ",", "adds", ",", "_", "=", "Watch", ".", "_extract_changes", "(", "self", ".", "doc_map", ",", "self", ".", "change_map", ",", "None", ")", "return", "len", "(", "self", ".", "doc_map", ")", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Watch._reset_docs
Helper to clear the docs on RESET or filter mismatch.
firestore/google/cloud/firestore_v1beta1/watch.py
def _reset_docs(self): """ Helper to clear the docs on RESET or filter mismatch. """ _LOGGER.debug("resetting documents") self.change_map.clear() self.resume_token = None # Mark each document as deleted. If documents are not deleted # they will be sent ag...
def _reset_docs(self): """ Helper to clear the docs on RESET or filter mismatch. """ _LOGGER.debug("resetting documents") self.change_map.clear() self.resume_token = None # Mark each document as deleted. If documents are not deleted # they will be sent ag...
[ "Helper", "to", "clear", "the", "docs", "on", "RESET", "or", "filter", "mismatch", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/watch.py#L708-L722
[ "def", "_reset_docs", "(", "self", ")", ":", "_LOGGER", ".", "debug", "(", "\"resetting documents\"", ")", "self", ".", "change_map", ".", "clear", "(", ")", "self", ".", "resume_token", "=", "None", "# Mark each document as deleted. If documents are not deleted", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
JSONConnection.build_api_url
Construct an API url given a few components, some optional. Typically, you shouldn't need to use this method. :type path: str :param path: The path to the resource (ie, ``'/b/bucket-name'``). :type query_params: dict or list :param query_params: A dictionary of keys and values...
core/google/cloud/_http.py
def build_api_url( cls, path, query_params=None, api_base_url=None, api_version=None ): """Construct an API url given a few components, some optional. Typically, you shouldn't need to use this method. :type path: str :param path: The path to the resource (ie, ``'/b/bucket-n...
def build_api_url( cls, path, query_params=None, api_base_url=None, api_version=None ): """Construct an API url given a few components, some optional. Typically, you shouldn't need to use this method. :type path: str :param path: The path to the resource (ie, ``'/b/bucket-n...
[ "Construct", "an", "API", "url", "given", "a", "few", "components", "some", "optional", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/_http.py#L105-L142
[ "def", "build_api_url", "(", "cls", ",", "path", ",", "query_params", "=", "None", ",", "api_base_url", "=", "None", ",", "api_version", "=", "None", ")", ":", "url", "=", "cls", ".", "API_URL_TEMPLATE", ".", "format", "(", "api_base_url", "=", "(", "api...
85e80125a59cb10f8cb105f25ecc099e4b940b50