From 7d003fc0eba517bbf9089896174ebe065dd7860a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:46:10 +0000 Subject: [PATCH] chore(python): use black==22.3.0 (#295) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- videointelligence/samples/analyze/analyze.py | 6 ++-- .../samples/analyze/beta_snippets.py | 6 ++-- videointelligence/samples/analyze/noxfile.py | 4 +-- .../samples/analyze/video_detect_logo.py | 36 +++++++++---------- .../samples/analyze/video_detect_logo_gcs.py | 36 +++++++++---------- videointelligence/samples/labels/labels.py | 2 +- videointelligence/samples/labels/noxfile.py | 4 +-- .../samples/quickstart/noxfile.py | 4 +-- .../samples/shotchange/noxfile.py | 4 +-- .../samples/shotchange/shotchange.py | 2 +- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/videointelligence/samples/analyze/analyze.py b/videointelligence/samples/analyze/analyze.py index 2af996c8801d..cbe700c5b4be 100644 --- a/videointelligence/samples/analyze/analyze.py +++ b/videointelligence/samples/analyze/analyze.py @@ -39,7 +39,7 @@ def analyze_explicit_content(path): # [START video_analyze_explicit_content] - """ Detects explicit content from the GCS path to a video. """ + """Detects explicit content from the GCS path to a video.""" video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.Feature.EXPLICIT_CONTENT_DETECTION] @@ -62,7 +62,7 @@ def analyze_explicit_content(path): def analyze_labels(path): # [START video_analyze_labels_gcs] - """ Detects labels given a GCS path. """ + """Detects labels given a GCS path.""" video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.Feature.LABEL_DETECTION] @@ -231,7 +231,7 @@ def analyze_labels_file(path): def analyze_shots(path): # [START video_analyze_shots] - """ Detects camera shot changes. """ + """Detects camera shot changes.""" video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.Feature.SHOT_CHANGE_DETECTION] operation = video_client.annotate_video( diff --git a/videointelligence/samples/analyze/beta_snippets.py b/videointelligence/samples/analyze/beta_snippets.py index ac78f355433c..f653d5ef0963 100644 --- a/videointelligence/samples/analyze/beta_snippets.py +++ b/videointelligence/samples/analyze/beta_snippets.py @@ -280,7 +280,7 @@ def stream_generator(): confidence = annotation.frames[0].confidence # description is in Unicode print( - u"{}s: {} (confidence: {})".format(time_offset, description, confidence) + "{}s: {} (confidence: {})".format(time_offset, description, confidence) ) # [END video_streaming_label_detection_beta] @@ -420,7 +420,7 @@ def stream_generator(): # description is in Unicode print("{}s".format(time_offset)) - print(u"\tEntity description: {}".format(description)) + print("\tEntity description: {}".format(description)) print("\tTrack Id: {}".format(track_id)) if annotation.entity.entity_id: print("\tEntity id: {}".format(annotation.entity.entity_id)) @@ -728,7 +728,7 @@ def stream_generator(): # description is in Unicode print("{}s".format(time_offset)) - print(u"\tEntity description: {}".format(description)) + print("\tEntity description: {}".format(description)) print("\tTrack Id: {}".format(track_id)) if annotation.entity.entity_id: print("\tEntity id: {}".format(annotation.entity.entity_id)) diff --git a/videointelligence/samples/analyze/noxfile.py b/videointelligence/samples/analyze/noxfile.py index 85f5836dba3a..25f87a215d4c 100644 --- a/videointelligence/samples/analyze/noxfile.py +++ b/videointelligence/samples/analyze/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/videointelligence/samples/analyze/video_detect_logo.py b/videointelligence/samples/analyze/video_detect_logo.py index fbd0018f0c0b..b781fda90b0e 100644 --- a/videointelligence/samples/analyze/video_detect_logo.py +++ b/videointelligence/samples/analyze/video_detect_logo.py @@ -32,7 +32,7 @@ def detect_logo(local_file_path="path/to/your/video.mp4"): request={"features": features, "input_content": input_content} ) - print(u"Waiting for operation to complete...") + print("Waiting for operation to complete...") response = operation.result() # 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"): # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph # Search API](https://developers.google.com/knowledge-graph/). - print(u"Entity Id : {}".format(entity.entity_id)) + print("Entity Id : {}".format(entity.entity_id)) - print(u"Description : {}".format(entity.description)) + print("Description : {}".format(entity.description)) # All logo tracks where the recognized logo appears. Each track corresponds # to one logo instance appearing in consecutive frames. for track in logo_recognition_annotation.tracks: # Video segment of a track. print( - u"\n\tStart Time Offset : {}.{}".format( + "\n\tStart Time Offset : {}.{}".format( track.segment.start_time_offset.seconds, track.segment.start_time_offset.microseconds * 1000, ) ) print( - u"\tEnd Time Offset : {}.{}".format( + "\tEnd Time Offset : {}.{}".format( track.segment.end_time_offset.seconds, track.segment.end_time_offset.microseconds * 1000, ) ) - print(u"\tConfidence : {}".format(track.confidence)) + print("\tConfidence : {}".format(track.confidence)) # The object with timestamp and attributes per frame in the track. for timestamped_object in track.timestamped_objects: # Normalized Bounding box in a frame, where the object is located. normalized_bounding_box = timestamped_object.normalized_bounding_box - print(u"\n\t\tLeft : {}".format(normalized_bounding_box.left)) - print(u"\t\tTop : {}".format(normalized_bounding_box.top)) - print(u"\t\tRight : {}".format(normalized_bounding_box.right)) - print(u"\t\tBottom : {}".format(normalized_bounding_box.bottom)) + print("\n\t\tLeft : {}".format(normalized_bounding_box.left)) + print("\t\tTop : {}".format(normalized_bounding_box.top)) + print("\t\tRight : {}".format(normalized_bounding_box.right)) + print("\t\tBottom : {}".format(normalized_bounding_box.bottom)) # Optional. The attributes of the object in the bounding box. for attribute in timestamped_object.attributes: - print(u"\n\t\t\tName : {}".format(attribute.name)) - print(u"\t\t\tConfidence : {}".format(attribute.confidence)) - print(u"\t\t\tValue : {}".format(attribute.value)) + print("\n\t\t\tName : {}".format(attribute.name)) + print("\t\t\tConfidence : {}".format(attribute.confidence)) + print("\t\t\tValue : {}".format(attribute.value)) # Optional. Attributes in the track level. for track_attribute in track.attributes: - print(u"\n\t\tName : {}".format(track_attribute.name)) - print(u"\t\tConfidence : {}".format(track_attribute.confidence)) - print(u"\t\tValue : {}".format(track_attribute.value)) + print("\n\t\tName : {}".format(track_attribute.name)) + print("\t\tConfidence : {}".format(track_attribute.confidence)) + print("\t\tValue : {}".format(track_attribute.value)) # All video segments where the recognized logo appears. There might be # multiple instances of the same logo class appearing in one VideoSegment. for segment in logo_recognition_annotation.segments: print( - u"\n\tStart Time Offset : {}.{}".format( + "\n\tStart Time Offset : {}.{}".format( segment.start_time_offset.seconds, segment.start_time_offset.microseconds * 1000, ) ) print( - u"\tEnd Time Offset : {}.{}".format( + "\tEnd Time Offset : {}.{}".format( segment.end_time_offset.seconds, segment.end_time_offset.microseconds * 1000, ) diff --git a/videointelligence/samples/analyze/video_detect_logo_gcs.py b/videointelligence/samples/analyze/video_detect_logo_gcs.py index 68db2e8bb634..faf6ee5f1c09 100644 --- a/videointelligence/samples/analyze/video_detect_logo_gcs.py +++ b/videointelligence/samples/analyze/video_detect_logo_gcs.py @@ -27,7 +27,7 @@ def detect_logo_gcs(input_uri="gs://YOUR_BUCKET_ID/path/to/your/file.mp4"): request={"features": features, "input_uri": input_uri} ) - print(u"Waiting for operation to complete...") + print("Waiting for operation to complete...") response = operation.result() # Get the first response, since we sent only one video. @@ -39,9 +39,9 @@ def detect_logo_gcs(input_uri="gs://YOUR_BUCKET_ID/path/to/your/file.mp4"): # Opaque entity ID. Some IDs may be available in [Google Knowledge Graph # Search API](https://developers.google.com/knowledge-graph/). - print(u"Entity Id : {}".format(entity.entity_id)) + print("Entity Id : {}".format(entity.entity_id)) - print(u"Description : {}".format(entity.description)) + print("Description : {}".format(entity.description)) # All logo tracks where the recognized logo appears. Each track corresponds # to one logo instance appearing in consecutive frames. @@ -49,51 +49,51 @@ def detect_logo_gcs(input_uri="gs://YOUR_BUCKET_ID/path/to/your/file.mp4"): # Video segment of a track. print( - u"\n\tStart Time Offset : {}.{}".format( + "\n\tStart Time Offset : {}.{}".format( track.segment.start_time_offset.seconds, track.segment.start_time_offset.microseconds * 1000, ) ) print( - u"\tEnd Time Offset : {}.{}".format( + "\tEnd Time Offset : {}.{}".format( track.segment.end_time_offset.seconds, track.segment.end_time_offset.microseconds * 1000, ) ) - print(u"\tConfidence : {}".format(track.confidence)) + print("\tConfidence : {}".format(track.confidence)) # The object with timestamp and attributes per frame in the track. for timestamped_object in track.timestamped_objects: # Normalized Bounding box in a frame, where the object is located. normalized_bounding_box = timestamped_object.normalized_bounding_box - print(u"\n\t\tLeft : {}".format(normalized_bounding_box.left)) - print(u"\t\tTop : {}".format(normalized_bounding_box.top)) - print(u"\t\tRight : {}".format(normalized_bounding_box.right)) - print(u"\t\tBottom : {}".format(normalized_bounding_box.bottom)) + print("\n\t\tLeft : {}".format(normalized_bounding_box.left)) + print("\t\tTop : {}".format(normalized_bounding_box.top)) + print("\t\tRight : {}".format(normalized_bounding_box.right)) + print("\t\tBottom : {}".format(normalized_bounding_box.bottom)) # Optional. The attributes of the object in the bounding box. for attribute in timestamped_object.attributes: - print(u"\n\t\t\tName : {}".format(attribute.name)) - print(u"\t\t\tConfidence : {}".format(attribute.confidence)) - print(u"\t\t\tValue : {}".format(attribute.value)) + print("\n\t\t\tName : {}".format(attribute.name)) + print("\t\t\tConfidence : {}".format(attribute.confidence)) + print("\t\t\tValue : {}".format(attribute.value)) # Optional. Attributes in the track level. for track_attribute in track.attributes: - print(u"\n\t\tName : {}".format(track_attribute.name)) - print(u"\t\tConfidence : {}".format(track_attribute.confidence)) - print(u"\t\tValue : {}".format(track_attribute.value)) + print("\n\t\tName : {}".format(track_attribute.name)) + print("\t\tConfidence : {}".format(track_attribute.confidence)) + print("\t\tValue : {}".format(track_attribute.value)) # All video segments where the recognized logo appears. There might be # multiple instances of the same logo class appearing in one VideoSegment. for segment in logo_recognition_annotation.segments: print( - u"\n\tStart Time Offset : {}.{}".format( + "\n\tStart Time Offset : {}.{}".format( segment.start_time_offset.seconds, segment.start_time_offset.microseconds * 1000, ) ) print( - u"\tEnd Time Offset : {}.{}".format( + "\tEnd Time Offset : {}.{}".format( segment.end_time_offset.seconds, segment.end_time_offset.microseconds * 1000, ) diff --git a/videointelligence/samples/labels/labels.py b/videointelligence/samples/labels/labels.py index 8f8c31ddd0c1..eadae99a36c4 100644 --- a/videointelligence/samples/labels/labels.py +++ b/videointelligence/samples/labels/labels.py @@ -37,7 +37,7 @@ def analyze_labels(path): - """ Detects labels given a GCS path. """ + """Detects labels given a GCS path.""" # [START video_label_tutorial_construct_request] video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.Feature.LABEL_DETECTION] diff --git a/videointelligence/samples/labels/noxfile.py b/videointelligence/samples/labels/noxfile.py index 85f5836dba3a..25f87a215d4c 100644 --- a/videointelligence/samples/labels/noxfile.py +++ b/videointelligence/samples/labels/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/videointelligence/samples/quickstart/noxfile.py b/videointelligence/samples/quickstart/noxfile.py index 85f5836dba3a..25f87a215d4c 100644 --- a/videointelligence/samples/quickstart/noxfile.py +++ b/videointelligence/samples/quickstart/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/videointelligence/samples/shotchange/noxfile.py b/videointelligence/samples/shotchange/noxfile.py index 85f5836dba3a..25f87a215d4c 100644 --- a/videointelligence/samples/shotchange/noxfile.py +++ b/videointelligence/samples/shotchange/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/videointelligence/samples/shotchange/shotchange.py b/videointelligence/samples/shotchange/shotchange.py index 241289f96a62..c55ce77a6276 100644 --- a/videointelligence/samples/shotchange/shotchange.py +++ b/videointelligence/samples/shotchange/shotchange.py @@ -36,7 +36,7 @@ def analyze_shots(path): - """ Detects camera shot changes. """ + """Detects camera shot changes.""" # [START video_shot_tutorial_construct_request] video_client = videointelligence.VideoIntelligenceServiceClient() features = [videointelligence.Feature.SHOT_CHANGE_DETECTION]