<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_subset(self, *constants):
 """Create a subset of entries This subset is a new ``Choices`` instance, with only the wanted constants from the main ``Choices`` (each "choice entry" in the subset is shared from the main ``Choices``) Parameters *constants: list The constants names of this ``Choices`` object to make available in the subset. Returns ------- Choices The newly created subset, which is a ``Choices`` object Example ------- [('ONLINE', 1, 'Online'), ('DRAFT', 2, 'Draft'), ('OFFLINE', 3, 'Offline')] [('DRAFT', 2, 'Draft'), ('OFFLINE', 3, 'Offline')] 2 True Traceback (most recent call last):
 AttributeError: 'Choices' object has no attribute 'ONLINE' Raises ------ ValueError If a constant is not defined as a constant in the ``Choices`` instance. """


        # Ensure that all passed constants exists as such in the list of available constants.
        bad_constants = set(constants).difference(self.constants)
        if bad_constants:
            raise ValueError("All constants in subsets should be in parent choice. "
                             "Missing constants: %s." % list(bad_constants))

        # Keep only entries we asked for.
        choice_entries = [self.constants[c] for c in constants]

        # Create a new ``Choices`` instance with the limited set of entries, and pass the other
        # configuration attributes to share the same behavior as the current ``Choices``.
        # Also we set ``mutable`` to False to disable the possibility to add new choices to the
        # subset.
        subset = self.__class__(
            *choice_entries,
            **{
                'dict_class': self.dict_class,
                'mutable': False,
            }
        )

        return subset