def _convert_choices(self, choices):
<EOL>constants = [c[<NUM_LIT:0>] for c in choices]<EOL>constants_doubles = [c for c in constants if constants.count(c) > <NUM_LIT:1>]<EOL>if constants_doubles:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % list(set(constants_doubles)))<EOL><DEDENT>bad_constants = set(constants).intersection(self.constants)<EOL>if bad_constants:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % list(bad_constants))<EOL><DEDENT>bad_constants = [c for c in constants if hasattr(self, c)]<EOL>if bad_constants:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % list(bad_constants))<EOL><DEDENT>values = [c[<NUM_LIT:1>] for c in choices]<EOL>values_doubles = [c for c in values if values.count(c) > <NUM_LIT:1>]<EOL>if values_doubles:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % list(set(values_doubles)))<EOL><DEDENT>try:<EOL><INDENT>bad_values = set(values).intersection(self.values)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise ValueError("<STR_LIT>" % list(values))<EOL><DEDENT>else:<EOL><INDENT>if bad_values:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % list(bad_values))<EOL><DEDENT><DEDENT>for choice_tuple in choices:<EOL><INDENT>choice_entry = choice_tuple<EOL>if not isinstance(choice_entry, self.ChoiceEntryClass):<EOL><INDENT>choice_entry = self.ChoiceEntryClass(choice_entry)<EOL><DEDENT>self.append(choice_entry.choice)<EOL>self.entries.append(choice_entry)<EOL>setattr(self, choice_entry.constant, choice_entry.value)<EOL>self.constants[choice_entry.constant] = choice_entry<EOL>self.values[choice_entry.value] = choice_entry<EOL>self.displays[choice_entry.display] = choice_entry<EOL><DEDENT>return constants<EOL>
Validate each choices

        Parameters
        ----------
        choices : list of tuples
            The list of choices to be added

        Returns
        -------
        list
            The list of the added constants