code: def _evaluate(self, indices, norm_distances, out=None):
          
          idx_res = []
          for i, yi in zip(indices, norm_distances):
              if self.variant == 'left':
                  idx_res.append(np.where(yi <= .5, i, i + 1))
              else:
                  idx_res.append(np.where(yi < .5, i, i + 1))
          idx_res = tuple(idx_res)
          if out is not None:
              out[:] = self.values[idx_res]
              return out
          else:
              return self.values[idx_res]
docs: Evaluate nearest interpolation.