code: def register_rmtree(directory, cleaner=_mkdtemp_atexit_cleaner):
    
    with _MKDTEMP_LOCK:
      _mkdtemp_register_cleaner(cleaner)
      _MKDTEMP_DIRS[os.getpid()].add(directory)
    return directory
docs: Register an existing directory to be cleaned up at process exit.