(self, indexes)
return sup_info, cost
Query function.

        Parameters
        ----------
        indexes: list or int
            Index to query, if only one index to query (batch_size = 1),
            an int is expected.

        Returns
        -------
        labels: list
            supervised information of queried index.

        cost: list
            corresponding cost produced by query.
Query function.
Query function .
def query_by_index(self, indexes):
        """Query function.

        Parameters
        ----------
        indexes: list or int
            Index to query, if only one index to query (batch_size = 1),
            an int is expected.

        Returns
        -------
        labels: list
            supervised information of queried index.

        cost: list
            corresponding cost produced by query.
        """
        if not isinstance(indexes, (list, np.ndarray, interface.BaseCollection)):
            indexes = [indexes]
        sup_info = []
        cost = []
        for k in indexes:
            if k in self._ind2all.keys():
                if self._cost_flag:
                    sup_info.append(self._ind2all[k][0])
                    cost.append(self._ind2all[k][1])
                else:
                    sup_info.append(self._ind2all[k])
                    cost.append(1)
            else:
                self._do_missing(k)
        return sup_info, cost
def query_by_index ( self , indexes ) : if not isinstance ( indexes , ( list , np . ndarray , interface . BaseCollection ) ) : indexes = [ indexes ] sup_info = [ ] cost = [ ] for k in indexes : if k in self . _ind2all . keys ( ) : if self . _cost_flag : sup_info . append ( self . _ind2all [ k ] [ 0 ] ) cost . append ( self . _ind2all [ k ] [ 1 ] ) else : sup_info . append ( self . _ind2all [ k ] ) cost . append ( 1 ) else : self . _do_missing ( k ) return sup_info , cost