# Path: pyphi/constants.py
# EPSILON = None
# FILESYSTEM = "fs"
# DATABASE = "db"
# PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL
# OFF = (0,)
# ON = (1,)
# 
# Path: pyphi/utils.py
# def state_of(nodes, network_state):
# def all_states(n, big_endian=False):
# def np_immutable(a):
# def np_hash(a):
#     def __init__(self, array):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __repr__(self):
# def eq(x, y):
# def combs(a, r):
# def comb_indices(n, k):
# def powerset(iterable, nonempty=False, reverse=False):
# def load_data(directory, num):
#     def get_path(i):  # pylint: disable=missing-docstring
# def time_annotated(func, *args, **kwargs):
# class np_hashable:


from unittest.mock import patch
from pyphi import constants, utils
import numpy as np
    assert list(utils.all_states(3)) == states
    assert list(utils.all_states(3, big_endian=True)) == [
        tuple(reversed(state)) for state in states
    ]


def test_eq():
    phi = 0.5
    close_enough = phi - constants.EPSILON / 2
    not_quite = phi - constants.EPSILON * 2
    assert utils.eq(phi, close_enough)
    assert not utils.eq(phi, not_quite)
    assert not utils.eq(phi, (phi - phi))


def test_combs_for_1D_input():
    n, k = 3, 2
    data = np.arange(n)
    answer = np.asarray([[0, 1], [0, 2], [1, 2],])
    assert np.array_equal(utils.combs(data, k), answer)


def test_combs_r_is_0():
    n, k = 3, 0
    data = np.arange(n)
    assert np.array_equal(utils.combs(data, k), np.asarray([]))


def test_comb_indices():
    n, k = 3, 2

# Path: pyphi/constants.py
# EPSILON = None
# FILESYSTEM = "fs"
# DATABASE = "db"
# PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL
# OFF = (0,)
# ON = (1,)
# 
# Path: pyphi/utils.py
# def state_of(nodes, network_state):
# def all_states(n, big_endian=False):
# def np_immutable(a):
# def np_hash(a):
#     def __init__(self, array):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __repr__(self):
# def eq(x, y):
# def combs(a, r):
# def comb_indices(n, k):
# def powerset(iterable, nonempty=False, reverse=False):
# def load_data(directory, num):
#     def get_path(i):  # pylint: disable=missing-docstring
# def time_annotated(func, *args, **kwargs):
# class np_hashable:


# Path: test/test_utils.py
from unittest.mock import patch
from pyphi import constants, utils
import numpy as np

    assert list(utils.all_states(3)) == states
    assert list(utils.all_states(3, big_endian=True)) == [
        tuple(reversed(state)) for state in states
    ]


def test_eq():
    phi = 0.5
    close_enough = phi - constants.EPSILON / 2
    not_quite = phi - constants.EPSILON * 2
    assert utils.eq(phi, close_enough)
    assert not utils.eq(phi, not_quite)
    assert not utils.eq(phi, (phi - phi))


def test_combs_for_1D_input():
    n, k = 3, 2
    data = np.arange(n)
    answer = np.asarray([[0, 1], [0, 2], [1, 2],])
    assert np.array_equal(utils.combs(data, k), answer)


def test_combs_r_is_0():
    n, k = 3, 0
    data = np.arange(n)
    assert np.array_equal(utils.combs(data, k), np.asarray([]))


def test_comb_indices():
    n, k = 3, 2

    data = np.arange(6).reshape(2, 3)