code: def _remove_video_info_missing_or_incomplete_videos(
      video_data_infos: Dict[
          str, Union[VideoFrameInfo, EncodedVideoInfo]
      ],
      video_infos: Dict[str, VideoInfo],
  ) -> None:
      # Avoid deletion keys from dict during iteration over keys
      video_ids = list(video_infos)
      for video_id in video_ids:
          video_info = video_infos[video_id]
  
          # Remove videos we have metadata for but don't have video data
          if video_id not in video_data_infos:
              del video_infos[video_id]
              continue
  
          # Remove videos we have metadata for but don't have the right number of frames
          if type(video_data_infos[video_id]) == VideoFrameInfo:
              video_frames_info = video_data_infos[video_id]
              expected_frames = round(
                  video_info.duration * video_info.fps
              )
              num_frames = (
                  video_frames_info.max_frame_number
                  - video_frames_info.min_frame_number
              )
              if abs(num_frames - expected_frames) > video_info.fps:
                  del video_data_infos[video_id]
                  del video_infos[video_id]
  
      video_ids = list(
          video_data_infos
      )  # Avoid modifying dict during iteration
      for video_id in video_ids:
          # Remove videos we have video data for but don't have metadata
          if video_id not in video_infos:
              del video_data_infos[video_id]
  
imports: import datetime
  import os
  from dataclasses import dataclass
  from enum import Enum
  from typing import Dict, Optional, Union
  from pytorchvideo.data.encoded_video import EncodedVideo
  from pytorchvideo.data.frame_video import FrameVideo
  from pytorchvideo.data.utils import DataclassFieldCaster, load_dataclass_dict_from_csv, save_dataclass_objs_to_headered_csv
  from pytorchvideo.data.video import Video
label_desc: Use image node_id 5 for calling the VideoDataset obj's underlying member method code with example usage: obj._remove_video_info_missing_or_incomplete_videos(video_data_infos, video_infos) without return types