code: def raise_warning(
      message: Text,
      category: Optional[Type[Warning]] = None,
      docs: Optional[Text] = None,
      **kwargs: Any,
  ) -> None:
      """Emit a `warnings.warn` with sensible defaults and a colored warning msg."""
      original_formatter = warnings.formatwarning
  
      def should_show_source_line() -> bool:
          if "stacklevel" not in kwargs:
              if category == UserWarning or category is None:
                  return False
              if category == FutureWarning:
                  return False
          return True
  
      def formatwarning(
          message: Union[Warning, Text],
          category: Type[Warning],
          filename: Text,
          lineno: int,
          line: Optional[Text] = None,
      ) -> Text:
          """Function to format a warning the standard way."""
          if not should_show_source_line():
              if docs:
                  line = f"More info at {docs}"
              else:
                  line = ""
  
          formatted_message = original_formatter(
              message, category, filename, lineno, line
          )
          return wrap_with_color(
              formatted_message, color=bcolors.WARNING
          )
  
      if "stacklevel" not in kwargs:
          # try to set useful defaults for the most common warning categories
          if category == DeprecationWarning:
              kwargs["stacklevel"] = 3
          elif category in (UserWarning, FutureWarning):
              kwargs["stacklevel"] = 2
  
      warnings.formatwarning = formatwarning
      warnings.warn(message, category=category, **kwargs)
      warnings.formatwarning = original_formatter
  
imports: from collections import OrderedDict
  import errno
  import glob
  from hashlib import md5
  from io import StringIO
  import json
  import os
  import sys
  from pathlib import Path
  import re
  from typing import Any, Dict, List, Optional, Text, Type, Union
  import warnings
  import random
  import string
  import portalocker
  from ruamel import yaml
  from ruamel.yaml import RoundTripRepresenter, YAMLError
  from ruamel.yaml.constructor import DuplicateKeyError, BaseConstructor, ScalarNode
  from rasa.shared.constants import DEFAULT_LOG_LEVEL, ENV_LOG_LEVEL, NEXT_MAJOR_VERSION_FOR_DEPRECATIONS, CONFIG_SCHEMA_FILE, MODEL_CONFIG_SCHEMA_FILE
  from rasa.shared.exceptions import FileIOException, FileNotFoundException, YamlSyntaxException, RasaException
  import rasa.shared.utils.validation
label_desc: Use image node_id 2 for calling a global function with example usage: raise_warning(message, category, docs) and returns: True, wrap_with_color, False, False