code: def insert_text(
      texts: Union[str, List[str]],
      insert_text: List[str],
      num_insertions: int = 1,
      insertion_location: str = "random",
      seed: Optional[int] = 10,
      metadata: Optional[List[Dict[str, Any]]] = None,
  ) -> Union[str, List[str]]:
      """
      Inserts some specified text into the input text a given number of times at a given
      location
  
      @param texts: a string or a list of text documents to be augmented
  
      @param insert_text: a list of text to sample from and insert into each text in texts
  
      @param num_insertions: the number of times to sample from insert_text and insert
  
      @param insertion_location: where to insert the insert_text in the input text; valid
          values are "prepend", "append", or "random" (inserts at a random index between
          words in the input text)
  
      @param seed: if provided, this will set the random seed to ensure consistency between
          runs
  
      @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())
  
      insert_texts_aug = a.InsertTextAugmenter(
          num_insertions, insertion_location, seed
      )
      aug_texts = insert_texts_aug.augment(texts, insert_text)
  
      txtutils.get_metadata(
          metadata=metadata,
          function_name="insert_text",
          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 6 for calling a global function with example usage: insert_text(texts, insert_text, num_insertions, insertion_location, seed, metadata) and returns: aug_texts