Skip to content

Commit a7c577a

Browse files
chore(python): use black==22.3.0 (#283)
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 ce57843 commit a7c577a

File tree

23 files changed

+1307
-365
lines changed

23 files changed

+1307
-365
lines changed

packages/google-cloud-language/.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:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba
16+
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe

packages/google-cloud-language/docs/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,10 @@
361361
intersphinx_mapping = {
362362
"python": ("https://python.readthedocs.org/en/latest/", None),
363363
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
364-
"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+
),
365368
"grpc": ("https://grpc.github.io/grpc/python/", None),
366369
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
367370
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),

packages/google-cloud-language/google/cloud/language_v1/services/language_service/async_client.py

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,12 @@ def sample_analyze_sentiment():
301301
)
302302

303303
# Send the request.
304-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
304+
response = await rpc(
305+
request,
306+
retry=retry,
307+
timeout=timeout,
308+
metadata=metadata,
309+
)
305310

306311
# Done; return the response.
307312
return response
@@ -407,7 +412,12 @@ def sample_analyze_entities():
407412
)
408413

409414
# Send the request.
410-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
415+
response = await rpc(
416+
request,
417+
retry=retry,
418+
timeout=timeout,
419+
metadata=metadata,
420+
)
411421

412422
# Done; return the response.
413423
return response
@@ -516,7 +526,12 @@ def sample_analyze_entity_sentiment():
516526
)
517527

518528
# Send the request.
519-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
529+
response = await rpc(
530+
request,
531+
retry=retry,
532+
timeout=timeout,
533+
metadata=metadata,
534+
)
520535

521536
# Done; return the response.
522537
return response
@@ -621,7 +636,12 @@ def sample_analyze_syntax():
621636
)
622637

623638
# Send the request.
624-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
639+
response = await rpc(
640+
request,
641+
retry=retry,
642+
timeout=timeout,
643+
metadata=metadata,
644+
)
625645

626646
# Done; return the response.
627647
return response
@@ -716,7 +736,12 @@ def sample_classify_text():
716736
)
717737

718738
# Send the request.
719-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
739+
response = await rpc(
740+
request,
741+
retry=retry,
742+
timeout=timeout,
743+
metadata=metadata,
744+
)
720745

721746
# Done; return the response.
722747
return response
@@ -833,7 +858,12 @@ def sample_annotate_text():
833858
)
834859

835860
# Send the request.
836-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
861+
response = await rpc(
862+
request,
863+
retry=retry,
864+
timeout=timeout,
865+
metadata=metadata,
866+
)
837867

838868
# Done; return the response.
839869
return response
@@ -847,7 +877,9 @@ async def __aexit__(self, exc_type, exc, tb):
847877

848878
try:
849879
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
850-
gapic_version=pkg_resources.get_distribution("google-cloud-language",).version,
880+
gapic_version=pkg_resources.get_distribution(
881+
"google-cloud-language",
882+
).version,
851883
)
852884
except pkg_resources.DistributionNotFound:
853885
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-language/google/cloud/language_v1/services/language_service/client.py

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ class LanguageServiceClientMeta(type):
5454
_transport_registry["grpc"] = LanguageServiceGrpcTransport
5555
_transport_registry["grpc_asyncio"] = LanguageServiceGrpcAsyncIOTransport
5656

57-
def get_transport_class(cls, label: str = None,) -> Type[LanguageServiceTransport]:
57+
def get_transport_class(
58+
cls,
59+
label: str = None,
60+
) -> Type[LanguageServiceTransport]:
5861
"""Returns an appropriate transport class.
5962
6063
Args:
@@ -161,7 +164,9 @@ def transport(self) -> LanguageServiceTransport:
161164
return self._transport
162165

163166
@staticmethod
164-
def common_billing_account_path(billing_account: str,) -> str:
167+
def common_billing_account_path(
168+
billing_account: str,
169+
) -> str:
165170
"""Returns a fully-qualified billing_account string."""
166171
return "billingAccounts/{billing_account}".format(
167172
billing_account=billing_account,
@@ -174,9 +179,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
174179
return m.groupdict() if m else {}
175180

176181
@staticmethod
177-
def common_folder_path(folder: str,) -> str:
182+
def common_folder_path(
183+
folder: str,
184+
) -> str:
178185
"""Returns a fully-qualified folder string."""
179-
return "folders/{folder}".format(folder=folder,)
186+
return "folders/{folder}".format(
187+
folder=folder,
188+
)
180189

181190
@staticmethod
182191
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -185,9 +194,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
185194
return m.groupdict() if m else {}
186195

187196
@staticmethod
188-
def common_organization_path(organization: str,) -> str:
197+
def common_organization_path(
198+
organization: str,
199+
) -> str:
189200
"""Returns a fully-qualified organization string."""
190-
return "organizations/{organization}".format(organization=organization,)
201+
return "organizations/{organization}".format(
202+
organization=organization,
203+
)
191204

192205
@staticmethod
193206
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -196,9 +209,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
196209
return m.groupdict() if m else {}
197210

198211
@staticmethod
199-
def common_project_path(project: str,) -> str:
212+
def common_project_path(
213+
project: str,
214+
) -> str:
200215
"""Returns a fully-qualified project string."""
201-
return "projects/{project}".format(project=project,)
216+
return "projects/{project}".format(
217+
project=project,
218+
)
202219

203220
@staticmethod
204221
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -207,10 +224,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
207224
return m.groupdict() if m else {}
208225

209226
@staticmethod
210-
def common_location_path(project: str, location: str,) -> str:
227+
def common_location_path(
228+
project: str,
229+
location: str,
230+
) -> str:
211231
"""Returns a fully-qualified location string."""
212232
return "projects/{project}/locations/{location}".format(
213-
project=project, location=location,
233+
project=project,
234+
location=location,
214235
)
215236

216237
@staticmethod
@@ -474,7 +495,12 @@ def sample_analyze_sentiment():
474495
rpc = self._transport._wrapped_methods[self._transport.analyze_sentiment]
475496

476497
# Send the request.
477-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
498+
response = rpc(
499+
request,
500+
retry=retry,
501+
timeout=timeout,
502+
metadata=metadata,
503+
)
478504

479505
# Done; return the response.
480506
return response
@@ -570,7 +596,12 @@ def sample_analyze_entities():
570596
rpc = self._transport._wrapped_methods[self._transport.analyze_entities]
571597

572598
# Send the request.
573-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
599+
response = rpc(
600+
request,
601+
retry=retry,
602+
timeout=timeout,
603+
metadata=metadata,
604+
)
574605

575606
# Done; return the response.
576607
return response
@@ -669,7 +700,12 @@ def sample_analyze_entity_sentiment():
669700
rpc = self._transport._wrapped_methods[self._transport.analyze_entity_sentiment]
670701

671702
# Send the request.
672-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
703+
response = rpc(
704+
request,
705+
retry=retry,
706+
timeout=timeout,
707+
metadata=metadata,
708+
)
673709

674710
# Done; return the response.
675711
return response
@@ -764,7 +800,12 @@ def sample_analyze_syntax():
764800
rpc = self._transport._wrapped_methods[self._transport.analyze_syntax]
765801

766802
# Send the request.
767-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
803+
response = rpc(
804+
request,
805+
retry=retry,
806+
timeout=timeout,
807+
metadata=metadata,
808+
)
768809

769810
# Done; return the response.
770811
return response
@@ -849,7 +890,12 @@ def sample_classify_text():
849890
rpc = self._transport._wrapped_methods[self._transport.classify_text]
850891

851892
# Send the request.
852-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
893+
response = rpc(
894+
request,
895+
retry=retry,
896+
timeout=timeout,
897+
metadata=metadata,
898+
)
853899

854900
# Done; return the response.
855901
return response
@@ -956,7 +1002,12 @@ def sample_annotate_text():
9561002
rpc = self._transport._wrapped_methods[self._transport.annotate_text]
9571003

9581004
# Send the request.
959-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
1005+
response = rpc(
1006+
request,
1007+
retry=retry,
1008+
timeout=timeout,
1009+
metadata=metadata,
1010+
)
9601011

9611012
# Done; return the response.
9621013
return response
@@ -977,7 +1028,9 @@ def __exit__(self, type, value, traceback):
9771028

9781029
try:
9791030
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
980-
gapic_version=pkg_resources.get_distribution("google-cloud-language",).version,
1031+
gapic_version=pkg_resources.get_distribution(
1032+
"google-cloud-language",
1033+
).version,
9811034
)
9821035
except pkg_resources.DistributionNotFound:
9831036
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-language/google/cloud/language_v1/services/language_service/transports/base.py

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

3030
try:
3131
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution("google-cloud-language",).version,
32+
gapic_version=pkg_resources.get_distribution(
33+
"google-cloud-language",
34+
).version,
3335
)
3436
except pkg_resources.DistributionNotFound:
3537
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
@@ -216,9 +218,9 @@ def _prep_wrapped_messages(self, client_info):
216218
def close(self):
217219
"""Closes resources associated with the transport.
218220
219-
.. warning::
220-
Only call this method if the transport is NOT shared
221-
with other clients - this may cause errors in other clients!
221+
.. warning::
222+
Only call this method if the transport is NOT shared
223+
with other clients - this may cause errors in other clients!
222224
"""
223225
raise NotImplementedError()
224226

packages/google-cloud-language/google/cloud/language_v1/services/language_service/transports/grpc.py

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

226226
@property
227227
def grpc_channel(self) -> grpc.Channel:
228-
"""Return the channel designed to connect to this service.
229-
"""
228+
"""Return the channel designed to connect to this service."""
230229
return self._grpc_channel
231230

232231
@property

0 commit comments

Comments
 (0)