def METHOD_NAME(exc):
    if fail_classes and isinstance(exc, tuple(fail_classes)):
        return False
    if retry_classes and not isinstance(exc, tuple(retry_classes)):
        return False
    return True