class_docstr: Wrapper for a non-async context manager that allows entering and exiting it in EventLoop-friendly manner
class_docstr_tok: ["Wrapper","for","a","non-async","context","manager","that","allows","entering","and","exiting","it","in","EventLoop-friendly","manner"]
code: def get_process_wide_executor(cls):
      if os.getpid() != cls.EXECUTOR_PID:
          with cls.EXECUTOR_LOCK:
              if os.getpid() != cls.EXECUTOR_PID:
                  cls.CONTEXT_EXECUTOR = ThreadPoolExecutor(
                      max_workers=float("inf")
                  )
                  cls.EXECUTOR_PID = os.getpid()
      return cls.CONTEXT_EXECUTOR
  
file_path: hivemind/hivemind/utils/asyncio.py
imports: import asyncio
  import concurrent.futures
  import multiprocessing
  import os
  from concurrent.futures import ThreadPoolExecutor
  from contextlib import AbstractAsyncContextManager, AbstractContextManager, asynccontextmanager
  from typing import AsyncIterable, AsyncIterator, Awaitable, Callable, Iterable, Optional, Tuple, TypeVar, Union
  import uvloop
  from hivemind.utils.logging import get_logger
label_desc: Use image node_id 2 for calling the _AsyncContextWrapper obj's underlying member method code with example usage: obj.get_process_wide_executor(cls) and returns: cls