code: def worker_story(
      keys_or_stimuli: Collection[Key | str], log: Iterable[tuple]
  ) -> list:
      """Creates a story from the worker log given a set of keys
      describing tasks or stimuli.
  
      Parameters
      ----------
      keys_or_stimuli : set[str]
          Task keys or stimulus_id's
      log : iterable
          The worker log
  
      Returns
      -------
      story : list[str]
      """
      return [
          msg
          for msg in log
          if any(key in msg for key in keys_or_stimuli)
          or any(
              key in c
              for key in keys_or_stimuli
              for c in msg
              if isinstance(c, (tuple, list, set))
          )
      ]
  
imports: from __future__ import annotations
  from collections.abc import Collection, Iterable
  from typing import TYPE_CHECKING
  from dask.typing import Key
label_desc: Use image node_id 2 for calling a global function with example usage: worker_story(keys_or_stimuli, log) and returns: unknown