class_docstr: FrameVideo is an abstractions for accessing clips based on their start and end
  time for a video where each frame is stored as an image. PathManager is used for
  frame image reading, allowing non-local uri's to be used.
docstr: Args:
      path (str): path to frame video directory.
      fps (float): the target fps for the video. This is needed to link the frames
          to a second timestamp in the video.
      multithreaded_io (bool):  controls whether parllelizable io operations are
          performed across multiple threads.
      path_order_cache (dict): An optional mapping from directory-path to list
          of frames in the directory in numerical order. Used for speedup by
          caching the frame paths.
docstr_tok: ["Args",":","path","(","str",")",":","path","to","frame","video","directory",".","fps","(","float",")",":","the","target","fps","for","the","video",".","This","is","needed","to","link","the","frames","to","a","second","timestamp","in","the","video",".","multithreaded_io","(","bool",")",":","controls","whether","parllelizable","io","operations","are","performed","across","multiple","threads",".","path_order_cache","(","dict",")",":","An","optional","mapping","from","directory-path","to","list","of","frames","in","the","directory","in","numerical","order",".","Used","for","speedup","by","caching","the","frame","paths","."]
code: def from_directory(
      cls,
      path: str,
      fps: float = 30.0,
      multithreaded_io=False,
      path_order_cache: Optional[Dict[str, List[str]]] = None,
  ):
      """
      Args:
          path (str): path to frame video directory.
          fps (float): the target fps for the video. This is needed to link the frames
              to a second timestamp in the video.
          multithreaded_io (bool):  controls whether parllelizable io operations are
              performed across multiple threads.
          path_order_cache (dict): An optional mapping from directory-path to list
              of frames in the directory in numerical order. Used for speedup by
              caching the frame paths.
      """
      if path_order_cache is not None and path in path_order_cache:
          return cls.from_frame_paths(
              path_order_cache[path], fps, multithreaded_io
          )
  
      assert g_pathmgr.isdir(path), f"{path} is not a directory"
      rel_frame_paths = g_pathmgr.ls(path)
  
      def natural_keys(text):
          return [
              int(c) if c.isdigit() else c
              for c in re.split("(\d+)", text)
          ]
  
      rel_frame_paths.sort(key=natural_keys)
      frame_paths = [os.path.join(path, f) for f in rel_frame_paths]
      if path_order_cache is not None:
          path_order_cache[path] = frame_paths
      return cls.from_frame_paths(frame_paths, fps, multithreaded_io)
  
imports: from __future__ import annotations
  import logging
  import math
  import os
  import re
  import time
  from typing import Callable, Dict, List, Optional
  import numpy
  import torch
  import torch.utils.data
  from iopath.common.file_io import g_pathmgr
  from pytorchvideo.data.utils import optional_threaded_foreach
  from .utils import thwc_to_cthw
  from .video import Video
label_desc: Use image node_id 2 for calling the FrameVideo obj's underlying member method code with example usage: obj.from_directory(cls, path, fps, multithreaded_io, path_order_cache) and returns: cls, cls, unknown