def select_by_given_instance(self, selected_instance):
    'Select oracle to query by providing the index of selected instance.\n\n        Parameters\n        ----------\n        selected_instance: int\n            The indexes of selected samples. Should be a member of unlabeled set.\n\n        Returns\n        -------\n        selected_oracles: list\n            The selected oracles for querying.\n        '
    selected_oracles = np.nonzero((self._UI >= (self.epsilon * np.max(self._UI))))
    selected_oracles = selected_oracles[0]
    labeling_results = []
    for i in selected_oracles:
        (lab, _) = self._oracles[self._oracle_ind_name_dict[i]].query_by_index(selected_instance)
        labeling_results.append(lab[0])
        self._oracles_history[i][selected_instance] = copy.copy(lab[0])
    (_, majority_vote_result) = majority_vote(labeling_results)
    reward_arr = np.zeros(len(selected_oracles))
    same_ind = np.nonzero((labeling_results == majority_vote_result))[0]
    reward_arr[same_ind] = 1
    self._majority_vote_results[selected_instance] = majority_vote_result
    for i in selected_oracles:
        self._UI[i] = self._calc_uia(self._oracles_history[i], self._majority_vote_results)
    return [self._oracle_ind_name_dict[i] for i in selected_oracles]
Select oracle to query by providing the index of selected instance.

Parameters
----------
selected_instance: int
    The indexes of selected samples. Should be a member of unlabeled set.

Returns
-------
selected_oracles: list
    The selected oracles for querying.
def select_by_given_instance(self, selected_instance):
    'Select oracle to query by providing the index of selected instance.\n\n        Parameters\n        ----------\n        selected_instance: int\n            The indexes of selected samples. Should be a member of unlabeled set.\n\n        Returns\n        -------\n        selected_oracles: list\n            The selected oracles for querying.\n        '
    selected_oracles = np.nonzero((self._UI >= (self.epsilon * np.max(self._UI))))
    selected_oracles = selected_oracles[0]
    labeling_results = []
    for i in selected_oracles:
        (lab, _) = self._oracles[self._oracle_ind_name_dict[i]].query_by_index(selected_instance)
        labeling_results.append(lab[0])
        self._oracles_history[i][selected_instance] = copy.copy(lab[0])
    (_, majority_vote_result) = majority_vote(labeling_results)
    reward_arr = np.zeros(len(selected_oracles))
    same_ind = np.nonzero((labeling_results == majority_vote_result))[0]
    reward_arr[same_ind] = 1
    self._majority_vote_results[selected_instance] = majority_vote_result
    for i in selected_oracles:
        self._UI[i] = self._calc_uia(self._oracles_history[i], self._majority_vote_results)
    return [self._oracle_ind_name_dict[i] for i in selected_oracles]