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: Initialises the logger.
  
  Args:
    to: A `Logger` object to which the current object will forward its results
      when `write` is called.
    gating_fn: A function that takes an integer (number of calls) as input.
      For example, to log every tenth call: gating_fn=lambda t: t % 10 == 0.
docstr_tok: ["Initialises","the","logger",".","Args",":","to",":","A","`","Logger","`","object","to","which","the","current","object","will","forward","its","results","when","`","write","`","is","called",".","gating_fn",":","A","function","that","takes","an","integer","(","number","of","calls",")","as","input",".","For","example",",","to","log","every","tenth","call",":","gating_fn=lambda","t",":","t","%","10","==","0","."]
code: def __init__(self, to: base.Logger, gating_fn: Callable[[int], bool]):
      """Initialises the logger.
  
      Args:
        to: A `Logger` object to which the current object will forward its results
          when `write` is called.
        gating_fn: A function that takes an integer (number of calls) as input.
          For example, to log every tenth call: gating_fn=lambda t: t % 10 == 0.
      """
      self._to = to
      self._gating_fn = gating_fn
      self._calls = 0
  
imports: import math
  import time
  from typing import Callable, Optional, Sequence
  from acme.utils.loggers import base
label_desc: Use image node_id 1 to create a new GatedFilter object from inherited base classes: base with example: obj = GatedFilter(to, gating_fn)