docstr: Wait for the cache to be empty before resizing the pool.
docstr_tok: ["Wait","for","the","cache","to","be","empty","before","resizing","the","pool","."]
code: def _wait_job_completion(self):
      """Wait for the cache to be empty before resizing the pool."""
      # Issue a warning to the user about the bad effect of this usage.
      if self._pending_work_items:
          warnings.warn(
              "Trying to resize an executor with running jobs: "
              "waiting for jobs completion before resizing.",
              UserWarning,
          )
          mp.util.debug(
              f"Executor {self.executor_id} waiting for jobs completion "
              "before resizing"
          )
      # Wait for the completion of the jobs
      while self._pending_work_items:
          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 5 for calling the _ReusablePoolExecutor obj's underlying member method code with example usage: obj._wait_job_completion() without return types