def add_node(graph, node):
    """Add `node` to `graph`. `node` is a tuple with the
    following shape:
        (node_id, {<node attributes>}, {<graph's node attributes>})
            ^              ^                      ^
         string           see graphviz documentation"""
    node_id, node_attr, graph_node_attr = node
    graph.node(node_id, **node_attr, **graph_node_attr)
    return graph