code: def get_start_end_idx(
      video_size,
      clip_size,
      clip_idx,
      num_clips_uniform,
      use_offset=False,
  ):
      """
      Sample a clip of size clip_size from a video of size video_size and
      return the indices of the first and last frame of the clip. If clip_idx is
      -1, the clip is randomly sampled, otherwise uniformly split the video to
      num_clips_uniform clips, and select the start and end index of clip_idx-th video
      clip.
      Args:
          video_size (int): number of overall frames.
          clip_size (int): size of the clip to sample from the frames.
          clip_idx (int): if clip_idx is -1, perform random jitter sampling. If
              clip_idx is larger than -1, uniformly split the video to num_clips_uniform
              clips, and select the start and end index of the clip_idx-th video
              clip.
          num_clips_uniform (int): overall number of clips to uniformly sample from the
              given video for testing.
      Returns:
          start_idx (int): the start frame index.
          end_idx (int): the end frame index.
      """
      delta = max(video_size - clip_size, 0)
      if clip_idx == -1:
          # Random temporal sampling.
          start_idx = random.uniform(0, delta)
      else:
          if use_offset:
              if num_clips_uniform == 1:
                  # Take the center clip if num_clips_uniform is 1.
                  start_idx = math.floor(delta / 2)
              else:
                  # Uniformly sample the clip with the given index.
                  start_idx = clip_idx * math.floor(
                      delta / (num_clips_uniform - 1)
                  )
          else:
              # Uniformly sample the clip with the given index.
              start_idx = delta * clip_idx / num_clips_uniform
      end_idx = start_idx + clip_size - 1
  
      return (
          start_idx,
          end_idx,
          start_idx / delta if delta != 0 else 0.0,
      )
  
file_path: SlowFast/slowfast/datasets/decoder.py
imports: import logging
  import math
  import numpy
  import random
  import torch
  import torchvision.io
  from .None import transform
label_desc: Use image node_id 2 for calling a global function with example usage: get_start_end_idx(video_size, clip_size, clip_idx, num_clips_uniform, use_offset) and returns: start_idx,  end_idx,  unknown