repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
googleapis/google-cloud-python
storage/google/cloud/storage/_signing.py
generate_signed_url_v2
def generate_signed_url_v2( credentials, resource, expiration, api_access_endpoint="", method="GET", content_md5=None, content_type=None, response_type=None, response_disposition=None, generation=None, headers=None, query_parameters=None, ): """Generate a V2 signed UR...
python
def generate_signed_url_v2( credentials, resource, expiration, api_access_endpoint="", method="GET", content_md5=None, content_type=None, response_type=None, response_disposition=None, generation=None, headers=None, query_parameters=None, ): """Generate a V2 signed UR...
[ "def", "generate_signed_url_v2", "(", "credentials", ",", "resource", ",", "expiration", ",", "api_access_endpoint", "=", "\"\"", ",", "method", "=", "\"GET\"", ",", "content_md5", "=", "None", ",", "content_type", "=", "None", ",", "response_type", "=", "None",...
Generate a V2 signed URL to provide query-string auth'n to a resource. .. note:: Assumes ``credentials`` implements the :class:`google.auth.credentials.Signing` interface. Also assumes ``credentials`` has a ``service_account_email`` property which identifies the credentials. ....
[ "Generate", "a", "V2", "signed", "URL", "to", "provide", "query", "-", "string", "auth", "n", "to", "a", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_signing.py#L255-L392
train
googleapis/google-cloud-python
storage/google/cloud/storage/_signing.py
generate_signed_url_v4
def generate_signed_url_v4( credentials, resource, expiration, api_access_endpoint=DEFAULT_ENDPOINT, method="GET", content_md5=None, content_type=None, response_type=None, response_disposition=None, generation=None, headers=None, query_parameters=None, _request_timest...
python
def generate_signed_url_v4( credentials, resource, expiration, api_access_endpoint=DEFAULT_ENDPOINT, method="GET", content_md5=None, content_type=None, response_type=None, response_disposition=None, generation=None, headers=None, query_parameters=None, _request_timest...
[ "def", "generate_signed_url_v4", "(", "credentials", ",", "resource", ",", "expiration", ",", "api_access_endpoint", "=", "DEFAULT_ENDPOINT", ",", "method", "=", "\"GET\"", ",", "content_md5", "=", "None", ",", "content_type", "=", "None", ",", "response_type", "=...
Generate a V4 signed URL to provide query-string auth'n to a resource. .. note:: Assumes ``credentials`` implements the :class:`google.auth.credentials.Signing` interface. Also assumes ``credentials`` has a ``service_account_email`` property which identifies the credentials. ....
[ "Generate", "a", "V4", "signed", "URL", "to", "provide", "query", "-", "string", "auth", "n", "to", "a", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_signing.py#L399-L591
train
googleapis/google-cloud-python
translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py
TranslationServiceClient.glossary_path
def glossary_path(cls, project, location, glossary): """Return a fully-qualified glossary string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/glossaries/{glossary}", project=project, location=location, glossary=...
python
def glossary_path(cls, project, location, glossary): """Return a fully-qualified glossary string.""" return google.api_core.path_template.expand( "projects/{project}/locations/{location}/glossaries/{glossary}", project=project, location=location, glossary=...
[ "def", "glossary_path", "(", "cls", ",", "project", ",", "location", ",", "glossary", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/locations/{location}/glossaries/{glossary}\"", ",", "project", "=", "...
Return a fully-qualified glossary string.
[ "Return", "a", "fully", "-", "qualified", "glossary", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py#L88-L95
train
googleapis/google-cloud-python
translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py
TranslationServiceClient.translate_text
def translate_text( self, contents, target_language_code, mime_type=None, source_language_code=None, parent=None, model=None, glossary_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAU...
python
def translate_text( self, contents, target_language_code, mime_type=None, source_language_code=None, parent=None, model=None, glossary_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAU...
[ "def", "translate_text", "(", "self", ",", "contents", ",", "target_language_code", ",", "mime_type", "=", "None", ",", "source_language_code", "=", "None", ",", "parent", "=", "None", ",", "model", "=", "None", ",", "glossary_config", "=", "None", ",", "ret...
Translates input text and returns translated text. Example: >>> from google.cloud import translate_v3beta1 >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> >>> # TODO: Initialize `contents`: >>> contents = [] >...
[ "Translates", "input", "text", "and", "returns", "translated", "text", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py#L196-L317
train
googleapis/google-cloud-python
translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py
TranslationServiceClient.detect_language
def detect_language( self, parent=None, model=None, content=None, mime_type=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Detects the language of text within ...
python
def detect_language( self, parent=None, model=None, content=None, mime_type=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Detects the language of text within ...
[ "def", "detect_language", "(", "self", ",", "parent", "=", "None", ",", "model", "=", "None", ",", "content", "=", "None", ",", "mime_type", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",",...
Detects the language of text within a request. Example: >>> from google.cloud import translate_v3beta1 >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> >>> response = client.detect_language() Args: parent (str): O...
[ "Detects", "the", "language", "of", "text", "within", "a", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py#L319-L404
train
googleapis/google-cloud-python
translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py
TranslationServiceClient.get_supported_languages
def get_supported_languages( self, parent=None, display_language_code=None, model=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Returns a list of supported languages ...
python
def get_supported_languages( self, parent=None, display_language_code=None, model=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Returns a list of supported languages ...
[ "def", "get_supported_languages", "(", "self", ",", "parent", "=", "None", ",", "display_language_code", "=", "None", ",", "model", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "...
Returns a list of supported languages for translation. Example: >>> from google.cloud import translate_v3beta1 >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> >>> response = client.get_supported_languages() Args: ...
[ "Returns", "a", "list", "of", "supported", "languages", "for", "translation", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py#L406-L492
train
googleapis/google-cloud-python
translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py
TranslationServiceClient.batch_translate_text
def batch_translate_text( self, source_language_code, target_language_codes, input_configs, output_config, parent=None, models=None, glossaries=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEF...
python
def batch_translate_text( self, source_language_code, target_language_codes, input_configs, output_config, parent=None, models=None, glossaries=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEF...
[ "def", "batch_translate_text", "(", "self", ",", "source_language_code", ",", "target_language_codes", ",", "input_configs", ",", "output_config", ",", "parent", "=", "None", ",", "models", "=", "None", ",", "glossaries", "=", "None", ",", "retry", "=", "google"...
Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. Thi...
[ "Translates", "a", "large", "volume", "of", "text", "in", "asynchronous", "batch", "mode", ".", "This", "function", "provides", "real", "-", "time", "output", "as", "the", "inputs", "are", "being", "processed", ".", "If", "caller", "cancels", "a", "request",...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py#L494-L644
train
googleapis/google-cloud-python
translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py
TranslationServiceClient.create_glossary
def create_glossary( self, parent, glossary, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a glossary and returns the long-running operation. Returns NOT\_FOUND, if...
python
def create_glossary( self, parent, glossary, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a glossary and returns the long-running operation. Returns NOT\_FOUND, if...
[ "def", "create_glossary", "(", "self", ",", "parent", ",", "glossary", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEF...
Creates a glossary and returns the long-running operation. Returns NOT\_FOUND, if the project doesn't exist. Example: >>> from google.cloud import translate_v3beta1 >>> >>> client = translate_v3beta1.TranslationServiceClient() >>> >>> parent =...
[ "Creates", "a", "glossary", "and", "returns", "the", "long", "-", "running", "operation", ".", "Returns", "NOT", "\\", "_FOUND", "if", "the", "project", "doesn", "t", "exist", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py#L646-L739
train
googleapis/google-cloud-python
translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py
TranslationServiceClient.delete_glossary
def delete_glossary( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT\_...
python
def delete_glossary( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT\_...
[ "def", "delete_glossary", "(", "self", ",", "name", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "metada...
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT\_FOUND, if the glossary doesn't exist. Example: >>> from google.cloud import translate_v3beta1 >>> >>> client = translate_v3beta1.TranslationServiceClient() ...
[ "Deletes", "a", "glossary", "or", "cancels", "glossary", "construction", "if", "the", "glossary", "isn", "t", "created", "yet", ".", "Returns", "NOT", "\\", "_FOUND", "if", "the", "glossary", "doesn", "t", "exist", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py#L916-L999
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/_dataframe.py
_extract_header
def _extract_header(time_series): """Return a copy of time_series with the points removed.""" return TimeSeries( metric=time_series.metric, resource=time_series.resource, metric_kind=time_series.metric_kind, value_type=time_series.value_type, )
python
def _extract_header(time_series): """Return a copy of time_series with the points removed.""" return TimeSeries( metric=time_series.metric, resource=time_series.resource, metric_kind=time_series.metric_kind, value_type=time_series.value_type, )
[ "def", "_extract_header", "(", "time_series", ")", ":", "return", "TimeSeries", "(", "metric", "=", "time_series", ".", "metric", ",", "resource", "=", "time_series", ".", "resource", ",", "metric_kind", "=", "time_series", ".", "metric_kind", ",", "value_type",...
Return a copy of time_series with the points removed.
[ "Return", "a", "copy", "of", "time_series", "with", "the", "points", "removed", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/_dataframe.py#L29-L36
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/_dataframe.py
_extract_labels
def _extract_labels(time_series): """Build the combined resource and metric labels, with resource_type.""" labels = {"resource_type": time_series.resource.type} labels.update(time_series.resource.labels) labels.update(time_series.metric.labels) return labels
python
def _extract_labels(time_series): """Build the combined resource and metric labels, with resource_type.""" labels = {"resource_type": time_series.resource.type} labels.update(time_series.resource.labels) labels.update(time_series.metric.labels) return labels
[ "def", "_extract_labels", "(", "time_series", ")", ":", "labels", "=", "{", "\"resource_type\"", ":", "time_series", ".", "resource", ".", "type", "}", "labels", ".", "update", "(", "time_series", ".", "resource", ".", "labels", ")", "labels", ".", "update",...
Build the combined resource and metric labels, with resource_type.
[ "Build", "the", "combined", "resource", "and", "metric", "labels", "with", "resource_type", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/_dataframe.py#L39-L44
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/_dataframe.py
_build_dataframe
def _build_dataframe(time_series_iterable, label=None, labels=None): # pragma: NO COVER """Build a :mod:`pandas` dataframe out of time series. :type time_series_iterable: iterable over :class:`~google.cloud.monitoring_v3.types.TimeSeries` :param time_series_iterable: An iterable (e.g., a q...
python
def _build_dataframe(time_series_iterable, label=None, labels=None): # pragma: NO COVER """Build a :mod:`pandas` dataframe out of time series. :type time_series_iterable: iterable over :class:`~google.cloud.monitoring_v3.types.TimeSeries` :param time_series_iterable: An iterable (e.g., a q...
[ "def", "_build_dataframe", "(", "time_series_iterable", ",", "label", "=", "None", ",", "labels", "=", "None", ")", ":", "# pragma: NO COVER", "if", "pandas", "is", "None", ":", "raise", "RuntimeError", "(", "\"This method requires `pandas` to be installed.\"", ")", ...
Build a :mod:`pandas` dataframe out of time series. :type time_series_iterable: iterable over :class:`~google.cloud.monitoring_v3.types.TimeSeries` :param time_series_iterable: An iterable (e.g., a query object) yielding time series. :type label: str :param label: (Optional) Th...
[ "Build", "a", ":", "mod", ":", "pandas", "dataframe", "out", "of", "time", "series", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/_dataframe.py#L53-L140
train
googleapis/google-cloud-python
monitoring/google/cloud/monitoring_v3/_dataframe.py
_sorted_resource_labels
def _sorted_resource_labels(labels): """Sort label names, putting well-known resource labels first.""" head = [label for label in TOP_RESOURCE_LABELS if label in labels] tail = sorted(label for label in labels if label not in TOP_RESOURCE_LABELS) return head + tail
python
def _sorted_resource_labels(labels): """Sort label names, putting well-known resource labels first.""" head = [label for label in TOP_RESOURCE_LABELS if label in labels] tail = sorted(label for label in labels if label not in TOP_RESOURCE_LABELS) return head + tail
[ "def", "_sorted_resource_labels", "(", "labels", ")", ":", "head", "=", "[", "label", "for", "label", "in", "TOP_RESOURCE_LABELS", "if", "label", "in", "labels", "]", "tail", "=", "sorted", "(", "label", "for", "label", "in", "labels", "if", "label", "not"...
Sort label names, putting well-known resource labels first.
[ "Sort", "label", "names", "putting", "well", "-", "known", "resource", "labels", "first", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/monitoring/google/cloud/monitoring_v3/_dataframe.py#L143-L147
train
googleapis/google-cloud-python
api_core/google/api_core/future/_helpers.py
start_daemon_thread
def start_daemon_thread(*args, **kwargs): """Starts a thread and marks it as a daemon thread.""" thread = threading.Thread(*args, **kwargs) thread.daemon = True thread.start() return thread
python
def start_daemon_thread(*args, **kwargs): """Starts a thread and marks it as a daemon thread.""" thread = threading.Thread(*args, **kwargs) thread.daemon = True thread.start() return thread
[ "def", "start_daemon_thread", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "thread", "=", "threading", ".", "Thread", "(", "*", "args", ",", "*", "*", "kwargs", ")", "thread", ".", "daemon", "=", "True", "thread", ".", "start", "(", ")", "r...
Starts a thread and marks it as a daemon thread.
[ "Starts", "a", "thread", "and", "marks", "it", "as", "a", "daemon", "thread", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/future/_helpers.py#L24-L29
train
googleapis/google-cloud-python
api_core/google/api_core/future/_helpers.py
safe_invoke_callback
def safe_invoke_callback(callback, *args, **kwargs): """Invoke a callback, swallowing and logging any exceptions.""" # pylint: disable=bare-except # We intentionally want to swallow all exceptions. try: return callback(*args, **kwargs) except Exception: _LOGGER.exception("Error while...
python
def safe_invoke_callback(callback, *args, **kwargs): """Invoke a callback, swallowing and logging any exceptions.""" # pylint: disable=bare-except # We intentionally want to swallow all exceptions. try: return callback(*args, **kwargs) except Exception: _LOGGER.exception("Error while...
[ "def", "safe_invoke_callback", "(", "callback", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=bare-except", "# We intentionally want to swallow all exceptions.", "try", ":", "return", "callback", "(", "*", "args", ",", "*", "*", "kwargs", ...
Invoke a callback, swallowing and logging any exceptions.
[ "Invoke", "a", "callback", "swallowing", "and", "logging", "any", "exceptions", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/future/_helpers.py#L32-L39
train
googleapis/google-cloud-python
resource_manager/google/cloud/resource_manager/client.py
Client.new_project
def new_project(self, project_id, name=None, labels=None): """Create a project bound to the current client. Use :meth:`Project.reload() \ <google.cloud.resource_manager.project.Project.reload>` to retrieve project metadata after creating a :class:`~google.cloud.resource_manager....
python
def new_project(self, project_id, name=None, labels=None): """Create a project bound to the current client. Use :meth:`Project.reload() \ <google.cloud.resource_manager.project.Project.reload>` to retrieve project metadata after creating a :class:`~google.cloud.resource_manager....
[ "def", "new_project", "(", "self", ",", "project_id", ",", "name", "=", "None", ",", "labels", "=", "None", ")", ":", "return", "Project", "(", "project_id", "=", "project_id", ",", "client", "=", "self", ",", "name", "=", "name", ",", "labels", "=", ...
Create a project bound to the current client. Use :meth:`Project.reload() \ <google.cloud.resource_manager.project.Project.reload>` to retrieve project metadata after creating a :class:`~google.cloud.resource_manager.project.Project` instance. .. note: This does no...
[ "Create", "a", "project", "bound", "to", "the", "current", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/client.py#L61-L87
train
googleapis/google-cloud-python
resource_manager/google/cloud/resource_manager/client.py
Client.fetch_project
def fetch_project(self, project_id): """Fetch an existing project and it's relevant metadata by ID. .. note:: If the project does not exist, this will raise a :class:`NotFound <google.cloud.exceptions.NotFound>` error. :type project_id: str :param project_id: T...
python
def fetch_project(self, project_id): """Fetch an existing project and it's relevant metadata by ID. .. note:: If the project does not exist, this will raise a :class:`NotFound <google.cloud.exceptions.NotFound>` error. :type project_id: str :param project_id: T...
[ "def", "fetch_project", "(", "self", ",", "project_id", ")", ":", "project", "=", "self", ".", "new_project", "(", "project_id", ")", "project", ".", "reload", "(", ")", "return", "project" ]
Fetch an existing project and it's relevant metadata by ID. .. note:: If the project does not exist, this will raise a :class:`NotFound <google.cloud.exceptions.NotFound>` error. :type project_id: str :param project_id: The ID for this project. :rtype: :class:...
[ "Fetch", "an", "existing", "project", "and", "it", "s", "relevant", "metadata", "by", "ID", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/client.py#L89-L106
train
googleapis/google-cloud-python
resource_manager/google/cloud/resource_manager/client.py
Client.list_projects
def list_projects(self, filter_params=None, page_size=None): """List the projects visible to this client. Example:: >>> from google.cloud import resource_manager >>> client = resource_manager.Client() >>> for project in client.list_projects(): ... pr...
python
def list_projects(self, filter_params=None, page_size=None): """List the projects visible to this client. Example:: >>> from google.cloud import resource_manager >>> client = resource_manager.Client() >>> for project in client.list_projects(): ... pr...
[ "def", "list_projects", "(", "self", ",", "filter_params", "=", "None", ",", "page_size", "=", "None", ")", ":", "extra_params", "=", "{", "}", "if", "page_size", "is", "not", "None", ":", "extra_params", "[", "\"pageSize\"", "]", "=", "page_size", "if", ...
List the projects visible to this client. Example:: >>> from google.cloud import resource_manager >>> client = resource_manager.Client() >>> for project in client.list_projects(): ... print(project.project_id) List all projects with label ``'environ...
[ "List", "the", "projects", "visible", "to", "this", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/resource_manager/google/cloud/resource_manager/client.py#L108-L177
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.session_path
def session_path(cls, project, instance, database, session): """Return a fully-qualified session string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}", project=project, instance=instan...
python
def session_path(cls, project, instance, database, session): """Return a fully-qualified session string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}", project=project, instance=instan...
[ "def", "session_path", "(", "cls", ",", "project", ",", "instance", ",", "database", ",", "session", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}/databases/{database}/sessions/{sessio...
Return a fully-qualified session string.
[ "Return", "a", "fully", "-", "qualified", "session", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L94-L102
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.create_session
def create_session( self, database, session=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new session. A session can be used to perform transactions that re...
python
def create_session( self, database, session=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new session. A session can be used to perform transactions that re...
[ "def", "create_session", "(", "self", ",", "database", ",", "session", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "metho...
Creates a new session. A session can be used to perform transactions that read and/or modify data in a Cloud Spanner database. Sessions are meant to be reused for many consecutive transactions. Sessions can only execute one transaction at a time. To execute multiple concurrent read-writ...
[ "Creates", "a", "new", "session", ".", "A", "session", "can", "be", "used", "to", "perform", "transactions", "that", "read", "and", "/", "or", "modify", "data", "in", "a", "Cloud", "Spanner", "database", ".", "Sessions", "are", "meant", "to", "be", "reus...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L203-L291
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.execute_streaming_sql
def execute_streaming_sql( self, session, sql, transaction=None, params=None, param_types=None, resume_token=None, query_mode=None, partition_token=None, seqno=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=goo...
python
def execute_streaming_sql( self, session, sql, transaction=None, params=None, param_types=None, resume_token=None, query_mode=None, partition_token=None, seqno=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=goo...
[ "def", "execute_streaming_sql", "(", "self", ",", "session", ",", "sql", ",", "transaction", "=", "None", ",", "params", "=", "None", ",", "param_types", "=", "None", ",", "resume_token", "=", "None", ",", "query_mode", "=", "None", ",", "partition_token", ...
Like ``ExecuteSql``, except returns the result set as a stream. Unlike ``ExecuteSql``, there is no limit on the size of the returned result set. However, no individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB. Example: >>> from google.c...
[ "Like", "ExecuteSql", "except", "returns", "the", "result", "set", "as", "a", "stream", ".", "Unlike", "ExecuteSql", "there", "is", "no", "limit", "on", "the", "size", "of", "the", "returned", "result", "set", ".", "However", "no", "individual", "row", "in...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L712-L872
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.execute_batch_dml
def execute_batch_dml( self, session, transaction, statements, seqno, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Executes a batch of SQL DML statements. This met...
python
def execute_batch_dml( self, session, transaction, statements, seqno, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Executes a batch of SQL DML statements. This met...
[ "def", "execute_batch_dml", "(", "self", ",", "session", ",", "transaction", ",", "statements", ",", "seqno", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".",...
Executes a batch of SQL DML statements. This method allows many statements to be run with lower latency than submitting them sequentially with ``ExecuteSql``. Statements are executed in order, sequentially. ``ExecuteBatchDmlResponse`` will contain a ``ResultSet`` for each DML st...
[ "Executes", "a", "batch", "of", "SQL", "DML", "statements", ".", "This", "method", "allows", "many", "statements", "to", "be", "run", "with", "lower", "latency", "than", "submitting", "them", "sequentially", "with", "ExecuteSql", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L874-L990
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.read
def read( self, session, table, columns, key_set, transaction=None, index=None, limit=None, resume_token=None, partition_token=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFA...
python
def read( self, session, table, columns, key_set, transaction=None, index=None, limit=None, resume_token=None, partition_token=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFA...
[ "def", "read", "(", "self", ",", "session", ",", "table", ",", "columns", ",", "key_set", ",", "transaction", "=", "None", ",", "index", "=", "None", ",", "limit", "=", "None", ",", "resume_token", "=", "None", ",", "partition_token", "=", "None", ",",...
Reads rows from the database using key lookups and scans, as a simple key/value style alternative to ``ExecuteSql``. This method cannot be used to return a result set larger than 10 MiB; if the read matches more data than that, the read fails with a ``FAILED_PRECONDITION`` error. Reads ...
[ "Reads", "rows", "from", "the", "database", "using", "key", "lookups", "and", "scans", "as", "a", "simple", "key", "/", "value", "style", "alternative", "to", "ExecuteSql", ".", "This", "method", "cannot", "be", "used", "to", "return", "a", "result", "set"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L992-L1132
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.commit
def commit( self, session, mutations, transaction_id=None, single_use_transaction=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Commits a transaction. The req...
python
def commit( self, session, mutations, transaction_id=None, single_use_transaction=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Commits a transaction. The req...
[ "def", "commit", "(", "self", ",", "session", ",", "mutations", ",", "transaction_id", "=", "None", ",", "single_use_transaction", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=...
Commits a transaction. The request includes the mutations to be applied to rows in the database. ``Commit`` might return an ``ABORTED`` error. This can occur at any time; commonly, the cause is conflicts with concurrent transactions. However, it can also happen for a variety of other re...
[ "Commits", "a", "transaction", ".", "The", "request", "includes", "the", "mutations", "to", "be", "applied", "to", "rows", "in", "the", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L1352-L1460
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.partition_query
def partition_query( self, session, sql, transaction=None, params=None, param_types=None, partition_options=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
python
def partition_query( self, session, sql, transaction=None, params=None, param_types=None, partition_options=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
[ "def", "partition_query", "(", "self", ",", "session", ",", "sql", ",", "transaction", "=", "None", ",", "params", "=", "None", ",", "param_types", "=", "None", ",", "partition_options", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "ga...
Creates a set of partition tokens that can be used to execute a query operation in parallel. Each of the returned partition tokens can be used by ``ExecuteStreamingSql`` to specify a subset of the query result to read. The same session and read-only transaction must be used by the Partit...
[ "Creates", "a", "set", "of", "partition", "tokens", "that", "can", "be", "used", "to", "execute", "a", "query", "operation", "in", "parallel", ".", "Each", "of", "the", "returned", "partition", "tokens", "can", "be", "used", "by", "ExecuteStreamingSql", "to"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L1541-L1679
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/gapic/spanner_client.py
SpannerClient.partition_read
def partition_read( self, session, table, key_set, transaction=None, index=None, columns=None, partition_options=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ...
python
def partition_read( self, session, table, key_set, transaction=None, index=None, columns=None, partition_options=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ...
[ "def", "partition_read", "(", "self", ",", "session", ",", "table", ",", "key_set", ",", "transaction", "=", "None", ",", "index", "=", "None", ",", "columns", "=", "None", ",", "partition_options", "=", "None", ",", "retry", "=", "google", ".", "api_cor...
Creates a set of partition tokens that can be used to execute a read operation in parallel. Each of the returned partition tokens can be used by ``StreamingRead`` to specify a subset of the read result to read. The same session and read-only transaction must be used by the PartitionReadR...
[ "Creates", "a", "set", "of", "partition", "tokens", "that", "can", "be", "used", "to", "execute", "a", "read", "operation", "in", "parallel", ".", "Each", "of", "the", "returned", "partition", "tokens", "can", "be", "used", "by", "StreamingRead", "to", "sp...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/gapic/spanner_client.py#L1681-L1806
train
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/event_service_client.py
EventServiceClient.create_client_event
def create_client_event( self, parent, client_event, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Report events issued when end user interacts with customer's application ...
python
def create_client_event( self, parent, client_event, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Report events issued when end user interacts with customer's application ...
[ "def", "create_client_event", "(", "self", ",", "parent", ",", "client_event", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", "."...
Report events issued when end user interacts with customer's application that uses Cloud Talent Solution. You may inspect the created events in `self service tools <https://console.cloud.google.com/talent-solution/overview>`__. `Learn more <https://cloud.google.com/talent-solutio...
[ "Report", "events", "issued", "when", "end", "user", "interacts", "with", "customer", "s", "application", "that", "uses", "Cloud", "Talent", "Solution", ".", "You", "may", "inspect", "the", "created", "events", "in", "self", "service", "tools", "<https", ":", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/event_service_client.py#L182-L255
train
googleapis/google-cloud-python
datastore/google/cloud/datastore/_gapic.py
make_datastore_api
def make_datastore_api(client): """Create an instance of the GAPIC Datastore API. :type client: :class:`~google.cloud.datastore.client.Client` :param client: The client that holds configuration details. :rtype: :class:`.datastore.v1.datastore_client.DatastoreClient` :returns: A datastore API insta...
python
def make_datastore_api(client): """Create an instance of the GAPIC Datastore API. :type client: :class:`~google.cloud.datastore.client.Client` :param client: The client that holds configuration details. :rtype: :class:`.datastore.v1.datastore_client.DatastoreClient` :returns: A datastore API insta...
[ "def", "make_datastore_api", "(", "client", ")", ":", "parse_result", "=", "six", ".", "moves", ".", "urllib_parse", ".", "urlparse", "(", "client", ".", "_base_url", ")", "host", "=", "parse_result", ".", "netloc", "if", "parse_result", ".", "scheme", "==",...
Create an instance of the GAPIC Datastore API. :type client: :class:`~google.cloud.datastore.client.Client` :param client: The client that holds configuration details. :rtype: :class:`.datastore.v1.datastore_client.DatastoreClient` :returns: A datastore API instance with the proper credentials.
[ "Create", "an", "instance", "of", "the", "GAPIC", "Datastore", "API", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/_gapic.py#L28-L49
train
googleapis/google-cloud-python
bigquery/noxfile.py
default
def default(session): """Default unit test session. This is intended to be run **without** an interpreter set, so that the current ``python`` (on the ``PATH``) or the version of Python corresponding to the ``nox`` binary the ``PATH`` can run the tests. """ # Install all test dependencies, t...
python
def default(session): """Default unit test session. This is intended to be run **without** an interpreter set, so that the current ``python`` (on the ``PATH``) or the version of Python corresponding to the ``nox`` binary the ``PATH`` can run the tests. """ # Install all test dependencies, t...
[ "def", "default", "(", "session", ")", ":", "# Install all test dependencies, then install local packages in-place.", "session", ".", "install", "(", "\"mock\"", ",", "\"pytest\"", ",", "\"pytest-cov\"", ")", "for", "local_dep", "in", "LOCAL_DEPS", ":", "session", ".", ...
Default unit test session. This is intended to be run **without** an interpreter set, so that the current ``python`` (on the ``PATH``) or the version of Python corresponding to the ``nox`` binary the ``PATH`` can run the tests.
[ "Default", "unit", "test", "session", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/noxfile.py#L28-L63
train
googleapis/google-cloud-python
bigquery/noxfile.py
snippets
def snippets(session): """Run the snippets test suite.""" # Sanity check: Only run snippets 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, ...
python
def snippets(session): """Run the snippets test suite.""" # Sanity check: Only run snippets 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, ...
[ "def", "snippets", "(", "session", ")", ":", "# Sanity check: Only run snippets tests if the environment variable is set.", "if", "not", "os", ".", "environ", ".", "get", "(", "\"GOOGLE_APPLICATION_CREDENTIALS\"", ",", "\"\"", ")", ":", "session", ".", "skip", "(", "\...
Run the snippets test suite.
[ "Run", "the", "snippets", "test", "suite", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/noxfile.py#L104-L121
train
googleapis/google-cloud-python
bigquery/noxfile.py
lint
def lint(session): """Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ session.install("black", "flake8", *LOCAL_DEPS) session.install(".") session.run("flake8", os.path.join("google", "cloud", "bigquery")) session.run("...
python
def lint(session): """Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ session.install("black", "flake8", *LOCAL_DEPS) session.install(".") session.run("flake8", os.path.join("google", "cloud", "bigquery")) session.run("...
[ "def", "lint", "(", "session", ")", ":", "session", ".", "install", "(", "\"black\"", ",", "\"flake8\"", ",", "*", "LOCAL_DEPS", ")", "session", ".", "install", "(", "\".\"", ")", "session", ".", "run", "(", "\"flake8\"", ",", "os", ".", "path", ".", ...
Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality issues.
[ "Run", "linters", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/noxfile.py#L137-L149
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/message.py
_indent
def _indent(lines, prefix=" "): """Indent some text. Note that this is present as ``textwrap.indent``, but not in Python 2. Args: lines (str): The newline delimited string to be indented. prefix (Optional[str]): The prefix to indent each line with. Default to two spaces. ...
python
def _indent(lines, prefix=" "): """Indent some text. Note that this is present as ``textwrap.indent``, but not in Python 2. Args: lines (str): The newline delimited string to be indented. prefix (Optional[str]): The prefix to indent each line with. Default to two spaces. ...
[ "def", "_indent", "(", "lines", ",", "prefix", "=", "\" \"", ")", ":", "indented", "=", "[", "]", "for", "line", "in", "lines", ".", "split", "(", "\"\\n\"", ")", ":", "indented", ".", "append", "(", "prefix", "+", "line", ")", "return", "\"\\n\"", ...
Indent some text. Note that this is present as ``textwrap.indent``, but not in Python 2. Args: lines (str): The newline delimited string to be indented. prefix (Optional[str]): The prefix to indent each line with. Default to two spaces. Returns: str: The newly indented...
[ "Indent", "some", "text", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L33-L49
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/message.py
Message.publish_time
def publish_time(self): """Return the time that the message was originally published. Returns: datetime: The date and time that the message was published. """ timestamp = self._message.publish_time delta = datetime.timedelta( seconds=timestamp.seconds, mi...
python
def publish_time(self): """Return the time that the message was originally published. Returns: datetime: The date and time that the message was published. """ timestamp = self._message.publish_time delta = datetime.timedelta( seconds=timestamp.seconds, mi...
[ "def", "publish_time", "(", "self", ")", ":", "timestamp", "=", "self", ".", "_message", ".", "publish_time", "delta", "=", "datetime", ".", "timedelta", "(", "seconds", "=", "timestamp", ".", "seconds", ",", "microseconds", "=", "timestamp", ".", "nanos", ...
Return the time that the message was originally published. Returns: datetime: The date and time that the message was published.
[ "Return", "the", "time", "that", "the", "message", "was", "originally", "published", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L147-L157
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/message.py
Message.ack
def ack(self): """Acknowledge the given message. Acknowledging a message in Pub/Sub means that you are done with it, and it will not be delivered to this subscription again. You should avoid acknowledging messages until you have *finished* processing them, so that in the event o...
python
def ack(self): """Acknowledge the given message. Acknowledging a message in Pub/Sub means that you are done with it, and it will not be delivered to this subscription again. You should avoid acknowledging messages until you have *finished* processing them, so that in the event o...
[ "def", "ack", "(", "self", ")", ":", "time_to_ack", "=", "math", ".", "ceil", "(", "time", ".", "time", "(", ")", "-", "self", ".", "_received_timestamp", ")", "self", ".", "_request_queue", ".", "put", "(", "requests", ".", "AckRequest", "(", "ack_id"...
Acknowledge the given message. Acknowledging a message in Pub/Sub means that you are done with it, and it will not be delivered to this subscription again. You should avoid acknowledging messages until you have *finished* processing them, so that in the event of a failure, you r...
[ "Acknowledge", "the", "given", "message", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L169-L188
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/message.py
Message.drop
def drop(self): """Release the message from lease management. This informs the policy to no longer hold on to the lease for this message. Pub/Sub will re-deliver the message if it is not acknowledged before the existing lease expires. .. warning:: For most use cases...
python
def drop(self): """Release the message from lease management. This informs the policy to no longer hold on to the lease for this message. Pub/Sub will re-deliver the message if it is not acknowledged before the existing lease expires. .. warning:: For most use cases...
[ "def", "drop", "(", "self", ")", ":", "self", ".", "_request_queue", ".", "put", "(", "requests", ".", "DropRequest", "(", "ack_id", "=", "self", ".", "_ack_id", ",", "byte_size", "=", "self", ".", "size", ")", ")" ]
Release the message from lease management. This informs the policy to no longer hold on to the lease for this message. Pub/Sub will re-deliver the message if it is not acknowledged before the existing lease expires. .. warning:: For most use cases, the only reason to drop a...
[ "Release", "the", "message", "from", "lease", "management", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L190-L205
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/message.py
Message.lease
def lease(self): """Inform the policy to lease this message continually. .. note:: This method is called by the constructor, and you should never need to call it manually. """ self._request_queue.put( requests.LeaseRequest(ack_id=self._ack_id, byte_si...
python
def lease(self): """Inform the policy to lease this message continually. .. note:: This method is called by the constructor, and you should never need to call it manually. """ self._request_queue.put( requests.LeaseRequest(ack_id=self._ack_id, byte_si...
[ "def", "lease", "(", "self", ")", ":", "self", ".", "_request_queue", ".", "put", "(", "requests", ".", "LeaseRequest", "(", "ack_id", "=", "self", ".", "_ack_id", ",", "byte_size", "=", "self", ".", "size", ")", ")" ]
Inform the policy to lease this message continually. .. note:: This method is called by the constructor, and you should never need to call it manually.
[ "Inform", "the", "policy", "to", "lease", "this", "message", "continually", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L207-L216
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/message.py
Message.modify_ack_deadline
def modify_ack_deadline(self, seconds): """Resets the deadline for acknowledgement. New deadline will be the given value of seconds from now. The default implementation handles this for you; you should not need to manually deal with setting ack deadlines. The exception case is ...
python
def modify_ack_deadline(self, seconds): """Resets the deadline for acknowledgement. New deadline will be the given value of seconds from now. The default implementation handles this for you; you should not need to manually deal with setting ack deadlines. The exception case is ...
[ "def", "modify_ack_deadline", "(", "self", ",", "seconds", ")", ":", "self", ".", "_request_queue", ".", "put", "(", "requests", ".", "ModAckRequest", "(", "ack_id", "=", "self", ".", "_ack_id", ",", "seconds", "=", "seconds", ")", ")" ]
Resets the deadline for acknowledgement. New deadline will be the given value of seconds from now. The default implementation handles this for you; you should not need to manually deal with setting ack deadlines. The exception case is if you are implementing your own custom subclass of...
[ "Resets", "the", "deadline", "for", "acknowledgement", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L218-L235
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/message.py
Message.nack
def nack(self): """Decline to acknowldge the given message. This will cause the message to be re-delivered to the subscription. """ self._request_queue.put( requests.NackRequest(ack_id=self._ack_id, byte_size=self.size) )
python
def nack(self): """Decline to acknowldge the given message. This will cause the message to be re-delivered to the subscription. """ self._request_queue.put( requests.NackRequest(ack_id=self._ack_id, byte_size=self.size) )
[ "def", "nack", "(", "self", ")", ":", "self", ".", "_request_queue", ".", "put", "(", "requests", ".", "NackRequest", "(", "ack_id", "=", "self", ".", "_ack_id", ",", "byte_size", "=", "self", ".", "size", ")", ")" ]
Decline to acknowldge the given message. This will cause the message to be re-delivered to the subscription.
[ "Decline", "to", "acknowldge", "the", "given", "message", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/message.py#L237-L244
train
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/magics.py
_run_query
def _run_query(client, query, job_config=None): """Runs a query while printing status updates Args: client (google.cloud.bigquery.client.Client): Client to bundle configuration needed for API requests. query (str): SQL query to be executed. Defaults to the standard SQL d...
python
def _run_query(client, query, job_config=None): """Runs a query while printing status updates Args: client (google.cloud.bigquery.client.Client): Client to bundle configuration needed for API requests. query (str): SQL query to be executed. Defaults to the standard SQL d...
[ "def", "_run_query", "(", "client", ",", "query", ",", "job_config", "=", "None", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "query_job", "=", "client", ".", "query", "(", "query", ",", "job_config", "=", "job_config", ")", "print", "(...
Runs a query while printing status updates Args: client (google.cloud.bigquery.client.Client): Client to bundle configuration needed for API requests. query (str): SQL query to be executed. Defaults to the standard SQL dialect. Use the ``job_config`` parameter to...
[ "Runs", "a", "query", "while", "printing", "status", "updates" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/magics.py#L243-L278
train
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/magics.py
_cell_magic
def _cell_magic(line, query): """Underlying function for bigquery cell magic Note: This function contains the underlying logic for the 'bigquery' cell magic. This function is not meant to be called directly. Args: line (str): "%%bigquery" followed by arguments as required q...
python
def _cell_magic(line, query): """Underlying function for bigquery cell magic Note: This function contains the underlying logic for the 'bigquery' cell magic. This function is not meant to be called directly. Args: line (str): "%%bigquery" followed by arguments as required q...
[ "def", "_cell_magic", "(", "line", ",", "query", ")", ":", "args", "=", "magic_arguments", ".", "parse_argstring", "(", "_cell_magic", ",", "line", ")", "params", "=", "[", "]", "if", "args", ".", "params", "is", "not", "None", ":", "try", ":", "params...
Underlying function for bigquery cell magic Note: This function contains the underlying logic for the 'bigquery' cell magic. This function is not meant to be called directly. Args: line (str): "%%bigquery" followed by arguments as required query (str): SQL query to run Ret...
[ "Underlying", "function", "for", "bigquery", "cell", "magic" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/magics.py#L336-L381
train
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/magics.py
Context.credentials
def credentials(self): """google.auth.credentials.Credentials: Credentials to use for queries performed through IPython magics Note: These credentials do not need to be explicitly defined if you are using Application Default Credentials. If you are not using ...
python
def credentials(self): """google.auth.credentials.Credentials: Credentials to use for queries performed through IPython magics Note: These credentials do not need to be explicitly defined if you are using Application Default Credentials. If you are not using ...
[ "def", "credentials", "(", "self", ")", ":", "if", "self", ".", "_credentials", "is", "None", ":", "self", ".", "_credentials", ",", "_", "=", "google", ".", "auth", ".", "default", "(", ")", "return", "self", ".", "_credentials" ]
google.auth.credentials.Credentials: Credentials to use for queries performed through IPython magics Note: These credentials do not need to be explicitly defined if you are using Application Default Credentials. If you are not using Application Default Credentials, m...
[ "google", ".", "auth", ".", "credentials", ".", "Credentials", ":", "Credentials", "to", "use", "for", "queries", "performed", "through", "IPython", "magics" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/magics.py#L165-L193
train
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/magics.py
Context.project
def project(self): """str: Default project to use for queries performed through IPython magics Note: The project does not need to be explicitly defined if you have an environment default project set. If you do not have a default project set in your environmen...
python
def project(self): """str: Default project to use for queries performed through IPython magics Note: The project does not need to be explicitly defined if you have an environment default project set. If you do not have a default project set in your environmen...
[ "def", "project", "(", "self", ")", ":", "if", "self", ".", "_project", "is", "None", ":", "_", ",", "self", ".", "_project", "=", "google", ".", "auth", ".", "default", "(", ")", "return", "self", ".", "_project" ]
str: Default project to use for queries performed through IPython magics Note: The project does not need to be explicitly defined if you have an environment default project set. If you do not have a default project set in your environment, manually assign the project...
[ "str", ":", "Default", "project", "to", "use", "for", "queries", "performed", "through", "IPython", "magics" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/magics.py#L200-L218
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.database_root_path
def database_root_path(cls, project, database): """Return a fully-qualified database_root string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}", project=project, database=database, )
python
def database_root_path(cls, project, database): """Return a fully-qualified database_root string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}", project=project, database=database, )
[ "def", "database_root_path", "(", "cls", ",", "project", ",", "database", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/databases/{database}\"", ",", "project", "=", "project", ",", "database", "=", ...
Return a fully-qualified database_root string.
[ "Return", "a", "fully", "-", "qualified", "database_root", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L99-L105
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.document_root_path
def document_root_path(cls, project, database): """Return a fully-qualified document_root string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}/documents", project=project, database=database, )
python
def document_root_path(cls, project, database): """Return a fully-qualified document_root string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}/documents", project=project, database=database, )
[ "def", "document_root_path", "(", "cls", ",", "project", ",", "database", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/databases/{database}/documents\"", ",", "project", "=", "project", ",", "database...
Return a fully-qualified document_root string.
[ "Return", "a", "fully", "-", "qualified", "document_root", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L108-L114
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.document_path_path
def document_path_path(cls, project, database, document_path): """Return a fully-qualified document_path string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}/documents/{document_path=**}", project=project, database=database,...
python
def document_path_path(cls, project, database, document_path): """Return a fully-qualified document_path string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}/documents/{document_path=**}", project=project, database=database,...
[ "def", "document_path_path", "(", "cls", ",", "project", ",", "database", ",", "document_path", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/databases/{database}/documents/{document_path=**}\"", ",", "pro...
Return a fully-qualified document_path string.
[ "Return", "a", "fully", "-", "qualified", "document_path", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L117-L124
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.any_path_path
def any_path_path(cls, project, database, document, any_path): """Return a fully-qualified any_path string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}/documents/{document}/{any_path=**}", project=project, database=database...
python
def any_path_path(cls, project, database, document, any_path): """Return a fully-qualified any_path string.""" return google.api_core.path_template.expand( "projects/{project}/databases/{database}/documents/{document}/{any_path=**}", project=project, database=database...
[ "def", "any_path_path", "(", "cls", ",", "project", ",", "database", ",", "document", ",", "any_path", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/databases/{database}/documents/{document}/{any_path=**}\...
Return a fully-qualified any_path string.
[ "Return", "a", "fully", "-", "qualified", "any_path", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L127-L135
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.get_document
def get_document( self, name, mask=None, transaction=None, read_time=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Gets a single document. Example: ...
python
def get_document( self, name, mask=None, transaction=None, read_time=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Gets a single document. Example: ...
[ "def", "get_document", "(", "self", ",", "name", ",", "mask", "=", "None", ",", "transaction", "=", "None", ",", "read_time", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "="...
Gets a single document. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> name = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') >>> ...
[ "Gets", "a", "single", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L236-L328
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.list_documents
def list_documents( self, parent, collection_id, page_size=None, order_by=None, mask=None, transaction=None, read_time=None, show_missing=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.D...
python
def list_documents( self, parent, collection_id, page_size=None, order_by=None, mask=None, transaction=None, read_time=None, show_missing=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.D...
[ "def", "list_documents", "(", "self", ",", "parent", ",", "collection_id", ",", "page_size", "=", "None", ",", "order_by", "=", "None", ",", "mask", "=", "None", ",", "transaction", "=", "None", ",", "read_time", "=", "None", ",", "show_missing", "=", "N...
Lists documents. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') >>> >>> ...
[ "Lists", "documents", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L330-L467
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.create_document
def create_document( self, parent, collection_id, document_id, document, mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new document. ...
python
def create_document( self, parent, collection_id, document_id, document, mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new document. ...
[ "def", "create_document", "(", "self", ",", "parent", ",", "collection_id", ",", "document_id", ",", "document", ",", "mask", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", ...
Creates a new document. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') >>> ...
[ "Creates", "a", "new", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L469-L560
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.update_document
def update_document( self, document, update_mask, mask=None, current_document=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates or inserts a document. ...
python
def update_document( self, document, update_mask, mask=None, current_document=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates or inserts a document. ...
[ "def", "update_document", "(", "self", ",", "document", ",", "update_mask", ",", "mask", "=", "None", ",", "current_document", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", ...
Updates or inserts a document. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> # TODO: Initialize `document`: >>> document = {} >>> >>> # TODO: In...
[ "Updates", "or", "inserts", "a", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L562-L667
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.delete_document
def delete_document( self, name, current_document=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a document. Example: >>> from google.cloud import...
python
def delete_document( self, name, current_document=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes a document. Example: >>> from google.cloud import...
[ "def", "delete_document", "(", "self", ",", "name", ",", "current_document", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", ...
Deletes a document. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> name = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') >>> >>>...
[ "Deletes", "a", "document", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L669-L742
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.batch_get_documents
def batch_get_documents( self, database, documents, mask=None, transaction=None, new_transaction=None, read_time=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
python
def batch_get_documents( self, database, documents, mask=None, transaction=None, new_transaction=None, read_time=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
[ "def", "batch_get_documents", "(", "self", ",", "database", ",", "documents", ",", "mask", "=", "None", ",", "transaction", "=", "None", ",", "new_transaction", "=", "None", ",", "read_time", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", ...
Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() ...
[ "Gets", "multiple", "documents", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L744-L864
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.begin_transaction
def begin_transaction( self, database, options_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Starts a new transaction. Example: >>> from google.cloud im...
python
def begin_transaction( self, database, options_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Starts a new transaction. Example: >>> from google.cloud im...
[ "def", "begin_transaction", "(", "self", ",", "database", ",", "options_", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "m...
Starts a new transaction. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') >>> >>> response = c...
[ "Starts", "a", "new", "transaction", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L866-L942
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.run_query
def run_query( self, parent, structured_query=None, transaction=None, new_transaction=None, read_time=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Ru...
python
def run_query( self, parent, structured_query=None, transaction=None, new_transaction=None, read_time=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Ru...
[ "def", "run_query", "(", "self", ",", "parent", ",", "structured_query", "=", "None", ",", "transaction", "=", "None", ",", "new_transaction", "=", "None", ",", "read_time", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", ...
Runs a query. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') >>> >>> for...
[ "Runs", "a", "query", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L1102-L1214
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py
FirestoreClient.write
def write( self, requests, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Streams batches of document updates and deletes, in order. EXPERIMENTAL: This method interface might chang...
python
def write( self, requests, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Streams batches of document updates and deletes, in order. EXPERIMENTAL: This method interface might chang...
[ "def", "write", "(", "self", ",", "requests", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "metadata", ...
Streams batches of document updates and deletes, in order. EXPERIMENTAL: This method interface might change in the future. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> >>> da...
[ "Streams", "batches", "of", "document", "updates", "and", "deletes", "in", "order", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/firestore_client.py#L1216-L1276
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py
LoggingServiceV2Client.log_path
def log_path(cls, project, log): """Return a fully-qualified log string.""" return google.api_core.path_template.expand( "projects/{project}/logs/{log}", project=project, log=log )
python
def log_path(cls, project, log): """Return a fully-qualified log string.""" return google.api_core.path_template.expand( "projects/{project}/logs/{log}", project=project, log=log )
[ "def", "log_path", "(", "cls", ",", "project", ",", "log", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/logs/{log}\"", ",", "project", "=", "project", ",", "log", "=", "log", ")" ]
Return a fully-qualified log string.
[ "Return", "a", "fully", "-", "qualified", "log", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py#L75-L79
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py
LoggingServiceV2Client.delete_log
def delete_log( self, log_name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes all the log entries in a log. The log reappears if it receives new entries. Log entrie...
python
def delete_log( self, log_name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Deletes all the log entries in a log. The log reappears if it receives new entries. Log entrie...
[ "def", "delete_log", "(", "self", ",", "log_name", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "metadat...
Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Example: >>> from google.cloud import logging_v2 >>> >>> client = logging_v2.LoggingServi...
[ "Deletes", "all", "the", "log", "entries", "in", "a", "log", ".", "The", "log", "reappears", "if", "it", "receives", "new", "entries", ".", "Log", "entries", "written", "shortly", "before", "the", "delete", "operation", "might", "not", "be", "deleted", "."...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py#L187-L266
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py
LoggingServiceV2Client.write_log_entries
def write_log_entries( self, entries, log_name=None, resource=None, labels=None, partial_success=None, dry_run=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
python
def write_log_entries( self, entries, log_name=None, resource=None, labels=None, partial_success=None, dry_run=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
[ "def", "write_log_entries", "(", "self", ",", "entries", ",", "log_name", "=", "None", ",", "resource", "=", "None", ",", "labels", "=", "None", ",", "partial_success", "=", "None", ",", "dry_run", "=", "None", ",", "retry", "=", "google", ".", "api_core...
Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 ...
[ "Writes", "log", "entries", "to", "Logging", ".", "This", "API", "method", "is", "the", "only", "way", "to", "send", "log", "entries", "to", "Logging", ".", "This", "method", "is", "used", "directly", "or", "indirectly", "by", "the", "Logging", "agent", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py#L268-L414
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py
LoggingServiceV2Client.list_log_entries
def list_log_entries( self, resource_names, project_ids=None, filter_=None, order_by=None, page_size=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Lis...
python
def list_log_entries( self, resource_names, project_ids=None, filter_=None, order_by=None, page_size=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Lis...
[ "def", "list_log_entries", "(", "self", ",", "resource_names", ",", "project_ids", "=", "None", ",", "filter_", "=", "None", ",", "order_by", "=", "None", ",", "page_size", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", ...
Lists log entries. Use this method to retrieve log entries from Logging. For ways to export log entries, see `Exporting Logs <https://cloud.google.com/logging/docs/export>`__. Example: >>> from google.cloud import logging_v2 >>> >>> client = logging_v2.Loggin...
[ "Lists", "log", "entries", ".", "Use", "this", "method", "to", "retrieve", "log", "entries", "from", "Logging", ".", "For", "ways", "to", "export", "log", "entries", "see", "Exporting", "Logs", "<https", ":", "//", "cloud", ".", "google", ".", "com", "/"...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py#L416-L544
train
googleapis/google-cloud-python
api_core/google/api_core/path_template.py
_expand_variable_match
def _expand_variable_match(positional_vars, named_vars, match): """Expand a matched variable with its value. Args: positional_vars (list): A list of positonal variables. This list will be modified. named_vars (dict): A dictionary of named variables. match (re.Match): A regul...
python
def _expand_variable_match(positional_vars, named_vars, match): """Expand a matched variable with its value. Args: positional_vars (list): A list of positonal variables. This list will be modified. named_vars (dict): A dictionary of named variables. match (re.Match): A regul...
[ "def", "_expand_variable_match", "(", "positional_vars", ",", "named_vars", ",", "match", ")", ":", "positional", "=", "match", ".", "group", "(", "\"positional\"", ")", "name", "=", "match", ".", "group", "(", "\"name\"", ")", "if", "name", "is", "not", "...
Expand a matched variable with its value. Args: positional_vars (list): A list of positonal variables. This list will be modified. named_vars (dict): A dictionary of named variables. match (re.Match): A regular expression match. Returns: str: The expanded variable t...
[ "Expand", "a", "matched", "variable", "with", "its", "value", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/path_template.py#L65-L101
train
googleapis/google-cloud-python
api_core/google/api_core/path_template.py
expand
def expand(tmpl, *args, **kwargs): """Expand a path template with the given variables. ..code-block:: python >>> expand('users/*/messages/*', 'me', '123') users/me/messages/123 >>> expand('/v1/{name=shelves/*/books/*}', name='shelves/1/books/3') /v1/shelves/1/books/3 Args:...
python
def expand(tmpl, *args, **kwargs): """Expand a path template with the given variables. ..code-block:: python >>> expand('users/*/messages/*', 'me', '123') users/me/messages/123 >>> expand('/v1/{name=shelves/*/books/*}', name='shelves/1/books/3') /v1/shelves/1/books/3 Args:...
[ "def", "expand", "(", "tmpl", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "replacer", "=", "functools", ".", "partial", "(", "_expand_variable_match", ",", "list", "(", "args", ")", ",", "kwargs", ")", "return", "_VARIABLE_RE", ".", "sub", "("...
Expand a path template with the given variables. ..code-block:: python >>> expand('users/*/messages/*', 'me', '123') users/me/messages/123 >>> expand('/v1/{name=shelves/*/books/*}', name='shelves/1/books/3') /v1/shelves/1/books/3 Args: tmpl (str): The path template. ...
[ "Expand", "a", "path", "template", "with", "the", "given", "variables", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/path_template.py#L104-L128
train
googleapis/google-cloud-python
api_core/google/api_core/path_template.py
_replace_variable_with_pattern
def _replace_variable_with_pattern(match): """Replace a variable match with a pattern that can be used to validate it. Args: match (re.Match): A regular expression match Returns: str: A regular expression pattern that can be used to validate the variable in an expanded path. ...
python
def _replace_variable_with_pattern(match): """Replace a variable match with a pattern that can be used to validate it. Args: match (re.Match): A regular expression match Returns: str: A regular expression pattern that can be used to validate the variable in an expanded path. ...
[ "def", "_replace_variable_with_pattern", "(", "match", ")", ":", "positional", "=", "match", ".", "group", "(", "\"positional\"", ")", "name", "=", "match", ".", "group", "(", "\"name\"", ")", "template", "=", "match", ".", "group", "(", "\"template\"", ")",...
Replace a variable match with a pattern that can be used to validate it. Args: match (re.Match): A regular expression match Returns: str: A regular expression pattern that can be used to validate the variable in an expanded path. Raises: ValueError: If an unexpected te...
[ "Replace", "a", "variable", "match", "with", "a", "pattern", "that", "can", "be", "used", "to", "validate", "it", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/path_template.py#L131-L159
train
googleapis/google-cloud-python
api_core/google/api_core/path_template.py
validate
def validate(tmpl, path): """Validate a path against the path template. .. code-block:: python >>> validate('users/*/messages/*', 'users/me/messages/123') True >>> validate('users/*/messages/*', 'users/me/drafts/123') False >>> validate('/v1/{name=shelves/*/books/*}', /...
python
def validate(tmpl, path): """Validate a path against the path template. .. code-block:: python >>> validate('users/*/messages/*', 'users/me/messages/123') True >>> validate('users/*/messages/*', 'users/me/drafts/123') False >>> validate('/v1/{name=shelves/*/books/*}', /...
[ "def", "validate", "(", "tmpl", ",", "path", ")", ":", "pattern", "=", "_generate_pattern_for_template", "(", "tmpl", ")", "+", "\"$\"", "return", "True", "if", "re", ".", "match", "(", "pattern", ",", "path", ")", "is", "not", "None", "else", "False" ]
Validate a path against the path template. .. code-block:: python >>> validate('users/*/messages/*', 'users/me/messages/123') True >>> validate('users/*/messages/*', 'users/me/drafts/123') False >>> validate('/v1/{name=shelves/*/books/*}', /v1/shelves/1/books/3) Tru...
[ "Validate", "a", "path", "against", "the", "path", "template", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/path_template.py#L175-L197
train
googleapis/google-cloud-python
storage/noxfile.py
default
def default(session): """Default unit test session. This is intended to be run **without** an interpreter set, so that the current ``python`` (on the ``PATH``) or the version of Python corresponding to the ``nox`` binary the ``PATH`` can run the tests. """ # Install all test dependencies, t...
python
def default(session): """Default unit test session. This is intended to be run **without** an interpreter set, so that the current ``python`` (on the ``PATH``) or the version of Python corresponding to the ``nox`` binary the ``PATH`` can run the tests. """ # Install all test dependencies, t...
[ "def", "default", "(", "session", ")", ":", "# Install all test dependencies, then install local packages in-place.", "session", ".", "install", "(", "'mock'", ",", "'pytest'", ",", "'pytest-cov'", ")", "for", "local_dep", "in", "LOCAL_DEPS", ":", "session", ".", "ins...
Default unit test session. This is intended to be run **without** an interpreter set, so that the current ``python`` (on the ``PATH``) or the version of Python corresponding to the ``nox`` binary the ``PATH`` can run the tests.
[ "Default", "unit", "test", "session", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/noxfile.py#L29-L55
train
googleapis/google-cloud-python
firestore/google/cloud/firestore_v1beta1/gapic/transports/firestore_grpc_transport.py
FirestoreGrpcTransport.create_channel
def create_channel(cls, address="firestore.googleapis.com:443", credentials=None): """Create and return a gRPC channel object. Args: address (str): The host for the channel to use. credentials (~.Credentials): The authorization credentials to attach to requests. ...
python
def create_channel(cls, address="firestore.googleapis.com:443", credentials=None): """Create and return a gRPC channel object. Args: address (str): The host for the channel to use. credentials (~.Credentials): The authorization credentials to attach to requests. ...
[ "def", "create_channel", "(", "cls", ",", "address", "=", "\"firestore.googleapis.com:443\"", ",", "credentials", "=", "None", ")", ":", "return", "google", ".", "api_core", ".", "grpc_helpers", ".", "create_channel", "(", "address", ",", "credentials", "=", "cr...
Create and return a gRPC channel object. Args: address (str): The host for the channel to use. credentials (~.Credentials): The authorization credentials to attach to requests. These credentials identify this application to the service. If ...
[ "Create", "and", "return", "a", "gRPC", "channel", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/gapic/transports/firestore_grpc_transport.py#L72-L88
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile.name
def name(self): """AppProfile name used in requests. .. note:: This property will not change if ``app_profile_id`` does not, but the return value is not cached. The AppProfile name is of the form ``"projects/../instances/../app_profile/{app_profile_id}"`` ...
python
def name(self): """AppProfile name used in requests. .. note:: This property will not change if ``app_profile_id`` does not, but the return value is not cached. The AppProfile name is of the form ``"projects/../instances/../app_profile/{app_profile_id}"`` ...
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "instance_admin_client", ".", "app_profile_path", "(", "self", ".", "_instance", ".", "_client", ".", "project", ",", "self", ".", "_instance", ".", "instance_id", ",", "self", ".", "app_profile_id...
AppProfile name used in requests. .. note:: This property will not change if ``app_profile_id`` does not, but the return value is not cached. The AppProfile name is of the form ``"projects/../instances/../app_profile/{app_profile_id}"`` :rtype: str :re...
[ "AppProfile", "name", "used", "in", "requests", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L85-L103
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile.from_pb
def from_pb(cls, app_profile_pb, instance): """Creates an instance app_profile from a protobuf. :type app_profile_pb: :class:`instance_pb2.app_profile_pb` :param app_profile_pb: An instance protobuf object. :type instance: :class:`google.cloud.bigtable.instance.Instance` :param...
python
def from_pb(cls, app_profile_pb, instance): """Creates an instance app_profile from a protobuf. :type app_profile_pb: :class:`instance_pb2.app_profile_pb` :param app_profile_pb: An instance protobuf object. :type instance: :class:`google.cloud.bigtable.instance.Instance` :param...
[ "def", "from_pb", "(", "cls", ",", "app_profile_pb", ",", "instance", ")", ":", "match_app_profile_name", "=", "_APP_PROFILE_NAME_RE", ".", "match", "(", "app_profile_pb", ".", "name", ")", "if", "match_app_profile_name", "is", "None", ":", "raise", "ValueError", ...
Creates an instance app_profile from a protobuf. :type app_profile_pb: :class:`instance_pb2.app_profile_pb` :param app_profile_pb: An instance protobuf object. :type instance: :class:`google.cloud.bigtable.instance.Instance` :param instance: The instance that owns the cluster. ...
[ "Creates", "an", "instance", "app_profile", "from", "a", "protobuf", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L131-L171
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile._update_from_pb
def _update_from_pb(self, app_profile_pb): """Refresh self from the server-provided protobuf. Helper for :meth:`from_pb` and :meth:`reload`. """ self.routing_policy_type = None self.allow_transactional_writes = None self.cluster_id = None self.description = app_p...
python
def _update_from_pb(self, app_profile_pb): """Refresh self from the server-provided protobuf. Helper for :meth:`from_pb` and :meth:`reload`. """ self.routing_policy_type = None self.allow_transactional_writes = None self.cluster_id = None self.description = app_p...
[ "def", "_update_from_pb", "(", "self", ",", "app_profile_pb", ")", ":", "self", ".", "routing_policy_type", "=", "None", "self", ".", "allow_transactional_writes", "=", "None", "self", ".", "cluster_id", "=", "None", "self", ".", "description", "=", "app_profile...
Refresh self from the server-provided protobuf. Helper for :meth:`from_pb` and :meth:`reload`.
[ "Refresh", "self", "from", "the", "server", "-", "provided", "protobuf", ".", "Helper", "for", ":", "meth", ":", "from_pb", "and", ":", "meth", ":", "reload", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L173-L193
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile._to_pb
def _to_pb(self): """Create an AppProfile proto buff message for API calls :rtype: :class:`.instance_pb2.AppProfile` :returns: The converted current object. :raises: :class:`ValueError <exceptions.ValueError>` if the AppProfile routing_policy_type is not set """...
python
def _to_pb(self): """Create an AppProfile proto buff message for API calls :rtype: :class:`.instance_pb2.AppProfile` :returns: The converted current object. :raises: :class:`ValueError <exceptions.ValueError>` if the AppProfile routing_policy_type is not set """...
[ "def", "_to_pb", "(", "self", ")", ":", "if", "not", "self", ".", "routing_policy_type", ":", "raise", "ValueError", "(", "\"AppProfile required routing policy.\"", ")", "single_cluster_routing", "=", "None", "multi_cluster_routing_use_any", "=", "None", "if", "self",...
Create an AppProfile proto buff message for API calls :rtype: :class:`.instance_pb2.AppProfile` :returns: The converted current object. :raises: :class:`ValueError <exceptions.ValueError>` if the AppProfile routing_policy_type is not set
[ "Create", "an", "AppProfile", "proto", "buff", "message", "for", "API", "calls", ":", "rtype", ":", ":", "class", ":", ".", "instance_pb2", ".", "AppProfile", ":", "returns", ":", "The", "converted", "current", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L195-L225
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile.reload
def reload(self): """Reload the metadata for this cluster""" app_profile_pb = self.instance_admin_client.get_app_profile(self.name) # NOTE: _update_from_pb does not check that the project and # app_profile ID on the response match the request. self._update_from_pb(app_pro...
python
def reload(self): """Reload the metadata for this cluster""" app_profile_pb = self.instance_admin_client.get_app_profile(self.name) # NOTE: _update_from_pb does not check that the project and # app_profile ID on the response match the request. self._update_from_pb(app_pro...
[ "def", "reload", "(", "self", ")", ":", "app_profile_pb", "=", "self", ".", "instance_admin_client", ".", "get_app_profile", "(", "self", ".", "name", ")", "# NOTE: _update_from_pb does not check that the project and", "# app_profile ID on the response match the request."...
Reload the metadata for this cluster
[ "Reload", "the", "metadata", "for", "this", "cluster" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L227-L234
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile.exists
def exists(self): """Check whether the AppProfile already exists. :rtype: bool :returns: True if the AppProfile exists, else False. """ try: self.instance_admin_client.get_app_profile(self.name) return True # NOTE: There could be other exceptions ...
python
def exists(self): """Check whether the AppProfile already exists. :rtype: bool :returns: True if the AppProfile exists, else False. """ try: self.instance_admin_client.get_app_profile(self.name) return True # NOTE: There could be other exceptions ...
[ "def", "exists", "(", "self", ")", ":", "try", ":", "self", ".", "instance_admin_client", ".", "get_app_profile", "(", "self", ".", "name", ")", "return", "True", "# NOTE: There could be other exceptions that are returned to the user.", "except", "NotFound", ":", "ret...
Check whether the AppProfile already exists. :rtype: bool :returns: True if the AppProfile exists, else False.
[ "Check", "whether", "the", "AppProfile", "already", "exists", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L236-L247
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile.create
def create(self, ignore_warnings=None): """Create this AppProfile. .. note:: Uses the ``instance`` and ``app_profile_id`` on the current :class:`AppProfile` in addition to the ``routing_policy_type``, ``description``, ``cluster_id`` and ``allow_transactional_writes`...
python
def create(self, ignore_warnings=None): """Create this AppProfile. .. note:: Uses the ``instance`` and ``app_profile_id`` on the current :class:`AppProfile` in addition to the ``routing_policy_type``, ``description``, ``cluster_id`` and ``allow_transactional_writes`...
[ "def", "create", "(", "self", ",", "ignore_warnings", "=", "None", ")", ":", "return", "self", ".", "from_pb", "(", "self", ".", "instance_admin_client", ".", "create_app_profile", "(", "parent", "=", "self", ".", "_instance", ".", "name", ",", "app_profile_...
Create this AppProfile. .. note:: Uses the ``instance`` and ``app_profile_id`` on the current :class:`AppProfile` in addition to the ``routing_policy_type``, ``description``, ``cluster_id`` and ``allow_transactional_writes``. To change them before creating, rese...
[ "Create", "this", "AppProfile", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L249-L283
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable/app_profile.py
AppProfile.update
def update(self, ignore_warnings=None): """Update this app_profile. .. note:: Update any or all of the following values: ``routing_policy_type`` ``description`` ``cluster_id`` ``allow_transactional_writes`` """ update_mask_pb...
python
def update(self, ignore_warnings=None): """Update this app_profile. .. note:: Update any or all of the following values: ``routing_policy_type`` ``description`` ``cluster_id`` ``allow_transactional_writes`` """ update_mask_pb...
[ "def", "update", "(", "self", ",", "ignore_warnings", "=", "None", ")", ":", "update_mask_pb", "=", "field_mask_pb2", ".", "FieldMask", "(", ")", "if", "self", ".", "description", "is", "not", "None", ":", "update_mask_pb", ".", "paths", ".", "append", "("...
Update this app_profile. .. note:: Update any or all of the following values: ``routing_policy_type`` ``description`` ``cluster_id`` ``allow_transactional_writes``
[ "Update", "this", "app_profile", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/app_profile.py#L285-L311
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/config_service_v2_client.py
ConfigServiceV2Client.sink_path
def sink_path(cls, project, sink): """Return a fully-qualified sink string.""" return google.api_core.path_template.expand( "projects/{project}/sinks/{sink}", project=project, sink=sink )
python
def sink_path(cls, project, sink): """Return a fully-qualified sink string.""" return google.api_core.path_template.expand( "projects/{project}/sinks/{sink}", project=project, sink=sink )
[ "def", "sink_path", "(", "cls", ",", "project", ",", "sink", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/sinks/{sink}\"", ",", "project", "=", "project", ",", "sink", "=", "sink", ")" ]
Return a fully-qualified sink string.
[ "Return", "a", "fully", "-", "qualified", "sink", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/config_service_v2_client.py#L88-L92
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/config_service_v2_client.py
ConfigServiceV2Client.exclusion_path
def exclusion_path(cls, project, exclusion): """Return a fully-qualified exclusion string.""" return google.api_core.path_template.expand( "projects/{project}/exclusions/{exclusion}", project=project, exclusion=exclusion, )
python
def exclusion_path(cls, project, exclusion): """Return a fully-qualified exclusion string.""" return google.api_core.path_template.expand( "projects/{project}/exclusions/{exclusion}", project=project, exclusion=exclusion, )
[ "def", "exclusion_path", "(", "cls", ",", "project", ",", "exclusion", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/exclusions/{exclusion}\"", ",", "project", "=", "project", ",", "exclusion", "=", ...
Return a fully-qualified exclusion string.
[ "Return", "a", "fully", "-", "qualified", "exclusion", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/config_service_v2_client.py#L95-L101
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/config_service_v2_client.py
ConfigServiceV2Client.create_sink
def create_sink( self, parent, sink, unique_writer_identity=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a sink that exports specified log entries to a desti...
python
def create_sink( self, parent, sink, unique_writer_identity=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a sink that exports specified log entries to a desti...
[ "def", "create_sink", "(", "self", ",", "parent", ",", "sink", ",", "unique_writer_identity", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", ...
Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's ``writer_identity`` is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. Exam...
[ "Creates", "a", "sink", "that", "exports", "specified", "log", "entries", "to", "a", "destination", ".", "The", "export", "of", "newly", "-", "ingested", "log", "entries", "begins", "immediately", "unless", "the", "sink", "s", "writer_identity", "is", "not", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/config_service_v2_client.py#L390-L493
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/config_service_v2_client.py
ConfigServiceV2Client.update_sink
def update_sink( self, sink_name, sink, unique_writer_identity=None, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates a sink. This method rep...
python
def update_sink( self, sink_name, sink, unique_writer_identity=None, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates a sink. This method rep...
[ "def", "update_sink", "(", "self", ",", "sink_name", ",", "sink", ",", "unique_writer_identity", "=", "None", ",", "update_mask", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "="...
Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: ``destination``, and ``filter``. The updated sink might also have a new ``writer_identity``; see the ``unique_writer_identity`` field. Example: >>> from google.cloud...
[ "Updates", "a", "sink", ".", "This", "method", "replaces", "the", "following", "fields", "in", "the", "existing", "sink", "with", "values", "from", "the", "new", "sink", ":", "destination", "and", "filter", ".", "The", "updated", "sink", "might", "also", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/config_service_v2_client.py#L495-L619
train
googleapis/google-cloud-python
logging/google/cloud/logging_v2/gapic/config_service_v2_client.py
ConfigServiceV2Client.create_exclusion
def create_exclusion( self, parent, exclusion, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new exclusion in a specified parent resource. Only log entries belong...
python
def create_exclusion( self, parent, exclusion, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new exclusion in a specified parent resource. Only log entries belong...
[ "def", "create_exclusion", "(", "self", ",", "parent", ",", "exclusion", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "D...
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. Example: >>> from google.cloud import logging_v2 >>> >>> client = logging_v2.ConfigServiceV2Cl...
[ "Creates", "a", "new", "exclusion", "in", "a", "specified", "parent", "resource", ".", "Only", "log", "entries", "belonging", "to", "that", "resource", "can", "be", "excluded", ".", "You", "can", "have", "up", "to", "10", "exclusions", "in", "a", "resource...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging_v2/gapic/config_service_v2_client.py#L886-L976
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/_helpers.py
_make_value_pb
def _make_value_pb(value): """Helper for :func:`_make_list_value_pbs`. :type value: scalar value :param value: value to convert :rtype: :class:`~google.protobuf.struct_pb2.Value` :returns: value protobufs :raises ValueError: if value is not of a known scalar type. """ if value is None:...
python
def _make_value_pb(value): """Helper for :func:`_make_list_value_pbs`. :type value: scalar value :param value: value to convert :rtype: :class:`~google.protobuf.struct_pb2.Value` :returns: value protobufs :raises ValueError: if value is not of a known scalar type. """ if value is None:...
[ "def", "_make_value_pb", "(", "value", ")", ":", "if", "value", "is", "None", ":", "return", "Value", "(", "null_value", "=", "\"NULL_VALUE\"", ")", "if", "isinstance", "(", "value", ",", "(", "list", ",", "tuple", ")", ")", ":", "return", "Value", "("...
Helper for :func:`_make_list_value_pbs`. :type value: scalar value :param value: value to convert :rtype: :class:`~google.protobuf.struct_pb2.Value` :returns: value protobufs :raises ValueError: if value is not of a known scalar type.
[ "Helper", "for", ":", "func", ":", "_make_list_value_pbs", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/_helpers.py#L51-L91
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/_helpers.py
_parse_value_pb
def _parse_value_pb(value_pb, field_type): """Convert a Value protobuf to cell data. :type value_pb: :class:`~google.protobuf.struct_pb2.Value` :param value_pb: protobuf to convert :type field_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Type` :param field_type: type code for the value ...
python
def _parse_value_pb(value_pb, field_type): """Convert a Value protobuf to cell data. :type value_pb: :class:`~google.protobuf.struct_pb2.Value` :param value_pb: protobuf to convert :type field_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Type` :param field_type: type code for the value ...
[ "def", "_parse_value_pb", "(", "value_pb", ",", "field_type", ")", ":", "if", "value_pb", ".", "HasField", "(", "\"null_value\"", ")", ":", "return", "None", "if", "field_type", ".", "code", "==", "type_pb2", ".", "STRING", ":", "result", "=", "value_pb", ...
Convert a Value protobuf to cell data. :type value_pb: :class:`~google.protobuf.struct_pb2.Value` :param value_pb: protobuf to convert :type field_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Type` :param field_type: type code for the value :rtype: varies on field_type :returns: valu...
[ "Convert", "a", "Value", "protobuf", "to", "cell", "data", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/_helpers.py#L122-L167
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/_helpers.py
_parse_list_value_pbs
def _parse_list_value_pbs(rows, row_type): """Convert a list of ListValue protobufs into a list of list of cell data. :type rows: list of :class:`~google.protobuf.struct_pb2.ListValue` :param rows: row data returned from a read/query :type row_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Stru...
python
def _parse_list_value_pbs(rows, row_type): """Convert a list of ListValue protobufs into a list of list of cell data. :type rows: list of :class:`~google.protobuf.struct_pb2.ListValue` :param rows: row data returned from a read/query :type row_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Stru...
[ "def", "_parse_list_value_pbs", "(", "rows", ",", "row_type", ")", ":", "result", "=", "[", "]", "for", "row", "in", "rows", ":", "row_data", "=", "[", "]", "for", "value_pb", ",", "field", "in", "zip", "(", "row", ".", "values", ",", "row_type", "."...
Convert a list of ListValue protobufs into a list of list of cell data. :type rows: list of :class:`~google.protobuf.struct_pb2.ListValue` :param rows: row data returned from a read/query :type row_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.StructType` :param row_type: row schema specificat...
[ "Convert", "a", "list", "of", "ListValue", "protobufs", "into", "a", "list", "of", "list", "of", "cell", "data", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/_helpers.py#L173-L191
train
googleapis/google-cloud-python
asset/google/cloud/asset_v1/gapic/asset_service_client.py
AssetServiceClient.export_assets
def export_assets( self, parent, output_config, read_time=None, asset_types=None, content_type=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Exports a...
python
def export_assets( self, parent, output_config, read_time=None, asset_types=None, content_type=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Exports a...
[ "def", "export_assets", "(", "self", ",", "parent", ",", "output_config", ",", "read_time", "=", "None", ",", "asset_types", "=", "None", ",", "content_type", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", ...
Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the ``google.longrunning.Operation`` API allowing you to keep track of the export. Example: >>> from google.cloud import asset_v1 ...
[ "Exports", "assets", "with", "time", "and", "resource", "types", "to", "a", "given", "Cloud", "Storage", "location", ".", "The", "output", "format", "is", "newline", "-", "delimited", "JSON", ".", "This", "API", "implements", "the", "google", ".", "longrunni...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/asset/google/cloud/asset_v1/gapic/asset_service_client.py#L179-L288
train
googleapis/google-cloud-python
asset/google/cloud/asset_v1/gapic/asset_service_client.py
AssetServiceClient.batch_get_assets_history
def batch_get_assets_history( self, parent, content_type, read_time_window, asset_names=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Batch gets the update hi...
python
def batch_get_assets_history( self, parent, content_type, read_time_window, asset_names=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Batch gets the update hi...
[ "def", "batch_get_assets_history", "(", "self", ",", "parent", ",", "content_type", ",", "read_time_window", ",", "asset_names", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "...
Batch gets the update history of assets that overlap a time window. For RESOURCE content, this API outputs history with asset in both non-delete or deleted status. For IAM\_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gap...
[ "Batch", "gets", "the", "update", "history", "of", "assets", "that", "overlap", "a", "time", "window", ".", "For", "RESOURCE", "content", "this", "API", "outputs", "history", "with", "asset", "in", "both", "non", "-", "delete", "or", "deleted", "status", "...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/asset/google/cloud/asset_v1/gapic/asset_service_client.py#L290-L387
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
_avro_schema
def _avro_schema(read_session): """Extract and parse Avro schema from a read session. Args: read_session ( \ ~google.cloud.bigquery_storage_v1beta1.types.ReadSession \ ): The read session associated with this read rows stream. This contains the schema, which ...
python
def _avro_schema(read_session): """Extract and parse Avro schema from a read session. Args: read_session ( \ ~google.cloud.bigquery_storage_v1beta1.types.ReadSession \ ): The read session associated with this read rows stream. This contains the schema, which ...
[ "def", "_avro_schema", "(", "read_session", ")", ":", "json_schema", "=", "json", ".", "loads", "(", "read_session", ".", "avro_schema", ".", "schema", ")", "column_names", "=", "tuple", "(", "(", "field", "[", "\"name\"", "]", "for", "field", "in", "json_...
Extract and parse Avro schema from a read session. Args: read_session ( \ ~google.cloud.bigquery_storage_v1beta1.types.ReadSession \ ): The read session associated with this read rows stream. This contains the schema, which is required to parse the data ...
[ "Extract", "and", "parse", "Avro", "schema", "from", "a", "read", "session", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L375-L393
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
_avro_rows
def _avro_rows(block, avro_schema): """Parse all rows in a stream block. Args: block ( \ ~google.cloud.bigquery_storage_v1beta1.types.ReadRowsResponse \ ): A block containing Avro bytes to parse into rows. avro_schema (fastavro.schema): A parsed Avro ...
python
def _avro_rows(block, avro_schema): """Parse all rows in a stream block. Args: block ( \ ~google.cloud.bigquery_storage_v1beta1.types.ReadRowsResponse \ ): A block containing Avro bytes to parse into rows. avro_schema (fastavro.schema): A parsed Avro ...
[ "def", "_avro_rows", "(", "block", ",", "avro_schema", ")", ":", "blockio", "=", "six", ".", "BytesIO", "(", "block", ".", "avro_rows", ".", "serialized_binary_rows", ")", "while", "True", ":", "# Loop in a while loop because schemaless_reader can only read", "# a sin...
Parse all rows in a stream block. Args: block ( \ ~google.cloud.bigquery_storage_v1beta1.types.ReadRowsResponse \ ): A block containing Avro bytes to parse into rows. avro_schema (fastavro.schema): A parsed Avro schema, used to deserialized the bytes in t...
[ "Parse", "all", "rows", "in", "a", "stream", "block", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L396-L421
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
_copy_stream_position
def _copy_stream_position(position): """Copy a StreamPosition. Args: position (Union[ \ dict, \ ~google.cloud.bigquery_storage_v1beta1.types.StreamPosition \ ]): StreamPostion (or dictionary in StreamPosition format) to copy. Returns: ~google.clo...
python
def _copy_stream_position(position): """Copy a StreamPosition. Args: position (Union[ \ dict, \ ~google.cloud.bigquery_storage_v1beta1.types.StreamPosition \ ]): StreamPostion (or dictionary in StreamPosition format) to copy. Returns: ~google.clo...
[ "def", "_copy_stream_position", "(", "position", ")", ":", "if", "isinstance", "(", "position", ",", "types", ".", "StreamPosition", ")", ":", "output", "=", "types", ".", "StreamPosition", "(", ")", "output", ".", "CopyFrom", "(", "position", ")", "return",...
Copy a StreamPosition. Args: position (Union[ \ dict, \ ~google.cloud.bigquery_storage_v1beta1.types.StreamPosition \ ]): StreamPostion (or dictionary in StreamPosition format) to copy. Returns: ~google.cloud.bigquery_storage_v1beta1.types.StreamPosi...
[ "Copy", "a", "StreamPosition", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L424-L443
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
ReadRowsStream._reconnect
def _reconnect(self): """Reconnect to the ReadRows stream using the most recent offset.""" self._wrapped = self._client.read_rows( _copy_stream_position(self._position), **self._read_rows_kwargs )
python
def _reconnect(self): """Reconnect to the ReadRows stream using the most recent offset.""" self._wrapped = self._client.read_rows( _copy_stream_position(self._position), **self._read_rows_kwargs )
[ "def", "_reconnect", "(", "self", ")", ":", "self", ".", "_wrapped", "=", "self", ".", "_client", ".", "read_rows", "(", "_copy_stream_position", "(", "self", ".", "_position", ")", ",", "*", "*", "self", ".", "_read_rows_kwargs", ")" ]
Reconnect to the ReadRows stream using the most recent offset.
[ "Reconnect", "to", "the", "ReadRows", "stream", "using", "the", "most", "recent", "offset", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L128-L132
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
ReadRowsStream.to_dataframe
def to_dataframe(self, read_session, dtypes=None): """Create a :class:`pandas.DataFrame` of all rows in the stream. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. T...
python
def to_dataframe(self, read_session, dtypes=None): """Create a :class:`pandas.DataFrame` of all rows in the stream. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. T...
[ "def", "to_dataframe", "(", "self", ",", "read_session", ",", "dtypes", "=", "None", ")", ":", "if", "fastavro", "is", "None", ":", "raise", "ImportError", "(", "_FASTAVRO_REQUIRED", ")", "if", "pandas", "is", "None", ":", "raise", "ImportError", "(", "_PA...
Create a :class:`pandas.DataFrame` of all rows in the stream. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. They are currently parsed as strings in the fastavr...
[ "Create", "a", ":", "class", ":", "pandas", ".", "DataFrame", "of", "all", "rows", "in", "the", "stream", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L161-L195
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
ReadRowsIterable.pages
def pages(self): """A generator of all pages in the stream. Returns: types.GeneratorType[google.cloud.bigquery_storage_v1beta1.ReadRowsPage]: A generator of pages. """ # Each page is an iterator of rows. But also has num_items, remaining, # and to_dat...
python
def pages(self): """A generator of all pages in the stream. Returns: types.GeneratorType[google.cloud.bigquery_storage_v1beta1.ReadRowsPage]: A generator of pages. """ # Each page is an iterator of rows. But also has num_items, remaining, # and to_dat...
[ "def", "pages", "(", "self", ")", ":", "# Each page is an iterator of rows. But also has num_items, remaining,", "# and to_dataframe.", "avro_schema", ",", "column_names", "=", "_avro_schema", "(", "self", ".", "_read_session", ")", "for", "block", "in", "self", ".", "_...
A generator of all pages in the stream. Returns: types.GeneratorType[google.cloud.bigquery_storage_v1beta1.ReadRowsPage]: A generator of pages.
[ "A", "generator", "of", "all", "pages", "in", "the", "stream", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L226-L238
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
ReadRowsIterable.to_dataframe
def to_dataframe(self, dtypes=None): """Create a :class:`pandas.DataFrame` of all rows in the stream. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. They are curren...
python
def to_dataframe(self, dtypes=None): """Create a :class:`pandas.DataFrame` of all rows in the stream. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. They are curren...
[ "def", "to_dataframe", "(", "self", ",", "dtypes", "=", "None", ")", ":", "if", "pandas", "is", "None", ":", "raise", "ImportError", "(", "_PANDAS_REQUIRED", ")", "frames", "=", "[", "]", "for", "page", "in", "self", ".", "pages", ":", "frames", ".", ...
Create a :class:`pandas.DataFrame` of all rows in the stream. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. They are currently parsed as strings in the fastavr...
[ "Create", "a", ":", "class", ":", "pandas", ".", "DataFrame", "of", "all", "rows", "in", "the", "stream", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L246-L275
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
ReadRowsPage._parse_block
def _parse_block(self): """Parse metadata and rows from the block only once.""" if self._iter_rows is not None: return rows = _avro_rows(self._block, self._avro_schema) self._num_items = self._block.avro_rows.row_count self._remaining = self._block.avro_rows.row_coun...
python
def _parse_block(self): """Parse metadata and rows from the block only once.""" if self._iter_rows is not None: return rows = _avro_rows(self._block, self._avro_schema) self._num_items = self._block.avro_rows.row_count self._remaining = self._block.avro_rows.row_coun...
[ "def", "_parse_block", "(", "self", ")", ":", "if", "self", ".", "_iter_rows", "is", "not", "None", ":", "return", "rows", "=", "_avro_rows", "(", "self", ".", "_block", ",", "self", ".", "_avro_schema", ")", "self", ".", "_num_items", "=", "self", "."...
Parse metadata and rows from the block only once.
[ "Parse", "metadata", "and", "rows", "from", "the", "block", "only", "once", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L301-L309
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
ReadRowsPage.next
def next(self): """Get the next row in the page.""" self._parse_block() if self._remaining > 0: self._remaining -= 1 return six.next(self._iter_rows)
python
def next(self): """Get the next row in the page.""" self._parse_block() if self._remaining > 0: self._remaining -= 1 return six.next(self._iter_rows)
[ "def", "next", "(", "self", ")", ":", "self", ".", "_parse_block", "(", ")", "if", "self", ".", "_remaining", ">", "0", ":", "self", ".", "_remaining", "-=", "1", "return", "six", ".", "next", "(", "self", ".", "_iter_rows", ")" ]
Get the next row in the page.
[ "Get", "the", "next", "row", "in", "the", "page", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L327-L332
train
googleapis/google-cloud-python
bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py
ReadRowsPage.to_dataframe
def to_dataframe(self, dtypes=None): """Create a :class:`pandas.DataFrame` of rows in the page. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. They are currently pa...
python
def to_dataframe(self, dtypes=None): """Create a :class:`pandas.DataFrame` of rows in the page. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. They are currently pa...
[ "def", "to_dataframe", "(", "self", ",", "dtypes", "=", "None", ")", ":", "if", "pandas", "is", "None", ":", "raise", "ImportError", "(", "_PANDAS_REQUIRED", ")", "if", "dtypes", "is", "None", ":", "dtypes", "=", "{", "}", "columns", "=", "collections", ...
Create a :class:`pandas.DataFrame` of rows in the page. This method requires the pandas libary to create a data frame and the fastavro library to parse row blocks. .. warning:: DATETIME columns are not supported. They are currently parsed as strings in the fastavro libr...
[ "Create", "a", ":", "class", ":", "pandas", ".", "DataFrame", "of", "rows", "in", "the", "page", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/reader.py#L337-L372
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py
InstanceAdminClient.instance_config_path
def instance_config_path(cls, project, instance_config): """Return a fully-qualified instance_config string.""" return google.api_core.path_template.expand( "projects/{project}/instanceConfigs/{instance_config}", project=project, instance_config=instance_config, ...
python
def instance_config_path(cls, project, instance_config): """Return a fully-qualified instance_config string.""" return google.api_core.path_template.expand( "projects/{project}/instanceConfigs/{instance_config}", project=project, instance_config=instance_config, ...
[ "def", "instance_config_path", "(", "cls", ",", "project", ",", "instance_config", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instanceConfigs/{instance_config}\"", ",", "project", "=", "project", ",",...
Return a fully-qualified instance_config string.
[ "Return", "a", "fully", "-", "qualified", "instance_config", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py#L110-L116
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py
InstanceAdminClient.create_instance
def create_instance( self, parent, instance_id, instance, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an instance and begins preparing it to begin serving. The ...
python
def create_instance( self, parent, instance_id, instance, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an instance and begins preparing it to begin serving. The ...
[ "def", "create_instance", "(", "self", ",", "parent", ",", "instance_id", ",", "instance", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", ...
Creates an instance and begins preparing it to begin serving. The returned ``long-running operation`` can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, ``CreateInstance`` returns ``ALREADY_E...
[ "Creates", "an", "instance", "and", "begins", "preparing", "it", "to", "begin", "serving", ".", "The", "returned", "long", "-", "running", "operation", "can", "be", "used", "to", "track", "the", "progress", "of", "preparing", "the", "new", "instance", ".", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py#L594-L725
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py
InstanceAdminClient.update_instance
def update_instance( self, instance, field_mask, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an instance, and begins allocating or releasing resources as requeste...
python
def update_instance( self, instance, field_mask, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an instance, and begins allocating or releasing resources as requeste...
[ "def", "update_instance", "(", "self", ",", "instance", ",", "field_mask", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", ...
Updates an instance, and begins allocating or releasing resources as requested. The returned ``long-running operation`` can be used to track the progress of updating the instance. If the named instance does not exist, returns ``NOT_FOUND``. Immediately upon completion of this request: ...
[ "Updates", "an", "instance", "and", "begins", "allocating", "or", "releasing", "resources", "as", "requested", ".", "The", "returned", "long", "-", "running", "operation", "can", "be", "used", "to", "track", "the", "progress", "of", "updating", "the", "instanc...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py#L727-L866
train
googleapis/google-cloud-python
websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py
WebSecurityScannerClient.finding_path
def finding_path(cls, project, scan_config, scan_run, finding): """Return a fully-qualified finding string.""" return google.api_core.path_template.expand( "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}", project=project, scan_con...
python
def finding_path(cls, project, scan_config, scan_run, finding): """Return a fully-qualified finding string.""" return google.api_core.path_template.expand( "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}", project=project, scan_con...
[ "def", "finding_path", "(", "cls", ",", "project", ",", "scan_config", ",", "scan_run", ",", "finding", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/...
Return a fully-qualified finding string.
[ "Return", "a", "fully", "-", "qualified", "finding", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py#L87-L95
train
googleapis/google-cloud-python
websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py
WebSecurityScannerClient.scan_config_path
def scan_config_path(cls, project, scan_config): """Return a fully-qualified scan_config string.""" return google.api_core.path_template.expand( "projects/{project}/scanConfigs/{scan_config}", project=project, scan_config=scan_config, )
python
def scan_config_path(cls, project, scan_config): """Return a fully-qualified scan_config string.""" return google.api_core.path_template.expand( "projects/{project}/scanConfigs/{scan_config}", project=project, scan_config=scan_config, )
[ "def", "scan_config_path", "(", "cls", ",", "project", ",", "scan_config", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/scanConfigs/{scan_config}\"", ",", "project", "=", "project", ",", "scan_config"...
Return a fully-qualified scan_config string.
[ "Return", "a", "fully", "-", "qualified", "scan_config", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py#L105-L111
train
googleapis/google-cloud-python
websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py
WebSecurityScannerClient.scan_run_path
def scan_run_path(cls, project, scan_config, scan_run): """Return a fully-qualified scan_run string.""" return google.api_core.path_template.expand( "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}", project=project, scan_config=scan_config, ...
python
def scan_run_path(cls, project, scan_config, scan_run): """Return a fully-qualified scan_run string.""" return google.api_core.path_template.expand( "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}", project=project, scan_config=scan_config, ...
[ "def", "scan_run_path", "(", "cls", ",", "project", ",", "scan_config", ",", "scan_run", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}\"", ",", "project", "=...
Return a fully-qualified scan_run string.
[ "Return", "a", "fully", "-", "qualified", "scan_run", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py#L114-L121
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/client.py
Client.instance_admin_api
def instance_admin_api(self): """Helper for session-related API calls.""" if self._instance_admin_api is None: self._instance_admin_api = InstanceAdminClient( credentials=self.credentials, client_info=_CLIENT_INFO ) return self._instance_admin_api
python
def instance_admin_api(self): """Helper for session-related API calls.""" if self._instance_admin_api is None: self._instance_admin_api = InstanceAdminClient( credentials=self.credentials, client_info=_CLIENT_INFO ) return self._instance_admin_api
[ "def", "instance_admin_api", "(", "self", ")", ":", "if", "self", ".", "_instance_admin_api", "is", "None", ":", "self", ".", "_instance_admin_api", "=", "InstanceAdminClient", "(", "credentials", "=", "self", ".", "credentials", ",", "client_info", "=", "_CLIEN...
Helper for session-related API calls.
[ "Helper", "for", "session", "-", "related", "API", "calls", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/client.py#L152-L158
train