code: def get_multiple_start_end_idx(
      video_size,
      clip_sizes,
      clip_idx,
      num_clips_uniform,
      min_delta=0,
      max_delta=math.inf,
      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_sizes (list): 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.
      """
  
      def sample_clips(
          video_size,
          clip_sizes,
          clip_idx,
          num_clips_uniform,
          min_delta=0,
          max_delta=math.inf,
          num_retries=100,
          use_offset=False,
      ):
          se_inds = np.empty((0, 2))
          dt = np.empty((0))
          for clip_size in clip_sizes:
              for i_try in range(num_retries):
                  # clip_size = int(clip_size)
                  max_start = max(video_size - clip_size, 0)
                  if clip_idx == -1:
                      # Random temporal sampling.
                      start_idx = random.uniform(0, max_start)
                  else:  # Uniformly sample the clip with the given index.
                      if use_offset:
                          if num_clips_uniform == 1:
                              # Take the center clip if num_clips is 1.
                              start_idx = math.floor(max_start / 2)
                          else:
                              start_idx = clip_idx * math.floor(
                                  max_start / (num_clips_uniform - 1)
                              )
                      else:
                          start_idx = (
                              max_start * clip_idx / num_clips_uniform
                          )
  
                  end_idx = start_idx + clip_size - 1
  
                  se_inds_new = np.append(
                      se_inds, [[start_idx, end_idx]], axis=0
                  )
                  if se_inds.shape[0] < 1:
                      se_inds = se_inds_new
                      break
  
                  se_inds_new = np.sort(se_inds_new, 0)
                  t_start, t_end = se_inds_new[:, 0], se_inds_new[:, 1]
                  dt = t_start[1:] - t_end[:-1]
                  if (
                      any(dt < min_delta) or any(dt > max_delta)
                  ) and i_try < num_retries - 1:
                      continue  # there is overlap
                  else:
                      se_inds = se_inds_new
                      break
          return se_inds, dt
  
      num_retries, goodness = 100, -math.inf
      for _ in range(num_retries):
          se_inds, dt = sample_clips(
              video_size,
              clip_sizes,
              clip_idx,
              num_clips_uniform,
              min_delta,
              max_delta,
              100,
              use_offset,
          )
          success = not (any(dt < min_delta) or any(dt > max_delta))
          if success or clip_idx != -1:
              se_final, dt_final = se_inds, dt
              break
          else:
              cur_goodness = np.r_[
                  dt[dt < min_delta], -dt[dt > max_delta]
              ].sum()
              if goodness < cur_goodness:
                  se_final, dt_final = se_inds, dt
                  goodness = cur_goodness
  
      delta_clips = np.concatenate((np.array([0]), dt_final))
      start_end_delta_time = np.c_[se_final, delta_clips]
  
      return start_end_delta_time
  
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 3 for calling a global function with example usage: get_multiple_start_end_idx(video_size, clip_sizes, clip_idx, num_clips_uniform, min_delta, max_delta, use_offset) and returns: start_end_delta_time, se_inds,  dt