def add_composition(node, composition, part=None):
    """Add composition to node"""
    if part is None:
        raise ValueError("'part' must be a function that returns a node")
    node.add_attr(composition.type, part(composition), position=composition
        .position, extra=composition.extra)
