code: def run_in_simple_project_with_model(
      testdir: Testdir, trained_simple_project: Text
  ) -> Callable[..., RunResult]:
      os.environ["LOG_LEVEL"] = "ERROR"
  
      # makes sure we do not always retrain an initial model for every "new" project
      for file_name in os.listdir(trained_simple_project):
          full_file_name = os.path.join(
              trained_simple_project, file_name
          )
          if os.path.isfile(full_file_name):
              shutil.copy(full_file_name, str(testdir.tmpdir))
          else:
              shutil.copytree(
                  full_file_name, str(testdir.tmpdir / file_name)
              )
  
      def do_run(*args):
          args = [shutil.which(RASA_EXE)] + list(args)
          result = testdir.run(*args)
          os.environ["LOG_LEVEL"] = "INFO"
          return result
  
      return do_run
  
file_path: rasa/tests/cli/conftest.py
imports: from pathlib import Path
  from subprocess import check_call
  from typing import Callable, Text
  import pytest
  import shutil
  import os
  from pytest import TempdirFactory, Testdir
  from _pytest.pytester import RunResult
  from rasa.cli import scaffold
  from rasa.shared.utils.io import write_yaml
label_desc: Use image node_id 9 for calling a global function with example usage: run_in_simple_project_with_model(testdir, trained_simple_project) and returns: do_run, result