Skip to content

Commit 71fdf04

Browse files
chore(python): use black==22.3.0 (#346)
Source-Link: googleapis/synthtool@6fab84a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
1 parent c0c4742 commit 71fdf04

File tree

22 files changed

+2209
-640
lines changed

22 files changed

+2209
-640
lines changed

packages/google-cloud-python-speech/docs/conf.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,13 @@
314314
# One entry per manual page. List of tuples
315315
# (source start file, name, description, authors, manual section).
316316
man_pages = [
317-
(root_doc, "google-cloud-speech", "google-cloud-speech Documentation", [author], 1,)
317+
(
318+
root_doc,
319+
"google-cloud-speech",
320+
"google-cloud-speech Documentation",
321+
[author],
322+
1,
323+
)
318324
]
319325

320326
# If true, show URL addresses after external links.
@@ -355,7 +361,10 @@
355361
intersphinx_mapping = {
356362
"python": ("https://python.readthedocs.org/en/latest/", None),
357363
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
358-
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
364+
"google.api_core": (
365+
"https://googleapis.dev/python/google-api-core/latest/",
366+
None,
367+
),
359368
"grpc": ("https://grpc.github.io/grpc/python/", None),
360369
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
361370
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/async_client.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,12 @@ def sample_recognize():
317317
)
318318

319319
# Send the request.
320-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
320+
response = await rpc(
321+
request,
322+
retry=retry,
323+
timeout=timeout,
324+
metadata=metadata,
325+
)
321326

322327
# Done; return the response.
323328
return response
@@ -435,7 +440,12 @@ def sample_long_running_recognize():
435440
)
436441

437442
# Send the request.
438-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
443+
response = await rpc(
444+
request,
445+
retry=retry,
446+
timeout=timeout,
447+
metadata=metadata,
448+
)
439449

440450
# Wrap the response in an operation future.
441451
response = operation_async.from_gapic(
@@ -593,7 +603,12 @@ def request_generator():
593603
)
594604

595605
# Send the request.
596-
response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
606+
response = rpc(
607+
requests,
608+
retry=retry,
609+
timeout=timeout,
610+
metadata=metadata,
611+
)
597612

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

608623
try:
609624
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
610-
gapic_version=pkg_resources.get_distribution("google-cloud-speech",).version,
625+
gapic_version=pkg_resources.get_distribution(
626+
"google-cloud-speech",
627+
).version,
611628
)
612629
except pkg_resources.DistributionNotFound:
613630
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/client.py

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ class SpeechClientMeta(type):
5656
_transport_registry["grpc"] = SpeechGrpcTransport
5757
_transport_registry["grpc_asyncio"] = SpeechGrpcAsyncIOTransport
5858

59-
def get_transport_class(cls, label: str = None,) -> Type[SpeechTransport]:
59+
def get_transport_class(
60+
cls,
61+
label: str = None,
62+
) -> Type[SpeechTransport]:
6063
"""Returns an appropriate transport class.
6164
6265
Args:
@@ -161,10 +164,16 @@ def transport(self) -> SpeechTransport:
161164
return self._transport
162165

163166
@staticmethod
164-
def custom_class_path(project: str, location: str, custom_class: str,) -> str:
167+
def custom_class_path(
168+
project: str,
169+
location: str,
170+
custom_class: str,
171+
) -> str:
165172
"""Returns a fully-qualified custom_class string."""
166173
return "projects/{project}/locations/{location}/customClasses/{custom_class}".format(
167-
project=project, location=location, custom_class=custom_class,
174+
project=project,
175+
location=location,
176+
custom_class=custom_class,
168177
)
169178

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

179188
@staticmethod
180-
def phrase_set_path(project: str, location: str, phrase_set: str,) -> str:
189+
def phrase_set_path(
190+
project: str,
191+
location: str,
192+
phrase_set: str,
193+
) -> str:
181194
"""Returns a fully-qualified phrase_set string."""
182195
return "projects/{project}/locations/{location}/phraseSets/{phrase_set}".format(
183-
project=project, location=location, phrase_set=phrase_set,
196+
project=project,
197+
location=location,
198+
phrase_set=phrase_set,
184199
)
185200

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

195210
@staticmethod
196-
def common_billing_account_path(billing_account: str,) -> str:
211+
def common_billing_account_path(
212+
billing_account: str,
213+
) -> str:
197214
"""Returns a fully-qualified billing_account string."""
198215
return "billingAccounts/{billing_account}".format(
199216
billing_account=billing_account,
@@ -206,9 +223,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
206223
return m.groupdict() if m else {}
207224

208225
@staticmethod
209-
def common_folder_path(folder: str,) -> str:
226+
def common_folder_path(
227+
folder: str,
228+
) -> str:
210229
"""Returns a fully-qualified folder string."""
211-
return "folders/{folder}".format(folder=folder,)
230+
return "folders/{folder}".format(
231+
folder=folder,
232+
)
212233

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

219240
@staticmethod
220-
def common_organization_path(organization: str,) -> str:
241+
def common_organization_path(
242+
organization: str,
243+
) -> str:
221244
"""Returns a fully-qualified organization string."""
222-
return "organizations/{organization}".format(organization=organization,)
245+
return "organizations/{organization}".format(
246+
organization=organization,
247+
)
223248

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

230255
@staticmethod
231-
def common_project_path(project: str,) -> str:
256+
def common_project_path(
257+
project: str,
258+
) -> str:
232259
"""Returns a fully-qualified project string."""
233-
return "projects/{project}".format(project=project,)
260+
return "projects/{project}".format(
261+
project=project,
262+
)
234263

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

241270
@staticmethod
242-
def common_location_path(project: str, location: str,) -> str:
271+
def common_location_path(
272+
project: str,
273+
location: str,
274+
) -> str:
243275
"""Returns a fully-qualified location string."""
244276
return "projects/{project}/locations/{location}".format(
245-
project=project, location=location,
277+
project=project,
278+
location=location,
246279
)
247280

248281
@staticmethod
@@ -516,7 +549,12 @@ def sample_recognize():
516549
rpc = self._transport._wrapped_methods[self._transport.recognize]
517550

518551
# Send the request.
519-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
552+
response = rpc(
553+
request,
554+
retry=retry,
555+
timeout=timeout,
556+
metadata=metadata,
557+
)
520558

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

636674
# Send the request.
637-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
675+
response = rpc(
676+
request,
677+
retry=retry,
678+
timeout=timeout,
679+
metadata=metadata,
680+
)
638681

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

780823
# Send the request.
781-
response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
824+
response = rpc(
825+
requests,
826+
retry=retry,
827+
timeout=timeout,
828+
metadata=metadata,
829+
)
782830

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

800848
try:
801849
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
802-
gapic_version=pkg_resources.get_distribution("google-cloud-speech",).version,
850+
gapic_version=pkg_resources.get_distribution(
851+
"google-cloud-speech",
852+
).version,
803853
)
804854
except pkg_resources.DistributionNotFound:
805855
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/transports/base.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131

3232
try:
3333
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
34-
gapic_version=pkg_resources.get_distribution("google-cloud-speech",).version,
34+
gapic_version=pkg_resources.get_distribution(
35+
"google-cloud-speech",
36+
).version,
3537
)
3638
except pkg_resources.DistributionNotFound:
3739
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
@@ -160,9 +162,9 @@ def _prep_wrapped_messages(self, client_info):
160162
def close(self):
161163
"""Closes resources associated with the transport.
162164
163-
.. warning::
164-
Only call this method if the transport is NOT shared
165-
with other clients - this may cause errors in other clients!
165+
.. warning::
166+
Only call this method if the transport is NOT shared
167+
with other clients - this may cause errors in other clients!
166168
"""
167169
raise NotImplementedError()
168170

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/transports/grpc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ def create_channel(
227227

228228
@property
229229
def grpc_channel(self) -> grpc.Channel:
230-
"""Return the channel designed to connect to this service.
231-
"""
230+
"""Return the channel designed to connect to this service."""
232231
return self._grpc_channel
233232

234233
@property

0 commit comments

Comments
 (0)