(self, examples)
return self.retrieve_by_indexes(q_id)
Retrieve by examples.

        Parameters
        ----------
        examples: array-like or object
            The examples used for retrieving. Should be a subset in the repository.

        Returns
        -------
        y: array-like
            The retrieved labels.
Retrieve by examples.
Retrieve by examples .
def retrieve_by_examples(self, examples):
        """Retrieve by examples.

        Parameters
        ----------
        examples: array-like or object
            The examples used for retrieving. Should be a subset in the repository.

        Returns
        -------
        y: array-like
            The retrieved labels.
        """
        if not self._instance_flag:
            raise Exception("This repository do not have the instance information, "
                            "retrieve_by_examples is not supported")
        if not isinstance(examples, (list, np.ndarray)):
            examples = [examples]
        elif len(np.shape(examples)) == 1:
            examples = [examples]
        q_id = []
        for k in examples:
            k = tuple(k)
            if k in self._exa2ind.keys():
                q_id.append(self._exa2ind[k])
            else:
                warnings.warn("Example for retrieving is not in the repository, skip.",
                              category=ValidityWarning)
        return self.retrieve_by_indexes(q_id)
def retrieve_by_examples ( self , examples ) : if not self . _instance_flag : raise Exception ( "This repository do not have the instance information, " "retrieve_by_examples is not supported" ) if not isinstance ( examples , ( list , np . ndarray ) ) : examples = [ examples ] elif len ( np . shape ( examples ) ) == 1 : examples = [ examples ] q_id = [ ] for k in examples : k = tuple ( k ) if k in self . _exa2ind . keys ( ) : q_id . append ( self . _exa2ind [ k ] ) else : warnings . warn ( "Example for retrieving is not in the repository, skip." , category = ValidityWarning ) return self . retrieve_by_indexes ( q_id )