Skip to content

Commit 2e7266e

Browse files
chore(python): use black==22.3.0 (#333)
Source-Link: googleapis/synthtool@6fab84a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 1764f9b commit 2e7266e

File tree

77 files changed

+9146
-2599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+9146
-2599
lines changed

packages/google-cloud-vision/.github/.OwlBot.lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3
16+
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe

packages/google-cloud-vision/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-vision", "google-cloud-vision Documentation", [author], 1,)
317+
(
318+
root_doc,
319+
"google-cloud-vision",
320+
"google-cloud-vision 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-vision/google/cloud/vision_v1/services/image_annotator/async_client.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,12 @@ def sample_batch_annotate_images():
299299
)
300300

301301
# Send the request.
302-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
302+
response = await rpc(
303+
request,
304+
retry=retry,
305+
timeout=timeout,
306+
metadata=metadata,
307+
)
303308

304309
# Done; return the response.
305310
return response
@@ -400,7 +405,12 @@ def sample_batch_annotate_files():
400405
)
401406

402407
# Send the request.
403-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
408+
response = await rpc(
409+
request,
410+
retry=retry,
411+
timeout=timeout,
412+
metadata=metadata,
413+
)
404414

405415
# Done; return the response.
406416
return response
@@ -522,7 +532,12 @@ def sample_async_batch_annotate_images():
522532
)
523533

524534
# Send the request.
525-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
535+
response = await rpc(
536+
request,
537+
retry=retry,
538+
timeout=timeout,
539+
metadata=metadata,
540+
)
526541

527542
# Wrap the response in an operation future.
528543
response = operation_async.from_gapic(
@@ -637,7 +652,12 @@ def sample_async_batch_annotate_files():
637652
)
638653

639654
# Send the request.
640-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
655+
response = await rpc(
656+
request,
657+
retry=retry,
658+
timeout=timeout,
659+
metadata=metadata,
660+
)
641661

642662
# Wrap the response in an operation future.
643663
response = operation_async.from_gapic(
@@ -659,7 +679,9 @@ async def __aexit__(self, exc_type, exc, tb):
659679

660680
try:
661681
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
662-
gapic_version=pkg_resources.get_distribution("google-cloud-vision",).version,
682+
gapic_version=pkg_resources.get_distribution(
683+
"google-cloud-vision",
684+
).version,
663685
)
664686
except pkg_resources.DistributionNotFound:
665687
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py

Lines changed: 77 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ class ImageAnnotatorClientMeta(type):
5656
_transport_registry["grpc"] = ImageAnnotatorGrpcTransport
5757
_transport_registry["grpc_asyncio"] = ImageAnnotatorGrpcAsyncIOTransport
5858

59-
def get_transport_class(cls, label: str = None,) -> Type[ImageAnnotatorTransport]:
59+
def get_transport_class(
60+
cls,
61+
label: str = None,
62+
) -> Type[ImageAnnotatorTransport]:
6063
"""Returns an appropriate transport class.
6164
6265
Args:
@@ -165,10 +168,16 @@ def transport(self) -> ImageAnnotatorTransport:
165168
return self._transport
166169

167170
@staticmethod
168-
def product_path(project: str, location: str, product: str,) -> str:
171+
def product_path(
172+
project: str,
173+
location: str,
174+
product: str,
175+
) -> str:
169176
"""Returns a fully-qualified product string."""
170177
return "projects/{project}/locations/{location}/products/{product}".format(
171-
project=project, location=location, product=product,
178+
project=project,
179+
location=location,
180+
product=product,
172181
)
173182

174183
@staticmethod
@@ -181,10 +190,18 @@ def parse_product_path(path: str) -> Dict[str, str]:
181190
return m.groupdict() if m else {}
182191

183192
@staticmethod
184-
def product_set_path(project: str, location: str, product_set: str,) -> str:
193+
def product_set_path(
194+
project: str,
195+
location: str,
196+
product_set: str,
197+
) -> str:
185198
"""Returns a fully-qualified product_set string."""
186-
return "projects/{project}/locations/{location}/productSets/{product_set}".format(
187-
project=project, location=location, product_set=product_set,
199+
return (
200+
"projects/{project}/locations/{location}/productSets/{product_set}".format(
201+
project=project,
202+
location=location,
203+
product_set=product_set,
204+
)
188205
)
189206

190207
@staticmethod
@@ -197,7 +214,9 @@ def parse_product_set_path(path: str) -> Dict[str, str]:
197214
return m.groupdict() if m else {}
198215

199216
@staticmethod
200-
def common_billing_account_path(billing_account: str,) -> str:
217+
def common_billing_account_path(
218+
billing_account: str,
219+
) -> str:
201220
"""Returns a fully-qualified billing_account string."""
202221
return "billingAccounts/{billing_account}".format(
203222
billing_account=billing_account,
@@ -210,9 +229,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
210229
return m.groupdict() if m else {}
211230

212231
@staticmethod
213-
def common_folder_path(folder: str,) -> str:
232+
def common_folder_path(
233+
folder: str,
234+
) -> str:
214235
"""Returns a fully-qualified folder string."""
215-
return "folders/{folder}".format(folder=folder,)
236+
return "folders/{folder}".format(
237+
folder=folder,
238+
)
216239

217240
@staticmethod
218241
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -221,9 +244,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
221244
return m.groupdict() if m else {}
222245

223246
@staticmethod
224-
def common_organization_path(organization: str,) -> str:
247+
def common_organization_path(
248+
organization: str,
249+
) -> str:
225250
"""Returns a fully-qualified organization string."""
226-
return "organizations/{organization}".format(organization=organization,)
251+
return "organizations/{organization}".format(
252+
organization=organization,
253+
)
227254

228255
@staticmethod
229256
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -232,9 +259,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
232259
return m.groupdict() if m else {}
233260

234261
@staticmethod
235-
def common_project_path(project: str,) -> str:
262+
def common_project_path(
263+
project: str,
264+
) -> str:
236265
"""Returns a fully-qualified project string."""
237-
return "projects/{project}".format(project=project,)
266+
return "projects/{project}".format(
267+
project=project,
268+
)
238269

239270
@staticmethod
240271
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -243,10 +274,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
243274
return m.groupdict() if m else {}
244275

245276
@staticmethod
246-
def common_location_path(project: str, location: str,) -> str:
277+
def common_location_path(
278+
project: str,
279+
location: str,
280+
) -> str:
247281
"""Returns a fully-qualified location string."""
248282
return "projects/{project}/locations/{location}".format(
249-
project=project, location=location,
283+
project=project,
284+
location=location,
250285
)
251286

252287
@staticmethod
@@ -503,7 +538,12 @@ def sample_batch_annotate_images():
503538
rpc = self._transport._wrapped_methods[self._transport.batch_annotate_images]
504539

505540
# Send the request.
506-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
541+
response = rpc(
542+
request,
543+
retry=retry,
544+
timeout=timeout,
545+
metadata=metadata,
546+
)
507547

508548
# Done; return the response.
509549
return response
@@ -597,7 +637,12 @@ def sample_batch_annotate_files():
597637
rpc = self._transport._wrapped_methods[self._transport.batch_annotate_files]
598638

599639
# Send the request.
600-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
640+
response = rpc(
641+
request,
642+
retry=retry,
643+
timeout=timeout,
644+
metadata=metadata,
645+
)
601646

602647
# Done; return the response.
603648
return response
@@ -714,7 +759,12 @@ def sample_async_batch_annotate_images():
714759
]
715760

716761
# Send the request.
717-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
762+
response = rpc(
763+
request,
764+
retry=retry,
765+
timeout=timeout,
766+
metadata=metadata,
767+
)
718768

719769
# Wrap the response in an operation future.
720770
response = operation.from_gapic(
@@ -824,7 +874,12 @@ def sample_async_batch_annotate_files():
824874
]
825875

826876
# Send the request.
827-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
877+
response = rpc(
878+
request,
879+
retry=retry,
880+
timeout=timeout,
881+
metadata=metadata,
882+
)
828883

829884
# Wrap the response in an operation future.
830885
response = operation.from_gapic(
@@ -853,7 +908,9 @@ def __exit__(self, type, value, traceback):
853908

854909
try:
855910
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
856-
gapic_version=pkg_resources.get_distribution("google-cloud-vision",).version,
911+
gapic_version=pkg_resources.get_distribution(
912+
"google-cloud-vision",
913+
).version,
857914
)
858915
except pkg_resources.DistributionNotFound:
859916
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/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-vision",).version,
34+
gapic_version=pkg_resources.get_distribution(
35+
"google-cloud-vision",
36+
).version,
3537
)
3638
except pkg_resources.DistributionNotFound:
3739
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
@@ -188,9 +190,9 @@ def _prep_wrapped_messages(self, client_info):
188190
def close(self):
189191
"""Closes resources associated with the transport.
190192
191-
.. warning::
192-
Only call this method if the transport is NOT shared
193-
with other clients - this may cause errors in other clients!
193+
.. warning::
194+
Only call this method if the transport is NOT shared
195+
with other clients - this may cause errors in other clients!
194196
"""
195197
raise NotImplementedError()
196198

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py

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

231231
@property
232232
def grpc_channel(self) -> grpc.Channel:
233-
"""Return the channel designed to connect to this service.
234-
"""
233+
"""Return the channel designed to connect to this service."""
235234
return self._grpc_channel
236235

237236
@property

0 commit comments

Comments
 (0)