def flat_node_list(graph):
    """
    returns list of all non-compund nodes in a graph, inculding
    all the nodes that are inside compound nodes.
    """
    node_ids = []
    for node in graph:
        node_data = graph.node[node]
        #print(node_data)
        if 'components' in node_data:
            internal_nodes = list(node_data['components'])
            internal_nodes.append(node)
        else:
            internal_nodes = [node]
        node_ids.extend(internal_nodes)
    return list(set(node_ids))