class_docstr: Stateful object able to manage temporary folder and pickles
  
  It exposes:
  - a per-context folder name resolving API that memmap-based reducers will
    rely on to know where to pickle the temporary memmaps
  - a temporary file/folder management API that internally uses the
    resource_tracker.
class_docstr_tok: ["Stateful","object","able","to","manage","temporary","folder","and","pickles","It","exposes",":","-","a","per-context","folder","name","resolving","API","that","memmap-based","reducers","will","rely","on","to","know","where","to","pickle","the","temporary","memmaps","-","a","temporary","file\/folder","management","API","that","internally","uses","the","resource_tracker","."]
code: def register_new_context(self, context_id):
      # Prepare a sub-folder name specific to a context (usually a unique id
      # generated by each instance of the Parallel class). Do not create in
      # advance to spare FS write access if no array is to be dumped).
      if context_id in self._cached_temp_folders:
          return
      else:
          # During its lifecycle, one Parallel object can have several
          # executors associated to it (for instance, if a loky worker raises
          # an exception, joblib shutdowns the executor and instantly
          # recreates a new one before raising the error - see
          # ``ensure_ready``.  Because we don't want two executors tied to
          # the same Parallel object (and thus the same context id) to
          # register/use/delete the same folder, we also add an id specific
          # to the current Manager (and thus specific to its associated
          # executor) to the folder name.
          new_folder_name = "joblib_memmapping_folder_{}_{}_{}".format(
              os.getpid(), self._id, context_id
          )
          new_folder_path, _ = _get_temp_dir(
              new_folder_name, self._temp_folder_root
          )
          self.register_folder_finalizer(new_folder_path, context_id)
          self._cached_temp_folders[context_id] = new_folder_path
  
imports: from mmap import mmap
  import errno
  import os
  import stat
  import threading
  import atexit
  import tempfile
  import time
  import warnings
  import weakref
  from uuid import uuid4
  from multiprocessing import util
  from pickle import whichmodule, loads, dumps, HIGHEST_PROTOCOL, PicklingError
  from .numpy_pickle import dump, load, load_temporary_memmap
  from .backports import make_memmap
  from .disk import delete_folder
  from .externals.loky.backend import resource_tracker
label_desc: Use image node_id 3 for calling the TemporaryResourcesManager obj's underlying member method code with example usage: obj.register_new_context(context_id) without return types