code: def temporal_sampling(frames, start_idx, end_idx, num_samples):
      """
      Given the start and end frame index, sample num_samples frames between
      the start and end with equal interval.
      Args:
          frames (tensor): a tensor of video frames, dimension is
              `num video frames` x `channel` x `height` x `width`.
          start_idx (int): the index of the start frame.
          end_idx (int): the index of the end frame.
          num_samples (int): number of frames to sample.
      Returns:
          frames (tersor): a tensor of temporal sampled video frames, dimension is
              `num clip frames` x `channel` x `height` x `width`.
      """
      index = torch.linspace(start_idx, end_idx, num_samples)
      index = torch.clamp(index, 0, frames.shape[0] - 1).long()
      frames = torch.index_select(frames, 0, index)
      return frames
  
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 1 for calling a global function with example usage: temporal_sampling(frames, start_idx, end_idx, num_samples) and returns: frames