def base_validator(name, value, conditions):
    """Validates value based on dictionary of conditions"""

    msg = f"""Input {name} must be one of `{tuple(conditions.keys())},`
received {value!r} instead.
"""
    assert value in conditions.keys(), msg
    return conditions[value]