class_docstr: Trains a model using a graph schema.
class_docstr_tok: ["Trains","a","model","using","a","graph","schema","."]
docstr: Uses the fingerprint statuses to prune the graph schema.
  
  Walks the graph starting at each target node. If a node has a cache hit we
  replace it with a `PrecomputedValueProvider` and remove its input dependencies.
  At the end, any node that is not an ancestor of a target node will be pruned
  when we call `minimal_graph_schema()`.
  
  Args:
      schema: The graph to prune.
      fingerprint_run_outputs: Node outputs from the fingerprint run as a mapping
          from node name to output.
  
  Returns:
      The pruned schema.
docstr_tok: ["Uses","the","fingerprint","statuses","to","prune","the","graph","schema",".","Walks","the","graph","starting","at","each","target","node",".","If","a","node","has","a","cache","hit","we","replace","it","with","a","`","PrecomputedValueProvider","`","and","remove","its","input","dependencies",".","At","the","end",",","any","node","that","is","not","an","ancestor","of","a","target","node","will","be","pruned","when","we","call","`","minimal_graph_schema","(",")","`",".","Args",":","schema",":","The","graph","to","prune",".","fingerprint_run_outputs",":","Node","outputs","from","the","fingerprint","run","as","a","mapping","from","node","name","to","output",".","Returns",":","The","pruned","schema","."]
code: def _prune_schema(
      self,
      schema: GraphSchema,
      fingerprint_run_outputs: Dict[
          Text, Union[FingerprintStatus, Any]
      ],
  ) -> GraphSchema:
      """Uses the fingerprint statuses to prune the graph schema.
  
      Walks the graph starting at each target node. If a node has a cache hit we
      replace it with a `PrecomputedValueProvider` and remove its input dependencies.
      At the end, any node that is not an ancestor of a target node will be pruned
      when we call `minimal_graph_schema()`.
  
      Args:
          schema: The graph to prune.
          fingerprint_run_outputs: Node outputs from the fingerprint run as a mapping
              from node name to output.
  
      Returns:
          The pruned schema.
      """
      pruned_schema = copy.deepcopy(schema)
      target_node_names = pruned_schema.target_names
  
      for target_node_name in target_node_names:
          self._walk_and_prune(
              pruned_schema, target_node_name, fingerprint_run_outputs
          )
  
      return pruned_schema.minimal_graph_schema()
  
file_path: rasa/rasa/engine/training/graph_trainer.py
imports: import copy
  import logging
  from pathlib import Path
  from typing import Any, Dict, Text, Type, Union
  from rasa.engine.caching import TrainingCache
  from rasa.engine.graph import ExecutionContext, GraphSchema, GraphModelConfiguration
  from rasa.engine.constants import PLACEHOLDER_IMPORTER
  from rasa.engine.runner.interface import GraphRunner
  from rasa.engine.storage.storage import ModelStorage, ModelMetadata
  from rasa.engine.training.components import PrecomputedValueProvider, FingerprintComponent, FingerprintStatus
  from rasa.engine.training.hooks import TrainingHook, LoggingHook
  from rasa.shared.importers.importer import TrainingDataImporter
label_desc: Use image node_id 5 for calling the GraphTrainer obj's underlying member method code with example usage: obj._prune_schema(schema, fingerprint_run_outputs) and returns: pruned_schema