(self, x)
Add a record to the log.
Add a record to the log.
Add a record to the log .
def log(self, x):
    """Add a record to the log."""
    # append or overwrite such that we retain every `subsample_factor`th value
    # and the most recent value
    item = (self.i, x)
    if (self.subsample_factor == 1 or self.i % self.subsample_factor == 1 or
        not self.items):
      self.items.append(item)
    else:
      self.items[-1] = item
    self.i += 1
def log ( self , x ) : # append or overwrite such that we retain every `subsample_factor`th value # and the most recent value item = ( self . i , x ) if ( self . subsample_factor == 1 or self . i % self . subsample_factor == 1 or not self . items ) : self . items . append ( item ) else : self . items [ - 1 ] = item self . i += 1