def create_edges(cells_nodes):
<EOL>local_idx = numpy.array([[<NUM_LIT:1>, <NUM_LIT:2>], [<NUM_LIT:2>, <NUM_LIT:0>], [<NUM_LIT:0>, <NUM_LIT:1>]]).T<EOL>nds = cells_nodes.T<EOL>idx_hierarchy = nds[local_idx]<EOL>s = idx_hierarchy.shape<EOL>a = numpy.sort(idx_hierarchy.reshape(s[<NUM_LIT:0>], s[<NUM_LIT:1>] * s[<NUM_LIT:2>]).T)<EOL>b = numpy.ascontiguousarray(a).view(<EOL>numpy.dtype((numpy.void, a.dtype.itemsize * a.shape[<NUM_LIT:1>]))<EOL>)<EOL>_, idx, inv, cts = numpy.unique(<EOL>b, return_index=True, return_inverse=True, return_counts=True<EOL>)<EOL>assert all(cts < <NUM_LIT:3>)<EOL>edge_nodes = a[idx]<EOL>cells_edges = inv.reshape(<NUM_LIT:3>, -<NUM_LIT:1>).T<EOL>return edge_nodes, cells_edges<EOL>
Setup edge-node and edge-cell relations. Adapted from voropy.