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_runspec(self, *args, key=None, **kwargs):
      key = self._process_key(key)
      ts = self.scheduler.tasks.get(key)
      return {
          "task": ToPickle(ts.run_spec),
          "deps": [dts.key for dts in ts.dependencies],
      }
  
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 4 for calling the ReplayTaskScheduler obj's underlying member method code with example usage: obj.get_runspec() and returns: dict