def parent_contribs(parent_weight_children):
    (parent, weight, children) = parent_weight_children
    contrib_from_parent = (weight / len(children))
    for child in children:
        (yield (child, contrib_from_parent))
def parent_contribs(parent_weight_children):
    (parent, weight, children) = parent_weight_children
    contrib_from_parent = (weight / len(children))
    for child in children:
        (yield (child, contrib_from_parent))