code: def extract_subset(self, *constants):
          
  
          # 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
docs: 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
          -------
  
          >>> STATES = Choices(
          ...     ('ONLINE',  1, 'Online'),
          ...     ('DRAFT',   2, 'Draft'),
          ...     ('OFFLINE', 3, 'Offline'),
          ... )
          >>> STATES
          [('ONLINE', 1, 'Online'), ('DRAFT', 2, 'Draft'), ('OFFLINE', 3, 'Offline')]
          >>> subset = STATES.extract_subset('DRAFT', 'OFFLINE')
          >>> subset
          [('DRAFT', 2, 'Draft'), ('OFFLINE', 3, 'Offline')]
          >>> subset.DRAFT
          2
          >>> subset.for_constant('DRAFT') is STATES.for_constant('DRAFT')
          True
          >>> subset.ONLINE
          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.