id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
27,800 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.total_bytes_billed | def total_bytes_billed(self):
"""Return total bytes billed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesBilled
:rtype: int or None
:returns: total bytes processed by the job, or None if job is not... | python | def total_bytes_billed(self):
"""Return total bytes billed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesBilled
:rtype: int or None
:returns: total bytes processed by the job, or None if job is not... | [
"def",
"total_bytes_billed",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"totalBytesBilled\"",
")",
"if",
"result",
"is",
"not",
"None",
":",
"result",
"=",
"int",
"(",
"result",
")",
"return",
"resu... | Return total bytes billed from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.totalBytesBilled
:rtype: int or None
:returns: total bytes processed by the job, or None if job is not
yet complete. | [
"Return",
"total",
"bytes",
"billed",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2593-L2606 |
27,801 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.num_dml_affected_rows | def num_dml_affected_rows(self):
"""Return the number of DML rows affected by the job.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.numDmlAffectedRows
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is ... | python | def num_dml_affected_rows(self):
"""Return the number of DML rows affected by the job.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.numDmlAffectedRows
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is ... | [
"def",
"num_dml_affected_rows",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"numDmlAffectedRows\"",
")",
"if",
"result",
"is",
"not",
"None",
":",
"result",
"=",
"int",
"(",
"result",
")",
"return",
... | Return the number of DML rows affected by the job.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.numDmlAffectedRows
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is not
yet complete. | [
"Return",
"the",
"number",
"of",
"DML",
"rows",
"affected",
"by",
"the",
"job",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2658-L2671 |
27,802 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.referenced_tables | def referenced_tables(self):
"""Return referenced tables from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.referencedTables
:rtype: list of dict
:returns: mappings describing the query plan, or an empty list
... | python | def referenced_tables(self):
"""Return referenced tables from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.referencedTables
:rtype: list of dict
:returns: mappings describing the query plan, or an empty list
... | [
"def",
"referenced_tables",
"(",
"self",
")",
":",
"tables",
"=",
"[",
"]",
"datasets_by_project_name",
"=",
"{",
"}",
"for",
"table",
"in",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"referencedTables\"",
",",
"(",
")",
")",
":",
"t_pr... | Return referenced tables from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.referencedTables
:rtype: list of dict
:returns: mappings describing the query plan, or an empty list
if the query has not yet ... | [
"Return",
"referenced",
"tables",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2692-L2718 |
27,803 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.undeclared_query_parameters | def undeclared_query_parameters(self):
"""Return undeclared query parameters from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.undeclaredQueryParameters
:rtype:
list of
:class:`~google.cloud.bigq... | python | def undeclared_query_parameters(self):
"""Return undeclared query parameters from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.undeclaredQueryParameters
:rtype:
list of
:class:`~google.cloud.bigq... | [
"def",
"undeclared_query_parameters",
"(",
"self",
")",
":",
"parameters",
"=",
"[",
"]",
"undeclared",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"undeclaredQueryParameters\"",
",",
"(",
")",
")",
"for",
"parameter",
"in",
"undeclared",... | Return undeclared query parameters from job statistics, if present.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.undeclaredQueryParameters
:rtype:
list of
:class:`~google.cloud.bigquery.ArrayQueryParameter`,
:class:`~go... | [
"Return",
"undeclared",
"query",
"parameters",
"from",
"job",
"statistics",
"if",
"present",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2721-L2750 |
27,804 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.estimated_bytes_processed | def estimated_bytes_processed(self):
"""Return the estimated number of bytes processed by the query.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.estimatedBytesProcessed
:rtype: int or None
:returns: number of DML rows affected by the job,... | python | def estimated_bytes_processed(self):
"""Return the estimated number of bytes processed by the query.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.estimatedBytesProcessed
:rtype: int or None
:returns: number of DML rows affected by the job,... | [
"def",
"estimated_bytes_processed",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"_job_statistics",
"(",
")",
".",
"get",
"(",
"\"estimatedBytesProcessed\"",
")",
"if",
"result",
"is",
"not",
"None",
":",
"result",
"=",
"int",
"(",
"result",
")",
"re... | Return the estimated number of bytes processed by the query.
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.estimatedBytesProcessed
:rtype: int or None
:returns: number of DML rows affected by the job, or None if job is not
yet com... | [
"Return",
"the",
"estimated",
"number",
"of",
"bytes",
"processed",
"by",
"the",
"query",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2753-L2766 |
27,805 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | QueryJob.to_dataframe | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Return a pandas DataFrame from a QueryJob
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Alpha Feature** Optional... | python | def to_dataframe(self, bqstorage_client=None, dtypes=None, progress_bar_type=None):
"""Return a pandas DataFrame from a QueryJob
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Alpha Feature** Optional... | [
"def",
"to_dataframe",
"(",
"self",
",",
"bqstorage_client",
"=",
"None",
",",
"dtypes",
"=",
"None",
",",
"progress_bar_type",
"=",
"None",
")",
":",
"return",
"self",
".",
"result",
"(",
")",
".",
"to_dataframe",
"(",
"bqstorage_client",
"=",
"bqstorage_cl... | Return a pandas DataFrame from a QueryJob
Args:
bqstorage_client ( \
google.cloud.bigquery_storage_v1beta1.BigQueryStorageClient \
):
**Alpha Feature** Optional. A BigQuery Storage API client. If
supplied, use the faster BigQuery Storage A... | [
"Return",
"a",
"pandas",
"DataFrame",
"from",
"a",
"QueryJob"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L2854-L2904 |
27,806 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/job.py | UnknownJob.from_api_repr | def from_api_repr(cls, resource, client):
"""Construct an UnknownJob from the JSON representation.
Args:
resource (dict): JSON representation of a job.
client (google.cloud.bigquery.client.Client):
Client connected to BigQuery API.
Returns:
U... | python | def from_api_repr(cls, resource, client):
"""Construct an UnknownJob from the JSON representation.
Args:
resource (dict): JSON representation of a job.
client (google.cloud.bigquery.client.Client):
Client connected to BigQuery API.
Returns:
U... | [
"def",
"from_api_repr",
"(",
"cls",
",",
"resource",
",",
"client",
")",
":",
"job_ref_properties",
"=",
"resource",
".",
"get",
"(",
"\"jobReference\"",
",",
"{",
"\"projectId\"",
":",
"client",
".",
"project",
"}",
")",
"job_ref",
"=",
"_JobReference",
"."... | Construct an UnknownJob from the JSON representation.
Args:
resource (dict): JSON representation of a job.
client (google.cloud.bigquery.client.Client):
Client connected to BigQuery API.
Returns:
UnknownJob: Job corresponding to the resource. | [
"Construct",
"an",
"UnknownJob",
"from",
"the",
"JSON",
"representation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/job.py#L3244-L3262 |
27,807 | googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.description | def description(self, value):
"""Update description of the zone.
:type value: str
:param value: (Optional) new description
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError("Pa... | python | def description(self, value):
"""Update description of the zone.
:type value: str
:param value: (Optional) new description
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError("Pa... | [
"def",
"description",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
"and",
"value",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Pass a string, or None\"",
")",
"self",
".",
... | Update description of the zone.
:type value: str
:param value: (Optional) new description
:raises: ValueError for invalid value types. | [
"Update",
"description",
"of",
"the",
"zone",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L138-L148 |
27,808 | googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.name_server_set | def name_server_set(self, value):
"""Update named set of DNS name servers.
:type value: str
:param value: (Optional) new title
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError... | python | def name_server_set(self, value):
"""Update named set of DNS name servers.
:type value: str
:param value: (Optional) new title
:raises: ValueError for invalid value types.
"""
if not isinstance(value, six.string_types) and value is not None:
raise ValueError... | [
"def",
"name_server_set",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
"and",
"value",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Pass a string, or None\"",
")",
"self",
"... | Update named set of DNS name servers.
:type value: str
:param value: (Optional) new title
:raises: ValueError for invalid value types. | [
"Update",
"named",
"set",
"of",
"DNS",
"name",
"servers",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L165-L175 |
27,809 | googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.resource_record_set | def resource_record_set(self, name, record_type, ttl, rrdatas):
"""Construct a resource record set bound to this zone.
:type name: str
:param name: Name of the record set.
:type record_type: str
:param record_type: RR type
:type ttl: int
:param ttl: TTL for the... | python | def resource_record_set(self, name, record_type, ttl, rrdatas):
"""Construct a resource record set bound to this zone.
:type name: str
:param name: Name of the record set.
:type record_type: str
:param record_type: RR type
:type ttl: int
:param ttl: TTL for the... | [
"def",
"resource_record_set",
"(",
"self",
",",
"name",
",",
"record_type",
",",
"ttl",
",",
"rrdatas",
")",
":",
"return",
"ResourceRecordSet",
"(",
"name",
",",
"record_type",
",",
"ttl",
",",
"rrdatas",
",",
"zone",
"=",
"self",
")"
] | Construct a resource record set bound to this zone.
:type name: str
:param name: Name of the record set.
:type record_type: str
:param record_type: RR type
:type ttl: int
:param ttl: TTL for the RR, in seconds
:type rrdatas: list of string
:param rrdat... | [
"Construct",
"a",
"resource",
"record",
"set",
"bound",
"to",
"this",
"zone",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L177-L195 |
27,810 | googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone._build_resource | def _build_resource(self):
"""Generate a resource for ``create`` or ``update``."""
resource = {"name": self.name}
if self.dns_name is not None:
resource["dnsName"] = self.dns_name
if self.description is not None:
resource["description"] = self.description
... | python | def _build_resource(self):
"""Generate a resource for ``create`` or ``update``."""
resource = {"name": self.name}
if self.dns_name is not None:
resource["dnsName"] = self.dns_name
if self.description is not None:
resource["description"] = self.description
... | [
"def",
"_build_resource",
"(",
"self",
")",
":",
"resource",
"=",
"{",
"\"name\"",
":",
"self",
".",
"name",
"}",
"if",
"self",
".",
"dns_name",
"is",
"not",
"None",
":",
"resource",
"[",
"\"dnsName\"",
"]",
"=",
"self",
".",
"dns_name",
"if",
"self",
... | Generate a resource for ``create`` or ``update``. | [
"Generate",
"a",
"resource",
"for",
"create",
"or",
"update",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L233-L246 |
27,811 | googleapis/google-cloud-python | dns/google/cloud/dns/zone.py | ManagedZone.list_resource_record_sets | def list_resource_record_sets(self, max_results=None, page_token=None, client=None):
"""List resource record sets for this zone.
See
https://cloud.google.com/dns/api/v1/resourceRecordSets/list
:type max_results: int
:param max_results: Optional. The maximum number of resource r... | python | def list_resource_record_sets(self, max_results=None, page_token=None, client=None):
"""List resource record sets for this zone.
See
https://cloud.google.com/dns/api/v1/resourceRecordSets/list
:type max_results: int
:param max_results: Optional. The maximum number of resource r... | [
"def",
"list_resource_record_sets",
"(",
"self",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"path",
"=",
"\"/projects/%s/managedZones... | List resource record sets for this zone.
See
https://cloud.google.com/dns/api/v1/resourceRecordSets/list
:type max_results: int
:param max_results: Optional. The maximum number of resource record
sets to return. Defaults to a sensible value
... | [
"List",
"resource",
"record",
"sets",
"for",
"this",
"zone",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/dns/google/cloud/dns/zone.py#L319-L358 |
27,812 | googleapis/google-cloud-python | vision/google/cloud/vision_helpers/__init__.py | VisionHelpers.annotate_image | def annotate_image(self, request, retry=None, timeout=None):
"""Run image detection and annotation for an image.
Example:
>>> from google.cloud.vision_v1 import ImageAnnotatorClient
>>> client = ImageAnnotatorClient()
>>> request = {
... 'image': {
... | python | def annotate_image(self, request, retry=None, timeout=None):
"""Run image detection and annotation for an image.
Example:
>>> from google.cloud.vision_v1 import ImageAnnotatorClient
>>> client = ImageAnnotatorClient()
>>> request = {
... 'image': {
... | [
"def",
"annotate_image",
"(",
"self",
",",
"request",
",",
"retry",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"# If the image is a file handler, set the content.",
"image",
"=",
"protobuf",
".",
"get",
"(",
"request",
",",
"\"image\"",
")",
"if",
"ha... | Run image detection and annotation for an image.
Example:
>>> from google.cloud.vision_v1 import ImageAnnotatorClient
>>> client = ImageAnnotatorClient()
>>> request = {
... 'image': {
... 'source': {'image_uri': 'https://foo.com/image.jpg... | [
"Run",
"image",
"detection",
"and",
"annotation",
"for",
"an",
"image",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/vision/google/cloud/vision_helpers/__init__.py#L29-L73 |
27,813 | googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.create_job | def create_job(
self,
parent,
job,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may tak... | python | def create_job(
self,
parent,
job,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may tak... | [
"def",
"create_job",
"(",
"self",
",",
"parent",
",",
"job",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
"... | Creates a new job.
Typically, the job becomes searchable within 10 seconds, but it may take
up to 5 minutes.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.JobServiceClient()
>>>
>>> parent = clie... | [
"Creates",
"a",
"new",
"job",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L197-L269 |
27,814 | googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.get_job | def get_job(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the specified job, whose status is OPEN or recently EXPIRED
within the last 90 days.
Examp... | python | def get_job(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Retrieves the specified job, whose status is OPEN or recently EXPIRED
within the last 90 days.
Examp... | [
"def",
"get_job",
"(",
"self",
",",
"name",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"metadata",
"... | Retrieves the specified job, whose status is OPEN or recently EXPIRED
within the last 90 days.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.JobServiceClient()
>>>
>>> name = client.job_path('[PROJECT]', ... | [
"Retrieves",
"the",
"specified",
"job",
"whose",
"status",
"is",
"OPEN",
"or",
"recently",
"EXPIRED",
"within",
"the",
"last",
"90",
"days",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L271-L331 |
27,815 | googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.batch_delete_jobs | def batch_delete_jobs(
self,
parent,
filter_,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a list of ``Job``\ s by filter.
Example:
>>> from google.cl... | python | def batch_delete_jobs(
self,
parent,
filter_,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Deletes a list of ``Job``\ s by filter.
Example:
>>> from google.cl... | [
"def",
"batch_delete_jobs",
"(",
"self",
",",
"parent",
",",
"filter_",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DE... | Deletes a list of ``Job``\ s by filter.
Example:
>>> from google.cloud import talent_v4beta1
>>>
>>> client = talent_v4beta1.JobServiceClient()
>>>
>>> parent = client.project_path('[PROJECT]')
>>>
>>> # TODO: Initialize `filte... | [
"Deletes",
"a",
"list",
"of",
"Job",
"\\",
"s",
"by",
"filter",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L595-L668 |
27,816 | googleapis/google-cloud-python | talent/google/cloud/talent_v4beta1/gapic/job_service_client.py | JobServiceClient.search_jobs | def search_jobs(
self,
parent,
request_metadata,
search_mode=None,
job_query=None,
enable_broadening=None,
require_precise_result_size=None,
histogram_queries=None,
job_view=None,
offset=None,
page_size=None,
order_by=None,
... | python | def search_jobs(
self,
parent,
request_metadata,
search_mode=None,
job_query=None,
enable_broadening=None,
require_precise_result_size=None,
histogram_queries=None,
job_view=None,
offset=None,
page_size=None,
order_by=None,
... | [
"def",
"search_jobs",
"(",
"self",
",",
"parent",
",",
"request_metadata",
",",
"search_mode",
"=",
"None",
",",
"job_query",
"=",
"None",
",",
"enable_broadening",
"=",
"None",
",",
"require_precise_result_size",
"=",
"None",
",",
"histogram_queries",
"=",
"Non... | Searches for jobs using the provided ``SearchJobsRequest``.
This call constrains the ``visibility`` of jobs present in the database,
and only returns jobs that the caller has permission to search against.
Example:
>>> from google.cloud import talent_v4beta1
>>>
... | [
"Searches",
"for",
"jobs",
"using",
"the",
"provided",
"SearchJobsRequest",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py#L670-L1024 |
27,817 | googleapis/google-cloud-python | core/google/cloud/operation.py | _compute_type_url | def _compute_type_url(klass, prefix=_GOOGLE_APIS_PREFIX):
"""Compute a type URL for a klass.
:type klass: type
:param klass: class to be used as a factory for the given type
:type prefix: str
:param prefix: URL prefix for the type
:rtype: str
:returns: the URL, prefixed as appropriate
... | python | def _compute_type_url(klass, prefix=_GOOGLE_APIS_PREFIX):
"""Compute a type URL for a klass.
:type klass: type
:param klass: class to be used as a factory for the given type
:type prefix: str
:param prefix: URL prefix for the type
:rtype: str
:returns: the URL, prefixed as appropriate
... | [
"def",
"_compute_type_url",
"(",
"klass",
",",
"prefix",
"=",
"_GOOGLE_APIS_PREFIX",
")",
":",
"name",
"=",
"klass",
".",
"DESCRIPTOR",
".",
"full_name",
"return",
"\"%s/%s\"",
"%",
"(",
"prefix",
",",
"name",
")"
] | Compute a type URL for a klass.
:type klass: type
:param klass: class to be used as a factory for the given type
:type prefix: str
:param prefix: URL prefix for the type
:rtype: str
:returns: the URL, prefixed as appropriate | [
"Compute",
"a",
"type",
"URL",
"for",
"a",
"klass",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L26-L39 |
27,818 | googleapis/google-cloud-python | core/google/cloud/operation.py | register_type | def register_type(klass, type_url=None):
"""Register a klass as the factory for a given type URL.
:type klass: :class:`type`
:param klass: class to be used as a factory for the given type
:type type_url: str
:param type_url: (Optional) URL naming the type. If not provided,
inf... | python | def register_type(klass, type_url=None):
"""Register a klass as the factory for a given type URL.
:type klass: :class:`type`
:param klass: class to be used as a factory for the given type
:type type_url: str
:param type_url: (Optional) URL naming the type. If not provided,
inf... | [
"def",
"register_type",
"(",
"klass",
",",
"type_url",
"=",
"None",
")",
":",
"if",
"type_url",
"is",
"None",
":",
"type_url",
"=",
"_compute_type_url",
"(",
"klass",
")",
"if",
"type_url",
"in",
"_TYPE_URL_MAP",
":",
"if",
"_TYPE_URL_MAP",
"[",
"type_url",
... | Register a klass as the factory for a given type URL.
:type klass: :class:`type`
:param klass: class to be used as a factory for the given type
:type type_url: str
:param type_url: (Optional) URL naming the type. If not provided,
infers the URL from the type descriptor.
:rais... | [
"Register",
"a",
"klass",
"as",
"the",
"factory",
"for",
"a",
"given",
"type",
"URL",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L42-L60 |
27,819 | googleapis/google-cloud-python | core/google/cloud/operation.py | _from_any | def _from_any(any_pb):
"""Convert an ``Any`` protobuf into the actual class.
Uses the type URL to do the conversion.
.. note::
This assumes that the type URL is already registered.
:type any_pb: :class:`google.protobuf.any_pb2.Any`
:param any_pb: An any object to be converted.
:rtyp... | python | def _from_any(any_pb):
"""Convert an ``Any`` protobuf into the actual class.
Uses the type URL to do the conversion.
.. note::
This assumes that the type URL is already registered.
:type any_pb: :class:`google.protobuf.any_pb2.Any`
:param any_pb: An any object to be converted.
:rtyp... | [
"def",
"_from_any",
"(",
"any_pb",
")",
":",
"klass",
"=",
"_TYPE_URL_MAP",
"[",
"any_pb",
".",
"type_url",
"]",
"return",
"klass",
".",
"FromString",
"(",
"any_pb",
".",
"value",
")"
] | Convert an ``Any`` protobuf into the actual class.
Uses the type URL to do the conversion.
.. note::
This assumes that the type URL is already registered.
:type any_pb: :class:`google.protobuf.any_pb2.Any`
:param any_pb: An any object to be converted.
:rtype: object
:returns: The in... | [
"Convert",
"an",
"Any",
"protobuf",
"into",
"the",
"actual",
"class",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L63-L80 |
27,820 | googleapis/google-cloud-python | core/google/cloud/operation.py | Operation._get_operation_rpc | def _get_operation_rpc(self):
"""Polls the status of the current operation.
Uses gRPC request to check.
:rtype: :class:`~google.longrunning.operations_pb2.Operation`
:returns: The latest status of the current operation.
"""
request_pb = operations_pb2.GetOperationReques... | python | def _get_operation_rpc(self):
"""Polls the status of the current operation.
Uses gRPC request to check.
:rtype: :class:`~google.longrunning.operations_pb2.Operation`
:returns: The latest status of the current operation.
"""
request_pb = operations_pb2.GetOperationReques... | [
"def",
"_get_operation_rpc",
"(",
"self",
")",
":",
"request_pb",
"=",
"operations_pb2",
".",
"GetOperationRequest",
"(",
"name",
"=",
"self",
".",
"name",
")",
"return",
"self",
".",
"client",
".",
"_operations_stub",
".",
"GetOperation",
"(",
"request_pb",
"... | Polls the status of the current operation.
Uses gRPC request to check.
:rtype: :class:`~google.longrunning.operations_pb2.Operation`
:returns: The latest status of the current operation. | [
"Polls",
"the",
"status",
"of",
"the",
"current",
"operation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L199-L208 |
27,821 | googleapis/google-cloud-python | core/google/cloud/operation.py | Operation._get_operation_http | def _get_operation_http(self):
"""Checks the status of the current operation.
Uses HTTP request to check.
:rtype: :class:`~google.longrunning.operations_pb2.Operation`
:returns: The latest status of the current operation.
"""
path = "operations/%s" % (self.name,)
... | python | def _get_operation_http(self):
"""Checks the status of the current operation.
Uses HTTP request to check.
:rtype: :class:`~google.longrunning.operations_pb2.Operation`
:returns: The latest status of the current operation.
"""
path = "operations/%s" % (self.name,)
... | [
"def",
"_get_operation_http",
"(",
"self",
")",
":",
"path",
"=",
"\"operations/%s\"",
"%",
"(",
"self",
".",
"name",
",",
")",
"api_response",
"=",
"self",
".",
"client",
".",
"_connection",
".",
"api_request",
"(",
"method",
"=",
"\"GET\"",
",",
"path",
... | Checks the status of the current operation.
Uses HTTP request to check.
:rtype: :class:`~google.longrunning.operations_pb2.Operation`
:returns: The latest status of the current operation. | [
"Checks",
"the",
"status",
"of",
"the",
"current",
"operation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L210-L220 |
27,822 | googleapis/google-cloud-python | core/google/cloud/operation.py | Operation._update_state | def _update_state(self, operation_pb):
"""Update the state of the current object based on operation.
:type operation_pb:
:class:`~google.longrunning.operations_pb2.Operation`
:param operation_pb: Protobuf to be parsed.
"""
if operation_pb.done:
self._comp... | python | def _update_state(self, operation_pb):
"""Update the state of the current object based on operation.
:type operation_pb:
:class:`~google.longrunning.operations_pb2.Operation`
:param operation_pb: Protobuf to be parsed.
"""
if operation_pb.done:
self._comp... | [
"def",
"_update_state",
"(",
"self",
",",
"operation_pb",
")",
":",
"if",
"operation_pb",
".",
"done",
":",
"self",
".",
"_complete",
"=",
"True",
"if",
"operation_pb",
".",
"HasField",
"(",
"\"metadata\"",
")",
":",
"self",
".",
"metadata",
"=",
"_from_an... | Update the state of the current object based on operation.
:type operation_pb:
:class:`~google.longrunning.operations_pb2.Operation`
:param operation_pb: Protobuf to be parsed. | [
"Update",
"the",
"state",
"of",
"the",
"current",
"object",
"based",
"on",
"operation",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L233-L250 |
27,823 | googleapis/google-cloud-python | core/google/cloud/operation.py | Operation.poll | def poll(self):
"""Check if the operation has finished.
:rtype: bool
:returns: A boolean indicating if the current operation has completed.
:raises ValueError: if the operation
has already completed.
"""
if self.complete:
raise ValueError("Th... | python | def poll(self):
"""Check if the operation has finished.
:rtype: bool
:returns: A boolean indicating if the current operation has completed.
:raises ValueError: if the operation
has already completed.
"""
if self.complete:
raise ValueError("Th... | [
"def",
"poll",
"(",
"self",
")",
":",
"if",
"self",
".",
"complete",
":",
"raise",
"ValueError",
"(",
"\"The operation has completed.\"",
")",
"operation_pb",
"=",
"self",
".",
"_get_operation",
"(",
")",
"self",
".",
"_update_state",
"(",
"operation_pb",
")",... | Check if the operation has finished.
:rtype: bool
:returns: A boolean indicating if the current operation has completed.
:raises ValueError: if the operation
has already completed. | [
"Check",
"if",
"the",
"operation",
"has",
"finished",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/core/google/cloud/operation.py#L252-L266 |
27,824 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | _parse_rmw_row_response | def _parse_rmw_row_response(row_response):
"""Parses the response to a ``ReadModifyWriteRow`` request.
:type row_response: :class:`.data_v2_pb2.Row`
:param row_response: The response row (with only modified cells) from a
``ReadModifyWriteRow`` request.
:rtype: dict
:return... | python | def _parse_rmw_row_response(row_response):
"""Parses the response to a ``ReadModifyWriteRow`` request.
:type row_response: :class:`.data_v2_pb2.Row`
:param row_response: The response row (with only modified cells) from a
``ReadModifyWriteRow`` request.
:rtype: dict
:return... | [
"def",
"_parse_rmw_row_response",
"(",
"row_response",
")",
":",
"result",
"=",
"{",
"}",
"for",
"column_family",
"in",
"row_response",
".",
"row",
".",
"families",
":",
"column_family_id",
",",
"curr_family",
"=",
"_parse_family_pb",
"(",
"column_family",
")",
... | Parses the response to a ``ReadModifyWriteRow`` request.
:type row_response: :class:`.data_v2_pb2.Row`
:param row_response: The response row (with only modified cells) from a
``ReadModifyWriteRow`` request.
:rtype: dict
:returns: The new contents of all modified cells. Returne... | [
"Parses",
"the",
"response",
"to",
"a",
"ReadModifyWriteRow",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L921-L958 |
27,825 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | _parse_family_pb | def _parse_family_pb(family_pb):
"""Parses a Family protobuf into a dictionary.
:type family_pb: :class:`._generated.data_pb2.Family`
:param family_pb: A protobuf
:rtype: tuple
:returns: A string and dictionary. The string is the name of the
column family and the dictionary has colum... | python | def _parse_family_pb(family_pb):
"""Parses a Family protobuf into a dictionary.
:type family_pb: :class:`._generated.data_pb2.Family`
:param family_pb: A protobuf
:rtype: tuple
:returns: A string and dictionary. The string is the name of the
column family and the dictionary has colum... | [
"def",
"_parse_family_pb",
"(",
"family_pb",
")",
":",
"result",
"=",
"{",
"}",
"for",
"column",
"in",
"family_pb",
".",
"columns",
":",
"result",
"[",
"column",
".",
"qualifier",
"]",
"=",
"cells",
"=",
"[",
"]",
"for",
"cell",
"in",
"column",
".",
... | Parses a Family protobuf into a dictionary.
:type family_pb: :class:`._generated.data_pb2.Family`
:param family_pb: A protobuf
:rtype: tuple
:returns: A string and dictionary. The string is the name of the
column family and the dictionary has column names (within the
family... | [
"Parses",
"a",
"Family",
"protobuf",
"into",
"a",
"dictionary",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L961-L993 |
27,826 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | DirectRow.get_mutations_size | def get_mutations_size(self):
""" Gets the total mutations size for current row
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_get_mutations_size]
:end-before: [END bigtable_row_get_mutations_size]
"""
mutation_siz... | python | def get_mutations_size(self):
""" Gets the total mutations size for current row
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_get_mutations_size]
:end-before: [END bigtable_row_get_mutations_size]
"""
mutation_siz... | [
"def",
"get_mutations_size",
"(",
"self",
")",
":",
"mutation_size",
"=",
"0",
"for",
"mutation",
"in",
"self",
".",
"_get_mutations",
"(",
")",
":",
"mutation_size",
"+=",
"mutation",
".",
"ByteSize",
"(",
")",
"return",
"mutation_size"
] | Gets the total mutations size for current row
For example:
.. literalinclude:: snippets_table.py
:start-after: [START bigtable_row_get_mutations_size]
:end-before: [END bigtable_row_get_mutations_size] | [
"Gets",
"the",
"total",
"mutations",
"size",
"for",
"current",
"row"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L295-L310 |
27,827 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | DirectRow.set_cell | def set_cell(self, column_family_id, column, value, timestamp=None):
"""Sets a value in this row.
The cell is determined by the ``row_key`` of this :class:`DirectRow`
and the ``column``. The ``column`` must be in an existing
:class:`.ColumnFamily` (as determined by ``column_family_id``)... | python | def set_cell(self, column_family_id, column, value, timestamp=None):
"""Sets a value in this row.
The cell is determined by the ``row_key`` of this :class:`DirectRow`
and the ``column``. The ``column`` must be in an existing
:class:`.ColumnFamily` (as determined by ``column_family_id``)... | [
"def",
"set_cell",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"value",
",",
"timestamp",
"=",
"None",
")",
":",
"self",
".",
"_set_cell",
"(",
"column_family_id",
",",
"column",
",",
"value",
",",
"timestamp",
"=",
"timestamp",
",",
"state",... | Sets a value in this row.
The cell is determined by the ``row_key`` of this :class:`DirectRow`
and the ``column``. The ``column`` must be in an existing
:class:`.ColumnFamily` (as determined by ``column_family_id``).
.. note::
This method adds a mutation to the accumulated... | [
"Sets",
"a",
"value",
"in",
"this",
"row",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L312-L349 |
27,828 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | DirectRow.delete_cell | def delete_cell(self, column_family_id, column, time_range=None):
"""Deletes cell in this row.
.. note::
This method adds a mutation to the accumulated mutations on this
row, but does not make an API request. To actually
send an API request (with the mutations) to t... | python | def delete_cell(self, column_family_id, column, time_range=None):
"""Deletes cell in this row.
.. note::
This method adds a mutation to the accumulated mutations on this
row, but does not make an API request. To actually
send an API request (with the mutations) to t... | [
"def",
"delete_cell",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"time_range",
"=",
"None",
")",
":",
"self",
".",
"_delete_cells",
"(",
"column_family_id",
",",
"[",
"column",
"]",
",",
"time_range",
"=",
"time_range",
",",
"state",
"=",
"N... | Deletes cell in this row.
.. note::
This method adds a mutation to the accumulated mutations on this
row, but does not make an API request. To actually
send an API request (with the mutations) to the Google Cloud
Bigtable API, call :meth:`commit`.
For e... | [
"Deletes",
"cell",
"in",
"this",
"row",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L370-L401 |
27,829 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | DirectRow.delete_cells | def delete_cells(self, column_family_id, columns, time_range=None):
"""Deletes cells in this row.
.. note::
This method adds a mutation to the accumulated mutations on this
row, but does not make an API request. To actually
send an API request (with the mutations) t... | python | def delete_cells(self, column_family_id, columns, time_range=None):
"""Deletes cells in this row.
.. note::
This method adds a mutation to the accumulated mutations on this
row, but does not make an API request. To actually
send an API request (with the mutations) t... | [
"def",
"delete_cells",
"(",
"self",
",",
"column_family_id",
",",
"columns",
",",
"time_range",
"=",
"None",
")",
":",
"self",
".",
"_delete_cells",
"(",
"column_family_id",
",",
"columns",
",",
"time_range",
"=",
"time_range",
",",
"state",
"=",
"None",
")"... | Deletes cells in this row.
.. note::
This method adds a mutation to the accumulated mutations on this
row, but does not make an API request. To actually
send an API request (with the mutations) to the Google Cloud
Bigtable API, call :meth:`commit`.
For ... | [
"Deletes",
"cells",
"in",
"this",
"row",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L403-L434 |
27,830 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | ConditionalRow.commit | def commit(self):
"""Makes a ``CheckAndMutateRow`` API request.
If no mutations have been created in the row, no request is made.
The mutations will be applied conditionally, based on whether the
filter matches any cells in the :class:`ConditionalRow` or not. (Each
method which... | python | def commit(self):
"""Makes a ``CheckAndMutateRow`` API request.
If no mutations have been created in the row, no request is made.
The mutations will be applied conditionally, based on whether the
filter matches any cells in the :class:`ConditionalRow` or not. (Each
method which... | [
"def",
"commit",
"(",
"self",
")",
":",
"true_mutations",
"=",
"self",
".",
"_get_mutations",
"(",
"state",
"=",
"True",
")",
"false_mutations",
"=",
"self",
".",
"_get_mutations",
"(",
"state",
"=",
"False",
")",
"num_true_mutations",
"=",
"len",
"(",
"tr... | Makes a ``CheckAndMutateRow`` API request.
If no mutations have been created in the row, no request is made.
The mutations will be applied conditionally, based on whether the
filter matches any cells in the :class:`ConditionalRow` or not. (Each
method which adds a mutation has a ``stat... | [
"Makes",
"a",
"CheckAndMutateRow",
"API",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L538-L589 |
27,831 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | AppendRow.append_cell_value | def append_cell_value(self, column_family_id, column, value):
"""Appends a value to an existing cell.
.. note::
This method adds a read-modify rule protobuf to the accumulated
read-modify rules on this row, but does not make an API
request. To actually send an API r... | python | def append_cell_value(self, column_family_id, column, value):
"""Appends a value to an existing cell.
.. note::
This method adds a read-modify rule protobuf to the accumulated
read-modify rules on this row, but does not make an API
request. To actually send an API r... | [
"def",
"append_cell_value",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"value",
")",
":",
"column",
"=",
"_to_bytes",
"(",
"column",
")",
"value",
"=",
"_to_bytes",
"(",
"value",
")",
"rule_pb",
"=",
"data_v2_pb2",
".",
"ReadModifyWriteRule",
... | Appends a value to an existing cell.
.. note::
This method adds a read-modify rule protobuf to the accumulated
read-modify rules on this row, but does not make an API
request. To actually send an API request (with the rules) to the
Google Cloud Bigtable API, cal... | [
"Appends",
"a",
"value",
"to",
"an",
"existing",
"cell",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L789-L824 |
27,832 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | AppendRow.increment_cell_value | def increment_cell_value(self, column_family_id, column, int_value):
"""Increments a value in an existing cell.
Assumes the value in the cell is stored as a 64 bit integer
serialized to bytes.
.. note::
This method adds a read-modify rule protobuf to the accumulated
... | python | def increment_cell_value(self, column_family_id, column, int_value):
"""Increments a value in an existing cell.
Assumes the value in the cell is stored as a 64 bit integer
serialized to bytes.
.. note::
This method adds a read-modify rule protobuf to the accumulated
... | [
"def",
"increment_cell_value",
"(",
"self",
",",
"column_family_id",
",",
"column",
",",
"int_value",
")",
":",
"column",
"=",
"_to_bytes",
"(",
"column",
")",
"rule_pb",
"=",
"data_v2_pb2",
".",
"ReadModifyWriteRule",
"(",
"family_name",
"=",
"column_family_id",
... | Increments a value in an existing cell.
Assumes the value in the cell is stored as a 64 bit integer
serialized to bytes.
.. note::
This method adds a read-modify rule protobuf to the accumulated
read-modify rules on this row, but does not make an API
reques... | [
"Increments",
"a",
"value",
"in",
"an",
"existing",
"cell",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L826-L868 |
27,833 | googleapis/google-cloud-python | bigtable/google/cloud/bigtable/row.py | AppendRow.commit | def commit(self):
"""Makes a ``ReadModifyWriteRow`` API request.
This commits modifications made by :meth:`append_cell_value` and
:meth:`increment_cell_value`. If no modifications were made, makes
no API request and just returns ``{}``.
Modifies a row atomically, reading the la... | python | def commit(self):
"""Makes a ``ReadModifyWriteRow`` API request.
This commits modifications made by :meth:`append_cell_value` and
:meth:`increment_cell_value`. If no modifications were made, makes
no API request and just returns ``{}``.
Modifies a row atomically, reading the la... | [
"def",
"commit",
"(",
"self",
")",
":",
"num_mutations",
"=",
"len",
"(",
"self",
".",
"_rule_pb_list",
")",
"if",
"num_mutations",
"==",
"0",
":",
"return",
"{",
"}",
"if",
"num_mutations",
">",
"MAX_MUTATIONS",
":",
"raise",
"ValueError",
"(",
"\"%d tota... | Makes a ``ReadModifyWriteRow`` API request.
This commits modifications made by :meth:`append_cell_value` and
:meth:`increment_cell_value`. If no modifications were made, makes
no API request and just returns ``{}``.
Modifies a row atomically, reading the latest existing
timesta... | [
"Makes",
"a",
"ReadModifyWriteRow",
"API",
"request",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigtable/google/cloud/bigtable/row.py#L870-L918 |
27,834 | googleapis/google-cloud-python | api_core/google/api_core/gapic_v1/config.py | _retry_from_retry_config | def _retry_from_retry_config(retry_params, retry_codes):
"""Creates a Retry object given a gapic retry configuration.
Args:
retry_params (dict): The retry parameter values, for example::
{
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.5,
... | python | def _retry_from_retry_config(retry_params, retry_codes):
"""Creates a Retry object given a gapic retry configuration.
Args:
retry_params (dict): The retry parameter values, for example::
{
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.5,
... | [
"def",
"_retry_from_retry_config",
"(",
"retry_params",
",",
"retry_codes",
")",
":",
"exception_classes",
"=",
"[",
"_exception_class_for_grpc_status_name",
"(",
"code",
")",
"for",
"code",
"in",
"retry_codes",
"]",
"return",
"retry",
".",
"Retry",
"(",
"retry",
... | Creates a Retry object given a gapic retry configuration.
Args:
retry_params (dict): The retry parameter values, for example::
{
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.5,
"max_retry_delay_millis": 120000,
... | [
"Creates",
"a",
"Retry",
"object",
"given",
"a",
"gapic",
"retry",
"configuration",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/config.py#L48-L79 |
27,835 | googleapis/google-cloud-python | api_core/google/api_core/gapic_v1/config.py | _timeout_from_retry_config | def _timeout_from_retry_config(retry_params):
"""Creates a ExponentialTimeout object given a gapic retry configuration.
Args:
retry_params (dict): The retry parameter values, for example::
{
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.5,
... | python | def _timeout_from_retry_config(retry_params):
"""Creates a ExponentialTimeout object given a gapic retry configuration.
Args:
retry_params (dict): The retry parameter values, for example::
{
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.5,
... | [
"def",
"_timeout_from_retry_config",
"(",
"retry_params",
")",
":",
"return",
"timeout",
".",
"ExponentialTimeout",
"(",
"initial",
"=",
"(",
"retry_params",
"[",
"\"initial_rpc_timeout_millis\"",
"]",
"/",
"_MILLIS_PER_SECOND",
")",
",",
"maximum",
"=",
"(",
"retry... | Creates a ExponentialTimeout object given a gapic retry configuration.
Args:
retry_params (dict): The retry parameter values, for example::
{
"initial_retry_delay_millis": 1000,
"retry_delay_multiplier": 2.5,
"max_retry_delay_millis": 120000,
... | [
"Creates",
"a",
"ExponentialTimeout",
"object",
"given",
"a",
"gapic",
"retry",
"configuration",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/config.py#L82-L107 |
27,836 | googleapis/google-cloud-python | api_core/google/api_core/gapic_v1/config.py | parse_method_configs | def parse_method_configs(interface_config):
"""Creates default retry and timeout objects for each method in a gapic
interface config.
Args:
interface_config (Mapping): The interface config section of the full
gapic library config. For example, If the full configuration has
a... | python | def parse_method_configs(interface_config):
"""Creates default retry and timeout objects for each method in a gapic
interface config.
Args:
interface_config (Mapping): The interface config section of the full
gapic library config. For example, If the full configuration has
a... | [
"def",
"parse_method_configs",
"(",
"interface_config",
")",
":",
"# Grab all the retry codes",
"retry_codes_map",
"=",
"{",
"name",
":",
"retry_codes",
"for",
"name",
",",
"retry_codes",
"in",
"six",
".",
"iteritems",
"(",
"interface_config",
".",
"get",
"(",
"\"... | Creates default retry and timeout objects for each method in a gapic
interface config.
Args:
interface_config (Mapping): The interface config section of the full
gapic library config. For example, If the full configuration has
an interface named ``google.example.v1.ExampleServic... | [
"Creates",
"default",
"retry",
"and",
"timeout",
"objects",
"for",
"each",
"method",
"in",
"a",
"gapic",
"interface",
"config",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/gapic_v1/config.py#L113-L167 |
27,837 | googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/futures.py | Future.done | def done(self):
"""Return True the future is done, False otherwise.
This still returns True in failure cases; checking :meth:`result` or
:meth:`exception` is the canonical way to assess success or failure.
"""
return self._exception != self._SENTINEL or self._result != self._SEN... | python | def done(self):
"""Return True the future is done, False otherwise.
This still returns True in failure cases; checking :meth:`result` or
:meth:`exception` is the canonical way to assess success or failure.
"""
return self._exception != self._SENTINEL or self._result != self._SEN... | [
"def",
"done",
"(",
"self",
")",
":",
"return",
"self",
".",
"_exception",
"!=",
"self",
".",
"_SENTINEL",
"or",
"self",
".",
"_result",
"!=",
"self",
".",
"_SENTINEL"
] | Return True the future is done, False otherwise.
This still returns True in failure cases; checking :meth:`result` or
:meth:`exception` is the canonical way to assess success or failure. | [
"Return",
"True",
"the",
"future",
"is",
"done",
"False",
"otherwise",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L81-L87 |
27,838 | googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/futures.py | Future.exception | def exception(self, timeout=None):
"""Return the exception raised by the call, if any.
This blocks until the message has successfully been published, and
returns the exception. If the call succeeded, return None.
Args:
timeout (Union[int, float]): The number of seconds befo... | python | def exception(self, timeout=None):
"""Return the exception raised by the call, if any.
This blocks until the message has successfully been published, and
returns the exception. If the call succeeded, return None.
Args:
timeout (Union[int, float]): The number of seconds befo... | [
"def",
"exception",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"# Wait until the future is done.",
"if",
"not",
"self",
".",
"_completed",
".",
"wait",
"(",
"timeout",
"=",
"timeout",
")",
":",
"raise",
"exceptions",
".",
"TimeoutError",
"(",
"\"Tim... | Return the exception raised by the call, if any.
This blocks until the message has successfully been published, and
returns the exception. If the call succeeded, return None.
Args:
timeout (Union[int, float]): The number of seconds before this call
times out and rai... | [
"Return",
"the",
"exception",
"raised",
"by",
"the",
"call",
"if",
"any",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L115-L140 |
27,839 | googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/futures.py | Future.add_done_callback | def add_done_callback(self, fn):
"""Attach the provided callable to the future.
The provided function is called, with this future as its only argument,
when the future finishes running.
"""
if self.done():
return fn(self)
self._callbacks.append(fn) | python | def add_done_callback(self, fn):
"""Attach the provided callable to the future.
The provided function is called, with this future as its only argument,
when the future finishes running.
"""
if self.done():
return fn(self)
self._callbacks.append(fn) | [
"def",
"add_done_callback",
"(",
"self",
",",
"fn",
")",
":",
"if",
"self",
".",
"done",
"(",
")",
":",
"return",
"fn",
"(",
"self",
")",
"self",
".",
"_callbacks",
".",
"append",
"(",
"fn",
")"
] | Attach the provided callable to the future.
The provided function is called, with this future as its only argument,
when the future finishes running. | [
"Attach",
"the",
"provided",
"callable",
"to",
"the",
"future",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L142-L150 |
27,840 | googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/futures.py | Future.set_result | def set_result(self, result):
"""Set the result of the future to the provided result.
Args:
result (Any): The result
"""
# Sanity check: A future can only complete once.
if self.done():
raise RuntimeError("set_result can only be called once.")
# ... | python | def set_result(self, result):
"""Set the result of the future to the provided result.
Args:
result (Any): The result
"""
# Sanity check: A future can only complete once.
if self.done():
raise RuntimeError("set_result can only be called once.")
# ... | [
"def",
"set_result",
"(",
"self",
",",
"result",
")",
":",
"# Sanity check: A future can only complete once.",
"if",
"self",
".",
"done",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"\"set_result can only be called once.\"",
")",
"# Set the result and trigger the future.",... | Set the result of the future to the provided result.
Args:
result (Any): The result | [
"Set",
"the",
"result",
"of",
"the",
"future",
"to",
"the",
"provided",
"result",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L152-L164 |
27,841 | googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/futures.py | Future.set_exception | def set_exception(self, exception):
"""Set the result of the future to the given exception.
Args:
exception (:exc:`Exception`): The exception raised.
"""
# Sanity check: A future can only complete once.
if self.done():
raise RuntimeError("set_exception ca... | python | def set_exception(self, exception):
"""Set the result of the future to the given exception.
Args:
exception (:exc:`Exception`): The exception raised.
"""
# Sanity check: A future can only complete once.
if self.done():
raise RuntimeError("set_exception ca... | [
"def",
"set_exception",
"(",
"self",
",",
"exception",
")",
":",
"# Sanity check: A future can only complete once.",
"if",
"self",
".",
"done",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"\"set_exception can only be called once.\"",
")",
"# Set the exception and trigger t... | Set the result of the future to the given exception.
Args:
exception (:exc:`Exception`): The exception raised. | [
"Set",
"the",
"result",
"of",
"the",
"future",
"to",
"the",
"given",
"exception",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L166-L178 |
27,842 | googleapis/google-cloud-python | pubsub/google/cloud/pubsub_v1/futures.py | Future._trigger | def _trigger(self):
"""Trigger all callbacks registered to this Future.
This method is called internally by the batch once the batch
completes.
Args:
message_id (str): The message ID, as a string.
"""
self._completed.set()
for callback in self._callb... | python | def _trigger(self):
"""Trigger all callbacks registered to this Future.
This method is called internally by the batch once the batch
completes.
Args:
message_id (str): The message ID, as a string.
"""
self._completed.set()
for callback in self._callb... | [
"def",
"_trigger",
"(",
"self",
")",
":",
"self",
".",
"_completed",
".",
"set",
"(",
")",
"for",
"callback",
"in",
"self",
".",
"_callbacks",
":",
"callback",
"(",
"self",
")"
] | Trigger all callbacks registered to this Future.
This method is called internally by the batch once the batch
completes.
Args:
message_id (str): The message ID, as a string. | [
"Trigger",
"all",
"callbacks",
"registered",
"to",
"this",
"Future",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/pubsub/google/cloud/pubsub_v1/futures.py#L180-L191 |
27,843 | googleapis/google-cloud-python | bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py | BigQueryStorageClient.create_read_session | def create_read_session(
self,
table_reference,
parent,
table_modifiers=None,
requested_streams=None,
read_options=None,
format_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=... | python | def create_read_session(
self,
table_reference,
parent,
table_modifiers=None,
requested_streams=None,
read_options=None,
format_=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=... | [
"def",
"create_read_session",
"(",
"self",
",",
"table_reference",
",",
"parent",
",",
"table_modifiers",
"=",
"None",
",",
"requested_streams",
"=",
"None",
",",
"read_options",
"=",
"None",
",",
"format_",
"=",
"None",
",",
"retry",
"=",
"google",
".",
"ap... | Creates a new read session. A read session divides the contents of a
BigQuery table into one or more streams, which can then be used to read
data from the table. The read session also specifies properties of the
data to be read, such as a list of columns or a push-down filter describing
... | [
"Creates",
"a",
"new",
"read",
"session",
".",
"A",
"read",
"session",
"divides",
"the",
"contents",
"of",
"a",
"BigQuery",
"table",
"into",
"one",
"or",
"more",
"streams",
"which",
"can",
"then",
"be",
"used",
"to",
"read",
"data",
"from",
"the",
"table... | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py#L179-L298 |
27,844 | googleapis/google-cloud-python | bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py | BigQueryStorageClient.batch_create_read_session_streams | def batch_create_read_session_streams(
self,
session,
requested_streams,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates additional streams for a ReadSession. This API can be... | python | def batch_create_read_session_streams(
self,
session,
requested_streams,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Creates additional streams for a ReadSession. This API can be... | [
"def",
"batch_create_read_session_streams",
"(",
"self",
",",
"session",
",",
"requested_streams",
",",
"retry",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".",
"method",
".",
"DEFAULT",
",",
"timeout",
"=",
"google",
".",
"api_core",
".",
"gapic_v1",
".... | Creates additional streams for a ReadSession. This API can be used to
dynamically adjust the parallelism of a batch processing task upwards by
adding additional workers.
Example:
>>> from google.cloud import bigquery_storage_v1beta1
>>>
>>> client = bigquery_... | [
"Creates",
"additional",
"streams",
"for",
"a",
"ReadSession",
".",
"This",
"API",
"can",
"be",
"used",
"to",
"dynamically",
"adjust",
"the",
"parallelism",
"of",
"a",
"batch",
"processing",
"task",
"upwards",
"by",
"adding",
"additional",
"workers",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py#L385-L472 |
27,845 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/external_config.py | ExternalConfig.to_api_repr | def to_api_repr(self):
"""Build an API representation of this object.
Returns:
Dict[str, Any]:
A dictionary in the format used by the BigQuery API.
"""
config = copy.deepcopy(self._properties)
if self.options is not None:
r = self.options.... | python | def to_api_repr(self):
"""Build an API representation of this object.
Returns:
Dict[str, Any]:
A dictionary in the format used by the BigQuery API.
"""
config = copy.deepcopy(self._properties)
if self.options is not None:
r = self.options.... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"config",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"_properties",
")",
"if",
"self",
".",
"options",
"is",
"not",
"None",
":",
"r",
"=",
"self",
".",
"options",
".",
"to_api_repr",
"(",
")",
"if",
... | Build an API representation of this object.
Returns:
Dict[str, Any]:
A dictionary in the format used by the BigQuery API. | [
"Build",
"an",
"API",
"representation",
"of",
"this",
"object",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/external_config.py#L682-L694 |
27,846 | googleapis/google-cloud-python | bigquery_storage/noxfile.py | lint | def lint(session):
"""Run linters.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install('flake8', *LOCAL_DEPS)
session.install('-e', '.')
session.run(
'flake8', os.path.join('google', 'cloud', 'bigquery_storage_v1beta1... | python | def lint(session):
"""Run linters.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install('flake8', *LOCAL_DEPS)
session.install('-e', '.')
session.run(
'flake8', os.path.join('google', 'cloud', 'bigquery_storage_v1beta1... | [
"def",
"lint",
"(",
"session",
")",
":",
"session",
".",
"install",
"(",
"'flake8'",
",",
"*",
"LOCAL_DEPS",
")",
"session",
".",
"install",
"(",
"'-e'",
",",
"'.'",
")",
"session",
".",
"run",
"(",
"'flake8'",
",",
"os",
".",
"path",
".",
"join",
... | Run linters.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues. | [
"Run",
"linters",
".",
"Returns",
"a",
"failure",
"if",
"the",
"linters",
"find",
"linting",
"errors",
"or",
"sufficiently",
"serious",
"code",
"quality",
"issues",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery_storage/noxfile.py#L63-L73 |
27,847 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | _enum_from_op_string | def _enum_from_op_string(op_string):
"""Convert a string representation of a binary operator to an enum.
These enums come from the protobuf message definition
``StructuredQuery.FieldFilter.Operator``.
Args:
op_string (str): A comparison operation in the form of a string.
Acceptable... | python | def _enum_from_op_string(op_string):
"""Convert a string representation of a binary operator to an enum.
These enums come from the protobuf message definition
``StructuredQuery.FieldFilter.Operator``.
Args:
op_string (str): A comparison operation in the form of a string.
Acceptable... | [
"def",
"_enum_from_op_string",
"(",
"op_string",
")",
":",
"try",
":",
"return",
"_COMPARISON_OPERATORS",
"[",
"op_string",
"]",
"except",
"KeyError",
":",
"choices",
"=",
"\", \"",
".",
"join",
"(",
"sorted",
"(",
"_COMPARISON_OPERATORS",
".",
"keys",
"(",
")... | Convert a string representation of a binary operator to an enum.
These enums come from the protobuf message definition
``StructuredQuery.FieldFilter.Operator``.
Args:
op_string (str): A comparison operation in the form of a string.
Acceptable values are ``<``, ``<=``, ``==``, ``>=``
... | [
"Convert",
"a",
"string",
"representation",
"of",
"a",
"binary",
"operator",
"to",
"an",
"enum",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L825-L847 |
27,848 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | _enum_from_direction | def _enum_from_direction(direction):
"""Convert a string representation of a direction to an enum.
Args:
direction (str): A direction to order by. Must be one of
:attr:`~.firestore.Query.ASCENDING` or
:attr:`~.firestore.Query.DESCENDING`.
Returns:
int: The enum corr... | python | def _enum_from_direction(direction):
"""Convert a string representation of a direction to an enum.
Args:
direction (str): A direction to order by. Must be one of
:attr:`~.firestore.Query.ASCENDING` or
:attr:`~.firestore.Query.DESCENDING`.
Returns:
int: The enum corr... | [
"def",
"_enum_from_direction",
"(",
"direction",
")",
":",
"if",
"isinstance",
"(",
"direction",
",",
"int",
")",
":",
"return",
"direction",
"if",
"direction",
"==",
"Query",
".",
"ASCENDING",
":",
"return",
"enums",
".",
"StructuredQuery",
".",
"Direction",
... | Convert a string representation of a direction to an enum.
Args:
direction (str): A direction to order by. Must be one of
:attr:`~.firestore.Query.ASCENDING` or
:attr:`~.firestore.Query.DESCENDING`.
Returns:
int: The enum corresponding to ``direction``.
Raises:
... | [
"Convert",
"a",
"string",
"representation",
"of",
"a",
"direction",
"to",
"an",
"enum",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L868-L891 |
27,849 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | _filter_pb | def _filter_pb(field_or_unary):
"""Convert a specific protobuf filter to the generic filter type.
Args:
field_or_unary (Union[google.cloud.proto.firestore.v1beta1.\
query_pb2.StructuredQuery.FieldFilter, google.cloud.proto.\
firestore.v1beta1.query_pb2.StructuredQuery.FieldFilte... | python | def _filter_pb(field_or_unary):
"""Convert a specific protobuf filter to the generic filter type.
Args:
field_or_unary (Union[google.cloud.proto.firestore.v1beta1.\
query_pb2.StructuredQuery.FieldFilter, google.cloud.proto.\
firestore.v1beta1.query_pb2.StructuredQuery.FieldFilte... | [
"def",
"_filter_pb",
"(",
"field_or_unary",
")",
":",
"if",
"isinstance",
"(",
"field_or_unary",
",",
"query_pb2",
".",
"StructuredQuery",
".",
"FieldFilter",
")",
":",
"return",
"query_pb2",
".",
"StructuredQuery",
".",
"Filter",
"(",
"field_filter",
"=",
"fiel... | Convert a specific protobuf filter to the generic filter type.
Args:
field_or_unary (Union[google.cloud.proto.firestore.v1beta1.\
query_pb2.StructuredQuery.FieldFilter, google.cloud.proto.\
firestore.v1beta1.query_pb2.StructuredQuery.FieldFilter]): A
field or unary filte... | [
"Convert",
"a",
"specific",
"protobuf",
"filter",
"to",
"the",
"generic",
"filter",
"type",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L894-L915 |
27,850 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | _cursor_pb | def _cursor_pb(cursor_pair):
"""Convert a cursor pair to a protobuf.
If ``cursor_pair`` is :data:`None`, just returns :data:`None`.
Args:
cursor_pair (Optional[Tuple[list, bool]]): Two-tuple of
* a list of field values.
* a ``before`` flag
Returns:
Optional[go... | python | def _cursor_pb(cursor_pair):
"""Convert a cursor pair to a protobuf.
If ``cursor_pair`` is :data:`None`, just returns :data:`None`.
Args:
cursor_pair (Optional[Tuple[list, bool]]): Two-tuple of
* a list of field values.
* a ``before`` flag
Returns:
Optional[go... | [
"def",
"_cursor_pb",
"(",
"cursor_pair",
")",
":",
"if",
"cursor_pair",
"is",
"not",
"None",
":",
"data",
",",
"before",
"=",
"cursor_pair",
"value_pbs",
"=",
"[",
"_helpers",
".",
"encode_value",
"(",
"value",
")",
"for",
"value",
"in",
"data",
"]",
"re... | Convert a cursor pair to a protobuf.
If ``cursor_pair`` is :data:`None`, just returns :data:`None`.
Args:
cursor_pair (Optional[Tuple[list, bool]]): Two-tuple of
* a list of field values.
* a ``before`` flag
Returns:
Optional[google.cloud.firestore_v1beta1.types.C... | [
"Convert",
"a",
"cursor",
"pair",
"to",
"a",
"protobuf",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L918-L936 |
27,851 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | _query_response_to_snapshot | def _query_response_to_snapshot(response_pb, collection, expected_prefix):
"""Parse a query response protobuf to a document snapshot.
Args:
response_pb (google.cloud.proto.firestore.v1beta1.\
firestore_pb2.RunQueryResponse): A
collection (~.firestore_v1beta1.collection.CollectionRef... | python | def _query_response_to_snapshot(response_pb, collection, expected_prefix):
"""Parse a query response protobuf to a document snapshot.
Args:
response_pb (google.cloud.proto.firestore.v1beta1.\
firestore_pb2.RunQueryResponse): A
collection (~.firestore_v1beta1.collection.CollectionRef... | [
"def",
"_query_response_to_snapshot",
"(",
"response_pb",
",",
"collection",
",",
"expected_prefix",
")",
":",
"if",
"not",
"response_pb",
".",
"HasField",
"(",
"\"document\"",
")",
":",
"return",
"None",
"document_id",
"=",
"_helpers",
".",
"get_doc_id",
"(",
"... | Parse a query response protobuf to a document snapshot.
Args:
response_pb (google.cloud.proto.firestore.v1beta1.\
firestore_pb2.RunQueryResponse): A
collection (~.firestore_v1beta1.collection.CollectionReference): A
reference to the collection that initiated the query.
... | [
"Parse",
"a",
"query",
"response",
"protobuf",
"to",
"a",
"document",
"snapshot",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L939-L970 |
27,852 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.select | def select(self, field_paths):
"""Project documents matching query to a limited set of fields.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
If the current query already has a projection set (i.e. has already
called :meth:`~.f... | python | def select(self, field_paths):
"""Project documents matching query to a limited set of fields.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
If the current query already has a projection set (i.e. has already
called :meth:`~.f... | [
"def",
"select",
"(",
"self",
",",
"field_paths",
")",
":",
"field_paths",
"=",
"list",
"(",
"field_paths",
")",
"for",
"field_path",
"in",
"field_paths",
":",
"field_path_module",
".",
"split_field_path",
"(",
"field_path",
")",
"# raises",
"new_projection",
"=... | Project documents matching query to a limited set of fields.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
If the current query already has a projection set (i.e. has already
called :meth:`~.firestore_v1beta1.query.Query.select`), thi... | [
"Project",
"documents",
"matching",
"query",
"to",
"a",
"limited",
"set",
"of",
"fields",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L165-L206 |
27,853 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.where | def where(self, field_path, op_string, value):
"""Filter the query on a field.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
Returns a new :class:`~.firestore_v1beta1.query.Query` that
filters on a specific field path, accordi... | python | def where(self, field_path, op_string, value):
"""Filter the query on a field.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
Returns a new :class:`~.firestore_v1beta1.query.Query` that
filters on a specific field path, accordi... | [
"def",
"where",
"(",
"self",
",",
"field_path",
",",
"op_string",
",",
"value",
")",
":",
"field_path_module",
".",
"split_field_path",
"(",
"field_path",
")",
"# raises",
"if",
"value",
"is",
"None",
":",
"if",
"op_string",
"!=",
"_EQ_OP",
":",
"raise",
"... | Filter the query on a field.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
Returns a new :class:`~.firestore_v1beta1.query.Query` that
filters on a specific field path, according to an operation (e.g.
``==`` or "equals") and a... | [
"Filter",
"the",
"query",
"on",
"a",
"field",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L208-L273 |
27,854 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.order_by | def order_by(self, field_path, direction=ASCENDING):
"""Modify the query to add an order clause on a specific field.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
Successive :meth:`~.firestore_v1beta1.query.Query.order_by` calls
... | python | def order_by(self, field_path, direction=ASCENDING):
"""Modify the query to add an order clause on a specific field.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
Successive :meth:`~.firestore_v1beta1.query.Query.order_by` calls
... | [
"def",
"order_by",
"(",
"self",
",",
"field_path",
",",
"direction",
"=",
"ASCENDING",
")",
":",
"field_path_module",
".",
"split_field_path",
"(",
"field_path",
")",
"# raises",
"order_pb",
"=",
"self",
".",
"_make_order",
"(",
"field_path",
",",
"direction",
... | Modify the query to add an order clause on a specific field.
See :meth:`~.firestore_v1beta1.client.Client.field_path` for
more information on **field paths**.
Successive :meth:`~.firestore_v1beta1.query.Query.order_by` calls
will further refine the ordering of results returned by the q... | [
"Modify",
"the",
"query",
"to",
"add",
"an",
"order",
"clause",
"on",
"a",
"specific",
"field",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L283-L324 |
27,855 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.limit | def limit(self, count):
"""Limit a query to return a fixed number of results.
If the current query already has a limit set, this will overwrite it.
Args:
count (int): Maximum number of documents to return that match
the query.
Returns:
~.firesto... | python | def limit(self, count):
"""Limit a query to return a fixed number of results.
If the current query already has a limit set, this will overwrite it.
Args:
count (int): Maximum number of documents to return that match
the query.
Returns:
~.firesto... | [
"def",
"limit",
"(",
"self",
",",
"count",
")",
":",
"return",
"self",
".",
"__class__",
"(",
"self",
".",
"_parent",
",",
"projection",
"=",
"self",
".",
"_projection",
",",
"field_filters",
"=",
"self",
".",
"_field_filters",
",",
"orders",
"=",
"self"... | Limit a query to return a fixed number of results.
If the current query already has a limit set, this will overwrite it.
Args:
count (int): Maximum number of documents to return that match
the query.
Returns:
~.firestore_v1beta1.query.Query: A limited q... | [
"Limit",
"a",
"query",
"to",
"return",
"a",
"fixed",
"number",
"of",
"results",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L326-L349 |
27,856 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.offset | def offset(self, num_to_skip):
"""Skip to an offset in a query.
If the current query already has specified an offset, this will
overwrite it.
Args:
num_to_skip (int): The number of results to skip at the beginning
of query results. (Must be non-negative.)
... | python | def offset(self, num_to_skip):
"""Skip to an offset in a query.
If the current query already has specified an offset, this will
overwrite it.
Args:
num_to_skip (int): The number of results to skip at the beginning
of query results. (Must be non-negative.)
... | [
"def",
"offset",
"(",
"self",
",",
"num_to_skip",
")",
":",
"return",
"self",
".",
"__class__",
"(",
"self",
".",
"_parent",
",",
"projection",
"=",
"self",
".",
"_projection",
",",
"field_filters",
"=",
"self",
".",
"_field_filters",
",",
"orders",
"=",
... | Skip to an offset in a query.
If the current query already has specified an offset, this will
overwrite it.
Args:
num_to_skip (int): The number of results to skip at the beginning
of query results. (Must be non-negative.)
Returns:
~.firestore_v1... | [
"Skip",
"to",
"an",
"offset",
"in",
"a",
"query",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L351-L375 |
27,857 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query._cursor_helper | def _cursor_helper(self, document_fields, before, start):
"""Set values to be used for a ``start_at`` or ``end_at`` cursor.
The values will later be used in a query protobuf.
When the query is sent to the server, the ``document_fields`` will
be used in the order given by fields set by
... | python | def _cursor_helper(self, document_fields, before, start):
"""Set values to be used for a ``start_at`` or ``end_at`` cursor.
The values will later be used in a query protobuf.
When the query is sent to the server, the ``document_fields`` will
be used in the order given by fields set by
... | [
"def",
"_cursor_helper",
"(",
"self",
",",
"document_fields",
",",
"before",
",",
"start",
")",
":",
"if",
"isinstance",
"(",
"document_fields",
",",
"tuple",
")",
":",
"document_fields",
"=",
"list",
"(",
"document_fields",
")",
"elif",
"isinstance",
"(",
"... | Set values to be used for a ``start_at`` or ``end_at`` cursor.
The values will later be used in a query protobuf.
When the query is sent to the server, the ``document_fields`` will
be used in the order given by fields set by
:meth:`~.firestore_v1beta1.query.Query.order_by`.
Ar... | [
"Set",
"values",
"to",
"be",
"used",
"for",
"a",
"start_at",
"or",
"end_at",
"cursor",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L377-L429 |
27,858 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.start_at | def start_at(self, document_fields):
"""Start query results at a particular document value.
The result set will **include** the document specified by
``document_fields``.
If the current query already has specified a start cursor -- either
via this method or
:meth:`~.fir... | python | def start_at(self, document_fields):
"""Start query results at a particular document value.
The result set will **include** the document specified by
``document_fields``.
If the current query already has specified a start cursor -- either
via this method or
:meth:`~.fir... | [
"def",
"start_at",
"(",
"self",
",",
"document_fields",
")",
":",
"return",
"self",
".",
"_cursor_helper",
"(",
"document_fields",
",",
"before",
"=",
"True",
",",
"start",
"=",
"True",
")"
] | Start query results at a particular document value.
The result set will **include** the document specified by
``document_fields``.
If the current query already has specified a start cursor -- either
via this method or
:meth:`~.firestore_v1beta1.query.Query.start_after` -- this ... | [
"Start",
"query",
"results",
"at",
"a",
"particular",
"document",
"value",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L431-L458 |
27,859 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.start_after | def start_after(self, document_fields):
"""Start query results after a particular document value.
The result set will **exclude** the document specified by
``document_fields``.
If the current query already has specified a start cursor -- either
via this method or
:meth:... | python | def start_after(self, document_fields):
"""Start query results after a particular document value.
The result set will **exclude** the document specified by
``document_fields``.
If the current query already has specified a start cursor -- either
via this method or
:meth:... | [
"def",
"start_after",
"(",
"self",
",",
"document_fields",
")",
":",
"return",
"self",
".",
"_cursor_helper",
"(",
"document_fields",
",",
"before",
"=",
"False",
",",
"start",
"=",
"True",
")"
] | Start query results after a particular document value.
The result set will **exclude** the document specified by
``document_fields``.
If the current query already has specified a start cursor -- either
via this method or
:meth:`~.firestore_v1beta1.query.Query.start_at` -- this ... | [
"Start",
"query",
"results",
"after",
"a",
"particular",
"document",
"value",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L460-L487 |
27,860 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.end_before | def end_before(self, document_fields):
"""End query results before a particular document value.
The result set will **exclude** the document specified by
``document_fields``.
If the current query already has specified an end cursor -- either
via this method or
:meth:`~.... | python | def end_before(self, document_fields):
"""End query results before a particular document value.
The result set will **exclude** the document specified by
``document_fields``.
If the current query already has specified an end cursor -- either
via this method or
:meth:`~.... | [
"def",
"end_before",
"(",
"self",
",",
"document_fields",
")",
":",
"return",
"self",
".",
"_cursor_helper",
"(",
"document_fields",
",",
"before",
"=",
"True",
",",
"start",
"=",
"False",
")"
] | End query results before a particular document value.
The result set will **exclude** the document specified by
``document_fields``.
If the current query already has specified an end cursor -- either
via this method or
:meth:`~.firestore_v1beta1.query.Query.end_at` -- this will... | [
"End",
"query",
"results",
"before",
"a",
"particular",
"document",
"value",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L489-L516 |
27,861 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.end_at | def end_at(self, document_fields):
"""End query results at a particular document value.
The result set will **include** the document specified by
``document_fields``.
If the current query already has specified an end cursor -- either
via this method or
:meth:`~.firestor... | python | def end_at(self, document_fields):
"""End query results at a particular document value.
The result set will **include** the document specified by
``document_fields``.
If the current query already has specified an end cursor -- either
via this method or
:meth:`~.firestor... | [
"def",
"end_at",
"(",
"self",
",",
"document_fields",
")",
":",
"return",
"self",
".",
"_cursor_helper",
"(",
"document_fields",
",",
"before",
"=",
"False",
",",
"start",
"=",
"False",
")"
] | End query results at a particular document value.
The result set will **include** the document specified by
``document_fields``.
If the current query already has specified an end cursor -- either
via this method or
:meth:`~.firestore_v1beta1.query.Query.end_before` -- this will... | [
"End",
"query",
"results",
"at",
"a",
"particular",
"document",
"value",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L518-L545 |
27,862 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query._filters_pb | def _filters_pb(self):
"""Convert all the filters into a single generic Filter protobuf.
This may be a lone field filter or unary filter, may be a composite
filter or may be :data:`None`.
Returns:
google.cloud.firestore_v1beta1.types.\
StructuredQuery.Filter: A ... | python | def _filters_pb(self):
"""Convert all the filters into a single generic Filter protobuf.
This may be a lone field filter or unary filter, may be a composite
filter or may be :data:`None`.
Returns:
google.cloud.firestore_v1beta1.types.\
StructuredQuery.Filter: A ... | [
"def",
"_filters_pb",
"(",
"self",
")",
":",
"num_filters",
"=",
"len",
"(",
"self",
".",
"_field_filters",
")",
"if",
"num_filters",
"==",
"0",
":",
"return",
"None",
"elif",
"num_filters",
"==",
"1",
":",
"return",
"_filter_pb",
"(",
"self",
".",
"_fie... | Convert all the filters into a single generic Filter protobuf.
This may be a lone field filter or unary filter, may be a composite
filter or may be :data:`None`.
Returns:
google.cloud.firestore_v1beta1.types.\
StructuredQuery.Filter: A "generic" filter representing the
... | [
"Convert",
"all",
"the",
"filters",
"into",
"a",
"single",
"generic",
"Filter",
"protobuf",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L547-L568 |
27,863 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query._to_protobuf | def _to_protobuf(self):
"""Convert the current query into the equivalent protobuf.
Returns:
google.cloud.firestore_v1beta1.types.StructuredQuery: The
query protobuf.
"""
projection = self._normalize_projection(self._projection)
orders = self._normalize_or... | python | def _to_protobuf(self):
"""Convert the current query into the equivalent protobuf.
Returns:
google.cloud.firestore_v1beta1.types.StructuredQuery: The
query protobuf.
"""
projection = self._normalize_projection(self._projection)
orders = self._normalize_or... | [
"def",
"_to_protobuf",
"(",
"self",
")",
":",
"projection",
"=",
"self",
".",
"_normalize_projection",
"(",
"self",
".",
"_projection",
")",
"orders",
"=",
"self",
".",
"_normalize_orders",
"(",
")",
"start_at",
"=",
"self",
".",
"_normalize_cursor",
"(",
"s... | Convert the current query into the equivalent protobuf.
Returns:
google.cloud.firestore_v1beta1.types.StructuredQuery: The
query protobuf. | [
"Convert",
"the",
"current",
"query",
"into",
"the",
"equivalent",
"protobuf",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L666-L695 |
27,864 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.stream | def stream(self, transaction=None):
"""Read the documents in the collection that match this query.
This sends a ``RunQuery`` RPC and then returns an iterator which
consumes each document returned in the stream of ``RunQueryResponse``
messages.
.. note::
The underlyi... | python | def stream(self, transaction=None):
"""Read the documents in the collection that match this query.
This sends a ``RunQuery`` RPC and then returns an iterator which
consumes each document returned in the stream of ``RunQueryResponse``
messages.
.. note::
The underlyi... | [
"def",
"stream",
"(",
"self",
",",
"transaction",
"=",
"None",
")",
":",
"parent_path",
",",
"expected_prefix",
"=",
"self",
".",
"_parent",
".",
"_parent_info",
"(",
")",
"response_iterator",
"=",
"self",
".",
"_client",
".",
"_firestore_api",
".",
"run_que... | Read the documents in the collection that match this query.
This sends a ``RunQuery`` RPC and then returns an iterator which
consumes each document returned in the stream of ``RunQueryResponse``
messages.
.. note::
The underlying stream of responses will time out after
... | [
"Read",
"the",
"documents",
"in",
"the",
"collection",
"that",
"match",
"this",
"query",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L706-L746 |
27,865 | googleapis/google-cloud-python | firestore/google/cloud/firestore_v1beta1/query.py | Query.on_snapshot | def on_snapshot(self, callback):
"""Monitor the documents in this collection that match this query.
This starts a watch on this query using a background thread. The
provided callback is run on the snapshot of the documents.
Args:
callback(~.firestore.query.QuerySnapshot): a... | python | def on_snapshot(self, callback):
"""Monitor the documents in this collection that match this query.
This starts a watch on this query using a background thread. The
provided callback is run on the snapshot of the documents.
Args:
callback(~.firestore.query.QuerySnapshot): a... | [
"def",
"on_snapshot",
"(",
"self",
",",
"callback",
")",
":",
"return",
"Watch",
".",
"for_query",
"(",
"self",
",",
"callback",
",",
"document",
".",
"DocumentSnapshot",
",",
"document",
".",
"DocumentReference",
")"
] | Monitor the documents in this collection that match this query.
This starts a watch on this query using a background thread. The
provided callback is run on the snapshot of the documents.
Args:
callback(~.firestore.query.QuerySnapshot): a callback to run when
a chan... | [
"Monitor",
"the",
"documents",
"in",
"this",
"collection",
"that",
"match",
"this",
"query",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/firestore/google/cloud/firestore_v1beta1/query.py#L748-L776 |
27,866 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/dataset.py | _get_model_reference | def _get_model_reference(self, model_id):
"""Constructs a ModelReference.
Args:
model_id (str): the ID of the model.
Returns:
google.cloud.bigquery.model.ModelReference:
A ModelReference for a model in this dataset.
"""
return ModelReference.from_api_repr(
{"pro... | python | def _get_model_reference(self, model_id):
"""Constructs a ModelReference.
Args:
model_id (str): the ID of the model.
Returns:
google.cloud.bigquery.model.ModelReference:
A ModelReference for a model in this dataset.
"""
return ModelReference.from_api_repr(
{"pro... | [
"def",
"_get_model_reference",
"(",
"self",
",",
"model_id",
")",
":",
"return",
"ModelReference",
".",
"from_api_repr",
"(",
"{",
"\"projectId\"",
":",
"self",
".",
"project",
",",
"\"datasetId\"",
":",
"self",
".",
"dataset_id",
",",
"\"modelId\"",
":",
"mod... | Constructs a ModelReference.
Args:
model_id (str): the ID of the model.
Returns:
google.cloud.bigquery.model.ModelReference:
A ModelReference for a model in this dataset. | [
"Constructs",
"a",
"ModelReference",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L41-L53 |
27,867 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/dataset.py | AccessEntry.to_api_repr | def to_api_repr(self):
"""Construct the API resource representation of this access entry
Returns:
Dict[str, object]: Access entry represented as an API resource
"""
resource = {self.entity_type: self.entity_id}
if self.role is not None:
resource["role"] =... | python | def to_api_repr(self):
"""Construct the API resource representation of this access entry
Returns:
Dict[str, object]: Access entry represented as an API resource
"""
resource = {self.entity_type: self.entity_id}
if self.role is not None:
resource["role"] =... | [
"def",
"to_api_repr",
"(",
"self",
")",
":",
"resource",
"=",
"{",
"self",
".",
"entity_type",
":",
"self",
".",
"entity_id",
"}",
"if",
"self",
".",
"role",
"is",
"not",
"None",
":",
"resource",
"[",
"\"role\"",
"]",
"=",
"self",
".",
"role",
"retur... | Construct the API resource representation of this access entry
Returns:
Dict[str, object]: Access entry represented as an API resource | [
"Construct",
"the",
"API",
"resource",
"representation",
"of",
"this",
"access",
"entry"
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L150-L159 |
27,868 | googleapis/google-cloud-python | bigquery/google/cloud/bigquery/dataset.py | DatasetReference.from_string | def from_string(cls, dataset_id, default_project=None):
"""Construct a dataset reference from dataset ID string.
Args:
dataset_id (str):
A dataset ID in standard SQL format. If ``default_project``
is not specified, this must included both the project ID and
... | python | def from_string(cls, dataset_id, default_project=None):
"""Construct a dataset reference from dataset ID string.
Args:
dataset_id (str):
A dataset ID in standard SQL format. If ``default_project``
is not specified, this must included both the project ID and
... | [
"def",
"from_string",
"(",
"cls",
",",
"dataset_id",
",",
"default_project",
"=",
"None",
")",
":",
"output_dataset_id",
"=",
"dataset_id",
"output_project_id",
"=",
"default_project",
"parts",
"=",
"dataset_id",
".",
"split",
"(",
"\".\"",
")",
"if",
"len",
"... | Construct a dataset reference from dataset ID string.
Args:
dataset_id (str):
A dataset ID in standard SQL format. If ``default_project``
is not specified, this must included both the project ID and
the dataset ID, separated by ``.``.
defa... | [
"Construct",
"a",
"dataset",
"reference",
"from",
"dataset",
"ID",
"string",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/bigquery/google/cloud/bigquery/dataset.py#L244-L288 |
27,869 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | _item_to_blob | def _item_to_blob(iterator, item):
"""Convert a JSON blob to the native object.
.. note::
This assumes that the ``bucket`` attribute has been
added to the iterator after being created.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that ... | python | def _item_to_blob(iterator, item):
"""Convert a JSON blob to the native object.
.. note::
This assumes that the ``bucket`` attribute has been
added to the iterator after being created.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that ... | [
"def",
"_item_to_blob",
"(",
"iterator",
",",
"item",
")",
":",
"name",
"=",
"item",
".",
"get",
"(",
"\"name\"",
")",
"blob",
"=",
"Blob",
"(",
"name",
",",
"bucket",
"=",
"iterator",
".",
"bucket",
")",
"blob",
".",
"_set_properties",
"(",
"item",
... | Convert a JSON blob to the native object.
.. note::
This assumes that the ``bucket`` attribute has been
added to the iterator after being created.
:type iterator: :class:`~google.api_core.page_iterator.Iterator`
:param iterator: The iterator that has retrieved the item.
:type item: d... | [
"Convert",
"a",
"JSON",
"blob",
"to",
"the",
"native",
"object",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L69-L89 |
27,870 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket._set_properties | def _set_properties(self, value):
"""Set the properties for the current object.
:type value: dict or :class:`google.cloud.storage.batch._FutureDict`
:param value: The properties to be set.
"""
self._label_removals.clear()
return super(Bucket, self)._set_properties(value) | python | def _set_properties(self, value):
"""Set the properties for the current object.
:type value: dict or :class:`google.cloud.storage.batch._FutureDict`
:param value: The properties to be set.
"""
self._label_removals.clear()
return super(Bucket, self)._set_properties(value) | [
"def",
"_set_properties",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_label_removals",
".",
"clear",
"(",
")",
"return",
"super",
"(",
"Bucket",
",",
"self",
")",
".",
"_set_properties",
"(",
"value",
")"
] | Set the properties for the current object.
:type value: dict or :class:`google.cloud.storage.batch._FutureDict`
:param value: The properties to be set. | [
"Set",
"the",
"properties",
"for",
"the",
"current",
"object",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L421-L428 |
27,871 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.blob | def blob(
self,
blob_name,
chunk_size=None,
encryption_key=None,
kms_key_name=None,
generation=None,
):
"""Factory constructor for blob object.
.. note::
This will not make an HTTP request; it simply instantiates
a blob object owne... | python | def blob(
self,
blob_name,
chunk_size=None,
encryption_key=None,
kms_key_name=None,
generation=None,
):
"""Factory constructor for blob object.
.. note::
This will not make an HTTP request; it simply instantiates
a blob object owne... | [
"def",
"blob",
"(",
"self",
",",
"blob_name",
",",
"chunk_size",
"=",
"None",
",",
"encryption_key",
"=",
"None",
",",
"kms_key_name",
"=",
"None",
",",
"generation",
"=",
"None",
",",
")",
":",
"return",
"Blob",
"(",
"name",
"=",
"blob_name",
",",
"bu... | Factory constructor for blob object.
.. note::
This will not make an HTTP request; it simply instantiates
a blob object owned by this bucket.
:type blob_name: str
:param blob_name: The name of the blob to be instantiated.
:type chunk_size: int
:param chunk_... | [
"Factory",
"constructor",
"for",
"blob",
"object",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L440-L484 |
27,872 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.create | def create(self, client=None, project=None, location=None):
"""Creates current bucket.
If the bucket already exists, will raise
:class:`google.cloud.exceptions.Conflict`.
This implements "storage.buckets.insert".
If :attr:`user_project` is set, bills the API request to that pr... | python | def create(self, client=None, project=None, location=None):
"""Creates current bucket.
If the bucket already exists, will raise
:class:`google.cloud.exceptions.Conflict`.
This implements "storage.buckets.insert".
If :attr:`user_project` is set, bills the API request to that pr... | [
"def",
"create",
"(",
"self",
",",
"client",
"=",
"None",
",",
"project",
"=",
"None",
",",
"location",
"=",
"None",
")",
":",
"if",
"self",
".",
"user_project",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Cannot create bucket with 'user_project... | Creates current bucket.
If the bucket already exists, will raise
:class:`google.cloud.exceptions.Conflict`.
This implements "storage.buckets.insert".
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Clie... | [
"Creates",
"current",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L548-L601 |
27,873 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.get_blob | def get_blob(
self, blob_name, client=None, encryption_key=None, generation=None, **kwargs
):
"""Get a blob object by name.
This will return None if the blob doesn't exist:
.. literalinclude:: snippets.py
:start-after: [START get_blob]
:end-before: [END get_blob... | python | def get_blob(
self, blob_name, client=None, encryption_key=None, generation=None, **kwargs
):
"""Get a blob object by name.
This will return None if the blob doesn't exist:
.. literalinclude:: snippets.py
:start-after: [START get_blob]
:end-before: [END get_blob... | [
"def",
"get_blob",
"(",
"self",
",",
"blob_name",
",",
"client",
"=",
"None",
",",
"encryption_key",
"=",
"None",
",",
"generation",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"blob",
"=",
"Blob",
"(",
"bucket",
"=",
"self",
",",
"name",
"=",
... | Get a blob object by name.
This will return None if the blob doesn't exist:
.. literalinclude:: snippets.py
:start-after: [START get_blob]
:end-before: [END get_blob]
If :attr:`user_project` is set, bills the API request to that project.
:type blob_name: str
... | [
"Get",
"a",
"blob",
"object",
"by",
"name",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L656-L709 |
27,874 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.list_blobs | def list_blobs(
self,
max_results=None,
page_token=None,
prefix=None,
delimiter=None,
versions=None,
projection="noAcl",
fields=None,
client=None,
):
"""Return an iterator used to find blobs in the bucket.
If :attr:`user_projec... | python | def list_blobs(
self,
max_results=None,
page_token=None,
prefix=None,
delimiter=None,
versions=None,
projection="noAcl",
fields=None,
client=None,
):
"""Return an iterator used to find blobs in the bucket.
If :attr:`user_projec... | [
"def",
"list_blobs",
"(",
"self",
",",
"max_results",
"=",
"None",
",",
"page_token",
"=",
"None",
",",
"prefix",
"=",
"None",
",",
"delimiter",
"=",
"None",
",",
"versions",
"=",
"None",
",",
"projection",
"=",
"\"noAcl\"",
",",
"fields",
"=",
"None",
... | Return an iterator used to find blobs in the bucket.
If :attr:`user_project` is set, bills the API request to that project.
:type max_results: int
:param max_results:
(Optional) The maximum number of blobs in each page of results
from this request. Non-positive values a... | [
"Return",
"an",
"iterator",
"used",
"to",
"find",
"blobs",
"in",
"the",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L711-L802 |
27,875 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.delete | def delete(self, force=False, client=None):
"""Delete this bucket.
The bucket **must** be empty in order to submit a delete request. If
``force=True`` is passed, this will first attempt to delete all the
objects / blobs in the bucket (i.e. try to empty the bucket).
If the bucke... | python | def delete(self, force=False, client=None):
"""Delete this bucket.
The bucket **must** be empty in order to submit a delete request. If
``force=True`` is passed, this will first attempt to delete all the
objects / blobs in the bucket (i.e. try to empty the bucket).
If the bucke... | [
"def",
"delete",
"(",
"self",
",",
"force",
"=",
"False",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"query_params",
"=",
"{",
"}",
"if",
"self",
".",
"user_project",
"is",
"not",
"None",
... | Delete this bucket.
The bucket **must** be empty in order to submit a delete request. If
``force=True`` is passed, this will first attempt to delete all the
objects / blobs in the bucket (i.e. try to empty the bucket).
If the bucket doesn't exist, this will raise
:class:`google... | [
"Delete",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L831-L893 |
27,876 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.delete_blob | def delete_blob(self, blob_name, client=None, generation=None):
"""Deletes a blob from the current bucket.
If the blob isn't found (backend 404), raises a
:class:`google.cloud.exceptions.NotFound`.
For example:
.. literalinclude:: snippets.py
:start-after: [START del... | python | def delete_blob(self, blob_name, client=None, generation=None):
"""Deletes a blob from the current bucket.
If the blob isn't found (backend 404), raises a
:class:`google.cloud.exceptions.NotFound`.
For example:
.. literalinclude:: snippets.py
:start-after: [START del... | [
"def",
"delete_blob",
"(",
"self",
",",
"blob_name",
",",
"client",
"=",
"None",
",",
"generation",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"blob",
"=",
"Blob",
"(",
"blob_name",
",",
"bucket",
"=",
"se... | Deletes a blob from the current bucket.
If the blob isn't found (backend 404), raises a
:class:`google.cloud.exceptions.NotFound`.
For example:
.. literalinclude:: snippets.py
:start-after: [START delete_blob]
:end-before: [END delete_blob]
If :attr:`user_... | [
"Deletes",
"a",
"blob",
"from",
"the",
"current",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L895-L941 |
27,877 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.delete_blobs | def delete_blobs(self, blobs, on_error=None, client=None):
"""Deletes a list of blobs from the current bucket.
Uses :meth:`delete_blob` to delete each individual blob.
If :attr:`user_project` is set, bills the API request to that project.
:type blobs: list
:param blobs: A list... | python | def delete_blobs(self, blobs, on_error=None, client=None):
"""Deletes a list of blobs from the current bucket.
Uses :meth:`delete_blob` to delete each individual blob.
If :attr:`user_project` is set, bills the API request to that project.
:type blobs: list
:param blobs: A list... | [
"def",
"delete_blobs",
"(",
"self",
",",
"blobs",
",",
"on_error",
"=",
"None",
",",
"client",
"=",
"None",
")",
":",
"for",
"blob",
"in",
"blobs",
":",
"try",
":",
"blob_name",
"=",
"blob",
"if",
"not",
"isinstance",
"(",
"blob_name",
",",
"six",
".... | Deletes a list of blobs from the current bucket.
Uses :meth:`delete_blob` to delete each individual blob.
If :attr:`user_project` is set, bills the API request to that project.
:type blobs: list
:param blobs: A list of :class:`~google.cloud.storage.blob.Blob`-s or
... | [
"Deletes",
"a",
"list",
"of",
"blobs",
"from",
"the",
"current",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L943-L977 |
27,878 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.copy_blob | def copy_blob(
self,
blob,
destination_bucket,
new_name=None,
client=None,
preserve_acl=True,
source_generation=None,
):
"""Copy the given blob to the given bucket, optionally with a new name.
If :attr:`user_project` is set, bills the API requ... | python | def copy_blob(
self,
blob,
destination_bucket,
new_name=None,
client=None,
preserve_acl=True,
source_generation=None,
):
"""Copy the given blob to the given bucket, optionally with a new name.
If :attr:`user_project` is set, bills the API requ... | [
"def",
"copy_blob",
"(",
"self",
",",
"blob",
",",
"destination_bucket",
",",
"new_name",
"=",
"None",
",",
"client",
"=",
"None",
",",
"preserve_acl",
"=",
"True",
",",
"source_generation",
"=",
"None",
",",
")",
":",
"client",
"=",
"self",
".",
"_requi... | Copy the given blob to the given bucket, optionally with a new name.
If :attr:`user_project` is set, bills the API request to that project.
:type blob: :class:`google.cloud.storage.blob.Blob`
:param blob: The blob to be copied.
:type destination_bucket: :class:`google.cloud.storage.bu... | [
"Copy",
"the",
"given",
"blob",
"to",
"the",
"given",
"bucket",
"optionally",
"with",
"a",
"new",
"name",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L979-L1043 |
27,879 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.rename_blob | def rename_blob(self, blob, new_name, client=None):
"""Rename the given blob using copy and delete operations.
If :attr:`user_project` is set, bills the API request to that project.
Effectively, copies blob to the same bucket with a new name, then
deletes the blob.
.. warning:... | python | def rename_blob(self, blob, new_name, client=None):
"""Rename the given blob using copy and delete operations.
If :attr:`user_project` is set, bills the API request to that project.
Effectively, copies blob to the same bucket with a new name, then
deletes the blob.
.. warning:... | [
"def",
"rename_blob",
"(",
"self",
",",
"blob",
",",
"new_name",
",",
"client",
"=",
"None",
")",
":",
"same_name",
"=",
"blob",
".",
"name",
"==",
"new_name",
"new_blob",
"=",
"self",
".",
"copy_blob",
"(",
"blob",
",",
"self",
",",
"new_name",
",",
... | Rename the given blob using copy and delete operations.
If :attr:`user_project` is set, bills the API request to that project.
Effectively, copies blob to the same bucket with a new name, then
deletes the blob.
.. warning::
This method will first duplicate the data and then... | [
"Rename",
"the",
"given",
"blob",
"using",
"copy",
"and",
"delete",
"operations",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1045-L1080 |
27,880 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.default_kms_key_name | def default_kms_key_name(self, value):
"""Set default KMS encryption key for objects in the bucket.
:type value: str or None
:param value: new KMS key name (None to clear any existing key).
"""
encryption_config = self._properties.get("encryption", {})
encryption_config[... | python | def default_kms_key_name(self, value):
"""Set default KMS encryption key for objects in the bucket.
:type value: str or None
:param value: new KMS key name (None to clear any existing key).
"""
encryption_config = self._properties.get("encryption", {})
encryption_config[... | [
"def",
"default_kms_key_name",
"(",
"self",
",",
"value",
")",
":",
"encryption_config",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"encryption\"",
",",
"{",
"}",
")",
"encryption_config",
"[",
"\"defaultKmsKeyName\"",
"]",
"=",
"value",
"self",
".",
... | Set default KMS encryption key for objects in the bucket.
:type value: str or None
:param value: new KMS key name (None to clear any existing key). | [
"Set",
"default",
"KMS",
"encryption",
"key",
"for",
"objects",
"in",
"the",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1154-L1162 |
27,881 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.labels | def labels(self):
"""Retrieve or set labels assigned to this bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets#labels
.. note::
The getter for this property returns a dict which is a *copy*
of the bucket's labels. Mutating that dict has no ef... | python | def labels(self):
"""Retrieve or set labels assigned to this bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets#labels
.. note::
The getter for this property returns a dict which is a *copy*
of the bucket's labels. Mutating that dict has no ef... | [
"def",
"labels",
"(",
"self",
")",
":",
"labels",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"labels\"",
")",
"if",
"labels",
"is",
"None",
":",
"return",
"{",
"}",
"return",
"copy",
".",
"deepcopy",
"(",
"labels",
")"
] | Retrieve or set labels assigned to this bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets#labels
.. note::
The getter for this property returns a dict which is a *copy*
of the bucket's labels. Mutating that dict has no effect unless
you th... | [
"Retrieve",
"or",
"set",
"labels",
"assigned",
"to",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1165-L1192 |
27,882 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.labels | def labels(self, mapping):
"""Set labels assigned to this bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets#labels
:type mapping: :class:`dict`
:param mapping: Name-value pairs (string->string) labelling the bucket.
"""
# If any labels have b... | python | def labels(self, mapping):
"""Set labels assigned to this bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets#labels
:type mapping: :class:`dict`
:param mapping: Name-value pairs (string->string) labelling the bucket.
"""
# If any labels have b... | [
"def",
"labels",
"(",
"self",
",",
"mapping",
")",
":",
"# If any labels have been expressly removed, we need to track this",
"# so that a future .patch() call can do the correct thing.",
"existing",
"=",
"set",
"(",
"[",
"k",
"for",
"k",
"in",
"self",
".",
"labels",
".",... | Set labels assigned to this bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets#labels
:type mapping: :class:`dict`
:param mapping: Name-value pairs (string->string) labelling the bucket. | [
"Set",
"labels",
"assigned",
"to",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1195-L1211 |
27,883 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.iam_configuration | def iam_configuration(self):
"""Retrieve IAM configuration for this bucket.
:rtype: :class:`IAMConfiguration`
:returns: an instance for managing the bucket's IAM configuration.
"""
info = self._properties.get("iamConfiguration", {})
return IAMConfiguration.from_api_repr(... | python | def iam_configuration(self):
"""Retrieve IAM configuration for this bucket.
:rtype: :class:`IAMConfiguration`
:returns: an instance for managing the bucket's IAM configuration.
"""
info = self._properties.get("iamConfiguration", {})
return IAMConfiguration.from_api_repr(... | [
"def",
"iam_configuration",
"(",
"self",
")",
":",
"info",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"iamConfiguration\"",
",",
"{",
"}",
")",
"return",
"IAMConfiguration",
".",
"from_api_repr",
"(",
"info",
",",
"self",
")"
] | Retrieve IAM configuration for this bucket.
:rtype: :class:`IAMConfiguration`
:returns: an instance for managing the bucket's IAM configuration. | [
"Retrieve",
"IAM",
"configuration",
"for",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1239-L1246 |
27,884 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.lifecycle_rules | def lifecycle_rules(self):
"""Retrieve or set lifecycle rules configured for this bucket.
See https://cloud.google.com/storage/docs/lifecycle and
https://cloud.google.com/storage/docs/json_api/v1/buckets
.. note::
The getter for this property returns a list which conta... | python | def lifecycle_rules(self):
"""Retrieve or set lifecycle rules configured for this bucket.
See https://cloud.google.com/storage/docs/lifecycle and
https://cloud.google.com/storage/docs/json_api/v1/buckets
.. note::
The getter for this property returns a list which conta... | [
"def",
"lifecycle_rules",
"(",
"self",
")",
":",
"info",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"lifecycle\"",
",",
"{",
"}",
")",
"for",
"rule",
"in",
"info",
".",
"get",
"(",
"\"rule\"",
",",
"(",
")",
")",
":",
"action_type",
"=",
"... | Retrieve or set lifecycle rules configured for this bucket.
See https://cloud.google.com/storage/docs/lifecycle and
https://cloud.google.com/storage/docs/json_api/v1/buckets
.. note::
The getter for this property returns a list which contains
*copies* of the bucket'... | [
"Retrieve",
"or",
"set",
"lifecycle",
"rules",
"configured",
"for",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1249-L1283 |
27,885 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.lifecycle_rules | def lifecycle_rules(self, rules):
"""Set lifestyle rules configured for this bucket.
See https://cloud.google.com/storage/docs/lifecycle and
https://cloud.google.com/storage/docs/json_api/v1/buckets
:type entries: list of dictionaries
:param entries: A sequence of mappings... | python | def lifecycle_rules(self, rules):
"""Set lifestyle rules configured for this bucket.
See https://cloud.google.com/storage/docs/lifecycle and
https://cloud.google.com/storage/docs/json_api/v1/buckets
:type entries: list of dictionaries
:param entries: A sequence of mappings... | [
"def",
"lifecycle_rules",
"(",
"self",
",",
"rules",
")",
":",
"rules",
"=",
"[",
"dict",
"(",
"rule",
")",
"for",
"rule",
"in",
"rules",
"]",
"# Convert helpers if needed",
"self",
".",
"_patch_property",
"(",
"\"lifecycle\"",
",",
"{",
"\"rule\"",
":",
"... | Set lifestyle rules configured for this bucket.
See https://cloud.google.com/storage/docs/lifecycle and
https://cloud.google.com/storage/docs/json_api/v1/buckets
:type entries: list of dictionaries
:param entries: A sequence of mappings describing each lifecycle rule. | [
"Set",
"lifestyle",
"rules",
"configured",
"for",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1286-L1296 |
27,886 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.enable_logging | def enable_logging(self, bucket_name, object_prefix=""):
"""Enable access logging for this bucket.
See https://cloud.google.com/storage/docs/access-logs
:type bucket_name: str
:param bucket_name: name of bucket in which to store access logs
:type object_prefix: str
:pa... | python | def enable_logging(self, bucket_name, object_prefix=""):
"""Enable access logging for this bucket.
See https://cloud.google.com/storage/docs/access-logs
:type bucket_name: str
:param bucket_name: name of bucket in which to store access logs
:type object_prefix: str
:pa... | [
"def",
"enable_logging",
"(",
"self",
",",
"bucket_name",
",",
"object_prefix",
"=",
"\"\"",
")",
":",
"info",
"=",
"{",
"\"logBucket\"",
":",
"bucket_name",
",",
"\"logObjectPrefix\"",
":",
"object_prefix",
"}",
"self",
".",
"_patch_property",
"(",
"\"logging\"... | Enable access logging for this bucket.
See https://cloud.google.com/storage/docs/access-logs
:type bucket_name: str
:param bucket_name: name of bucket in which to store access logs
:type object_prefix: str
:param object_prefix: prefix for access log filenames | [
"Enable",
"access",
"logging",
"for",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1388-L1400 |
27,887 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.retention_policy_effective_time | def retention_policy_effective_time(self):
"""Retrieve the effective time of the bucket's retention policy.
:rtype: datetime.datetime or ``NoneType``
:returns: point-in time at which the bucket's retention policy is
effective, or ``None`` if the property is not
... | python | def retention_policy_effective_time(self):
"""Retrieve the effective time of the bucket's retention policy.
:rtype: datetime.datetime or ``NoneType``
:returns: point-in time at which the bucket's retention policy is
effective, or ``None`` if the property is not
... | [
"def",
"retention_policy_effective_time",
"(",
"self",
")",
":",
"policy",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"retentionPolicy\"",
")",
"if",
"policy",
"is",
"not",
"None",
":",
"timestamp",
"=",
"policy",
".",
"get",
"(",
"\"effectiveTime\"",... | Retrieve the effective time of the bucket's retention policy.
:rtype: datetime.datetime or ``NoneType``
:returns: point-in time at which the bucket's retention policy is
effective, or ``None`` if the property is not
set locally. | [
"Retrieve",
"the",
"effective",
"time",
"of",
"the",
"bucket",
"s",
"retention",
"policy",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1450-L1462 |
27,888 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.retention_period | def retention_period(self):
"""Retrieve or set the retention period for items in the bucket.
:rtype: int or ``NoneType``
:returns: number of seconds to retain items after upload or release
from event-based lock, or ``None`` if the property is not
set locally.... | python | def retention_period(self):
"""Retrieve or set the retention period for items in the bucket.
:rtype: int or ``NoneType``
:returns: number of seconds to retain items after upload or release
from event-based lock, or ``None`` if the property is not
set locally.... | [
"def",
"retention_period",
"(",
"self",
")",
":",
"policy",
"=",
"self",
".",
"_properties",
".",
"get",
"(",
"\"retentionPolicy\"",
")",
"if",
"policy",
"is",
"not",
"None",
":",
"period",
"=",
"policy",
".",
"get",
"(",
"\"retentionPeriod\"",
")",
"if",
... | Retrieve or set the retention period for items in the bucket.
:rtype: int or ``NoneType``
:returns: number of seconds to retain items after upload or release
from event-based lock, or ``None`` if the property is not
set locally. | [
"Retrieve",
"or",
"set",
"the",
"retention",
"period",
"for",
"items",
"in",
"the",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1478-L1490 |
27,889 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.retention_period | def retention_period(self, value):
"""Set the retention period for items in the bucket.
:type value: int
:param value:
number of seconds to retain items after upload or release from
event-based lock.
:raises ValueError: if the bucket's retention policy is locked... | python | def retention_period(self, value):
"""Set the retention period for items in the bucket.
:type value: int
:param value:
number of seconds to retain items after upload or release from
event-based lock.
:raises ValueError: if the bucket's retention policy is locked... | [
"def",
"retention_period",
"(",
"self",
",",
"value",
")",
":",
"policy",
"=",
"self",
".",
"_properties",
".",
"setdefault",
"(",
"\"retentionPolicy\"",
",",
"{",
"}",
")",
"if",
"value",
"is",
"not",
"None",
":",
"policy",
"[",
"\"retentionPeriod\"",
"]"... | Set the retention period for items in the bucket.
:type value: int
:param value:
number of seconds to retain items after upload or release from
event-based lock.
:raises ValueError: if the bucket's retention policy is locked. | [
"Set",
"the",
"retention",
"period",
"for",
"items",
"in",
"the",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1493-L1508 |
27,890 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.storage_class | def storage_class(self, value):
"""Set the storage class for the bucket.
See https://cloud.google.com/storage/docs/storage-classes
:type value: str
:param value: one of "MULTI_REGIONAL", "REGIONAL", "NEARLINE",
"COLDLINE", "STANDARD", or "DURABLE_REDUCED_AVAILABIL... | python | def storage_class(self, value):
"""Set the storage class for the bucket.
See https://cloud.google.com/storage/docs/storage-classes
:type value: str
:param value: one of "MULTI_REGIONAL", "REGIONAL", "NEARLINE",
"COLDLINE", "STANDARD", or "DURABLE_REDUCED_AVAILABIL... | [
"def",
"storage_class",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"not",
"in",
"self",
".",
"_STORAGE_CLASSES",
":",
"raise",
"ValueError",
"(",
"\"Invalid storage class: %s\"",
"%",
"(",
"value",
",",
")",
")",
"self",
".",
"_patch_property",
"(",... | Set the storage class for the bucket.
See https://cloud.google.com/storage/docs/storage-classes
:type value: str
:param value: one of "MULTI_REGIONAL", "REGIONAL", "NEARLINE",
"COLDLINE", "STANDARD", or "DURABLE_REDUCED_AVAILABILITY" | [
"Set",
"the",
"storage",
"class",
"for",
"the",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1539-L1550 |
27,891 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.configure_website | def configure_website(self, main_page_suffix=None, not_found_page=None):
"""Configure website-related properties.
See https://cloud.google.com/storage/docs/hosting-static-website
.. note::
This (apparently) only works
if your bucket name is a domain name
(and to d... | python | def configure_website(self, main_page_suffix=None, not_found_page=None):
"""Configure website-related properties.
See https://cloud.google.com/storage/docs/hosting-static-website
.. note::
This (apparently) only works
if your bucket name is a domain name
(and to d... | [
"def",
"configure_website",
"(",
"self",
",",
"main_page_suffix",
"=",
"None",
",",
"not_found_page",
"=",
"None",
")",
":",
"data",
"=",
"{",
"\"mainPageSuffix\"",
":",
"main_page_suffix",
",",
"\"notFoundPage\"",
":",
"not_found_page",
"}",
"self",
".",
"_patc... | Configure website-related properties.
See https://cloud.google.com/storage/docs/hosting-static-website
.. note::
This (apparently) only works
if your bucket name is a domain name
(and to do that, you need to get approved somehow...).
If you want this bucket to ho... | [
"Configure",
"website",
"-",
"related",
"properties",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1624-L1660 |
27,892 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.get_iam_policy | def get_iam_policy(self, client=None):
"""Retrieve the IAM policy for the bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets/getIamPolicy
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.clien... | python | def get_iam_policy(self, client=None):
"""Retrieve the IAM policy for the bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets/getIamPolicy
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.clien... | [
"def",
"get_iam_policy",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"query_params",
"=",
"{",
"}",
"if",
"self",
".",
"user_project",
"is",
"not",
"None",
":",
"query_params",
"["... | Retrieve the IAM policy for the bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets/getIamPolicy
If :attr:`user_project` is set, bills the API request to that project.
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
... | [
"Retrieve",
"the",
"IAM",
"policy",
"for",
"the",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1670-L1699 |
27,893 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.set_iam_policy | def set_iam_policy(self, policy, client=None):
"""Update the IAM policy for the bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets/setIamPolicy
If :attr:`user_project` is set, bills the API request to that project.
:type policy: :class:`google.api_core.iam.P... | python | def set_iam_policy(self, policy, client=None):
"""Update the IAM policy for the bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets/setIamPolicy
If :attr:`user_project` is set, bills the API request to that project.
:type policy: :class:`google.api_core.iam.P... | [
"def",
"set_iam_policy",
"(",
"self",
",",
"policy",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"query_params",
"=",
"{",
"}",
"if",
"self",
".",
"user_project",
"is",
"not",
"None",
":",
"q... | Update the IAM policy for the bucket.
See
https://cloud.google.com/storage/docs/json_api/v1/buckets/setIamPolicy
If :attr:`user_project` is set, bills the API request to that project.
:type policy: :class:`google.api_core.iam.Policy`
:param policy: policy instance used to upda... | [
"Update",
"the",
"IAM",
"policy",
"for",
"the",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1701-L1736 |
27,894 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.make_private | def make_private(self, recursive=False, future=False, client=None):
"""Update bucket's ACL, revoking read access for anonymous users.
:type recursive: bool
:param recursive: If True, this will make all blobs inside the bucket
private as well.
:type future: boo... | python | def make_private(self, recursive=False, future=False, client=None):
"""Update bucket's ACL, revoking read access for anonymous users.
:type recursive: bool
:param recursive: If True, this will make all blobs inside the bucket
private as well.
:type future: boo... | [
"def",
"make_private",
"(",
"self",
",",
"recursive",
"=",
"False",
",",
"future",
"=",
"False",
",",
"client",
"=",
"None",
")",
":",
"self",
".",
"acl",
".",
"all",
"(",
")",
".",
"revoke_read",
"(",
")",
"self",
".",
"acl",
".",
"save",
"(",
"... | Update bucket's ACL, revoking read access for anonymous users.
:type recursive: bool
:param recursive: If True, this will make all blobs inside the bucket
private as well.
:type future: bool
:param future: If True, this will make all objects created in the
... | [
"Update",
"bucket",
"s",
"ACL",
"revoking",
"read",
"access",
"for",
"anonymous",
"users",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1826-L1880 |
27,895 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.generate_upload_policy | def generate_upload_policy(self, conditions, expiration=None, client=None):
"""Create a signed upload policy for uploading objects.
This method generates and signs a policy document. You can use
`policy documents`_ to allow visitors to a website to upload files to
Google Cloud Storage w... | python | def generate_upload_policy(self, conditions, expiration=None, client=None):
"""Create a signed upload policy for uploading objects.
This method generates and signs a policy document. You can use
`policy documents`_ to allow visitors to a website to upload files to
Google Cloud Storage w... | [
"def",
"generate_upload_policy",
"(",
"self",
",",
"conditions",
",",
"expiration",
"=",
"None",
",",
"client",
"=",
"None",
")",
":",
"client",
"=",
"self",
".",
"_require_client",
"(",
"client",
")",
"credentials",
"=",
"client",
".",
"_base_connection",
"... | Create a signed upload policy for uploading objects.
This method generates and signs a policy document. You can use
`policy documents`_ to allow visitors to a website to upload files to
Google Cloud Storage without giving them direct write access.
For example:
.. literalinclud... | [
"Create",
"a",
"signed",
"upload",
"policy",
"for",
"uploading",
"objects",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1882-L1942 |
27,896 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.lock_retention_policy | def lock_retention_policy(self, client=None):
"""Lock the bucket's retention policy.
:raises ValueError:
if the bucket has no metageneration (i.e., new or never reloaded);
if the bucket has no retention policy assigned;
if the bucket's retention policy is already loc... | python | def lock_retention_policy(self, client=None):
"""Lock the bucket's retention policy.
:raises ValueError:
if the bucket has no metageneration (i.e., new or never reloaded);
if the bucket has no retention policy assigned;
if the bucket's retention policy is already loc... | [
"def",
"lock_retention_policy",
"(",
"self",
",",
"client",
"=",
"None",
")",
":",
"if",
"\"metageneration\"",
"not",
"in",
"self",
".",
"_properties",
":",
"raise",
"ValueError",
"(",
"\"Bucket has no retention policy assigned: try 'reload'?\"",
")",
"policy",
"=",
... | Lock the bucket's retention policy.
:raises ValueError:
if the bucket has no metageneration (i.e., new or never reloaded);
if the bucket has no retention policy assigned;
if the bucket's retention policy is already locked. | [
"Lock",
"the",
"bucket",
"s",
"retention",
"policy",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1944-L1974 |
27,897 | googleapis/google-cloud-python | storage/google/cloud/storage/bucket.py | Bucket.generate_signed_url | def generate_signed_url(
self,
expiration=None,
api_access_endpoint=_API_ACCESS_ENDPOINT,
method="GET",
headers=None,
query_parameters=None,
client=None,
credentials=None,
version=None,
):
"""Generates a signed URL for this bucket.
... | python | def generate_signed_url(
self,
expiration=None,
api_access_endpoint=_API_ACCESS_ENDPOINT,
method="GET",
headers=None,
query_parameters=None,
client=None,
credentials=None,
version=None,
):
"""Generates a signed URL for this bucket.
... | [
"def",
"generate_signed_url",
"(",
"self",
",",
"expiration",
"=",
"None",
",",
"api_access_endpoint",
"=",
"_API_ACCESS_ENDPOINT",
",",
"method",
"=",
"\"GET\"",
",",
"headers",
"=",
"None",
",",
"query_parameters",
"=",
"None",
",",
"client",
"=",
"None",
",... | Generates a signed URL for this bucket.
.. note::
If you are on Google Compute Engine, you can't generate a signed
URL using GCE service account. Follow `Issue 50`_ for updates on
this. If you'd like to be able to generate a signed URL from GCE,
you can use a st... | [
"Generates",
"a",
"signed",
"URL",
"for",
"this",
"bucket",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/storage/google/cloud/storage/bucket.py#L1976-L2080 |
27,898 | googleapis/google-cloud-python | api_core/google/api_core/datetime_helpers.py | to_microseconds | def to_microseconds(value):
"""Convert a datetime to microseconds since the unix epoch.
Args:
value (datetime.datetime): The datetime to covert.
Returns:
int: Microseconds since the unix epoch.
"""
if not value.tzinfo:
value = value.replace(tzinfo=pytz.utc)
# Regardless... | python | def to_microseconds(value):
"""Convert a datetime to microseconds since the unix epoch.
Args:
value (datetime.datetime): The datetime to covert.
Returns:
int: Microseconds since the unix epoch.
"""
if not value.tzinfo:
value = value.replace(tzinfo=pytz.utc)
# Regardless... | [
"def",
"to_microseconds",
"(",
"value",
")",
":",
"if",
"not",
"value",
".",
"tzinfo",
":",
"value",
"=",
"value",
".",
"replace",
"(",
"tzinfo",
"=",
"pytz",
".",
"utc",
")",
"# Regardless of what timezone is on the value, convert it to UTC.",
"value",
"=",
"va... | Convert a datetime to microseconds since the unix epoch.
Args:
value (datetime.datetime): The datetime to covert.
Returns:
int: Microseconds since the unix epoch. | [
"Convert",
"a",
"datetime",
"to",
"microseconds",
"since",
"the",
"unix",
"epoch",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L76-L90 |
27,899 | googleapis/google-cloud-python | api_core/google/api_core/datetime_helpers.py | from_rfc3339 | def from_rfc3339(value):
"""Convert a microsecond-precision timestamp to datetime.
Args:
value (str): The RFC3339 string to convert.
Returns:
datetime.datetime: The datetime object equivalent to the timestamp in
UTC.
"""
return datetime.datetime.strptime(value, _RFC3339... | python | def from_rfc3339(value):
"""Convert a microsecond-precision timestamp to datetime.
Args:
value (str): The RFC3339 string to convert.
Returns:
datetime.datetime: The datetime object equivalent to the timestamp in
UTC.
"""
return datetime.datetime.strptime(value, _RFC3339... | [
"def",
"from_rfc3339",
"(",
"value",
")",
":",
"return",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"value",
",",
"_RFC3339_MICROS",
")",
".",
"replace",
"(",
"tzinfo",
"=",
"pytz",
".",
"utc",
")"
] | Convert a microsecond-precision timestamp to datetime.
Args:
value (str): The RFC3339 string to convert.
Returns:
datetime.datetime: The datetime object equivalent to the timestamp in
UTC. | [
"Convert",
"a",
"microsecond",
"-",
"precision",
"timestamp",
"to",
"datetime",
"."
] | 85e80125a59cb10f8cb105f25ecc099e4b940b50 | https://github.com/googleapis/google-cloud-python/blob/85e80125a59cb10f8cb105f25ecc099e4b940b50/api_core/google/api_core/datetime_helpers.py#L117-L127 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.