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)

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 .