def _get_nearest_indexer(self, target, limit, tolerance):
        left_indexer = self.get_indexer(target, 'pad', limit=limit)
        right_indexer = self.get_indexer(target, 'backfill', limit=limit)

        target = np.asarray(target)
        left_distances = abs(self.values[left_indexer] - target)
        right_distances = abs(self.values[right_indexer] - target)

        op = operator.lt if self.is_monotonic_increasing else operator.le
        indexer = np.where(op(left_distances, right_distances) |
                           (right_indexer == -1), left_indexer, right_indexer)
        if tolerance is not None:
            indexer = self._filter_indexer_tolerance(target, indexer,
                                                     tolerance)
        return indexer
Check if a symlinked directory exists and is non-empty.
dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py/Index._get_nearest_indexer--crossover with--dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/custom/shared.py/_symlinked_dir_exists