a generator that returns all the keys in a set of nested
        DotDict instances.  The keys take the form X.Y.Z
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)
1274055
def keys(self):
        
        keys = ['text']
        keys.extend([n for (n, t, r) in self.c_attributes.values()])
        keys.extend([v[0] for v in self.c_children.values()])
        return keys
1174407
def gen_keys(keydir=None, keyname=None, keysize=None, user=None):
    '''
    
    '''
    skey = get_key(__opts__)
    return skey.gen_keys(keydir, keyname, keysize, user)
809797
def keys(cls):
        
        if cls._cache_keys is None:
            cls._cache_keys = [c.name for c in cls.__table__._columns]
        return cls._cache_keys
1318090
def get_all(self):
        
        if not self.vars:
            return self.parent
        if not self.parent:
            return self.vars
        return dict(self.parent, **self.vars)
993859
def keys(self):
        """"""
        keys = self._keys
        if keys is None:
            keys = tuple(self[i].name for i in self.key_indices)
        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
1132516
def read_keys(self, keys, dict_cls=AttrDict, path="/"):
        
        od = dict_cls()
        for k in keys:
            try:
                # Try to read a variable.
                od[k] = self.read_value(k, path=path)
            except self.Error:
                try:
                    # Try to read a dimension.
                    od[k] = self.read_dimvalue(k, path=path)
                except self.Error:
                    od[k] = None

        return od
616362
def collection_keys(coll, sep='.'):
    
    def _keys(x, pre=''):
        for k in x:
            yield (pre + k)
            if isinstance(x[k], dict):
                for nested in _keys(x[k], pre + k + sep):
                    yield nested

    return list(_keys(coll.find_one()))
1142302
def __get_keys(self):
        
        keys = list()
        tree_node = self
        while tree_node is not None and tree_node.key is not None:
            keys.insert(0, tree_node.key)
            tree_node = tree_node.parent
        return keys
80084
def keys(self):
        
        keys = []
        for key, value in self._values.items():
            if isinstance(value, (FlatDict, dict)):
                nested = [self._delimiter.join([key, k]) for k in value.keys()]
                keys += nested if nested else [key]
            else:
                keys.append(key)
        return sorted(keys)
1198901
def _data_keys(self):
        
        return [name for name, child in iteritems(self._children) if not isinstance(child, GroupNode)]
113976
def get_all_keys(self, start=None):
        
        s = self.stream
        if not start:
            start = HEADER_SIZE + self.block_size * self.root_block
        s.seek(start)
        block_type = s.read(2)
        if block_type == LEAF:
            reader = LeafReader(self)
            num_keys = struct.unpack('>i', reader.read(4))[0]
            for _ in range(num_keys):
                cur_key = reader.read(self.key_size)
                # We to a tell/seek here so that the user can read from
                # the file while this loop is still being run
                cur_pos = s.tell()
                yield cur_key
                s.seek(cur_pos)
                length = sbon.read_varint(reader)
                reader.seek(length, 1)
        elif block_type == INDEX:
            (_, num_keys, first_child) = struct.unpack('>Bii', s.read(9))
            children = [first_child]
            for _ in range(num_keys):
                # Skip the key field.
                _ = s.read(self.key_size)
                # Read pointer to the child block.
                next_child = struct.unpack('>i', s.read(4))[0]
                children.append(next_child)
            for child_loc in children:
                for key in self.get_all_keys(HEADER_SIZE + self.block_size * child_loc):
                    yield key
        elif block_type == FREE:
            pass
        else:
            raise Exception('Unhandled block type: {}'.format(block_type))
1071
def nested_get(dictionary, keys):
    
    return reduce(lambda d, k: d[k], keys, dictionary)
1360897
def keys(self, key_type=None):
        
        if key_type is not None:
            intermediate_key = str(key_type)
            if intermediate_key in self.__dict__:
                return self.__dict__[intermediate_key].keys()
        else:
            all_keys = {} # in order to preserve keys() type (dict_keys for python3) 
            for keys in self.items_dict.keys():
                all_keys[keys] = None
            return all_keys.keys()
378090
def keys(self, id=None, search=None):
        
        if self._keys is None:
            self._keys = {}
            self._list_keys()

        if id:
            return [self._keys[key_id] for key_id in self._keys.keys()
                    if id == self._keys[key_id].id]
        elif search:
            return [self._keys[key_id] for key_id in self._keys.keys()
                    if (search in self._keys[key_id].id) or (search in self._keys[key_id].name)]
        else:
            return [self._keys[key_id] for key_id in self._keys.keys()]
419088
def asDict(self):
        
        d = {}
        for k, v in self.items():
            d[k] = v
        return d