code: def _resize(self, max_workers):
      with self._submit_resize_lock:
          if max_workers is None:
              raise ValueError("Trying to resize with max_workers=None")
          elif max_workers == self._max_workers:
              return
  
          if self._executor_manager_thread is None:
              # If the executor_manager_thread has not been started
              # then no processes have been spawned and we can just
              # update _max_workers and return
              self._max_workers = max_workers
              return
  
          self._wait_job_completion()
  
          # Some process might have returned due to timeout so check how many
          # children are still alive. Use the _process_management_lock to
          # ensure that no process are spawned or timeout during the resize.
          with self._processes_management_lock:
              processes = list(self._processes.values())
              nb_children_alive = sum(p.is_alive() for p in processes)
              self._max_workers = max_workers
              for _ in range(max_workers, nb_children_alive):
                  self._call_queue.put(None)
          while (
              len(self._processes) > max_workers
              and not self._flags.broken
          ):
              time.sleep(1e-3)
  
          self._adjust_process_count()
          processes = list(self._processes.values())
          while not all(p.is_alive() for p in processes):
              time.sleep(1e-3)
  
file_path: catboost/contrib/python/joblib/joblib/externals/loky/reusable_executor.py
imports: import time
  import warnings
  import threading
  import multiprocessing
  from .process_executor import ProcessPoolExecutor, EXTRA_QUEUED_CALLS
  from .backend.context import cpu_count
  from .backend import get_context
label_desc: Use image node_id 4 for calling the _ReusablePoolExecutor obj's underlying member method code with example usage: obj._resize(max_workers) without return types