# Path: tde/util/functions.py
# def iterator_length(iterable):
# def unique(iterable):
# def unique_by(iterable, key):
# def intersection(iterable1, iterable2):
# def intersection_by(iterable1, iterable2, key):
# def grouper(n, iterable, padvalue=None):
# def fname2speaker(corpus_type):
# def fscore(p, r):


from pprint import pformat
from itertools import izip, repeat, combinations, ifilterfalse
from tde.util.functions import unique, flatten
import collections
    def __str__(self):
        return str(self.clsdict)

    def __eq__(self, other):
        return self.clsdict == other.clsdict

    def __ne__(self, other):
        return not self.__eq__(other)

    def pretty(self):
        return pformat(self.clsdict)

    def iter_fragments(self, with_class=False):
        """
        Iterate over FragmentTokens.

        Parameters
        ----------
        with_class : bool, optional
            Iterate over (ClassID, FragmentToken) pairs instead

        Returns
        -------
        Iterator over FragmentToken or (ClassID, FragmentToken) pairs

        """
        if with_class:
            return unique(flatten(izip(repeat(c), v)
                                  for c, v in self.clsdict.iteritems()))
        else:

# Path: tde/util/functions.py
# def iterator_length(iterable):
# def unique(iterable):
# def unique_by(iterable, key):
# def intersection(iterable1, iterable2):
# def intersection_by(iterable1, iterable2, key):
# def grouper(n, iterable, padvalue=None):
# def fname2speaker(corpus_type):
# def fscore(p, r):


# Path: tde/data/classes.py
from pprint import pformat
from itertools import izip, repeat, combinations, ifilterfalse
from tde.util.functions import unique, flatten
import collections

    def __str__(self):
        return str(self.clsdict)

    def __eq__(self, other):
        return self.clsdict == other.clsdict

    def __ne__(self, other):
        return not self.__eq__(other)

    def pretty(self):
        return pformat(self.clsdict)

    def iter_fragments(self, with_class=False):
        """
        Iterate over FragmentTokens.

        Parameters
        ----------
        with_class : bool, optional
            Iterate over (ClassID, FragmentToken) pairs instead

        Returns
        -------
        Iterator over FragmentToken or (ClassID, FragmentToken) pairs

        """
        if with_class:
            return unique(flatten(izip(repeat(c), v)
                                  for c, v in self.clsdict.iteritems()))
        else:

            return unique(flatten(self.clsdict.itervalues()))