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 __init__(self, scheduler):
      self.scheduler = scheduler
      self.scheduler.handlers["get_runspec"] = self.get_runspec
      self.scheduler.handlers["get_error_cause"] = self.get_error_cause
  
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 1 to create a new ReplayTaskScheduler object  with example: obj = ReplayTaskScheduler(scheduler)