def parse_in_choices(choices, value):
    """Raise ValueError if value is not in choices
    """
    if value not in choices:
        raise ValueError('Invalid value [{0}]: not in choices'.format(value))
    else:
        return value