class_docstr: A plugin for the client allowing replay of remote tasks locally
  
  Adds the following methods to the given client:
  
  - ``recreate_error_locally``: main user method for replaying failed tasks
  - ``recreate_task_locally``: main user method for replaying any task
class_docstr_tok: ["A","plugin","for","the","client","allowing","replay","of","remote","tasks","locally","Adds","the","following","methods","to","the","given","client",":","-","``","recreate_error_locally","``",":","main","user","method","for","replaying","failed","tasks","-","``","recreate_task_locally","``",":","main","user","method","for","replaying","any","task"]
code: def __init__(self, client):
      self.client = client
      self.client.extensions["replay-tasks"] = self
      # monkey patch
      self.client._get_raw_components_from_future = (
          self._get_raw_components_from_future
      )
      self.client._prepare_raw_components = self._prepare_raw_components
      self.client._get_components_from_future = (
          self._get_components_from_future
      )
      self.client._get_errored_future = self._get_errored_future
      self.client.recreate_task_locally = self.recreate_task_locally
      self.client.recreate_error_locally = self.recreate_error_locally
  
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 ReplayTaskClient object  with example: obj = ReplayTaskClient(client)