(morphisms)
return edges
Creates a dictionary which maps edges to corresponding
        morphisms.  Thus for a morphism `f:A\rightarrow B`, the edge
        `(A, B)` will be associated with `f`.  This function also adds
        to the list those edges which are formed by juxtaposition of
        two edges already in the list.  These new edges are not
        associated with any morphism and are only added to assure that
        the diagram can be decomposed into triangles.
Creates a dictionary which maps edges to corresponding
        morphisms.  Thus for a morphism `f:A\rightarrow B`, the edge
        `(A, B)` will be associated with `f`.  This function also adds
        to the list those edges which are formed by juxtaposition of
        two edges already in the list.  These new edges are not
        associated with any morphism and are only added to assure that
        the diagram can be decomposed into triangles.
Creates a dictionary which maps edges to corresponding morphisms . Thus for a morphism f : A \ rightarrow B the edge ( A B ) will be associated with f . This function also adds to the list those edges which are formed by juxtaposition of two edges already in the list . These new edges are not associated with any morphism and are only added to assure that the diagram can be decomposed into triangles .
def _build_skeleton(morphisms):
        """
        Creates a dictionary which maps edges to corresponding
        morphisms.  Thus for a morphism `f:A\rightarrow B`, the edge
        `(A, B)` will be associated with `f`.  This function also adds
        to the list those edges which are formed by juxtaposition of
        two edges already in the list.  These new edges are not
        associated with any morphism and are only added to assure that
        the diagram can be decomposed into triangles.
        """
        edges = {}
        # Create edges for morphisms.
        for morphism in morphisms:
            DiagramGrid._add_edge_append(
                edges, frozenset([morphism.domain, morphism.codomain]), morphism)

        # Create new edges by juxtaposing existing edges.
        edges1 = dict(edges)
        for w in edges1:
            for v in edges1:
                wv = DiagramGrid._juxtapose_edges(w, v)
                if wv and wv not in edges:
                    edges[wv] = []

        return edges
def _build_skeleton ( morphisms ) : edges = { } # Create edges for morphisms. for morphism in morphisms : DiagramGrid . _add_edge_append ( edges , frozenset ( [ morphism . domain , morphism . codomain ] ) , morphism ) # Create new edges by juxtaposing existing edges. edges1 = dict ( edges ) for w in edges1 : for v in edges1 : wv = DiagramGrid . _juxtapose_edges ( w , v ) if wv and wv not in edges : edges [ wv ] = [ ] return edges