def add_node(nodes, parent, time):
    """Adds a node with specified parent and creation time. This functions assumes that
    a node has been already allocated by "child" functions `add_node_classifier` and
    `add_node_regressor`.

    Parameters
    ----------
    nodes : :obj:`Nodes`
        The collection of nodes.

    parent : :obj:`int`
        The index of the parent of the new node.

    time : :obj:`float`
        The creation time of the new node.

    Returns
    -------
    output : `int`
        Index of the new node.

    """
    node_index = nodes.n_nodes
    nodes.index[node_index] = node_index
    nodes.parent[node_index] = parent
    nodes.time[node_index] = time
    nodes.n_nodes += 1
    return nodes.n_nodes - 1