code: def filter_warning(
      action: Literal[
          "default", "error", "ignore", "always", "module", "once"
      ],
      error_msg: str,
  ):
      """Customize how spaCy should handle a certain warning.
  
      error_msg (str): e.g. "W006", or a full error message
      action (str): "default", "error", "ignore", "always", "module" or "once"
      """
      warnings.filterwarnings(
          action, message=_escape_warning_msg(error_msg)
      )
  
file_path: spaCy/spacy/errors.py
imports: import warnings
  from .compat import Literal
label_desc: Use image node_id 2 for calling a global function with example usage: filter_warning(action, error_msg) without return types