code: def replace_fun_fonts(
      texts: Union[str, List[str]],
      aug_p: float = 0.3,
      aug_min: int = 1,
      aug_max: int = 10000,
      granularity: str = "all",
      vary_fonts: bool = False,
      fonts_path: str = FUN_FONTS_PATH,
      n: int = 1,
      priority_words: Optional[List[str]] = None,
      metadata: Optional[List[Dict[str, Any]]] = None,
  ) -> Union[str, List[str]]:
      """
      Replaces words or characters depending on the granularity with fun fonts applied
  
      @param texts: a string or a list of text documents to be augmented
  
      @param aug_p: probability of words to be augmented
  
      @param aug_min: minimum # of words to be augmented
  
      @param aug_max: maximum # of words to be augmented
  
      @param granularity: the level at which the font is applied; this must be be
          either word, char, or all
  
      @param vary_fonts: whether or not to switch font in each replacement
  
      @param fonts_path: iopath uri where the fonts are stored
  
      @param n: number of augmentations to be performed for each text
  
      @param priority_words: list of target words that the augmenter should
          prioritize to augment first
  
      @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
      """
      func_kwargs = txtutils.get_func_kwargs(metadata, locals())
  
      fun_fonts_aug = a.FunFontsAugmenter(
          granularity,
          aug_min,
          aug_max,
          aug_p,
          vary_fonts,
          fonts_path,
          priority_words,
      )
      aug_texts = fun_fonts_aug.augment(texts, n)
  
      txtutils.get_metadata(
          metadata=metadata,
          function_name="replace_fun_fonts",
          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 11 for calling a global function with example usage: replace_fun_fonts(texts, aug_p, aug_min, aug_max, granularity, vary_fonts, fonts_path, n, priority_words, metadata) and returns: aug_texts