# 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/alleles.py
# class Alleles(np.ndarray, AlleleContainer):
# 
#     ''' A class for holding genotypes '''
#     def __new__(cls, data, template=None, **kwargs):
#         obj = np.asarray(data, **kwargs).view(cls)
#         obj.template = template
#         return obj
# 
#     def __array__finalize__(self, obj):
#         if obj is None:
#             return
#         self.template = getattr(obj, 'template', None)
# 
#     @property
#     def missingcode(self):
#         return 0 if np.issubdtype(self.dtype, np.integer) else ''
# 
#     @property
#     def missing(self):
#         """
#         Returns a numpy array indicating which markers have missing data
#         
#         :returns: missingness array
#         :rtype: np.array
#         """
#         return np.array(self == self.missingcode)
# 
#     def nmark(self):
#         '''
#         Return the number of markers represented by the Alleles object
# 
#         :returns: number of markers
#         :rtype: int
#         '''
#         return self.shape[0]
# 
#     def copy_span(self, template, copy_start, copy_stop):
#         """
#         Copies a span of another AlleleContainer to this one
# 
#         :param template: Container to copy from
#         :type template: AlleleContainer
#         :param copy_start: start point for copy (inclusive)
#         :type copy_start: int
#         :param copy_stop: end_point for copy (exclusive)
#         :type copy_stop: int
# 
#         :rtype: void
#         """
#         self[copy_start:copy_stop] = template[copy_start:copy_stop]
# 
#     def empty_like(self):
#         ''' Returns an empty Alleles object like this one '''
#         z = np.zeros(self.nmark(), dtype=self.dtype)
# 
#         return Alleles(z, template=self.template)


from pydigree.common import spans
from pydigree.genotypes import Alleles
    import line_profiler
    import sys
try:
except ImportError:
    print("No line profiler, skipping test.")
    sys.exit(0)

test_data = Alleles([0] * 10000)
func = spans

for start in range(1, 10000, 200):
	test_data[start:(start+100)] = 1


# 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/alleles.py
# class Alleles(np.ndarray, AlleleContainer):
# 
#     ''' A class for holding genotypes '''
#     def __new__(cls, data, template=None, **kwargs):
#         obj = np.asarray(data, **kwargs).view(cls)
#         obj.template = template
#         return obj
# 
#     def __array__finalize__(self, obj):
#         if obj is None:
#             return
#         self.template = getattr(obj, 'template', None)
# 
#     @property
#     def missingcode(self):
#         return 0 if np.issubdtype(self.dtype, np.integer) else ''
# 
#     @property
#     def missing(self):
#         """
#         Returns a numpy array indicating which markers have missing data
#         
#         :returns: missingness array
#         :rtype: np.array
#         """
#         return np.array(self == self.missingcode)
# 
#     def nmark(self):
#         '''
#         Return the number of markers represented by the Alleles object
# 
#         :returns: number of markers
#         :rtype: int
#         '''
#         return self.shape[0]
# 
#     def copy_span(self, template, copy_start, copy_stop):
#         """
#         Copies a span of another AlleleContainer to this one
# 
#         :param template: Container to copy from
#         :type template: AlleleContainer
#         :param copy_start: start point for copy (inclusive)
#         :type copy_start: int
#         :param copy_stop: end_point for copy (exclusive)
#         :type copy_stop: int
# 
#         :rtype: void
#         """
#         self[copy_start:copy_stop] = template[copy_start:copy_stop]
# 
#     def empty_like(self):
#         ''' Returns an empty Alleles object like this one '''
#         z = np.zeros(self.nmark(), dtype=self.dtype)
# 
#         return Alleles(z, template=self.template)


# Path: support/cyprofile.py
from pydigree.common import spans
from pydigree.genotypes import Alleles
    import line_profiler
    import sys

try:
except ImportError:
    print("No line profiler, skipping test.")
    sys.exit(0)

test_data = Alleles([0] * 10000)
func = spans

for start in range(1, 10000, 200):
	test_data[start:(start+100)] = 1


profile = line_profiler.LineProfiler(func)