def _similarities_group_by_distance(boreholes, disTol=0.1):
    """
    Groups pairs of boreholes by radial distance between borehole.

    Parameters
    ----------
    boreholes : list of Borehole objects
        List of boreholes in the bore field.
    distol : float, defaults to 0.1
        Absolute tolerance (in meters) on radial distance. Two distances
        (d1, d2) between two pairs of boreholes are considered equal if the
        difference between the two distances (abs(d1-d2)) is below tolerance.

    Returns
    -------
    nDis : int
        Number of unique radial distances between pairs of borehole.
    disPairs : list
        List of radial distances.
    nPairs : list
        List of number of pairs for each radial distance.
    pairs : list
        List of tuples of the borehole indices of borehole pairs at each
        radial distance.

    Raises
    ------
    SomeError

    See Also
    --------
    OtherModules

    Examples
    --------

    """
    nPairs = [1]
    pairs = [[(0, 0)]]
    disPairs = [boreholes[0].r_b]
    nDis = 1
    nb = len(boreholes)
    for i in range(nb):
        b1 = boreholes[i]
        if i == 0:
            i2 = i + 1
        else:
            i2 = i
        for j in range(i2, nb):
            b2 = boreholes[j]
            dis = b1.distance(b2)
            if i == j:
                rTol = 1e-06 * b1.r_b
            else:
                rTol = disTol
            for k in range(nDis):
                if abs(disPairs[k] - dis) < rTol:
                    pairs[k].append((i, j))
                    nPairs[k] += 1
                    break
            else:
                nDis += 1
                disPairs.append(dis)
                pairs.append([(i, j)])
                nPairs.append(1)
    return nDis, disPairs, nPairs, pairs
