class_docstr: Common parent class for all dialogue policies.
docstr: Trains a policy.
  
  Args:
      training_trackers: The story and rules trackers from the training data.
      domain: The model's domain.
      **kwargs: Depending on the specified `needs` section and the resulting
          graph structure the policy can use different input to train itself.
  
  Returns:
      A policy must return its resource locator so that potential children nodes
      can load the policy from the resource.
docstr_tok: ["Trains","a","policy",".","Args",":","training_trackers",":","The","story","and","rules","trackers","from","the","training","data",".","domain",":","The","model","'s","domain",".","*","*","kwargs",":","Depending","on","the","specified","`","needs","`","section","and","the","resulting","graph","structure","the","policy","can","use","different","input","to","train","itself",".","Returns",":","A","policy","must","return","its","resource","locator","so","that","potential","children","nodes","can","load","the","policy","from","the","resource","."]
code: def train(
      self,
      training_trackers: List[TrackerWithCachedStates],
      domain: Domain,
      **kwargs: Any,
  ) -> Resource:
      """Trains a policy.
  
      Args:
          training_trackers: The story and rules trackers from the training data.
          domain: The model's domain.
          **kwargs: Depending on the specified `needs` section and the resulting
              graph structure the policy can use different input to train itself.
  
      Returns:
          A policy must return its resource locator so that potential children nodes
          can load the policy from the resource.
      """
      raise NotImplementedError(
          "Policy must have the capacity to train."
      )
  
imports: from __future__ import annotations
  import abc
  import copy
  import logging
  from enum import Enum
  from pathlib import Path
  from rasa.shared.core.events import Event
  from typing import Any, List, Optional, Text, Dict, Callable, Tuple, TypeVar, TYPE_CHECKING
  import numpy
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
  from rasa.core.featurizers.tracker_featurizers import TrackerFeaturizer
  from rasa.core.featurizers.tracker_featurizers import MaxHistoryTrackerFeaturizer
  from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
  from rasa.core.featurizers.tracker_featurizers import FEATURIZER_FILE
  import rasa.utils.common
  import rasa.shared.utils.io
  from rasa.shared.exceptions import RasaException, FileIOException
  from rasa.shared.nlu.constants import ENTITIES, INTENT, TEXT, ACTION_TEXT, ACTION_NAME
  from rasa.shared.core.domain import Domain, State
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.shared.core.generator import TrackerWithCachedStates
  from rasa.core.constants import DEFAULT_POLICY_PRIORITY, POLICY_PRIORITY, POLICY_MAX_HISTORY
  from rasa.shared.core.constants import USER, SLOTS, PREVIOUS_ACTION, ACTIVE_LOOP
  import rasa.shared.utils.common
label_desc: Use image node_id 11 for calling the Policy obj's underlying member method code with example usage: obj.train(training_trackers, domain) without return types