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
logging/google/cloud/logging/_gapic.py
_item_to_entry
def _item_to_entry(iterator, entry_pb, loggers): """Convert a log entry protobuf to the native object. .. note:: This method does not have the correct signature to be used as the ``item_to_value`` argument to :class:`~google.api_core.page_iterator.Iterator`. It is intended to be ...
python
def _item_to_entry(iterator, entry_pb, loggers): """Convert a log entry protobuf to the native object. .. note:: This method does not have the correct signature to be used as the ``item_to_value`` argument to :class:`~google.api_core.page_iterator.Iterator`. It is intended to be ...
[ "def", "_item_to_entry", "(", "iterator", ",", "entry_pb", ",", "loggers", ")", ":", "resource", "=", "_parse_log_entry", "(", "entry_pb", ")", "return", "entry_from_resource", "(", "resource", ",", "iterator", ".", "client", ",", "loggers", ")" ]
Convert a log entry protobuf to the native object. .. note:: This method does not have the correct signature to be used as the ``item_to_value`` argument to :class:`~google.api_core.page_iterator.Iterator`. It is intended to be patched with a mutable ``loggers`` argument that can b...
[ "Convert", "a", "log", "entry", "protobuf", "to", "the", "native", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L468-L496
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_item_to_sink
def _item_to_sink(iterator, log_sink_pb): """Convert a sink protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_sink_pb: :class:`.logging_config_pb2.LogSink` :param log_sink_pb: Si...
python
def _item_to_sink(iterator, log_sink_pb): """Convert a sink protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_sink_pb: :class:`.logging_config_pb2.LogSink` :param log_sink_pb: Si...
[ "def", "_item_to_sink", "(", "iterator", ",", "log_sink_pb", ")", ":", "# NOTE: LogSink message type does not have an ``Any`` field", "# so `MessageToDict`` can safely be used.", "resource", "=", "MessageToDict", "(", "log_sink_pb", ")", "return", "Sink", ".", "from_api_r...
Convert a sink protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_sink_pb: :class:`.logging_config_pb2.LogSink` :param log_sink_pb: Sink protobuf returned from the API. :rtype: :...
[ "Convert", "a", "sink", "protobuf", "to", "the", "native", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L499-L515
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_item_to_metric
def _item_to_metric(iterator, log_metric_pb): """Convert a metric protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_metric_pb: :class:`.logging_metrics_pb2.LogMetric` :param log_...
python
def _item_to_metric(iterator, log_metric_pb): """Convert a metric protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_metric_pb: :class:`.logging_metrics_pb2.LogMetric` :param log_...
[ "def", "_item_to_metric", "(", "iterator", ",", "log_metric_pb", ")", ":", "# NOTE: LogMetric message type does not have an ``Any`` field", "# so `MessageToDict`` can safely be used.", "resource", "=", "MessageToDict", "(", "log_metric_pb", ")", "return", "Metric", ".", "...
Convert a metric protobuf to the native object. :type iterator: :class:`~google.api_core.page_iterator.Iterator` :param iterator: The iterator that is currently in use. :type log_metric_pb: :class:`.logging_metrics_pb2.LogMetric` :param log_metric_pb: Metric protobuf returned from the API. ...
[ "Convert", "a", "metric", "protobuf", "to", "the", "native", "object", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L518-L534
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
make_logging_api
def make_logging_api(client): """Create an instance of the Logging API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_LoggingAPI` :returns: A metrics API instance with the proper credentials. """ ...
python
def make_logging_api(client): """Create an instance of the Logging API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_LoggingAPI` :returns: A metrics API instance with the proper credentials. """ ...
[ "def", "make_logging_api", "(", "client", ")", ":", "generated", "=", "LoggingServiceV2Client", "(", "credentials", "=", "client", ".", "_credentials", ",", "client_info", "=", "_CLIENT_INFO", ")", "return", "_LoggingAPI", "(", "generated", ",", "client", ")" ]
Create an instance of the Logging API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_LoggingAPI` :returns: A metrics API instance with the proper credentials.
[ "Create", "an", "instance", "of", "the", "Logging", "API", "adapter", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L537-L549
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
make_metrics_api
def make_metrics_api(client): """Create an instance of the Metrics API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_MetricsAPI` :returns: A metrics API instance with the proper credentials. """ ...
python
def make_metrics_api(client): """Create an instance of the Metrics API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_MetricsAPI` :returns: A metrics API instance with the proper credentials. """ ...
[ "def", "make_metrics_api", "(", "client", ")", ":", "generated", "=", "MetricsServiceV2Client", "(", "credentials", "=", "client", ".", "_credentials", ",", "client_info", "=", "_CLIENT_INFO", ")", "return", "_MetricsAPI", "(", "generated", ",", "client", ")" ]
Create an instance of the Metrics API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_MetricsAPI` :returns: A metrics API instance with the proper credentials.
[ "Create", "an", "instance", "of", "the", "Metrics", "API", "adapter", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L552-L564
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
make_sinks_api
def make_sinks_api(client): """Create an instance of the Sinks API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_SinksAPI` :returns: A metrics API instance with the proper credentials. """ ge...
python
def make_sinks_api(client): """Create an instance of the Sinks API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_SinksAPI` :returns: A metrics API instance with the proper credentials. """ ge...
[ "def", "make_sinks_api", "(", "client", ")", ":", "generated", "=", "ConfigServiceV2Client", "(", "credentials", "=", "client", ".", "_credentials", ",", "client_info", "=", "_CLIENT_INFO", ")", "return", "_SinksAPI", "(", "generated", ",", "client", ")" ]
Create an instance of the Sinks API adapter. :type client: :class:`~google.cloud.logging.client.Client` :param client: The client that holds configuration details. :rtype: :class:`_SinksAPI` :returns: A metrics API instance with the proper credentials.
[ "Create", "an", "instance", "of", "the", "Sinks", "API", "adapter", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L567-L579
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_LoggingAPI.list_entries
def list_entries( self, projects, filter_="", order_by="", page_size=0, page_token=None ): """Return a page of log entry resources. :type projects: list of strings :param projects: project IDs to include. If not passed, defaults to the project bound to the A...
python
def list_entries( self, projects, filter_="", order_by="", page_size=0, page_token=None ): """Return a page of log entry resources. :type projects: list of strings :param projects: project IDs to include. If not passed, defaults to the project bound to the A...
[ "def", "list_entries", "(", "self", ",", "projects", ",", "filter_", "=", "\"\"", ",", "order_by", "=", "\"\"", ",", "page_size", "=", "0", ",", "page_token", "=", "None", ")", ":", "page_iter", "=", "self", ".", "_gapic_api", ".", "list_log_entries", "(...
Return a page of log entry resources. :type projects: list of strings :param projects: project IDs to include. If not passed, defaults to the project bound to the API's client. :type filter_: str :param filter_: a filter expression. See ...
[ "Return", "a", "page", "of", "log", "entry", "resources", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L58-L104
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_LoggingAPI.write_entries
def write_entries(self, entries, logger_name=None, resource=None, labels=None): """API call: log an entry resource via a POST request :type entries: sequence of mapping :param entries: the log entry resources to log. :type logger_name: str :param logger_name: name of default l...
python
def write_entries(self, entries, logger_name=None, resource=None, labels=None): """API call: log an entry resource via a POST request :type entries: sequence of mapping :param entries: the log entry resources to log. :type logger_name: str :param logger_name: name of default l...
[ "def", "write_entries", "(", "self", ",", "entries", ",", "logger_name", "=", "None", ",", "resource", "=", "None", ",", "labels", "=", "None", ")", ":", "partial_success", "=", "False", "entry_pbs", "=", "[", "_log_entry_mapping_to_pb", "(", "entry", ")", ...
API call: log an entry resource via a POST request :type entries: sequence of mapping :param entries: the log entry resources to log. :type logger_name: str :param logger_name: name of default logger to which to log the entries; individual entries may overr...
[ "API", "call", ":", "log", "an", "entry", "resource", "via", "a", "POST", "request" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L106-L132
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_LoggingAPI.logger_delete
def logger_delete(self, project, logger_name): """API call: delete all entries in a logger via a DELETE request :type project: str :param project: ID of project containing the log entries to delete :type logger_name: str :param logger_name: name of logger containing the log en...
python
def logger_delete(self, project, logger_name): """API call: delete all entries in a logger via a DELETE request :type project: str :param project: ID of project containing the log entries to delete :type logger_name: str :param logger_name: name of logger containing the log en...
[ "def", "logger_delete", "(", "self", ",", "project", ",", "logger_name", ")", ":", "path", "=", "\"projects/%s/logs/%s\"", "%", "(", "project", ",", "logger_name", ")", "self", ".", "_gapic_api", ".", "delete_log", "(", "path", ")" ]
API call: delete all entries in a logger via a DELETE request :type project: str :param project: ID of project containing the log entries to delete :type logger_name: str :param logger_name: name of logger containing the log entries to delete
[ "API", "call", ":", "delete", "all", "entries", "in", "a", "logger", "via", "a", "DELETE", "request" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L134-L144
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_SinksAPI.list_sinks
def list_sinks(self, project, page_size=0, page_token=None): """List sinks for the project associated with this client. :type project: str :param project: ID of the project whose sinks are to be listed. :type page_size: int :param page_size: maximum number of sinks to return, I...
python
def list_sinks(self, project, page_size=0, page_token=None): """List sinks for the project associated with this client. :type project: str :param project: ID of the project whose sinks are to be listed. :type page_size: int :param page_size: maximum number of sinks to return, I...
[ "def", "list_sinks", "(", "self", ",", "project", ",", "page_size", "=", "0", ",", "page_token", "=", "None", ")", ":", "path", "=", "\"projects/%s\"", "%", "(", "project", ",", ")", "page_iter", "=", "self", ".", "_gapic_api", ".", "list_sinks", "(", ...
List sinks for the project associated with this client. :type project: str :param project: ID of the project whose sinks are to be listed. :type page_size: int :param page_size: maximum number of sinks to return, If not passed, defaults to a value set by the A...
[ "List", "sinks", "for", "the", "project", "associated", "with", "this", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L162-L187
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_SinksAPI.sink_create
def sink_create( self, project, sink_name, filter_, destination, unique_writer_identity=False ): """API call: create a sink resource. See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create :type project: str :param project: ID of the p...
python
def sink_create( self, project, sink_name, filter_, destination, unique_writer_identity=False ): """API call: create a sink resource. See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create :type project: str :param project: ID of the p...
[ "def", "sink_create", "(", "self", ",", "project", ",", "sink_name", ",", "filter_", ",", "destination", ",", "unique_writer_identity", "=", "False", ")", ":", "parent", "=", "\"projects/%s\"", "%", "(", "project", ",", ")", "sink_pb", "=", "LogSink", "(", ...
API call: create a sink resource. See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create :type project: str :param project: ID of the project in which to create the sink. :type sink_name: str :param sink_name: the name of the sink ...
[ "API", "call", ":", "create", "a", "sink", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L189-L225
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_SinksAPI.sink_get
def sink_get(self, project, sink_name): """API call: retrieve a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the sink :rtype: dict :returns: The sink object returned...
python
def sink_get(self, project, sink_name): """API call: retrieve a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the sink :rtype: dict :returns: The sink object returned...
[ "def", "sink_get", "(", "self", ",", "project", ",", "sink_name", ")", ":", "path", "=", "\"projects/%s/sinks/%s\"", "%", "(", "project", ",", "sink_name", ")", "sink_pb", "=", "self", ".", "_gapic_api", ".", "get_sink", "(", "path", ")", "# NOTE: LogSink me...
API call: retrieve a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the sink :rtype: dict :returns: The sink object returned from the API (converted from a p...
[ "API", "call", ":", "retrieve", "a", "sink", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L227-L244
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_SinksAPI.sink_update
def sink_update( self, project, sink_name, filter_, destination, unique_writer_identity=False ): """API call: update a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the si...
python
def sink_update( self, project, sink_name, filter_, destination, unique_writer_identity=False ): """API call: update a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the si...
[ "def", "sink_update", "(", "self", ",", "project", ",", "sink_name", ",", "filter_", ",", "destination", ",", "unique_writer_identity", "=", "False", ")", ":", "path", "=", "\"projects/%s/sinks/%s\"", "%", "(", "project", ",", "sink_name", ")", "sink_pb", "=",...
API call: update a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the sink :type filter_: str :param filter_: the advanced logs filter expression defining the ...
[ "API", "call", ":", "update", "a", "sink", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L246-L281
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_SinksAPI.sink_delete
def sink_delete(self, project, sink_name): """API call: delete a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the sink """ path = "projects/%s/sinks/%s" % (project, s...
python
def sink_delete(self, project, sink_name): """API call: delete a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the sink """ path = "projects/%s/sinks/%s" % (project, s...
[ "def", "sink_delete", "(", "self", ",", "project", ",", "sink_name", ")", ":", "path", "=", "\"projects/%s/sinks/%s\"", "%", "(", "project", ",", "sink_name", ")", "self", ".", "_gapic_api", ".", "delete_sink", "(", "path", ")" ]
API call: delete a sink resource. :type project: str :param project: ID of the project containing the sink. :type sink_name: str :param sink_name: the name of the sink
[ "API", "call", ":", "delete", "a", "sink", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L283-L293
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_MetricsAPI.list_metrics
def list_metrics(self, project, page_size=0, page_token=None): """List metrics for the project associated with this client. :type project: str :param project: ID of the project whose metrics are to be listed. :type page_size: int :param page_size: maximum number of metrics to r...
python
def list_metrics(self, project, page_size=0, page_token=None): """List metrics for the project associated with this client. :type project: str :param project: ID of the project whose metrics are to be listed. :type page_size: int :param page_size: maximum number of metrics to r...
[ "def", "list_metrics", "(", "self", ",", "project", ",", "page_size", "=", "0", ",", "page_token", "=", "None", ")", ":", "path", "=", "\"projects/%s\"", "%", "(", "project", ",", ")", "page_iter", "=", "self", ".", "_gapic_api", ".", "list_log_metrics", ...
List metrics for the project associated with this client. :type project: str :param project: ID of the project whose metrics are to be listed. :type page_size: int :param page_size: maximum number of metrics to return, If not passed, defaults to a value set by...
[ "List", "metrics", "for", "the", "project", "associated", "with", "this", "client", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L312-L337
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_MetricsAPI.metric_create
def metric_create(self, project, metric_name, filter_, description): """API call: create a metric resource. See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create :type project: str :param project: ID of the project in which to create the metric...
python
def metric_create(self, project, metric_name, filter_, description): """API call: create a metric resource. See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create :type project: str :param project: ID of the project in which to create the metric...
[ "def", "metric_create", "(", "self", ",", "project", ",", "metric_name", ",", "filter_", ",", "description", ")", ":", "parent", "=", "\"projects/%s\"", "%", "(", "project", ",", ")", "metric_pb", "=", "LogMetric", "(", "name", "=", "metric_name", ",", "fi...
API call: create a metric resource. See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics/create :type project: str :param project: ID of the project in which to create the metric. :type metric_name: str :param metric_name: the name of the me...
[ "API", "call", ":", "create", "a", "metric", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L339-L360
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_MetricsAPI.metric_get
def metric_get(self, project, metric_name): """API call: retrieve a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric :rtype: dict :returns: The metric...
python
def metric_get(self, project, metric_name): """API call: retrieve a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric :rtype: dict :returns: The metric...
[ "def", "metric_get", "(", "self", ",", "project", ",", "metric_name", ")", ":", "path", "=", "\"projects/%s/metrics/%s\"", "%", "(", "project", ",", "metric_name", ")", "metric_pb", "=", "self", ".", "_gapic_api", ".", "get_log_metric", "(", "path", ")", "# ...
API call: retrieve a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric :rtype: dict :returns: The metric object returned from the API (converted from a ...
[ "API", "call", ":", "retrieve", "a", "metric", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L362-L379
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_MetricsAPI.metric_update
def metric_update(self, project, metric_name, filter_, description): """API call: update a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric :type filter_: str...
python
def metric_update(self, project, metric_name, filter_, description): """API call: update a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric :type filter_: str...
[ "def", "metric_update", "(", "self", ",", "project", ",", "metric_name", ",", "filter_", ",", "description", ")", ":", "path", "=", "\"projects/%s/metrics/%s\"", "%", "(", "project", ",", "metric_name", ")", "metric_pb", "=", "LogMetric", "(", "name", "=", "...
API call: update a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric :type filter_: str :param filter_: the advanced logs filter expression defining the ...
[ "API", "call", ":", "update", "a", "metric", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L381-L406
train
googleapis/google-cloud-python
logging/google/cloud/logging/_gapic.py
_MetricsAPI.metric_delete
def metric_delete(self, project, metric_name): """API call: delete a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric """ path = "projects/%s/metrics/%...
python
def metric_delete(self, project, metric_name): """API call: delete a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric """ path = "projects/%s/metrics/%...
[ "def", "metric_delete", "(", "self", ",", "project", ",", "metric_name", ")", ":", "path", "=", "\"projects/%s/metrics/%s\"", "%", "(", "project", ",", "metric_name", ")", "self", ".", "_gapic_api", ".", "delete_log_metric", "(", "path", ")" ]
API call: delete a metric resource. :type project: str :param project: ID of the project containing the metric. :type metric_name: str :param metric_name: the name of the metric
[ "API", "call", ":", "delete", "a", "metric", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/_gapic.py#L408-L418
train
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.tenant_path
def tenant_path(cls, project, tenant): """Return a fully-qualified tenant string.""" return google.api_core.path_template.expand( "projects/{project}/tenants/{tenant}", project=project, tenant=tenant )
python
def tenant_path(cls, project, tenant): """Return a fully-qualified tenant string.""" return google.api_core.path_template.expand( "projects/{project}/tenants/{tenant}", project=project, tenant=tenant )
[ "def", "tenant_path", "(", "cls", ",", "project", ",", "tenant", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/tenants/{tenant}\"", ",", "project", "=", "project", ",", "tenant", "=", "tenant", "...
Return a fully-qualified tenant string.
[ "Return", "a", "fully", "-", "qualified", "tenant", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L100-L104
train
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.create_tenant
def create_tenant( self, parent, tenant, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new tenant entity. Example: >>> from google.cloud import talen...
python
def create_tenant( self, parent, tenant, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a new tenant entity. Example: >>> from google.cloud import talen...
[ "def", "create_tenant", "(", "self", ",", "parent", ",", "tenant", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT...
Creates a new tenant entity. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.TenantServiceClient() >>> >>> parent = client.project_path('[PROJECT]') >>> >>> # TODO: Initialize `tenant`: ...
[ "Creates", "a", "new", "tenant", "entity", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L205-L274
train
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.get_tenant
def get_tenant( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Retrieves specified tenant. Example: >>> from google.cloud import talent_v4beta1 ...
python
def get_tenant( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Retrieves specified tenant. Example: >>> from google.cloud import talent_v4beta1 ...
[ "def", "get_tenant", "(", "self", ",", "name", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "metadata", ...
Retrieves specified tenant. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.TenantServiceClient() >>> >>> name = client.tenant_path('[PROJECT]', '[TENANT]') >>> >>> response = client.get_ten...
[ "Retrieves", "specified", "tenant", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L276-L335
train
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py
TenantServiceClient.update_tenant
def update_tenant( self, tenant, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates specified tenant. Example: >>> from google.cloud impor...
python
def update_tenant( self, tenant, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates specified tenant. Example: >>> from google.cloud impor...
[ "def", "update_tenant", "(", "self", ",", "tenant", ",", "update_mask", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "meth...
Updates specified tenant. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.TenantServiceClient() >>> >>> # TODO: Initialize `tenant`: >>> tenant = {} >>> >>> response = client.upd...
[ "Updates", "specified", "tenant", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py#L337-L410
train
googleapis/google-cloud-python
api_core/google/api_core/gapic_v1/method.py
_apply_decorators
def _apply_decorators(func, decorators): """Apply a list of decorators to a given function. ``decorators`` may contain items that are ``None`` or ``False`` which will be ignored. """ decorators = filter(_is_not_none_or_false, reversed(decorators)) for decorator in decorators: func = de...
python
def _apply_decorators(func, decorators): """Apply a list of decorators to a given function. ``decorators`` may contain items that are ``None`` or ``False`` which will be ignored. """ decorators = filter(_is_not_none_or_false, reversed(decorators)) for decorator in decorators: func = de...
[ "def", "_apply_decorators", "(", "func", ",", "decorators", ")", ":", "decorators", "=", "filter", "(", "_is_not_none_or_false", ",", "reversed", "(", "decorators", ")", ")", "for", "decorator", "in", "decorators", ":", "func", "=", "decorator", "(", "func", ...
Apply a list of decorators to a given function. ``decorators`` may contain items that are ``None`` or ``False`` which will be ignored.
[ "Apply", "a", "list", "of", "decorators", "to", "a", "given", "function", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L36-L47
train
googleapis/google-cloud-python
api_core/google/api_core/gapic_v1/method.py
_determine_timeout
def _determine_timeout(default_timeout, specified_timeout, retry): """Determines how timeout should be applied to a wrapped method. Args: default_timeout (Optional[Timeout]): The default timeout specified at method creation time. specified_timeout (Optional[Timeout]): The timeout sp...
python
def _determine_timeout(default_timeout, specified_timeout, retry): """Determines how timeout should be applied to a wrapped method. Args: default_timeout (Optional[Timeout]): The default timeout specified at method creation time. specified_timeout (Optional[Timeout]): The timeout sp...
[ "def", "_determine_timeout", "(", "default_timeout", ",", "specified_timeout", ",", "retry", ")", ":", "if", "specified_timeout", "is", "DEFAULT", ":", "specified_timeout", "=", "default_timeout", "if", "specified_timeout", "is", "default_timeout", ":", "# If timeout is...
Determines how timeout should be applied to a wrapped method. Args: default_timeout (Optional[Timeout]): The default timeout specified at method creation time. specified_timeout (Optional[Timeout]): The timeout specified at invocation time. If :attr:`DEFAULT`, this will be s...
[ "Determines", "how", "timeout", "should", "be", "applied", "to", "a", "wrapped", "method", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L50-L86
train
googleapis/google-cloud-python
api_core/google/api_core/gapic_v1/method.py
wrap_method
def wrap_method( func, default_retry=None, default_timeout=None, client_info=client_info.DEFAULT_CLIENT_INFO, ): """Wrap an RPC method with common behavior. This applies common error wrapping, retry, and timeout behavior a function. The wrapped function will take optional ``retry`` and ``ti...
python
def wrap_method( func, default_retry=None, default_timeout=None, client_info=client_info.DEFAULT_CLIENT_INFO, ): """Wrap an RPC method with common behavior. This applies common error wrapping, retry, and timeout behavior a function. The wrapped function will take optional ``retry`` and ``ti...
[ "def", "wrap_method", "(", "func", ",", "default_retry", "=", "None", ",", "default_timeout", "=", "None", ",", "client_info", "=", "client_info", ".", "DEFAULT_CLIENT_INFO", ",", ")", ":", "func", "=", "grpc_helpers", ".", "wrap_errors", "(", "func", ")", "...
Wrap an RPC method with common behavior. This applies common error wrapping, retry, and timeout behavior a function. The wrapped function will take optional ``retry`` and ``timeout`` arguments. For example:: import google.api_core.gapic_v1.method from google.api_core import retry ...
[ "Wrap", "an", "RPC", "method", "with", "common", "behavior", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/method.py#L146-L242
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_validate_name
def _validate_name(name): """Pre-flight ``Bucket`` name validation. :type name: str or :data:`NoneType` :param name: Proposed bucket name. :rtype: str or :data:`NoneType` :returns: ``name`` if valid. """ if name is None: return # The first and las characters must be alphanumer...
python
def _validate_name(name): """Pre-flight ``Bucket`` name validation. :type name: str or :data:`NoneType` :param name: Proposed bucket name. :rtype: str or :data:`NoneType` :returns: ``name`` if valid. """ if name is None: return # The first and las characters must be alphanumer...
[ "def", "_validate_name", "(", "name", ")", ":", "if", "name", "is", "None", ":", "return", "# The first and las characters must be alphanumeric.", "if", "not", "all", "(", "[", "name", "[", "0", "]", ".", "isalnum", "(", ")", ",", "name", "[", "-", "1", ...
Pre-flight ``Bucket`` name validation. :type name: str or :data:`NoneType` :param name: Proposed bucket name. :rtype: str or :data:`NoneType` :returns: ``name`` if valid.
[ "Pre", "-", "flight", "Bucket", "name", "validation", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L24-L39
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_scalar_property
def _scalar_property(fieldname): """Create a property descriptor around the :class:`_PropertyMixin` helpers. """ def _getter(self): """Scalar property getter.""" return self._properties.get(fieldname) def _setter(self, value): """Scalar property setter.""" self._patch_p...
python
def _scalar_property(fieldname): """Create a property descriptor around the :class:`_PropertyMixin` helpers. """ def _getter(self): """Scalar property getter.""" return self._properties.get(fieldname) def _setter(self, value): """Scalar property setter.""" self._patch_p...
[ "def", "_scalar_property", "(", "fieldname", ")", ":", "def", "_getter", "(", "self", ")", ":", "\"\"\"Scalar property getter.\"\"\"", "return", "self", ".", "_properties", ".", "get", "(", "fieldname", ")", "def", "_setter", "(", "self", ",", "value", ")", ...
Create a property descriptor around the :class:`_PropertyMixin` helpers.
[ "Create", "a", "property", "descriptor", "around", "the", ":", "class", ":", "_PropertyMixin", "helpers", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L216-L228
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_write_buffer_to_hash
def _write_buffer_to_hash(buffer_object, hash_obj, digest_block_size=8192): """Read blocks from a buffer and update a hash with them. :type buffer_object: bytes buffer :param buffer_object: Buffer containing bytes used to update a hash object. :type hash_obj: object that implements update :param h...
python
def _write_buffer_to_hash(buffer_object, hash_obj, digest_block_size=8192): """Read blocks from a buffer and update a hash with them. :type buffer_object: bytes buffer :param buffer_object: Buffer containing bytes used to update a hash object. :type hash_obj: object that implements update :param h...
[ "def", "_write_buffer_to_hash", "(", "buffer_object", ",", "hash_obj", ",", "digest_block_size", "=", "8192", ")", ":", "block", "=", "buffer_object", ".", "read", "(", "digest_block_size", ")", "while", "len", "(", "block", ")", ">", "0", ":", "hash_obj", "...
Read blocks from a buffer and update a hash with them. :type buffer_object: bytes buffer :param buffer_object: Buffer containing bytes used to update a hash object. :type hash_obj: object that implements update :param hash_obj: A hash object (MD5 or CRC32-C). :type digest_block_size: int :par...
[ "Read", "blocks", "from", "a", "buffer", "and", "update", "a", "hash", "with", "them", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L231-L249
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_base64_md5hash
def _base64_md5hash(buffer_object): """Get MD5 hash of bytes (as base64). :type buffer_object: bytes buffer :param buffer_object: Buffer containing bytes used to compute an MD5 hash (as base64). :rtype: str :returns: A base64 encoded digest of the MD5 hash. """ ha...
python
def _base64_md5hash(buffer_object): """Get MD5 hash of bytes (as base64). :type buffer_object: bytes buffer :param buffer_object: Buffer containing bytes used to compute an MD5 hash (as base64). :rtype: str :returns: A base64 encoded digest of the MD5 hash. """ ha...
[ "def", "_base64_md5hash", "(", "buffer_object", ")", ":", "hash_obj", "=", "md5", "(", ")", "_write_buffer_to_hash", "(", "buffer_object", ",", "hash_obj", ")", "digest_bytes", "=", "hash_obj", ".", "digest", "(", ")", "return", "base64", ".", "b64encode", "("...
Get MD5 hash of bytes (as base64). :type buffer_object: bytes buffer :param buffer_object: Buffer containing bytes used to compute an MD5 hash (as base64). :rtype: str :returns: A base64 encoded digest of the MD5 hash.
[ "Get", "MD5", "hash", "of", "bytes", "(", "as", "base64", ")", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L252-L265
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_PropertyMixin.reload
def reload(self, client=None): """Reload properties from Cloud Storage. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client: the client to use. If not pass...
python
def reload(self, client=None): """Reload properties from Cloud Storage. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client: the client to use. If not pass...
[ "def", "reload", "(", "self", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "self", ".", "_query_params", "# Pass only '?projection=noAcl' here because 'acl' and related", "# are handled v...
Reload properties from Cloud Storage. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client: the client to use. If not passed, falls back to the ...
[ "Reload", "properties", "from", "Cloud", "Storage", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L110-L132
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_PropertyMixin._patch_property
def _patch_property(self, name, value): """Update field of this object's properties. This method will only update the field provided and will not touch the other fields. It **will not** reload the properties from the server. The behavior is local only and syncing occurs via :me...
python
def _patch_property(self, name, value): """Update field of this object's properties. This method will only update the field provided and will not touch the other fields. It **will not** reload the properties from the server. The behavior is local only and syncing occurs via :me...
[ "def", "_patch_property", "(", "self", ",", "name", ",", "value", ")", ":", "self", ".", "_changes", ".", "add", "(", "name", ")", "self", ".", "_properties", "[", "name", "]", "=", "value" ]
Update field of this object's properties. This method will only update the field provided and will not touch the other fields. It **will not** reload the properties from the server. The behavior is local only and syncing occurs via :meth:`patch`. :type name: str :param...
[ "Update", "field", "of", "this", "object", "s", "properties", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L134-L150
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_PropertyMixin.patch
def patch(self, client=None): """Sends all changed properties in a PATCH request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
python
def patch(self, client=None): """Sends all changed properties in a PATCH request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
[ "def", "patch", "(", "self", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "self", ".", "_query_params", "# Pass '?projection=full' here because 'PATCH' documented not", "# to work properl...
Sends all changed properties in a PATCH request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :par...
[ "Sends", "all", "changed", "properties", "in", "a", "PATCH", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L162-L189
train
googleapis/google-cloud-python
storage/google/cloud/storage/_helpers.py
_PropertyMixin.update
def update(self, client=None): """Sends all properties in a PUT request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
python
def update(self, client=None): """Sends all properties in a PUT request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ...
[ "def", "update", "(", "self", ",", "client", "=", "None", ")", ":", "client", "=", "self", ".", "_require_client", "(", "client", ")", "query_params", "=", "self", ".", "_query_params", "query_params", "[", "\"projection\"", "]", "=", "\"full\"", "api_respon...
Sends all properties in a PUT request. Updates the ``_properties`` with the response from the backend. If :attr:`user_project` is set, bills the API request to that project. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client:...
[ "Sends", "all", "properties", "in", "a", "PUT", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/_helpers.py#L191-L213
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.start
def start(self): """Start a thread to dispatch requests queued up by callbacks. Spawns a thread to run :meth:`dispatch_callback`. """ with self._operational_lock: if self._thread is not None: raise ValueError("Dispatcher is already running.") flow...
python
def start(self): """Start a thread to dispatch requests queued up by callbacks. Spawns a thread to run :meth:`dispatch_callback`. """ with self._operational_lock: if self._thread is not None: raise ValueError("Dispatcher is already running.") flow...
[ "def", "start", "(", "self", ")", ":", "with", "self", ".", "_operational_lock", ":", "if", "self", ".", "_thread", "is", "not", "None", ":", "raise", "ValueError", "(", "\"Dispatcher is already running.\"", ")", "flow_control", "=", "self", ".", "_manager", ...
Start a thread to dispatch requests queued up by callbacks. Spawns a thread to run :meth:`dispatch_callback`.
[ "Start", "a", "thread", "to", "dispatch", "requests", "queued", "up", "by", "callbacks", ".", "Spawns", "a", "thread", "to", "run", ":", "meth", ":", "dispatch_callback", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L37-L57
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.dispatch_callback
def dispatch_callback(self, items): """Map the callback request to the appropriate gRPC request. Args: action (str): The method to be invoked. kwargs (Dict[str, Any]): The keyword arguments for the method specified by ``action``. Raises: Valu...
python
def dispatch_callback(self, items): """Map the callback request to the appropriate gRPC request. Args: action (str): The method to be invoked. kwargs (Dict[str, Any]): The keyword arguments for the method specified by ``action``. Raises: Valu...
[ "def", "dispatch_callback", "(", "self", ",", "items", ")", ":", "if", "not", "self", ".", "_manager", ".", "is_active", ":", "return", "batched_commands", "=", "collections", ".", "defaultdict", "(", "list", ")", "for", "item", "in", "items", ":", "batche...
Map the callback request to the appropriate gRPC request. Args: action (str): The method to be invoked. kwargs (Dict[str, Any]): The keyword arguments for the method specified by ``action``. Raises: ValueError: If ``action`` isn't one of the expected...
[ "Map", "the", "callback", "request", "to", "the", "appropriate", "gRPC", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L68-L101
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.ack
def ack(self, items): """Acknowledge the given messages. Args: items(Sequence[AckRequest]): The items to acknowledge. """ # If we got timing information, add it to the histogram. for item in items: time_to_ack = item.time_to_ack if time_to_ack...
python
def ack(self, items): """Acknowledge the given messages. Args: items(Sequence[AckRequest]): The items to acknowledge. """ # If we got timing information, add it to the histogram. for item in items: time_to_ack = item.time_to_ack if time_to_ack...
[ "def", "ack", "(", "self", ",", "items", ")", ":", "# If we got timing information, add it to the histogram.", "for", "item", "in", "items", ":", "time_to_ack", "=", "item", ".", "time_to_ack", "if", "time_to_ack", "is", "not", "None", ":", "self", ".", "_manage...
Acknowledge the given messages. Args: items(Sequence[AckRequest]): The items to acknowledge.
[ "Acknowledge", "the", "given", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L103-L120
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.drop
def drop(self, items): """Remove the given messages from lease management. Args: items(Sequence[DropRequest]): The items to drop. """ self._manager.leaser.remove(items) self._manager.maybe_resume_consumer()
python
def drop(self, items): """Remove the given messages from lease management. Args: items(Sequence[DropRequest]): The items to drop. """ self._manager.leaser.remove(items) self._manager.maybe_resume_consumer()
[ "def", "drop", "(", "self", ",", "items", ")", ":", "self", ".", "_manager", ".", "leaser", ".", "remove", "(", "items", ")", "self", ".", "_manager", ".", "maybe_resume_consumer", "(", ")" ]
Remove the given messages from lease management. Args: items(Sequence[DropRequest]): The items to drop.
[ "Remove", "the", "given", "messages", "from", "lease", "management", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L122-L129
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.lease
def lease(self, items): """Add the given messages to lease management. Args: items(Sequence[LeaseRequest]): The items to lease. """ self._manager.leaser.add(items) self._manager.maybe_pause_consumer()
python
def lease(self, items): """Add the given messages to lease management. Args: items(Sequence[LeaseRequest]): The items to lease. """ self._manager.leaser.add(items) self._manager.maybe_pause_consumer()
[ "def", "lease", "(", "self", ",", "items", ")", ":", "self", ".", "_manager", ".", "leaser", ".", "add", "(", "items", ")", "self", ".", "_manager", ".", "maybe_pause_consumer", "(", ")" ]
Add the given messages to lease management. Args: items(Sequence[LeaseRequest]): The items to lease.
[ "Add", "the", "given", "messages", "to", "lease", "management", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L131-L138
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.modify_ack_deadline
def modify_ack_deadline(self, items): """Modify the ack deadline for the given messages. Args: items(Sequence[ModAckRequest]): The items to modify. """ ack_ids = [item.ack_id for item in items] seconds = [item.seconds for item in items] request = types.Strea...
python
def modify_ack_deadline(self, items): """Modify the ack deadline for the given messages. Args: items(Sequence[ModAckRequest]): The items to modify. """ ack_ids = [item.ack_id for item in items] seconds = [item.seconds for item in items] request = types.Strea...
[ "def", "modify_ack_deadline", "(", "self", ",", "items", ")", ":", "ack_ids", "=", "[", "item", ".", "ack_id", "for", "item", "in", "items", "]", "seconds", "=", "[", "item", ".", "seconds", "for", "item", "in", "items", "]", "request", "=", "types", ...
Modify the ack deadline for the given messages. Args: items(Sequence[ModAckRequest]): The items to modify.
[ "Modify", "the", "ack", "deadline", "for", "the", "given", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L140-L152
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py
Dispatcher.nack
def nack(self, items): """Explicitly deny receipt of messages. Args: items(Sequence[NackRequest]): The items to deny. """ self.modify_ack_deadline( [requests.ModAckRequest(ack_id=item.ack_id, seconds=0) for item in items] ) self.drop([requests.Dro...
python
def nack(self, items): """Explicitly deny receipt of messages. Args: items(Sequence[NackRequest]): The items to deny. """ self.modify_ack_deadline( [requests.ModAckRequest(ack_id=item.ack_id, seconds=0) for item in items] ) self.drop([requests.Dro...
[ "def", "nack", "(", "self", ",", "items", ")", ":", "self", ".", "modify_ack_deadline", "(", "[", "requests", ".", "ModAckRequest", "(", "ack_id", "=", "item", ".", "ack_id", ",", "seconds", "=", "0", ")", "for", "item", "in", "items", "]", ")", "sel...
Explicitly deny receipt of messages. Args: items(Sequence[NackRequest]): The items to deny.
[ "Explicitly", "deny", "receipt", "of", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py#L154-L163
train
googleapis/google-cloud-python
dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py
JobControllerClient.submit_job
def submit_job( self, project_id, region, job, request_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Submits a job to a cluster. Example: ...
python
def submit_job( self, project_id, region, job, request_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Submits a job to a cluster. Example: ...
[ "def", "submit_job", "(", "self", ",", "project_id", ",", "region", ",", "job", ",", "request_id", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ...
Submits a job to a cluster. Example: >>> from google.cloud import dataproc_v1beta2 >>> >>> client = dataproc_v1beta2.JobControllerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>> # TODO:...
[ "Submits", "a", "job", "to", "a", "cluster", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L175-L257
train
googleapis/google-cloud-python
dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py
JobControllerClient.update_job
def update_job( self, project_id, region, job_id, job, update_mask, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates a job in a project. Examp...
python
def update_job( self, project_id, region, job_id, job, update_mask, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates a job in a project. Examp...
[ "def", "update_job", "(", "self", ",", "project_id", ",", "region", ",", "job_id", ",", "job", ",", "update_mask", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core...
Updates a job in a project. Example: >>> from google.cloud import dataproc_v1beta2 >>> >>> client = dataproc_v1beta2.JobControllerClient() >>> >>> # TODO: Initialize `project_id`: >>> project_id = '' >>> >>> # TODO:...
[ "Updates", "a", "job", "in", "a", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L454-L546
train
googleapis/google-cloud-python
dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py
JobControllerClient.cancel_job
def cancel_job( self, project_id, region, job_id, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Starts a job cancellation request. To access the job resource after ...
python
def cancel_job( self, project_id, region, job_id, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Starts a job cancellation request. To access the job resource after ...
[ "def", "cancel_job", "(", "self", ",", "project_id", ",", "region", ",", "job_id", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method...
Starts a job cancellation request. To access the job resource after cancellation, call `regions/{region}/jobs.list <https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list>`__ or `regions/{region}/jobs.get <https://cloud.google.com/dataproc/docs/reference...
[ "Starts", "a", "job", "cancellation", "request", ".", "To", "access", "the", "job", "resource", "after", "cancellation", "call", "regions", "/", "{", "region", "}", "/", "jobs", ".", "list", "<https", ":", "//", "cloud", ".", "google", ".", "com", "/", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/job_controller_client.py#L548-L620
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.instance_path
def instance_path(cls, project, instance): """Return a fully-qualified instance string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}", project=project, instance=instance, )
python
def instance_path(cls, project, instance): """Return a fully-qualified instance string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}", project=project, instance=instance, )
[ "def", "instance_path", "(", "cls", ",", "project", ",", "instance", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}\"", ",", "project", "=", "project", ",", "instance", "=", "in...
Return a fully-qualified instance string.
[ "Return", "a", "fully", "-", "qualified", "instance", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L93-L99
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.app_profile_path
def app_profile_path(cls, project, instance, app_profile): """Return a fully-qualified app_profile string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/appProfiles/{app_profile}", project=project, instance=instance, ...
python
def app_profile_path(cls, project, instance, app_profile): """Return a fully-qualified app_profile string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/appProfiles/{app_profile}", project=project, instance=instance, ...
[ "def", "app_profile_path", "(", "cls", ",", "project", ",", "instance", ",", "app_profile", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}/appProfiles/{app_profile}\"", ",", "project", ...
Return a fully-qualified app_profile string.
[ "Return", "a", "fully", "-", "qualified", "app_profile", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L102-L109
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.cluster_path
def cluster_path(cls, project, instance, cluster): """Return a fully-qualified cluster string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/clusters/{cluster}", project=project, instance=instance, cluster=cluster...
python
def cluster_path(cls, project, instance, cluster): """Return a fully-qualified cluster string.""" return google.api_core.path_template.expand( "projects/{project}/instances/{instance}/clusters/{cluster}", project=project, instance=instance, cluster=cluster...
[ "def", "cluster_path", "(", "cls", ",", "project", ",", "instance", ",", "cluster", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instances/{instance}/clusters/{cluster}\"", ",", "project", "=", "proje...
Return a fully-qualified cluster string.
[ "Return", "a", "fully", "-", "qualified", "cluster", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L112-L119
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.list_instances
def list_instances( self, parent, page_token=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Lists information about instances in a project. Example: >>> f...
python
def list_instances( self, parent, page_token=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Lists information about instances in a project. Example: >>> f...
[ "def", "list_instances", "(", "self", ",", "parent", ",", "page_token", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "meth...
Lists information about instances in a project. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> parent = client.project_path('[PROJECT]') >>> >>> ...
[ "Lists", "information", "about", "instances", "in", "a", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L413-L485
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.update_instance
def update_instance( self, name, display_name, type_, labels, state=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an instance within a project...
python
def update_instance( self, name, display_name, type_, labels, state=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an instance within a project...
[ "def", "update_instance", "(", "self", ",", "name", ",", "display_name", ",", "type_", ",", "labels", ",", "state", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ...
Updates an instance within a project. Example: >>> from google.cloud import bigtable_admin_v2 >>> from google.cloud.bigtable_admin_v2 import enums >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> name = client.insta...
[ "Updates", "an", "instance", "within", "a", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L487-L588
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.partial_update_instance
def partial_update_instance( self, instance, update_mask, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Partially updates an instance within a project. Example: ...
python
def partial_update_instance( self, instance, update_mask, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Partially updates an instance within a project. Example: ...
[ "def", "partial_update_instance", "(", "self", ",", "instance", ",", "update_mask", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ...
Partially updates an instance within a project. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> # TODO: Initialize `instance`: >>> instance = {} >...
[ "Partially", "updates", "an", "instance", "within", "a", "project", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L590-L687
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.create_cluster
def create_cluster( self, parent, cluster_id, cluster, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a cluster within an instance. Example: >>>...
python
def create_cluster( self, parent, cluster_id, cluster, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates a cluster within an instance. Example: >>>...
[ "def", "create_cluster", "(", "self", ",", "parent", ",", "cluster_id", ",", "cluster", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "m...
Creates a cluster within an instance. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> parent = client.instance_path('[PROJECT]', '[INSTANCE]') >>> ...
[ "Creates", "a", "cluster", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L756-L857
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.update_cluster
def update_cluster( self, name, serve_nodes, location=None, state=None, default_storage_type=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates a c...
python
def update_cluster( self, name, serve_nodes, location=None, state=None, default_storage_type=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates a c...
[ "def", "update_cluster", "(", "self", ",", "name", ",", "serve_nodes", ",", "location", "=", "None", ",", "state", "=", "None", ",", "default_storage_type", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "...
Updates a cluster within an instance. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> name = client.cluster_path('[PROJECT]', '[INSTANCE]', '[CLUSTER]') >>> ...
[ "Updates", "a", "cluster", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1006-L1111
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.create_app_profile
def create_app_profile( self, parent, app_profile_id, app_profile, ignore_warnings=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an app profile within...
python
def create_app_profile( self, parent, app_profile_id, app_profile, ignore_warnings=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an app profile within...
[ "def", "create_app_profile", "(", "self", ",", "parent", ",", "app_profile_id", ",", "app_profile", ",", "ignore_warnings", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "googl...
Creates an app profile within an instance. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> parent = client.instance_path('[PROJECT]', '[INSTANCE]') >>> ...
[ "Creates", "an", "app", "profile", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1180-L1271
train
googleapis/google-cloud-python
bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py
BigtableInstanceAdminClient.update_app_profile
def update_app_profile( self, app_profile, update_mask, ignore_warnings=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an app profile within an instance. ...
python
def update_app_profile( self, app_profile, update_mask, ignore_warnings=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Updates an app profile within an instance. ...
[ "def", "update_app_profile", "(", "self", ",", "app_profile", ",", "update_mask", ",", "ignore_warnings", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core...
Updates an app profile within an instance. Example: >>> from google.cloud import bigtable_admin_v2 >>> >>> client = bigtable_admin_v2.BigtableInstanceAdminClient() >>> >>> # TODO: Initialize `app_profile`: >>> app_profile = {} ...
[ "Updates", "an", "app", "profile", "within", "an", "instance", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py#L1447-L1548
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.annotation_spec_set_path
def annotation_spec_set_path(cls, project, annotation_spec_set): """Return a fully-qualified annotation_spec_set string.""" return google.api_core.path_template.expand( "projects/{project}/annotationSpecSets/{annotation_spec_set}", project=project, annotation_spec_set...
python
def annotation_spec_set_path(cls, project, annotation_spec_set): """Return a fully-qualified annotation_spec_set string.""" return google.api_core.path_template.expand( "projects/{project}/annotationSpecSets/{annotation_spec_set}", project=project, annotation_spec_set...
[ "def", "annotation_spec_set_path", "(", "cls", ",", "project", ",", "annotation_spec_set", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/annotationSpecSets/{annotation_spec_set}\"", ",", "project", "=", "p...
Return a fully-qualified annotation_spec_set string.
[ "Return", "a", "fully", "-", "qualified", "annotation_spec_set", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L93-L99
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.dataset_path
def dataset_path(cls, project, dataset): """Return a fully-qualified dataset string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}", project=project, dataset=dataset )
python
def dataset_path(cls, project, dataset): """Return a fully-qualified dataset string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}", project=project, dataset=dataset )
[ "def", "dataset_path", "(", "cls", ",", "project", ",", "dataset", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}\"", ",", "project", "=", "project", ",", "dataset", "=", "dataset...
Return a fully-qualified dataset string.
[ "Return", "a", "fully", "-", "qualified", "dataset", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L102-L106
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.annotated_dataset_path
def annotated_dataset_path(cls, project, dataset, annotated_dataset): """Return a fully-qualified annotated_dataset string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}", project=project, ...
python
def annotated_dataset_path(cls, project, dataset, annotated_dataset): """Return a fully-qualified annotated_dataset string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}", project=project, ...
[ "def", "annotated_dataset_path", "(", "cls", ",", "project", ",", "dataset", ",", "annotated_dataset", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}\"",...
Return a fully-qualified annotated_dataset string.
[ "Return", "a", "fully", "-", "qualified", "annotated_dataset", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L109-L116
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.example_path
def example_path(cls, project, dataset, annotated_dataset, example): """Return a fully-qualified example string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}", project=project, ...
python
def example_path(cls, project, dataset, annotated_dataset, example): """Return a fully-qualified example string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}", project=project, ...
[ "def", "example_path", "(", "cls", ",", "project", ",", "dataset", ",", "annotated_dataset", ",", "example", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_da...
Return a fully-qualified example string.
[ "Return", "a", "fully", "-", "qualified", "example", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L119-L127
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.data_item_path
def data_item_path(cls, project, dataset, data_item): """Return a fully-qualified data_item string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}/dataItems/{data_item}", project=project, dataset=dataset, data_item=d...
python
def data_item_path(cls, project, dataset, data_item): """Return a fully-qualified data_item string.""" return google.api_core.path_template.expand( "projects/{project}/datasets/{dataset}/dataItems/{data_item}", project=project, dataset=dataset, data_item=d...
[ "def", "data_item_path", "(", "cls", ",", "project", ",", "dataset", ",", "data_item", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/datasets/{dataset}/dataItems/{data_item}\"", ",", "project", "=", "p...
Return a fully-qualified data_item string.
[ "Return", "a", "fully", "-", "qualified", "data_item", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L130-L137
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.instruction_path
def instruction_path(cls, project, instruction): """Return a fully-qualified instruction string.""" return google.api_core.path_template.expand( "projects/{project}/instructions/{instruction}", project=project, instruction=instruction, )
python
def instruction_path(cls, project, instruction): """Return a fully-qualified instruction string.""" return google.api_core.path_template.expand( "projects/{project}/instructions/{instruction}", project=project, instruction=instruction, )
[ "def", "instruction_path", "(", "cls", ",", "project", ",", "instruction", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/instructions/{instruction}\"", ",", "project", "=", "project", ",", "instruction...
Return a fully-qualified instruction string.
[ "Return", "a", "fully", "-", "qualified", "instruction", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L140-L146
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.export_data
def export_data( self, name, annotated_dataset, output_config, filter_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Exports data and annotations from dataset...
python
def export_data( self, name, annotated_dataset, output_config, filter_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Exports data and annotations from dataset...
[ "def", "export_data", "(", "self", ",", "name", ",", "annotated_dataset", ",", "output_config", ",", "filter_", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", ...
Exports data and annotations from dataset. Example: >>> from google.cloud import datalabeling_v1beta1 >>> >>> client = datalabeling_v1beta1.DataLabelingServiceClient() >>> >>> name = client.dataset_path('[PROJECT]', '[DATASET]') >>> ...
[ "Exports", "data", "and", "annotations", "from", "dataset", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L667-L774
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.label_image
def label_image( self, parent, basic_config, feature, image_classification_config=None, bounding_poly_config=None, polyline_config=None, segmentation_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_...
python
def label_image( self, parent, basic_config, feature, image_classification_config=None, bounding_poly_config=None, polyline_config=None, segmentation_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_...
[ "def", "label_image", "(", "self", ",", "parent", ",", "basic_config", ",", "feature", ",", "image_classification_config", "=", "None", ",", "bounding_poly_config", "=", "None", ",", "polyline_config", "=", "None", ",", "segmentation_config", "=", "None", ",", "...
Starts a labeling task for image. The type of image labeling task is configured by feature in the request. Example: >>> from google.cloud import datalabeling_v1beta1 >>> from google.cloud.datalabeling_v1beta1 import enums >>> >>> client = datalabeling_v1b...
[ "Starts", "a", "labeling", "task", "for", "image", ".", "The", "type", "of", "image", "labeling", "task", "is", "configured", "by", "feature", "in", "the", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1131-L1274
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.label_video
def label_video( self, parent, basic_config, feature, video_classification_config=None, object_detection_config=None, object_tracking_config=None, event_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gap...
python
def label_video( self, parent, basic_config, feature, video_classification_config=None, object_detection_config=None, object_tracking_config=None, event_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gap...
[ "def", "label_video", "(", "self", ",", "parent", ",", "basic_config", ",", "feature", ",", "video_classification_config", "=", "None", ",", "object_detection_config", "=", "None", ",", "object_tracking_config", "=", "None", ",", "event_config", "=", "None", ",", ...
Starts a labeling task for video. The type of video labeling task is configured by feature in the request. Example: >>> from google.cloud import datalabeling_v1beta1 >>> from google.cloud.datalabeling_v1beta1 import enums >>> >>> client = datalabeling_v1b...
[ "Starts", "a", "labeling", "task", "for", "video", ".", "The", "type", "of", "video", "labeling", "task", "is", "configured", "by", "feature", "in", "the", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1276-L1419
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.label_text
def label_text( self, parent, basic_config, feature, text_classification_config=None, text_entity_extraction_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
python
def label_text( self, parent, basic_config, feature, text_classification_config=None, text_entity_extraction_config=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
[ "def", "label_text", "(", "self", ",", "parent", ",", "basic_config", ",", "feature", ",", "text_classification_config", "=", "None", ",", "text_entity_extraction_config", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method",...
Starts a labeling task for text. The type of text labeling task is configured by feature in the request. Example: >>> from google.cloud import datalabeling_v1beta1 >>> from google.cloud.datalabeling_v1beta1 import enums >>> >>> client = datalabeling_v1bet...
[ "Starts", "a", "labeling", "task", "for", "text", ".", "The", "type", "of", "text", "labeling", "task", "is", "configured", "by", "feature", "in", "the", "request", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L1421-L1546
train
googleapis/google-cloud-python
datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py
DataLabelingServiceClient.create_instruction
def create_instruction( self, parent, instruction, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an instruction for how data should be labeled. Example: ...
python
def create_instruction( self, parent, instruction, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an instruction for how data should be labeled. Example: ...
[ "def", "create_instruction", "(", "self", ",", "parent", ",", "instruction", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", ...
Creates an instruction for how data should be labeled. Example: >>> from google.cloud import datalabeling_v1beta1 >>> >>> client = datalabeling_v1beta1.DataLabelingServiceClient() >>> >>> parent = client.project_path('[PROJECT]') >>> ...
[ "Creates", "an", "instruction", "for", "how", "data", "should", "be", "labeled", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py#L2157-L2249
train
googleapis/google-cloud-python
runtimeconfig/google/cloud/runtimeconfig/variable.py
Variable.from_api_repr
def from_api_repr(cls, resource, config): """Factory: construct a Variable given its API representation :type resource: dict :param resource: change set representation returned from the API. :type config: :class:`google.cloud.runtimeconfig.config.Config` :param config: The con...
python
def from_api_repr(cls, resource, config): """Factory: construct a Variable given its API representation :type resource: dict :param resource: change set representation returned from the API. :type config: :class:`google.cloud.runtimeconfig.config.Config` :param config: The con...
[ "def", "from_api_repr", "(", "cls", ",", "resource", ",", "config", ")", ":", "name", "=", "variable_name_from_full_name", "(", "resource", ".", "get", "(", "\"name\"", ")", ")", "variable", "=", "cls", "(", "name", "=", "name", ",", "config", "=", "conf...
Factory: construct a Variable given its API representation :type resource: dict :param resource: change set representation returned from the API. :type config: :class:`google.cloud.runtimeconfig.config.Config` :param config: The config to which this variable belongs. :rtype: ...
[ "Factory", ":", "construct", "a", "Variable", "given", "its", "API", "representation" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L73-L88
train
googleapis/google-cloud-python
runtimeconfig/google/cloud/runtimeconfig/variable.py
Variable.full_name
def full_name(self): """Fully-qualified name of this variable. Example: ``projects/my-project/configs/my-config/variables/my-var`` :rtype: str :returns: The full name based on config and variable names. :raises: :class:`ValueError` if the variable is missing a name. ...
python
def full_name(self): """Fully-qualified name of this variable. Example: ``projects/my-project/configs/my-config/variables/my-var`` :rtype: str :returns: The full name based on config and variable names. :raises: :class:`ValueError` if the variable is missing a name. ...
[ "def", "full_name", "(", "self", ")", ":", "if", "not", "self", ".", "name", ":", "raise", "ValueError", "(", "\"Missing variable name.\"", ")", "return", "\"%s/variables/%s\"", "%", "(", "self", ".", "config", ".", "full_name", ",", "self", ".", "name", "...
Fully-qualified name of this variable. Example: ``projects/my-project/configs/my-config/variables/my-var`` :rtype: str :returns: The full name based on config and variable names. :raises: :class:`ValueError` if the variable is missing a name.
[ "Fully", "-", "qualified", "name", "of", "this", "variable", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L91-L104
train
googleapis/google-cloud-python
runtimeconfig/google/cloud/runtimeconfig/variable.py
Variable.value
def value(self): """Value of the variable, as bytes. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables :rtype: bytes or ``NoneType`` :returns: The value of the variable or ``None`` if the property ...
python
def value(self): """Value of the variable, as bytes. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables :rtype: bytes or ``NoneType`` :returns: The value of the variable or ``None`` if the property ...
[ "def", "value", "(", "self", ")", ":", "value", "=", "self", ".", "_properties", ".", "get", "(", "\"value\"", ")", "if", "value", "is", "not", "None", ":", "value", "=", "base64", ".", "b64decode", "(", "value", ")", "return", "value" ]
Value of the variable, as bytes. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables :rtype: bytes or ``NoneType`` :returns: The value of the variable or ``None`` if the property is not set locally.
[ "Value", "of", "the", "variable", "as", "bytes", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L121-L134
train
googleapis/google-cloud-python
runtimeconfig/google/cloud/runtimeconfig/variable.py
Variable.update_time
def update_time(self): """Retrieve the timestamp at which the variable was updated. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables Returns: :class:`~api_core.datetime_helpers.DatetimeWithNanoseconds`, ...
python
def update_time(self): """Retrieve the timestamp at which the variable was updated. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables Returns: :class:`~api_core.datetime_helpers.DatetimeWithNanoseconds`, ...
[ "def", "update_time", "(", "self", ")", ":", "value", "=", "self", ".", "_properties", ".", "get", "(", "\"updateTime\"", ")", "if", "value", "is", "not", "None", ":", "try", ":", "value", "=", "datetime", ".", "datetime", ".", "strptime", "(", "value"...
Retrieve the timestamp at which the variable was updated. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables Returns: :class:`~api_core.datetime_helpers.DatetimeWithNanoseconds`, :class:`datetime.dateti...
[ "Retrieve", "the", "timestamp", "at", "which", "the", "variable", "was", "updated", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L151-L178
train
googleapis/google-cloud-python
runtimeconfig/google/cloud/runtimeconfig/variable.py
Variable._set_properties
def _set_properties(self, resource): """Update properties from resource in body of ``api_response`` :type resource: dict :param resource: variable representation returned from the API. """ self._properties.clear() cleaned = resource.copy() if "name" in cleaned: ...
python
def _set_properties(self, resource): """Update properties from resource in body of ``api_response`` :type resource: dict :param resource: variable representation returned from the API. """ self._properties.clear() cleaned = resource.copy() if "name" in cleaned: ...
[ "def", "_set_properties", "(", "self", ",", "resource", ")", ":", "self", ".", "_properties", ".", "clear", "(", ")", "cleaned", "=", "resource", ".", "copy", "(", ")", "if", "\"name\"", "in", "cleaned", ":", "self", ".", "name", "=", "variable_name_from...
Update properties from resource in body of ``api_response`` :type resource: dict :param resource: variable representation returned from the API.
[ "Update", "properties", "from", "resource", "in", "body", "of", "api_response" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/runtimeconfig/google/cloud/runtimeconfig/variable.py#L195-L205
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
from_any_pb
def from_any_pb(pb_type, any_pb): """Converts an ``Any`` protobuf to the specified message type. Args: pb_type (type): the type of the message that any_pb stores an instance of. any_pb (google.protobuf.any_pb2.Any): the object to be converted. Returns: pb_type: An insta...
python
def from_any_pb(pb_type, any_pb): """Converts an ``Any`` protobuf to the specified message type. Args: pb_type (type): the type of the message that any_pb stores an instance of. any_pb (google.protobuf.any_pb2.Any): the object to be converted. Returns: pb_type: An insta...
[ "def", "from_any_pb", "(", "pb_type", ",", "any_pb", ")", ":", "msg", "=", "pb_type", "(", ")", "# Unwrap proto-plus wrapped messages.", "if", "callable", "(", "getattr", "(", "pb_type", ",", "\"pb\"", ",", "None", ")", ")", ":", "msg_pb", "=", "pb_type", ...
Converts an ``Any`` protobuf to the specified message type. Args: pb_type (type): the type of the message that any_pb stores an instance of. any_pb (google.protobuf.any_pb2.Any): the object to be converted. Returns: pb_type: An instance of the pb_type message. Raises: ...
[ "Converts", "an", "Any", "protobuf", "to", "the", "specified", "message", "type", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L43-L74
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
get_messages
def get_messages(module): """Discovers all protobuf Message classes in a given import module. Args: module (module): A Python module; :func:`dir` will be run against this module to find Message subclasses. Returns: dict[str, google.protobuf.message.Message]: A dictionary with t...
python
def get_messages(module): """Discovers all protobuf Message classes in a given import module. Args: module (module): A Python module; :func:`dir` will be run against this module to find Message subclasses. Returns: dict[str, google.protobuf.message.Message]: A dictionary with t...
[ "def", "get_messages", "(", "module", ")", ":", "answer", "=", "collections", ".", "OrderedDict", "(", ")", "for", "name", "in", "dir", "(", "module", ")", ":", "candidate", "=", "getattr", "(", "module", ",", "name", ")", "if", "inspect", ".", "isclas...
Discovers all protobuf Message classes in a given import module. Args: module (module): A Python module; :func:`dir` will be run against this module to find Message subclasses. Returns: dict[str, google.protobuf.message.Message]: A dictionary with the Message class name...
[ "Discovers", "all", "protobuf", "Message", "classes", "in", "a", "given", "import", "module", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L99-L116
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
_resolve_subkeys
def _resolve_subkeys(key, separator="."): """Resolve a potentially nested key. If the key contains the ``separator`` (e.g. ``.``) then the key will be split on the first instance of the subkey:: >>> _resolve_subkeys('a.b.c') ('a', 'b.c') >>> _resolve_subkeys('d|e|f', separator='|') ...
python
def _resolve_subkeys(key, separator="."): """Resolve a potentially nested key. If the key contains the ``separator`` (e.g. ``.``) then the key will be split on the first instance of the subkey:: >>> _resolve_subkeys('a.b.c') ('a', 'b.c') >>> _resolve_subkeys('d|e|f', separator='|') ...
[ "def", "_resolve_subkeys", "(", "key", ",", "separator", "=", "\".\"", ")", ":", "parts", "=", "key", ".", "split", "(", "separator", ",", "1", ")", "if", "len", "(", "parts", ")", ">", "1", ":", "return", "parts", "else", ":", "return", "parts", "...
Resolve a potentially nested key. If the key contains the ``separator`` (e.g. ``.``) then the key will be split on the first instance of the subkey:: >>> _resolve_subkeys('a.b.c') ('a', 'b.c') >>> _resolve_subkeys('d|e|f', separator='|') ('d', 'e|f') If not, the subkey will be...
[ "Resolve", "a", "potentially", "nested", "key", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L119-L147
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
get
def get(msg_or_dict, key, default=_SENTINEL): """Retrieve a key's value from a protobuf Message or dictionary. Args: mdg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the object. key (str): The key to retrieve from the object. default (Any): If the key is not p...
python
def get(msg_or_dict, key, default=_SENTINEL): """Retrieve a key's value from a protobuf Message or dictionary. Args: mdg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the object. key (str): The key to retrieve from the object. default (Any): If the key is not p...
[ "def", "get", "(", "msg_or_dict", ",", "key", ",", "default", "=", "_SENTINEL", ")", ":", "# We may need to get a nested key. Resolve this.", "key", ",", "subkey", "=", "_resolve_subkeys", "(", "key", ")", "# Attempt to get the value from the two types of objects we know ab...
Retrieve a key's value from a protobuf Message or dictionary. Args: mdg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the object. key (str): The key to retrieve from the object. default (Any): If the key is not present on the object, and a default is se...
[ "Retrieve", "a", "key", "s", "value", "from", "a", "protobuf", "Message", "or", "dictionary", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L150-L198
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
_set_field_on_message
def _set_field_on_message(msg, key, value): """Set helper for protobuf Messages.""" # Attempt to set the value on the types of objects we know how to deal # with. if isinstance(value, (collections_abc.MutableSequence, tuple)): # Clear the existing repeated protobuf message of any elements ...
python
def _set_field_on_message(msg, key, value): """Set helper for protobuf Messages.""" # Attempt to set the value on the types of objects we know how to deal # with. if isinstance(value, (collections_abc.MutableSequence, tuple)): # Clear the existing repeated protobuf message of any elements ...
[ "def", "_set_field_on_message", "(", "msg", ",", "key", ",", "value", ")", ":", "# Attempt to set the value on the types of objects we know how to deal", "# with.", "if", "isinstance", "(", "value", ",", "(", "collections_abc", ".", "MutableSequence", ",", "tuple", ")",...
Set helper for protobuf Messages.
[ "Set", "helper", "for", "protobuf", "Messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L201-L226
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
set
def set(msg_or_dict, key, value): """Set a key's value on a protobuf Message or dictionary. Args: msg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the object. key (str): The key to set. value (Any): The value to set. Raises: TypeError: If ``msg_or...
python
def set(msg_or_dict, key, value): """Set a key's value on a protobuf Message or dictionary. Args: msg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the object. key (str): The key to set. value (Any): The value to set. Raises: TypeError: If ``msg_or...
[ "def", "set", "(", "msg_or_dict", ",", "key", ",", "value", ")", ":", "# Sanity check: Is our target object valid?", "if", "not", "isinstance", "(", "msg_or_dict", ",", "(", "collections_abc", ".", "MutableMapping", ",", "message", ".", "Message", ")", ")", ":",...
Set a key's value on a protobuf Message or dictionary. Args: msg_or_dict (Union[~google.protobuf.message.Message, Mapping]): the object. key (str): The key to set. value (Any): The value to set. Raises: TypeError: If ``msg_or_dict`` is not a Message or dictionary.
[ "Set", "a", "key", "s", "value", "on", "a", "protobuf", "Message", "or", "dictionary", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L229-L263
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
setdefault
def setdefault(msg_or_dict, key, value): """Set the key on a protobuf Message or dictionary to a given value if the current value is falsy. Because protobuf Messages do not distinguish between unset values and falsy ones particularly well (by design), this method treats any falsy value (e.g. 0, emp...
python
def setdefault(msg_or_dict, key, value): """Set the key on a protobuf Message or dictionary to a given value if the current value is falsy. Because protobuf Messages do not distinguish between unset values and falsy ones particularly well (by design), this method treats any falsy value (e.g. 0, emp...
[ "def", "setdefault", "(", "msg_or_dict", ",", "key", ",", "value", ")", ":", "if", "not", "get", "(", "msg_or_dict", ",", "key", ",", "default", "=", "None", ")", ":", "set", "(", "msg_or_dict", ",", "key", ",", "value", ")" ]
Set the key on a protobuf Message or dictionary to a given value if the current value is falsy. Because protobuf Messages do not distinguish between unset values and falsy ones particularly well (by design), this method treats any falsy value (e.g. 0, empty list) as a target to be overwritten, on both ...
[ "Set", "the", "key", "on", "a", "protobuf", "Message", "or", "dictionary", "to", "a", "given", "value", "if", "the", "current", "value", "is", "falsy", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L266-L285
train
googleapis/google-cloud-python
api_core/google/api_core/protobuf_helpers.py
field_mask
def field_mask(original, modified): """Create a field mask by comparing two messages. Args: original (~google.protobuf.message.Message): the original message. If set to None, this field will be interpretted as an empty message. modified (~google.protobuf.message.Message)...
python
def field_mask(original, modified): """Create a field mask by comparing two messages. Args: original (~google.protobuf.message.Message): the original message. If set to None, this field will be interpretted as an empty message. modified (~google.protobuf.message.Message)...
[ "def", "field_mask", "(", "original", ",", "modified", ")", ":", "if", "original", "is", "None", "and", "modified", "is", "None", ":", "return", "field_mask_pb2", ".", "FieldMask", "(", ")", "if", "original", "is", "None", "and", "modified", "is", "not", ...
Create a field mask by comparing two messages. Args: original (~google.protobuf.message.Message): the original message. If set to None, this field will be interpretted as an empty message. modified (~google.protobuf.message.Message): the modified message. If set ...
[ "Create", "a", "field", "mask", "by", "comparing", "two", "messages", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/protobuf_helpers.py#L288-L326
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
SubscriberClient.topic_path
def topic_path(cls, project, topic): """Return a fully-qualified topic string.""" return google.api_core.path_template.expand( "projects/{project}/topics/{topic}", project=project, topic=topic )
python
def topic_path(cls, project, topic): """Return a fully-qualified topic string.""" return google.api_core.path_template.expand( "projects/{project}/topics/{topic}", project=project, topic=topic )
[ "def", "topic_path", "(", "cls", ",", "project", ",", "topic", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/topics/{topic}\"", ",", "project", "=", "project", ",", "topic", "=", "topic", ")" ]
Return a fully-qualified topic string.
[ "Return", "a", "fully", "-", "qualified", "topic", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L98-L102
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
SubscriberClient.snapshot_path
def snapshot_path(cls, project, snapshot): """Return a fully-qualified snapshot string.""" return google.api_core.path_template.expand( "projects/{project}/snapshots/{snapshot}", project=project, snapshot=snapshot, )
python
def snapshot_path(cls, project, snapshot): """Return a fully-qualified snapshot string.""" return google.api_core.path_template.expand( "projects/{project}/snapshots/{snapshot}", project=project, snapshot=snapshot, )
[ "def", "snapshot_path", "(", "cls", ",", "project", ",", "snapshot", ")", ":", "return", "google", ".", "api_core", ".", "path_template", ".", "expand", "(", "\"projects/{project}/snapshots/{snapshot}\"", ",", "project", "=", "project", ",", "snapshot", "=", "sn...
Return a fully-qualified snapshot string.
[ "Return", "a", "fully", "-", "qualified", "snapshot", "string", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L112-L118
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
SubscriberClient.create_subscription
def create_subscription( self, name, topic, push_config=None, ack_deadline_seconds=None, retain_acked_messages=None, message_retention_duration=None, labels=None, enable_message_ordering=None, expiration_policy=None, retry=google.ap...
python
def create_subscription( self, name, topic, push_config=None, ack_deadline_seconds=None, retain_acked_messages=None, message_retention_duration=None, labels=None, enable_message_ordering=None, expiration_policy=None, retry=google.ap...
[ "def", "create_subscription", "(", "self", ",", "name", ",", "topic", ",", "push_config", "=", "None", ",", "ack_deadline_seconds", "=", "None", ",", "retain_acked_messages", "=", "None", ",", "message_retention_duration", "=", "None", ",", "labels", "=", "None"...
Creates a subscription to a given topic. See the resource name rules. If the subscription already exists, returns ``ALREADY_EXISTS``. If the corresponding topic doesn't exist, returns ``NOT_FOUND``. If the name is not provided in the request, the server will assign a random name for thi...
[ "Creates", "a", "subscription", "to", "a", "given", "topic", ".", "See", "the", "resource", "name", "rules", ".", "If", "the", "subscription", "already", "exists", "returns", "ALREADY_EXISTS", ".", "If", "the", "corresponding", "topic", "doesn", "t", "exist", ...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L219-L389
train
googleapis/google-cloud-python
pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
SubscriberClient.seek
def seek( self, subscription, time=None, snapshot=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Seeks an existing subscription to a point in time or to a given snapsh...
python
def seek( self, subscription, time=None, snapshot=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Seeks an existing subscription to a point in time or to a given snapsh...
[ "def", "seek", "(", "self", ",", "subscription", ",", "time", "=", "None", ",", "snapshot", "=", "None", ",", "retry", "=", "google", ".", "api_core", ".", "gapic_v1", ".", "method", ".", "DEFAULT", ",", "timeout", "=", "google", ".", "api_core", ".", ...
Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. Snapshots are used in <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which allow you to manage message acknowledgments in bulk. That is, yo...
[ "Seeks", "an", "existing", "subscription", "to", "a", "point", "in", "time", "or", "to", "a", "given", "snapshot", "whichever", "is", "provided", "in", "the", "request", ".", "Snapshots", "are", "used", "in", "<a", "href", "=", "https", ":", "//", "cloud...
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py#L1527-L1626
train
googleapis/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/completion_client.py
CompletionClient.complete_query
def complete_query( self, name, query, page_size, language_codes=None, company_name=None, scope=None, type_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
python
def complete_query( self, name, query, page_size, language_codes=None, company_name=None, scope=None, type_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): ...
[ "def", "complete_query", "(", "self", ",", "name", ",", "query", ",", "page_size", ",", "language_codes", "=", "None", ",", "company_name", "=", "None", ",", "scope", "=", "None", ",", "type_", "=", "None", ",", "retry", "=", "google", ".", "api_core", ...
Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-complete search box. Example: >>> from google.cloud import talent_v4beta1 >>> >>> client = talent_v4beta1.CompletionClient() >>> >>> name = client.p...
[ "Completes", "the", "specified", "prefix", "with", "keyword", "suggestions", ".", "Intended", "for", "use", "by", "a", "job", "search", "auto", "-", "complete", "search", "box", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/completion_client.py#L179-L298
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
AbstractSessionPool._new_session
def _new_session(self): """Helper for concrete methods creating session instances. :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: new session instance. """ if self.labels: return self._database.session(labels=self.labels) return self._dat...
python
def _new_session(self): """Helper for concrete methods creating session instances. :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: new session instance. """ if self.labels: return self._database.session(labels=self.labels) return self._dat...
[ "def", "_new_session", "(", "self", ")", ":", "if", "self", ".", "labels", ":", "return", "self", ".", "_database", ".", "session", "(", "labels", "=", "self", ".", "labels", ")", "return", "self", ".", "_database", ".", "session", "(", ")" ]
Helper for concrete methods creating session instances. :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: new session instance.
[ "Helper", "for", "concrete", "methods", "creating", "session", "instances", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L102-L110
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
FixedSizePool.bind
def bind(self, database): """Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed. """ self._database = database ...
python
def bind(self, database): """Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed. """ self._database = database ...
[ "def", "bind", "(", "self", ",", "database", ")", ":", "self", ".", "_database", "=", "database", "while", "not", "self", ".", "_sessions", ".", "full", "(", ")", ":", "session", "=", "self", ".", "_new_session", "(", ")", "session", ".", "create", "...
Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed.
[ "Associate", "the", "pool", "with", "a", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L162-L174
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
FixedSizePool.get
def get(self, timeout=None): # pylint: disable=arguments-differ """Check a session out from the pool. :type timeout: int :param timeout: seconds to block waiting for an available session :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session fr...
python
def get(self, timeout=None): # pylint: disable=arguments-differ """Check a session out from the pool. :type timeout: int :param timeout: seconds to block waiting for an available session :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session fr...
[ "def", "get", "(", "self", ",", "timeout", "=", "None", ")", ":", "# pylint: disable=arguments-differ", "if", "timeout", "is", "None", ":", "timeout", "=", "self", ".", "default_timeout", "session", "=", "self", ".", "_sessions", ".", "get", "(", "block", ...
Check a session out from the pool. :type timeout: int :param timeout: seconds to block waiting for an available session :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session from the pool, or a newly-created session. :raises: ...
[ "Check", "a", "session", "out", "from", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L176-L196
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
FixedSizePool.clear
def clear(self): """Delete all sessions in the pool.""" while True: try: session = self._sessions.get(block=False) except queue.Empty: break else: session.delete()
python
def clear(self): """Delete all sessions in the pool.""" while True: try: session = self._sessions.get(block=False) except queue.Empty: break else: session.delete()
[ "def", "clear", "(", "self", ")", ":", "while", "True", ":", "try", ":", "session", "=", "self", ".", "_sessions", ".", "get", "(", "block", "=", "False", ")", "except", "queue", ".", "Empty", ":", "break", "else", ":", "session", ".", "delete", "(...
Delete all sessions in the pool.
[ "Delete", "all", "sessions", "in", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L210-L219
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
BurstyPool.get
def get(self): """Check a session out from the pool. :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session from the pool, or a newly-created session. """ try: session = self._sessions.get_nowait() except que...
python
def get(self): """Check a session out from the pool. :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session from the pool, or a newly-created session. """ try: session = self._sessions.get_nowait() except que...
[ "def", "get", "(", "self", ")", ":", "try", ":", "session", "=", "self", ".", "_sessions", ".", "get_nowait", "(", ")", "except", "queue", ".", "Empty", ":", "session", "=", "self", ".", "_new_session", "(", ")", "session", ".", "create", "(", ")", ...
Check a session out from the pool. :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session from the pool, or a newly-created session.
[ "Check", "a", "session", "out", "from", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L257-L273
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
BurstyPool.put
def put(self, session): """Return a session to the pool. Never blocks: if the pool is full, the returned session is discarded. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. """ try: self...
python
def put(self, session): """Return a session to the pool. Never blocks: if the pool is full, the returned session is discarded. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. """ try: self...
[ "def", "put", "(", "self", ",", "session", ")", ":", "try", ":", "self", ".", "_sessions", ".", "put_nowait", "(", "session", ")", "except", "queue", ".", "Full", ":", "try", ":", "session", ".", "delete", "(", ")", "except", "NotFound", ":", "pass" ...
Return a session to the pool. Never blocks: if the pool is full, the returned session is discarded. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned.
[ "Return", "a", "session", "to", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L275-L290
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
PingingPool.bind
def bind(self, database): """Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed. """ self._database = database ...
python
def bind(self, database): """Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed. """ self._database = database ...
[ "def", "bind", "(", "self", ",", "database", ")", ":", "self", ".", "_database", "=", "database", "for", "_", "in", "xrange", "(", "self", ".", "size", ")", ":", "session", "=", "self", ".", "_new_session", "(", ")", "session", ".", "create", "(", ...
Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed.
[ "Associate", "the", "pool", "with", "a", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L346-L358
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
PingingPool.get
def get(self, timeout=None): # pylint: disable=arguments-differ """Check a session out from the pool. :type timeout: int :param timeout: seconds to block waiting for an available session :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session fr...
python
def get(self, timeout=None): # pylint: disable=arguments-differ """Check a session out from the pool. :type timeout: int :param timeout: seconds to block waiting for an available session :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session fr...
[ "def", "get", "(", "self", ",", "timeout", "=", "None", ")", ":", "# pylint: disable=arguments-differ", "if", "timeout", "is", "None", ":", "timeout", "=", "self", ".", "default_timeout", "ping_after", ",", "session", "=", "self", ".", "_sessions", ".", "get...
Check a session out from the pool. :type timeout: int :param timeout: seconds to block waiting for an available session :rtype: :class:`~google.cloud.spanner_v1.session.Session` :returns: an existing session from the pool, or a newly-created session. :raises: ...
[ "Check", "a", "session", "out", "from", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L360-L381
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
PingingPool.put
def put(self, session): """Return a session to the pool. Never blocks: if the pool is full, raises. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. :raises: :exc:`six.moves.queue.Full` if the queue is full. ...
python
def put(self, session): """Return a session to the pool. Never blocks: if the pool is full, raises. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. :raises: :exc:`six.moves.queue.Full` if the queue is full. ...
[ "def", "put", "(", "self", ",", "session", ")", ":", "self", ".", "_sessions", ".", "put_nowait", "(", "(", "_NOW", "(", ")", "+", "self", ".", "_delta", ",", "session", ")", ")" ]
Return a session to the pool. Never blocks: if the pool is full, raises. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. :raises: :exc:`six.moves.queue.Full` if the queue is full.
[ "Return", "a", "session", "to", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L383-L393
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
PingingPool.ping
def ping(self): """Refresh maybe-expired sessions in the pool. This method is designed to be called from a background thread, or during the "idle" phase of an event loop. """ while True: try: ping_after, session = self._sessions.get(block=False) ...
python
def ping(self): """Refresh maybe-expired sessions in the pool. This method is designed to be called from a background thread, or during the "idle" phase of an event loop. """ while True: try: ping_after, session = self._sessions.get(block=False) ...
[ "def", "ping", "(", "self", ")", ":", "while", "True", ":", "try", ":", "ping_after", ",", "session", "=", "self", ".", "_sessions", ".", "get", "(", "block", "=", "False", ")", "except", "queue", ".", "Empty", ":", "# all sessions in use", "break", "i...
Refresh maybe-expired sessions in the pool. This method is designed to be called from a background thread, or during the "idle" phase of an event loop.
[ "Refresh", "maybe", "-", "expired", "sessions", "in", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L405-L424
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
TransactionPingingPool.bind
def bind(self, database): """Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed. """ super(TransactionPingingPool, self)...
python
def bind(self, database): """Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed. """ super(TransactionPingingPool, self)...
[ "def", "bind", "(", "self", ",", "database", ")", ":", "super", "(", "TransactionPingingPool", ",", "self", ")", ".", "bind", "(", "database", ")", "self", ".", "begin_pending_transactions", "(", ")" ]
Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` :param database: database used by the pool: used to create sessions when needed.
[ "Associate", "the", "pool", "with", "a", "database", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L463-L471
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
TransactionPingingPool.put
def put(self, session): """Return a session to the pool. Never blocks: if the pool is full, raises. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. :raises: :exc:`six.moves.queue.Full` if the queue is full. ...
python
def put(self, session): """Return a session to the pool. Never blocks: if the pool is full, raises. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. :raises: :exc:`six.moves.queue.Full` if the queue is full. ...
[ "def", "put", "(", "self", ",", "session", ")", ":", "if", "self", ".", "_sessions", ".", "full", "(", ")", ":", "raise", "queue", ".", "Full", "txn", "=", "session", ".", "_transaction", "if", "txn", "is", "None", "or", "txn", ".", "committed", "(...
Return a session to the pool. Never blocks: if the pool is full, raises. :type session: :class:`~google.cloud.spanner_v1.session.Session` :param session: the session being returned. :raises: :exc:`six.moves.queue.Full` if the queue is full.
[ "Return", "a", "session", "to", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L473-L491
train
googleapis/google-cloud-python
spanner/google/cloud/spanner_v1/pool.py
TransactionPingingPool.begin_pending_transactions
def begin_pending_transactions(self): """Begin all transactions for sessions added to the pool.""" while not self._pending_sessions.empty(): session = self._pending_sessions.get() session._transaction.begin() super(TransactionPingingPool, self).put(session)
python
def begin_pending_transactions(self): """Begin all transactions for sessions added to the pool.""" while not self._pending_sessions.empty(): session = self._pending_sessions.get() session._transaction.begin() super(TransactionPingingPool, self).put(session)
[ "def", "begin_pending_transactions", "(", "self", ")", ":", "while", "not", "self", ".", "_pending_sessions", ".", "empty", "(", ")", ":", "session", "=", "self", ".", "_pending_sessions", ".", "get", "(", ")", "session", ".", "_transaction", ".", "begin", ...
Begin all transactions for sessions added to the pool.
[ "Begin", "all", "transactions", "for", "sessions", "added", "to", "the", "pool", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/pool.py#L493-L498
train
googleapis/google-cloud-python
logging/google/cloud/logging/handlers/handlers.py
setup_logging
def setup_logging( handler, excluded_loggers=EXCLUDED_LOGGER_DEFAULTS, log_level=logging.INFO ): """Attach a logging handler to the Python root logger Excludes loggers that this library itself uses to avoid infinite recursion. :type handler: :class:`logging.handler` :param handler: the handler...
python
def setup_logging( handler, excluded_loggers=EXCLUDED_LOGGER_DEFAULTS, log_level=logging.INFO ): """Attach a logging handler to the Python root logger Excludes loggers that this library itself uses to avoid infinite recursion. :type handler: :class:`logging.handler` :param handler: the handler...
[ "def", "setup_logging", "(", "handler", ",", "excluded_loggers", "=", "EXCLUDED_LOGGER_DEFAULTS", ",", "log_level", "=", "logging", ".", "INFO", ")", ":", "all_excluded_loggers", "=", "set", "(", "excluded_loggers", "+", "EXCLUDED_LOGGER_DEFAULTS", ")", "logger", "=...
Attach a logging handler to the Python root logger Excludes loggers that this library itself uses to avoid infinite recursion. :type handler: :class:`logging.handler` :param handler: the handler to attach to the global handler :type excluded_loggers: tuple :param excluded_loggers: (Optional) ...
[ "Attach", "a", "logging", "handler", "to", "the", "Python", "root", "logger" ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/handlers.py#L112-L156
train
googleapis/google-cloud-python
logging/google/cloud/logging/handlers/handlers.py
CloudLoggingHandler.emit
def emit(self, record): """Actually log the specified logging record. Overrides the default emit behavior of ``StreamHandler``. See https://docs.python.org/2/library/logging.html#handler-objects :type record: :class:`logging.LogRecord` :param record: The record to be logged. ...
python
def emit(self, record): """Actually log the specified logging record. Overrides the default emit behavior of ``StreamHandler``. See https://docs.python.org/2/library/logging.html#handler-objects :type record: :class:`logging.LogRecord` :param record: The record to be logged. ...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "message", "=", "super", "(", "CloudLoggingHandler", ",", "self", ")", ".", "format", "(", "record", ")", "self", ".", "transport", ".", "send", "(", "record", ",", "message", ",", "resource", "=", ...
Actually log the specified logging record. Overrides the default emit behavior of ``StreamHandler``. See https://docs.python.org/2/library/logging.html#handler-objects :type record: :class:`logging.LogRecord` :param record: The record to be logged.
[ "Actually", "log", "the", "specified", "logging", "record", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/handlers.py#L98-L109
train
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/query.py
_query_param_from_api_repr
def _query_param_from_api_repr(resource): """Helper: construct concrete query parameter from JSON resource.""" qp_type = resource["parameterType"] if "arrayType" in qp_type: klass = ArrayQueryParameter elif "structTypes" in qp_type: klass = StructQueryParameter else: klass =...
python
def _query_param_from_api_repr(resource): """Helper: construct concrete query parameter from JSON resource.""" qp_type = resource["parameterType"] if "arrayType" in qp_type: klass = ArrayQueryParameter elif "structTypes" in qp_type: klass = StructQueryParameter else: klass =...
[ "def", "_query_param_from_api_repr", "(", "resource", ")", ":", "qp_type", "=", "resource", "[", "\"parameterType\"", "]", "if", "\"arrayType\"", "in", "qp_type", ":", "klass", "=", "ArrayQueryParameter", "elif", "\"structTypes\"", "in", "qp_type", ":", "klass", "...
Helper: construct concrete query parameter from JSON resource.
[ "Helper", ":", "construct", "concrete", "query", "parameter", "from", "JSON", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L616-L625
train
googleapis/google-cloud-python
bigquery/google/cloud/bigquery/query.py
ScalarQueryParameter.from_api_repr
def from_api_repr(cls, resource): """Factory: construct parameter from JSON resource. :type resource: dict :param resource: JSON mapping of parameter :rtype: :class:`~google.cloud.bigquery.query.ScalarQueryParameter` :returns: instance """ name = resource.get("n...
python
def from_api_repr(cls, resource): """Factory: construct parameter from JSON resource. :type resource: dict :param resource: JSON mapping of parameter :rtype: :class:`~google.cloud.bigquery.query.ScalarQueryParameter` :returns: instance """ name = resource.get("n...
[ "def", "from_api_repr", "(", "cls", ",", "resource", ")", ":", "name", "=", "resource", ".", "get", "(", "\"name\"", ")", "type_", "=", "resource", "[", "\"parameterType\"", "]", "[", "\"type\"", "]", "value", "=", "resource", "[", "\"parameterValue\"", "]...
Factory: construct parameter from JSON resource. :type resource: dict :param resource: JSON mapping of parameter :rtype: :class:`~google.cloud.bigquery.query.ScalarQueryParameter` :returns: instance
[ "Factory", ":", "construct", "parameter", "from", "JSON", "resource", "." ]
85e80125a59cb10f8cb105f25ecc099e4b940b50
https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/query.py#L118-L131
train