code: def sample_distinct(self, n_to_sample, **kwargs):
          
          # Record how many distinct items have not yet been sampled
          n_notsampled = np.sum(np.isnan(self.cached_labels_))
  
          if n_notsampled == 0:
              raise Exception("All distinct items have already been sampled.")
  
          if n_to_sample > n_notsampled:
              warnings.warn("Only {} distinct item(s) have not yet been sampled."
                            " Setting n_to_sample = {}.".format(n_notsampled, \
                            n_notsampled))
              n_to_sample = n_notsampled
  
          n_sampled = 0 # number of distinct items sampled this round
          while n_sampled < n_to_sample:
              self.sample(1,**kwargs)
              n_sampled += self._queried_oracle[self.t_ - 1]*1
docs: Sample a sequence of items from the pool until a minimum number of
          distinct items are queried
  
          Parameters
          ----------
          n_to_sample : int
              number of distinct items to sample. If sampling with replacement,
              this number is not necessarily the same as the number of
              iterations.