code: def test_recipes_execution_directory_is_managed_as_expected(
      custom_execution_directory,
      enter_recipe_example_directory,
      tmp_path,
  ):
      if custom_execution_directory is not None:
          custom_execution_directory = (
              tmp_path / custom_execution_directory
          )
  
      if custom_execution_directory is not None:
          os.environ["MLFLOW_RECIPES_EXECUTION_DIRECTORY"] = str(
              custom_execution_directory
          )
  
      expected_execution_directory_location = (
          pathlib.Path(custom_execution_directory)
          if custom_execution_directory
          else pathlib.Path.home()
          / ".mlflow"
          / "recipes"
          / _get_execution_directory_basename(
              enter_recipe_example_directory
          )
      )
  
      # Run the full recipe and verify that outputs for each step were written to the expected
      # execution directory locations
      r = Recipe(profile="local")
      r.run()
      assert (
          expected_execution_directory_location / "Makefile"
      ).exists()
      assert (expected_execution_directory_location / "steps").exists()
      for step_name in _STEP_NAMES:
          step_outputs_path = (
              expected_execution_directory_location
              / "steps"
              / step_name
              / "outputs"
          )
          assert step_outputs_path.exists()
          first_output = next(step_outputs_path.iterdir(), None)
          assert first_output is not None
  
      # Clean the recipe and verify that all step outputs have been removed
      r.clean()
      for step_name in _STEP_NAMES:
          step_outputs_path = (
              expected_execution_directory_location
              / "steps"
              / step_name
              / "outputs"
          )
          assert not list(step_outputs_path.iterdir())
  
imports: import os
  import pathlib
  import re
  import shutil
  from unittest import mock
  import pandas
  import pytest
  import yaml
  import mlflow
  from mlflow.entities import Run, SourceType
  from mlflow.entities.model_registry import ModelVersion
  from mlflow.exceptions import MlflowException
  from mlflow.recipes.recipe import Recipe
  from mlflow.recipes.step import BaseStep
  from mlflow.recipes.utils.execution import _MAKEFILE_FORMAT_STRING, _get_execution_directory_basename, get_step_output_path
  from mlflow.tracking.client import MlflowClient
  from mlflow.tracking.context.registry import resolve_tags
  from mlflow.utils.file_utils import path_to_local_file_uri
  from mlflow.utils.mlflow_tags import LEGACY_MLFLOW_GIT_REPO_URL, MLFLOW_GIT_COMMIT, MLFLOW_GIT_REPO_URL, MLFLOW_SOURCE_NAME, MLFLOW_SOURCE_TYPE
  from tests.recipes.helper_functions import chdir, list_all_artifacts
label_desc: Use image node_id 5 for calling a global function with example usage: test_recipes_execution_directory_is_managed_as_expected(custom_execution_directory, enter_recipe_example_directory, tmp_path) without return types