class_docstr: Logger which filters keys in logged data.
class_docstr_tok: ["Logger","which","filters","keys","in","logged","data","."]
docstr: Creates the filter.
  
  Args:
    to: A `Logger` object to which the current object will forward its writes.
    keep: Keys that are kept by the filter. Note that `keep` and `drop` cannot
      be both set at once.
    drop: Keys that are dropped by the filter. Note that `keep` and `drop`
      cannot be both set at once.
docstr_tok: ["Creates","the","filter",".","Args",":","to",":","A","`","Logger","`","object","to","which","the","current","object","will","forward","its","writes",".","keep",":","Keys","that","are","kept","by","the","filter",".","Note","that","`","keep","`","and","`","drop","`","can","not","be","both","set","at","once",".","drop",":","Keys","that","are","dropped","by","the","filter",".","Note","that","`","keep","`","and","`","drop","`","can","not","be","both","set","at","once","."]
code: def __init__(
      self,
      to: base.Logger,
      *,
      keep: Optional[Sequence[str]] = None,
      drop: Optional[Sequence[str]] = None,
  ):
      """Creates the filter.
  
      Args:
        to: A `Logger` object to which the current object will forward its writes.
        keep: Keys that are kept by the filter. Note that `keep` and `drop` cannot
          be both set at once.
        drop: Keys that are dropped by the filter. Note that `keep` and `drop`
          cannot be both set at once.
      """
      if bool(keep) == bool(drop):
          raise ValueError(
              "Exactly one of `keep` & `drop` arguments must be set."
          )
      self._to = to
      self._keep = keep
      self._drop = drop
  
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 KeyFilter object from inherited base classes: base with example: obj = KeyFilter(to)