def valid_value(self, value):
        "Check to see if the provided value is a valid choice"
        for k, v in self.choices:
            if (tuple, list) in type(v):
                # This is an optgroup, so look inside the group for options
                for k2, v2 in v:
                    if value == smart_unicode(k2):
                        return True
            else:
                if value == smart_unicode(k):
                    return True
        return False
dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/forms/fields.py/ChoiceField.valid_value/swapped operands of `in`