Return a deep dict of the values selected.

    The leaf values may still be gcl Tuples. Use util.to_python() if you want
    to reify everything to real Python values.
344543
def deep(self):
    
    self.lists = {}
    ret = {}
    for path, value in self.paths_values():
      self.recursiveSet(ret, path, value)
    self.removeMissingValuesFromLists()
    return ret
1107766
def get_value_tuple(self):
        
        retval = tuple()
        for val in self.VALUES:
            retval += (getattr(self, val),)
        return retval
26012
def to_dict(self):
        
        if self._dict is not None:
            return self._dict

        result = {}
        for key in self.ATTRIBUTES:
            value = getattr(self, key)
            if value:
                result[key] = value
        self._dict = result
        return result
561460
def _to_full_dict(xmltree):
    '''
    
    '''
    xmldict = {}

    for attrName, attrValue in xmltree.attrib.items():
        xmldict[attrName] = attrValue

    if not xmltree.getchildren():
        if not xmldict:
            # If we don't have attributes, we should return the value as a string
            # ex: <entry>test</entry>
            return xmltree.text
        elif xmltree.text:
            # XML allows for empty sets with attributes, so we need to make sure that capture this.
            # ex: <entry name="test"/>
            xmldict[_conv_name(xmltree.tag)] = xmltree.text

    for item in xmltree:
        name = _conv_name(item.tag)

        if name not in xmldict:
            xmldict[name] = _to_full_dict(item)
        else:
            # If a tag appears more than once in the same place, convert it to
            # a list. This may require that the caller watch for such a thing
            # to happen, and behave accordingly.
            if not isinstance(xmldict[name], list):
                xmldict[name] = [xmldict[name]]

            xmldict[name].append(_to_full_dict(item))

    return xmldict
899626
def as_dict(self):
        
        out = dict({})
        for key in self.keys():
            if self._has_delimiter(key):
                pk, ck = key.split(self._delimiter, 1)
                if self._has_delimiter(ck):
                    ck = ck.split(self._delimiter, 1)[0]
                if isinstance(self._values[pk], FlatDict) and pk not in out:
                    out[pk] = dict()
                if isinstance(self._values[pk][ck], FlatDict):
                    out[pk][ck] = self._values[pk][ck].as_dict()
                else:
                    out[pk][ck] = self._values[pk][ck]
            else:
                out[key] = self._values[key]
        return out
1192253
def convert(self, root_cls):
        

        d = self.__dict__
        d['sl'] = self.sl

        try:
            cls = root_cls.get_class(root_cls.sl)
        except (AttributeError, TypeError):
            # Hopefully because root_cls is a module
            cls = root_cls.get_class(self.sl)

        return cls(**d)
317531
def _opts_to_dict(*opts):
	''''''
	ret = {}
	for key, val in opts:
		if key[:2] == '--':
			key = key[2:]
		elif key[:1] == '-':
			key = key[1:]
		if val == '':
			val = True
		ret[key.replace('-','_')] = val
	return ret
491932
def to_dict(self, val=UNSET):
        
        if val is UNSET:
            val = self

        if isinstance(val, dict2) or isinstance(val, dict):
            res = dict()
            for k, v in val.items():
                res[k] = self.to_dict(v)
            return res
        elif isinstance(val, list):
            res = []
            for item in val:
                res.append(self.to_dict(item))
            return res
        else:
            return val
1278720
def to_dict(self):
        
        result = super(OptionHandler, self).to_dict()
        result["type"] = "OptionHandler"
        result["options"] = join_options(self.options)
        return result
1192398
def as_dict(self) -> Dict[str, Any]:
        
        return dict((opt.name, opt.value()) for name, opt in self._options.items())
1154989
def to_dict(self):
        
        return dict(
            (k, self.__dict__[k]) for k in self.__dict__ if k.find("_") != 0)
1327115
def to_dict(self):
        
        input_dict = super(Constant, self)._save_to_input_dict()
        input_dict["class"] = "GPy.mappings.Constant"
        input_dict["value"] = self.C.values[0]
        return input_dict
739436
def get_values(self, dtype=None):
        
        if is_object_dtype(dtype):
            return self.values.astype(object)
        return self.values
831785
def to_python(value, seen=None):
  
  seen = seen or set()
  if isinstance(value, framework.TupleLike):
    if value.ident in seen:
      raise RecursionException('to_python: infinite recursion while evaluating %r' % value)
    new_seen = seen.union([value.ident])
    return {k: to_python(value[k], seen=new_seen) for k in value.exportable_keys()}
  if isinstance(value, dict):
    return {k: to_python(value[k], seen=seen) for k in value.keys()}
  if isinstance(value, list):
    return [to_python(x, seen=seen) for x in value]
  return value
613028
def to_dict(self):
        
        return {k: v.to_dict() if isinstance(v, AttrDict) else v
                for k, v in self.__dict__.items() if not k.startswith('_')}
390039
def value(self):
        '''
        '''
        if len(self.__dict__['values']) == 1 and current_app.config['FORCE_ATTRIBUTE_VALUE_AS_LIST'] is False:
            return self.__dict__['values'][0]
        else:
            return self.__dict__['values']
1049379
def choices(self, cl):
        
        #: Just tidy up standard implementation for the sake of DRY principle.
        def _choice_item(is_selected, query_string, title):
            return {
                'selected': is_selected,
                'query_string': query_string,
                'display': force_text(title),
            }

        yield _choice_item(
            self.lookup_val is None,
            cl.get_query_string({}, [self.lookup_kwarg]),
            _('All'))

        container = (self.field.choices
                     if isinstance(self.field, ChoicesField) else
                     self.field.flatchoices)

        for lookup, title in container:
            yield _choice_item(
                smart_text(lookup) == self.lookup_val,
                cl.get_query_string({self.lookup_kwarg: lookup}),
                title)