class_docstr: A section in the Logging structure.
class_docstr_tok: ["A","section","in","the","Logging","structure","."]
docstr: Add a record to the log.
docstr_tok: ["Add","a","record","to","the","log","."]
code: 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
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import os
  from magenta.models.coconet import lib_util
  import numpy
label_desc: Use image node_id 2 for calling the _Section obj's underlying member method code with example usage: obj.log(x) without return types