code: def _seconds_to_frame_index(
      time_in_seconds: float,
      fps: int,
      zero_indexed: Optional[bool] = True,
  ) -> int:
      """
      Converts a point in time (in seconds) within a video clip to its closest
      frame indexed (rounding down), based on a specified frame rate.
  
      Args:
          time_in_seconds (float): The point in time within the video.
          fps (int): The frame rate (frames per second) of the video.
          zero_indexed (Optional[bool]): Whether the returned frame should be
              zero-indexed (if True) or one-indexed (if False).
  
      Returns:
          (int) The index of the nearest frame (rounding down to the nearest integer).
      """
      frame_idx = math.floor(time_in_seconds * fps)
      if not zero_indexed:
          frame_idx += 1
      return frame_idx
  
imports: import logging
  import math
  import random
  import time
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import numpy
  import torch
  from iopath.common.file_io import g_pathmgr
  from PIL import Image
  from pytorchvideo.data.dataset_manifest_utils import ImageDataset, ImageFrameInfo, VideoClipInfo, VideoDataset, VideoDatasetType
  from pytorchvideo.data.utils import DataclassFieldCaster, load_dataclass_dict_from_csv
  from pytorchvideo.data.video import Video
label_desc: Use image node_id 1 for calling a global function with example usage: _seconds_to_frame_index(time_in_seconds, fps, zero_indexed) and returns: frame_idx