Given an interval `start:stop`, return bins for intervals *overlapping*
    `start:stop` by at least one position. The order is according to the bin
    level (starting with the smallest bins), and within a level according to
    the bin number (ascending).

    :arg int start, stop: Interval positions (zero-based, open-ended). If
      `stop` is not provided, the interval is assumed to be of length 1
      (equivalent to `stop = start + 1`).

    :return: All bins for intervals overlapping `start:stop`, ordered first
      according to bin level (ascending) and then according to bin number
      (ascending).
    :rtype: list(int)

    :raise OutOfRangeError: If `start:stop` exceeds the range of the binning
      scheme.

def overlapping_bins(start, stop=None):
    """
    Given an interval `start:stop`, return bins for intervals *overlapping*
    `start:stop` by at least one position. The order is according to the bin
    level (starting with the smallest bins), and within a level according to
    the bin number (ascending).

    :arg int start, stop: Interval positions (zero-based, open-ended). If
      `stop` is not provided, the interval is assumed to be of length 1
      (equivalent to `stop = start + 1`).

    :return: All bins for intervals overlapping `start:stop`, ordered first
      according to bin level (ascending) and then according to bin number
      (ascending).
    :rtype: list(int)

    :raise OutOfRangeError: If `start:stop` exceeds the range of the binning
      scheme.
    """
    if stop is None:
        stop = start + 1

    return [bin
            for first, last in range_per_level(start, stop)
            for bin in range(first, last + 1)]