code: def terminate(self, kill_workers=False):
      self.shutdown(kill_workers=kill_workers)
  
      # When workers are killed in a brutal manner, they cannot execute the
      # finalizer of their shared memmaps. The refcount of those memmaps may
      # be off by an unknown number, so instead of decref'ing them, we force
      # delete the whole temporary folder, and unregister them. There is no
      # risk of PermissionError at folder deletion because at this
      # point, all child processes are dead, so all references to temporary
      # memmaps are closed. Otherwise, just try to delete as much as possible
      # with allow_non_empty=True but if we can't, it will be clean up later
      # on by the resource_tracker.
      with self._submit_resize_lock:
          self._temp_folder_manager._clean_temporary_resources(
              force=kill_workers, allow_non_empty=True
          )
  
file_path: catboost/contrib/python/joblib/joblib/executor.py
imports: from ._memmapping_reducer import get_memmapping_reducers
  from ._memmapping_reducer import TemporaryResourcesManager
  from .externals.loky.reusable_executor import _ReusablePoolExecutor
label_desc: Use image node_id 2 for calling the MemmappingExecutor obj's underlying member method code with example usage: obj.terminate(kill_workers) without return types