# 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:


import numpy as np
from pyphi import utils
cm3 = [[1] * 16] * 16


matrices = [cm0, cm1, cm2, cm3]


class BenchmarkBlockCm():

    params = [0, 1, 2, 3]

    def setup(self, m):
        self.cm = np.array(matrices[m])

    def time_block_cm(self, m):
        utils.block_cm(self.cm)


class BenchmarkReducibility():

    params = [[0, 1, 2, 3], ['block', 'full']]
    param_names = ['cm', 'type']

    def setup(self, m, _type):
        self.cm = np.array(matrices[m])

    def time_reducibility(self, m, _type):
        idxs = (tuple(range(self.cm.shape[0])),
                tuple(range(self.cm.shape[1])))

        if _type == 'block':

# 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: benchmarks/benchmarks/utils.py
import numpy as np
from pyphi import utils

cm3 = [[1] * 16] * 16


matrices = [cm0, cm1, cm2, cm3]


class BenchmarkBlockCm():

    params = [0, 1, 2, 3]

    def setup(self, m):
        self.cm = np.array(matrices[m])

    def time_block_cm(self, m):
        utils.block_cm(self.cm)


class BenchmarkReducibility():

    params = [[0, 1, 2, 3], ['block', 'full']]
    param_names = ['cm', 'type']

    def setup(self, m, _type):
        self.cm = np.array(matrices[m])

    def time_reducibility(self, m, _type):
        idxs = (tuple(range(self.cm.shape[0])),
                tuple(range(self.cm.shape[1])))

        if _type == 'block':

            utils.block_reducible(self.cm, *idxs)