Skip to content

Commit 8f22f04

Browse files
gcf-owl-bot[bot]leahecole
authored andcommitted
chore(python): use black==22.3.0 (#295)
Source-Link: googleapis/synthtool@6fab84a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
1 parent b799764 commit 8f22f04

File tree

10 files changed

+52
-52
lines changed

10 files changed

+52
-52
lines changed

videointelligence/samples/analyze/analyze.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
def analyze_explicit_content(path):
4141
# [START video_analyze_explicit_content]
42-
""" Detects explicit content from the GCS path to a video. """
42+
"""Detects explicit content from the GCS path to a video."""
4343
video_client = videointelligence.VideoIntelligenceServiceClient()
4444
features = [videointelligence.Feature.EXPLICIT_CONTENT_DETECTION]
4545

@@ -62,7 +62,7 @@ def analyze_explicit_content(path):
6262

6363
def analyze_labels(path):
6464
# [START video_analyze_labels_gcs]
65-
""" Detects labels given a GCS path. """
65+
"""Detects labels given a GCS path."""
6666
video_client = videointelligence.VideoIntelligenceServiceClient()
6767
features = [videointelligence.Feature.LABEL_DETECTION]
6868

@@ -231,7 +231,7 @@ def analyze_labels_file(path):
231231

232232
def analyze_shots(path):
233233
# [START video_analyze_shots]
234-
""" Detects camera shot changes. """
234+
"""Detects camera shot changes."""
235235
video_client = videointelligence.VideoIntelligenceServiceClient()
236236
features = [videointelligence.Feature.SHOT_CHANGE_DETECTION]
237237
operation = video_client.annotate_video(

videointelligence/samples/analyze/beta_snippets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def stream_generator():
280280
confidence = annotation.frames[0].confidence
281281
# description is in Unicode
282282
print(
283-
u"{}s: {} (confidence: {})".format(time_offset, description, confidence)
283+
"{}s: {} (confidence: {})".format(time_offset, description, confidence)
284284
)
285285
# [END video_streaming_label_detection_beta]
286286

@@ -420,7 +420,7 @@ def stream_generator():
420420

421421
# description is in Unicode
422422
print("{}s".format(time_offset))
423-
print(u"\tEntity description: {}".format(description))
423+
print("\tEntity description: {}".format(description))
424424
print("\tTrack Id: {}".format(track_id))
425425
if annotation.entity.entity_id:
426426
print("\tEntity id: {}".format(annotation.entity.entity_id))
@@ -728,7 +728,7 @@ def stream_generator():
728728

729729
# description is in Unicode
730730
print("{}s".format(time_offset))
731-
print(u"\tEntity description: {}".format(description))
731+
print("\tEntity description: {}".format(description))
732732
print("\tTrack Id: {}".format(track_id))
733733
if annotation.entity.entity_id:
734734
print("\tEntity id: {}".format(annotation.entity.entity_id))

videointelligence/samples/analyze/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# WARNING - WARNING - WARNING - WARNING - WARNING
3030
# WARNING - WARNING - WARNING - WARNING - WARNING
3131

32-
BLACK_VERSION = "black==19.10b0"
32+
BLACK_VERSION = "black==22.3.0"
3333

3434
# Copy `noxfile_config.py` to your directory and modify it instead.
3535

@@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None:
253253

254254

255255
def _get_repo_root() -> Optional[str]:
256-
""" Returns the root folder of the project. """
256+
"""Returns the root folder of the project."""
257257
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
258258
p = Path(os.getcwd())
259259
for i in range(10):

videointelligence/samples/analyze/video_detect_logo.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def detect_logo(local_file_path="path/to/your/video.mp4"):
3232
request={"features": features, "input_content": input_content}
3333
)
3434

35-
print(u"Waiting for operation to complete...")
35+
print("Waiting for operation to complete...")
3636
response = operation.result()
3737

3838
# Get the first response, since we sent only one video.
@@ -44,61 +44,61 @@ def detect_logo(local_file_path="path/to/your/video.mp4"):
4444

4545
# Opaque entity ID. Some IDs may be available in [Google Knowledge Graph
4646
# Search API](https://developers.google.com/knowledge-graph/).
47-
print(u"Entity Id : {}".format(entity.entity_id))
47+
print("Entity Id : {}".format(entity.entity_id))
4848

49-
print(u"Description : {}".format(entity.description))
49+
print("Description : {}".format(entity.description))
5050

5151
# All logo tracks where the recognized logo appears. Each track corresponds
5252
# to one logo instance appearing in consecutive frames.
5353
for track in logo_recognition_annotation.tracks:
5454
# Video segment of a track.
5555
print(
56-
u"\n\tStart Time Offset : {}.{}".format(
56+
"\n\tStart Time Offset : {}.{}".format(
5757
track.segment.start_time_offset.seconds,
5858
track.segment.start_time_offset.microseconds * 1000,
5959
)
6060
)
6161
print(
62-
u"\tEnd Time Offset : {}.{}".format(
62+
"\tEnd Time Offset : {}.{}".format(
6363
track.segment.end_time_offset.seconds,
6464
track.segment.end_time_offset.microseconds * 1000,
6565
)
6666
)
67-
print(u"\tConfidence : {}".format(track.confidence))
67+
print("\tConfidence : {}".format(track.confidence))
6868

6969
# The object with timestamp and attributes per frame in the track.
7070
for timestamped_object in track.timestamped_objects:
7171

7272
# Normalized Bounding box in a frame, where the object is located.
7373
normalized_bounding_box = timestamped_object.normalized_bounding_box
74-
print(u"\n\t\tLeft : {}".format(normalized_bounding_box.left))
75-
print(u"\t\tTop : {}".format(normalized_bounding_box.top))
76-
print(u"\t\tRight : {}".format(normalized_bounding_box.right))
77-
print(u"\t\tBottom : {}".format(normalized_bounding_box.bottom))
74+
print("\n\t\tLeft : {}".format(normalized_bounding_box.left))
75+
print("\t\tTop : {}".format(normalized_bounding_box.top))
76+
print("\t\tRight : {}".format(normalized_bounding_box.right))
77+
print("\t\tBottom : {}".format(normalized_bounding_box.bottom))
7878

7979
# Optional. The attributes of the object in the bounding box.
8080
for attribute in timestamped_object.attributes:
81-
print(u"\n\t\t\tName : {}".format(attribute.name))
82-
print(u"\t\t\tConfidence : {}".format(attribute.confidence))
83-
print(u"\t\t\tValue : {}".format(attribute.value))
81+
print("\n\t\t\tName : {}".format(attribute.name))
82+
print("\t\t\tConfidence : {}".format(attribute.confidence))
83+
print("\t\t\tValue : {}".format(attribute.value))
8484

8585
# Optional. Attributes in the track level.
8686
for track_attribute in track.attributes:
87-
print(u"\n\t\tName : {}".format(track_attribute.name))
88-
print(u"\t\tConfidence : {}".format(track_attribute.confidence))
89-
print(u"\t\tValue : {}".format(track_attribute.value))
87+
print("\n\t\tName : {}".format(track_attribute.name))
88+
print("\t\tConfidence : {}".format(track_attribute.confidence))
89+
print("\t\tValue : {}".format(track_attribute.value))
9090

9191
# All video segments where the recognized logo appears. There might be
9292
# multiple instances of the same logo class appearing in one VideoSegment.
9393
for segment in logo_recognition_annotation.segments:
9494
print(
95-
u"\n\tStart Time Offset : {}.{}".format(
95+
"\n\tStart Time Offset : {}.{}".format(
9696
segment.start_time_offset.seconds,
9797
segment.start_time_offset.microseconds * 1000,
9898
)
9999
)
100100
print(
101-
u"\tEnd Time Offset : {}.{}".format(
101+
"\tEnd Time Offset : {}.{}".format(
102102
segment.end_time_offset.seconds,
103103
segment.end_time_offset.microseconds * 1000,
104104
)

videointelligence/samples/analyze/video_detect_logo_gcs.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def detect_logo_gcs(input_uri="gs://YOUR_BUCKET_ID/path/to/your/file.mp4"):
2727
request={"features": features, "input_uri": input_uri}
2828
)
2929

30-
print(u"Waiting for operation to complete...")
30+
print("Waiting for operation to complete...")
3131
response = operation.result()
3232

3333
# Get the first response, since we sent only one video.
@@ -39,61 +39,61 @@ def detect_logo_gcs(input_uri="gs://YOUR_BUCKET_ID/path/to/your/file.mp4"):
3939

4040
# Opaque entity ID. Some IDs may be available in [Google Knowledge Graph
4141
# Search API](https://developers.google.com/knowledge-graph/).
42-
print(u"Entity Id : {}".format(entity.entity_id))
42+
print("Entity Id : {}".format(entity.entity_id))
4343

44-
print(u"Description : {}".format(entity.description))
44+
print("Description : {}".format(entity.description))
4545

4646
# All logo tracks where the recognized logo appears. Each track corresponds
4747
# to one logo instance appearing in consecutive frames.
4848
for track in logo_recognition_annotation.tracks:
4949

5050
# Video segment of a track.
5151
print(
52-
u"\n\tStart Time Offset : {}.{}".format(
52+
"\n\tStart Time Offset : {}.{}".format(
5353
track.segment.start_time_offset.seconds,
5454
track.segment.start_time_offset.microseconds * 1000,
5555
)
5656
)
5757
print(
58-
u"\tEnd Time Offset : {}.{}".format(
58+
"\tEnd Time Offset : {}.{}".format(
5959
track.segment.end_time_offset.seconds,
6060
track.segment.end_time_offset.microseconds * 1000,
6161
)
6262
)
63-
print(u"\tConfidence : {}".format(track.confidence))
63+
print("\tConfidence : {}".format(track.confidence))
6464

6565
# The object with timestamp and attributes per frame in the track.
6666
for timestamped_object in track.timestamped_objects:
6767
# Normalized Bounding box in a frame, where the object is located.
6868
normalized_bounding_box = timestamped_object.normalized_bounding_box
69-
print(u"\n\t\tLeft : {}".format(normalized_bounding_box.left))
70-
print(u"\t\tTop : {}".format(normalized_bounding_box.top))
71-
print(u"\t\tRight : {}".format(normalized_bounding_box.right))
72-
print(u"\t\tBottom : {}".format(normalized_bounding_box.bottom))
69+
print("\n\t\tLeft : {}".format(normalized_bounding_box.left))
70+
print("\t\tTop : {}".format(normalized_bounding_box.top))
71+
print("\t\tRight : {}".format(normalized_bounding_box.right))
72+
print("\t\tBottom : {}".format(normalized_bounding_box.bottom))
7373

7474
# Optional. The attributes of the object in the bounding box.
7575
for attribute in timestamped_object.attributes:
76-
print(u"\n\t\t\tName : {}".format(attribute.name))
77-
print(u"\t\t\tConfidence : {}".format(attribute.confidence))
78-
print(u"\t\t\tValue : {}".format(attribute.value))
76+
print("\n\t\t\tName : {}".format(attribute.name))
77+
print("\t\t\tConfidence : {}".format(attribute.confidence))
78+
print("\t\t\tValue : {}".format(attribute.value))
7979

8080
# Optional. Attributes in the track level.
8181
for track_attribute in track.attributes:
82-
print(u"\n\t\tName : {}".format(track_attribute.name))
83-
print(u"\t\tConfidence : {}".format(track_attribute.confidence))
84-
print(u"\t\tValue : {}".format(track_attribute.value))
82+
print("\n\t\tName : {}".format(track_attribute.name))
83+
print("\t\tConfidence : {}".format(track_attribute.confidence))
84+
print("\t\tValue : {}".format(track_attribute.value))
8585

8686
# All video segments where the recognized logo appears. There might be
8787
# multiple instances of the same logo class appearing in one VideoSegment.
8888
for segment in logo_recognition_annotation.segments:
8989
print(
90-
u"\n\tStart Time Offset : {}.{}".format(
90+
"\n\tStart Time Offset : {}.{}".format(
9191
segment.start_time_offset.seconds,
9292
segment.start_time_offset.microseconds * 1000,
9393
)
9494
)
9595
print(
96-
u"\tEnd Time Offset : {}.{}".format(
96+
"\tEnd Time Offset : {}.{}".format(
9797
segment.end_time_offset.seconds,
9898
segment.end_time_offset.microseconds * 1000,
9999
)

videointelligence/samples/labels/labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838

3939
def analyze_labels(path):
40-
""" Detects labels given a GCS path. """
40+
"""Detects labels given a GCS path."""
4141
# [START video_label_tutorial_construct_request]
4242
video_client = videointelligence.VideoIntelligenceServiceClient()
4343
features = [videointelligence.Feature.LABEL_DETECTION]

videointelligence/samples/labels/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# WARNING - WARNING - WARNING - WARNING - WARNING
3030
# WARNING - WARNING - WARNING - WARNING - WARNING
3131

32-
BLACK_VERSION = "black==19.10b0"
32+
BLACK_VERSION = "black==22.3.0"
3333

3434
# Copy `noxfile_config.py` to your directory and modify it instead.
3535

@@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None:
253253

254254

255255
def _get_repo_root() -> Optional[str]:
256-
""" Returns the root folder of the project. """
256+
"""Returns the root folder of the project."""
257257
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
258258
p = Path(os.getcwd())
259259
for i in range(10):

videointelligence/samples/quickstart/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# WARNING - WARNING - WARNING - WARNING - WARNING
3030
# WARNING - WARNING - WARNING - WARNING - WARNING
3131

32-
BLACK_VERSION = "black==19.10b0"
32+
BLACK_VERSION = "black==22.3.0"
3333

3434
# Copy `noxfile_config.py` to your directory and modify it instead.
3535

@@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None:
253253

254254

255255
def _get_repo_root() -> Optional[str]:
256-
""" Returns the root folder of the project. """
256+
"""Returns the root folder of the project."""
257257
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
258258
p = Path(os.getcwd())
259259
for i in range(10):

videointelligence/samples/shotchange/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# WARNING - WARNING - WARNING - WARNING - WARNING
3030
# WARNING - WARNING - WARNING - WARNING - WARNING
3131

32-
BLACK_VERSION = "black==19.10b0"
32+
BLACK_VERSION = "black==22.3.0"
3333

3434
# Copy `noxfile_config.py` to your directory and modify it instead.
3535

@@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None:
253253

254254

255255
def _get_repo_root() -> Optional[str]:
256-
""" Returns the root folder of the project. """
256+
"""Returns the root folder of the project."""
257257
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
258258
p = Path(os.getcwd())
259259
for i in range(10):

videointelligence/samples/shotchange/shotchange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
def analyze_shots(path):
39-
""" Detects camera shot changes. """
39+
"""Detects camera shot changes."""
4040
# [START video_shot_tutorial_construct_request]
4141
video_client = videointelligence.VideoIntelligenceServiceClient()
4242
features = [videointelligence.Feature.SHOT_CHANGE_DETECTION]

0 commit comments

Comments
 (0)