class_docstr: Logger which writes to another logger based on a gating function.
  
  This logger tracks the number of times its `write` method is called, and uses
  a gating function on this number to decide when to write.
class_docstr_tok: ["Logger","which","writes","to","another","logger","based","on","a","gating","function",".","This","logger","tracks","the","number","of","times","its","`","write","`","method","is","called",",","and","uses","a","gating","function","on","this","number","to","decide","when","to","write","."]
docstr: Builds a logger for writing at linearly-spaced intervals.
  
  Args:
    to: The underlying logger to write to.
    interval: The interval between writes.
  Returns:
    A GatedFilter logger, which gates periodically as described above.
docstr_tok: ["Builds","a","logger","for","writing","at","linearly-spaced","intervals",".","Args",":","to",":","The","underlying","logger","to","write","to",".","interval",":","The","interval","between","writes",".","Returns",":","A","GatedFilter","logger",",","which","gates","periodically","as","described","above","."]
code: def periodic(
      cls, to: base.Logger, interval: int = 10
  ) -> "GatedFilter":
      """Builds a logger for writing at linearly-spaced intervals.
  
      Args:
        to: The underlying logger to write to.
        interval: The interval between writes.
      Returns:
        A GatedFilter logger, which gates periodically as described above.
      """
      return cls(to, gating_fn=lambda t: t % interval == 0)
  
imports: import math
  import time
  from typing import Callable, Optional, Sequence
  from acme.utils.loggers import base
label_desc: Use image node_id 5 for calling the GatedFilter obj's underlying member method code with example usage: obj.periodic(cls, to, interval) and returns: cls