Return all `(key, value)` tuples for configurations in this node, including configurations on children nodes.
762109
def config_items(self, sortkey = False):
        
        if sortkey:
            items = sorted(self.items())
        else:
            items = self.items()
        for k,v in items:
            if isinstance(v, ConfigTree):
                for k2,v2 in v.config_items(sortkey):
                    yield (k + '.' + k2, v2)
            else:
                yield (k,v)
1009107
def collect_all_bucket_keys(self):
        
        if len(self.childs) == 0:
            # This is a leaf so just return the bucket key (we reached the bucket leaf)
            #print 'Returning (collect) leaf bucket key %s with %d vectors' % (self.bucket_key, self.vector_count)
            return [self.bucket_key]

        # Not leaf, return results of childs
        result = []
        for child in self.childs.values():
            result = result + child.collect_all_bucket_keys()

        return result
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
1091879
def leaf_keyvalue node
    h = {}
    node.children.each do |child|
      next unless child.element?
      h[child.name] = child.content
    end
    [h['key'], h['value']]
  end
248179
def get_keys_from_value(self, value):
        

        return [key for key, data in self.iteritems() if data == value]
959280
def iter_annotation_value_pairs(graph) -> Iterable[Tuple[str, str]]:
    
    return (
        (key, value)
        for _, _, data in graph.edges(data=True)
        if ANNOTATIONS in data
        for key, values in data[ANNOTATIONS].items()
        for value in values
    )
1187622
def children(self):
        """"""
        tags = {'*'}
        if self.tag:
            network_tags = {self.tag: self.campaign.network.tags[self.tag]}
        else:
            network_tags = self.campaign.network.tags
        for tag, configs in network_tags.items():
            for config in configs:
                for mode, kconfig in config.items():
                    if mode == 'match':
                        if kconfig.match(self.name) or kconfig.match(LOCALHOST):
                            tags.add(tag)
                            break
                    elif mode == 'nodes':
                        if self.name in kconfig or LOCALHOST in kconfig:
                            tags.add(tag)
                            break
                    elif mode == 'constraint':
                        tags.add(tag)
                        break
                if tag in tags:
                    break
        return tags
327953
def get_bindings_for_keys(self, keys):
        
        def get():
            result = []
            for b in self.key_bindings:
                if len(keys) == len(b.keys):
                    match = True
                    any_count = 0

                    for i, j in zip(b.keys, keys):
                        if i != j and i != Keys.Any:
                            match = False
                            break

                        if i == Keys.Any:
                            any_count += 1

                    if match:
                        result.append((any_count, b))

            # Place bindings that have more 'Any' occurences in them at the end.
            result = sorted(result, key=lambda item: -item[0])

            return [item[1] for item in result]

        return self._get_bindings_for_keys_cache.get(keys, get)
845341
def getAttrs(self, node):
        
        attrs = {}
        for k,v in node._attrs.items():
            attrs[k] = v.value
        return attrs
84966
def _nodes_to_values(self):
        
        def is_none(slice):
            return slice[0] == -1 and slice[1] == -1

        def get(slice):
            return self.string[slice[0]:slice[1]]

        return [(varname, get(slice), slice) for varname, slice in self._nodes_to_regs() if not is_none(slice)]
283505
def get_all_for(self, key):
        
        if not isinstance(key, _string_type):
            raise TypeError("Key needs to be a string.")
        return [self[(idx, key)] for idx in _range(self.__kcount[key])]
652220
public boolean containsAll(K key, Collection<? extends V> values) {
	return _getValues(key).containsAll(values);
    }
1339312
def get_children(self, depth=1):
        """"""
        yield self
        if depth == 0: return
        for child in self.children.values():
            for node in child.get_children(depth-1): yield node
1183481
def iflatten_dict_values(node, depth=0):
    
    if isinstance(node, dict):
        _iter = (iflatten_dict_values(value) for value in six.itervalues(node))
        return util_iter.iflatten(_iter)
    else:
        return node
1360447
def get_child(self, value):
        
        for node in self.children:
            if node.value == value:
                return node

        return None
750841
def merge_all_config_sections_into_a_single_dict(desired_type: Type[T], config: ConfigParser, logger: Logger,
                                                 conversion_finder: ConversionFinder, **kwargs) -> Dict[str, Any]:
    

    # convert the whole config to a dictionary by flattening all sections. If a key is found twice in two different
    # sections an error is raised
    results = dict()
    for section, props in config.items():
        for key, value in props.items():
            if key in results.keys():
                # find all sections where it appears
                sections_where_it_appears = [s for s, p in config.items() if key in p.keys()]
                raise MultipleKeyOccurenceInConfigurationError.create(key, sections_where_it_appears)
            else:
                results[key] = value

    return ConversionFinder.convert_collection_values_according_to_pep(results, desired_type, conversion_finder,
                                                                       logger, **kwargs)
60418
def values(cls):
        
        if not hasattr(cls, '__values_'):
            cls.__values_ = tuple([c.value for c in list(cls)])
        return cls.__values_