docstr: Factory for ReusableExecutor with automatic memmapping for large
  numpy arrays.
docstr_tok: ["Factory","for","ReusableExecutor","with","automatic","memmapping","for","large","numpy","arrays","."]
code: def get_memmapping_executor(
      cls,
      n_jobs,
      timeout=300,
      initializer=None,
      initargs=(),
      env=None,
      temp_folder=None,
      context_id=None,
      **backend_args,
  ):
      """Factory for ReusableExecutor with automatic memmapping for large
      numpy arrays.
      """
      global _executor_args
      # Check if we can reuse the executor here instead of deferring the test
      # to loky as the reducers are objects that changes at each call.
      executor_args = backend_args.copy()
      executor_args.update(env if env else {})
      executor_args.update(
          dict(
              timeout=timeout,
              initializer=initializer,
              initargs=initargs,
          )
      )
      reuse = _executor_args is None or _executor_args == executor_args
      _executor_args = executor_args
  
      manager = TemporaryResourcesManager(temp_folder)
  
      # reducers access the temporary folder in which to store temporary
      # pickles through a call to manager.resolve_temp_folder_name. resolving
      # the folder name dynamically is useful to use different folders across
      # calls of a same reusable executor
      job_reducers, result_reducers = get_memmapping_reducers(
          unlink_on_gc_collect=True,
          temp_folder_resolver=manager.resolve_temp_folder_name,
          **backend_args,
      )
      _executor, executor_is_reused = super().get_reusable_executor(
          n_jobs,
          job_reducers=job_reducers,
          result_reducers=result_reducers,
          reuse=reuse,
          timeout=timeout,
          initializer=initializer,
          initargs=initargs,
          env=env,
      )
  
      if not executor_is_reused:
          # Only set a _temp_folder_manager for new executors. Reused
          # executors already have a _temporary_folder_manager that must not
          # be re-assigned like that because it is referenced in various
          # places in the reducing machinery of the executor.
          _executor._temp_folder_manager = manager
  
      if context_id is not None:
          # Only register the specified context once we know which manager
          # the current executor is using, in order to not register an atexit
          # finalizer twice for the same folder.
          _executor._temp_folder_manager.register_new_context(
              context_id
          )
  
      return _executor
  
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 1 for calling the MemmappingExecutor obj's underlying member method code with example usage: obj.get_memmapping_executor(cls, n_jobs, timeout, initializer, initargs, env, temp_folder, context_id) and returns: _executor