class_docstr: Maintain a copy of worker events
class_docstr_tok: ["Maintain","a","copy","of","worker","events"]
code: def transition(self, key, start, finish, *args, **kwargs):
      if start == "processing":
          kwargs["key"] = key
          if finish == "memory" or finish == "erred":
              self.buffer.append(kwargs)
  
file_path: distributed/distributed/diagnostics/eventstream.py
imports: from __future__ import annotations
  import logging
  from distributed.core import coerce_to_address, connect
  from distributed.diagnostics.plugin import SchedulerPlugin
  from distributed.worker import dumps_function
label_desc: Use image node_id 2 for calling the EventStream obj's underlying member method code with example usage: obj.transition(key, start, finish) without return types