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"]
docstr: For any calculation, whether it succeeded or failed, perform the task
  locally for debugging.
  
  This operation should be performed after a future (result of ``gather``,
  ``compute``, etc) comes back with a status other than "pending". Cases
  where you might want to debug a successfully completed future could
  include a calculation that returns an unexpected results. A common
  debugging process might include running the task locally in debug mode,
  with `pdb.runcall`.
  
  Examples
  --------
  >>> import pdb                                    # doctest: +SKIP
  >>> future = c.submit(div, 1, 1)                  # doctest: +SKIP
  >>> future.status                                 # doctest: +SKIP
  'finished'
  >>> pdb.runcall(c.recreate_task_locally, future)  # doctest: +SKIP
  
  Parameters
  ----------
  future : future
      The same thing as was given to ``gather``.
  
  Returns
  -------
  Any; will return the result of the task future.
docstr_tok: ["For","any","calculation",",","whether","it","succeeded","or","failed",",","perform","the","task","locally","for","debugging",".","This","operation","should","be","performed","after","a","future","(","result","of","``","gather","``",",","``","compute","``",",","etc",")","comes","back","with","a","status","other","than","``","pending","''",".","Cases","where","you","might","want","to","debug","a","successfully","completed","future","could","include","a","calculation","that","returns","an","unexpected","results",".","A","common","debugging","process","might","include","running","the","task","locally","in","debug","mode",",","with","`","pdb.runcall","`",".","Examples","--","--","--","--",">",">",">","import","pdb","#","doctest",":","+SKIP",">",">",">","future","=","c.submit","(","div",",","1",",","1",")","#","doctest",":","+SKIP",">",">",">","future.status","#","doctest",":","+SKIP","'finished'",">",">",">","pdb.runcall","(","c.recreate_task_locally",",","future",")","#","doctest",":","+SKIP","Parameters","--","--","--","--","--","future",":","future","The","same","thing","as","was","given","to","``","gather","``",".","Returns","--","--","--","-","Any",";","will","return","the","result","of","the","task","future","."]
code: def recreate_task_locally(self, future):
      """
      For any calculation, whether it succeeded or failed, perform the task
      locally for debugging.
  
      This operation should be performed after a future (result of ``gather``,
      ``compute``, etc) comes back with a status other than "pending". Cases
      where you might want to debug a successfully completed future could
      include a calculation that returns an unexpected results. A common
      debugging process might include running the task locally in debug mode,
      with `pdb.runcall`.
  
      Examples
      --------
      >>> import pdb                                    # doctest: +SKIP
      >>> future = c.submit(div, 1, 1)                  # doctest: +SKIP
      >>> future.status                                 # doctest: +SKIP
      'finished'
      >>> pdb.runcall(c.recreate_task_locally, future)  # doctest: +SKIP
  
      Parameters
      ----------
      future : future
          The same thing as was given to ``gather``.
  
      Returns
      -------
      Any; will return the result of the task future.
      """
      func, args, kwargs = sync(
          self.client.loop, self._get_components_from_future, future
      )
      return func(*args, **kwargs)
  
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 ReplayTaskClient obj's underlying member method code with example usage: obj.recreate_task_locally(future) and returns: func