def num_lineages_at(self, distance):
        '''Returns the number of lineages of this ``Tree`` that exist ``distance`` away from the root

        Args:
            ``distance`` (``float``): The distance away from the root

        Returns:
            ``int``: The number of lineages that exist ``distance`` away from the root
        '''
        if not isinstance(distance, float) and not isinstance(distance, int):
            raise TypeError("distance must be an int or a float")
        if distance < 0:
            raise RuntimeError("distance cannot be negative")
        d = dict(); q = deque(); q.append(self.root); count = 0
        while len(q) != 0:
            node = q.popleft()
            if node.is_root():
                d[node] = 0
            else:
                d[node] = d[node.parent]
            if node.edge_length is not None:
                d[node] += node.edge_length
            if d[node] < distance:
                q.extend(node.children)
            elif node.parent is None or d[node.parent] < distance:
                count += 1
        return count
def num_lineages_at ( self , distance ) : if not isinstance ( distance , float ) and not isinstance ( distance , int ) : raise TypeError ( "distance must be an int or a float" ) if distance < 0 : raise RuntimeError ( "distance cannot be negative" ) d = dict ( ) ; q = deque ( ) ; q . append ( self . root ) ; count = 0 while len ( q ) != 0 : node = q . popleft ( ) if node . is_root ( ) : d [ node ] = 0 else : d [ node ] = d [ node . parent ] if node . edge_length is not None : d [ node ] += node . edge_length if d [ node ] < distance : q . extend ( node . children ) elif node . parent is None or d [ node . parent ] < distance : count += 1 return count
Returns the number of lineages of this ``Tree`` that exist ``distance`` away from the root

        Args:
            ``distance`` (``float``): The distance away from the root

        Returns:
            ``int``: The number of lineages that exist ``distance`` away from the root