code: def get_encoded_video_infos(directory, exit_stack=None):
      encoded_video_infos = {}
      for video_id in MOCK_VIDEO_IDS:
          file_path, _ = (
              exit_stack.enter_context(temp_encoded_video(10, 10))
              if exit_stack
              else (f"{directory}/{video_id}.mp4", None)
          )
          encoded_video_infos[video_id] = EncodedVideoInfo(
              video_id, file_path
          )
      return encoded_video_infos
  
file_path: pytorchvideo/tests/utils.py
imports: import contextlib
  import os
  import pathlib
  import tempfile
  import av
  import numpy
  import torch
  import torchvision.io
  import torchvision.transforms
  from pytorchvideo.data.dataset_manifest_utils import EncodedVideoInfo, VideoFrameInfo, VideoInfo
  from pytorchvideo.data.utils import thwc_to_cthw
label_desc: Use image node_id 9 for calling a global function with example usage: get_encoded_video_infos(directory, exit_stack) and returns: encoded_video_infos