code: def dict_contents(self, use_dict=None, as_class=dict):
          
          if _debug: Choice._debug("dict_contents use_dict=%r as_class=%r", use_dict, as_class)
  
          # make/extend the dictionary of content
          if use_dict is None:
              use_dict = as_class()
  
          # look for the chosen element
          for element in self.choiceElements:
              value = getattr(self, element.name, None)
              if value is None:
                  continue
  
              if issubclass(element.klass, Atomic):
                  mapped_value = value                    ### ambiguous
              elif issubclass(element.klass, AnyAtomic):
                  mapped_value = value.value              ### ambiguous
              elif isinstance(value, element.klass):
                  mapped_value = value.dict_contents(as_class=as_class)
  
              use_dict.__setitem__(element.name, mapped_value)
              break
  
          # return what we built/updated
          return use_dict
docs: Return the contents of an object as a dict.