src/pybel/testing/utils.py
def make_dummy_annotations(manager: Manager, graph: BELGraph):
    """Make dummy annotations for the test."""
    namespaces = {}
    for keyword, entity in iter_annotation_value_pairs(graph):
        namespace = namespaces.get(keyword)
        if namespace is None:
            graph.annotation_url[keyword] = url = n()
            namespace = Namespace(keyword=keyword, url=url, is_annotation=True)
            manager.session.add(namespace)

        entry = NamespaceEntry(name=entity.name, identifier=entity.identifier, namespace=namespace)
        manager.session.add(entry)

    manager.session.commit()
Make dummy annotations for the test.
Make dummy annotations for the test.
Make dummy annotations for the test .
def make_dummy_annotations(manager: Manager, graph: BELGraph):
    namespaces = {}
    for keyword, entity in iter_annotation_value_pairs(graph):
        namespace = namespaces.get(keyword)
        if namespace is None:
            graph.annotation_url[keyword] = url = n()
            namespace = Namespace(keyword=keyword, url=url, is_annotation=True)
            manager.session.add(namespace)
        entry = NamespaceEntry(name=entity.name, identifier=entity.identifier, namespace=namespace)
        manager.session.add(entry)
    manager.session.commit()
def make_dummy_annotations ( manager : Manager , graph : BELGraph ) : namespaces = { } for keyword , entity in iter_annotation_value_pairs ( graph ) : namespace = namespaces . get ( keyword ) if namespace is None : graph . annotation_url [ keyword ] = url = n ( ) namespace = Namespace ( keyword = keyword , url = url , is_annotation = True ) manager . session . add ( namespace ) entry = NamespaceEntry ( name = entity . name , identifier = entity . identifier , namespace = namespace ) manager . session . add ( entry ) manager . session . commit ( )
Make dummy annotations for the test.
Make dummy annotations for the test .
"""Make dummy annotations for the test."""
manager
Manager
graph
BELGraph