def _find_matching_indices(tree, bin_X, left_mask, right_mask):
    left_index = np.searchsorted(tree, bin_X & left_mask)
    right_index = np.searchsorted(tree, bin_X | right_mask,
                                  side='right')
    return left_index, right_index
Finds indices in sorted array of integers.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/neighbors/approximate.py/_find_matching_indices