class_docstr: Serves as storage backend for `GraphComponents` which need persistence.
class_docstr_tok: ["Serves","as","storage","backend","for","`","GraphComponents","`","which","need","persistence","."]
docstr: Persists data for a given resource.
  
  This `Resource` can then be accessed in dependent graph nodes via
  `model_storage.read_from`.
  
  Args:
      resource: The resource which should be persisted.
  
  Returns:
      A directory which can be used to persist data for the given `Resource`.
docstr_tok: ["Persists","data","for","a","given","resource",".","This","`","Resource","`","can","then","be","accessed","in","dependent","graph","nodes","via","`","model_storage.read_from","`",".","Args",":","resource",":","The","resource","which","should","be","persisted",".","Returns",":","A","directory","which","can","be","used","to","persist","data","for","the","given","`","Resource","`","."]
code: def write_to(self, resource: Resource) -> Generator[Path, None, None]:
      """Persists data for a given resource.
  
      This `Resource` can then be accessed in dependent graph nodes via
      `model_storage.read_from`.
  
      Args:
          resource: The resource which should be persisted.
  
      Returns:
          A directory which can be used to persist data for the given `Resource`.
      """
      ...
  
imports: from __future__ import annotations
  import abc
  import logging
  import typing
  from contextlib import contextmanager
  from dataclasses import dataclass
  from datetime import datetime
  from pathlib import Path
  from typing import List, Tuple, Union, Text, Generator, Dict, Any, Optional
  from packaging import version
  from rasa.constants import MINIMUM_COMPATIBLE_VERSION
  from rasa.exceptions import UnsupportedModelVersionError
  from rasa.engine.storage.resource import Resource
  from rasa.shared.core.domain import Domain
  from rasa.shared.data import TrainingType
label_desc: Use image node_id 4 for calling the ModelStorage obj's underlying member method code with example usage: obj.write_to(resource) without return types