def grid_layout(bpmn_graph, sorted_nodes_with_classification):
tmp_nodes_with_classification = list(sorted_nodes_with_classification)<EOL>last_row = consts.Consts.grid_column_width<EOL>last_col = <NUM_LIT:1><EOL>grid = []<EOL>while tmp_nodes_with_classification:<EOL><INDENT>node_with_classification = tmp_nodes_with_classification.pop(<NUM_LIT:0>)<EOL>(grid, last_row, last_col) = place_element_in_grid(node_with_classification, grid, last_row, last_col,<EOL>bpmn_graph, tmp_nodes_with_classification)<EOL><DEDENT>return grid<EOL>
:param sorted_nodes_with_classification:
:param bpmn_graph:
:return: