code: def _get_indices_dual(
      left_region: np.ndarray,
      right_region: np.ndarray,
      left_index: np.ndarray,
      right_index: np.ndarray,
      search_indices: np.ndarray,
      cummin_arr: np.ndarray,
  ):
      """
      Retrieves the matching indices
      for the left and right regions.
      Strictly for non-equi joins (two regions).
      """
      # find earliest point where left_region1 > right_region1
      # that serves as our end boundary, and should reduce search space
      countss = np.empty(right_region.size, dtype=np.intp)
      ends = np.empty(right_region.size, dtype=np.intp)
      total_length = 0
      for num in prange(right_region.size):
          start = search_indices[num]
          value = right_region[num]
          end = -1
          for n in range(start - 1, -1, -1):
              check = cummin_arr[n] > value
              if check:
                  end = n
                  break
          # get actual counts
          counts = 0
          ends[num] = end
          for ind in range(start - 1, end, -1):
              check = left_region[ind] <= value
              counts += check
          countss[num] = counts
          total_length += counts
  
      # build left and right indices
      starts = np.empty(right_region.size, dtype=np.intp)
      starts[0] = 0
      starts[1:] = np.cumsum(countss)[:-1]
      l_index = np.empty(total_length, dtype=np.intp)
      r_index = np.empty(total_length, dtype=np.intp)
  
      for num in prange(right_region.size):
          ind = starts[num]
          pos = search_indices[num]
          end = ends[num]
          size = countss[num]
          value = right_region[num]
          r_ind = right_index[num]
          for n in range(pos - 1, end, -1):
              if not size:
                  break
              check = left_region[n] > value
              if check:
                  continue
              l_index[ind] = left_index[n]
              r_index[ind] = r_ind
              ind += 1
              size -= 1
  
      return l_index, r_index
  
file_path: pyjanitor/janitor/functions/_numba.py
imports: import numpy
  import pandas
  from numba import njit, prange
  from pandas.api.types import is_datetime64_dtype, is_extension_array_dtype
  from janitor.functions.utils import _generic_func_cond_join, _null_checks_cond_join, greater_than_join_types, less_than_join_types
label_desc: Use image node_id 8 for calling a global function with example usage: _get_indices_dual(left_region, right_region, left_index, right_index, search_indices, cummin_arr) and returns: l_index,  r_index