code: def _calculate_cluster_distance(end_iter):
      
      out = []
      sizes = []
      for x in end_iter:
          out.append(x)
          sizes.append(x.end1 - x.start1)
          sizes.append(x.end2 - x.start2)
      distance = sum(sizes) // len(sizes)
      return distance, out
docs: Compute allowed distance for clustering based on end confidence intervals.