code: def _generate(model, config, path):  # noqa: D202
      """Generate a new test function for the given model/config/path."""
  
      def _x(test_case: unittest.TestCase):
          errors = get_configuration_errors(path)
          if errors:
              msg = f"Errors found in {model}: {config}:\n" + "\n".join(
                  f"  {error}" for error in errors
              )
              test_case.fail(msg)
  
      return _x
  
imports: import logging
  import unittest
  from pykeen.experiments.validate import get_configuration_errors, iterate_config_paths
label_desc: Use image node_id 1 for calling a global function with example usage: _generate(model, config, path) and returns: _x