<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_choices(self, *choices, **kwargs):
 """Add some choices to the current ``Choices`` instance. The given choices will be added to the existing choices. If a ``name`` attribute is passed, a new subset will be created with all the given choices. Note that it's not possible to add new choices to a subset. Parameters *choices : list of tuples It's the list of tuples to add to the ``Choices`` instance, each tuple having three entries: the constant name, the value, the display name. A dict could be added as a 4th entry in the tuple to allow setting arbitrary arguments to the final ``ChoiceEntry`` created for this choice tuple. If the first entry of ``*choices`` is a string, then it will be used as a name for a new subset that will contain all the given choices. **kwargs : dict name : string Instead of using the first entry of the ``*choices`` to pass a name of a subset to create, you can pass it via the ``name`` named argument. Example ------- [('ZERO', 0, 'zero')] [('ZERO', 0, 'zero'), ('ONE', 1, 'one'), ('TWO', 2, 'two')] [('ONE', 1, 'one'), ('TWO', 2, 'two')] [('ZERO', 0, 'zero'), ('ONE', 1, 'one'), ('TWO', 2, 'two'), ('THREE', 3, 'three'), ('FOUR', 4, 'four')] [('THREE', 3, 'three'), ('FOUR', 4, 'four')] Raises ------ RuntimeError When the ``Choices`` instance is marked as not mutable, which is the case for subsets. ValueError * if the subset name is defined as first argument and as named argument. * if some constants have the same name or the same value. * if at least one constant or value already exists in the instance. """


        # It the ``_mutable`` flag is falsy, which is the case for subsets, we refuse to add
        # new choices.
        if not self._mutable:
            raise RuntimeError("This ``Choices`` instance cannot be updated.")

        # Check for an optional subset name as the first argument (so the first entry of *choices).
        subset_name = None
        if choices and isinstance(choices[0], six.string_types) and choices[0] != _NO_SUBSET_NAME_:
            subset_name = choices[0]
            choices = choices[1:]

        # Check for an optional subset name in the named arguments.
        if kwargs.get('name', None):
            if subset_name:
                raise ValueError("The name of the subset cannot be defined as the first "
                                 "argument and also as a named argument")
            subset_name = kwargs['name']

        constants = self._convert_choices(choices)

        # If we have a subset name, create a new subset with all the given constants.
        if subset_name:
            self.add_subset(subset_name, constants)