class_docstr: Caches training results on local disk (see parent class for full docstring).
class_docstr_tok: ["Caches","training","results","on","local","disk","(","see","parent","class","for","full","docstring",")","."]
code: def _cache_output_to_disk(
      self, output: Cacheable, model_storage: ModelStorage
  ) -> Tuple[Optional[Text], Optional[Text]]:
      tempdir_name = rasa.utils.common.get_temp_dir_name()
  
      # Use `TempDirectoryPath` instead of `tempfile.TemporaryDirectory` as this
      # leads to errors on Windows when the context manager tries to delete an
      # already deleted temporary directory (e.g. https://bugs.python.org/issue29982)
      with rasa.utils.common.TempDirectoryPath(
          tempdir_name
      ) as temp_dir:
          tmp_path = Path(temp_dir)
          try:
              output.to_cache(tmp_path, model_storage)
  
              logger.debug(
                  f"Caching output of type '{type(output).__name__}' succeeded."
              )
          except Exception as e:
              logger.error(
                  f"Caching output of type '{type(output).__name__}' failed with the "
                  f"following error:\n{e}"
              )
              return None, None
  
          output_size = rasa.utils.common.directory_size_in_mb(tmp_path)
          if output_size > self._max_cache_size:
              logger.debug(
                  f"Caching result of type '{type(output).__name__}' was skipped "
                  f"because it exceeds the maximum cache size of "
                  f"{self._max_cache_size} MiB."
              )
              return None, None
  
          while (
              rasa.utils.common.directory_size_in_mb(
                  self._cache_location,
                  filenames_to_exclude=[self._cache_database_name],
              )
              + output_size
              > self._max_cache_size
          ):
              self._drop_least_recently_used_item()
  
          output_type = (
              rasa.shared.utils.common.module_path_from_instance(output)
          )
          cache_path = shutil.move(temp_dir, self._cache_location)
  
          return cache_path, output_type
  
imports: from __future__ import annotations
  import abc
  import logging
  import os
  import shutil
  from datetime import datetime
  from pathlib import Path
  from typing import Text, Any, Optional, Tuple, List
  from packaging import version
  from sqlalchemy.engine import URL
  from sqlalchemy.exc import OperationalError
  from typing_extensions import Protocol, runtime_checkable
  import rasa
  import rasa.model
  import rasa.utils.common
  import rasa.shared.utils.common
  from rasa.constants import MINIMUM_COMPATIBLE_VERSION
  import sqlalchemy
  import sqlalchemy.orm
  from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
  from rasa.engine.storage.storage import ModelStorage
label_desc: Use image node_id 11 for calling the LocalTrainingCache obj's underlying member method code with example usage: obj._cache_output_to_disk(output, model_storage) and returns: cache_path,  output_type, None,  None, None,  None