def METHOD_NAME(value, choices):
    """OpenEmbedded 'choice' type
    Acts as a multiple choice for the user.  To use this, set the variable
    type flag to 'choice', and set the 'choices' flag to a space separated
    list of valid values."""
    if not isinstance(value, str):
        raise TypeError("choice accepts a string, not '%s'" % type(value))
    value = value.lower()
    choices = choices.lower()
    if value not in choices.split():
        raise ValueError("Invalid choice '%s'.  Valid choices: %s" %
                         (value, choices))
    return value