code: def get_metadata(
      metadata: Optional[List[Dict[str, Any]]],
      function_name: str,
      texts: Optional[List[str]] = None,
      aug_texts: Optional[Union[List[str], str]] = None,
      **kwargs,
  ) -> None:
      if metadata is None:
          return
  
      assert isinstance(
          metadata, list
      ), "Expected `metadata` to be set to None or of type list"
      assert (
          texts is not None
      ), "Expected `texts` to be passed in if metadata was provided"
      assert (
          aug_texts is not None
      ), "Expected `aug_texts` to be passed in if metadata was provided"
  
      metadata.append(
          {
              "name": function_name,
              "input_type": "list"
              if isinstance(texts, list)
              else "string",
              "src_length": len(texts)
              if isinstance(texts, list)
              else 1,
              "dst_length": len(aug_texts)
              if isinstance(aug_texts, list)
              else 1,
              **kwargs,
          }
      )
  
      intensity_kwargs = {
          "metadata": metadata[-1],
          "texts": texts,
          **kwargs,
      }
      metadata[-1]["intensity"] = getattr(
          txtintensity, f"{function_name}_intensity", lambda **_: 0.0
      )(**intensity_kwargs)
  
file_path: AugLy/augly/text/utils.py
imports: import json
  from copy import deepcopy
  from typing import Any, Dict, List, Optional, Union
  from augly import utils
  from augly.text import intensity
label_desc: Use image node_id 2 for calling a global function with example usage: get_metadata(metadata, function_name, texts, aug_texts) without return types