def add_node(self, node_name, edge_into_node_begin, edge_into_node_function, edge_out_node_end, edge_out_node_function, node_description=None):
    'Adds a node to the graph. Required input is node_name (a string with no spaces),\n        a reference to an entering node,the function mapping the entering node to the new node,\n        a reference to an exiting node and the function mapping the\n        new node to the exiting node.'
    self.node_names.append(node_name)
    self.state.append(0)
    self.state_matrix = np.matrix(self.state).T
    for (index, matrix) in enumerate(self.edge_matrices):
        pad_row = np.zeros((1, len(matrix)))
        new_matrix = np.concatenate((matrix, pad_row), axis=0)
        pad_column = np.zeros((1, len(self.node_names)))
        new_matrix = np.concatenate((new_matrix, pad_column.T), axis=1)
        self.edge_matrices[index] = new_matrix
    self.add_edge(begin_node=node_name, end_node=edge_out_node_end, edge_function=edge_out_node_function)
    self.add_edge(begin_node=edge_into_node_begin, end_node=node_name, edge_function=edge_into_node_function)
    if node_description:
        self.node_descriptions.append(node_description)
    self.display_graph.add_node(node_name)
    self.display_graph.add_edge(node_name, edge_out_node_end)
    self.display_graph.add_edge(edge_into_node_begin, node_name)
    self.display_layout = networkx.spring_layout(self.display_graph)
Adds a node to the graph. Required input is node_name (a string with no spaces),
a reference to an entering node,the function mapping the entering node to the new node,
a reference to an exiting node and the function mapping the
new node to the exiting node.
def add_node(self, node_name, edge_into_node_begin, edge_into_node_function, edge_out_node_end, edge_out_node_function, node_description=None):
    'Adds a node to the graph. Required input is node_name (a string with no spaces),\n        a reference to an entering node,the function mapping the entering node to the new node,\n        a reference to an exiting node and the function mapping the\n        new node to the exiting node.'
    self.node_names.append(node_name)
    self.state.append(0)
    self.state_matrix = np.matrix(self.state).T
    for (index, matrix) in enumerate(self.edge_matrices):
        pad_row = np.zeros((1, len(matrix)))
        new_matrix = np.concatenate((matrix, pad_row), axis=0)
        pad_column = np.zeros((1, len(self.node_names)))
        new_matrix = np.concatenate((new_matrix, pad_column.T), axis=1)
        self.edge_matrices[index] = new_matrix
    self.add_edge(begin_node=node_name, end_node=edge_out_node_end, edge_function=edge_out_node_function)
    self.add_edge(begin_node=edge_into_node_begin, end_node=node_name, edge_function=edge_into_node_function)
    if node_description:
        self.node_descriptions.append(node_description)
    self.display_graph.add_node(node_name)
    self.display_graph.add_edge(node_name, edge_out_node_end)
    self.display_graph.add_edge(edge_into_node_begin, node_name)
    self.display_layout = networkx.spring_layout(self.display_graph)