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))
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"
    
spacy/errors.py