code: def create_split(
      input_path: str, output_path: str, split: str, num_workers: int
  ):
      """
      Create one split of the disk_folder format and the associated disk_filelist files
      """
      image_paths = []
      image_labels = []
      error_paths = []
  
      # Create the disk_folder format
      dataset = KineticsMiddleFrameDataset(
          data_path=input_path, split=split
      )
      loader = DataLoader(
          dataset,
          num_workers=num_workers,
          batch_size=1,
          collate_fn=lambda x: x[0],
      )
      for mid_frame, image_name, label, video_path in tqdm(
          loader, total=len(dataset)
      ):
          if mid_frame is not None:
              label = clean_label(label)
              label_folder = os.path.join(
                  output_path, f"{split}_images", label
              )
              os.makedirs(label_folder, exist_ok=True)
              image_path = os.path.join(label_folder, image_name)
              with open(image_path, "w") as image_file:
                  mid_frame.save(image_file)
              image_paths.append(image_path)
              image_labels.append(label)
          else:
              error_paths.append(video_path)
  
      # Save the disk_filelist format
      save_file(
          np.array(image_paths),
          filename=os.path.join(output_path, f"{split}_images.npy"),
      )
      save_file(
          np.array(image_labels),
          filename=os.path.join(output_path, f"{split}_labels.npy"),
      )
      if len(error_paths):
          print(
              f"Number of errors in '{split}' split: {len(error_paths)}"
          )
          error_paths_file = os.path.join(
              output_path, f"{split}_errors.npy"
          )
          print(f"Errors are saved in: {error_paths_file}")
          save_file(error_paths, filename=error_paths_file)
  
file_path: vissl/extra_scripts/datasets/create_k700_data_files.py
imports: import argparse
  import os
  from typing import Optional, Tuple
  import numpy
  from PIL import Image
  from torch.utils.data import DataLoader
  from torchvision.datasets.utils import download_url
  from tqdm import tqdm
  from vissl.utils.download import download_and_extract_archive
  from vissl.utils.io import save_file
label_desc: Use image node_id 4 for calling a global function with example usage: create_split(input_path, output_path, split, num_workers) without return types