# Path: pydigree/common.py
# def count(val, iterable):
# def table(seq):
# def mode(seq):
# def random_choice(iterable):
# def flatten(x):
# def grouper(iterable, n, fillvalue=None):
# def invert_dict(d):
# def merge_dicts(*args):
# def log_base_change(value, old, new):
# def product(iter):
# def cumsum(iter):
# 
# Path: pydigree/genotypes/genoabc.py
# class AlleleContainer(object):
#     " A base class for the interface allele containers object must implement"
# 
#     def empty_like(self):
#         raise NotImplementedError
# 
#     def copy_span(self, template, start, stop):
#         raise NotImplementedError
# 
#     def dtype(self):
#         raise NotImplementedError
# 
#     def __eq__(self, other):
#         raise NotImplementedError
# 
#     def __lt__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __gt__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __le__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __ge__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __delitem__(self, key):
#         raise NotMeaningfulError('Allele arrays are fixed size')


from pydigree.common import all_same_type
from .genoabc import AlleleContainer
        return 'InheritanceSpan{}'.format(self.to_tuple())

    def __eq__(self, other):
        return (self.ancestor == other.ancestor and
                self.chromosomeidx == other.chromosomeidx and
                self.haplotype == other.haplotype and
                self.start == other.start and
                self.stop == other.stop)

    @property
    def ancestral_allele(self):
        return AncestralAllele(self.ancestor, self.haplotype)

    def contains(self, index):
        'Returns true if the index specified falls within this span'
        return self.start <= index <= self.stop

    @property
    def interval(self):
        return self.start, self.stop

    def to_tuple(self):
        return (self.ancestor, self.chromosomeidx, self.haplotype,
                self.start, self.stop)

    @property
    def ancestral_chromosome(self):
        return self.ancestor.genotypes[self.chromosomeidx][self.haplotype]



# Path: pydigree/common.py
# def count(val, iterable):
# def table(seq):
# def mode(seq):
# def random_choice(iterable):
# def flatten(x):
# def grouper(iterable, n, fillvalue=None):
# def invert_dict(d):
# def merge_dicts(*args):
# def log_base_change(value, old, new):
# def product(iter):
# def cumsum(iter):
# 
# Path: pydigree/genotypes/genoabc.py
# class AlleleContainer(object):
#     " A base class for the interface allele containers object must implement"
# 
#     def empty_like(self):
#         raise NotImplementedError
# 
#     def copy_span(self, template, start, stop):
#         raise NotImplementedError
# 
#     def dtype(self):
#         raise NotImplementedError
# 
#     def __eq__(self, other):
#         raise NotImplementedError
# 
#     def __lt__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __gt__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __le__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __ge__(self, other):
#         raise NotMeaningfulError(
#             'Value comparisions not meaningful for genotypes')
# 
#     def __delitem__(self, key):
#         raise NotMeaningfulError('Allele arrays are fixed size')


# Path: pydigree/genotypes/labelledalleles.py
from pydigree.common import all_same_type
from .genoabc import AlleleContainer

        return 'InheritanceSpan{}'.format(self.to_tuple())

    def __eq__(self, other):
        return (self.ancestor == other.ancestor and
                self.chromosomeidx == other.chromosomeidx and
                self.haplotype == other.haplotype and
                self.start == other.start and
                self.stop == other.stop)

    @property
    def ancestral_allele(self):
        return AncestralAllele(self.ancestor, self.haplotype)

    def contains(self, index):
        'Returns true if the index specified falls within this span'
        return self.start <= index <= self.stop

    @property
    def interval(self):
        return self.start, self.stop

    def to_tuple(self):
        return (self.ancestor, self.chromosomeidx, self.haplotype,
                self.start, self.stop)

    @property
    def ancestral_chromosome(self):
        return self.ancestor.genotypes[self.chromosomeidx][self.haplotype]



class AncestralAllele(object):