code: def test_create_validator_from_callable():
      def is_valid(user_input) -> None:
          return user_input == "this passes"
  
      error_message = "try again"
  
      validator = io_utils.create_validator(is_valid, error_message)
  
      document = Document("this passes")
      assert validator.validate(document) is None
  
      document = Document("this doesn't")
      with pytest.raises(ValidationError) as e:
          validator.validate(document)
  
      assert e.value.message == error_message
  
file_path: rasa/tests/utils/test_io.py
imports: from pathlib import Path
  from typing import Dict, Text
  import pytest
  from _pytest.tmpdir import TempPathFactory
  from prompt_toolkit.document import Document
  from prompt_toolkit.validation import ValidationError
  import rasa.shared.utils.io
  import rasa.utils.io
label_desc: Use image node_id 5 for calling a global function with example usage: test_create_validator_from_callable() and returns: unknown