code: def apply_lambda(
      texts: Union[str, List[str]],
      aug_function: Callable[..., List[str]] = lambda x: x,
      metadata: Optional[List[Dict[str, Any]]] = None,
      **kwargs,
  ) -> Union[str, List[str]]:
      """
      Apply a user-defined lambda on a list of text documents
  
      @param texts: a string or a list of text documents to be augmented
  
      @param aug_function: the augmentation function to be applied onto the text
          (should expect a list of text documents as input and return a list of
          text documents)
  
      @param **kwargs: the input attributes to be passed into the augmentation
          function to be applied
  
      @param metadata: if set to be a list, metadata about the function execution
          including its name, the source & dest length, etc. will be appended to
          the inputted list. If set to None, no metadata will be appended or returned
  
      @returns: the list of augmented text documents
      """
      assert callable(aug_function), (
          repr(type(aug_function).__name__) + " object is not callable"
      )
  
      func_kwargs = deepcopy(locals())
      if aug_function is not None:
          try:
              func_kwargs["aug_function"] = aug_function.__name__
          except AttributeError:
              func_kwargs["aug_function"] = type(aug_function).__name__
      func_kwargs = txtutils.get_func_kwargs(metadata, func_kwargs)
  
      aug_texts = aug_function(texts, **kwargs)
  
      txtutils.get_metadata(
          metadata=metadata,
          function_name="apply_lambda",
          aug_texts=aug_texts,
          **func_kwargs,
      )
  
      return aug_texts
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Union
  from augly.text import augmenters, utils
  from augly.utils import CONTRACTIONS_MAPPING, FUN_FONTS_PATH, GENDERED_WORDS_MAPPING, MISSPELLING_DICTIONARY_PATH, UNICODE_MAPPING_PATH
label_desc: Use image node_id 1 for calling a global function with example usage: apply_lambda(texts, aug_function, metadata) and returns: aug_texts