code: def locate_intersection_ranges(self, starts, stops):
          
  
          # check inputs
          starts = asarray_ndim(starts, 1)
          stops = asarray_ndim(stops, 1)
          check_dim0_aligned(starts, stops)
  
          # find indices of start and stop values in idx
          start_indices = np.searchsorted(self, starts)
          stop_indices = np.searchsorted(self, stops, side='right')
  
          # find intervals overlapping at least one value
          loc_ranges = start_indices < stop_indices
  
          # find values within at least one interval
          loc = np.zeros(self.shape, dtype=np.bool)
          for i, j in zip(start_indices[loc_ranges], stop_indices[loc_ranges]):
              loc[i:j] = True
  
          return loc, loc_ranges
docs: Locate the intersection with a set of ranges.
  
          Parameters
          ----------
          starts : array_like, int
              Range start values.
          stops : array_like, int
              Range stop values.
  
          Returns
          -------
          loc : ndarray, bool
              Boolean array with location of entries found.
          loc_ranges : ndarray, bool
              Boolean array with location of ranges containing one or more
              entries.
  
          Examples
          --------
  
          >>> import allel
          >>> import numpy as np
          >>> idx = allel.SortedIndex([3, 6, 11, 20, 35])
          >>> ranges = np.array([[0, 2], [6, 17], [12, 15], [31, 35],
          ...                    [100, 120]])
          >>> starts = ranges[:, 0]
          >>> stops = ranges[:, 1]
          >>> loc, loc_ranges = idx.locate_intersection_ranges(starts, stops)
          >>> loc
          array([False,  True,  True, False,  True])
          >>> loc_ranges
          array([False,  True, False,  True, False])
          >>> idx[loc]
          <SortedIndex shape=(3,) dtype=int64>
          [6, 11, 35]
          >>> ranges[loc_ranges]
          array([[ 6, 17],
                 [31, 35]])