# Path: pyphi/connectivity.py
# def apply_boundary_conditions_to_cm(external_indices, cm):
# def get_inputs_from_cm(index, cm):
# def get_outputs_from_cm(index, cm):
# def causally_significant_nodes(cm):
# def relevant_connections(n, _from, to):
# def block_cm(cm):
#     def outputs_of(nodes):
#     def inputs_to(nodes):
# def block_reducible(cm, nodes1, nodes2):
# def _connected(cm, nodes, connection):
# def is_strong(cm, nodes=None):
# def is_weak(cm, nodes=None):
# def is_full(cm, nodes1, nodes2):


import numpy as np
from pyphi import connectivity
    cm = np.array([
        [0, 0, 1],
        [1, 0, 1],
        [1, 1, 0],
    ])
    # fmt: on
    assert not connectivity.is_full(cm, (0,), (0, 1, 2))
    assert not connectivity.is_full(cm, (2,), (2,))
    assert not connectivity.is_full(cm, (0, 1), (1, 2))
    assert connectivity.is_full(cm, (), (0, 1, 2))
    assert connectivity.is_full(cm, (0,), ())
    assert connectivity.is_full(cm, (0, 1), (0, 2))
    assert connectivity.is_full(cm, (1, 2), (1, 2))
    assert connectivity.is_full(cm, (0, 1, 2), (0, 1, 2))


def test_apply_boundary_conditions():
    # fmt: off
    cm = np.array([
        [0, 0, 1],
        [1, 0, 1],
        [1, 1, 0],
    ])
    answer = np.array([
        [0, 0, 1],
        [0, 0, 0],
        [1, 0, 0],
    ])
    # fmt: on
    assert np.array_equal(

# Path: pyphi/connectivity.py
# def apply_boundary_conditions_to_cm(external_indices, cm):
# def get_inputs_from_cm(index, cm):
# def get_outputs_from_cm(index, cm):
# def causally_significant_nodes(cm):
# def relevant_connections(n, _from, to):
# def block_cm(cm):
#     def outputs_of(nodes):
#     def inputs_to(nodes):
# def block_reducible(cm, nodes1, nodes2):
# def _connected(cm, nodes, connection):
# def is_strong(cm, nodes=None):
# def is_weak(cm, nodes=None):
# def is_full(cm, nodes1, nodes2):


# Path: test/test_connectivity.py
import numpy as np
from pyphi import connectivity

    cm = np.array([
        [0, 0, 1],
        [1, 0, 1],
        [1, 1, 0],
    ])
    # fmt: on
    assert not connectivity.is_full(cm, (0,), (0, 1, 2))
    assert not connectivity.is_full(cm, (2,), (2,))
    assert not connectivity.is_full(cm, (0, 1), (1, 2))
    assert connectivity.is_full(cm, (), (0, 1, 2))
    assert connectivity.is_full(cm, (0,), ())
    assert connectivity.is_full(cm, (0, 1), (0, 2))
    assert connectivity.is_full(cm, (1, 2), (1, 2))
    assert connectivity.is_full(cm, (0, 1, 2), (0, 1, 2))


def test_apply_boundary_conditions():
    # fmt: off
    cm = np.array([
        [0, 0, 1],
        [1, 0, 1],
        [1, 1, 0],
    ])
    answer = np.array([
        [0, 0, 1],
        [0, 0, 0],
        [1, 0, 0],
    ])
    # fmt: on
    assert np.array_equal(

        connectivity.apply_boundary_conditions_to_cm((1,), cm), answer