Skip to content

Commit 4c972fa

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

12 files changed

+149
-47
lines changed

video/transcoder/create_job_from_ad_hoc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def create_job_from_ad_hoc(project_id, location, input_uri, output_uri):
100100
parser = argparse.ArgumentParser()
101101
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
102102
parser.add_argument(
103-
"--location", help="The location to start this job in.", default="us-central1",
103+
"--location",
104+
help="The location to start this job in.",
105+
default="us-central1",
104106
)
105107
parser.add_argument(
106108
"--input_uri",
@@ -114,5 +116,8 @@ def create_job_from_ad_hoc(project_id, location, input_uri, output_uri):
114116
)
115117
args = parser.parse_args()
116118
create_job_from_ad_hoc(
117-
args.project_id, args.location, args.input_uri, args.output_uri,
119+
args.project_id,
120+
args.location,
121+
args.input_uri,
122+
args.output_uri,
118123
)

video/transcoder/create_job_from_preset.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def create_job_from_preset(project_id, location, input_uri, output_uri, preset):
5959
parser = argparse.ArgumentParser()
6060
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
6161
parser.add_argument(
62-
"--location", help="The location to start this job in.", default="us-central1",
62+
"--location",
63+
help="The location to start this job in.",
64+
default="us-central1",
6365
)
6466
parser.add_argument(
6567
"--input_uri",
@@ -78,5 +80,9 @@ def create_job_from_preset(project_id, location, input_uri, output_uri, preset):
7880
)
7981
args = parser.parse_args()
8082
create_job_from_preset(
81-
args.project_id, args.location, args.input_uri, args.output_uri, args.preset,
83+
args.project_id,
84+
args.location,
85+
args.input_uri,
86+
args.output_uri,
87+
args.preset,
8288
)

video/transcoder/create_job_from_template.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def create_job_from_template(project_id, location, input_uri, output_uri, templa
5959
parser = argparse.ArgumentParser()
6060
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
6161
parser.add_argument(
62-
"--location", help="The location to start this job in.", default="us-central1",
62+
"--location",
63+
help="The location to start this job in.",
64+
default="us-central1",
6365
)
6466
parser.add_argument(
6567
"--input_uri",

video/transcoder/create_job_with_animated_overlay.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def create_job_with_animated_overlay(
8181
image=transcoder_v1.types.Overlay.Image(
8282
uri=overlay_image_uri,
8383
resolution=transcoder_v1.types.Overlay.NormalizedCoordinate(
84-
x=0, y=0,
84+
x=0,
85+
y=0,
8586
),
8687
alpha=1,
8788
),
@@ -90,20 +91,30 @@ def create_job_with_animated_overlay(
9091
animation_fade=transcoder_v1.types.Overlay.AnimationFade(
9192
fade_type=transcoder_v1.types.Overlay.FadeType.FADE_IN,
9293
xy=transcoder_v1.types.Overlay.NormalizedCoordinate(
93-
x=0.5, y=0.5,
94+
x=0.5,
95+
y=0.5,
96+
),
97+
start_time_offset=duration.Duration(
98+
seconds=5,
99+
),
100+
end_time_offset=duration.Duration(
101+
seconds=10,
94102
),
95-
start_time_offset=duration.Duration(seconds=5,),
96-
end_time_offset=duration.Duration(seconds=10,),
97103
),
98104
),
99105
transcoder_v1.types.Overlay.Animation(
100106
animation_fade=transcoder_v1.types.Overlay.AnimationFade(
101107
fade_type=transcoder_v1.types.Overlay.FadeType.FADE_OUT,
102108
xy=transcoder_v1.types.Overlay.NormalizedCoordinate(
103-
x=0.5, y=0.5,
109+
x=0.5,
110+
y=0.5,
111+
),
112+
start_time_offset=duration.Duration(
113+
seconds=12,
114+
),
115+
end_time_offset=duration.Duration(
116+
seconds=15,
104117
),
105-
start_time_offset=duration.Duration(seconds=12,),
106-
end_time_offset=duration.Duration(seconds=15,),
107118
),
108119
),
109120
],
@@ -121,7 +132,9 @@ def create_job_with_animated_overlay(
121132
parser = argparse.ArgumentParser()
122133
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
123134
parser.add_argument(
124-
"--location", help="The location to start this job in.", default="us-central1",
135+
"--location",
136+
help="The location to start this job in.",
137+
default="us-central1",
125138
)
126139
parser.add_argument(
127140
"--input_uri",

video/transcoder/create_job_with_concatenated_inputs.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,14 @@ def create_job_with_concatenated_inputs(
8080
job.output_uri = output_uri
8181
job.config = transcoder_v1.types.JobConfig(
8282
inputs=[
83-
transcoder_v1.types.Input(key="input1", uri=input1_uri,),
84-
transcoder_v1.types.Input(key="input2", uri=input2_uri,),
83+
transcoder_v1.types.Input(
84+
key="input1",
85+
uri=input1_uri,
86+
),
87+
transcoder_v1.types.Input(
88+
key="input2",
89+
uri=input2_uri,
90+
),
8591
],
8692
edit_list=[
8793
transcoder_v1.types.EditAtom(
@@ -135,7 +141,9 @@ def create_job_with_concatenated_inputs(
135141
parser = argparse.ArgumentParser()
136142
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
137143
parser.add_argument(
138-
"--location", help="The location to start this job in.", default="us-central1",
144+
"--location",
145+
help="The location to start this job in.",
146+
default="us-central1",
139147
)
140148
parser.add_argument(
141149
"--input1_uri",

video/transcoder/create_job_with_embedded_captions.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232

3333

3434
def create_job_with_embedded_captions(
35-
project_id, location, input_video_uri, input_captions_uri, output_uri,
35+
project_id,
36+
location,
37+
input_video_uri,
38+
input_captions_uri,
39+
output_uri,
3640
):
3741
"""Creates a job based on an ad-hoc job configuration that embeds captions in the output video.
3842
@@ -53,12 +57,19 @@ def create_job_with_embedded_captions(
5357
job.output_uri = output_uri
5458
job.config = transcoder_v1.types.JobConfig(
5559
inputs=[
56-
transcoder_v1.types.Input(key="input0", uri=input_video_uri,),
57-
transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,),
60+
transcoder_v1.types.Input(
61+
key="input0",
62+
uri=input_video_uri,
63+
),
64+
transcoder_v1.types.Input(
65+
key="caption-input0",
66+
uri=input_captions_uri,
67+
),
5868
],
5969
edit_list=[
6070
transcoder_v1.types.EditAtom(
61-
key="atom0", inputs=["input0", "caption-input0"],
71+
key="atom0",
72+
inputs=["input0", "caption-input0"],
6273
),
6374
],
6475
elementary_streams=[
@@ -85,7 +96,9 @@ def create_job_with_embedded_captions(
8596
codec="cea608",
8697
mapping_=[
8798
transcoder_v1.types.TextStream.TextMapping(
88-
atom_key="atom0", input_key="caption-input0", input_track=0,
99+
atom_key="atom0",
100+
input_key="caption-input0",
101+
input_track=0,
89102
),
90103
],
91104
),
@@ -103,7 +116,9 @@ def create_job_with_embedded_captions(
103116
elementary_streams=["video-stream0", "audio-stream0"],
104117
),
105118
transcoder_v1.types.MuxStream(
106-
key="sd-dash", container="fmp4", elementary_streams=["video-stream0"],
119+
key="sd-dash",
120+
container="fmp4",
121+
elementary_streams=["video-stream0"],
107122
),
108123
transcoder_v1.types.MuxStream(
109124
key="audio-dash",
@@ -113,7 +128,9 @@ def create_job_with_embedded_captions(
113128
],
114129
manifests=[
115130
transcoder_v1.types.Manifest(
116-
file_name="manifest.m3u8", type_="HLS", mux_streams=["sd-hls"],
131+
file_name="manifest.m3u8",
132+
type_="HLS",
133+
mux_streams=["sd-hls"],
117134
),
118135
transcoder_v1.types.Manifest(
119136
file_name="manifest.mpd",
@@ -133,7 +150,9 @@ def create_job_with_embedded_captions(
133150
parser = argparse.ArgumentParser()
134151
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
135152
parser.add_argument(
136-
"--location", help="The location to start this job in.", default="us-central1",
153+
"--location",
154+
help="The location to start this job in.",
155+
default="us-central1",
137156
)
138157
parser.add_argument(
139158
"--input_video_uri",

video/transcoder/create_job_with_periodic_images_spritesheet.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,18 @@ def create_job_with_periodic_images_spritesheet(
8888
file_prefix="small-sprite-sheet",
8989
sprite_width_pixels=64,
9090
sprite_height_pixels=32,
91-
interval=duration.Duration(seconds=7,),
91+
interval=duration.Duration(
92+
seconds=7,
93+
),
9294
),
9395
# Generate a sprite sheet with 128x72px images. An image is taken every 7 seconds from the video.
9496
transcoder_v1.types.SpriteSheet(
9597
file_prefix="large-sprite-sheet",
9698
sprite_width_pixels=128,
9799
sprite_height_pixels=72,
98-
interval=duration.Duration(seconds=7,),
100+
interval=duration.Duration(
101+
seconds=7,
102+
),
99103
),
100104
],
101105
)
@@ -110,7 +114,9 @@ def create_job_with_periodic_images_spritesheet(
110114
parser = argparse.ArgumentParser()
111115
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
112116
parser.add_argument(
113-
"--location", help="The location to start this job in.", default="us-central1",
117+
"--location",
118+
help="The location to start this job in.",
119+
default="us-central1",
114120
)
115121
parser.add_argument(
116122
"--input_uri",
@@ -124,5 +130,8 @@ def create_job_with_periodic_images_spritesheet(
124130
)
125131
args = parser.parse_args()
126132
create_job_with_periodic_images_spritesheet(
127-
args.project_id, args.location, args.input_uri, args.output_uri,
133+
args.project_id,
134+
args.location,
135+
args.input_uri,
136+
args.output_uri,
128137
)

video/transcoder/create_job_with_set_number_images_spritesheet.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def create_job_with_set_number_images_spritesheet(
113113
parser = argparse.ArgumentParser()
114114
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
115115
parser.add_argument(
116-
"--location", help="The location to start this job in.", default="us-central1",
116+
"--location",
117+
help="The location to start this job in.",
118+
default="us-central1",
117119
)
118120
parser.add_argument(
119121
"--input_uri",
@@ -127,5 +129,8 @@ def create_job_with_set_number_images_spritesheet(
127129
)
128130
args = parser.parse_args()
129131
create_job_with_set_number_images_spritesheet(
130-
args.project_id, args.location, args.input_uri, args.output_uri,
132+
args.project_id,
133+
args.location,
134+
args.input_uri,
135+
args.output_uri,
131136
)

video/transcoder/create_job_with_standalone_captions.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333

3434

3535
def create_job_with_standalone_captions(
36-
project_id, location, input_video_uri, input_captions_uri, output_uri,
36+
project_id,
37+
location,
38+
input_video_uri,
39+
input_captions_uri,
40+
output_uri,
3741
):
3842
"""Creates a job based on an ad-hoc job configuration that can use captions from a standalone file.
3943
@@ -54,12 +58,19 @@ def create_job_with_standalone_captions(
5458
job.output_uri = output_uri
5559
job.config = transcoder_v1.types.JobConfig(
5660
inputs=[
57-
transcoder_v1.types.Input(key="input0", uri=input_video_uri,),
58-
transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,),
61+
transcoder_v1.types.Input(
62+
key="input0",
63+
uri=input_video_uri,
64+
),
65+
transcoder_v1.types.Input(
66+
key="caption-input0",
67+
uri=input_captions_uri,
68+
),
5969
],
6070
edit_list=[
6171
transcoder_v1.types.EditAtom(
62-
key="atom0", inputs=["input0", "caption-input0"],
72+
key="atom0",
73+
inputs=["input0", "caption-input0"],
6374
),
6475
],
6576
elementary_streams=[
@@ -86,7 +97,9 @@ def create_job_with_standalone_captions(
8697
codec="webvtt",
8798
mapping_=[
8899
transcoder_v1.types.TextStream.TextMapping(
89-
atom_key="atom0", input_key="caption-input0", input_track=0,
100+
atom_key="atom0",
101+
input_key="caption-input0",
102+
input_track=0,
90103
),
91104
],
92105
),
@@ -108,7 +121,9 @@ def create_job_with_standalone_captions(
108121
container="vtt",
109122
elementary_streams=["vtt-stream0"],
110123
segment_settings=transcoder_v1.types.SegmentSettings(
111-
segment_duration=duration.Duration(seconds=6,),
124+
segment_duration=duration.Duration(
125+
seconds=6,
126+
),
112127
individual_segments=True,
113128
),
114129
),
@@ -132,7 +147,9 @@ def create_job_with_standalone_captions(
132147
parser = argparse.ArgumentParser()
133148
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
134149
parser.add_argument(
135-
"--location", help="The location to start this job in.", default="us-central1",
150+
"--location",
151+
help="The location to start this job in.",
152+
default="us-central1",
136153
)
137154
parser.add_argument(
138155
"--input_video_uri",

video/transcoder/create_job_with_static_overlay.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,28 @@ def create_job_with_static_overlay(
8181
image=transcoder_v1.types.Overlay.Image(
8282
uri=overlay_image_uri,
8383
resolution=transcoder_v1.types.Overlay.NormalizedCoordinate(
84-
x=1, y=0.5,
84+
x=1,
85+
y=0.5,
8586
),
8687
alpha=1,
8788
),
8889
animations=[
8990
transcoder_v1.types.Overlay.Animation(
9091
animation_static=transcoder_v1.types.Overlay.AnimationStatic(
9192
xy=transcoder_v1.types.Overlay.NormalizedCoordinate(
92-
x=0, y=0,
93+
x=0,
94+
y=0,
95+
),
96+
start_time_offset=duration.Duration(
97+
seconds=0,
9398
),
94-
start_time_offset=duration.Duration(seconds=0,),
9599
),
96100
),
97101
transcoder_v1.types.Overlay.Animation(
98102
animation_end=transcoder_v1.types.Overlay.AnimationEnd(
99-
start_time_offset=duration.Duration(seconds=10,),
103+
start_time_offset=duration.Duration(
104+
seconds=10,
105+
),
100106
),
101107
),
102108
],
@@ -114,7 +120,9 @@ def create_job_with_static_overlay(
114120
parser = argparse.ArgumentParser()
115121
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
116122
parser.add_argument(
117-
"--location", help="The location to start this job in.", default="us-central1",
123+
"--location",
124+
help="The location to start this job in.",
125+
default="us-central1",
118126
)
119127
parser.add_argument(
120128
"--input_uri",

0 commit comments

Comments
 (0)