def _show_capture_callback(x):
    """Validate the passed options for showing captured output."""
    if x in [None, "None", "none"]:
        x = None
    elif x in ["no", "stdout", "stderr", "all"]:
        pass
    else:
        raise ValueError(
            "'show_capture' must be one of ['no', 'stdout', 'stderr', 'all']."
        )

    return x