code: def create_choice(klass, choices, subsets, kwargs):
      
  
      obj = klass(*choices, **kwargs)
      for subset in subsets:
          obj.add_subset(*subset)
      return obj
docs: Create an instance of a ``Choices`` object.
  
      Parameters
      ----------
      klass : type
          The class to use to recreate the object.
      choices : list(tuple)
          A list of choices as expected by the ``__init__`` method of ``klass``.
      subsets : list(tuple)
          A tuple with an entry for each subset to create. Each entry is a list with two entries:
          - the name of the subsets
          - a list of the constants to use for this subset
      kwargs : dict
          Extra parameters expected on the ``__init__`` method of ``klass``.
  
      Returns
      -------
      Choices
          A new instance of ``Choices`` (or other class defined in ``klass``).