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
Future.done
Return True the future is done, False otherwise. This still returns True in failure cases; checking :meth:`result` or :meth:`exception` is the canonical way to assess success or failure.
pubsub/google/cloud/pubsub_v1/futures.py
def done(self): """Return True the future is done, False otherwise. This still returns True in failure cases; checking :meth:`result` or :meth:`exception` is the canonical way to assess success or failure. """ return self._exception != self._SENTINEL or self._result != self._SEN...
def done(self): """Return True the future is done, False otherwise. This still returns True in failure cases; checking :meth:`result` or :meth:`exception` is the canonical way to assess success or failure. """ return self._exception != self._SENTINEL or self._result != self._SEN...
[ "Return", "True", "the", "future", "is", "done", "False", "otherwise", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L81-L87
[ "def", "done", "(", "self", ")", ":", "return", "self", ".", "_exception", "!=", "self", ".", "_SENTINEL", "or", "self", ".", "_result", "!=", "self", ".", "_SENTINEL" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Future.exception
Return the exception raised by the call, if any. This blocks until the message has successfully been published, and returns the exception. If the call succeeded, return None. Args: timeout (Union[int, float]): The number of seconds before this call times out and rai...
pubsub/google/cloud/pubsub_v1/futures.py
def exception(self, timeout=None): """Return the exception raised by the call, if any. This blocks until the message has successfully been published, and returns the exception. If the call succeeded, return None. Args: timeout (Union[int, float]): The number of seconds befo...
def exception(self, timeout=None): """Return the exception raised by the call, if any. This blocks until the message has successfully been published, and returns the exception. If the call succeeded, return None. Args: timeout (Union[int, float]): The number of seconds befo...
[ "Return", "the", "exception", "raised", "by", "the", "call", "if", "any", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L115-L140
[ "def", "exception", "(", "self", ",", "timeout", "=", "None", ")", ":", "# Wait until the future is done.", "if", "not", "self", ".", "_completed", ".", "wait", "(", "timeout", "=", "timeout", ")", ":", "raise", "exceptions", ".", "TimeoutError", "(", "\"Tim...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Future.add_done_callback
Attach the provided callable to the future. The provided function is called, with this future as its only argument, when the future finishes running.
pubsub/google/cloud/pubsub_v1/futures.py
def add_done_callback(self, fn): """Attach the provided callable to the future. The provided function is called, with this future as its only argument, when the future finishes running. """ if self.done(): return fn(self) self._callbacks.append(fn)
def add_done_callback(self, fn): """Attach the provided callable to the future. The provided function is called, with this future as its only argument, when the future finishes running. """ if self.done(): return fn(self) self._callbacks.append(fn)
[ "Attach", "the", "provided", "callable", "to", "the", "future", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L142-L150
[ "def", "add_done_callback", "(", "self", ",", "fn", ")", ":", "if", "self", ".", "done", "(", ")", ":", "return", "fn", "(", "self", ")", "self", ".", "_callbacks", ".", "append", "(", "fn", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Future.set_result
Set the result of the future to the provided result. Args: result (Any): The result
pubsub/google/cloud/pubsub_v1/futures.py
def set_result(self, result): """Set the result of the future to the provided result. Args: result (Any): The result """ # Sanity check: A future can only complete once. if self.done(): raise RuntimeError("set_result can only be called once.") # ...
def set_result(self, result): """Set the result of the future to the provided result. Args: result (Any): The result """ # Sanity check: A future can only complete once. if self.done(): raise RuntimeError("set_result can only be called once.") # ...
[ "Set", "the", "result", "of", "the", "future", "to", "the", "provided", "result", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L152-L164
[ "def", "set_result", "(", "self", ",", "result", ")", ":", "# Sanity check: A future can only complete once.", "if", "self", ".", "done", "(", ")", ":", "raise", "RuntimeError", "(", "\"set_result can only be called once.\"", ")", "# Set the result and trigger the future.",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Future.set_exception
Set the result of the future to the given exception. Args: exception (:exc:`Exception`): The exception raised.
pubsub/google/cloud/pubsub_v1/futures.py
def set_exception(self, exception): """Set the result of the future to the given exception. Args: exception (:exc:`Exception`): The exception raised. """ # Sanity check: A future can only complete once. if self.done(): raise RuntimeError("set_exception ca...
def set_exception(self, exception): """Set the result of the future to the given exception. Args: exception (:exc:`Exception`): The exception raised. """ # Sanity check: A future can only complete once. if self.done(): raise RuntimeError("set_exception ca...
[ "Set", "the", "result", "of", "the", "future", "to", "the", "given", "exception", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L166-L178
[ "def", "set_exception", "(", "self", ",", "exception", ")", ":", "# Sanity check: A future can only complete once.", "if", "self", ".", "done", "(", ")", ":", "raise", "RuntimeError", "(", "\"set_exception can only be called once.\"", ")", "# Set the exception and trigger t...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Future._trigger
Trigger all callbacks registered to this Future. This method is called internally by the batch once the batch completes. Args: message_id (str): The message ID, as a string.
pubsub/google/cloud/pubsub_v1/futures.py
def _trigger(self): """Trigger all callbacks registered to this Future. This method is called internally by the batch once the batch completes. Args: message_id (str): The message ID, as a string. """ self._completed.set() for callback in self._callb...
def _trigger(self): """Trigger all callbacks registered to this Future. This method is called internally by the batch once the batch completes. Args: message_id (str): The message ID, as a string. """ self._completed.set() for callback in self._callb...
[ "Trigger", "all", "callbacks", "registered", "to", "this", "Future", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L180-L191
[ "def", "_trigger", "(", "self", ")", ":", "self", ".", "_completed", ".", "set", "(", ")", "for", "callback", "in", "self", ".", "_callbacks", ":", "callback", "(", "self", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
SyncTransport.send
Overrides transport.send(). :type record: :class:`logging.LogRecord` :param record: Python log record that the handler was called with. :type message: str :param message: The message from the ``LogRecord`` after being formatted by the associated log formatters. ...
logging/google/cloud/logging/handlers/transports/sync.py
def send( self, record, message, resource=None, labels=None, trace=None, span_id=None ): """Overrides transport.send(). :type record: :class:`logging.LogRecord` :param record: Python log record that the handler was called with. :type message: str :param message: The...
def send( self, record, message, resource=None, labels=None, trace=None, span_id=None ): """Overrides transport.send(). :type record: :class:`logging.LogRecord` :param record: Python log record that the handler was called with. :type message: str :param message: The...
[ "Overrides", "transport", ".", "send", "()", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/transports/sync.py#L32-L58
[ "def", "send", "(", "self", ",", "record", ",", "message", ",", "resource", "=", "None", ",", "labels", "=", "None", ",", "trace", "=", "None", ",", "span_id", "=", "None", ")", ":", "info", "=", "{", "\"message\"", ":", "message", ",", "\"python_log...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BigQueryStorageClient.create_read_session
Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing ...
bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py
def create_read_session( self, table_reference, parent, table_modifiers=None, requested_streams=None, read_options=None, format_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=...
def create_read_session( self, table_reference, parent, table_modifiers=None, requested_streams=None, read_options=None, format_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=...
[ "Creates", "a", "new", "read", "session", ".", "A", "read", "session", "divides", "the", "contents", "of", "a", "BigQuery", "table", "into", "one", "or", "more", "streams", "which", "can", "then", "be", "used", "to", "read", "data", "from", "the", "table...
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py#L179-L298
[ "def", "create_read_session", "(", "self", ",", "table_reference", ",", "parent", ",", "table_modifiers", "=", "None", ",", "requested_streams", "=", "None", ",", "read_options", "=", "None", ",", "format_", "=", "None", ",", "retry", "=", "google", ".", "ap...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BigQueryStorageClient.read_rows
Reads rows from the table in the format prescribed by the read session. Each response contains one or more table rows, up to a maximum of 10 MiB per response; read requests which attempt to read individual rows larger than this will fail. Each request also returns a set of stream statis...
bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py
def read_rows( self, read_position, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Reads rows from the table in the format prescribed by the read session. Each response contains one...
def read_rows( self, read_position, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Reads rows from the table in the format prescribed by the read session. Each response contains one...
[ "Reads", "rows", "from", "the", "table", "in", "the", "format", "prescribed", "by", "the", "read", "session", ".", "Each", "response", "contains", "one", "or", "more", "table", "rows", "up", "to", "a", "maximum", "of", "10", "MiB", "per", "response", ";"...
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py#L300-L383
[ "def", "read_rows", "(", "self", ",", "read_position", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "met...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BigQueryStorageClient.batch_create_read_session_streams
Creates additional streams for a ReadSession. This API can be used to dynamically adjust the parallelism of a batch processing task upwards by adding additional workers. Example: >>> from google.cloud import bigquery_storage_v1beta1 >>> >>> client = bigquery_...
bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py
def batch_create_read_session_streams( self, session, requested_streams, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates additional streams for a ReadSession. This API can be...
def batch_create_read_session_streams( self, session, requested_streams, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates additional streams for a ReadSession. This API can be...
[ "Creates", "additional", "streams", "for", "a", "ReadSession", ".", "This", "API", "can", "be", "used", "to", "dynamically", "adjust", "the", "parallelism", "of", "a", "batch", "processing", "task", "upwards", "by", "adding", "additional", "workers", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py#L385-L472
[ "def", "batch_create_read_session_streams", "(", "self", ",", "session", ",", "requested_streams", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", "....
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BigtableColumn.qualifier_encoded
Union[str, bytes]: The qualifier encoded in binary. The type is ``str`` (Python 2.x) or ``bytes`` (Python 3.x). The module will handle base64 encoding for you. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.%28key%29.bigtableOptio...
bigquery/google/cloud/bigquery/external_config.py
def qualifier_encoded(self): """Union[str, bytes]: The qualifier encoded in binary. The type is ``str`` (Python 2.x) or ``bytes`` (Python 3.x). The module will handle base64 encoding for you. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query....
def qualifier_encoded(self): """Union[str, bytes]: The qualifier encoded in binary. The type is ``str`` (Python 2.x) or ``bytes`` (Python 3.x). The module will handle base64 encoding for you. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query....
[ "Union", "[", "str", "bytes", "]", ":", "The", "qualifier", "encoded", "in", "binary", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/external_config.py#L110-L123
[ "def", "qualifier_encoded", "(", "self", ")", ":", "prop", "=", "self", ".", "_properties", ".", "get", "(", "\"qualifierEncoded\"", ")", "if", "prop", "is", "None", ":", "return", "None", "return", "base64", ".", "standard_b64decode", "(", "_to_bytes", "(",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BigtableColumnFamily.columns
List[:class:`~.external_config.BigtableColumn`]: Lists of columns that should be exposed as individual fields. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).bigtableOptions.columnFamilies.columns https://cloud.google.com/big...
bigquery/google/cloud/bigquery/external_config.py
def columns(self): """List[:class:`~.external_config.BigtableColumn`]: Lists of columns that should be exposed as individual fields. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).bigtableOptions.columnFamilies.columns ...
def columns(self): """List[:class:`~.external_config.BigtableColumn`]: Lists of columns that should be exposed as individual fields. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).bigtableOptions.columnFamilies.columns ...
[ "List", "[", ":", "class", ":", "~", ".", "external_config", ".", "BigtableColumn", "]", ":", "Lists", "of", "columns", "that", "should", "be", "exposed", "as", "individual", "fields", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/external_config.py#L250-L259
[ "def", "columns", "(", "self", ")", ":", "prop", "=", "self", ".", "_properties", ".", "get", "(", "\"columns\"", ",", "[", "]", ")", "return", "[", "BigtableColumn", ".", "from_api_repr", "(", "col", ")", "for", "col", "in", "prop", "]" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
BigtableOptions.column_families
List[:class:`~.external_config.BigtableColumnFamily`]: List of column families to expose in the table schema along with their types. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).bigtableOptions.columnFamilies https://cloud....
bigquery/google/cloud/bigquery/external_config.py
def column_families(self): """List[:class:`~.external_config.BigtableColumnFamily`]: List of column families to expose in the table schema along with their types. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).bigtableOptions...
def column_families(self): """List[:class:`~.external_config.BigtableColumnFamily`]: List of column families to expose in the table schema along with their types. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).bigtableOptions...
[ "List", "[", ":", "class", ":", "~", ".", "external_config", ".", "BigtableColumnFamily", "]", ":", "List", "of", "column", "families", "to", "expose", "in", "the", "table", "schema", "along", "with", "their", "types", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/external_config.py#L335-L344
[ "def", "column_families", "(", "self", ")", ":", "prop", "=", "self", ".", "_properties", ".", "get", "(", "\"columnFamilies\"", ",", "[", "]", ")", "return", "[", "BigtableColumnFamily", ".", "from_api_repr", "(", "cf", ")", "for", "cf", "in", "prop", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ExternalConfig.schema
List[:class:`~google.cloud.bigquery.schema.SchemaField`]: The schema for the data. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).schema https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externalDataConfiguratio...
bigquery/google/cloud/bigquery/external_config.py
def schema(self): """List[:class:`~google.cloud.bigquery.schema.SchemaField`]: The schema for the data. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).schema https://cloud.google.com/bigquery/docs/reference/rest/v2/ta...
def schema(self): """List[:class:`~google.cloud.bigquery.schema.SchemaField`]: The schema for the data. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).schema https://cloud.google.com/bigquery/docs/reference/rest/v2/ta...
[ "List", "[", ":", "class", ":", "~google", ".", "cloud", ".", "bigquery", ".", "schema", ".", "SchemaField", "]", ":", "The", "schema", "for", "the", "data", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/external_config.py#L664-L673
[ "def", "schema", "(", "self", ")", ":", "prop", "=", "self", ".", "_properties", ".", "get", "(", "\"schema\"", ",", "{", "}", ")", "return", "[", "SchemaField", ".", "from_api_repr", "(", "field", ")", "for", "field", "in", "prop", ".", "get", "(", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ExternalConfig.to_api_repr
Build an API representation of this object. Returns: Dict[str, Any]: A dictionary in the format used by the BigQuery API.
bigquery/google/cloud/bigquery/external_config.py
def to_api_repr(self): """Build an API representation of this object. Returns: Dict[str, Any]: A dictionary in the format used by the BigQuery API. """ config = copy.deepcopy(self._properties) if self.options is not None: r = self.options....
def to_api_repr(self): """Build an API representation of this object. Returns: Dict[str, Any]: A dictionary in the format used by the BigQuery API. """ config = copy.deepcopy(self._properties) if self.options is not None: r = self.options....
[ "Build", "an", "API", "representation", "of", "this", "object", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/external_config.py#L682-L694
[ "def", "to_api_repr", "(", "self", ")", ":", "config", "=", "copy", ".", "deepcopy", "(", "self", ".", "_properties", ")", "if", "self", ".", "options", "is", "not", "None", ":", "r", "=", "self", ".", "options", ".", "to_api_repr", "(", ")", "if", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ExternalConfig.from_api_repr
Factory: construct an :class:`~.external_config.ExternalConfig` instance given its API representation. Args: resource (Dict[str, Any]): Definition of an :class:`~.external_config.ExternalConfig` instance in the same representation as is returned from the ...
bigquery/google/cloud/bigquery/external_config.py
def from_api_repr(cls, resource): """Factory: construct an :class:`~.external_config.ExternalConfig` instance given its API representation. Args: resource (Dict[str, Any]): Definition of an :class:`~.external_config.ExternalConfig` instance in the sam...
def from_api_repr(cls, resource): """Factory: construct an :class:`~.external_config.ExternalConfig` instance given its API representation. Args: resource (Dict[str, Any]): Definition of an :class:`~.external_config.ExternalConfig` instance in the sam...
[ "Factory", ":", "construct", "an", ":", "class", ":", "~", ".", "external_config", ".", "ExternalConfig", "instance", "given", "its", "API", "representation", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/external_config.py#L697-L718
[ "def", "from_api_repr", "(", "cls", ",", "resource", ")", ":", "config", "=", "cls", "(", "resource", "[", "\"sourceFormat\"", "]", ")", "for", "optcls", "in", "_OPTION_CLASSES", ":", "opts", "=", "resource", ".", "get", "(", "optcls", ".", "_RESOURCE_NAME...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
lint
Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality issues.
bigquery_storage/noxfile.py
def lint(session): """Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ session.install('flake8', *LOCAL_DEPS) session.install('-e', '.') session.run( 'flake8', os.path.join('google', 'cloud', 'bigquery_storage_v1beta1...
def lint(session): """Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ session.install('flake8', *LOCAL_DEPS) session.install('-e', '.') session.run( 'flake8', os.path.join('google', 'cloud', 'bigquery_storage_v1beta1...
[ "Run", "linters", ".", "Returns", "a", "failure", "if", "the", "linters", "find", "linting", "errors", "or", "sufficiently", "serious", "code", "quality", "issues", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/noxfile.py#L63-L73
[ "def", "lint", "(", "session", ")", ":", "session", ".", "install", "(", "'flake8'", ",", "*", "LOCAL_DEPS", ")", "session", ".", "install", "(", "'-e'", ",", "'.'", ")", "session", ".", "run", "(", "'flake8'", ",", "os", ".", "path", ".", "join", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
system
Run the system test suite.
bigquery_storage/noxfile.py
def system(session): """Run the system test suite.""" # Sanity check: Only run system tests if the environment variable is set. if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''): session.skip('Credentials must be set via environment variable.') # Install all test dependencies, then i...
def system(session): """Run the system test suite.""" # Sanity check: Only run system tests if the environment variable is set. if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''): session.skip('Credentials must be set via environment variable.') # Install all test dependencies, then i...
[ "Run", "the", "system", "test", "suite", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/noxfile.py#L111-L127
[ "def", "system", "(", "session", ")", ":", "# Sanity check: Only run system tests if the environment variable is set.", "if", "not", "os", ".", "environ", ".", "get", "(", "'GOOGLE_APPLICATION_CREDENTIALS'", ",", "''", ")", ":", "session", ".", "skip", "(", "'Credenti...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
docs
Build the docs.
bigquery_storage/noxfile.py
def docs(session): """Build the docs.""" session.install('sphinx', 'sphinx_rtd_theme') session.install('-e', '.[pandas,fastavro]') shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True) session.run( 'sphinx-build', '-W', # warnings as errors '-T', # show full t...
def docs(session): """Build the docs.""" session.install('sphinx', 'sphinx_rtd_theme') session.install('-e', '.[pandas,fastavro]') shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True) session.run( 'sphinx-build', '-W', # warnings as errors '-T', # show full t...
[ "Build", "the", "docs", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/noxfile.py#L152-L168
[ "def", "docs", "(", "session", ")", ":", "session", ".", "install", "(", "'sphinx'", ",", "'sphinx_rtd_theme'", ")", "session", ".", "install", "(", "'-e'", ",", "'.[pandas,fastavro]'", ")", "shutil", ".", "rmtree", "(", "os", ".", "path", ".", "join", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_enum_from_op_string
Convert a string representation of a binary operator to an enum. These enums come from the protobuf message definition ``StructuredQuery.FieldFilter.Operator``. Args: op_string (str): A comparison operation in the form of a string. Acceptable values are ``<``, ``<=``, ``==``, ``>=`` ...
firestore/google/cloud/firestore_v1beta1/query.py
def _enum_from_op_string(op_string): """Convert a string representation of a binary operator to an enum. These enums come from the protobuf message definition ``StructuredQuery.FieldFilter.Operator``. Args: op_string (str): A comparison operation in the form of a string. Acceptable...
def _enum_from_op_string(op_string): """Convert a string representation of a binary operator to an enum. These enums come from the protobuf message definition ``StructuredQuery.FieldFilter.Operator``. Args: op_string (str): A comparison operation in the form of a string. Acceptable...
[ "Convert", "a", "string", "representation", "of", "a", "binary", "operator", "to", "an", "enum", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L825-L847
[ "def", "_enum_from_op_string", "(", "op_string", ")", ":", "try", ":", "return", "_COMPARISON_OPERATORS", "[", "op_string", "]", "except", "KeyError", ":", "choices", "=", "\", \"", ".", "join", "(", "sorted", "(", "_COMPARISON_OPERATORS", ".", "keys", "(", ")...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_enum_from_direction
Convert a string representation of a direction to an enum. Args: direction (str): A direction to order by. Must be one of :attr:`~.firestore.Query.ASCENDING` or :attr:`~.firestore.Query.DESCENDING`. Returns: int: The enum corresponding to ``direction``. Raises: ...
firestore/google/cloud/firestore_v1beta1/query.py
def _enum_from_direction(direction): """Convert a string representation of a direction to an enum. Args: direction (str): A direction to order by. Must be one of :attr:`~.firestore.Query.ASCENDING` or :attr:`~.firestore.Query.DESCENDING`. Returns: int: The enum corr...
def _enum_from_direction(direction): """Convert a string representation of a direction to an enum. Args: direction (str): A direction to order by. Must be one of :attr:`~.firestore.Query.ASCENDING` or :attr:`~.firestore.Query.DESCENDING`. Returns: int: The enum corr...
[ "Convert", "a", "string", "representation", "of", "a", "direction", "to", "an", "enum", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L868-L891
[ "def", "_enum_from_direction", "(", "direction", ")", ":", "if", "isinstance", "(", "direction", ",", "int", ")", ":", "return", "direction", "if", "direction", "==", "Query", ".", "ASCENDING", ":", "return", "enums", ".", "StructuredQuery", ".", "Direction", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_filter_pb
Convert a specific protobuf filter to the generic filter type. Args: field_or_unary (Union[google.cloud.proto.firestore.v1beta1.\ query_pb2.StructuredQuery.FieldFilter, google.cloud.proto.\ firestore.v1beta1.query_pb2.StructuredQuery.FieldFilter]): A field or unary filte...
firestore/google/cloud/firestore_v1beta1/query.py
def _filter_pb(field_or_unary): """Convert a specific protobuf filter to the generic filter type. Args: field_or_unary (Union[google.cloud.proto.firestore.v1beta1.\ query_pb2.StructuredQuery.FieldFilter, google.cloud.proto.\ firestore.v1beta1.query_pb2.StructuredQuery.FieldFilte...
def _filter_pb(field_or_unary): """Convert a specific protobuf filter to the generic filter type. Args: field_or_unary (Union[google.cloud.proto.firestore.v1beta1.\ query_pb2.StructuredQuery.FieldFilter, google.cloud.proto.\ firestore.v1beta1.query_pb2.StructuredQuery.FieldFilte...
[ "Convert", "a", "specific", "protobuf", "filter", "to", "the", "generic", "filter", "type", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L894-L915
[ "def", "_filter_pb", "(", "field_or_unary", ")", ":", "if", "isinstance", "(", "field_or_unary", ",", "query_pb2", ".", "StructuredQuery", ".", "FieldFilter", ")", ":", "return", "query_pb2", ".", "StructuredQuery", ".", "Filter", "(", "field_filter", "=", "fiel...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_cursor_pb
Convert a cursor pair to a protobuf. If ``cursor_pair`` is :data:`None`, just returns :data:`None`. Args: cursor_pair (Optional[Tuple[list, bool]]): Two-tuple of * a list of field values. * a ``before`` flag Returns: Optional[google.cloud.firestore_v1beta1.types.C...
firestore/google/cloud/firestore_v1beta1/query.py
def _cursor_pb(cursor_pair): """Convert a cursor pair to a protobuf. If ``cursor_pair`` is :data:`None`, just returns :data:`None`. Args: cursor_pair (Optional[Tuple[list, bool]]): Two-tuple of * a list of field values. * a ``before`` flag Returns: Optional[go...
def _cursor_pb(cursor_pair): """Convert a cursor pair to a protobuf. If ``cursor_pair`` is :data:`None`, just returns :data:`None`. Args: cursor_pair (Optional[Tuple[list, bool]]): Two-tuple of * a list of field values. * a ``before`` flag Returns: Optional[go...
[ "Convert", "a", "cursor", "pair", "to", "a", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L918-L936
[ "def", "_cursor_pb", "(", "cursor_pair", ")", ":", "if", "cursor_pair", "is", "not", "None", ":", "data", ",", "before", "=", "cursor_pair", "value_pbs", "=", "[", "_helpers", ".", "encode_value", "(", "value", ")", "for", "value", "in", "data", "]", "re...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_query_response_to_snapshot
Parse a query response protobuf to a document snapshot. Args: response_pb (google.cloud.proto.firestore.v1beta1.\ firestore_pb2.RunQueryResponse): A collection (~.firestore_v1beta1.collection.CollectionReference): A reference to the collection that initiated the query. ...
firestore/google/cloud/firestore_v1beta1/query.py
def _query_response_to_snapshot(response_pb, collection, expected_prefix): """Parse a query response protobuf to a document snapshot. Args: response_pb (google.cloud.proto.firestore.v1beta1.\ firestore_pb2.RunQueryResponse): A collection (~.firestore_v1beta1.collection.CollectionRef...
def _query_response_to_snapshot(response_pb, collection, expected_prefix): """Parse a query response protobuf to a document snapshot. Args: response_pb (google.cloud.proto.firestore.v1beta1.\ firestore_pb2.RunQueryResponse): A collection (~.firestore_v1beta1.collection.CollectionRef...
[ "Parse", "a", "query", "response", "protobuf", "to", "a", "document", "snapshot", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L939-L970
[ "def", "_query_response_to_snapshot", "(", "response_pb", ",", "collection", ",", "expected_prefix", ")", ":", "if", "not", "response_pb", ".", "HasField", "(", "\"document\"", ")", ":", "return", "None", "document_id", "=", "_helpers", ".", "get_doc_id", "(", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.select
Project documents matching query to a limited set of fields. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. If the current query already has a projection set (i.e. has already called :meth:`~.firestore_v1beta1.query.Query.select`), thi...
firestore/google/cloud/firestore_v1beta1/query.py
def select(self, field_paths): """Project documents matching query to a limited set of fields. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. If the current query already has a projection set (i.e. has already called :meth:`~.f...
def select(self, field_paths): """Project documents matching query to a limited set of fields. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. If the current query already has a projection set (i.e. has already called :meth:`~.f...
[ "Project", "documents", "matching", "query", "to", "a", "limited", "set", "of", "fields", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L165-L206
[ "def", "select", "(", "self", ",", "field_paths", ")", ":", "field_paths", "=", "list", "(", "field_paths", ")", "for", "field_path", "in", "field_paths", ":", "field_path_module", ".", "split_field_path", "(", "field_path", ")", "# raises", "new_projection", "=...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.where
Filter the query on a field. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. Returns a new :class:`~.firestore_v1beta1.query.Query` that filters on a specific field path, according to an operation (e.g. ``==`` or "equals") and a...
firestore/google/cloud/firestore_v1beta1/query.py
def where(self, field_path, op_string, value): """Filter the query on a field. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. Returns a new :class:`~.firestore_v1beta1.query.Query` that filters on a specific field path, accordi...
def where(self, field_path, op_string, value): """Filter the query on a field. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. Returns a new :class:`~.firestore_v1beta1.query.Query` that filters on a specific field path, accordi...
[ "Filter", "the", "query", "on", "a", "field", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L208-L273
[ "def", "where", "(", "self", ",", "field_path", ",", "op_string", ",", "value", ")", ":", "field_path_module", ".", "split_field_path", "(", "field_path", ")", "# raises", "if", "value", "is", "None", ":", "if", "op_string", "!=", "_EQ_OP", ":", "raise", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query._make_order
Helper for :meth:`order_by`.
firestore/google/cloud/firestore_v1beta1/query.py
def _make_order(field_path, direction): """Helper for :meth:`order_by`.""" return query_pb2.StructuredQuery.Order( field=query_pb2.StructuredQuery.FieldReference(field_path=field_path), direction=_enum_from_direction(direction), )
def _make_order(field_path, direction): """Helper for :meth:`order_by`.""" return query_pb2.StructuredQuery.Order( field=query_pb2.StructuredQuery.FieldReference(field_path=field_path), direction=_enum_from_direction(direction), )
[ "Helper", "for", ":", "meth", ":", "order_by", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L276-L281
[ "def", "_make_order", "(", "field_path", ",", "direction", ")", ":", "return", "query_pb2", ".", "StructuredQuery", ".", "Order", "(", "field", "=", "query_pb2", ".", "StructuredQuery", ".", "FieldReference", "(", "field_path", "=", "field_path", ")", ",", "di...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.order_by
Modify the query to add an order clause on a specific field. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. Successive :meth:`~.firestore_v1beta1.query.Query.order_by` calls will further refine the ordering of results returned by the q...
firestore/google/cloud/firestore_v1beta1/query.py
def order_by(self, field_path, direction=ASCENDING): """Modify the query to add an order clause on a specific field. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. Successive :meth:`~.firestore_v1beta1.query.Query.order_by` calls ...
def order_by(self, field_path, direction=ASCENDING): """Modify the query to add an order clause on a specific field. See :meth:`~.firestore_v1beta1.client.Client.field_path` for more information on **field paths**. Successive :meth:`~.firestore_v1beta1.query.Query.order_by` calls ...
[ "Modify", "the", "query", "to", "add", "an", "order", "clause", "on", "a", "specific", "field", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L283-L324
[ "def", "order_by", "(", "self", ",", "field_path", ",", "direction", "=", "ASCENDING", ")", ":", "field_path_module", ".", "split_field_path", "(", "field_path", ")", "# raises", "order_pb", "=", "self", ".", "_make_order", "(", "field_path", ",", "direction", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.limit
Limit a query to return a fixed number of results. If the current query already has a limit set, this will overwrite it. Args: count (int): Maximum number of documents to return that match the query. Returns: ~.firestore_v1beta1.query.Query: A limited q...
firestore/google/cloud/firestore_v1beta1/query.py
def limit(self, count): """Limit a query to return a fixed number of results. If the current query already has a limit set, this will overwrite it. Args: count (int): Maximum number of documents to return that match the query. Returns: ~.firesto...
def limit(self, count): """Limit a query to return a fixed number of results. If the current query already has a limit set, this will overwrite it. Args: count (int): Maximum number of documents to return that match the query. Returns: ~.firesto...
[ "Limit", "a", "query", "to", "return", "a", "fixed", "number", "of", "results", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L326-L349
[ "def", "limit", "(", "self", ",", "count", ")", ":", "return", "self", ".", "__class__", "(", "self", ".", "_parent", ",", "projection", "=", "self", ".", "_projection", ",", "field_filters", "=", "self", ".", "_field_filters", ",", "orders", "=", "self"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.offset
Skip to an offset in a query. If the current query already has specified an offset, this will overwrite it. Args: num_to_skip (int): The number of results to skip at the beginning of query results. (Must be non-negative.) Returns: ~.firestore_v1...
firestore/google/cloud/firestore_v1beta1/query.py
def offset(self, num_to_skip): """Skip to an offset in a query. If the current query already has specified an offset, this will overwrite it. Args: num_to_skip (int): The number of results to skip at the beginning of query results. (Must be non-negative.) ...
def offset(self, num_to_skip): """Skip to an offset in a query. If the current query already has specified an offset, this will overwrite it. Args: num_to_skip (int): The number of results to skip at the beginning of query results. (Must be non-negative.) ...
[ "Skip", "to", "an", "offset", "in", "a", "query", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L351-L375
[ "def", "offset", "(", "self", ",", "num_to_skip", ")", ":", "return", "self", ".", "__class__", "(", "self", ".", "_parent", ",", "projection", "=", "self", ".", "_projection", ",", "field_filters", "=", "self", ".", "_field_filters", ",", "orders", "=", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query._cursor_helper
Set values to be used for a ``start_at`` or ``end_at`` cursor. The values will later be used in a query protobuf. When the query is sent to the server, the ``document_fields`` will be used in the order given by fields set by :meth:`~.firestore_v1beta1.query.Query.order_by`. Ar...
firestore/google/cloud/firestore_v1beta1/query.py
def _cursor_helper(self, document_fields, before, start): """Set values to be used for a ``start_at`` or ``end_at`` cursor. The values will later be used in a query protobuf. When the query is sent to the server, the ``document_fields`` will be used in the order given by fields set by ...
def _cursor_helper(self, document_fields, before, start): """Set values to be used for a ``start_at`` or ``end_at`` cursor. The values will later be used in a query protobuf. When the query is sent to the server, the ``document_fields`` will be used in the order given by fields set by ...
[ "Set", "values", "to", "be", "used", "for", "a", "start_at", "or", "end_at", "cursor", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L377-L429
[ "def", "_cursor_helper", "(", "self", ",", "document_fields", ",", "before", ",", "start", ")", ":", "if", "isinstance", "(", "document_fields", ",", "tuple", ")", ":", "document_fields", "=", "list", "(", "document_fields", ")", "elif", "isinstance", "(", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.start_at
Start query results at a particular document value. The result set will **include** the document specified by ``document_fields``. If the current query already has specified a start cursor -- either via this method or :meth:`~.firestore_v1beta1.query.Query.start_after` -- this ...
firestore/google/cloud/firestore_v1beta1/query.py
def start_at(self, document_fields): """Start query results at a particular document value. The result set will **include** the document specified by ``document_fields``. If the current query already has specified a start cursor -- either via this method or :meth:`~.fir...
def start_at(self, document_fields): """Start query results at a particular document value. The result set will **include** the document specified by ``document_fields``. If the current query already has specified a start cursor -- either via this method or :meth:`~.fir...
[ "Start", "query", "results", "at", "a", "particular", "document", "value", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L431-L458
[ "def", "start_at", "(", "self", ",", "document_fields", ")", ":", "return", "self", ".", "_cursor_helper", "(", "document_fields", ",", "before", "=", "True", ",", "start", "=", "True", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.start_after
Start query results after a particular document value. The result set will **exclude** the document specified by ``document_fields``. If the current query already has specified a start cursor -- either via this method or :meth:`~.firestore_v1beta1.query.Query.start_at` -- this ...
firestore/google/cloud/firestore_v1beta1/query.py
def start_after(self, document_fields): """Start query results after a particular document value. The result set will **exclude** the document specified by ``document_fields``. If the current query already has specified a start cursor -- either via this method or :meth:...
def start_after(self, document_fields): """Start query results after a particular document value. The result set will **exclude** the document specified by ``document_fields``. If the current query already has specified a start cursor -- either via this method or :meth:...
[ "Start", "query", "results", "after", "a", "particular", "document", "value", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L460-L487
[ "def", "start_after", "(", "self", ",", "document_fields", ")", ":", "return", "self", ".", "_cursor_helper", "(", "document_fields", ",", "before", "=", "False", ",", "start", "=", "True", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.end_before
End query results before a particular document value. The result set will **exclude** the document specified by ``document_fields``. If the current query already has specified an end cursor -- either via this method or :meth:`~.firestore_v1beta1.query.Query.end_at` -- this will...
firestore/google/cloud/firestore_v1beta1/query.py
def end_before(self, document_fields): """End query results before a particular document value. The result set will **exclude** the document specified by ``document_fields``. If the current query already has specified an end cursor -- either via this method or :meth:`~....
def end_before(self, document_fields): """End query results before a particular document value. The result set will **exclude** the document specified by ``document_fields``. If the current query already has specified an end cursor -- either via this method or :meth:`~....
[ "End", "query", "results", "before", "a", "particular", "document", "value", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L489-L516
[ "def", "end_before", "(", "self", ",", "document_fields", ")", ":", "return", "self", ".", "_cursor_helper", "(", "document_fields", ",", "before", "=", "True", ",", "start", "=", "False", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.end_at
End query results at a particular document value. The result set will **include** the document specified by ``document_fields``. If the current query already has specified an end cursor -- either via this method or :meth:`~.firestore_v1beta1.query.Query.end_before` -- this will...
firestore/google/cloud/firestore_v1beta1/query.py
def end_at(self, document_fields): """End query results at a particular document value. The result set will **include** the document specified by ``document_fields``. If the current query already has specified an end cursor -- either via this method or :meth:`~.firestor...
def end_at(self, document_fields): """End query results at a particular document value. The result set will **include** the document specified by ``document_fields``. If the current query already has specified an end cursor -- either via this method or :meth:`~.firestor...
[ "End", "query", "results", "at", "a", "particular", "document", "value", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L518-L545
[ "def", "end_at", "(", "self", ",", "document_fields", ")", ":", "return", "self", ".", "_cursor_helper", "(", "document_fields", ",", "before", "=", "False", ",", "start", "=", "False", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query._filters_pb
Convert all the filters into a single generic Filter protobuf. This may be a lone field filter or unary filter, may be a composite filter or may be :data:`None`. Returns: google.cloud.firestore_v1beta1.types.\ StructuredQuery.Filter: A "generic" filter representing the ...
firestore/google/cloud/firestore_v1beta1/query.py
def _filters_pb(self): """Convert all the filters into a single generic Filter protobuf. This may be a lone field filter or unary filter, may be a composite filter or may be :data:`None`. Returns: google.cloud.firestore_v1beta1.types.\ StructuredQuery.Filter: A ...
def _filters_pb(self): """Convert all the filters into a single generic Filter protobuf. This may be a lone field filter or unary filter, may be a composite filter or may be :data:`None`. Returns: google.cloud.firestore_v1beta1.types.\ StructuredQuery.Filter: A ...
[ "Convert", "all", "the", "filters", "into", "a", "single", "generic", "Filter", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L547-L568
[ "def", "_filters_pb", "(", "self", ")", ":", "num_filters", "=", "len", "(", "self", ".", "_field_filters", ")", "if", "num_filters", "==", "0", ":", "return", "None", "elif", "num_filters", "==", "1", ":", "return", "_filter_pb", "(", "self", ".", "_fie...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query._normalize_projection
Helper: convert field paths to message.
firestore/google/cloud/firestore_v1beta1/query.py
def _normalize_projection(projection): """Helper: convert field paths to message.""" if projection is not None: fields = list(projection.fields) if not fields: field_ref = query_pb2.StructuredQuery.FieldReference( field_path="__name__" ...
def _normalize_projection(projection): """Helper: convert field paths to message.""" if projection is not None: fields = list(projection.fields) if not fields: field_ref = query_pb2.StructuredQuery.FieldReference( field_path="__name__" ...
[ "Helper", ":", "convert", "field", "paths", "to", "message", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L571-L583
[ "def", "_normalize_projection", "(", "projection", ")", ":", "if", "projection", "is", "not", "None", ":", "fields", "=", "list", "(", "projection", ".", "fields", ")", "if", "not", "fields", ":", "field_ref", "=", "query_pb2", ".", "StructuredQuery", ".", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query._normalize_orders
Helper: adjust orders based on cursors, where clauses.
firestore/google/cloud/firestore_v1beta1/query.py
def _normalize_orders(self): """Helper: adjust orders based on cursors, where clauses.""" orders = list(self._orders) _has_snapshot_cursor = False if self._start_at: if isinstance(self._start_at[0], document.DocumentSnapshot): _has_snapshot_cursor = True ...
def _normalize_orders(self): """Helper: adjust orders based on cursors, where clauses.""" orders = list(self._orders) _has_snapshot_cursor = False if self._start_at: if isinstance(self._start_at[0], document.DocumentSnapshot): _has_snapshot_cursor = True ...
[ "Helper", ":", "adjust", "orders", "based", "on", "cursors", "where", "clauses", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L585-L617
[ "def", "_normalize_orders", "(", "self", ")", ":", "orders", "=", "list", "(", "self", ".", "_orders", ")", "_has_snapshot_cursor", "=", "False", "if", "self", ".", "_start_at", ":", "if", "isinstance", "(", "self", ".", "_start_at", "[", "0", "]", ",", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query._normalize_cursor
Helper: convert cursor to a list of values based on orders.
firestore/google/cloud/firestore_v1beta1/query.py
def _normalize_cursor(self, cursor, orders): """Helper: convert cursor to a list of values based on orders.""" if cursor is None: return if not orders: raise ValueError(_NO_ORDERS_FOR_CURSOR) document_fields, before = cursor order_keys = [order.field.fi...
def _normalize_cursor(self, cursor, orders): """Helper: convert cursor to a list of values based on orders.""" if cursor is None: return if not orders: raise ValueError(_NO_ORDERS_FOR_CURSOR) document_fields, before = cursor order_keys = [order.field.fi...
[ "Helper", ":", "convert", "cursor", "to", "a", "list", "of", "values", "based", "on", "orders", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L619-L664
[ "def", "_normalize_cursor", "(", "self", ",", "cursor", ",", "orders", ")", ":", "if", "cursor", "is", "None", ":", "return", "if", "not", "orders", ":", "raise", "ValueError", "(", "_NO_ORDERS_FOR_CURSOR", ")", "document_fields", ",", "before", "=", "cursor...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query._to_protobuf
Convert the current query into the equivalent protobuf. Returns: google.cloud.firestore_v1beta1.types.StructuredQuery: The query protobuf.
firestore/google/cloud/firestore_v1beta1/query.py
def _to_protobuf(self): """Convert the current query into the equivalent protobuf. Returns: google.cloud.firestore_v1beta1.types.StructuredQuery: The query protobuf. """ projection = self._normalize_projection(self._projection) orders = self._normalize_or...
def _to_protobuf(self): """Convert the current query into the equivalent protobuf. Returns: google.cloud.firestore_v1beta1.types.StructuredQuery: The query protobuf. """ projection = self._normalize_projection(self._projection) orders = self._normalize_or...
[ "Convert", "the", "current", "query", "into", "the", "equivalent", "protobuf", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L666-L695
[ "def", "_to_protobuf", "(", "self", ")", ":", "projection", "=", "self", ".", "_normalize_projection", "(", "self", ".", "_projection", ")", "orders", "=", "self", ".", "_normalize_orders", "(", ")", "start_at", "=", "self", ".", "_normalize_cursor", "(", "s...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.get
Deprecated alias for :meth:`stream`.
firestore/google/cloud/firestore_v1beta1/query.py
def get(self, transaction=None): """Deprecated alias for :meth:`stream`.""" warnings.warn( "'Query.get' is deprecated: please use 'Query.stream' instead.", DeprecationWarning, stacklevel=2, ) return self.stream(transaction=transaction)
def get(self, transaction=None): """Deprecated alias for :meth:`stream`.""" warnings.warn( "'Query.get' is deprecated: please use 'Query.stream' instead.", DeprecationWarning, stacklevel=2, ) return self.stream(transaction=transaction)
[ "Deprecated", "alias", "for", ":", "meth", ":", "stream", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L697-L704
[ "def", "get", "(", "self", ",", "transaction", "=", "None", ")", ":", "warnings", ".", "warn", "(", "\"'Query.get' is deprecated: please use 'Query.stream' instead.\"", ",", "DeprecationWarning", ",", "stacklevel", "=", "2", ",", ")", "return", "self", ".", "stre...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.stream
Read the documents in the collection that match this query. This sends a ``RunQuery`` RPC and then returns an iterator which consumes each document returned in the stream of ``RunQueryResponse`` messages. .. note:: The underlying stream of responses will time out after ...
firestore/google/cloud/firestore_v1beta1/query.py
def stream(self, transaction=None): """Read the documents in the collection that match this query. This sends a ``RunQuery`` RPC and then returns an iterator which consumes each document returned in the stream of ``RunQueryResponse`` messages. .. note:: The underlyi...
def stream(self, transaction=None): """Read the documents in the collection that match this query. This sends a ``RunQuery`` RPC and then returns an iterator which consumes each document returned in the stream of ``RunQueryResponse`` messages. .. note:: The underlyi...
[ "Read", "the", "documents", "in", "the", "collection", "that", "match", "this", "query", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L706-L746
[ "def", "stream", "(", "self", ",", "transaction", "=", "None", ")", ":", "parent_path", ",", "expected_prefix", "=", "self", ".", "_parent", ".", "_parent_info", "(", ")", "response_iterator", "=", "self", ".", "_client", ".", "_firestore_api", ".", "run_que...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Query.on_snapshot
Monitor the documents in this collection that match this query. This starts a watch on this query using a background thread. The provided callback is run on the snapshot of the documents. Args: callback(~.firestore.query.QuerySnapshot): a callback to run when a chan...
firestore/google/cloud/firestore_v1beta1/query.py
def on_snapshot(self, callback): """Monitor the documents in this collection that match this query. This starts a watch on this query using a background thread. The provided callback is run on the snapshot of the documents. Args: callback(~.firestore.query.QuerySnapshot): a...
def on_snapshot(self, callback): """Monitor the documents in this collection that match this query. This starts a watch on this query using a background thread. The provided callback is run on the snapshot of the documents. Args: callback(~.firestore.query.QuerySnapshot): a...
[ "Monitor", "the", "documents", "in", "this", "collection", "that", "match", "this", "query", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L748-L776
[ "def", "on_snapshot", "(", "self", ",", "callback", ")", ":", "return", "Watch", ".", "for_query", "(", "self", ",", "callback", ",", "document", ".", "DocumentSnapshot", ",", "document", ".", "DocumentReference", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_get_model_reference
Constructs a ModelReference. Args: model_id (str): the ID of the model. Returns: google.cloud.bigquery.model.ModelReference: A ModelReference for a model in this dataset.
bigquery/google/cloud/bigquery/dataset.py
def _get_model_reference(self, model_id): """Constructs a ModelReference. Args: model_id (str): the ID of the model. Returns: google.cloud.bigquery.model.ModelReference: A ModelReference for a model in this dataset. """ return ModelReference.from_api_repr( {"pro...
def _get_model_reference(self, model_id): """Constructs a ModelReference. Args: model_id (str): the ID of the model. Returns: google.cloud.bigquery.model.ModelReference: A ModelReference for a model in this dataset. """ return ModelReference.from_api_repr( {"pro...
[ "Constructs", "a", "ModelReference", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L41-L53
[ "def", "_get_model_reference", "(", "self", ",", "model_id", ")", ":", "return", "ModelReference", ".", "from_api_repr", "(", "{", "\"projectId\"", ":", "self", ".", "project", ",", "\"datasetId\"", ":", "self", ".", "dataset_id", ",", "\"modelId\"", ":", "mod...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AccessEntry.to_api_repr
Construct the API resource representation of this access entry Returns: Dict[str, object]: Access entry represented as an API resource
bigquery/google/cloud/bigquery/dataset.py
def to_api_repr(self): """Construct the API resource representation of this access entry Returns: Dict[str, object]: Access entry represented as an API resource """ resource = {self.entity_type: self.entity_id} if self.role is not None: resource["role"] =...
def to_api_repr(self): """Construct the API resource representation of this access entry Returns: Dict[str, object]: Access entry represented as an API resource """ resource = {self.entity_type: self.entity_id} if self.role is not None: resource["role"] =...
[ "Construct", "the", "API", "resource", "representation", "of", "this", "access", "entry" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L150-L159
[ "def", "to_api_repr", "(", "self", ")", ":", "resource", "=", "{", "self", ".", "entity_type", ":", "self", ".", "entity_id", "}", "if", "self", ".", "role", "is", "not", "None", ":", "resource", "[", "\"role\"", "]", "=", "self", ".", "role", "retur...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
AccessEntry.from_api_repr
Factory: construct an access entry given its API representation Args: resource (Dict[str, object]): Access entry resource representation returned from the API Returns: google.cloud.bigquery.dataset.AccessEntry: Access entry parsed from ``resource...
bigquery/google/cloud/bigquery/dataset.py
def from_api_repr(cls, resource): """Factory: construct an access entry given its API representation Args: resource (Dict[str, object]): Access entry resource representation returned from the API Returns: google.cloud.bigquery.dataset.AccessEntry: ...
def from_api_repr(cls, resource): """Factory: construct an access entry given its API representation Args: resource (Dict[str, object]): Access entry resource representation returned from the API Returns: google.cloud.bigquery.dataset.AccessEntry: ...
[ "Factory", ":", "construct", "an", "access", "entry", "given", "its", "API", "representation" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L162-L183
[ "def", "from_api_repr", "(", "cls", ",", "resource", ")", ":", "entry", "=", "resource", ".", "copy", "(", ")", "role", "=", "entry", ".", "pop", "(", "\"role\"", ",", "None", ")", "entity_type", ",", "entity_id", "=", "entry", ".", "popitem", "(", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
DatasetReference.from_api_repr
Factory: construct a dataset reference given its API representation Args: resource (Dict[str, str]): Dataset reference resource representation returned from the API Returns: google.cloud.bigquery.dataset.DatasetReference: Dataset reference parsed...
bigquery/google/cloud/bigquery/dataset.py
def from_api_repr(cls, resource): """Factory: construct a dataset reference given its API representation Args: resource (Dict[str, str]): Dataset reference resource representation returned from the API Returns: google.cloud.bigquery.dataset.DatasetRefere...
def from_api_repr(cls, resource): """Factory: construct a dataset reference given its API representation Args: resource (Dict[str, str]): Dataset reference resource representation returned from the API Returns: google.cloud.bigquery.dataset.DatasetRefere...
[ "Factory", ":", "construct", "a", "dataset", "reference", "given", "its", "API", "representation" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L228-L241
[ "def", "from_api_repr", "(", "cls", ",", "resource", ")", ":", "project", "=", "resource", "[", "\"projectId\"", "]", "dataset_id", "=", "resource", "[", "\"datasetId\"", "]", "return", "cls", "(", "project", ",", "dataset_id", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
DatasetReference.from_string
Construct a dataset reference from dataset ID string. Args: dataset_id (str): A dataset ID in standard SQL format. If ``default_project`` is not specified, this must included both the project ID and the dataset ID, separated by ``.``. defa...
bigquery/google/cloud/bigquery/dataset.py
def from_string(cls, dataset_id, default_project=None): """Construct a dataset reference from dataset ID string. Args: dataset_id (str): A dataset ID in standard SQL format. If ``default_project`` is not specified, this must included both the project ID and ...
def from_string(cls, dataset_id, default_project=None): """Construct a dataset reference from dataset ID string. Args: dataset_id (str): A dataset ID in standard SQL format. If ``default_project`` is not specified, this must included both the project ID and ...
[ "Construct", "a", "dataset", "reference", "from", "dataset", "ID", "string", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L244-L288
[ "def", "from_string", "(", "cls", ",", "dataset_id", ",", "default_project", "=", "None", ")", ":", "output_dataset_id", "=", "dataset_id", "output_project_id", "=", "default_project", "parts", "=", "dataset_id", ".", "split", "(", "\".\"", ")", "if", "len", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Dataset.access_entries
List[google.cloud.bigquery.dataset.AccessEntry]: Dataset's access entries. ``role`` augments the entity type and must be present **unless** the entity type is ``view``. Raises: TypeError: If 'value' is not a sequence ValueError: If any item in th...
bigquery/google/cloud/bigquery/dataset.py
def access_entries(self): """List[google.cloud.bigquery.dataset.AccessEntry]: Dataset's access entries. ``role`` augments the entity type and must be present **unless** the entity type is ``view``. Raises: TypeError: If 'value' is not a sequence ValueErr...
def access_entries(self): """List[google.cloud.bigquery.dataset.AccessEntry]: Dataset's access entries. ``role`` augments the entity type and must be present **unless** the entity type is ``view``. Raises: TypeError: If 'value' is not a sequence ValueErr...
[ "List", "[", "google", ".", "cloud", ".", "bigquery", ".", "dataset", ".", "AccessEntry", "]", ":", "Dataset", "s", "access", "entries", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L362-L376
[ "def", "access_entries", "(", "self", ")", ":", "entries", "=", "self", ".", "_properties", ".", "get", "(", "\"access\"", ",", "[", "]", ")", "return", "[", "AccessEntry", ".", "from_api_repr", "(", "entry", ")", "for", "entry", "in", "entries", "]" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Dataset.created
Union[datetime.datetime, None]: Datetime at which the dataset was created (:data:`None` until set from the server).
bigquery/google/cloud/bigquery/dataset.py
def created(self): """Union[datetime.datetime, None]: Datetime at which the dataset was created (:data:`None` until set from the server). """ creation_time = self._properties.get("creationTime") if creation_time is not None: # creation_time will be in milliseconds. ...
def created(self): """Union[datetime.datetime, None]: Datetime at which the dataset was created (:data:`None` until set from the server). """ creation_time = self._properties.get("creationTime") if creation_time is not None: # creation_time will be in milliseconds. ...
[ "Union", "[", "datetime", ".", "datetime", "None", "]", ":", "Datetime", "at", "which", "the", "dataset", "was", "created", "(", ":", "data", ":", "None", "until", "set", "from", "the", "server", ")", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L386-L395
[ "def", "created", "(", "self", ")", ":", "creation_time", "=", "self", ".", "_properties", ".", "get", "(", "\"creationTime\"", ")", "if", "creation_time", "is", "not", "None", ":", "# creation_time will be in milliseconds.", "return", "google", ".", "cloud", "....
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Dataset.modified
Union[datetime.datetime, None]: Datetime at which the dataset was last modified (:data:`None` until set from the server).
bigquery/google/cloud/bigquery/dataset.py
def modified(self): """Union[datetime.datetime, None]: Datetime at which the dataset was last modified (:data:`None` until set from the server). """ modified_time = self._properties.get("lastModifiedTime") if modified_time is not None: # modified_time will be in milli...
def modified(self): """Union[datetime.datetime, None]: Datetime at which the dataset was last modified (:data:`None` until set from the server). """ modified_time = self._properties.get("lastModifiedTime") if modified_time is not None: # modified_time will be in milli...
[ "Union", "[", "datetime", ".", "datetime", "None", "]", ":", "Datetime", "at", "which", "the", "dataset", "was", "last", "modified", "(", ":", "data", ":", "None", "until", "set", "from", "the", "server", ")", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L426-L435
[ "def", "modified", "(", "self", ")", ":", "modified_time", "=", "self", ".", "_properties", ".", "get", "(", "\"lastModifiedTime\"", ")", "if", "modified_time", "is", "not", "None", ":", "# modified_time will be in milliseconds.", "return", "google", ".", "cloud",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Dataset.from_api_repr
Factory: construct a dataset given its API representation Args: resource (Dict[str: object]): Dataset resource representation returned from the API Returns: google.cloud.bigquery.dataset.Dataset: Dataset parsed from ``resource``.
bigquery/google/cloud/bigquery/dataset.py
def from_api_repr(cls, resource): """Factory: construct a dataset given its API representation Args: resource (Dict[str: object]): Dataset resource representation returned from the API Returns: google.cloud.bigquery.dataset.Dataset: Datas...
def from_api_repr(cls, resource): """Factory: construct a dataset given its API representation Args: resource (Dict[str: object]): Dataset resource representation returned from the API Returns: google.cloud.bigquery.dataset.Dataset: Datas...
[ "Factory", ":", "construct", "a", "dataset", "given", "its", "API", "representation" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L553-L576
[ "def", "from_api_repr", "(", "cls", ",", "resource", ")", ":", "if", "(", "\"datasetReference\"", "not", "in", "resource", "or", "\"datasetId\"", "not", "in", "resource", "[", "\"datasetReference\"", "]", ")", ":", "raise", "KeyError", "(", "\"Resource lacks req...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_blobs_page_start
Grab prefixes after a :class:`~google.cloud.iterator.Page` started. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type page: :class:`~google.cloud.api.core.page_iterator.Page` :param page: The page that was just created. ...
storage/google/cloud/storage/bucket.py
def _blobs_page_start(iterator, page, response): """Grab prefixes after a :class:`~google.cloud.iterator.Page` started. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type page: :class:`~google.cloud.api.core.page_iterator.Page...
def _blobs_page_start(iterator, page, response): """Grab prefixes after a :class:`~google.cloud.iterator.Page` started. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type page: :class:`~google.cloud.api.core.page_iterator.Page...
[ "Grab", "prefixes", "after", "a", ":", "class", ":", "~google", ".", "cloud", ".", "iterator", ".", "Page", "started", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L53-L66
[ "def", "_blobs_page_start", "(", "iterator", ",", "page", ",", "response", ")", ":", "page", ".", "prefixes", "=", "tuple", "(", "response", ".", "get", "(", "\"prefixes\"", ",", "(", ")", ")", ")", "iterator", ".", "prefixes", ".", "update", "(", "pag...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
_item_to_blob
Convert a JSON blob to the native object. .. note:: This assumes that the ``bucket`` attribute has been added to the iterator after being created. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that has retrieved the item. :type item: d...
storage/google/cloud/storage/bucket.py
def _item_to_blob(iterator, item): """Convert a JSON blob to the native object. .. note:: This assumes that the ``bucket`` attribute has been added to the iterator after being created. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that ...
def _item_to_blob(iterator, item): """Convert a JSON blob to the native object. .. note:: This assumes that the ``bucket`` attribute has been added to the iterator after being created. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that ...
[ "Convert", "a", "JSON", "blob", "to", "the", "native", "object", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L69-L89
[ "def", "_item_to_blob", "(", "iterator", ",", "item", ")", ":", "name", "=", "item", ".", "get", "(", "\"name\"", ")", "blob", "=", "Blob", "(", "name", ",", "bucket", "=", "iterator", ".", "bucket", ")", "blob", ".", "_set_properties", "(", "item", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
LifecycleRuleSetStorageClass.from_api_repr
Factory: construct instance from resource. :type resource: dict :param resource: mapping as returned from API call. :rtype: :class:`LifecycleRuleDelete` :returns: Instance created from resource.
storage/google/cloud/storage/bucket.py
def from_api_repr(cls, resource): """Factory: construct instance from resource. :type resource: dict :param resource: mapping as returned from API call. :rtype: :class:`LifecycleRuleDelete` :returns: Instance created from resource. """ action = resource["action...
def from_api_repr(cls, resource): """Factory: construct instance from resource. :type resource: dict :param resource: mapping as returned from API call. :rtype: :class:`LifecycleRuleDelete` :returns: Instance created from resource. """ action = resource["action...
[ "Factory", ":", "construct", "instance", "from", "resource", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L262-L274
[ "def", "from_api_repr", "(", "cls", ",", "resource", ")", ":", "action", "=", "resource", "[", "\"action\"", "]", "instance", "=", "cls", "(", "action", "[", "\"storageClass\"", "]", ",", "_factory", "=", "True", ")", "instance", ".", "update", "(", "res...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IAMConfiguration.from_api_repr
Factory: construct instance from resource. :type bucket: :class:`Bucket` :params bucket: Bucket for which this instance is the policy. :type resource: dict :param resource: mapping as returned from API call. :rtype: :class:`IAMConfiguration` :returns: Instance created...
storage/google/cloud/storage/bucket.py
def from_api_repr(cls, resource, bucket): """Factory: construct instance from resource. :type bucket: :class:`Bucket` :params bucket: Bucket for which this instance is the policy. :type resource: dict :param resource: mapping as returned from API call. :rtype: :class:...
def from_api_repr(cls, resource, bucket): """Factory: construct instance from resource. :type bucket: :class:`Bucket` :params bucket: Bucket for which this instance is the policy. :type resource: dict :param resource: mapping as returned from API call. :rtype: :class:...
[ "Factory", ":", "construct", "instance", "from", "resource", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L305-L319
[ "def", "from_api_repr", "(", "cls", ",", "resource", ",", "bucket", ")", ":", "instance", "=", "cls", "(", "bucket", ")", "instance", ".", "update", "(", "resource", ")", "return", "instance" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
IAMConfiguration.bucket_policy_only_locked_time
Deadline for changing :attr:`bucket_policy_only_enabled` from true to false. If the bucket's :attr:`bucket_policy_only_enabled` is true, this property is time time after which that setting becomes immutable. If the bucket's :attr:`bucket_policy_only_enabled` is false, this property is ...
storage/google/cloud/storage/bucket.py
def bucket_policy_only_locked_time(self): """Deadline for changing :attr:`bucket_policy_only_enabled` from true to false. If the bucket's :attr:`bucket_policy_only_enabled` is true, this property is time time after which that setting becomes immutable. If the bucket's :attr:`bucket_pol...
def bucket_policy_only_locked_time(self): """Deadline for changing :attr:`bucket_policy_only_enabled` from true to false. If the bucket's :attr:`bucket_policy_only_enabled` is true, this property is time time after which that setting becomes immutable. If the bucket's :attr:`bucket_pol...
[ "Deadline", "for", "changing", ":", "attr", ":", "bucket_policy_only_enabled", "from", "true", "to", "false", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L347-L364
[ "def", "bucket_policy_only_locked_time", "(", "self", ")", ":", "bpo", "=", "self", ".", "get", "(", "\"bucketPolicyOnly\"", ",", "{", "}", ")", "stamp", "=", "bpo", ".", "get", "(", "\"lockedTime\"", ")", "if", "stamp", "is", "not", "None", ":", "stamp"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket._set_properties
Set the properties for the current object. :type value: dict or :class:`google.cloud.storage.batch._FutureDict` :param value: The properties to be set.
storage/google/cloud/storage/bucket.py
def _set_properties(self, value): """Set the properties for the current object. :type value: dict or :class:`google.cloud.storage.batch._FutureDict` :param value: The properties to be set. """ self._label_removals.clear() return super(Bucket, self)._set_properties(value)
def _set_properties(self, value): """Set the properties for the current object. :type value: dict or :class:`google.cloud.storage.batch._FutureDict` :param value: The properties to be set. """ self._label_removals.clear() return super(Bucket, self)._set_properties(value)
[ "Set", "the", "properties", "for", "the", "current", "object", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L421-L428
[ "def", "_set_properties", "(", "self", ",", "value", ")", ":", "self", ".", "_label_removals", ".", "clear", "(", ")", "return", "super", "(", "Bucket", ",", "self", ")", ".", "_set_properties", "(", "value", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.blob
Factory constructor for blob object. .. note:: This will not make an HTTP request; it simply instantiates a blob object owned by this bucket. :type blob_name: str :param blob_name: The name of the blob to be instantiated. :type chunk_size: int :param chunk_...
storage/google/cloud/storage/bucket.py
def blob( self, blob_name, chunk_size=None, encryption_key=None, kms_key_name=None, generation=None, ): """Factory constructor for blob object. .. note:: This will not make an HTTP request; it simply instantiates a blob object owne...
def blob( self, blob_name, chunk_size=None, encryption_key=None, kms_key_name=None, generation=None, ): """Factory constructor for blob object. .. note:: This will not make an HTTP request; it simply instantiates a blob object owne...
[ "Factory", "constructor", "for", "blob", "object", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L440-L484
[ "def", "blob", "(", "self", ",", "blob_name", ",", "chunk_size", "=", "None", ",", "encryption_key", "=", "None", ",", "kms_key_name", "=", "None", ",", "generation", "=", "None", ",", ")", ":", "return", "Blob", "(", "name", "=", "blob_name", ",", "bu...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.notification
Factory: create a notification resource for the bucket. See: :class:`.BucketNotification` for parameters. :rtype: :class:`.BucketNotification`
storage/google/cloud/storage/bucket.py
def notification( self, topic_name, topic_project=None, custom_attributes=None, event_types=None, blob_name_prefix=None, payload_format=NONE_PAYLOAD_FORMAT, ): """Factory: create a notification resource for the bucket. See: :class:`.BucketNot...
def notification( self, topic_name, topic_project=None, custom_attributes=None, event_types=None, blob_name_prefix=None, payload_format=NONE_PAYLOAD_FORMAT, ): """Factory: create a notification resource for the bucket. See: :class:`.BucketNot...
[ "Factory", ":", "create", "a", "notification", "resource", "for", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L486-L509
[ "def", "notification", "(", "self", ",", "topic_name", ",", "topic_project", "=", "None", ",", "custom_attributes", "=", "None", ",", "event_types", "=", "None", ",", "blob_name_prefix", "=", "None", ",", "payload_format", "=", "NONE_PAYLOAD_FORMAT", ",", ")", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.create
Creates current bucket. If the bucket already exists, will raise :class:`google.cloud.exceptions.Conflict`. This implements "storage.buckets.insert". If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Clie...
storage/google/cloud/storage/bucket.py
def create(self, client=None, project=None, location=None): """Creates current bucket. If the bucket already exists, will raise :class:`google.cloud.exceptions.Conflict`. This implements "storage.buckets.insert". If :attr:`user_project` is set, bills the API request to that pr...
def create(self, client=None, project=None, location=None): """Creates current bucket. If the bucket already exists, will raise :class:`google.cloud.exceptions.Conflict`. This implements "storage.buckets.insert". If :attr:`user_project` is set, bills the API request to that pr...
[ "Creates", "current", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L548-L601
[ "def", "create", "(", "self", ",", "client", "=", "None", ",", "project", "=", "None", ",", "location", "=", "None", ")", ":", "if", "self", ".", "user_project", "is", "not", "None", ":", "raise", "ValueError", "(", "\"Cannot create bucket with 'user_project...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.patch
Sends all changed properties in a PATCH request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :par...
storage/google/cloud/storage/bucket.py
def patch(self, client=None): """Sends all changed properties in a PATCH request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
def patch(self, client=None): """Sends all changed properties in a PATCH request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
[ "Sends", "all", "changed", "properties", "in", "a", "PATCH", "request", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L603-L624
[ "def", "patch", "(", "self", ",", "client", "=", "None", ")", ":", "# Special case: For buckets, it is possible that labels are being", "# removed; this requires special handling.", "if", "self", ".", "_label_removals", ":", "self", ".", "_changes", ".", "add", "(", "\"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.get_blob
Get a blob object by name. This will return None if the blob doesn't exist: .. literalinclude:: snippets.py :start-after: [START get_blob] :end-before: [END get_blob] If :attr:`user_project` is set, bills the API request to that project. :type blob_name: str ...
storage/google/cloud/storage/bucket.py
def get_blob( self, blob_name, client=None, encryption_key=None, generation=None, **kwargs ): """Get a blob object by name. This will return None if the blob doesn't exist: .. literalinclude:: snippets.py :start-after: [START get_blob] :end-before: [END get_blob...
def get_blob( self, blob_name, client=None, encryption_key=None, generation=None, **kwargs ): """Get a blob object by name. This will return None if the blob doesn't exist: .. literalinclude:: snippets.py :start-after: [START get_blob] :end-before: [END get_blob...
[ "Get", "a", "blob", "object", "by", "name", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L656-L709
[ "def", "get_blob", "(", "self", ",", "blob_name", ",", "client", "=", "None", ",", "encryption_key", "=", "None", ",", "generation", "=", "None", ",", "*", "*", "kwargs", ")", ":", "blob", "=", "Blob", "(", "bucket", "=", "self", ",", "name", "=", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.list_blobs
Return an iterator used to find blobs in the bucket. If :attr:`user_project` is set, bills the API request to that project. :type max_results: int :param max_results: (Optional) The maximum number of blobs in each page of results from this request. Non-positive values a...
storage/google/cloud/storage/bucket.py
def list_blobs( self, max_results=None, page_token=None, prefix=None, delimiter=None, versions=None, projection="noAcl", fields=None, client=None, ): """Return an iterator used to find blobs in the bucket. If :attr:`user_projec...
def list_blobs( self, max_results=None, page_token=None, prefix=None, delimiter=None, versions=None, projection="noAcl", fields=None, client=None, ): """Return an iterator used to find blobs in the bucket. If :attr:`user_projec...
[ "Return", "an", "iterator", "used", "to", "find", "blobs", "in", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L711-L802
[ "def", "list_blobs", "(", "self", ",", "max_results", "=", "None", ",", "page_token", "=", "None", ",", "prefix", "=", "None", ",", "delimiter", "=", "None", ",", "versions", "=", "None", ",", "projection", "=", "\"noAcl\"", ",", "fields", "=", "None", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.list_notifications
List Pub / Sub notifications for this bucket. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/list If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType...
storage/google/cloud/storage/bucket.py
def list_notifications(self, client=None): """List Pub / Sub notifications for this bucket. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/list If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.stor...
def list_notifications(self, client=None): """List Pub / Sub notifications for this bucket. See: https://cloud.google.com/storage/docs/json_api/v1/notifications/list If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.stor...
[ "List", "Pub", "/", "Sub", "notifications", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L804-L829
[ "def", "list_notifications", "(", "self", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "path", "=", "self", ".", "path", "+", "\"/notificationConfigs\"", "iterator", "=", "page_iterator", ".", "HTTP...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.delete
Delete this bucket. The bucket **must** be empty in order to submit a delete request. If ``force=True`` is passed, this will first attempt to delete all the objects / blobs in the bucket (i.e. try to empty the bucket). If the bucket doesn't exist, this will raise :class:`google...
storage/google/cloud/storage/bucket.py
def delete(self, force=False, client=None): """Delete this bucket. The bucket **must** be empty in order to submit a delete request. If ``force=True`` is passed, this will first attempt to delete all the objects / blobs in the bucket (i.e. try to empty the bucket). If the bucke...
def delete(self, force=False, client=None): """Delete this bucket. The bucket **must** be empty in order to submit a delete request. If ``force=True`` is passed, this will first attempt to delete all the objects / blobs in the bucket (i.e. try to empty the bucket). If the bucke...
[ "Delete", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L831-L893
[ "def", "delete", "(", "self", ",", "force", "=", "False", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "{", "}", "if", "self", ".", "user_project", "is", "not", "None", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.delete_blob
Deletes a blob from the current bucket. If the blob isn't found (backend 404), raises a :class:`google.cloud.exceptions.NotFound`. For example: .. literalinclude:: snippets.py :start-after: [START delete_blob] :end-before: [END delete_blob] If :attr:`user_...
storage/google/cloud/storage/bucket.py
def delete_blob(self, blob_name, client=None, generation=None): """Deletes a blob from the current bucket. If the blob isn't found (backend 404), raises a :class:`google.cloud.exceptions.NotFound`. For example: .. literalinclude:: snippets.py :start-after: [START del...
def delete_blob(self, blob_name, client=None, generation=None): """Deletes a blob from the current bucket. If the blob isn't found (backend 404), raises a :class:`google.cloud.exceptions.NotFound`. For example: .. literalinclude:: snippets.py :start-after: [START del...
[ "Deletes", "a", "blob", "from", "the", "current", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L895-L941
[ "def", "delete_blob", "(", "self", ",", "blob_name", ",", "client", "=", "None", ",", "generation", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "blob", "=", "Blob", "(", "blob_name", ",", "bucket", "=", "se...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.delete_blobs
Deletes a list of blobs from the current bucket. Uses :meth:`delete_blob` to delete each individual blob. If :attr:`user_project` is set, bills the API request to that project. :type blobs: list :param blobs: A list of :class:`~google.cloud.storage.blob.Blob`-s or ...
storage/google/cloud/storage/bucket.py
def delete_blobs(self, blobs, on_error=None, client=None): """Deletes a list of blobs from the current bucket. Uses :meth:`delete_blob` to delete each individual blob. If :attr:`user_project` is set, bills the API request to that project. :type blobs: list :param blobs: A list...
def delete_blobs(self, blobs, on_error=None, client=None): """Deletes a list of blobs from the current bucket. Uses :meth:`delete_blob` to delete each individual blob. If :attr:`user_project` is set, bills the API request to that project. :type blobs: list :param blobs: A list...
[ "Deletes", "a", "list", "of", "blobs", "from", "the", "current", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L943-L977
[ "def", "delete_blobs", "(", "self", ",", "blobs", ",", "on_error", "=", "None", ",", "client", "=", "None", ")", ":", "for", "blob", "in", "blobs", ":", "try", ":", "blob_name", "=", "blob", "if", "not", "isinstance", "(", "blob_name", ",", "six", "....
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.copy_blob
Copy the given blob to the given bucket, optionally with a new name. If :attr:`user_project` is set, bills the API request to that project. :type blob: :class:`google.cloud.storage.blob.Blob` :param blob: The blob to be copied. :type destination_bucket: :class:`google.cloud.storage.bu...
storage/google/cloud/storage/bucket.py
def copy_blob( self, blob, destination_bucket, new_name=None, client=None, preserve_acl=True, source_generation=None, ): """Copy the given blob to the given bucket, optionally with a new name. If :attr:`user_project` is set, bills the API requ...
def copy_blob( self, blob, destination_bucket, new_name=None, client=None, preserve_acl=True, source_generation=None, ): """Copy the given blob to the given bucket, optionally with a new name. If :attr:`user_project` is set, bills the API requ...
[ "Copy", "the", "given", "blob", "to", "the", "given", "bucket", "optionally", "with", "a", "new", "name", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L979-L1043
[ "def", "copy_blob", "(", "self", ",", "blob", ",", "destination_bucket", ",", "new_name", "=", "None", ",", "client", "=", "None", ",", "preserve_acl", "=", "True", ",", "source_generation", "=", "None", ",", ")", ":", "client", "=", "self", ".", "_requi...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.rename_blob
Rename the given blob using copy and delete operations. If :attr:`user_project` is set, bills the API request to that project. Effectively, copies blob to the same bucket with a new name, then deletes the blob. .. warning:: This method will first duplicate the data and then...
storage/google/cloud/storage/bucket.py
def rename_blob(self, blob, new_name, client=None): """Rename the given blob using copy and delete operations. If :attr:`user_project` is set, bills the API request to that project. Effectively, copies blob to the same bucket with a new name, then deletes the blob. .. warning:...
def rename_blob(self, blob, new_name, client=None): """Rename the given blob using copy and delete operations. If :attr:`user_project` is set, bills the API request to that project. Effectively, copies blob to the same bucket with a new name, then deletes the blob. .. warning:...
[ "Rename", "the", "given", "blob", "using", "copy", "and", "delete", "operations", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1045-L1080
[ "def", "rename_blob", "(", "self", ",", "blob", ",", "new_name", ",", "client", "=", "None", ")", ":", "same_name", "=", "blob", ".", "name", "==", "new_name", "new_blob", "=", "self", ".", "copy_blob", "(", "blob", ",", "self", ",", "new_name", ",", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.default_kms_key_name
Set default KMS encryption key for objects in the bucket. :type value: str or None :param value: new KMS key name (None to clear any existing key).
storage/google/cloud/storage/bucket.py
def default_kms_key_name(self, value): """Set default KMS encryption key for objects in the bucket. :type value: str or None :param value: new KMS key name (None to clear any existing key). """ encryption_config = self._properties.get("encryption", {}) encryption_config[...
def default_kms_key_name(self, value): """Set default KMS encryption key for objects in the bucket. :type value: str or None :param value: new KMS key name (None to clear any existing key). """ encryption_config = self._properties.get("encryption", {}) encryption_config[...
[ "Set", "default", "KMS", "encryption", "key", "for", "objects", "in", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1154-L1162
[ "def", "default_kms_key_name", "(", "self", ",", "value", ")", ":", "encryption_config", "=", "self", ".", "_properties", ".", "get", "(", "\"encryption\"", ",", "{", "}", ")", "encryption_config", "[", "\"defaultKmsKeyName\"", "]", "=", "value", "self", ".", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.labels
Retrieve or set labels assigned to this bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets#labels .. note:: The getter for this property returns a dict which is a *copy* of the bucket's labels. Mutating that dict has no effect unless you th...
storage/google/cloud/storage/bucket.py
def labels(self): """Retrieve or set labels assigned to this bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets#labels .. note:: The getter for this property returns a dict which is a *copy* of the bucket's labels. Mutating that dict has no ef...
def labels(self): """Retrieve or set labels assigned to this bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets#labels .. note:: The getter for this property returns a dict which is a *copy* of the bucket's labels. Mutating that dict has no ef...
[ "Retrieve", "or", "set", "labels", "assigned", "to", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1165-L1192
[ "def", "labels", "(", "self", ")", ":", "labels", "=", "self", ".", "_properties", ".", "get", "(", "\"labels\"", ")", "if", "labels", "is", "None", ":", "return", "{", "}", "return", "copy", ".", "deepcopy", "(", "labels", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.labels
Set labels assigned to this bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets#labels :type mapping: :class:`dict` :param mapping: Name-value pairs (string->string) labelling the bucket.
storage/google/cloud/storage/bucket.py
def labels(self, mapping): """Set labels assigned to this bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets#labels :type mapping: :class:`dict` :param mapping: Name-value pairs (string->string) labelling the bucket. """ # If any labels have b...
def labels(self, mapping): """Set labels assigned to this bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets#labels :type mapping: :class:`dict` :param mapping: Name-value pairs (string->string) labelling the bucket. """ # If any labels have b...
[ "Set", "labels", "assigned", "to", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1195-L1211
[ "def", "labels", "(", "self", ",", "mapping", ")", ":", "# If any labels have been expressly removed, we need to track this", "# so that a future .patch() call can do the correct thing.", "existing", "=", "set", "(", "[", "k", "for", "k", "in", "self", ".", "labels", ".",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.iam_configuration
Retrieve IAM configuration for this bucket. :rtype: :class:`IAMConfiguration` :returns: an instance for managing the bucket's IAM configuration.
storage/google/cloud/storage/bucket.py
def iam_configuration(self): """Retrieve IAM configuration for this bucket. :rtype: :class:`IAMConfiguration` :returns: an instance for managing the bucket's IAM configuration. """ info = self._properties.get("iamConfiguration", {}) return IAMConfiguration.from_api_repr(...
def iam_configuration(self): """Retrieve IAM configuration for this bucket. :rtype: :class:`IAMConfiguration` :returns: an instance for managing the bucket's IAM configuration. """ info = self._properties.get("iamConfiguration", {}) return IAMConfiguration.from_api_repr(...
[ "Retrieve", "IAM", "configuration", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1239-L1246
[ "def", "iam_configuration", "(", "self", ")", ":", "info", "=", "self", ".", "_properties", ".", "get", "(", "\"iamConfiguration\"", ",", "{", "}", ")", "return", "IAMConfiguration", ".", "from_api_repr", "(", "info", ",", "self", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.lifecycle_rules
Retrieve or set lifecycle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. note:: The getter for this property returns a list which contains *copies* of the bucket'...
storage/google/cloud/storage/bucket.py
def lifecycle_rules(self): """Retrieve or set lifecycle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. note:: The getter for this property returns a list which conta...
def lifecycle_rules(self): """Retrieve or set lifecycle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. note:: The getter for this property returns a list which conta...
[ "Retrieve", "or", "set", "lifecycle", "rules", "configured", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1249-L1283
[ "def", "lifecycle_rules", "(", "self", ")", ":", "info", "=", "self", ".", "_properties", ".", "get", "(", "\"lifecycle\"", ",", "{", "}", ")", "for", "rule", "in", "info", ".", "get", "(", "\"rule\"", ",", "(", ")", ")", ":", "action_type", "=", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.lifecycle_rules
Set lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets :type entries: list of dictionaries :param entries: A sequence of mappings describing each lifecycle rule.
storage/google/cloud/storage/bucket.py
def lifecycle_rules(self, rules): """Set lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets :type entries: list of dictionaries :param entries: A sequence of mappings...
def lifecycle_rules(self, rules): """Set lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets :type entries: list of dictionaries :param entries: A sequence of mappings...
[ "Set", "lifestyle", "rules", "configured", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1286-L1296
[ "def", "lifecycle_rules", "(", "self", ",", "rules", ")", ":", "rules", "=", "[", "dict", "(", "rule", ")", "for", "rule", "in", "rules", "]", "# Convert helpers if needed", "self", ".", "_patch_property", "(", "\"lifecycle\"", ",", "{", "\"rule\"", ":", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.add_lifecycle_delete_rule
Add a "delete" rule to lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. literalinclude:: snippets.py :start-after: [START add_lifecycle_delete_rule] :end-bef...
storage/google/cloud/storage/bucket.py
def add_lifecycle_delete_rule(self, **kw): """Add a "delete" rule to lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. literalinclude:: snippets.py :start-after...
def add_lifecycle_delete_rule(self, **kw): """Add a "delete" rule to lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. literalinclude:: snippets.py :start-after...
[ "Add", "a", "delete", "rule", "to", "lifestyle", "rules", "configured", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1306-L1321
[ "def", "add_lifecycle_delete_rule", "(", "self", ",", "*", "*", "kw", ")", ":", "rules", "=", "list", "(", "self", ".", "lifecycle_rules", ")", "rules", ".", "append", "(", "LifecycleRuleDelete", "(", "*", "*", "kw", ")", ")", "self", ".", "lifecycle_rul...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.add_lifecycle_set_storage_class_rule
Add a "delete" rule to lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. literalinclude:: snippets.py :start-after: [START add_lifecycle_set_storage_class_rule] ...
storage/google/cloud/storage/bucket.py
def add_lifecycle_set_storage_class_rule(self, storage_class, **kw): """Add a "delete" rule to lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. literalinclude:: snippets...
def add_lifecycle_set_storage_class_rule(self, storage_class, **kw): """Add a "delete" rule to lifestyle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets .. literalinclude:: snippets...
[ "Add", "a", "delete", "rule", "to", "lifestyle", "rules", "configured", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1323-L1341
[ "def", "add_lifecycle_set_storage_class_rule", "(", "self", ",", "storage_class", ",", "*", "*", "kw", ")", ":", "rules", "=", "list", "(", "self", ".", "lifecycle_rules", ")", "rules", ".", "append", "(", "LifecycleRuleSetStorageClass", "(", "storage_class", ",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.location
(Deprecated) Set `Bucket.location` This can only be set at bucket **creation** time. See https://cloud.google.com/storage/docs/json_api/v1/buckets and https://cloud.google.com/storage/docs/bucket-locations .. warning:: Assignment to 'Bucket.location' is deprecated, as it ...
storage/google/cloud/storage/bucket.py
def location(self, value): """(Deprecated) Set `Bucket.location` This can only be set at bucket **creation** time. See https://cloud.google.com/storage/docs/json_api/v1/buckets and https://cloud.google.com/storage/docs/bucket-locations .. warning:: Assignment to '...
def location(self, value): """(Deprecated) Set `Bucket.location` This can only be set at bucket **creation** time. See https://cloud.google.com/storage/docs/json_api/v1/buckets and https://cloud.google.com/storage/docs/bucket-locations .. warning:: Assignment to '...
[ "(", "Deprecated", ")", "Set", "Bucket", ".", "location" ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1359-L1374
[ "def", "location", "(", "self", ",", "value", ")", ":", "warnings", ".", "warn", "(", "_LOCATION_SETTER_MESSAGE", ",", "DeprecationWarning", ",", "stacklevel", "=", "2", ")", "self", ".", "_location", "=", "value" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.enable_logging
Enable access logging for this bucket. See https://cloud.google.com/storage/docs/access-logs :type bucket_name: str :param bucket_name: name of bucket in which to store access logs :type object_prefix: str :param object_prefix: prefix for access log filenames
storage/google/cloud/storage/bucket.py
def enable_logging(self, bucket_name, object_prefix=""): """Enable access logging for this bucket. See https://cloud.google.com/storage/docs/access-logs :type bucket_name: str :param bucket_name: name of bucket in which to store access logs :type object_prefix: str :pa...
def enable_logging(self, bucket_name, object_prefix=""): """Enable access logging for this bucket. See https://cloud.google.com/storage/docs/access-logs :type bucket_name: str :param bucket_name: name of bucket in which to store access logs :type object_prefix: str :pa...
[ "Enable", "access", "logging", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1388-L1400
[ "def", "enable_logging", "(", "self", ",", "bucket_name", ",", "object_prefix", "=", "\"\"", ")", ":", "info", "=", "{", "\"logBucket\"", ":", "bucket_name", ",", "\"logObjectPrefix\"", ":", "object_prefix", "}", "self", ".", "_patch_property", "(", "\"logging\"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.retention_policy_effective_time
Retrieve the effective time of the bucket's retention policy. :rtype: datetime.datetime or ``NoneType`` :returns: point-in time at which the bucket's retention policy is effective, or ``None`` if the property is not set locally.
storage/google/cloud/storage/bucket.py
def retention_policy_effective_time(self): """Retrieve the effective time of the bucket's retention policy. :rtype: datetime.datetime or ``NoneType`` :returns: point-in time at which the bucket's retention policy is effective, or ``None`` if the property is not ...
def retention_policy_effective_time(self): """Retrieve the effective time of the bucket's retention policy. :rtype: datetime.datetime or ``NoneType`` :returns: point-in time at which the bucket's retention policy is effective, or ``None`` if the property is not ...
[ "Retrieve", "the", "effective", "time", "of", "the", "bucket", "s", "retention", "policy", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1450-L1462
[ "def", "retention_policy_effective_time", "(", "self", ")", ":", "policy", "=", "self", ".", "_properties", ".", "get", "(", "\"retentionPolicy\"", ")", "if", "policy", "is", "not", "None", ":", "timestamp", "=", "policy", ".", "get", "(", "\"effectiveTime\"",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.retention_period
Retrieve or set the retention period for items in the bucket. :rtype: int or ``NoneType`` :returns: number of seconds to retain items after upload or release from event-based lock, or ``None`` if the property is not set locally.
storage/google/cloud/storage/bucket.py
def retention_period(self): """Retrieve or set the retention period for items in the bucket. :rtype: int or ``NoneType`` :returns: number of seconds to retain items after upload or release from event-based lock, or ``None`` if the property is not set locally....
def retention_period(self): """Retrieve or set the retention period for items in the bucket. :rtype: int or ``NoneType`` :returns: number of seconds to retain items after upload or release from event-based lock, or ``None`` if the property is not set locally....
[ "Retrieve", "or", "set", "the", "retention", "period", "for", "items", "in", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1478-L1490
[ "def", "retention_period", "(", "self", ")", ":", "policy", "=", "self", ".", "_properties", ".", "get", "(", "\"retentionPolicy\"", ")", "if", "policy", "is", "not", "None", ":", "period", "=", "policy", ".", "get", "(", "\"retentionPeriod\"", ")", "if", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.retention_period
Set the retention period for items in the bucket. :type value: int :param value: number of seconds to retain items after upload or release from event-based lock. :raises ValueError: if the bucket's retention policy is locked.
storage/google/cloud/storage/bucket.py
def retention_period(self, value): """Set the retention period for items in the bucket. :type value: int :param value: number of seconds to retain items after upload or release from event-based lock. :raises ValueError: if the bucket's retention policy is locked...
def retention_period(self, value): """Set the retention period for items in the bucket. :type value: int :param value: number of seconds to retain items after upload or release from event-based lock. :raises ValueError: if the bucket's retention policy is locked...
[ "Set", "the", "retention", "period", "for", "items", "in", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1493-L1508
[ "def", "retention_period", "(", "self", ",", "value", ")", ":", "policy", "=", "self", ".", "_properties", ".", "setdefault", "(", "\"retentionPolicy\"", ",", "{", "}", ")", "if", "value", "is", "not", "None", ":", "policy", "[", "\"retentionPeriod\"", "]"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.storage_class
Set the storage class for the bucket. See https://cloud.google.com/storage/docs/storage-classes :type value: str :param value: one of "MULTI_REGIONAL", "REGIONAL", "NEARLINE", "COLDLINE", "STANDARD", or "DURABLE_REDUCED_AVAILABILITY"
storage/google/cloud/storage/bucket.py
def storage_class(self, value): """Set the storage class for the bucket. See https://cloud.google.com/storage/docs/storage-classes :type value: str :param value: one of "MULTI_REGIONAL", "REGIONAL", "NEARLINE", "COLDLINE", "STANDARD", or "DURABLE_REDUCED_AVAILABIL...
def storage_class(self, value): """Set the storage class for the bucket. See https://cloud.google.com/storage/docs/storage-classes :type value: str :param value: one of "MULTI_REGIONAL", "REGIONAL", "NEARLINE", "COLDLINE", "STANDARD", or "DURABLE_REDUCED_AVAILABIL...
[ "Set", "the", "storage", "class", "for", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1539-L1550
[ "def", "storage_class", "(", "self", ",", "value", ")", ":", "if", "value", "not", "in", "self", ".", "_STORAGE_CLASSES", ":", "raise", "ValueError", "(", "\"Invalid storage class: %s\"", "%", "(", "value", ",", ")", ")", "self", ".", "_patch_property", "(",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.configure_website
Configure website-related properties. See https://cloud.google.com/storage/docs/hosting-static-website .. note:: This (apparently) only works if your bucket name is a domain name (and to do that, you need to get approved somehow...). If you want this bucket to ho...
storage/google/cloud/storage/bucket.py
def configure_website(self, main_page_suffix=None, not_found_page=None): """Configure website-related properties. See https://cloud.google.com/storage/docs/hosting-static-website .. note:: This (apparently) only works if your bucket name is a domain name (and to d...
def configure_website(self, main_page_suffix=None, not_found_page=None): """Configure website-related properties. See https://cloud.google.com/storage/docs/hosting-static-website .. note:: This (apparently) only works if your bucket name is a domain name (and to d...
[ "Configure", "website", "-", "related", "properties", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1624-L1660
[ "def", "configure_website", "(", "self", ",", "main_page_suffix", "=", "None", ",", "not_found_page", "=", "None", ")", ":", "data", "=", "{", "\"mainPageSuffix\"", ":", "main_page_suffix", ",", "\"notFoundPage\"", ":", "not_found_page", "}", "self", ".", "_patc...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.get_iam_policy
Retrieve the IAM policy for the bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets/getIamPolicy If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` ...
storage/google/cloud/storage/bucket.py
def get_iam_policy(self, client=None): """Retrieve the IAM policy for the bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets/getIamPolicy If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.clien...
def get_iam_policy(self, client=None): """Retrieve the IAM policy for the bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets/getIamPolicy If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.clien...
[ "Retrieve", "the", "IAM", "policy", "for", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1670-L1699
[ "def", "get_iam_policy", "(", "self", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "{", "}", "if", "self", ".", "user_project", "is", "not", "None", ":", "query_params", "["...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.set_iam_policy
Update the IAM policy for the bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets/setIamPolicy If :attr:`user_project` is set, bills the API request to that project. :type policy: :class:`google.api_core.iam.Policy` :param policy: policy instance used to upda...
storage/google/cloud/storage/bucket.py
def set_iam_policy(self, policy, client=None): """Update the IAM policy for the bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets/setIamPolicy If :attr:`user_project` is set, bills the API request to that project. :type policy: :class:`google.api_core.iam.P...
def set_iam_policy(self, policy, client=None): """Update the IAM policy for the bucket. See https://cloud.google.com/storage/docs/json_api/v1/buckets/setIamPolicy If :attr:`user_project` is set, bills the API request to that project. :type policy: :class:`google.api_core.iam.P...
[ "Update", "the", "IAM", "policy", "for", "the", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1701-L1736
[ "def", "set_iam_policy", "(", "self", ",", "policy", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "{", "}", "if", "self", ".", "user_project", "is", "not", "None", ":", "q...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.make_private
Update bucket's ACL, revoking read access for anonymous users. :type recursive: bool :param recursive: If True, this will make all blobs inside the bucket private as well. :type future: bool :param future: If True, this will make all objects created in the ...
storage/google/cloud/storage/bucket.py
def make_private(self, recursive=False, future=False, client=None): """Update bucket's ACL, revoking read access for anonymous users. :type recursive: bool :param recursive: If True, this will make all blobs inside the bucket private as well. :type future: boo...
def make_private(self, recursive=False, future=False, client=None): """Update bucket's ACL, revoking read access for anonymous users. :type recursive: bool :param recursive: If True, this will make all blobs inside the bucket private as well. :type future: boo...
[ "Update", "bucket", "s", "ACL", "revoking", "read", "access", "for", "anonymous", "users", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1826-L1880
[ "def", "make_private", "(", "self", ",", "recursive", "=", "False", ",", "future", "=", "False", ",", "client", "=", "None", ")", ":", "self", ".", "acl", ".", "all", "(", ")", ".", "revoke_read", "(", ")", "self", ".", "acl", ".", "save", "(", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.generate_upload_policy
Create a signed upload policy for uploading objects. This method generates and signs a policy document. You can use `policy documents`_ to allow visitors to a website to upload files to Google Cloud Storage without giving them direct write access. For example: .. literalinclud...
storage/google/cloud/storage/bucket.py
def generate_upload_policy(self, conditions, expiration=None, client=None): """Create a signed upload policy for uploading objects. This method generates and signs a policy document. You can use `policy documents`_ to allow visitors to a website to upload files to Google Cloud Storage w...
def generate_upload_policy(self, conditions, expiration=None, client=None): """Create a signed upload policy for uploading objects. This method generates and signs a policy document. You can use `policy documents`_ to allow visitors to a website to upload files to Google Cloud Storage w...
[ "Create", "a", "signed", "upload", "policy", "for", "uploading", "objects", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1882-L1942
[ "def", "generate_upload_policy", "(", "self", ",", "conditions", ",", "expiration", "=", "None", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "credentials", "=", "client", ".", "_base_connection", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.lock_retention_policy
Lock the bucket's retention policy. :raises ValueError: if the bucket has no metageneration (i.e., new or never reloaded); if the bucket has no retention policy assigned; if the bucket's retention policy is already locked.
storage/google/cloud/storage/bucket.py
def lock_retention_policy(self, client=None): """Lock the bucket's retention policy. :raises ValueError: if the bucket has no metageneration (i.e., new or never reloaded); if the bucket has no retention policy assigned; if the bucket's retention policy is already loc...
def lock_retention_policy(self, client=None): """Lock the bucket's retention policy. :raises ValueError: if the bucket has no metageneration (i.e., new or never reloaded); if the bucket has no retention policy assigned; if the bucket's retention policy is already loc...
[ "Lock", "the", "bucket", "s", "retention", "policy", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1944-L1974
[ "def", "lock_retention_policy", "(", "self", ",", "client", "=", "None", ")", ":", "if", "\"metageneration\"", "not", "in", "self", ".", "_properties", ":", "raise", "ValueError", "(", "\"Bucket has no retention policy assigned: try 'reload'?\"", ")", "policy", "=", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
Bucket.generate_signed_url
Generates a signed URL for this bucket. .. note:: If you are on Google Compute Engine, you can't generate a signed URL using GCE service account. Follow `Issue 50`_ for updates on this. If you'd like to be able to generate a signed URL from GCE, you can use a st...
storage/google/cloud/storage/bucket.py
def generate_signed_url( self, expiration=None, api_access_endpoint=_API_ACCESS_ENDPOINT, method="GET", headers=None, query_parameters=None, client=None, credentials=None, version=None, ): """Generates a signed URL for this bucket. ...
def generate_signed_url( self, expiration=None, api_access_endpoint=_API_ACCESS_ENDPOINT, method="GET", headers=None, query_parameters=None, client=None, credentials=None, version=None, ): """Generates a signed URL for this bucket. ...
[ "Generates", "a", "signed", "URL", "for", "this", "bucket", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1976-L2080
[ "def", "generate_signed_url", "(", "self", ",", "expiration", "=", "None", ",", "api_access_endpoint", "=", "_API_ACCESS_ENDPOINT", ",", "method", "=", "\"GET\"", ",", "headers", "=", "None", ",", "query_parameters", "=", "None", ",", "client", "=", "None", ",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
to_microseconds
Convert a datetime to microseconds since the unix epoch. Args: value (datetime.datetime): The datetime to covert. Returns: int: Microseconds since the unix epoch.
api_core/google/api_core/datetime_helpers.py
def to_microseconds(value): """Convert a datetime to microseconds since the unix epoch. Args: value (datetime.datetime): The datetime to covert. Returns: int: Microseconds since the unix epoch. """ if not value.tzinfo: value = value.replace(tzinfo=pytz.utc) # Regardless...
def to_microseconds(value): """Convert a datetime to microseconds since the unix epoch. Args: value (datetime.datetime): The datetime to covert. Returns: int: Microseconds since the unix epoch. """ if not value.tzinfo: value = value.replace(tzinfo=pytz.utc) # Regardless...
[ "Convert", "a", "datetime", "to", "microseconds", "since", "the", "unix", "epoch", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L76-L90
[ "def", "to_microseconds", "(", "value", ")", ":", "if", "not", "value", ".", "tzinfo", ":", "value", "=", "value", ".", "replace", "(", "tzinfo", "=", "pytz", ".", "utc", ")", "# Regardless of what timezone is on the value, convert it to UTC.", "value", "=", "va...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
from_rfc3339
Convert a microsecond-precision timestamp to datetime. Args: value (str): The RFC3339 string to convert. Returns: datetime.datetime: The datetime object equivalent to the timestamp in UTC.
api_core/google/api_core/datetime_helpers.py
def from_rfc3339(value): """Convert a microsecond-precision timestamp to datetime. Args: value (str): The RFC3339 string to convert. Returns: datetime.datetime: The datetime object equivalent to the timestamp in UTC. """ return datetime.datetime.strptime(value, _RFC3339...
def from_rfc3339(value): """Convert a microsecond-precision timestamp to datetime. Args: value (str): The RFC3339 string to convert. Returns: datetime.datetime: The datetime object equivalent to the timestamp in UTC. """ return datetime.datetime.strptime(value, _RFC3339...
[ "Convert", "a", "microsecond", "-", "precision", "timestamp", "to", "datetime", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L117-L127
[ "def", "from_rfc3339", "(", "value", ")", ":", "return", "datetime", ".", "datetime", ".", "strptime", "(", "value", ",", "_RFC3339_MICROS", ")", ".", "replace", "(", "tzinfo", "=", "pytz", ".", "utc", ")" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
from_rfc3339_nanos
Convert a nanosecond-precision timestamp to a native datetime. .. note:: Python datetimes do not support nanosecond precision; this function therefore truncates such values to microseconds. Args: value (str): The RFC3339 string to convert. Returns: datetime.datetime: The d...
api_core/google/api_core/datetime_helpers.py
def from_rfc3339_nanos(value): """Convert a nanosecond-precision timestamp to a native datetime. .. note:: Python datetimes do not support nanosecond precision; this function therefore truncates such values to microseconds. Args: value (str): The RFC3339 string to convert. Ret...
def from_rfc3339_nanos(value): """Convert a nanosecond-precision timestamp to a native datetime. .. note:: Python datetimes do not support nanosecond precision; this function therefore truncates such values to microseconds. Args: value (str): The RFC3339 string to convert. Ret...
[ "Convert", "a", "nanosecond", "-", "precision", "timestamp", "to", "a", "native", "datetime", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L130-L169
[ "def", "from_rfc3339_nanos", "(", "value", ")", ":", "with_nanos", "=", "_RFC3339_NANOS", ".", "match", "(", "value", ")", "if", "with_nanos", "is", "None", ":", "raise", "ValueError", "(", "\"Timestamp: {!r}, does not match pattern: {!r}\"", ".", "format", "(", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
DatetimeWithNanoseconds.rfc3339
Return an RFC 3339-compliant timestamp. Returns: (str): Timestamp string according to RFC 3339 spec.
api_core/google/api_core/datetime_helpers.py
def rfc3339(self): """Return an RFC 3339-compliant timestamp. Returns: (str): Timestamp string according to RFC 3339 spec. """ if self._nanosecond == 0: return to_rfc3339(self) nanos = str(self._nanosecond).rjust(9, '0').rstrip("0") return "{}.{}Z...
def rfc3339(self): """Return an RFC 3339-compliant timestamp. Returns: (str): Timestamp string according to RFC 3339 spec. """ if self._nanosecond == 0: return to_rfc3339(self) nanos = str(self._nanosecond).rjust(9, '0').rstrip("0") return "{}.{}Z...
[ "Return", "an", "RFC", "3339", "-", "compliant", "timestamp", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L217-L226
[ "def", "rfc3339", "(", "self", ")", ":", "if", "self", ".", "_nanosecond", "==", "0", ":", "return", "to_rfc3339", "(", "self", ")", "nanos", "=", "str", "(", "self", ".", "_nanosecond", ")", ".", "rjust", "(", "9", ",", "'0'", ")", ".", "rstrip", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
DatetimeWithNanoseconds.from_rfc3339
Parse RFC 3339-compliant timestamp, preserving nanoseconds. Args: stamp (str): RFC 3339 stamp, with up to nanosecond precision Returns: :class:`DatetimeWithNanoseconds`: an instance matching the timestamp string Raises: ValueError: if `stamp...
api_core/google/api_core/datetime_helpers.py
def from_rfc3339(cls, stamp): """Parse RFC 3339-compliant timestamp, preserving nanoseconds. Args: stamp (str): RFC 3339 stamp, with up to nanosecond precision Returns: :class:`DatetimeWithNanoseconds`: an instance matching the timestamp string ...
def from_rfc3339(cls, stamp): """Parse RFC 3339-compliant timestamp, preserving nanoseconds. Args: stamp (str): RFC 3339 stamp, with up to nanosecond precision Returns: :class:`DatetimeWithNanoseconds`: an instance matching the timestamp string ...
[ "Parse", "RFC", "3339", "-", "compliant", "timestamp", "preserving", "nanoseconds", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L229-L267
[ "def", "from_rfc3339", "(", "cls", ",", "stamp", ")", ":", "with_nanos", "=", "_RFC3339_NANOS", ".", "match", "(", "stamp", ")", "if", "with_nanos", "is", "None", ":", "raise", "ValueError", "(", "\"Timestamp: {}, does not match pattern: {}\"", ".", "format", "(...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
DatetimeWithNanoseconds.timestamp_pb
Return a timestamp message. Returns: (:class:`~google.protobuf.timestamp_pb2.Timestamp`): Timestamp message
api_core/google/api_core/datetime_helpers.py
def timestamp_pb(self): """Return a timestamp message. Returns: (:class:`~google.protobuf.timestamp_pb2.Timestamp`): Timestamp message """ inst = self if self.tzinfo is not None else self.replace(tzinfo=pytz.UTC) delta = inst - _UTC_EPOCH seconds = int(delta....
def timestamp_pb(self): """Return a timestamp message. Returns: (:class:`~google.protobuf.timestamp_pb2.Timestamp`): Timestamp message """ inst = self if self.tzinfo is not None else self.replace(tzinfo=pytz.UTC) delta = inst - _UTC_EPOCH seconds = int(delta....
[ "Return", "a", "timestamp", "message", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L269-L279
[ "def", "timestamp_pb", "(", "self", ")", ":", "inst", "=", "self", "if", "self", ".", "tzinfo", "is", "not", "None", "else", "self", ".", "replace", "(", "tzinfo", "=", "pytz", ".", "UTC", ")", "delta", "=", "inst", "-", "_UTC_EPOCH", "seconds", "=",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
DatetimeWithNanoseconds.from_timestamp_pb
Parse RFC 3339-compliant timestamp, preserving nanoseconds. Args: stamp (:class:`~google.protobuf.timestamp_pb2.Timestamp`): timestamp message Returns: :class:`DatetimeWithNanoseconds`: an instance matching the timestamp message
api_core/google/api_core/datetime_helpers.py
def from_timestamp_pb(cls, stamp): """Parse RFC 3339-compliant timestamp, preserving nanoseconds. Args: stamp (:class:`~google.protobuf.timestamp_pb2.Timestamp`): timestamp message Returns: :class:`DatetimeWithNanoseconds`: an instance matching the times...
def from_timestamp_pb(cls, stamp): """Parse RFC 3339-compliant timestamp, preserving nanoseconds. Args: stamp (:class:`~google.protobuf.timestamp_pb2.Timestamp`): timestamp message Returns: :class:`DatetimeWithNanoseconds`: an instance matching the times...
[ "Parse", "RFC", "3339", "-", "compliant", "timestamp", "preserving", "nanoseconds", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L282-L303
[ "def", "from_timestamp_pb", "(", "cls", ",", "stamp", ")", ":", "microseconds", "=", "int", "(", "stamp", ".", "seconds", "*", "1e6", ")", "bare", "=", "from_microseconds", "(", "microseconds", ")", "return", "cls", "(", "bare", ".", "year", ",", "bare",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ClusterControllerClient.create_cluster
Creates a cluster in a project. Example: >>> from google.cloud import dataproc_v1beta2 >>> >>> client = dataproc_v1beta2.ClusterControllerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>>...
dataproc/google/cloud/dataproc_v1beta2/gapic/cluster_controller_client.py
def create_cluster( self, project_id, region, cluster, request_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a cluster in a project. Examp...
def create_cluster( self, project_id, region, cluster, request_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a cluster in a project. Examp...
[ "Creates", "a", "cluster", "in", "a", "project", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/cluster_controller_client.py#L180-L278
[ "def", "create_cluster", "(", "self", ",", "project_id", ",", "region", ",", "cluster", ",", "request_id", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api...
85e80125a59cb10f8cb105f25ecc099e4b940b50
train
ClusterControllerClient.delete_cluster
Deletes a cluster in a project. Example: >>> from google.cloud import dataproc_v1beta2 >>> >>> client = dataproc_v1beta2.ClusterControllerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>>...
dataproc/google/cloud/dataproc_v1beta2/gapic/cluster_controller_client.py
def delete_cluster( self, project_id, region, cluster_name, cluster_uuid=None, request_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a clus...
def delete_cluster( self, project_id, region, cluster_name, cluster_uuid=None, request_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a clus...
[ "Deletes", "a", "cluster", "in", "a", "project", "." ]
googleapis/google-cloud-python
python
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/cluster_controller_client.py#L646-L748
[ "def", "delete_cluster", "(", "self", ",", "project_id", ",", "region", ",", "cluster_name", ",", "cluster_uuid", "=", "None", ",", "request_id", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ","...
85e80125a59cb10f8cb105f25ecc099e4b940b50