code: def get_metadata(
      metadata: Optional[List[Dict[str, Any]]],
      function_name: str,
      image: Optional[Image.Image] = None,
      aug_image: Optional[Image.Image] = None,
      bboxes: Optional[Tuple] = None,
      bboxes_helper_func: Optional[Callable] = None,
      **kwargs,
  ) -> None:
      if metadata is None:
          return
  
      assert isinstance(
          metadata, list
      ), "Expected `metadata` to be set to None or of type list"
      assert (
          image is not None
      ), "Expected `image` to be passed in if metadata was provided"
      assert (
          aug_image is not None
      ), "Expected `aug_image` to be passed in if metadata was provided"
  
      transform_bboxes(
          function_name=function_name,
          image=image,
          aug_image=aug_image,
          bboxes_helper_func=bboxes_helper_func,
          **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()
      )
      if (
          bboxes_helper_func is not None
          and bboxes_helper_func.__name__ == "spatial_bbox_helper"
      ):
          kwargs_types_fixed.pop("aug_function", None)
  
      metadata.append(
          {
              "name": function_name,
              "src_width": image.width,
              "src_height": image.height,
              "dst_width": aug_image.width,
              "dst_height": aug_image.height,
              **kwargs_types_fixed,
          }
      )
  
      intensity_kwargs = {"metadata": metadata[-1], **kwargs}
      metadata[-1]["intensity"] = getattr(
          imintensity, f"{function_name}_intensity", lambda **_: 0.0
      )(**intensity_kwargs)
  
file_path: AugLy/augly/image/utils/metadata.py
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple
  from augly.image import intensity
  from augly.image.utils import bboxes
  from PIL import Image
label_desc: Use image node_id 7 for calling a global function with example usage: get_metadata(metadata, function_name, image, aug_image, bboxes, bboxes_helper_func) without return types