File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 BOTO3_AVAILABLE = False
1818
1919
20+ def _cliplabels_suffix_error (name : str ) -> str :
21+ return f"Input file must end with '_cliplabels.json', got { name } "
22+
23+
2024def extract_clip (
2125 video_path : str | Path ,
2226 start_frame : int ,
@@ -218,10 +222,7 @@ def extract_start_frames_label(cliplabels_path: str | Path) -> Path:
218222
219223 # Validate input filename
220224 if not cliplabels_path .name .endswith ("_cliplabels.json" ):
221- raise ValueError (
222- "Input file must end with '_cliplabels.json', "
223- f"got { cliplabels_path .name } "
224- )
225+ raise ValueError (_cliplabels_suffix_error (cliplabels_path .name ))
225226
226227 # Read the cliplabels file
227228 with open (cliplabels_path ) as f :
@@ -316,9 +317,7 @@ def extract_start_frames_label_s3(
316317
317318 # Validate filename
318319 if not key .endswith ("_cliplabels.json" ):
319- raise ValueError (
320- f"Input file must end with '_cliplabels.json', got { key } "
321- )
320+ raise ValueError (_cliplabels_suffix_error (key ))
322321
323322 # Initialize S3 client
324323 session = boto3 .Session (profile_name = aws_profile )
You can’t perform that action at this time.
0 commit comments