code: def time_decimate(
      video_path: str,
      output_path: Optional[str] = None,
      start_offset_factor: float = 0.0,
      on_factor: float = 0.2,
      off_factor: float = 0.5,
      transition: Optional[af.TransitionConfig] = None,
      metadata: Optional[List[Dict[str, Any]]] = None,
  ) -> str:
      """
      Removes evenly sized (off) chunks, and concatenates evenly spaced (on)
      chunks from the video
  
      @param video_path: the path to the video to be augmented
  
      @param output_path: the path in which the resulting video will be stored.
          If not passed in, the original video file will be overwritten
  
      @param start_offset_factor: relative to the video duration; the offset
          at which to start taking "on" segments
  
      @param on_factor: relative to the video duration; the amount of time each
          "on" video chunk should be
  
      @param off_factor: relative to the "on" duration; the amount of time each
          "off" video chunk should be
  
      @param transition: optional transition configuration to apply between the clips
  
      @param metadata: if set to be a list, metadata about the function execution
          including its name, the source & dest duration, fps, etc. will be appended
          to the inputted list. If set to None, no metadata will be appended or returned
  
      @returns: the path to the augmented video
      """
      assert (
          0 <= start_offset_factor < 1
      ), f"start_offset_factor value {start_offset_factor} must be in the range [0, 1)"
      assert (
          0 < on_factor <= 1
      ), "on_factor must be a value in the range (0, 1]"
      assert (
          0 <= off_factor <= 1
      ), "off_factor must be a value in the range [0, 1]"
  
      func_kwargs = helpers.get_func_kwargs(
          metadata, locals(), video_path
      )
      local_path = utils.pathmgr.get_local_path(video_path)
      utils.validate_video_path(local_path)
  
      video_info = helpers.get_video_info(local_path)
      _, video_ext = os.path.splitext(local_path)
  
      duration = float(video_info["duration"])
      start_offset = duration * start_offset_factor
      on_segment = duration * on_factor
      off_segment = on_segment * off_factor
  
      subclips = []
      n = int((duration - start_offset) / (on_segment + off_segment))
  
      # let a = on_segment and b = off_segment
      # subclips: 0->a, a+b -> 2*a + b, 2a+2b -> 3a+2b, .., na+nb -> (n+1)a + nb
      with tempfile.TemporaryDirectory() as tmpdir:
          for i in range(n):
              clip_path = os.path.join(tmpdir, f"{i}{video_ext}")
              trim(
                  video_path,
                  clip_path,
                  start=start_offset + i * on_segment + i * off_segment,
                  end=min(
                      duration,
                      start_offset
                      + (i + 1) * on_segment
                      + i * off_segment,
                  ),
              )
              subclips.append(clip_path)
  
          # Skip concatenation if only 1 clip.
          if n > 1:
              concat(
                  subclips,
                  output_path,
                  transition=transition,
              )
          else:
              if output_path is not None:
                  shutil.copy(subclips[0], output_path)
              else:
                  shutil.copy(subclips[0], local_path)
  
      if metadata is not None:
          helpers.get_metadata(
              metadata=metadata,
              function_name="time_decimate",
              **func_kwargs,
          )
  
      return output_path or video_path
  
imports: import functools
  import math
  import os
  import shutil
  import tempfile
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  from augly import audio, image, utils
  from augly.audio import utils
  from augly.video import helpers, utils
  from augly.video.augmenters import cv2, ffmpeg
label_desc: Use image node_id 41 for calling a global function with example usage: time_decimate(video_path, output_path, start_offset_factor, on_factor, off_factor, transition, metadata) and returns: unknown