def add_node(graph, node_id, attrs=dict()):
    """Add a node to a graph.

    Parameters
    ----------
    graph : regraph.Graph
    node_id : hashable
        Prefix that is prepended to the new unique name.
    attrs : dict, optional
        Node attributes.

    Raises
    -------
    regraph.exceptions.GraphError
        Raises an error if node already exists in the graph.
    """
    graph.add_node(node_id, attrs)
