code: def is_not_in_training_data(
      policy_name: Optional[Text],
      max_confidence: Optional[float] = None,
  ) -> bool:
      """Checks whether the prediction is empty or by a policy which did not memoize data.
  
      Args:
          policy_name: The name of the policy.
          max_confidence: The max confidence of the policy's prediction.
  
      Returns:
          `False` if and only if an action was predicted (i.e. `max_confidence` > 0) by
          a `MemoizationPolicy`
      """
      from rasa.core.policies.rule_policy import RulePolicy
      from rasa.core.policies.memoization import (
          MemoizationPolicy,
          AugmentedMemoizationPolicy,
      )
  
      if not policy_name:
          return True
  
      memorizing_policies = [
          RulePolicy.__name__,
          MemoizationPolicy.__name__,
          AugmentedMemoizationPolicy.__name__,
      ]
      is_memorized = any(
          policy_name.endswith(f"_{memoizing_policy}")
          for memoizing_policy in memorizing_policies
      )
  
      # also check if confidence is 0, than it cannot be count as prediction
      return not is_memorized or max_confidence == 0.0
  
imports: from __future__ import annotations
  from abc import abstractmethod, ABC
  from typing import Optional, Text, List, Dict, Any
  import logging
  from rasa.engine.graph import GraphComponent
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.engine.runner.interface import ExecutionContext
  from rasa.core.policies.policy import PolicyPrediction
  from rasa.shared.exceptions import RasaException, InvalidConfigException
  from rasa.shared.core.constants import ACTION_LISTEN_NAME
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.events import ActionExecutionRejected, ActionExecuted, DefinePrevUserUtteredFeaturization
  from rasa.shared.core.trackers import DialogueStateTracker
label_desc: Use image node_id 1 for calling a global function with example usage: is_not_in_training_data(policy_name, max_confidence) and returns: unknown, True