code: def replace_prompt_with_wildcards(
      prompt: str,
      wildcard_option_dict: Dict[str, List[str]] = {},
      wildcard_files: List[str] = [],
  ):
      new_prompt = prompt
  
      # get wildcard options
      wildcard_option_dict = grab_wildcard_values(
          wildcard_option_dict, wildcard_files
      )
  
      for m in global_re_wildcard.finditer(new_prompt):
          wildcard_value = m.group()
          replace_value = random.choice(
              wildcard_option_dict[wildcard_value.strip("__")]
          )
          new_prompt = new_prompt.replace(
              wildcard_value, replace_value, 1
          )
  
      return new_prompt
  
imports: import inspect
  import os
  import random
  import re
  from dataclasses import dataclass
  from typing import Callable, Dict, List, Optional, Union
  import torch
  from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
  from diffusers import DiffusionPipeline
  from diffusers.configuration_utils import FrozenDict
  from diffusers.models import AutoencoderKL, UNet2DConditionModel
  from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion import StableDiffusionPipelineOutput
  from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
  from diffusers.schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
  from diffusers.utils import deprecate, logging
label_desc: Use image node_id 4 for calling a global function with example usage: replace_prompt_with_wildcards(prompt, wildcard_option_dict, wildcard_files) and returns: new_prompt