code: def blend_videos(
      video_path: str,
      overlay_path: str,
      output_path: Optional[str] = None,
      opacity: float = 0.5,
      overlay_size: float = 1.0,
      x_pos: float = 0.0,
      y_pos: float = 0.0,
      use_second_audio: bool = True,
      metadata: Optional[List[Dict[str, Any]]] = None,
  ) -> str:
      """
      Overlays a video onto another video at position (width * x_pos, height * y_pos)
      at a lower opacity
  
      @param video_path: the path to the video to be augmented
  
      @param overlay_path: the path to the video that will be overlaid onto the
          background video
  
      @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 opacity: the lower the opacity, the more transparent the overlaid video
  
      @param overlay_size: size of the overlaid video is overlay_size * height of
          the background video
  
      @param x_pos: position of overlaid video relative to the background video width
  
      @param y_pos: position of overlaid video relative to the background video height
  
      @param use_second_audio: use the audio of the overlaid video rather than the audio
          of the background video
  
      @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
      """
      func_kwargs = helpers.get_func_kwargs(
          metadata, locals(), video_path
      )
  
      blend_func = functools.partial(
          imaugs.overlay_image,
          opacity=opacity,
          overlay_size=overlay_size,
          x_pos=x_pos,
          y_pos=y_pos,
      )
  
      vdutils.apply_to_frames(
          blend_func,
          video_path,
          overlay_path,
          output_path,
          use_second_audio,
      )
  
      if metadata is not None:
          helpers.get_metadata(
              metadata=metadata,
              function_name="blend_videos",
              **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 5 for calling a global function with example usage: blend_videos(video_path, overlay_path, output_path, opacity, overlay_size, x_pos, y_pos, use_second_audio, metadata) and returns: unknown