code: def _num_clips(
      duration_sec: float,
      fps: float,
      stride_frames: int,
      window_size_frames: int,
      backpad_last: bool = True,
  ) -> int:
      """
      Utility to calculate the number of clips for a given duration, fps, stride & window_size
      """
      num_frames = round(duration_sec * fps)
      N = num_frames - window_size_frames
      if N < 0:
          return 1
      result = int(N / stride_frames + 1)
      pad = backpad_last and N % stride_frames != 0
      return result + pad
  
file_path: pytorchvideo/tests/test_uniform_clip_sampler.py
imports: import copy
  import unittest
  from typing import Optional
  import numpy
  from parameterized import parameterized
  from pytorchvideo.data.clip_sampling import UniformClipSampler
label_desc: Use image node_id 1 for calling a global function with example usage: _num_clips(duration_sec, fps, stride_frames, window_size_frames, backpad_last) and returns: unknown, int