src/pybel/canonicalize.py
def _to_bel_lines_body(graph, use_identifiers: bool = False) -> Iterable[str]:
    """Iterate the lines of a BEL graph's corresponding BEL script's body.

    :param pybel.BELGraph graph: A BEL graph
    :param use_identifiers: Enables extended `BEP-0008 <http://bep.bel.bio/published/BEP-0008.html>`_ syntax
    """
    qualified_edges = sort_qualified_edges(graph)

    for (citation_db, citation_id), citation_edges in group_citation_edges(qualified_edges):
        yield SET_CITATION_FMT.format(citation_db, citation_id) + '\n'

        for evidence, evidence_edges in group_evidence_edges(citation_edges):
            yield 'SET SupportingText = "{}"'.format(evidence)

            for u, v, _, data in evidence_edges:
                annotations_data = data.get(ANNOTATIONS)

                keys = sorted(annotations_data) if annotations_data is not None else tuple()
                for key in keys:
                    yield _set_annotation_to_str(annotations_data, key, use_curie=key in graph.annotation_curie)

                yield graph.edge_to_bel(u, v, data, use_identifiers=use_identifiers)

                if keys:
                    yield _unset_annotation_to_str(keys)

            yield 'UNSET SupportingText'
        yield 'UNSET Citation\n'
        yield '#' * 80
Iterate the lines of a BEL graph's corresponding BEL script's body.

    :param pybel.BELGraph graph: A BEL graph
    :param use_identifiers: Enables extended `BEP-0008 <http://bep.bel.bio/published/BEP-0008.html>`_ syntax
    
Iterate the lines of a BEL graph's corresponding BEL script's body.
Iterate the lines of a BEL graph ' s corresponding BEL script ' s body .
def _to_bel_lines_body(graph, use_identifiers: bool = False) -> Iterable[str]:
    qualified_edges = sort_qualified_edges(graph)
    for (citation_db, citation_id), citation_edges in group_citation_edges(qualified_edges):
        yield SET_CITATION_FMT.format(citation_db, citation_id) + '\n'
        for evidence, evidence_edges in group_evidence_edges(citation_edges):
            yield 'SET SupportingText = "{}"'.format(evidence)
            for u, v, _, data in evidence_edges:
                annotations_data = data.get(ANNOTATIONS)
                keys = sorted(annotations_data) if annotations_data is not None else tuple()
                for key in keys:
                    yield _set_annotation_to_str(annotations_data, key, use_curie=key in graph.annotation_curie)
                yield graph.edge_to_bel(u, v, data, use_identifiers=use_identifiers)
                if keys:
                    yield _unset_annotation_to_str(keys)
            yield 'UNSET SupportingText'
        yield 'UNSET Citation\n'
        yield '#' * 80
def _to_bel_lines_body ( graph , use_identifiers : bool = False ) -> Iterable [ str ] : qualified_edges = sort_qualified_edges ( graph ) for ( citation_db , citation_id ) , citation_edges in group_citation_edges ( qualified_edges ) : yield SET_CITATION_FMT . format ( citation_db , citation_id ) + '\n' for evidence , evidence_edges in group_evidence_edges ( citation_edges ) : yield 'SET SupportingText = "{}"' . format ( evidence ) for u , v , _ , data in evidence_edges : annotations_data = data . get ( ANNOTATIONS ) keys = sorted ( annotations_data ) if annotations_data is not None else tuple ( ) for key in keys : yield _set_annotation_to_str ( annotations_data , key , use_curie = key in graph . annotation_curie ) yield graph . edge_to_bel ( u , v , data , use_identifiers = use_identifiers ) if keys : yield _unset_annotation_to_str ( keys ) yield 'UNSET SupportingText' yield 'UNSET Citation\n' yield '#' * 80
Iterate the lines of a BEL graph's corresponding BEL script's body.
Iterate the lines of a BEL graph ' s corresponding BEL script ' s body .
"""Iterate the lines of a BEL graph's corresponding BEL script's body.

    :param pybel.BELGraph graph: A BEL graph
    :param use_identifiers: Enables extended `BEP-0008 <http://bep.bel.bio/published/BEP-0008.html>`_ syntax
    """
graph
A BEL graph
A BEL graph
use_identifiers
bool
Enables extended `BEP-0008 `_ syntax
Enables extended ` BEP - 0008 ` _ syntax