Return dict where keys and values of ``subj_dict`` have been flipped
        around.
481574
def _perm_dict_from_subj_dict(self, subj_dict):
        """"""
        perm_dict = {}
        for subj_str, perm_set in list(subj_dict.items()):
            for perm_str in perm_set:
                perm_dict.setdefault(perm_str, set()).add(subj_str)
        return perm_dict
561604
def reverse_dict(self):
        """"""
        self.reserve_paint = dict(zip(self.paint.values(), self.paint.keys()))
360676
def _dict_key_priority(s):
        """"""
        if isinstance(s, Hook):
            return _priority(s._schema) - 0.5
        if isinstance(s, Optional):
            return _priority(s._schema) + 0.5
        return _priority(s)
273682
def show_item_dict(self, item):
        """"""
        d = {}
        for col in self.show_columns:
            v = getattr(item, col)
            if not isinstance(v, (int, float, string_types)):
                v = str(v)
            d[col] = v
        return d
97957
def changed(self):
        """"""
        return {key: value for key, value in six.iteritems(self)
                if getattr(self, key).changed}
562733
def _default_dict(self):
        """"""
        options = {}
        for attr, _, _, default, multi, _ in self._optiondict.values():
            if multi and default is None:
                options[attr] = []
            else:
                options[attr] = default
        return options
533124
def dict_merged(d, _filter=None, **kw):
    """"""
    def f(s):
        if _filter:
            return _filter(s)
        return s is not None
    d = d or {}
    for k, v in iteritems(kw):
        if f(v):
            d[k] = v
    return d
91624
def dict_minus(d, *keys):
    """"""
    # make shallow copy
    d = dict(d)
    for key in keys:
        try:
            del d[key]
        except:
            pass
    return d
1212369
def get_reversed_aliases(self):
        
        return dict((v, k) for k, v in six.iteritems(self.aliases))
450907
def inverted_dict(d):
    
    return dict((force_hashable(v), k) for (k, v) in viewitems(dict(d)))
527460
def from_dict(cls, d):
        """"""
        return cls(**{k: v for k, v in d.items() if k in cls.ENTRIES})
840801
def invertDictMapping(d):
    
    inv_map = {}
    for k, v in d.items():
        inv_map[v] = inv_map.get(v, [])
        inv_map[v].append(k)
    return inv_map
682068
def get_subs_dict(self, qnodes=None):
        
        #d = self.qparams.copy()
        d = self.qparams
        d.update(self.optimize_params(qnodes=qnodes))
        # clean null values
        subs_dict = {k: v for k, v in d.items() if v is not None}
        #print("subs_dict:", subs_dict)
        return subs_dict
703962
def valuestodict(key):
    """"""
    dict = {}
    size = winreg.QueryInfoKey(key)[1]
    for i in range(size):
        data = winreg.EnumValue(key, i)
        dict[data[0]] = data[1]
    return dict
381033
def _asdict(self):
    """"""
    # Start with any default values we have, and override with loaded values,
    # and then override with flag values.
    retval = {key: self._declarations[key].default_value for
              key in self._declarations if self._declarations[key].has_default}
    retval.update(self._loaded_values)
    # Only update keys that are declared so we don't allow injecting
    # un-declared keys via commandline flags.
    for key, value in self._modules['six'].iteritems(self._flag_values):
      if key in self._declarations:
        retval[key] = value
    return retval
949117
def flatten_dict(d,
                 parent_key='', sep='.',
                 ignore_under_prefixed=True,
                 mark_value=True):
    '''
    
    '''
    items = {}
    for k in d:
        if ignore_under_prefixed and k.startswith('__'): continue
        v = d[k]
        if mark_value and k.startswith('_') and not k.startswith('__'):
            v = MarkValue(repr(v))

        new_key = sep.join((parent_key, k)) if parent_key else k
        if isinstance(v, collections.MutableMapping):
            items.update(flatten_dict(v, new_key, sep=sep,
                                        ignore_under_prefixed=True,
                                        mark_value=True)
                            )
        else:
            items[new_key] = v

    return items
462718
def keys_in_dict(d, parent_key, keys):
    
    for key, value in d.iteritems():
        if isinstance(value, dict):
            keys_in_dict(value, key, keys)
        else:
            if parent_key:
                prefix = parent_key + "."
            else:
                prefix = ""

            keys.append(prefix + key)

    return keys