code: def _read_video_paths_and_labels(
      video_path_label_file: List[str], prefix: str = ""
  ) -> Tuple[List[str], List[int]]:
      """
      Args:
          video_path_label_file (List[str]): a file that contains frame paths for each
              video and the corresponding frame label. The file must be a space separated
              csv of the format:
                  `original_vido_id video_id frame_id path labels`
  
          prefix (str): prefix path to add to all paths from video_path_label_file.
  
      """
      image_paths = defaultdict(list)
      labels = defaultdict(list)
      with g_pathmgr.open(video_path_label_file, "r") as f:
          # Space separated CSV with format: original_vido_id video_id frame_id path labels
          csv_reader = csv.DictReader(f, delimiter=" ")
          for row in csv_reader:
              assert len(row) == 5
              video_name = row["original_vido_id"]
              path = os.path.join(prefix, row["path"])
              image_paths[video_name].append(path)
              frame_labels = row["labels"].replace('"', "")
              label_list = []
              if frame_labels:
                  label_list = [int(x) for x in frame_labels.split(",")]
  
              labels[video_name].append(label_list)
  
      # Extract image paths from dictionary and return paths and labels as list.
      video_names = image_paths.keys()
      image_paths = [image_paths[key] for key in video_names]
      labels = [labels[key] for key in video_names]
      # Aggregate labels from all frames to form video-level labels.
      video_labels = [
          list(set(itertools.chain(*label_list)))
          for label_list in labels
      ]
      return image_paths, labels, video_labels
  
file_path: pytorchvideo/pytorchvideo/data/charades.py
imports: import csv
  import functools
  import itertools
  import os
  from collections import defaultdict
  from typing import Any, Callable, List, Optional, Tuple, Type
  import torch
  import torch.utils.data
  from iopath.common.file_io import g_pathmgr
  from pytorchvideo.data.clip_sampling import ClipSampler
  from pytorchvideo.data.frame_video import FrameVideo
  from .utils import MultiProcessSampler
label_desc: Use image node_id 1 for calling a global function with example usage: _read_video_paths_and_labels(video_path_label_file, prefix) and returns: image_paths,  labels,  video_labels