Get first level keys from a list of dicts
558316
def get_ldict_keys(ldict, flatten_keys=False, **kwargs):
    
    result = []
    for ddict in ldict:
        if isinstance(ddict, dict):

            if flatten_keys:
                ddict = flatten(ddict, **kwargs)

            result.extend(ddict.keys())
    return list(set(result))
480694
def keys(self, start=None, stop=None):
        """"""
        return (item[0] for item in self.items(start, stop))
299736
def mget(self, *keys):
        
        return list(map(
            self._loads, self._client.hmget(self.key_prefix, *keys)))
1038195
function keysIndexes(children, startIndex, endIndex) {
  var i, keys = Object.create(null), key;
  for (i = startIndex; i <= endIndex; ++i) {
    if (children[i]) {
      key = children[i].key;
      if (key !== undefined) {
        keys[key] = i;
      }
    }
  }
  return keys;
}
739632
def reduce_by_keys(orig_dict, keys, default=None):
    
    ret = {}
    for key in keys:
        ret[key] = orig_dict.get(key, default)
    return ret
1100143
def _keys2sls(self, keys, key2sl):
        """"""
        sls = list()
        if isinstance(keys, tuple):
            for key in keys:
                sls.append(key2sl(key))
        else:
            sls.append(key2sl(keys))
        if len(sls) > self.ndim:
            fstr = "expected <= {0.ndim} slice dimensions, got {1}"
            raise ValueError(fstr.format(self, len(sls)))
        return sls
15616
def keys_breadth_first(self, include_dicts=False):
        """"""
        namespaces = []
        for key in self._key_order:
            if isinstance(getattr(self, key), DotDict):
                namespaces.append(key)
                if include_dicts:
                    yield key
            else:
                yield key
        for a_namespace in namespaces:
            for key in self[a_namespace].keys_breadth_first(include_dicts):
                yield '%s.%s' % (a_namespace, key)
248179
def get_keys_from_value(self, value):
        

        return [key for key, data in self.iteritems() if data == value]
331990
def get_first_defined(data, keys, default_value=None):
    
    for key in keys:
        if key in data:
            return data[key]
    return default_value
583103
def keys(self, section, prefix=None):
        
        return [key for key, _ in self.items(section) if (not prefix or key.startswith(prefix))]
229041
def _filter_keys(d: dict, keys: set) -> dict:
        
        return {key: d[key] for key in keys if key in d}
15103
def get_first_key_from_value(self, value):
        

        for key, data in self.iteritems():
            if data == value:
                return key
867264
def keys_at(self, x):
		
		return [key for key, segs in self.items() if x in segs]
1294341
def _find_keys(self):
        
        formatter = string.Formatter()
        return [
            val[1] for val in formatter.parse(self._original_filter) if val[1]
        ]
1163677
def get_inner_keys(dictionary):
    

    keys = []

    for key in dictionary.keys():
        inner_keys = dictionary[key].keys()
        keys += [
            key + " " + inner_key  # concatenate
            for inner_key in inner_keys
        ]

    return keys
405847
def recursive_asdict(d):
    """"""
    out = {}
    for k, v in asdict(d).iteritems():
        if hasattr(v, '__keylist__'):
            out[k] = recursive_asdict(v)
        elif isinstance(v, list):
            out[k] = []
            for item in v:
                if hasattr(item, '__keylist__'):
                    out[k].append(recursive_asdict(item))
                else:
                    out[k].append(item)
        else:
            out[k] = v
    return out
610023
def _get_key(args, kwargs, remove_callback):
    """"""
    # Use tuples, because lists are not hashable.
    weak_args = tuple(_try_weakref(arg, remove_callback) for arg in args)
    # Use a tuple of (key, values) pairs, because dict is not hashable.
    # Sort it, so that we don't depend on the order of keys.
    weak_kwargs = tuple(sorted(
        (key, _try_weakref(value, remove_callback))
        for (key, value) in kwargs.items()))
    return weak_args, weak_kwargs