class_docstr: A plugin for the scheduler to recreate tasks locally
  
  This adds the following routes to the scheduler
  
  *  get_runspec
  *  get_error_cause
class_docstr_tok: ["A","plugin","for","the","scheduler","to","recreate","tasks","locally","This","adds","the","following","routes","to","the","scheduler","*","get_runspec","*","get_error_cause"]
code: def get_error_cause(self, *args, keys=(), **kwargs):
      for key in keys:
          key = self._process_key(key)
          ts = self.scheduler.tasks.get(key)
          if ts is not None and ts.exception_blame is not None:
              return ts.exception_blame.key
  
file_path: distributed/distributed/recreate_tasks.py
imports: from __future__ import annotations
  import logging
  from dask.core import validate_key
  from distributed.client import Future, futures_of, wait
  from distributed.protocol.serialize import ToPickle
  from distributed.utils import sync
  from distributed.utils_comm import pack_data
label_desc: Use image node_id 3 for calling the ReplayTaskScheduler obj's underlying member method code with example usage: obj.get_error_cause() and returns: ts