code: def get_metadata(
      metadata: Optional[List[Dict[str, Any]]],
      function_name: str,
      video_path: str,
      output_path: Optional[str],
      src_video_info: Dict[str, Any],
      src_fps: Optional[float],
      **kwargs,
  ) -> None:
      if metadata is None:
          return
  
      assert isinstance(
          metadata, list
      ), "Expected 'metadata' to be set to None or of type list"
  
      assert src_fps is not None
  
      output_path = output_path or video_path
  
      src_video_info = src_video_info
      dst_video_info = helpers.get_video_info(output_path)
  
      src_duration = float(src_video_info["duration"])
      dst_duration = float(dst_video_info["duration"])
      src_segments, dst_segments = compute_segments(
          function_name, src_duration, dst_duration, metadata, **kwargs
      )
  
      # Json can't represent tuples, so they're represented as lists, which should
      # be equivalent to tuples. So let's avoid tuples in the metadata by
      # converting any tuples to lists here.
      kwargs_types_fixed = dict(
          (k, list(v)) if isinstance(v, tuple) else (k, v)
          for k, v in kwargs.items()
      )
  
      metadata.append(
          {
              "name": function_name,
              "src_duration": src_duration,
              "dst_duration": dst_duration,
              "src_fps": src_fps,
              "dst_fps": helpers.get_video_fps(output_path),
              "src_width": src_video_info["width"],
              "src_height": src_video_info["height"],
              "dst_width": dst_video_info["width"],
              "dst_height": dst_video_info["height"],
              "src_segments": [
                  src_segment._asdict() for src_segment in src_segments
              ],
              "dst_segments": [
                  dst_segment._asdict() for dst_segment in dst_segments
              ],
              **kwargs_types_fixed,
          }
      )
  
      intensity_kwargs = {"metadata": metadata[-1], **kwargs}
      metadata[-1]["intensity"] = getattr(
          vdintensity, f"{function_name}_intensity", lambda **_: 0.0
      )(**intensity_kwargs)
  
file_path: AugLy/augly/video/helpers/metadata.py
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple
  from augly import utils
  from augly.video import helpers
  from augly.video.helpers import intensity
label_desc: Use image node_id 8 for calling a global function with example usage: get_metadata(metadata, function_name, video_path, output_path, src_video_info, src_fps) without return types