# Path: ndd/exceptions.py
# class DataArrayError(NddError):
#     """Input is not a valid data array."""
# 
# class NddError(Exception):
#     """Base class for ndd exceptions."""


import logging
import numpy
from itertools import combinations
from numbers import Integral
from operator import itemgetter
from ndd.exceptions import DataArrayError, NddError
    from collections.abc import Sequence
    from collections import Sequence
        cls = type(self)
        return '%s(data=\n%s\nks=%s\n)' % (cls.__name__, self.data, self.ks)

    def __eq__(self, other):
        if not isinstance(other, DataArray):
            return NotImplemented
        return ((self.data == other.data).all()
                and (self.ks == other.ks or (self.ks == other.ks).all())
                and self.k() == other.k())

    @property
    def data(self):
        """Data are stored as a p-by-n ndarray."""
        return self._data

    @property
    def shape(self):
        """Data shape, p-by-n."""
        return self.data.shape

    @property
    def ks(self):
        """Alphabet size for each of the p variables."""
        return self._ks

    @ks.setter
    def ks(self, value):
        p, _ = self.shape
        if is_sequence(value):
            if len(value) != p:

# Path: ndd/exceptions.py
# class DataArrayError(NddError):
#     """Input is not a valid data array."""
# 
# class NddError(Exception):
#     """Base class for ndd exceptions."""


# Path: ndd/data.py
import logging
import numpy
from itertools import combinations
from numbers import Integral
from operator import itemgetter
from ndd.exceptions import DataArrayError, NddError
    from collections.abc import Sequence
    from collections import Sequence

        cls = type(self)
        return '%s(data=\n%s\nks=%s\n)' % (cls.__name__, self.data, self.ks)

    def __eq__(self, other):
        if not isinstance(other, DataArray):
            return NotImplemented
        return ((self.data == other.data).all()
                and (self.ks == other.ks or (self.ks == other.ks).all())
                and self.k() == other.k())

    @property
    def data(self):
        """Data are stored as a p-by-n ndarray."""
        return self._data

    @property
    def shape(self):
        """Data shape, p-by-n."""
        return self.data.shape

    @property
    def ks(self):
        """Alphabet size for each of the p variables."""
        return self._ks

    @ks.setter
    def ks(self, value):
        p, _ = self.shape
        if is_sequence(value):
            if len(value) != p:

                raise DataArrayError('len(ks) (%r) must be equal to p (%r)' %