def get_query_results(selected_instance, oracles, names=None):
    'Get the query results from oracles of the 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        oracles: {list, alipy.oracle.Oracles}\n            An alipy.oracle.Oracle object that contains all the\n            available oracles or a list of oracles.\n            Each oracle should be a alipy.oracle.Oracle object.\n\n        names: list, optional (default=None)\n            A list of str which contains the names of oracles to query from.\n            If not provided, it will query from all oracles.\n            Each name should in oracles.names().\n\n        Returns\n        -------\n        query_labels: list\n            The queried labels.\n\n        query_costs: list\n            The total cost of query.\n        '
    costs = []
    if isinstance(oracles, list):
        oracle_type = 'list'
        for oracle in oracles:
            assert isinstance(oracle, Oracle)
    elif isinstance(oracles, Oracles):
        oracle_type = 'oracles'
    else:
        raise TypeError('The type of parameter oracles must be a list or alipy.oracle.Oracles object.')
    labeling_results = []
    if (oracle_type == 'list'):
        for i in (oracles.names() if (oracle_type == 'oracles') else range(len(oracles))):
            (lab, co) = oracles[i].query_by_index(selected_instance)
            labeling_results.append(lab[0])
            costs.append(np.sum(co))
    else:
        results = oracles.query_from_s(selected_instance, oracles_name=names)
        labeling_results = [res[0][0] for res in results]
        costs = [np.sum(res[1]) for res in results]
    return (labeling_results, costs)
Get the query results from oracles of the selected instance.

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

oracles: {list, alipy.oracle.Oracles}
    An alipy.oracle.Oracle object that contains all the
    available oracles or a list of oracles.
    Each oracle should be a alipy.oracle.Oracle object.

names: list, optional (default=None)
    A list of str which contains the names of oracles to query from.
    If not provided, it will query from all oracles.
    Each name should in oracles.names().

Returns
-------
query_labels: list
    The queried labels.

query_costs: list
    The total cost of query.
def get_query_results(selected_instance, oracles, names=None):
    'Get the query results from oracles of the 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        oracles: {list, alipy.oracle.Oracles}\n            An alipy.oracle.Oracle object that contains all the\n            available oracles or a list of oracles.\n            Each oracle should be a alipy.oracle.Oracle object.\n\n        names: list, optional (default=None)\n            A list of str which contains the names of oracles to query from.\n            If not provided, it will query from all oracles.\n            Each name should in oracles.names().\n\n        Returns\n        -------\n        query_labels: list\n            The queried labels.\n\n        query_costs: list\n            The total cost of query.\n        '
    costs = []
    if isinstance(oracles, list):
        oracle_type = 'list'
        for oracle in oracles:
            assert isinstance(oracle, Oracle)
    elif isinstance(oracles, Oracles):
        oracle_type = 'oracles'
    else:
        raise TypeError('The type of parameter oracles must be a list or alipy.oracle.Oracles object.')
    labeling_results = []
    if (oracle_type == 'list'):
        for i in (oracles.names() if (oracle_type == 'oracles') else range(len(oracles))):
            (lab, co) = oracles[i].query_by_index(selected_instance)
            labeling_results.append(lab[0])
            costs.append(np.sum(co))
    else:
        results = oracles.query_from_s(selected_instance, oracles_name=names)
        labeling_results = [res[0][0] for res in results]
        costs = [np.sum(res[1]) for res in results]
    return (labeling_results, costs)