def n_workers_callback(value):
    """Validate the n-workers option."""
    if value == "auto":
        pass
    elif value in [None, "None", "none"]:
        value = None
    elif isinstance(value, int) and 1 <= value:
        pass
    elif isinstance(value, str) and value.isdigit():
        value = int(value)
    else:
        raise ValueError("n_workers can either be an integer >= 1, 'auto' or None.")

    return value