code: def test_fingerprint_changes_when_external_file_changes():
      tmp_file = tempfile.mktemp()
  
      class MinimalComponent(GraphComponent):
          @classmethod
          def create(
              cls,
              config: Dict[Text, Any],
              model_storage: ModelStorage,
              resource: Resource,
              execution_context: ExecutionContext,
          ) -> "MinimalComponent":
              return MinimalComponent()
  
          @classmethod
          def fingerprint_addon(
              cls, config: Dict[str, Any]
          ) -> Optional[str]:
              if not os.path.exists(tmp_file):
                  return None
              else:
                  return rasa.shared.utils.io.get_text_hash(
                      open(tmp_file, "r").read()
                  )
  
      with open(tmp_file, "w") as external_data:
          external_data.write("This is a test.")
  
      fingerprint_1 = fingerprinting.calculate_fingerprint_key(
          MinimalComponent, {}, {}
      )
  
      fingerprint_2 = fingerprinting.calculate_fingerprint_key(
          MinimalComponent, {}, {}
      )
  
      assert fingerprint_1 == fingerprint_2
  
      # overwrite the original external data
      with open(tmp_file, "w") as external_data:
          external_data.write(
              "This is a test for changes in external data."
          )
  
      fingerprint_3 = fingerprinting.calculate_fingerprint_key(
          MinimalComponent, {}, {}
      )
  
      assert fingerprint_3 != fingerprint_1
  
      os.remove(tmp_file)
  
imports: import inspect
  import os.path
  import tempfile
  from typing import Dict, Text, Any, Optional
  from unittest.mock import Mock
  from _pytest.monkeypatch import MonkeyPatch
  import rasa.shared.utils.io
  from rasa.core.policies.ted_policy import TEDPolicy
  from rasa.engine.graph import ExecutionContext, GraphComponent
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.training import fingerprinting
  from rasa.nlu.classifiers.diet_classifier import DIETClassifier
  from rasa.nlu.selectors.response_selector import ResponseSelector
  from tests.engine.training.test_components import FingerprintableText
label_desc: Use image node_id 6 for calling a global function with example usage: test_fingerprint_changes_when_external_file_changes() and returns: MinimalComponent, None, rasa