Skip to content

Commit

Permalink
chore(python): use black==22.3.0 (#346)
Browse files Browse the repository at this point in the history
Source-Link: googleapis/synthtool@6fab84a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
  • Loading branch information
gcf-owl-bot[bot] authored Mar 28, 2022
1 parent c3bb5df commit f18ffe1
Show file tree
Hide file tree
Showing 25 changed files with 2,212 additions and 643 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
13 changes: 11 additions & 2 deletions packages/google-cloud-python-speech/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(root_doc, "google-cloud-speech", "google-cloud-speech Documentation", [author], 1,)
(
root_doc,
"google-cloud-speech",
"google-cloud-speech Documentation",
[author],
1,
)
]

# If true, show URL addresses after external links.
Expand Down Expand Up @@ -355,7 +361,10 @@
intersphinx_mapping = {
"python": ("https://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"google.api_core": (
"https://googleapis.dev/python/google-api-core/latest/",
None,
),
"grpc": ("https://grpc.github.io/grpc/python/", None),
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ def sample_recognize():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down Expand Up @@ -435,7 +440,12 @@ def sample_long_running_recognize():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
Expand Down Expand Up @@ -593,7 +603,12 @@ def request_generator():
)

# Send the request.
response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
requests,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand All @@ -607,7 +622,9 @@ async def __aexit__(self, exc_type, exc, tb):

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-speech",).version,
gapic_version=pkg_resources.get_distribution(
"google-cloud-speech",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ class SpeechClientMeta(type):
_transport_registry["grpc"] = SpeechGrpcTransport
_transport_registry["grpc_asyncio"] = SpeechGrpcAsyncIOTransport

def get_transport_class(cls, label: str = None,) -> Type[SpeechTransport]:
def get_transport_class(
cls,
label: str = None,
) -> Type[SpeechTransport]:
"""Returns an appropriate transport class.
Args:
Expand Down Expand Up @@ -161,10 +164,16 @@ def transport(self) -> SpeechTransport:
return self._transport

@staticmethod
def custom_class_path(project: str, location: str, custom_class: str,) -> str:
def custom_class_path(
project: str,
location: str,
custom_class: str,
) -> str:
"""Returns a fully-qualified custom_class string."""
return "projects/{project}/locations/{location}/customClasses/{custom_class}".format(
project=project, location=location, custom_class=custom_class,
project=project,
location=location,
custom_class=custom_class,
)

@staticmethod
Expand All @@ -177,10 +186,16 @@ def parse_custom_class_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def phrase_set_path(project: str, location: str, phrase_set: str,) -> str:
def phrase_set_path(
project: str,
location: str,
phrase_set: str,
) -> str:
"""Returns a fully-qualified phrase_set string."""
return "projects/{project}/locations/{location}/phraseSets/{phrase_set}".format(
project=project, location=location, phrase_set=phrase_set,
project=project,
location=location,
phrase_set=phrase_set,
)

@staticmethod
Expand All @@ -193,7 +208,9 @@ def parse_phrase_set_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
def common_billing_account_path(
billing_account: str,
) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
Expand All @@ -206,9 +223,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_folder_path(folder: str,) -> str:
def common_folder_path(
folder: str,
) -> str:
"""Returns a fully-qualified folder string."""
return "folders/{folder}".format(folder=folder,)
return "folders/{folder}".format(
folder=folder,
)

@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
Expand All @@ -217,9 +238,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_organization_path(organization: str,) -> str:
def common_organization_path(
organization: str,
) -> str:
"""Returns a fully-qualified organization string."""
return "organizations/{organization}".format(organization=organization,)
return "organizations/{organization}".format(
organization=organization,
)

@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
Expand All @@ -228,9 +253,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_project_path(project: str,) -> str:
def common_project_path(
project: str,
) -> str:
"""Returns a fully-qualified project string."""
return "projects/{project}".format(project=project,)
return "projects/{project}".format(
project=project,
)

@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
Expand All @@ -239,10 +268,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_location_path(project: str, location: str,) -> str:
def common_location_path(
project: str,
location: str,
) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
project=project, location=location,
project=project,
location=location,
)

@staticmethod
Expand Down Expand Up @@ -516,7 +549,12 @@ def sample_recognize():
rpc = self._transport._wrapped_methods[self._transport.recognize]

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down Expand Up @@ -634,7 +672,12 @@ def sample_long_running_recognize():
rpc = self._transport._wrapped_methods[self._transport.long_running_recognize]

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation.from_gapic(
Expand Down Expand Up @@ -778,7 +821,12 @@ def request_generator():
rpc = self._transport._wrapped_methods[self._transport.streaming_recognize]

# Send the request.
response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
requests,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand All @@ -799,7 +847,9 @@ def __exit__(self, type, value, traceback):

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-speech",).version,
gapic_version=pkg_resources.get_distribution(
"google-cloud-speech",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-speech",).version,
gapic_version=pkg_resources.get_distribution(
"google-cloud-speech",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
Expand Down Expand Up @@ -160,9 +162,9 @@ def _prep_wrapped_messages(self, client_info):
def close(self):
"""Closes resources associated with the transport.
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ def create_channel(

@property
def grpc_channel(self) -> grpc.Channel:
"""Return the channel designed to connect to this service.
"""
"""Return the channel designed to connect to this service."""
return self._grpc_channel

@property
Expand Down
Loading

0 comments on commit f18ffe1

Please sign in to comment.