parameters: (self, candidate)
docstring: Consider this `candidate` for inclusion in this sampling buffer.
docstring_summary: Consider this `candidate` for inclusion in this sampling buffer.
docstring_tokens: Consider this candidate for inclusion in this sampling buffer .
function: def insert(self, candidate):
      """Consider this `candidate` for inclusion in this sampling buffer."""
      self._num_candidates += 1
      if self.num_elements < self.size:
        self._buffer[self.num_elements] = candidate
        self.num_elements += 1
        return
      idx = np.random.choice(self._num_candidates)
      if idx < self.size:
        self._buffer[idx] = candidate
function_tokens: def insert ( self , candidate ) : self . _num_candidates += 1 if self . num_elements < self . size : self . _buffer [ self . num_elements ] = candidate self . num_elements += 1 return idx = np . random . choice ( self . _num_candidates ) if idx < self . size : self . _buffer [ idx ] = candidate