def test_graph_cycle_direct(session, graph, users, groups):  # noqa

    add_member(groups["team-sre"], users["gary@a.co"])
    add_member(groups["tech-ops"], users["zay@a.co"])

    add_member(groups["team-sre"], groups["tech-ops"])
    add_member(groups["tech-ops"], groups["team-sre"])

    session.commit()
    graph.update_from_db(session)
    assert get_users(graph, "team-sre") == set(["gary@a.co", "zay@a.co"])
    assert get_users(graph, "team-sre", cutoff=1) == set(["gary@a.co"])

    assert get_users(graph, "tech-ops") == set(["gary@a.co", "zay@a.co"])
    assert get_users(graph, "tech-ops", cutoff=1) == set(["zay@a.co"])

    assert get_groups(graph, "gary@a.co") == set(["team-sre", "tech-ops"])
    assert get_groups(graph, "gary@a.co", cutoff=1) == set(["team-sre"])

    assert get_groups(graph, "zay@a.co") == set(["team-sre", "tech-ops"])
    assert get_groups(graph, "zay@a.co", cutoff=1) == set(["tech-ops"])
Perform mean field inference, using the model's inference procedure.
dataset/ETHPy150Open dropbox/grouper/tests/test_groups.py/test_graph_cycle_direct--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/dbm/dbm.py/DBM.mf