class_docstr: LabeledVideoPaths contains pairs of video path and integer index label.
class_docstr_tok: ["LabeledVideoPaths","contains","pairs","of","video","path","and","integer","index","label","."]
docstr: Factory function that creates a LabeledVideoPaths object depending on the path
  type.
  - If it is a directory path it uses the LabeledVideoPaths.from_directory function.
  - If it's a file it uses the LabeledVideoPaths.from_csv file.
  Args:
      file_path (str): The path to the file to be read.
docstr_tok: ["Factory","function","that","creates","a","LabeledVideoPaths","object","depending","on","the","path","type",".","-","If","it","is","a","directory","path","it","uses","the","LabeledVideoPaths.from_directory","function",".","-","If","it","'s","a","file","it","uses","the","LabeledVideoPaths.from_csv","file",".","Args",":","file_path","(","str",")",":","The","path","to","the","file","to","be","read","."]
code: def from_path(cls, data_path: str) -> LabeledVideoPaths:
      """
      Factory function that creates a LabeledVideoPaths object depending on the path
      type.
      - If it is a directory path it uses the LabeledVideoPaths.from_directory function.
      - If it's a file it uses the LabeledVideoPaths.from_csv file.
      Args:
          file_path (str): The path to the file to be read.
      """
  
      if g_pathmgr.isfile(data_path):
          return LabeledVideoPaths.from_csv(data_path)
      elif g_pathmgr.isdir(data_path):
          return LabeledVideoPaths.from_directory(data_path)
      else:
          raise FileNotFoundError(f"{data_path} not found.")
  
file_path: pytorchvideo/pytorchvideo/data/labeled_video_paths.py
imports: from __future__ import annotations
  import os
  import pathlib
  from typing import List, Optional, Tuple
  from iopath.common.file_io import g_pathmgr
  from torchvision.datasets.folder import make_dataset
label_desc: Use image node_id 1 for calling the LabeledVideoPaths obj's underlying member method code with example usage: obj.from_path(cls, data_path) and returns: LabeledVideoPaths, LabeledVideoPaths