docstr: Initializes a new ThreadPoolExecutor instance.
  
  Args:
      max_workers: The maximum number of threads that can be used to
          execute the given calls.
      thread_name_prefix: An optional name prefix to give our threads.
docstr_tok: ["Initializes","a","new","ThreadPoolExecutor","instance",".","Args",":","max_workers",":","The","maximum","number","of","threads","that","can","be","used","to","execute","the","given","calls",".","thread_name_prefix",":","An","optional","name","prefix","to","give","our","threads","."]
code: def __init__(self, max_workers=None, thread_name_prefix=""):
      """Initializes a new ThreadPoolExecutor instance.
  
      Args:
          max_workers: The maximum number of threads that can be used to
              execute the given calls.
          thread_name_prefix: An optional name prefix to give our threads.
      """
      if max_workers is None:
          # Use this number because ThreadPoolExecutor is often
          # used to overlap I/O instead of CPU work.
          max_workers = (os.cpu_count() or 1) * 5
      if max_workers <= 0:
          raise ValueError("max_workers must be greater than 0")
  
      self._max_workers = max_workers
      self._work_queue = queue.Queue()
      self._threads = set()
      self._shutdown = False
      self._shutdown_lock = threading.Lock()
      self._thread_name_prefix = thread_name_prefix or (
          "ThreadPoolExecutor-%d" % next(self._counter)
      )
  
file_path: distributed/distributed/_concurrent_futures_thread.py
imports: from __future__ import annotations
  import atexit
  import itertools
  import os
  import queue
  import threading
  import weakref
  from concurrent.futures import _base
label_desc: Use image node_id 1 to create a new ThreadPoolExecutor object from inherited base classes: _base with example: obj = ThreadPoolExecutor(max_workers, thread_name_prefix)