docstr: Override ParallelBackendBase.retrieval_context to avoid deadlocks.
  
  This removes thread from the worker's thread pool (using 'secede').
  Seceding avoids deadlock in nested parallelism settings.
docstr_tok: ["Override","ParallelBackendBase.retrieval_context","to","avoid","deadlocks",".","This","removes","thread","from","the","worker","'s","thread","pool","(","using","'secede","'",")",".","Seceding","avoids","deadlock","in","nested","parallelism","settings","."]
code: def retrieval_context(self):
      """Override ParallelBackendBase.retrieval_context to avoid deadlocks.
  
      This removes thread from the worker's thread pool (using 'secede').
      Seceding avoids deadlock in nested parallelism settings.
      """
      # See 'joblib.Parallel.__call__' and 'joblib.Parallel.retrieve' for how
      # this is used.
      if hasattr(thread_state, "execution_state"):
          # we are in a worker. Secede to avoid deadlock.
          secede()
  
      yield
  
      if hasattr(thread_state, "execution_state"):
          rejoin()
  
imports: from __future__ import print_function, division, absolute_import
  import asyncio
  import concurrent.futures
  import contextlib
  import time
  from uuid import uuid4
  import weakref
  from .parallel import parallel_config
  from .parallel import AutoBatchingMixin, ParallelBackendBase
label_desc: Use image node_id 10 for calling the DaskDistributedBackend obj's underlying member method code with example usage: obj.retrieval_context() without return types