def _walk_clades(trees, weights):
    clade_counts = defaultdict(float)
    edge_lengths = defaultdict(float)
    total = weights.sum()

    # get clade counts
    def tipnames_f(n):
        return [n.name] if n.is_tip() else []

    for tree, weight in zip(trees, weights):
        tree.cache_attr(tipnames_f, 'tip_names', frozenset)

        for node in tree.postorder():
            tip_names = node.tip_names

            # if node.length is not None, fetch it and weight it
            length = node.length * weight if node.length is not None else None

            clade_counts[tip_names] += weight

            if length is None:
                edge_lengths[tip_names] = None
            else:
                edge_lengths[tip_names] += length / total

    # sort clades by number times observed
    clade_counts = sorted(clade_counts.items(), key=lambda x: len(x[0]),
                          reverse=True)

    return clade_counts, edge_lengths
Look for user_setup_url in checkid_immediate negative
dataset/ETHPy150Open biocore/scikit-bio/skbio/tree/_majority_rule.py/_walk_clades--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/openid/test/test_server.py/TestCheckID.test_answerImmediateDenyOpenID1