code: def replace_with_color_frames(
      video_path: str,
      output_path: Optional[str] = None,
      offset_factor: float = 0.0,
      duration_factor: float = 1.0,
      color: Tuple[int, int, int] = utils.DEFAULT_COLOR,
      transition: Optional[af.TransitionConfig] = None,
      metadata: Optional[List[Dict[str, Any]]] = None,
  ) -> str:
      """
      Replaces part of the video with frames of the specified color
  
      @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 offset_factor: start point of the replacement relative to the video
          duration (this parameter is multiplied by the video duration)
  
      @param duration_factor: the length of the replacement relative to the video
          duration (this parameter is multiplied by the video duration)
  
      @param color: RGB color of the replaced frames. Default color is black
  
      @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
      """
      utils.validate_video_path(video_path)
      assert (
          0.0 <= offset_factor <= 1.0 and 0.0 <= duration_factor <= 1.0
      ), "Both offset & duration factors must be values in the range [0.0, 1.0]"
  
      func_kwargs = {
          **helpers.get_func_kwargs(metadata, locals(), video_path),
          "function_name": "replace_with_color_frames",
      }
  
      video_info = helpers.get_video_info(video_path)
      video_duration = float(video_info["duration"])
      width, height = video_info["width"], video_info["height"]
  
      offset = video_duration * offset_factor
      duration = video_duration * duration_factor
      output_path = output_path or video_path
  
      if duration == 0 or offset == video_duration:
          if output_path != video_path:
              shutil.copy(video_path, output_path)
          if metadata is not None:
              helpers.get_metadata(metadata=metadata, **func_kwargs)
          return output_path or video_path
  
      video_paths = []
      src_video_path_index = 0 if offset > 0 else 2
      with tempfile.TemporaryDirectory() as tmpdir:
          color_duration = (
              video_duration - offset
              if offset + duration >= video_duration
              else duration
          )
          color_path = os.path.join(tmpdir, "color_frames.mp4")
          helpers.create_color_video(
              color_path, color_duration, height, width, color
          )
  
          if helpers.has_audio_stream(video_path):
              audio_path = os.path.join(tmpdir, "audio.aac")
              helpers.extract_audio_to_file(video_path, audio_path)
              audio_swap(color_path, audio_path, offset=offset)
  
          if offset_factor == 0 and duration_factor == 1.0:
              shutil.copy(color_path, output_path)
              if metadata is not None:
                  helpers.get_metadata(metadata=metadata, **func_kwargs)
              return output_path or video_path
  
          if offset > 0:
              before_path = os.path.join(tmpdir, "before.mp4")
              trim(video_path, before_path, end=offset)
              video_paths.append(before_path)
  
          video_paths.append(color_path)
  
          if offset + duration < video_duration:
              after_path = os.path.join(tmpdir, "after.mp4")
              trim(video_path, after_path, start=offset + duration)
              video_paths.append(after_path)
  
          concat(
              video_paths,
              output_path,
              src_video_path_index=src_video_path_index,
              transition=transition,
          )
  
      if metadata is not None:
          helpers.get_metadata(metadata=metadata, **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 35 for calling a global function with example usage: replace_with_color_frames(video_path, output_path, offset_factor, duration_factor, color, transition, metadata) and returns: unknown, unknown, unknown