code: def masked_composite_intensity(
      mask: Optional[Union[str, Image.Image]],
      metadata: Dict[str, Any],
      **kwargs,
  ) -> float:
      if mask is None:
          mask_intensity = 1.0
      else:
          mask = imutils.validate_and_load_image(mask)
          mask_arr = np.array(mask)
          # There can be 3 dimensions if the mask is RGBA format, in which case
          # we only care about the last channel (alpha) to determine the mask
          mask_values = (
              mask_arr[:, :, -1] if mask_arr.ndim == 3 else mask_arr
          )
          mask_intensity = np.sum(mask_values > 0) / (
              mask_values.shape[0] * mask_values.shape[1]
          )
      if metadata["transform_function"] is None:
          aug_intensity = 0.0
      else:
          aug_intensity_func = globals().get(
              f"{metadata['transform_function']}_intensity"
          )
          aug_intensity = (
              aug_intensity_func(**kwargs) / 100.0
              if aug_intensity_func is not None
              else 1.0
          )
      return (aug_intensity * mask_intensity) * 100.0
  
imports: from typing import Any, Dict, Optional, Union
  import numpy
  from augly.image import utils
  from PIL import Image
label_desc: Use image node_id 14 for calling a global function with example usage: masked_composite_intensity(mask, metadata) and returns: unknown