code: def _intersection_slice_tuples(lhs_arr, rhs_arr, offset):
      
      lhs_slc, rhs_slc = [], []
      for istart, n_lhs, n_rhs in zip(offset, lhs_arr.shape, rhs_arr.shape):
  
          # Slice for the inner part in the larger array corresponding to the
          # small one, offset by the given amount
          istop = istart + min(n_lhs, n_rhs)
          inner_slc = slice(istart, istop)
  
          if n_lhs > n_rhs:
              # Extension
              lhs_slc.append(inner_slc)
              rhs_slc.append(slice(None))
          elif n_lhs < n_rhs:
              # Restriction
              lhs_slc.append(slice(None))
              rhs_slc.append(inner_slc)
          else:
              # Same size, so full slices for both
              lhs_slc.append(slice(None))
              rhs_slc.append(slice(None))
  
      return tuple(lhs_slc), tuple(rhs_slc)
docs: Return tuples to yield the intersecting part of both given arrays.
  
      The returned slices ``lhs_slc`` and ``rhs_slc`` are such that
      ``lhs_arr[lhs_slc]`` and ``rhs_arr[rhs_slc]`` have the same shape.
      The ``offset`` parameter determines how much is skipped/added on the
      "left" side (small indices).