# Path: pyphi/convert.py
# def reverse_bits(i, n):
# def be2le(i, n):
# def nodes2indices(nodes):
# def nodes2state(nodes):
# def state2be_index(state):
# def state2le_index(state):
# def le_index2state(i, number_of_nodes):
# def be_index2state(i, number_of_nodes):
# def be2le_state_by_state(tpm):
# def to_multidimensional(tpm):
# def to_2dimensional(tpm):
# def state_by_state2state_by_node(tpm):
# def _deterministic_sbn2sbs(Sp, Sn, sbn_tpm):
# def _unfold_nodewise_probabilities(Nn, Sn, sbn_row):
# def _nondeterministic_sbn2sbs(Nn, Sn, sbn_tpm):
# def state_by_node2state_by_state(tpm):
#     N = tpm.shape[0]
#     S = np.prod(tpm.shape[:-1])
#     N = tpm.shape[-1]
#     S = tpm.shape[-1]
#     N = int(log2(S))


from math import log2
from pyphi import convert
import numpy as np



    [[[[1, 0, 1, 1],
       [1, 1, 0, 1]],

      [[0, 1, 1, 0],
       [0, 1, 0, 0]]],


     [[[0, 0, 0, 0],
       [0, 1, 1, 0]],

      [[0, 1, 0, 1],
       [0, 1, 1, 1]]]],
], dtype=float)
twod_state_by_node = np.array([
    [1, 0, 0, 1],
    [1, 0, 1, 1],
    [0, 0, 1, 0],
    [0, 0, 0, 0],
    [0, 0, 0, 0],
    [0, 1, 1, 0],
    [0, 0, 1, 1],
    [0, 1, 0, 1],
    [1, 0, 1, 1],
    [1, 1, 0, 1],
    [0, 0, 0, 0],
    [0, 1, 1, 0],
    [0, 1, 1, 0],

# Path: pyphi/convert.py
# def reverse_bits(i, n):
# def be2le(i, n):
# def nodes2indices(nodes):
# def nodes2state(nodes):
# def state2be_index(state):
# def state2le_index(state):
# def le_index2state(i, number_of_nodes):
# def be_index2state(i, number_of_nodes):
# def be2le_state_by_state(tpm):
# def to_multidimensional(tpm):
# def to_2dimensional(tpm):
# def state_by_state2state_by_node(tpm):
# def _deterministic_sbn2sbs(Sp, Sn, sbn_tpm):
# def _unfold_nodewise_probabilities(Nn, Sn, sbn_row):
# def _nondeterministic_sbn2sbs(Nn, Sn, sbn_tpm):
# def state_by_node2state_by_state(tpm):
#     N = tpm.shape[0]
#     S = np.prod(tpm.shape[:-1])
#     N = tpm.shape[-1]
#     S = tpm.shape[-1]
#     N = int(log2(S))


# Path: test/test_convert.py
from math import log2
from pyphi import convert
import numpy as np




    [[[[1, 0, 1, 1],
       [1, 1, 0, 1]],

      [[0, 1, 1, 0],
       [0, 1, 0, 0]]],


     [[[0, 0, 0, 0],
       [0, 1, 1, 0]],

      [[0, 1, 0, 1],
       [0, 1, 1, 1]]]],
], dtype=float)
twod_state_by_node = np.array([
    [1, 0, 0, 1],
    [1, 0, 1, 1],
    [0, 0, 1, 0],
    [0, 0, 0, 0],
    [0, 0, 0, 0],
    [0, 1, 1, 0],
    [0, 0, 1, 1],
    [0, 1, 0, 1],
    [1, 0, 1, 1],
    [1, 1, 0, 1],
    [0, 0, 0, 0],
    [0, 1, 1, 0],
    [0, 1, 1, 0],

    [0, 1, 0, 0],