(self)
return str(tb)
return summaries of each oracle.

        This function returns the content of this object.
return summaries of each oracle.
return summaries of each oracle .
def __repr__(self):
        """return summaries of each oracle.

        This function returns the content of this object.
        """
        # collect information for displaying
        # key: name
        # value: (query_times, cost_incurred)
        display_dict = dict()
        for key in self._oracle_dict.keys():
            display_dict[key] = [0, 0]
        for query in self.query_history:
            # query is a triplet: (oracle_name, result, index_for_querying)
            # types of elements are: ([str], [[_labels], [cost]], [indexes])
            for i, name in enumerate(query[0]):
                display_dict[name][0] += 1
                display_dict[name][1] += np.sum([np.sum(query[1][i][1][j]) for j in range(len(query[1][i][1]))])

        tb = pt.PrettyTable()
        tb.field_names = ['oracles', 'number_of_labeling', 'cost']
        for key in display_dict.keys():
            tb.add_row([key, display_dict[key][0], display_dict[key][1]])
        return str(tb)
def __repr__ ( self ) : # collect information for displaying # key: name # value: (query_times, cost_incurred) display_dict = dict ( ) for key in self . _oracle_dict . keys ( ) : display_dict [ key ] = [ 0 , 0 ] for query in self . query_history : # query is a triplet: (oracle_name, result, index_for_querying) # types of elements are: ([str], [[_labels], [cost]], [indexes]) for i , name in enumerate ( query [ 0 ] ) : display_dict [ name ] [ 0 ] += 1 display_dict [ name ] [ 1 ] += np . sum ( [ np . sum ( query [ 1 ] [ i ] [ 1 ] [ j ] ) for j in range ( len ( query [ 1 ] [ i ] [ 1 ] ) ) ] ) tb = pt . PrettyTable ( ) tb . field_names = [ 'oracles' , 'number_of_labeling' , 'cost' ] for key in display_dict . keys ( ) : tb . add_row ( [ key , display_dict [ key ] [ 0 ] , display_dict [ key ] [ 1 ] ] ) return str ( tb )