def _check_intervals_overlap(intervals1, intervals2):
    """Return the first pair of indexes that overlap."""
    for ii in range(len(intervals1)):
        start1, stop1 = intervals1[ii]
        for jj in range(len(intervals2)):
            start2, stop2 = intervals2[jj]
            if start1 < stop2 and start2 < stop1:
                return ii, jj