def get_exiting_nodes(self, node):
    'Returns all nodes that have an edge leaving the specificed node'
    exit_edge_pattern = re.compile('edge_{0}_(?P<end_node>\\w+)_(?P<iterator>\\w+)'.format(node))
    exit_nodes = []
    for (index, edge) in enumerate(self.edges):
        exit_match = re.match(exit_edge_pattern, edge)
        if exit_match:
            exit_node = exit_match.groupdict()['end_node']
            exit_nodes.append(exit_node)
    return exit_nodes
Returns all nodes that have an edge leaving the specificed node
def get_exiting_nodes(self, node):
    
    exit_edge_pattern = re.compile('edge_{0}_(?P<end_node>\\w+)_(?P<iterator>\\w+)'.format(node))
    exit_nodes = []
    for (index, edge) in enumerate(self.edges):
        exit_match = re.match(exit_edge_pattern, edge)
        if exit_match:
            exit_node = exit_match.groupdict()['end_node']
            exit_nodes.append(exit_node)
    return exit_nodes