partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | Cluster.reload | Reload the metadata for this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_cluster]
:end-before: [END bigtable_reload_cluster] | bigtable/google/cloud/bigtable/cluster.py | def reload(self):
"""Reload the metadata for this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_cluster]
:end-before: [END bigtable_reload_cluster]
"""
cluster_pb = self._instance._client.instance_admin_client... | def reload(self):
"""Reload the metadata for this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_reload_cluster]
:end-before: [END bigtable_reload_cluster]
"""
cluster_pb = self._instance._client.instance_admin_client... | [
"Reload",
"the",
"metadata",
"for",
"this",
"cluster",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L201-L214 | [
"def",
"reload",
"(",
"self",
")",
":",
"cluster_pb",
"=",
"self",
".",
"_instance",
".",
"_client",
".",
"instance_admin_client",
".",
"get_cluster",
"(",
"self",
".",
"name",
")",
"# NOTE: _update_from_pb does not check that the project and",
"# cluster ID on th... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cluster.exists | Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_cluster_exists]
:end-before: [END bigtable_check_cluster_exists]
:rtype: bool
:returns: True if the table exists, else False. | bigtable/google/cloud/bigtable/cluster.py | def exists(self):
"""Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_cluster_exists]
:end-before: [END bigtable_check_cluster_exists]
:rtype: bool
:returns: True if the table exi... | def exists(self):
"""Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_cluster_exists]
:end-before: [END bigtable_check_cluster_exists]
:rtype: bool
:returns: True if the table exi... | [
"Check",
"whether",
"the",
"cluster",
"already",
"exists",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L216-L234 | [
"def",
"exists",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"try",
":",
"client",
".",
"instance_admin_client",
".",
"get_cluster",
"(",
"name",
"=",
"self",
".",
"name",
")",
"return",
"True",
"# NOTE: There could be oth... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cluster.create | Create this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-before: [END bigtable_create_cluster]
.. note::
Uses the ``project``, ``instance`` and ``cluster_id`` on the
current :class:`Cl... | bigtable/google/cloud/bigtable/cluster.py | def create(self):
"""Create this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-before: [END bigtable_create_cluster]
.. note::
Uses the ``project``, ``instance`` and ``cluster_id`` on the
... | def create(self):
"""Create this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_create_cluster]
:end-before: [END bigtable_create_cluster]
.. note::
Uses the ``project``, ``instance`` and ``cluster_id`` on the
... | [
"Create",
"this",
"cluster",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L236-L267 | [
"def",
"create",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"cluster_pb",
"=",
"self",
".",
"_to_pb",
"(",
")",
"return",
"client",
".",
"instance_admin_client",
".",
"create_cluster",
"(",
"self",
".",
"_instance",
"."... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cluster.update | Update this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_cluster]
:end-before: [END bigtable_update_cluster]
.. note::
Updates the ``serve_nodes``. If you'd like to
change them before updating, rese... | bigtable/google/cloud/bigtable/cluster.py | def update(self):
"""Update this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_cluster]
:end-before: [END bigtable_update_cluster]
.. note::
Updates the ``serve_nodes``. If you'd like to
chan... | def update(self):
"""Update this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_cluster]
:end-before: [END bigtable_update_cluster]
.. note::
Updates the ``serve_nodes``. If you'd like to
chan... | [
"Update",
"this",
"cluster",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L269-L311 | [
"def",
"update",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"# We are passing `None` for second argument location.",
"# Location is set only at the time of creation of a cluster",
"# and can not be changed after cluster has been created.",
"return... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cluster.delete | Delete this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_delete_cluster]
:end-before: [END bigtable_delete_cluster]
Marks a cluster and all of its tables for permanent deletion in 7 days.
Immediately upon completion of th... | bigtable/google/cloud/bigtable/cluster.py | def delete(self):
"""Delete this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_delete_cluster]
:end-before: [END bigtable_delete_cluster]
Marks a cluster and all of its tables for permanent deletion in 7 days.
Imme... | def delete(self):
"""Delete this cluster.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_delete_cluster]
:end-before: [END bigtable_delete_cluster]
Marks a cluster and all of its tables for permanent deletion in 7 days.
Imme... | [
"Delete",
"this",
"cluster",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L313-L340 | [
"def",
"delete",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"client",
".",
"instance_admin_client",
".",
"delete_cluster",
"(",
"self",
".",
"name",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cluster._to_pb | Create cluster proto buff message for API calls | bigtable/google/cloud/bigtable/cluster.py | def _to_pb(self):
""" Create cluster proto buff message for API calls """
client = self._instance._client
location = client.instance_admin_client.location_path(
client.project, self.location_id
)
cluster_pb = instance_pb2.Cluster(
location=location,
... | def _to_pb(self):
""" Create cluster proto buff message for API calls """
client = self._instance._client
location = client.instance_admin_client.location_path(
client.project, self.location_id
)
cluster_pb = instance_pb2.Cluster(
location=location,
... | [
"Create",
"cluster",
"proto",
"buff",
"message",
"for",
"API",
"calls"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/cluster.py#L342-L353 | [
"def",
"_to_pb",
"(",
"self",
")",
":",
"client",
"=",
"self",
".",
"_instance",
".",
"_client",
"location",
"=",
"client",
".",
"instance_admin_client",
".",
"location_path",
"(",
"client",
".",
"project",
",",
"self",
".",
"location_id",
")",
"cluster_pb",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Cell.from_pb | Create a new cell from a Cell protobuf.
:type cell_pb: :class:`._generated.data_pb2.Cell`
:param cell_pb: The protobuf to convert.
:rtype: :class:`Cell`
:returns: The cell corresponding to the protobuf. | bigtable/google/cloud/bigtable/row_data.py | def from_pb(cls, cell_pb):
"""Create a new cell from a Cell protobuf.
:type cell_pb: :class:`._generated.data_pb2.Cell`
:param cell_pb: The protobuf to convert.
:rtype: :class:`Cell`
:returns: The cell corresponding to the protobuf.
"""
if cell_pb.labels:
... | def from_pb(cls, cell_pb):
"""Create a new cell from a Cell protobuf.
:type cell_pb: :class:`._generated.data_pb2.Cell`
:param cell_pb: The protobuf to convert.
:rtype: :class:`Cell`
:returns: The cell corresponding to the protobuf.
"""
if cell_pb.labels:
... | [
"Create",
"a",
"new",
"cell",
"from",
"a",
"Cell",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L59-L71 | [
"def",
"from_pb",
"(",
"cls",
",",
"cell_pb",
")",
":",
"if",
"cell_pb",
".",
"labels",
":",
"return",
"cls",
"(",
"cell_pb",
".",
"value",
",",
"cell_pb",
".",
"timestamp_micros",
",",
"labels",
"=",
"cell_pb",
".",
"labels",
")",
"else",
":",
"return... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowData.to_dict | Convert the cells to a dictionary.
This is intended to be used with HappyBase, so the column family and
column qualiers are combined (with ``:``).
:rtype: dict
:returns: Dictionary containing all the data in the cells of this row. | bigtable/google/cloud/bigtable/row_data.py | def to_dict(self):
"""Convert the cells to a dictionary.
This is intended to be used with HappyBase, so the column family and
column qualiers are combined (with ``:``).
:rtype: dict
:returns: Dictionary containing all the data in the cells of this row.
"""
resul... | def to_dict(self):
"""Convert the cells to a dictionary.
This is intended to be used with HappyBase, so the column family and
column qualiers are combined (with ``:``).
:rtype: dict
:returns: Dictionary containing all the data in the cells of this row.
"""
resul... | [
"Convert",
"the",
"cells",
"to",
"a",
"dictionary",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L157-L171 | [
"def",
"to_dict",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"for",
"column_family_id",
",",
"columns",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"_cells",
")",
":",
"for",
"column_qual",
",",
"cells",
"in",
"six",
".",
"iteritems",
"(",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowData.find_cells | Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_find_cells]
:end-before: [END bigtable_row_find_cells]
Args:
column_family_id (str): The ID of the column family. Must b... | bigtable/google/cloud/bigtable/row_data.py | def find_cells(self, column_family_id, column):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_find_cells]
:end-before: [END bigtable_row_find_cells]
Args:
... | def find_cells(self, column_family_id, column):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_find_cells]
:end-before: [END bigtable_row_find_cells]
Args:
... | [
"Get",
"a",
"time",
"series",
"of",
"cells",
"stored",
"on",
"this",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L200-L235 | [
"def",
"find_cells",
"(",
"self",
",",
"column_family_id",
",",
"column",
")",
":",
"try",
":",
"column_family",
"=",
"self",
".",
"_cells",
"[",
"column_family_id",
"]",
"except",
"KeyError",
":",
"raise",
"KeyError",
"(",
"_MISSING_COLUMN_FAMILY",
".",
"form... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowData.cell_value | Get a single cell value stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_value]
:end-before: [END bigtable_row_cell_value]
Args:
column_family_id (str): The ID of the column family. Must be o... | bigtable/google/cloud/bigtable/row_data.py | def cell_value(self, column_family_id, column, index=0):
"""Get a single cell value stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_value]
:end-before: [END bigtable_row_cell_value]
Args:
... | def cell_value(self, column_family_id, column, index=0):
"""Get a single cell value stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_value]
:end-before: [END bigtable_row_cell_value]
Args:
... | [
"Get",
"a",
"single",
"cell",
"value",
"stored",
"on",
"this",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L237-L276 | [
"def",
"cell_value",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"index",
"=",
"0",
")",
":",
"cells",
"=",
"self",
".",
"find_cells",
"(",
"column_family_id",
",",
"column",
")",
"try",
":",
"cell",
"=",
"cells",
"[",
"index",
"]",
"exce... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowData.cell_values | Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_values]
:end-before: [END bigtable_row_cell_values]
Args:
column_family_id (str): The ID of the column family. Must... | bigtable/google/cloud/bigtable/row_data.py | def cell_values(self, column_family_id, column, max_count=None):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_values]
:end-before: [END bigtable_row_cell_values]
... | def cell_values(self, column_family_id, column, max_count=None):
"""Get a time series of cells stored on this instance.
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_cell_values]
:end-before: [END bigtable_row_cell_values]
... | [
"Get",
"a",
"time",
"series",
"of",
"cells",
"stored",
"on",
"this",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L278-L312 | [
"def",
"cell_values",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"max_count",
"=",
"None",
")",
":",
"cells",
"=",
"self",
".",
"find_cells",
"(",
"column_family_id",
",",
"column",
")",
"if",
"max_count",
"is",
"None",
":",
"max_count",
"="... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowsData.consume_all | Consume the streamed responses until there are no more.
.. warning::
This method will be removed in future releases. Please use this
class as a generator instead.
:type max_loops: int
:param max_loops: (Optional) Maximum number of times to try to consume
... | bigtable/google/cloud/bigtable/row_data.py | def consume_all(self, max_loops=None):
"""Consume the streamed responses until there are no more.
.. warning::
This method will be removed in future releases. Please use this
class as a generator instead.
:type max_loops: int
:param max_loops: (Optional) Maximum ... | def consume_all(self, max_loops=None):
"""Consume the streamed responses until there are no more.
.. warning::
This method will be removed in future releases. Please use this
class as a generator instead.
:type max_loops: int
:param max_loops: (Optional) Maximum ... | [
"Consume",
"the",
"streamed",
"responses",
"until",
"there",
"are",
"no",
"more",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L417-L430 | [
"def",
"consume_all",
"(",
"self",
",",
"max_loops",
"=",
"None",
")",
":",
"for",
"row",
"in",
"self",
":",
"self",
".",
"rows",
"[",
"row",
".",
"row_key",
"]",
"=",
"row"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowsData._create_retry_request | Helper for :meth:`__iter__`. | bigtable/google/cloud/bigtable/row_data.py | def _create_retry_request(self):
"""Helper for :meth:`__iter__`."""
req_manager = _ReadRowsRequestManager(
self.request, self.last_scanned_row_key, self._counter
)
return req_manager.build_updated_request() | def _create_retry_request(self):
"""Helper for :meth:`__iter__`."""
req_manager = _ReadRowsRequestManager(
self.request, self.last_scanned_row_key, self._counter
)
return req_manager.build_updated_request() | [
"Helper",
"for",
":",
"meth",
":",
"__iter__",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L432-L437 | [
"def",
"_create_retry_request",
"(",
"self",
")",
":",
"req_manager",
"=",
"_ReadRowsRequestManager",
"(",
"self",
".",
"request",
",",
"self",
".",
"last_scanned_row_key",
",",
"self",
".",
"_counter",
")",
"return",
"req_manager",
".",
"build_updated_request",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowsData._on_error | Helper for :meth:`__iter__`. | bigtable/google/cloud/bigtable/row_data.py | def _on_error(self, exc):
"""Helper for :meth:`__iter__`."""
# restart the read scan from AFTER the last successfully read row
retry_request = self.request
if self.last_scanned_row_key:
retry_request = self._create_retry_request()
self.response_iterator = self.read_m... | def _on_error(self, exc):
"""Helper for :meth:`__iter__`."""
# restart the read scan from AFTER the last successfully read row
retry_request = self.request
if self.last_scanned_row_key:
retry_request = self._create_retry_request()
self.response_iterator = self.read_m... | [
"Helper",
"for",
":",
"meth",
":",
"__iter__",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L439-L446 | [
"def",
"_on_error",
"(",
"self",
",",
"exc",
")",
":",
"# restart the read scan from AFTER the last successfully read row",
"retry_request",
"=",
"self",
".",
"request",
"if",
"self",
".",
"last_scanned_row_key",
":",
"retry_request",
"=",
"self",
".",
"_create_retry_re... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowsData._save_current_cell | Helper for :meth:`consume_next`. | bigtable/google/cloud/bigtable/row_data.py | def _save_current_cell(self):
"""Helper for :meth:`consume_next`."""
row, cell = self._row, self._cell
family = row._cells.setdefault(cell.family_name, {})
qualified = family.setdefault(cell.qualifier, [])
complete = Cell.from_pb(cell)
qualified.append(complete)
s... | def _save_current_cell(self):
"""Helper for :meth:`consume_next`."""
row, cell = self._row, self._cell
family = row._cells.setdefault(cell.family_name, {})
qualified = family.setdefault(cell.qualifier, [])
complete = Cell.from_pb(cell)
qualified.append(complete)
s... | [
"Helper",
"for",
":",
"meth",
":",
"consume_next",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L560-L567 | [
"def",
"_save_current_cell",
"(",
"self",
")",
":",
"row",
",",
"cell",
"=",
"self",
".",
"_row",
",",
"self",
".",
"_cell",
"family",
"=",
"row",
".",
"_cells",
".",
"setdefault",
"(",
"cell",
".",
"family_name",
",",
"{",
"}",
")",
"qualified",
"="... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | PartialRowsData._copy_from_previous | Helper for :meth:`consume_next`. | bigtable/google/cloud/bigtable/row_data.py | def _copy_from_previous(self, cell):
"""Helper for :meth:`consume_next`."""
previous = self._previous_cell
if previous is not None:
if not cell.row_key:
cell.row_key = previous.row_key
if not cell.family_name:
cell.family_name = pre... | def _copy_from_previous(self, cell):
"""Helper for :meth:`consume_next`."""
previous = self._previous_cell
if previous is not None:
if not cell.row_key:
cell.row_key = previous.row_key
if not cell.family_name:
cell.family_name = pre... | [
"Helper",
"for",
":",
"meth",
":",
"consume_next",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L569-L579 | [
"def",
"_copy_from_previous",
"(",
"self",
",",
"cell",
")",
":",
"previous",
"=",
"self",
".",
"_previous_cell",
"if",
"previous",
"is",
"not",
"None",
":",
"if",
"not",
"cell",
".",
"row_key",
":",
"cell",
".",
"row_key",
"=",
"previous",
".",
"row_key... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _ReadRowsRequestManager.build_updated_request | Updates the given message request as per last scanned key | bigtable/google/cloud/bigtable/row_data.py | def build_updated_request(self):
""" Updates the given message request as per last scanned key
"""
r_kwargs = {
"table_name": self.message.table_name,
"filter": self.message.filter,
}
if self.message.rows_limit != 0:
r_kwargs["rows_limit"] = m... | def build_updated_request(self):
""" Updates the given message request as per last scanned key
"""
r_kwargs = {
"table_name": self.message.table_name,
"filter": self.message.filter,
}
if self.message.rows_limit != 0:
r_kwargs["rows_limit"] = m... | [
"Updates",
"the",
"given",
"message",
"request",
"as",
"per",
"last",
"scanned",
"key"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L604-L629 | [
"def",
"build_updated_request",
"(",
"self",
")",
":",
"r_kwargs",
"=",
"{",
"\"table_name\"",
":",
"self",
".",
"message",
".",
"table_name",
",",
"\"filter\"",
":",
"self",
".",
"message",
".",
"filter",
",",
"}",
"if",
"self",
".",
"message",
".",
"ro... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _ReadRowsRequestManager._filter_rows_keys | Helper for :meth:`build_updated_request` | bigtable/google/cloud/bigtable/row_data.py | def _filter_rows_keys(self):
""" Helper for :meth:`build_updated_request`"""
return [
row_key
for row_key in self.message.rows.row_keys
if row_key > self.last_scanned_key
] | def _filter_rows_keys(self):
""" Helper for :meth:`build_updated_request`"""
return [
row_key
for row_key in self.message.rows.row_keys
if row_key > self.last_scanned_key
] | [
"Helper",
"for",
":",
"meth",
":",
"build_updated_request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L631-L637 | [
"def",
"_filter_rows_keys",
"(",
"self",
")",
":",
"return",
"[",
"row_key",
"for",
"row_key",
"in",
"self",
".",
"message",
".",
"rows",
".",
"row_keys",
"if",
"row_key",
">",
"self",
".",
"last_scanned_key",
"]"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _ReadRowsRequestManager._filter_row_ranges | Helper for :meth:`build_updated_request` | bigtable/google/cloud/bigtable/row_data.py | def _filter_row_ranges(self):
""" Helper for :meth:`build_updated_request`"""
new_row_ranges = []
for row_range in self.message.rows.row_ranges:
# if current end_key (open or closed) is set, return its value,
# if not, set to empty string ('').
# NOTE: Empty ... | def _filter_row_ranges(self):
""" Helper for :meth:`build_updated_request`"""
new_row_ranges = []
for row_range in self.message.rows.row_ranges:
# if current end_key (open or closed) is set, return its value,
# if not, set to empty string ('').
# NOTE: Empty ... | [
"Helper",
"for",
":",
"meth",
":",
"build_updated_request"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row_data.py#L639-L668 | [
"def",
"_filter_row_ranges",
"(",
"self",
")",
":",
"new_row_ranges",
"=",
"[",
"]",
"for",
"row_range",
"in",
"self",
".",
"message",
".",
"rows",
".",
"row_ranges",
":",
"# if current end_key (open or closed) is set, return its value,",
"# if not, set to empty string ('... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TraceServiceClient.patch_traces | Sends new traces to Stackdriver Trace or updates existing traces. If the ID
of a trace that you send matches that of an existing trace, any fields
in the existing trace and its spans are overwritten by the provided values,
and any new fields provided are merged with the existing trace data. If t... | trace/google/cloud/trace_v1/gapic/trace_service_client.py | def patch_traces(
self,
project_id,
traces,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Sends new traces to Stackdriver Trace or updates existing traces. If the ID
of a t... | def patch_traces(
self,
project_id,
traces,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Sends new traces to Stackdriver Trace or updates existing traces. If the ID
of a t... | [
"Sends",
"new",
"traces",
"to",
"Stackdriver",
"Trace",
"or",
"updates",
"existing",
"traces",
".",
"If",
"the",
"ID",
"of",
"a",
"trace",
"that",
"you",
"send",
"matches",
"that",
"of",
"an",
"existing",
"trace",
"any",
"fields",
"in",
"the",
"existing",
... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace_v1/gapic/trace_service_client.py#L177-L254 | [
"def",
"patch_traces",
"(",
"self",
",",
"project_id",
",",
"traces",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFA... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TraceServiceClient.get_trace | Gets a single trace by its ID.
Example:
>>> from google.cloud import trace_v1
>>>
>>> client = trace_v1.TraceServiceClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
>>>
>>> # TODO: Initialize `t... | trace/google/cloud/trace_v1/gapic/trace_service_client.py | def get_trace(
self,
project_id,
trace_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets a single trace by its ID.
Example:
>>> from google.cloud import t... | def get_trace(
self,
project_id,
trace_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets a single trace by its ID.
Example:
>>> from google.cloud import t... | [
"Gets",
"a",
"single",
"trace",
"by",
"its",
"ID",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace_v1/gapic/trace_service_client.py#L256-L316 | [
"def",
"get_trace",
"(",
"self",
",",
"project_id",
",",
"trace_id",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAU... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | TraceServiceClient.list_traces | Returns of a list of traces that match the specified filter conditions.
Example:
>>> from google.cloud import trace_v1
>>>
>>> client = trace_v1.TraceServiceClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
... | trace/google/cloud/trace_v1/gapic/trace_service_client.py | def list_traces(
self,
project_id,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None... | def list_traces(
self,
project_id,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None... | [
"Returns",
"of",
"a",
"list",
"of",
"traces",
"that",
"match",
"the",
"specified",
"filter",
"conditions",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace_v1/gapic/trace_service_client.py#L318-L486 | [
"def",
"list_traces",
"(",
"self",
",",
"project_id",
",",
"view",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
"retry",
"=",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudRedisClient.get_instance | Gets the details of a specific Redis instance.
Example:
>>> from google.cloud import redis_v1beta1
>>>
>>> client = redis_v1beta1.CloudRedisClient()
>>>
>>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]')
>>>
... | redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py | def get_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the details of a specific Redis instance.
Example:
>>> from google.cloud import redis_... | def get_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets the details of a specific Redis instance.
Example:
>>> from google.cloud import redis_... | [
"Gets",
"the",
"details",
"of",
"a",
"specific",
"Redis",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py#L310-L366 | [
"def",
"get_instance",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadata"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudRedisClient.update_instance | Updates the metadata and configuration of a specific Redis instance.
Completed longrunning.Operation will contain the new instance object
in the response field. The returned operation is automatically deleted
after a few hours, so there is no need to call DeleteOperation.
Example:
... | redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py | def update_instance(
self,
update_mask,
instance,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the metadata and configuration of a specific Redis instance.
Comple... | def update_instance(
self,
update_mask,
instance,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates the metadata and configuration of a specific Redis instance.
Comple... | [
"Updates",
"the",
"metadata",
"and",
"configuration",
"of",
"a",
"specific",
"Redis",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py#L474-L567 | [
"def",
"update_instance",
"(",
"self",
",",
"update_mask",
",",
"instance",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CloudRedisClient.delete_instance | Deletes a specific Redis instance. Instance stops serving and data is
deleted.
Example:
>>> from google.cloud import redis_v1beta1
>>>
>>> client = redis_v1beta1.CloudRedisClient()
>>>
>>> name = client.instance_path('[PROJECT]', '[LOCATION]'... | redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py | def delete_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a specific Redis instance. Instance stops serving and data is
deleted.
Example:
... | def delete_instance(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a specific Redis instance. Instance stops serving and data is
deleted.
Example:
... | [
"Deletes",
"a",
"specific",
"Redis",
"instance",
".",
"Instance",
"stops",
"serving",
"and",
"data",
"is",
"deleted",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py#L569-L641 | [
"def",
"delete_instance",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metada... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SpeechClient.recognize | Performs synchronous speech recognition: receive results after all audio
has been sent and processed.
Example:
>>> from google.cloud import speech_v1p1beta1
>>> from google.cloud.speech_v1p1beta1 import enums
>>>
>>> client = speech_v1p1beta1.SpeechClient... | speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py | def recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs synchronous speech recognition: receive results after all audio
has been sent and... | def recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs synchronous speech recognition: receive results after all audio
has been sent and... | [
"Performs",
"synchronous",
"speech",
"recognition",
":",
"receive",
"results",
"after",
"all",
"audio",
"has",
"been",
"sent",
"and",
"processed",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py#L170-L240 | [
"def",
"recognize",
"(",
"self",
",",
"config",
",",
"audio",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SpeechClient.long_running_recognize | Performs asynchronous speech recognition: receive results via the
google.longrunning.Operations interface. Returns either an
``Operation.error`` or an ``Operation.response`` which contains a
``LongRunningRecognizeResponse`` message.
Example:
>>> from google.cloud import spee... | speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py | def long_running_recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs asynchronous speech recognition: receive results via the
google.long... | def long_running_recognize(
self,
config,
audio,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Performs asynchronous speech recognition: receive results via the
google.long... | [
"Performs",
"asynchronous",
"speech",
"recognition",
":",
"receive",
"results",
"via",
"the",
"google",
".",
"longrunning",
".",
"Operations",
"interface",
".",
"Returns",
"either",
"an",
"Operation",
".",
"error",
"or",
"an",
"Operation",
".",
"response",
"whic... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py#L242-L331 | [
"def",
"long_running_recognize",
"(",
"self",
",",
"config",
",",
"audio",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | WorkflowTemplateServiceClient.region_path | Return a fully-qualified region string. | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | def region_path(cls, project, region):
"""Return a fully-qualified region string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}", project=project, region=region
) | def region_path(cls, project, region):
"""Return a fully-qualified region string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}", project=project, region=region
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"region",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L87-L91 | [
"def",
"region_path",
"(",
"cls",
",",
"project",
",",
"region",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/regions/{region}\"",
",",
"project",
"=",
"project",
",",
"region",
"=",
"region",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | WorkflowTemplateServiceClient.workflow_template_path | Return a fully-qualified workflow_template string. | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | def workflow_template_path(cls, project, region, workflow_template):
"""Return a fully-qualified workflow_template string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}/workflowTemplates/{workflow_template}",
project=project,
reg... | def workflow_template_path(cls, project, region, workflow_template):
"""Return a fully-qualified workflow_template string."""
return google.api_core.path_template.expand(
"projects/{project}/regions/{region}/workflowTemplates/{workflow_template}",
project=project,
reg... | [
"Return",
"a",
"fully",
"-",
"qualified",
"workflow_template",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L94-L101 | [
"def",
"workflow_template_path",
"(",
"cls",
",",
"project",
",",
"region",
",",
"workflow_template",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/regions/{region}/workflowTemplates/{workflow_template}\"",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | WorkflowTemplateServiceClient.create_workflow_template | Creates new workflow template.
Example:
>>> from google.cloud import dataproc_v1beta2
>>>
>>> client = dataproc_v1beta2.WorkflowTemplateServiceClient()
>>>
>>> parent = client.region_path('[PROJECT]', '[REGION]')
>>>
>>> # TODO... | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | def create_workflow_template(
self,
parent,
template,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates new workflow template.
Example:
>>> from google.clo... | def create_workflow_template(
self,
parent,
template,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates new workflow template.
Example:
>>> from google.clo... | [
"Creates",
"new",
"workflow",
"template",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L202-L268 | [
"def",
"create_workflow_template",
"(",
"self",
",",
"parent",
",",
"template",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | WorkflowTemplateServiceClient.get_workflow_template | Retrieves the latest workflow template.
Can retrieve previously instantiated template by specifying optional
version parameter.
Example:
>>> from google.cloud import dataproc_v1beta2
>>>
>>> client = dataproc_v1beta2.WorkflowTemplateServiceClient()
... | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | def get_workflow_template(
self,
name,
version=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the latest workflow template.
Can retrieve previously instanti... | def get_workflow_template(
self,
name,
version=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the latest workflow template.
Can retrieve previously instanti... | [
"Retrieves",
"the",
"latest",
"workflow",
"template",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L270-L336 | [
"def",
"get_workflow_template",
"(",
"self",
",",
"name",
",",
"version",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | WorkflowTemplateServiceClient.instantiate_workflow_template | Instantiates a template and begins execution.
The returned Operation can be used to track execution of workflow by
polling ``operations.get``. The Operation will complete when entire
workflow is finished.
The running workflow can be aborted via ``operations.cancel``. This will
... | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | def instantiate_workflow_template(
self,
name,
version=None,
instance_id=None,
request_id=None,
parameters=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
... | def instantiate_workflow_template(
self,
name,
version=None,
instance_id=None,
request_id=None,
parameters=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
... | [
"Instantiates",
"a",
"template",
"and",
"begins",
"execution",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L338-L451 | [
"def",
"instantiate_workflow_template",
"(",
"self",
",",
"name",
",",
"version",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"request_id",
"=",
"None",
",",
"parameters",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | WorkflowTemplateServiceClient.instantiate_inline_workflow_template | Instantiates a template and begins execution.
This method is equivalent to executing the sequence
``CreateWorkflowTemplate``, ``InstantiateWorkflowTemplate``,
``DeleteWorkflowTemplate``.
The returned Operation can be used to track execution of workflow by
polling ``operations.g... | dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py | def instantiate_inline_workflow_template(
self,
parent,
template,
instance_id=None,
request_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Instantiates a te... | def instantiate_inline_workflow_template(
self,
parent,
template,
instance_id=None,
request_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Instantiates a te... | [
"Instantiates",
"a",
"template",
"and",
"begins",
"execution",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dataproc/google/cloud/dataproc_v1beta2/gapic/workflow_template_service_client.py#L453-L569 | [
"def",
"instantiate_inline_workflow_template",
"(",
"self",
",",
"parent",
",",
"template",
",",
"instance_id",
"=",
"None",
",",
"request_id",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"t... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _parse_schema_resource | Parse a resource fragment into a schema field.
Args:
info: (Mapping[str->dict]): should contain a "fields" key to be parsed
Returns:
(Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None])
a list of parsed fields, or ``None`` if no "fields" key found. | bigquery/google/cloud/bigquery/schema.py | def _parse_schema_resource(info):
"""Parse a resource fragment into a schema field.
Args:
info: (Mapping[str->dict]): should contain a "fields" key to be parsed
Returns:
(Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None])
a list of parsed fields, or ``None... | def _parse_schema_resource(info):
"""Parse a resource fragment into a schema field.
Args:
info: (Mapping[str->dict]): should contain a "fields" key to be parsed
Returns:
(Union[Sequence[:class:`google.cloud.bigquery.schema.SchemaField`],None])
a list of parsed fields, or ``None... | [
"Parse",
"a",
"resource",
"fragment",
"into",
"a",
"schema",
"field",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L164-L185 | [
"def",
"_parse_schema_resource",
"(",
"info",
")",
":",
"if",
"\"fields\"",
"not",
"in",
"info",
":",
"return",
"(",
")",
"schema",
"=",
"[",
"]",
"for",
"r_field",
"in",
"info",
"[",
"\"fields\"",
"]",
":",
"name",
"=",
"r_field",
"[",
"\"name\"",
"]"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SchemaField.from_api_repr | Return a ``SchemaField`` object deserialized from a dictionary.
Args:
api_repr (Mapping[str, str]): The serialized representation
of the SchemaField, such as what is output by
:meth:`to_api_repr`.
Returns:
google.cloud.biquery.schema.SchemaField:... | bigquery/google/cloud/bigquery/schema.py | def from_api_repr(cls, api_repr):
"""Return a ``SchemaField`` object deserialized from a dictionary.
Args:
api_repr (Mapping[str, str]): The serialized representation
of the SchemaField, such as what is output by
:meth:`to_api_repr`.
Returns:
... | def from_api_repr(cls, api_repr):
"""Return a ``SchemaField`` object deserialized from a dictionary.
Args:
api_repr (Mapping[str, str]): The serialized representation
of the SchemaField, such as what is output by
:meth:`to_api_repr`.
Returns:
... | [
"Return",
"a",
"SchemaField",
"object",
"deserialized",
"from",
"a",
"dictionary",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L44-L66 | [
"def",
"from_api_repr",
"(",
"cls",
",",
"api_repr",
")",
":",
"# Handle optional properties with default values",
"mode",
"=",
"api_repr",
".",
"get",
"(",
"\"mode\"",
",",
"\"NULLABLE\"",
")",
"description",
"=",
"api_repr",
".",
"get",
"(",
"\"description\"",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SchemaField.to_api_repr | Return a dictionary representing this schema field.
Returns:
dict: A dictionary representing the SchemaField in a serialized
form. | bigquery/google/cloud/bigquery/schema.py | def to_api_repr(self):
"""Return a dictionary representing this schema field.
Returns:
dict: A dictionary representing the SchemaField in a serialized
form.
"""
# Put together the basic representation. See http://bit.ly/2hOAT5u.
answer = {
... | def to_api_repr(self):
"""Return a dictionary representing this schema field.
Returns:
dict: A dictionary representing the SchemaField in a serialized
form.
"""
# Put together the basic representation. See http://bit.ly/2hOAT5u.
answer = {
... | [
"Return",
"a",
"dictionary",
"representing",
"this",
"schema",
"field",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L109-L130 | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"# Put together the basic representation. See http://bit.ly/2hOAT5u.",
"answer",
"=",
"{",
"\"mode\"",
":",
"self",
".",
"mode",
".",
"upper",
"(",
")",
",",
"\"name\"",
":",
"self",
".",
"name",
",",
"\"type\"",
":",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | SchemaField._key | A tuple key that uniquely describes this field.
Used to compute this instance's hashcode and evaluate equality.
Returns:
tuple: The contents of this
:class:`~google.cloud.bigquery.schema.SchemaField`. | bigquery/google/cloud/bigquery/schema.py | def _key(self):
"""A tuple key that uniquely describes this field.
Used to compute this instance's hashcode and evaluate equality.
Returns:
tuple: The contents of this
:class:`~google.cloud.bigquery.schema.SchemaField`.
"""
return (
se... | def _key(self):
"""A tuple key that uniquely describes this field.
Used to compute this instance's hashcode and evaluate equality.
Returns:
tuple: The contents of this
:class:`~google.cloud.bigquery.schema.SchemaField`.
"""
return (
se... | [
"A",
"tuple",
"key",
"that",
"uniquely",
"describes",
"this",
"field",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/schema.py#L132-L147 | [
"def",
"_key",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_name",
",",
"self",
".",
"_field_type",
".",
"upper",
"(",
")",
",",
"self",
".",
"_mode",
".",
"upper",
"(",
")",
",",
"self",
".",
"_description",
",",
"self",
".",
"_fields",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | parse_options | Parses options. | spanner/benchmark/ycsb.py | def parse_options():
"""Parses options."""
parser = argparse.ArgumentParser()
parser.add_argument('command', help='The YCSB command.')
parser.add_argument('benchmark', help='The YCSB benchmark.')
parser.add_argument('-P', '--workload', action='store', dest='workload',
default... | def parse_options():
"""Parses options."""
parser = argparse.ArgumentParser()
parser.add_argument('command', help='The YCSB command.')
parser.add_argument('benchmark', help='The YCSB benchmark.')
parser.add_argument('-P', '--workload', action='store', dest='workload',
default... | [
"Parses",
"options",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L51-L81 | [
"def",
"parse_options",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'command'",
",",
"help",
"=",
"'The YCSB command.'",
")",
"parser",
".",
"add_argument",
"(",
"'benchmark'",
",",
"help",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | open_database | Opens a database specified by the parameters from parse_options(). | spanner/benchmark/ycsb.py | def open_database(parameters):
"""Opens a database specified by the parameters from parse_options()."""
spanner_client = spanner.Client()
instance_id = parameters['cloudspanner.instance']
instance = spanner_client.instance(instance_id)
database_id = parameters['cloudspanner.database']
pool = spa... | def open_database(parameters):
"""Opens a database specified by the parameters from parse_options()."""
spanner_client = spanner.Client()
instance_id = parameters['cloudspanner.instance']
instance = spanner_client.instance(instance_id)
database_id = parameters['cloudspanner.database']
pool = spa... | [
"Opens",
"a",
"database",
"specified",
"by",
"the",
"parameters",
"from",
"parse_options",
"()",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L84-L93 | [
"def",
"open_database",
"(",
"parameters",
")",
":",
"spanner_client",
"=",
"spanner",
".",
"Client",
"(",
")",
"instance_id",
"=",
"parameters",
"[",
"'cloudspanner.instance'",
"]",
"instance",
"=",
"spanner_client",
".",
"instance",
"(",
"instance_id",
")",
"d... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | load_keys | Loads keys from database. | spanner/benchmark/ycsb.py | def load_keys(database, parameters):
"""Loads keys from database."""
keys = []
with database.snapshot() as snapshot:
results = snapshot.execute_sql(
'SELECT u.id FROM %s u' % parameters['table'])
for row in results:
keys.append(row[0])
return keys | def load_keys(database, parameters):
"""Loads keys from database."""
keys = []
with database.snapshot() as snapshot:
results = snapshot.execute_sql(
'SELECT u.id FROM %s u' % parameters['table'])
for row in results:
keys.append(row[0])
return keys | [
"Loads",
"keys",
"from",
"database",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L96-L106 | [
"def",
"load_keys",
"(",
"database",
",",
"parameters",
")",
":",
"keys",
"=",
"[",
"]",
"with",
"database",
".",
"snapshot",
"(",
")",
"as",
"snapshot",
":",
"results",
"=",
"snapshot",
".",
"execute_sql",
"(",
"'SELECT u.id FROM %s u'",
"%",
"parameters",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | read | Does a single read operation. | spanner/benchmark/ycsb.py | def read(database, table, key):
"""Does a single read operation."""
with database.snapshot() as snapshot:
result = snapshot.execute_sql('SELECT u.* FROM %s u WHERE u.id="%s"' %
(table, key))
for row in result:
key = row[0]
for i in range(... | def read(database, table, key):
"""Does a single read operation."""
with database.snapshot() as snapshot:
result = snapshot.execute_sql('SELECT u.* FROM %s u WHERE u.id="%s"' %
(table, key))
for row in result:
key = row[0]
for i in range(... | [
"Does",
"a",
"single",
"read",
"operation",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L109-L117 | [
"def",
"read",
"(",
"database",
",",
"table",
",",
"key",
")",
":",
"with",
"database",
".",
"snapshot",
"(",
")",
"as",
"snapshot",
":",
"result",
"=",
"snapshot",
".",
"execute_sql",
"(",
"'SELECT u.* FROM %s u WHERE u.id=\"%s\"'",
"%",
"(",
"table",
",",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | update | Does a single update operation. | spanner/benchmark/ycsb.py | def update(database, table, key):
"""Does a single update operation."""
field = random.randrange(10)
value = ''.join(random.choice(string.printable) for i in range(100))
with database.batch() as batch:
batch.update(table=table, columns=('id', 'field%d' % field),
values=[(key... | def update(database, table, key):
"""Does a single update operation."""
field = random.randrange(10)
value = ''.join(random.choice(string.printable) for i in range(100))
with database.batch() as batch:
batch.update(table=table, columns=('id', 'field%d' % field),
values=[(key... | [
"Does",
"a",
"single",
"update",
"operation",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L120-L126 | [
"def",
"update",
"(",
"database",
",",
"table",
",",
"key",
")",
":",
"field",
"=",
"random",
".",
"randrange",
"(",
"10",
")",
"value",
"=",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"string",
".",
"printable",
")",
"for",
"i",
"in",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | do_operation | Does a single operation and records latency. | spanner/benchmark/ycsb.py | def do_operation(database, keys, table, operation, latencies_ms):
"""Does a single operation and records latency."""
key = random.choice(keys)
start = timeit.default_timer()
if operation == 'read':
read(database, table, key)
elif operation == 'update':
update(database, table, key)
... | def do_operation(database, keys, table, operation, latencies_ms):
"""Does a single operation and records latency."""
key = random.choice(keys)
start = timeit.default_timer()
if operation == 'read':
read(database, table, key)
elif operation == 'update':
update(database, table, key)
... | [
"Does",
"a",
"single",
"operation",
"and",
"records",
"latency",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L129-L140 | [
"def",
"do_operation",
"(",
"database",
",",
"keys",
",",
"table",
",",
"operation",
",",
"latencies_ms",
")",
":",
"key",
"=",
"random",
".",
"choice",
"(",
"keys",
")",
"start",
"=",
"timeit",
".",
"default_timer",
"(",
")",
"if",
"operation",
"==",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | aggregate_metrics | Aggregates metrics. | spanner/benchmark/ycsb.py | def aggregate_metrics(latencies_ms, duration_ms, num_bucket):
"""Aggregates metrics."""
overall_op_count = 0
op_counts = {operation : len(latency) for operation,
latency in latencies_ms.iteritems()}
overall_op_count = sum([op_count for op_count in op_counts.itervalues()])
print('[O... | def aggregate_metrics(latencies_ms, duration_ms, num_bucket):
"""Aggregates metrics."""
overall_op_count = 0
op_counts = {operation : len(latency) for operation,
latency in latencies_ms.iteritems()}
overall_op_count = sum([op_count for op_count in op_counts.itervalues()])
print('[O... | [
"Aggregates",
"metrics",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L143-L181 | [
"def",
"aggregate_metrics",
"(",
"latencies_ms",
",",
"duration_ms",
",",
"num_bucket",
")",
":",
"overall_op_count",
"=",
"0",
"op_counts",
"=",
"{",
"operation",
":",
"len",
"(",
"latency",
")",
"for",
"operation",
",",
"latency",
"in",
"latencies_ms",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | run_workload | Runs workload against the database. | spanner/benchmark/ycsb.py | def run_workload(database, keys, parameters):
"""Runs workload against the database."""
total_weight = 0.0
weights = []
operations = []
latencies_ms = {}
for operation in OPERATIONS:
weight = float(parameters[operation])
if weight <= 0.0:
continue
total_weight... | def run_workload(database, keys, parameters):
"""Runs workload against the database."""
total_weight = 0.0
weights = []
operations = []
latencies_ms = {}
for operation in OPERATIONS:
weight = float(parameters[operation])
if weight <= 0.0:
continue
total_weight... | [
"Runs",
"workload",
"against",
"the",
"database",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L219-L253 | [
"def",
"run_workload",
"(",
"database",
",",
"keys",
",",
"parameters",
")",
":",
"total_weight",
"=",
"0.0",
"weights",
"=",
"[",
"]",
"operations",
"=",
"[",
"]",
"latencies_ms",
"=",
"{",
"}",
"for",
"operation",
"in",
"OPERATIONS",
":",
"weight",
"="... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | WorkloadThread.run | Run a single thread of the workload. | spanner/benchmark/ycsb.py | def run(self):
"""Run a single thread of the workload."""
i = 0
operation_count = int(self._parameters['operationcount'])
while i < operation_count:
i += 1
weight = random.uniform(0, self._total_weight)
for j in range(len(self._weights)):
... | def run(self):
"""Run a single thread of the workload."""
i = 0
operation_count = int(self._parameters['operationcount'])
while i < operation_count:
i += 1
weight = random.uniform(0, self._total_weight)
for j in range(len(self._weights)):
... | [
"Run",
"a",
"single",
"thread",
"of",
"the",
"workload",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/benchmark/ycsb.py#L200-L212 | [
"def",
"run",
"(",
"self",
")",
":",
"i",
"=",
"0",
"operation_count",
"=",
"int",
"(",
"self",
".",
"_parameters",
"[",
"'operationcount'",
"]",
")",
"while",
"i",
"<",
"operation_count",
":",
"i",
"+=",
"1",
"weight",
"=",
"random",
".",
"uniform",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | add_methods | Add wrapped versions of the `api` member's methods to the class.
Any methods passed in `blacklist` are not added.
Additionally, any methods explicitly defined on the wrapped class are
not added. | pubsub/google/cloud/pubsub_v1/_gapic.py | def add_methods(source_class, blacklist=()):
"""Add wrapped versions of the `api` member's methods to the class.
Any methods passed in `blacklist` are not added.
Additionally, any methods explicitly defined on the wrapped class are
not added.
"""
def wrap(wrapped_fx):
"""Wrap a GAPIC m... | def add_methods(source_class, blacklist=()):
"""Add wrapped versions of the `api` member's methods to the class.
Any methods passed in `blacklist` are not added.
Additionally, any methods explicitly defined on the wrapped class are
not added.
"""
def wrap(wrapped_fx):
"""Wrap a GAPIC m... | [
"Add",
"wrapped",
"versions",
"of",
"the",
"api",
"member",
"s",
"methods",
"to",
"the",
"class",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/_gapic.py#L20-L77 | [
"def",
"add_methods",
"(",
"source_class",
",",
"blacklist",
"=",
"(",
")",
")",
":",
"def",
"wrap",
"(",
"wrapped_fx",
")",
":",
"\"\"\"Wrap a GAPIC method; preserve its name and docstring.\"\"\"",
"# If this is a static or class method, then we need to *not*",
"# send self as... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.create_product | Creates and returns a new product resource.
Possible errors:
- Returns INVALID\_ARGUMENT if display\_name is missing or longer than
4096 characters.
- Returns INVALID\_ARGUMENT if description is longer than 4096
characters.
- Returns INVALID\_ARGUMENT if produc... | vision/google/cloud/vision_v1/gapic/product_search_client.py | def create_product(
self,
parent,
product,
product_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new product resource.
Possible erro... | def create_product(
self,
parent,
product,
product_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates and returns a new product resource.
Possible erro... | [
"Creates",
"and",
"returns",
"a",
"new",
"product",
"resource",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1/gapic/product_search_client.py#L230-L322 | [
"def",
"create_product",
"(",
"self",
",",
"parent",
",",
"product",
",",
"product_id",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ProductSearchClient.update_product | Makes changes to a Product resource. Only the ``display_name``,
``description``, and ``labels`` fields can be updated right now.
If labels are updated, the change will not be reflected in queries until
the next index time.
Possible errors:
- Returns NOT\_FOUND if the Product ... | vision/google/cloud/vision_v1/gapic/product_search_client.py | def update_product(
self,
product,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Makes changes to a Product resource. Only the ``display_name``,
``descrip... | def update_product(
self,
product,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Makes changes to a Product resource. Only the ``display_name``,
``descrip... | [
"Makes",
"changes",
"to",
"a",
"Product",
"resource",
".",
"Only",
"the",
"display_name",
"description",
"and",
"labels",
"fields",
"can",
"be",
"updated",
"right",
"now",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_v1/gapic/product_search_client.py#L509-L604 | [
"def",
"update_product",
"(",
"self",
",",
"product",
",",
"update_mask",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _assign_entity_to_pb | Copy ``entity`` into ``entity_pb``.
Helper method for ``Batch.put``.
:type entity_pb: :class:`.entity_pb2.Entity`
:param entity_pb: The entity owned by a mutation.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The entity being updated within the batch / transaction. | datastore/google/cloud/datastore/batch.py | def _assign_entity_to_pb(entity_pb, entity):
"""Copy ``entity`` into ``entity_pb``.
Helper method for ``Batch.put``.
:type entity_pb: :class:`.entity_pb2.Entity`
:param entity_pb: The entity owned by a mutation.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The en... | def _assign_entity_to_pb(entity_pb, entity):
"""Copy ``entity`` into ``entity_pb``.
Helper method for ``Batch.put``.
:type entity_pb: :class:`.entity_pb2.Entity`
:param entity_pb: The entity owned by a mutation.
:type entity: :class:`google.cloud.datastore.entity.Entity`
:param entity: The en... | [
"Copy",
"entity",
"into",
"entity_pb",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L309-L322 | [
"def",
"_assign_entity_to_pb",
"(",
"entity_pb",
",",
"entity",
")",
":",
"bare_entity_pb",
"=",
"helpers",
".",
"entity_to_protobuf",
"(",
"entity",
")",
"bare_entity_pb",
".",
"key",
".",
"CopyFrom",
"(",
"bare_entity_pb",
".",
"key",
")",
"entity_pb",
".",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _parse_commit_response | Extract response data from a commit response.
:type commit_response_pb: :class:`.datastore_pb2.CommitResponse`
:param commit_response_pb: The protobuf response from a commit request.
:rtype: tuple
:returns: The pair of the number of index updates and a list of
:class:`.entity_pb2.Key` fo... | datastore/google/cloud/datastore/batch.py | def _parse_commit_response(commit_response_pb):
"""Extract response data from a commit response.
:type commit_response_pb: :class:`.datastore_pb2.CommitResponse`
:param commit_response_pb: The protobuf response from a commit request.
:rtype: tuple
:returns: The pair of the number of index updates ... | def _parse_commit_response(commit_response_pb):
"""Extract response data from a commit response.
:type commit_response_pb: :class:`.datastore_pb2.CommitResponse`
:param commit_response_pb: The protobuf response from a commit request.
:rtype: tuple
:returns: The pair of the number of index updates ... | [
"Extract",
"response",
"data",
"from",
"a",
"commit",
"response",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L325-L341 | [
"def",
"_parse_commit_response",
"(",
"commit_response_pb",
")",
":",
"mut_results",
"=",
"commit_response_pb",
".",
"mutation_results",
"index_updates",
"=",
"commit_response_pb",
".",
"index_updates",
"completed_keys",
"=",
"[",
"mut_result",
".",
"key",
"for",
"mut_r... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch._add_partial_key_entity_pb | Adds a new mutation for an entity with a partial key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit. | datastore/google/cloud/datastore/batch.py | def _add_partial_key_entity_pb(self):
"""Adds a new mutation for an entity with a partial key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
new_mutation = _datastore_pb2.Mutatio... | def _add_partial_key_entity_pb(self):
"""Adds a new mutation for an entity with a partial key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
new_mutation = _datastore_pb2.Mutatio... | [
"Adds",
"a",
"new",
"mutation",
"for",
"an",
"entity",
"with",
"a",
"partial",
"key",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L107-L116 | [
"def",
"_add_partial_key_entity_pb",
"(",
"self",
")",
":",
"new_mutation",
"=",
"_datastore_pb2",
".",
"Mutation",
"(",
")",
"self",
".",
"_mutations",
".",
"append",
"(",
"new_mutation",
")",
"return",
"new_mutation",
".",
"insert"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch._add_complete_key_entity_pb | Adds a new mutation for an entity with a completed key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit. | datastore/google/cloud/datastore/batch.py | def _add_complete_key_entity_pb(self):
"""Adds a new mutation for an entity with a completed key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
# We use ``upsert`` for entities w... | def _add_complete_key_entity_pb(self):
"""Adds a new mutation for an entity with a completed key.
:rtype: :class:`.entity_pb2.Entity`
:returns: The newly created entity protobuf that will be
updated and sent with a commit.
"""
# We use ``upsert`` for entities w... | [
"Adds",
"a",
"new",
"mutation",
"for",
"an",
"entity",
"with",
"a",
"completed",
"key",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L118-L130 | [
"def",
"_add_complete_key_entity_pb",
"(",
"self",
")",
":",
"# We use ``upsert`` for entities with completed keys, rather than",
"# ``insert`` or ``update``, in order not to create race conditions",
"# based on prior existence / removal of the entity.",
"new_mutation",
"=",
"_datastore_pb2",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch._add_delete_key_pb | Adds a new mutation for a key to be deleted.
:rtype: :class:`.entity_pb2.Key`
:returns: The newly created key protobuf that will be
deleted when sent with a commit. | datastore/google/cloud/datastore/batch.py | def _add_delete_key_pb(self):
"""Adds a new mutation for a key to be deleted.
:rtype: :class:`.entity_pb2.Key`
:returns: The newly created key protobuf that will be
deleted when sent with a commit.
"""
new_mutation = _datastore_pb2.Mutation()
self._muta... | def _add_delete_key_pb(self):
"""Adds a new mutation for a key to be deleted.
:rtype: :class:`.entity_pb2.Key`
:returns: The newly created key protobuf that will be
deleted when sent with a commit.
"""
new_mutation = _datastore_pb2.Mutation()
self._muta... | [
"Adds",
"a",
"new",
"mutation",
"for",
"a",
"key",
"to",
"be",
"deleted",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L132-L141 | [
"def",
"_add_delete_key_pb",
"(",
"self",
")",
":",
"new_mutation",
"=",
"_datastore_pb2",
".",
"Mutation",
"(",
")",
"self",
".",
"_mutations",
".",
"append",
"(",
"new_mutation",
")",
"return",
"new_mutation",
".",
"delete"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch.put | Remember an entity's state to be saved during :meth:`commit`.
.. note::
Any existing properties for the entity will be replaced by those
currently set on this instance. Already-stored properties which do
not correspond to keys set on this instance will be removed from
... | datastore/google/cloud/datastore/batch.py | def put(self, entity):
"""Remember an entity's state to be saved during :meth:`commit`.
.. note::
Any existing properties for the entity will be replaced by those
currently set on this instance. Already-stored properties which do
not correspond to keys set on this inst... | def put(self, entity):
"""Remember an entity's state to be saved during :meth:`commit`.
.. note::
Any existing properties for the entity will be replaced by those
currently set on this instance. Already-stored properties which do
not correspond to keys set on this inst... | [
"Remember",
"an",
"entity",
"s",
"state",
"to",
"be",
"saved",
"during",
":",
"meth",
":",
"commit",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L159-L200 | [
"def",
"put",
"(",
"self",
",",
"entity",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to put()\"",
")",
"if",
"entity",
".",
"key",
"is",
"None",
":",
"raise",
"Va... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch.delete | Remember a key to be deleted during :meth:`commit`.
:type key: :class:`google.cloud.datastore.key.Key`
:param key: the key to be deleted.
:raises: :class:`~exceptions.ValueError` if the batch is not in
progress, if key is not complete, or if the key's
``projec... | datastore/google/cloud/datastore/batch.py | def delete(self, key):
"""Remember a key to be deleted during :meth:`commit`.
:type key: :class:`google.cloud.datastore.key.Key`
:param key: the key to be deleted.
:raises: :class:`~exceptions.ValueError` if the batch is not in
progress, if key is not complete, or if t... | def delete(self, key):
"""Remember a key to be deleted during :meth:`commit`.
:type key: :class:`google.cloud.datastore.key.Key`
:param key: the key to be deleted.
:raises: :class:`~exceptions.ValueError` if the batch is not in
progress, if key is not complete, or if t... | [
"Remember",
"a",
"key",
"to",
"be",
"deleted",
"during",
":",
"meth",
":",
"commit",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L202-L222 | [
"def",
"delete",
"(",
"self",
",",
"key",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to delete()\"",
")",
"if",
"key",
".",
"is_partial",
":",
"raise",
"ValueError",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch.begin | Begins a batch.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`ValueError` if the batch ... | datastore/google/cloud/datastore/batch.py | def begin(self):
"""Begins a batch.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :clas... | def begin(self):
"""Begins a batch.
This method is called automatically when entering a with
statement, however it can be called explicitly if you don't want
to use a context manager.
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :clas... | [
"Begins",
"a",
"batch",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L224-L237 | [
"def",
"begin",
"(",
"self",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_INITIAL",
":",
"raise",
"ValueError",
"(",
"\"Batch already started previously.\"",
")",
"self",
".",
"_status",
"=",
"self",
".",
"_IN_PROGRESS"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch._commit | Commits the batch.
This is called by :meth:`commit`. | datastore/google/cloud/datastore/batch.py | def _commit(self):
"""Commits the batch.
This is called by :meth:`commit`.
"""
if self._id is None:
mode = _datastore_pb2.CommitRequest.NON_TRANSACTIONAL
else:
mode = _datastore_pb2.CommitRequest.TRANSACTIONAL
commit_response_pb = self._client._d... | def _commit(self):
"""Commits the batch.
This is called by :meth:`commit`.
"""
if self._id is None:
mode = _datastore_pb2.CommitRequest.NON_TRANSACTIONAL
else:
mode = _datastore_pb2.CommitRequest.TRANSACTIONAL
commit_response_pb = self._client._d... | [
"Commits",
"the",
"batch",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L239-L258 | [
"def",
"_commit",
"(",
"self",
")",
":",
"if",
"self",
".",
"_id",
"is",
"None",
":",
"mode",
"=",
"_datastore_pb2",
".",
"CommitRequest",
".",
"NON_TRANSACTIONAL",
"else",
":",
"mode",
"=",
"_datastore_pb2",
".",
"CommitRequest",
".",
"TRANSACTIONAL",
"comm... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch.commit | Commits the batch.
This is called automatically upon exiting a with statement,
however it can be called explicitly if you don't want to use a
context manager.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress. | datastore/google/cloud/datastore/batch.py | def commit(self):
"""Commits the batch.
This is called automatically upon exiting a with statement,
however it can be called explicitly if you don't want to use a
context manager.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
... | def commit(self):
"""Commits the batch.
This is called automatically upon exiting a with statement,
however it can be called explicitly if you don't want to use a
context manager.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
... | [
"Commits",
"the",
"batch",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L260-L276 | [
"def",
"commit",
"(",
"self",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to commit()\"",
")",
"try",
":",
"self",
".",
"_commit",
"(",
")",
"finally",
":",
"self",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch.rollback | Rolls back the current batch.
Marks the batch as aborted (can't be used again).
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress. | datastore/google/cloud/datastore/batch.py | def rollback(self):
"""Rolls back the current batch.
Marks the batch as aborted (can't be used again).
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
"""
... | def rollback(self):
"""Rolls back the current batch.
Marks the batch as aborted (can't be used again).
Overridden by :class:`google.cloud.datastore.transaction.Transaction`.
:raises: :class:`~exceptions.ValueError` if the batch is not
in progress.
"""
... | [
"Rolls",
"back",
"the",
"current",
"batch",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/batch.py#L278-L291 | [
"def",
"rollback",
"(",
"self",
")",
":",
"if",
"self",
".",
"_status",
"!=",
"self",
".",
"_IN_PROGRESS",
":",
"raise",
"ValueError",
"(",
"\"Batch must be in progress to rollback()\"",
")",
"self",
".",
"_status",
"=",
"self",
".",
"_ABORTED"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableTableAdminClient.snapshot_path | Return a fully-qualified snapshot string. | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | def snapshot_path(cls, project, instance, cluster, snapshot):
"""Return a fully-qualified snapshot string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}",
project=project,
instance=inst... | def snapshot_path(cls, project, instance, cluster, snapshot):
"""Return a fully-qualified snapshot string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}",
project=project,
instance=inst... | [
"Return",
"a",
"fully",
"-",
"qualified",
"snapshot",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L112-L120 | [
"def",
"snapshot_path",
"(",
"cls",
",",
"project",
",",
"instance",
",",
"cluster",
",",
"snapshot",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapsh... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableTableAdminClient.create_table | Creates a new table in the specified instance.
The table can be created with a full set of initial column families,
specified in the request.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2.BigtableTableAdminClient()... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | def create_table(
self,
parent,
table_id,
table,
initial_splits=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table in the specified instance.
... | def create_table(
self,
parent,
table_id,
table,
initial_splits=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table in the specified instance.
... | [
"Creates",
"a",
"new",
"table",
"in",
"the",
"specified",
"instance",
".",
"The",
"table",
"can",
"be",
"created",
"with",
"a",
"full",
"set",
"of",
"initial",
"column",
"families",
"specified",
"in",
"the",
"request",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L231-L339 | [
"def",
"create_table",
"(",
"self",
",",
"parent",
",",
"table_id",
",",
"table",
",",
"initial_splits",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_c... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableTableAdminClient.create_table_from_snapshot | Creates a new table from the specified snapshot. The target table must
not exist. The snapshot and the table must be in the same instance.
Note: This is a private alpha release of Cloud Bigtable snapshots. This
feature is not currently available to most Cloud Bigtable customers. This
fe... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | def create_table_from_snapshot(
self,
parent,
table_id,
source_snapshot,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table from the specified snapshot. The ... | def create_table_from_snapshot(
self,
parent,
table_id,
source_snapshot,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new table from the specified snapshot. The ... | [
"Creates",
"a",
"new",
"table",
"from",
"the",
"specified",
"snapshot",
".",
"The",
"target",
"table",
"must",
"not",
"exist",
".",
"The",
"snapshot",
"and",
"the",
"table",
"must",
"be",
"in",
"the",
"same",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L341-L447 | [
"def",
"create_table_from_snapshot",
"(",
"self",
",",
"parent",
",",
"table_id",
",",
"source_snapshot",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapi... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableTableAdminClient.drop_row_range | Permanently drop/delete a row range from a specified table. The request can
specify whether to delete all rows in a table, or only those that match a
particular prefix.
Example:
>>> from google.cloud import bigtable_admin_v2
>>>
>>> client = bigtable_admin_v2... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | def drop_row_range(
self,
name,
row_key_prefix=None,
delete_all_data_from_table=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Permanently drop/delete a row range from... | def drop_row_range(
self,
name,
row_key_prefix=None,
delete_all_data_from_table=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Permanently drop/delete a row range from... | [
"Permanently",
"drop",
"/",
"delete",
"a",
"row",
"range",
"from",
"a",
"specified",
"table",
".",
"The",
"request",
"can",
"specify",
"whether",
"to",
"delete",
"all",
"rows",
"in",
"a",
"table",
"or",
"only",
"those",
"that",
"match",
"a",
"particular",
... | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L780-L864 | [
"def",
"drop_row_range",
"(",
"self",
",",
"name",
",",
"row_key_prefix",
"=",
"None",
",",
"delete_all_data_from_table",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | BigtableTableAdminClient.snapshot_table | Creates a new snapshot in the specified cluster from the specified
source table. The cluster and the table must be in the same instance.
Note: This is a private alpha release of Cloud Bigtable snapshots. This
feature is not currently available to most Cloud Bigtable customers. This
feat... | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | def snapshot_table(
self,
name,
cluster,
snapshot_id,
description,
ttl=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new snapshot in the spe... | def snapshot_table(
self,
name,
cluster,
snapshot_id,
description,
ttl=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new snapshot in the spe... | [
"Creates",
"a",
"new",
"snapshot",
"in",
"the",
"specified",
"cluster",
"from",
"the",
"specified",
"source",
"table",
".",
"The",
"cluster",
"and",
"the",
"table",
"must",
"be",
"in",
"the",
"same",
"instance",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py#L1022-L1146 | [
"def",
"snapshot_table",
"(",
"self",
",",
"name",
",",
"cluster",
",",
"snapshot_id",
",",
"description",
",",
"ttl",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CompanyServiceClient.company_path | Return a fully-qualified company string. | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | def company_path(cls, project, company):
"""Return a fully-qualified company string."""
return google.api_core.path_template.expand(
"projects/{project}/companies/{company}", project=project, company=company
) | def company_path(cls, project, company):
"""Return a fully-qualified company string."""
return google.api_core.path_template.expand(
"projects/{project}/companies/{company}", project=project, company=company
) | [
"Return",
"a",
"fully",
"-",
"qualified",
"company",
"string",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L81-L85 | [
"def",
"company_path",
"(",
"cls",
",",
"project",
",",
"company",
")",
":",
"return",
"google",
".",
"api_core",
".",
"path_template",
".",
"expand",
"(",
"\"projects/{project}/companies/{company}\"",
",",
"project",
"=",
"project",
",",
"company",
"=",
"compan... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CompanyServiceClient.create_company | Creates a new company entity.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>>
>>> # TODO: Initialize `company`:
... | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | def create_company(
self,
parent,
company,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new company entity.
Example:
>>> from google.cloud import ta... | def create_company(
self,
parent,
company,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new company entity.
Example:
>>> from google.cloud import ta... | [
"Creates",
"a",
"new",
"company",
"entity",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L186-L257 | [
"def",
"create_company",
"(",
"self",
",",
"parent",
",",
"company",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAU... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CompanyServiceClient.update_company | Updates specified company.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> # TODO: Initialize `company`:
>>> company = {}
>>>
>>> response = client... | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | def update_company(
self,
company,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates specified company.
Example:
>>> from google.cloud im... | def update_company(
self,
company,
update_mask=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Updates specified company.
Example:
>>> from google.cloud im... | [
"Updates",
"specified",
"company",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L320-L393 | [
"def",
"update_company",
"(",
"self",
",",
"company",
",",
"update_mask",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"me... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | CompanyServiceClient.delete_company | Deletes specified company.
Prerequisite: The company has no jobs associated with it.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.CompanyServiceClient()
>>>
>>> name = client.company_path('[PROJECT]', '[... | talent/google/cloud/talent_v4beta1/gapic/company_service_client.py | def delete_company(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes specified company.
Prerequisite: The company has no jobs associated with it.
Example:... | def delete_company(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes specified company.
Prerequisite: The company has no jobs associated with it.
Example:... | [
"Deletes",
"specified",
"company",
".",
"Prerequisite",
":",
"The",
"company",
"has",
"no",
"jobs",
"associated",
"with",
"it",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py#L395-L452 | [
"def",
"delete_company",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadat... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Client.quotas | Return DNS quotas for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/projects/get
:rtype: mapping
:returns: keys for the mapping correspond to those of the ``quota``
sub-mapping of the project resource. | dns/google/cloud/dns/client.py | def quotas(self):
"""Return DNS quotas for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/projects/get
:rtype: mapping
:returns: keys for the mapping correspond to those of the ``quota``
sub-mapping of the project resource.
... | def quotas(self):
"""Return DNS quotas for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/projects/get
:rtype: mapping
:returns: keys for the mapping correspond to those of the ``quota``
sub-mapping of the project resource.
... | [
"Return",
"DNS",
"quotas",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L57-L72 | [
"def",
"quotas",
"(",
"self",
")",
":",
"path",
"=",
"\"/projects/%s\"",
"%",
"(",
"self",
".",
"project",
",",
")",
"resp",
"=",
"self",
".",
"_connection",
".",
"api_request",
"(",
"method",
"=",
"\"GET\"",
",",
"path",
"=",
"path",
")",
"return",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Client.list_zones | List zones for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/managedZones/list
:type max_results: int
:param max_results: maximum number of zones to return, If not
passed, defaults to a value set by the API.
:type ... | dns/google/cloud/dns/client.py | def list_zones(self, max_results=None, page_token=None):
"""List zones for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/managedZones/list
:type max_results: int
:param max_results: maximum number of zones to return, If not
... | def list_zones(self, max_results=None, page_token=None):
"""List zones for the project associated with this client.
See
https://cloud.google.com/dns/api/v1/managedZones/list
:type max_results: int
:param max_results: maximum number of zones to return, If not
... | [
"List",
"zones",
"for",
"the",
"project",
"associated",
"with",
"this",
"client",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L74-L104 | [
"def",
"list_zones",
"(",
"self",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
")",
":",
"path",
"=",
"\"/projects/%s/managedZones\"",
"%",
"(",
"self",
".",
"project",
",",
")",
"return",
"page_iterator",
".",
"HTTPIterator",
"(",
"clien... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Client.zone | Construct a zone bound to this client.
:type name: str
:param name: Name of the zone.
:type dns_name: str
:param dns_name:
(Optional) DNS name of the zone. If not passed, then calls to
:meth:`zone.create` will fail.
:type description: str
:para... | dns/google/cloud/dns/client.py | def zone(self, name, dns_name=None, description=None):
"""Construct a zone bound to this client.
:type name: str
:param name: Name of the zone.
:type dns_name: str
:param dns_name:
(Optional) DNS name of the zone. If not passed, then calls to
:meth:`zon... | def zone(self, name, dns_name=None, description=None):
"""Construct a zone bound to this client.
:type name: str
:param name: Name of the zone.
:type dns_name: str
:param dns_name:
(Optional) DNS name of the zone. If not passed, then calls to
:meth:`zon... | [
"Construct",
"a",
"zone",
"bound",
"to",
"this",
"client",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/client.py#L106-L125 | [
"def",
"zone",
"(",
"self",
",",
"name",
",",
"dns_name",
"=",
"None",
",",
"description",
"=",
"None",
")",
":",
"return",
"ManagedZone",
"(",
"name",
",",
"dns_name",
",",
"client",
"=",
"self",
",",
"description",
"=",
"description",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Client.patch_traces | Sends new traces to Stackdriver Trace or updates existing traces.
Args:
traces (dict): Required. The traces to be patched in the API call.
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored. | trace/google/cloud/trace/v1/client.py | def patch_traces(self, traces, project_id=None):
"""Sends new traces to Stackdriver Trace or updates existing traces.
Args:
traces (dict): Required. The traces to be patched in the API call.
project_id (Optional[str]): ID of the Cloud project where the trace
dat... | def patch_traces(self, traces, project_id=None):
"""Sends new traces to Stackdriver Trace or updates existing traces.
Args:
traces (dict): Required. The traces to be patched in the API call.
project_id (Optional[str]): ID of the Cloud project where the trace
dat... | [
"Sends",
"new",
"traces",
"to",
"Stackdriver",
"Trace",
"or",
"updates",
"existing",
"traces",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/client.py#L60-L72 | [
"def",
"patch_traces",
"(",
"self",
",",
"traces",
",",
"project_id",
"=",
"None",
")",
":",
"if",
"project_id",
"is",
"None",
":",
"project_id",
"=",
"self",
".",
"project",
"self",
".",
"trace_api",
".",
"patch_traces",
"(",
"project_id",
"=",
"project_i... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Client.get_trace | Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace dict. | trace/google/cloud/trace/v1/client.py | def get_trace(self, trace_id, project_id=None):
"""
Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace ... | def get_trace(self, trace_id, project_id=None):
"""
Gets a single trace by its ID.
Args:
trace_id (str): ID of the trace to return.
project_id (str): Required. ID of the Cloud project where the trace
data is stored.
Returns:
A Trace ... | [
"Gets",
"a",
"single",
"trace",
"by",
"its",
"ID",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/client.py#L74-L90 | [
"def",
"get_trace",
"(",
"self",
",",
"trace_id",
",",
"project_id",
"=",
"None",
")",
":",
"if",
"project_id",
"is",
"None",
":",
"project_id",
"=",
"self",
".",
"project",
"return",
"self",
".",
"trace_api",
".",
"get_trace",
"(",
"project_id",
"=",
"p... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Client.list_traces | Returns of a list of traces that match the filter conditions.
Args:
project_id (Optional[str]): ID of the Cloud project where the trace
data is stored.
view (Optional[~google.cloud.trace_v1.gapic.enums.
ListTracesRequest.ViewType]): Type of data returned... | trace/google/cloud/trace/v1/client.py | def list_traces(
self,
project_id=None,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
page_token=None,
):
"""
Returns of a list of traces that match the filter conditions.
Args:... | def list_traces(
self,
project_id=None,
view=None,
page_size=None,
start_time=None,
end_time=None,
filter_=None,
order_by=None,
page_token=None,
):
"""
Returns of a list of traces that match the filter conditions.
Args:... | [
"Returns",
"of",
"a",
"list",
"of",
"traces",
"that",
"match",
"the",
"filter",
"conditions",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/trace/google/cloud/trace/v1/client.py#L92-L157 | [
"def",
"list_traces",
"(",
"self",
",",
"project_id",
"=",
"None",
",",
"view",
"=",
"None",
",",
"page_size",
"=",
"None",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"filter_",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | ResumeServiceClient.parse_resume | Parses a resume into a ``Profile``. The API attempts to fill out the
following profile fields if present within the resume:
- personNames
- addresses
- emailAddress
- phoneNumbers
- personalUris
- employmentRecords
- educationRecords
- ski... | talent/google/cloud/talent_v4beta1/gapic/resume_service_client.py | def parse_resume(
self,
parent,
resume,
region_code=None,
language_code=None,
options_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Parses a resume i... | def parse_resume(
self,
parent,
resume,
region_code=None,
language_code=None,
options_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Parses a resume i... | [
"Parses",
"a",
"resume",
"into",
"a",
"Profile",
".",
"The",
"API",
"attempts",
"to",
"fill",
"out",
"the",
"following",
"profile",
"fields",
"if",
"present",
"within",
"the",
"resume",
":"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/resume_service_client.py#L193-L321 | [
"def",
"parse_resume",
"(",
"self",
",",
"parent",
",",
"resume",
",",
"region_code",
"=",
"None",
",",
"language_code",
"=",
"None",
",",
"options_",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAUL... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | update_model | Sample ID: go/samples-tracker/1533 | bigquery/samples/update_model.py | def update_model(client, model_id):
"""Sample ID: go/samples-tracker/1533"""
# [START bigquery_update_model_description]
from google.cloud import bigquery
# TODO(developer): Construct a BigQuery client object.
# client = bigquery.Client()
# TODO(developer): Set model_id to the ID of the model... | def update_model(client, model_id):
"""Sample ID: go/samples-tracker/1533"""
# [START bigquery_update_model_description]
from google.cloud import bigquery
# TODO(developer): Construct a BigQuery client object.
# client = bigquery.Client()
# TODO(developer): Set model_id to the ID of the model... | [
"Sample",
"ID",
":",
"go",
"/",
"samples",
"-",
"tracker",
"/",
"1533"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/samples/update_model.py#L16-L37 | [
"def",
"update_model",
"(",
"client",
",",
"model_id",
")",
":",
"# [START bigquery_update_model_description]",
"from",
"google",
".",
"cloud",
"import",
"bigquery",
"# TODO(developer): Construct a BigQuery client object.",
"# client = bigquery.Client()",
"# TODO(developer): Set mo... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _pb_from_query | Convert a Query instance to the corresponding protobuf.
:type query: :class:`Query`
:param query: The source query.
:rtype: :class:`.query_pb2.Query`
:returns: A protobuf that can be sent to the protobuf API. N.b. that
it does not contain "in-flight" fields for ongoing query
... | datastore/google/cloud/datastore/query.py | def _pb_from_query(query):
"""Convert a Query instance to the corresponding protobuf.
:type query: :class:`Query`
:param query: The source query.
:rtype: :class:`.query_pb2.Query`
:returns: A protobuf that can be sent to the protobuf API. N.b. that
it does not contain "in-flight" fi... | def _pb_from_query(query):
"""Convert a Query instance to the corresponding protobuf.
:type query: :class:`Query`
:param query: The source query.
:rtype: :class:`.query_pb2.Query`
:returns: A protobuf that can be sent to the protobuf API. N.b. that
it does not contain "in-flight" fi... | [
"Convert",
"a",
"Query",
"instance",
"to",
"the",
"corresponding",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L543-L605 | [
"def",
"_pb_from_query",
"(",
"query",
")",
":",
"pb",
"=",
"query_pb2",
".",
"Query",
"(",
")",
"for",
"projection_name",
"in",
"query",
".",
"projection",
":",
"pb",
".",
"projection",
".",
"add",
"(",
")",
".",
"property",
".",
"name",
"=",
"project... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.namespace | Update the query's namespace.
:type value: str | datastore/google/cloud/datastore/query.py | def namespace(self, value):
"""Update the query's namespace.
:type value: str
"""
if not isinstance(value, str):
raise ValueError("Namespace must be a string")
self._namespace = value | def namespace(self, value):
"""Update the query's namespace.
:type value: str
"""
if not isinstance(value, str):
raise ValueError("Namespace must be a string")
self._namespace = value | [
"Update",
"the",
"query",
"s",
"namespace",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L137-L144 | [
"def",
"namespace",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"\"Namespace must be a string\"",
")",
"self",
".",
"_namespace",
"=",
"value"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.kind | Update the Kind of the Query.
:type value: str
:param value: updated kind for the query.
.. note::
The protobuf specification allows for ``kind`` to be repeated,
but the current implementation returns an error if more than
one value is passed. If the back-end... | datastore/google/cloud/datastore/query.py | def kind(self, value):
"""Update the Kind of the Query.
:type value: str
:param value: updated kind for the query.
.. note::
The protobuf specification allows for ``kind`` to be repeated,
but the current implementation returns an error if more than
one... | def kind(self, value):
"""Update the Kind of the Query.
:type value: str
:param value: updated kind for the query.
.. note::
The protobuf specification allows for ``kind`` to be repeated,
but the current implementation returns an error if more than
one... | [
"Update",
"the",
"Kind",
"of",
"the",
"Query",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L156-L172 | [
"def",
"kind",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"raise",
"TypeError",
"(",
"\"Kind must be a string\"",
")",
"self",
".",
"_kind",
"=",
"value"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.ancestor | Set the ancestor for the query
:type value: :class:`~google.cloud.datastore.key.Key`
:param value: the new ancestor key | datastore/google/cloud/datastore/query.py | def ancestor(self, value):
"""Set the ancestor for the query
:type value: :class:`~google.cloud.datastore.key.Key`
:param value: the new ancestor key
"""
if not isinstance(value, Key):
raise TypeError("Ancestor must be a Key")
self._ancestor = value | def ancestor(self, value):
"""Set the ancestor for the query
:type value: :class:`~google.cloud.datastore.key.Key`
:param value: the new ancestor key
"""
if not isinstance(value, Key):
raise TypeError("Ancestor must be a Key")
self._ancestor = value | [
"Set",
"the",
"ancestor",
"for",
"the",
"query"
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L184-L192 | [
"def",
"ancestor",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"Key",
")",
":",
"raise",
"TypeError",
"(",
"\"Ancestor must be a Key\"",
")",
"self",
".",
"_ancestor",
"=",
"value"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.add_filter | Filter the query based on a property name, operator and a value.
Expressions take the form of::
.add_filter('<property>', '<operator>', <value>)
where property is a property stored on the entity in the datastore
and operator is one of ``OPERATORS``
(ie, ``=``, ``<``, ``<=``,... | datastore/google/cloud/datastore/query.py | def add_filter(self, property_name, operator, value):
"""Filter the query based on a property name, operator and a value.
Expressions take the form of::
.add_filter('<property>', '<operator>', <value>)
where property is a property stored on the entity in the datastore
and op... | def add_filter(self, property_name, operator, value):
"""Filter the query based on a property name, operator and a value.
Expressions take the form of::
.add_filter('<property>', '<operator>', <value>)
where property is a property stored on the entity in the datastore
and op... | [
"Filter",
"the",
"query",
"based",
"on",
"a",
"property",
"name",
"operator",
"and",
"a",
"value",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L209-L250 | [
"def",
"add_filter",
"(",
"self",
",",
"property_name",
",",
"operator",
",",
"value",
")",
":",
"if",
"self",
".",
"OPERATORS",
".",
"get",
"(",
"operator",
")",
"is",
"None",
":",
"error_message",
"=",
"'Invalid expression: \"%s\"'",
"%",
"(",
"operator",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.projection | Set the fields returned the query.
:type projection: str or sequence of strings
:param projection: Each value is a string giving the name of a
property to be included in the projection query. | datastore/google/cloud/datastore/query.py | def projection(self, projection):
"""Set the fields returned the query.
:type projection: str or sequence of strings
:param projection: Each value is a string giving the name of a
property to be included in the projection query.
"""
if isinstance(proje... | def projection(self, projection):
"""Set the fields returned the query.
:type projection: str or sequence of strings
:param projection: Each value is a string giving the name of a
property to be included in the projection query.
"""
if isinstance(proje... | [
"Set",
"the",
"fields",
"returned",
"the",
"query",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L262-L271 | [
"def",
"projection",
"(",
"self",
",",
"projection",
")",
":",
"if",
"isinstance",
"(",
"projection",
",",
"str",
")",
":",
"projection",
"=",
"[",
"projection",
"]",
"self",
".",
"_projection",
"[",
":",
"]",
"=",
"projection"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.order | Set the fields used to sort query results.
Sort fields will be applied in the order specified.
:type value: str or sequence of strings
:param value: Each value is a string giving the name of the
property on which to sort, optionally preceded by a
hyp... | datastore/google/cloud/datastore/query.py | def order(self, value):
"""Set the fields used to sort query results.
Sort fields will be applied in the order specified.
:type value: str or sequence of strings
:param value: Each value is a string giving the name of the
property on which to sort, optionally prec... | def order(self, value):
"""Set the fields used to sort query results.
Sort fields will be applied in the order specified.
:type value: str or sequence of strings
:param value: Each value is a string giving the name of the
property on which to sort, optionally prec... | [
"Set",
"the",
"fields",
"used",
"to",
"sort",
"query",
"results",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L299-L312 | [
"def",
"order",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"value",
"=",
"[",
"value",
"]",
"self",
".",
"_order",
"[",
":",
"]",
"=",
"value"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.distinct_on | Set fields used to group query results.
:type value: str or sequence of strings
:param value: Each value is a string giving the name of a
property to use to group results together. | datastore/google/cloud/datastore/query.py | def distinct_on(self, value):
"""Set fields used to group query results.
:type value: str or sequence of strings
:param value: Each value is a string giving the name of a
property to use to group results together.
"""
if isinstance(value, str):
... | def distinct_on(self, value):
"""Set fields used to group query results.
:type value: str or sequence of strings
:param value: Each value is a string giving the name of a
property to use to group results together.
"""
if isinstance(value, str):
... | [
"Set",
"fields",
"used",
"to",
"group",
"query",
"results",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L324-L333 | [
"def",
"distinct_on",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"value",
"=",
"[",
"value",
"]",
"self",
".",
"_distinct_on",
"[",
":",
"]",
"=",
"value"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Query.fetch | Execute the Query; return an iterator for the matching entities.
For example::
>>> from google.cloud import datastore
>>> client = datastore.Client()
>>> query = client.query(kind='Person')
>>> query.add_filter('name', '=', 'Sally')
>>> list(query.fetch())
... | datastore/google/cloud/datastore/query.py | def fetch(
self,
limit=None,
offset=0,
start_cursor=None,
end_cursor=None,
client=None,
eventual=False,
):
"""Execute the Query; return an iterator for the matching entities.
For example::
>>> from google.cloud import datastore
... | def fetch(
self,
limit=None,
offset=0,
start_cursor=None,
end_cursor=None,
client=None,
eventual=False,
):
"""Execute the Query; return an iterator for the matching entities.
For example::
>>> from google.cloud import datastore
... | [
"Execute",
"the",
"Query",
";",
"return",
"an",
"iterator",
"for",
"the",
"matching",
"entities",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L335-L393 | [
"def",
"fetch",
"(",
"self",
",",
"limit",
"=",
"None",
",",
"offset",
"=",
"0",
",",
"start_cursor",
"=",
"None",
",",
"end_cursor",
"=",
"None",
",",
"client",
"=",
"None",
",",
"eventual",
"=",
"False",
",",
")",
":",
"if",
"client",
"is",
"None... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Iterator._build_protobuf | Build a query protobuf.
Relies on the current state of the iterator.
:rtype:
:class:`.query_pb2.Query`
:returns: The query protobuf object for the current
state of the iterator. | datastore/google/cloud/datastore/query.py | def _build_protobuf(self):
"""Build a query protobuf.
Relies on the current state of the iterator.
:rtype:
:class:`.query_pb2.Query`
:returns: The query protobuf object for the current
state of the iterator.
"""
pb = _pb_from_query(self._qu... | def _build_protobuf(self):
"""Build a query protobuf.
Relies on the current state of the iterator.
:rtype:
:class:`.query_pb2.Query`
:returns: The query protobuf object for the current
state of the iterator.
"""
pb = _pb_from_query(self._qu... | [
"Build",
"a",
"query",
"protobuf",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L454-L484 | [
"def",
"_build_protobuf",
"(",
"self",
")",
":",
"pb",
"=",
"_pb_from_query",
"(",
"self",
".",
"_query",
")",
"start_cursor",
"=",
"self",
".",
"next_page_token",
"if",
"start_cursor",
"is",
"not",
"None",
":",
"pb",
".",
"start_cursor",
"=",
"base64",
".... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Iterator._process_query_results | Process the response from a datastore query.
:type response_pb: :class:`.datastore_pb2.RunQueryResponse`
:param response_pb: The protobuf response from a ``runQuery`` request.
:rtype: iterable
:returns: The next page of entity results.
:raises ValueError: If ``more_results`` is... | datastore/google/cloud/datastore/query.py | def _process_query_results(self, response_pb):
"""Process the response from a datastore query.
:type response_pb: :class:`.datastore_pb2.RunQueryResponse`
:param response_pb: The protobuf response from a ``runQuery`` request.
:rtype: iterable
:returns: The next page of entity r... | def _process_query_results(self, response_pb):
"""Process the response from a datastore query.
:type response_pb: :class:`.datastore_pb2.RunQueryResponse`
:param response_pb: The protobuf response from a ``runQuery`` request.
:rtype: iterable
:returns: The next page of entity r... | [
"Process",
"the",
"response",
"from",
"a",
"datastore",
"query",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L486-L513 | [
"def",
"_process_query_results",
"(",
"self",
",",
"response_pb",
")",
":",
"self",
".",
"_skipped_results",
"=",
"response_pb",
".",
"batch",
".",
"skipped_results",
"if",
"response_pb",
".",
"batch",
".",
"more_results",
"==",
"_NO_MORE_RESULTS",
":",
"self",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Iterator._next_page | Get the next page in the iterator.
:rtype: :class:`~google.cloud.iterator.Page`
:returns: The next page in the iterator (or :data:`None` if
there are no pages left). | datastore/google/cloud/datastore/query.py | def _next_page(self):
"""Get the next page in the iterator.
:rtype: :class:`~google.cloud.iterator.Page`
:returns: The next page in the iterator (or :data:`None` if
there are no pages left).
"""
if not self._more_results:
return None
query_... | def _next_page(self):
"""Get the next page in the iterator.
:rtype: :class:`~google.cloud.iterator.Page`
:returns: The next page in the iterator (or :data:`None` if
there are no pages left).
"""
if not self._more_results:
return None
query_... | [
"Get",
"the",
"next",
"page",
"in",
"the",
"iterator",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore/query.py#L515-L540 | [
"def",
"_next_page",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_more_results",
":",
"return",
"None",
"query_pb",
"=",
"self",
".",
"_build_protobuf",
"(",
")",
"transaction",
"=",
"self",
".",
"client",
".",
"current_transaction",
"if",
"transaction... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _make_write_pb | Helper for :meth:`Batch.insert` et aliae.
:type table: str
:param table: Name of the table to be modified.
:type columns: list of str
:param columns: Name of the table columns to be modified.
:type values: list of lists
:param values: Values to be modified.
:rtype: :class:`google.cloud.s... | spanner/google/cloud/spanner_v1/batch.py | def _make_write_pb(table, columns, values):
"""Helper for :meth:`Batch.insert` et aliae.
:type table: str
:param table: Name of the table to be modified.
:type columns: list of str
:param columns: Name of the table columns to be modified.
:type values: list of lists
:param values: Values ... | def _make_write_pb(table, columns, values):
"""Helper for :meth:`Batch.insert` et aliae.
:type table: str
:param table: Name of the table to be modified.
:type columns: list of str
:param columns: Name of the table columns to be modified.
:type values: list of lists
:param values: Values ... | [
"Helper",
"for",
":",
"meth",
":",
"Batch",
".",
"insert",
"et",
"aliae",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L171-L188 | [
"def",
"_make_write_pb",
"(",
"table",
",",
"columns",
",",
"values",
")",
":",
"return",
"Mutation",
".",
"Write",
"(",
"table",
"=",
"table",
",",
"columns",
"=",
"columns",
",",
"values",
"=",
"_make_list_value_pbs",
"(",
"values",
")",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _BatchBase.update | Update one or more existing table rows.
:type table: str
:param table: Name of the table to be modified.
:type columns: list of str
:param columns: Name of the table columns to be modified.
:type values: list of lists
:param values: Values to be modified. | spanner/google/cloud/spanner_v1/batch.py | def update(self, table, columns, values):
"""Update one or more existing table rows.
:type table: str
:param table: Name of the table to be modified.
:type columns: list of str
:param columns: Name of the table columns to be modified.
:type values: list of lists
... | def update(self, table, columns, values):
"""Update one or more existing table rows.
:type table: str
:param table: Name of the table to be modified.
:type columns: list of str
:param columns: Name of the table columns to be modified.
:type values: list of lists
... | [
"Update",
"one",
"or",
"more",
"existing",
"table",
"rows",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L64-L76 | [
"def",
"update",
"(",
"self",
",",
"table",
",",
"columns",
",",
"values",
")",
":",
"self",
".",
"_mutations",
".",
"append",
"(",
"Mutation",
"(",
"update",
"=",
"_make_write_pb",
"(",
"table",
",",
"columns",
",",
"values",
")",
")",
")"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | _BatchBase.delete | Delete one or more table rows.
:type table: str
:param table: Name of the table to be modified.
:type keyset: :class:`~google.cloud.spanner_v1.keyset.Keyset`
:param keyset: Keys/ranges identifying rows to delete. | spanner/google/cloud/spanner_v1/batch.py | def delete(self, table, keyset):
"""Delete one or more table rows.
:type table: str
:param table: Name of the table to be modified.
:type keyset: :class:`~google.cloud.spanner_v1.keyset.Keyset`
:param keyset: Keys/ranges identifying rows to delete.
"""
delete = ... | def delete(self, table, keyset):
"""Delete one or more table rows.
:type table: str
:param table: Name of the table to be modified.
:type keyset: :class:`~google.cloud.spanner_v1.keyset.Keyset`
:param keyset: Keys/ranges identifying rows to delete.
"""
delete = ... | [
"Delete",
"one",
"or",
"more",
"table",
"rows",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L108-L118 | [
"def",
"delete",
"(",
"self",
",",
"table",
",",
"keyset",
")",
":",
"delete",
"=",
"Mutation",
".",
"Delete",
"(",
"table",
"=",
"table",
",",
"key_set",
"=",
"keyset",
".",
"_to_pb",
"(",
")",
")",
"self",
".",
"_mutations",
".",
"append",
"(",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | Batch.commit | Commit mutations to the database.
:rtype: datetime
:returns: timestamp of the committed changes. | spanner/google/cloud/spanner_v1/batch.py | def commit(self):
"""Commit mutations to the database.
:rtype: datetime
:returns: timestamp of the committed changes.
"""
self._check_state()
database = self._session._database
api = database.spanner_api
metadata = _metadata_with_prefix(database.name)
... | def commit(self):
"""Commit mutations to the database.
:rtype: datetime
:returns: timestamp of the committed changes.
"""
self._check_state()
database = self._session._database
api = database.spanner_api
metadata = _metadata_with_prefix(database.name)
... | [
"Commit",
"mutations",
"to",
"the",
"database",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/spanner/google/cloud/spanner_v1/batch.py#L139-L157 | [
"def",
"commit",
"(",
"self",
")",
":",
"self",
".",
"_check_state",
"(",
")",
"database",
"=",
"self",
".",
"_session",
".",
"_database",
"api",
"=",
"database",
".",
"spanner_api",
"metadata",
"=",
"_metadata_with_prefix",
"(",
"database",
".",
"name",
"... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | dataset_exists | Return if a dataset exists.
Args:
client (google.cloud.bigquery.client.Client):
A client to connect to the BigQuery API.
dataset_reference (google.cloud.bigquery.dataset.DatasetReference):
A reference to the dataset to look for.
Returns:
bool: ``True`` if the da... | bigquery/docs/snippets.py | def dataset_exists(client, dataset_reference):
"""Return if a dataset exists.
Args:
client (google.cloud.bigquery.client.Client):
A client to connect to the BigQuery API.
dataset_reference (google.cloud.bigquery.dataset.DatasetReference):
A reference to the dataset to lo... | def dataset_exists(client, dataset_reference):
"""Return if a dataset exists.
Args:
client (google.cloud.bigquery.client.Client):
A client to connect to the BigQuery API.
dataset_reference (google.cloud.bigquery.dataset.DatasetReference):
A reference to the dataset to lo... | [
"Return",
"if",
"a",
"dataset",
"exists",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/docs/snippets.py#L178-L196 | [
"def",
"dataset_exists",
"(",
"client",
",",
"dataset_reference",
")",
":",
"from",
"google",
".",
"cloud",
".",
"exceptions",
"import",
"NotFound",
"try",
":",
"client",
".",
"get_dataset",
"(",
"dataset_reference",
")",
"return",
"True",
"except",
"NotFound",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | table_exists | Return if a table exists.
Args:
client (google.cloud.bigquery.client.Client):
A client to connect to the BigQuery API.
table_reference (google.cloud.bigquery.table.TableReference):
A reference to the table to look for.
Returns:
bool: ``True`` if the table exists... | bigquery/docs/snippets.py | def table_exists(client, table_reference):
"""Return if a table exists.
Args:
client (google.cloud.bigquery.client.Client):
A client to connect to the BigQuery API.
table_reference (google.cloud.bigquery.table.TableReference):
A reference to the table to look for.
R... | def table_exists(client, table_reference):
"""Return if a table exists.
Args:
client (google.cloud.bigquery.client.Client):
A client to connect to the BigQuery API.
table_reference (google.cloud.bigquery.table.TableReference):
A reference to the table to look for.
R... | [
"Return",
"if",
"a",
"table",
"exists",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/docs/snippets.py#L460-L478 | [
"def",
"table_exists",
"(",
"client",
",",
"table_reference",
")",
":",
"from",
"google",
".",
"cloud",
".",
"exceptions",
"import",
"NotFound",
"try",
":",
"client",
".",
"get_table",
"(",
"table_reference",
")",
"return",
"True",
"except",
"NotFound",
":",
... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DatastoreClient.run_query | Queries for entities.
Example:
>>> from google.cloud import datastore_v1
>>>
>>> client = datastore_v1.DatastoreClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
>>>
>>> # TODO: Initialize `parti... | datastore/google/cloud/datastore_v1/gapic/datastore_client.py | def run_query(
self,
project_id,
partition_id,
read_options=None,
query=None,
gql_query=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Queries for enti... | def run_query(
self,
project_id,
partition_id,
read_options=None,
query=None,
gql_query=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Queries for enti... | [
"Queries",
"for",
"entities",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore_v1/gapic/datastore_client.py#L264-L368 | [
"def",
"run_query",
"(",
"self",
",",
"project_id",
",",
"partition_id",
",",
"read_options",
"=",
"None",
",",
"query",
"=",
"None",
",",
"gql_query",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAU... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | DatastoreClient.commit | Commits a transaction, optionally creating, deleting or modifying some
entities.
Example:
>>> from google.cloud import datastore_v1
>>> from google.cloud.datastore_v1 import enums
>>>
>>> client = datastore_v1.DatastoreClient()
>>>
... | datastore/google/cloud/datastore_v1/gapic/datastore_client.py | def commit(
self,
project_id,
mode,
mutations,
transaction=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Commits a transaction, optionally creating, deleting ... | def commit(
self,
project_id,
mode,
mutations,
transaction=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Commits a transaction, optionally creating, deleting ... | [
"Commits",
"a",
"transaction",
"optionally",
"creating",
"deleting",
"or",
"modifying",
"some",
"entities",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/datastore/google/cloud/datastore_v1/gapic/datastore_client.py#L447-L555 | [
"def",
"commit",
"(",
"self",
",",
"project_id",
",",
"mode",
",",
"mutations",
",",
"transaction",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | AppEngineHandler.get_gae_resource | Return the GAE resource using the environment variables.
:rtype: :class:`~google.cloud.logging.resource.Resource`
:returns: Monitored resource for GAE. | logging/google/cloud/logging/handlers/app_engine.py | def get_gae_resource(self):
"""Return the GAE resource using the environment variables.
:rtype: :class:`~google.cloud.logging.resource.Resource`
:returns: Monitored resource for GAE.
"""
gae_resource = Resource(
type="gae_app",
labels={
"p... | def get_gae_resource(self):
"""Return the GAE resource using the environment variables.
:rtype: :class:`~google.cloud.logging.resource.Resource`
:returns: Monitored resource for GAE.
"""
gae_resource = Resource(
type="gae_app",
labels={
"p... | [
"Return",
"the",
"GAE",
"resource",
"using",
"the",
"environment",
"variables",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/app_engine.py#L72-L86 | [
"def",
"get_gae_resource",
"(",
"self",
")",
":",
"gae_resource",
"=",
"Resource",
"(",
"type",
"=",
"\"gae_app\"",
",",
"labels",
"=",
"{",
"\"project_id\"",
":",
"self",
".",
"project_id",
",",
"\"module_id\"",
":",
"self",
".",
"module_id",
",",
"\"versio... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | AppEngineHandler.get_gae_labels | Return the labels for GAE app.
If the trace ID can be detected, it will be included as a label.
Currently, no other labels are included.
:rtype: dict
:returns: Labels for GAE app. | logging/google/cloud/logging/handlers/app_engine.py | def get_gae_labels(self):
"""Return the labels for GAE app.
If the trace ID can be detected, it will be included as a label.
Currently, no other labels are included.
:rtype: dict
:returns: Labels for GAE app.
"""
gae_labels = {}
trace_id = get_trace_id(... | def get_gae_labels(self):
"""Return the labels for GAE app.
If the trace ID can be detected, it will be included as a label.
Currently, no other labels are included.
:rtype: dict
:returns: Labels for GAE app.
"""
gae_labels = {}
trace_id = get_trace_id(... | [
"Return",
"the",
"labels",
"for",
"GAE",
"app",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/app_engine.py#L88-L103 | [
"def",
"get_gae_labels",
"(",
"self",
")",
":",
"gae_labels",
"=",
"{",
"}",
"trace_id",
"=",
"get_trace_id",
"(",
")",
"if",
"trace_id",
"is",
"not",
"None",
":",
"gae_labels",
"[",
"_TRACE_ID_LABEL",
"]",
"=",
"trace_id",
"return",
"gae_labels"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
train | AppEngineHandler.emit | 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. | logging/google/cloud/logging/handlers/app_engine.py | 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):
"""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",
"."
] | googleapis/google-cloud-python | python | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/logging/google/cloud/logging/handlers/app_engine.py#L105-L124 | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"message",
"=",
"super",
"(",
"AppEngineHandler",
",",
"self",
")",
".",
"format",
"(",
"record",
")",
"gae_labels",
"=",
"self",
".",
"get_gae_labels",
"(",
")",
"trace_id",
"=",
"(",
"\"projects/%s/t... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.