def METHOD_NAME(exception: Exception):
    exception_class = exception.__class__
    error_number = exception.errno if hasattr(exception, 'errno') else None
    if isinstance(exception, IGNORED_ERRORS_BY_CLASS):
        return True
    if (exception_class, error_number) in IGNORED_ERRORS_BY_CODE:
        return True
    if exception_class not in IGNORED_ERRORS_BY_REGEX:
        return False
    pattern = IGNORED_ERRORS_BY_REGEX[exception_class]
    return re.search(pattern, str(exception)) is not None