code: def build_encoded_manifest_from_nested_directory(
      data_directory_path: str,
  ) -> Dict[str, EncodedVideoInfo]:
      """
      Creates a dictionary from video_id to EncodedVideoInfo for
      encoded videos in the given directory.
  
      Args:
          data_directory_path (str): The folder to ls to find encoded
          video files.
  
      Returns:
          Dict[str, EncodedVideoInfo] mapping video_id to EncodedVideoInfo
          for each file in 'data_directory_path'
      """
      encoded_video_infos = {}
      for participant_id in g_pathmgr.ls(data_directory_path):
          participant_folder_path = (
              f"{data_directory_path}/{participant_id}"
          )
          for video_file_name in g_pathmgr.ls(participant_folder_path):
              video_id = video_file_name[:6]
              video_full_path = (
                  f"{participant_folder_path}/{video_file_name}"
              )
              encoded_video_infos[video_id] = EncodedVideoInfo(
                  video_id, video_full_path
              )
      return encoded_video_infos
  
imports: from typing import Dict
  from iopath.common.file_io import g_pathmgr
  from pytorchvideo.data.dataset_manifest_utils import EncodedVideoInfo, VideoFrameInfo
  from pytorchvideo.data.utils import optional_threaded_foreach
label_desc: Use image node_id 3 for calling a global function with example usage: build_encoded_manifest_from_nested_directory(data_directory_path) and returns: encoded_video_infos