class_docstr: A factory class that creates an instance of a recipe for a particular ML problem
  (e.g. regression, classification) or MLOps task (e.g. batch scoring) based on the current
  working directory and supplied configuration.
  
  .. code-block:: python
      :caption: Example
  
      import os
      from mlflow.recipes import Recipe
  
      os.chdir("~/recipes-regression-template")
      regression_recipe = Recipe(profile="local")
      regression_recipe.run(step="train")
class_docstr_tok: ["A","factory","class","that","creates","an","instance","of","a","recipe","for","a","particular","ML","problem","(","e.g",".","regression",",","classification",")","or","MLOps","task","(","e.g",".","batch","scoring",")","based","on","the","current","working","directory","and","supplied","configuration",".","..","code-block",":",":","python",":","caption",":","Example","import","os","from","mlflow.recipes","import","Recipe","os.chdir","(","``","~\/recipes-regression-template","''",")","regression_recipe","=","Recipe","(","profile=","''","local","''",")","regression_recipe.run","(","step=","''","train","''",")"]
docstr: Creates an instance of an MLflow Recipe for a particular ML problem or MLOps task based
  on the current working directory and supplied configuration. The current working directory
  must be the root directory of an MLflow Recipe repository or a subdirectory of an
  MLflow Recipe repository.
  
  :param profile: The name of the profile to use for configuring the problem-specific or
                  task-specific recipe. Profiles customize the configuration of
                  one or more recipe steps, and recipe executions with different profiles
                  often produce different results.
  :return: A recipe for a particular ML problem or MLOps task. For example, an instance of
           `RegressionRecipe <https://github.com/mlflow/recipes-regression-template>`_
           for regression problems.
  
  .. code-block:: python
      :caption: Example
  
      import os
      from mlflow.recipes import Recipe
  
      os.chdir("~/recipes-regression-template")
      regression_recipe = Recipe(profile="local")
      regression_recipe.run(step="train")
docstr_tok: ["Creates","an","instance","of","an","MLflow","Recipe","for","a","particular","ML","problem","or","MLOps","task","based","on","the","current","working","directory","and","supplied","configuration",".","The","current","working","directory","must","be","the","root","directory","of","an","MLflow","Recipe","repository","or","a","subdirectory","of","an","MLflow","Recipe","repository",".",":","param","profile",":","The","name","of","the","profile","to","use","for","configuring","the","problem-specific","or","task-specific","recipe",".","Profiles","customize","the","configuration","of","one","or","more","recipe","steps",",","and","recipe","executions","with","different","profiles","often","produce","different","results",".",":","return",":","A","recipe","for","a","particular","ML","problem","or","MLOps","task",".","For","example",",","an","instance","of","`","RegressionRecipe","<","https",":","\/\/github.com\/mlflow\/recipes-regression-template",">","`","_","for","regression","problems",".","..","code-block",":",":","python",":","caption",":","Example","import","os","from","mlflow.recipes","import","Recipe","os.chdir","(","``","~\/recipes-regression-template","''",")","regression_recipe","=","Recipe","(","profile=","''","local","''",")","regression_recipe.run","(","step=","''","train","''",")"]
code: def __new__(cls, profile: str):
      """
      Creates an instance of an MLflow Recipe for a particular ML problem or MLOps task based
      on the current working directory and supplied configuration. The current working directory
      must be the root directory of an MLflow Recipe repository or a subdirectory of an
      MLflow Recipe repository.
  
      :param profile: The name of the profile to use for configuring the problem-specific or
                      task-specific recipe. Profiles customize the configuration of
                      one or more recipe steps, and recipe executions with different profiles
                      often produce different results.
      :return: A recipe for a particular ML problem or MLOps task. For example, an instance of
               `RegressionRecipe <https://github.com/mlflow/recipes-regression-template>`_
               for regression problems.
  
      .. code-block:: python
          :caption: Example
  
          import os
          from mlflow.recipes import Recipe
  
          os.chdir("~/recipes-regression-template")
          regression_recipe = Recipe(profile="local")
          regression_recipe.run(step="train")
      """
      if not profile:
          raise MlflowException(
              "A profile name must be provided to construct a valid Recipe object.",
              error_code=INVALID_PARAMETER_VALUE,
          ) from None
  
      recipe_root_path = get_recipe_root_path()
      if " " in recipe_root_path:
          raise MlflowException(
              message=(
                  "Recipe directory path cannot contain spaces. Please move or rename your "
                  f"recipe directory. Current path: {recipe_root_path}"
              ),
              error_code=INVALID_PARAMETER_VALUE,
          ) from None
  
      recipe_config = get_recipe_config(
          recipe_root_path=recipe_root_path, profile=profile
      )
      recipe = recipe_config.get("recipe")
      if recipe is None:
          raise MlflowException(
              "The `recipe` property needs to be defined in the `recipe.yaml` file. "
              "For example: `recipe: regression/v1`",
              error_code=INVALID_PARAMETER_VALUE,
          ) from None
      recipe_path = recipe.replace("/", ".").replace("@", ".")
      class_name = f"mlflow.recipes.{recipe_path}.RecipeImpl"
  
      try:
          recipe_class_module = _get_class_from_string(class_name)
      except Exception as e:
          if isinstance(e, ModuleNotFoundError):
              raise MlflowException(
                  f"Failed to find Recipe {class_name}."
                  f"Please check the correctness of the recipe template setting: {recipe}",
                  error_code=INVALID_PARAMETER_VALUE,
              ) from None
          else:
              raise MlflowException(
                  f"Failed to construct Recipe {class_name}. Error: {e!r}",
                  error_code=INTERNAL_ERROR,
              ) from None
  
      recipe_name = get_recipe_name(recipe_root_path)
      _logger.info(
          f"Creating MLflow Recipe '{recipe_name}' with profile: '{profile}'"
      )
      return recipe_class_module(recipe_root_path, profile)
  
imports: import abc
  import logging
  import os
  from typing import List, Optional
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import BAD_REQUEST, INTERNAL_ERROR, INVALID_PARAMETER_VALUE
  from mlflow.recipes import dag_help_strings
  from mlflow.recipes.artifacts import Artifact
  from mlflow.recipes.step import BaseStep, StepClass, StepStatus
  from mlflow.recipes.utils import get_recipe_config, get_recipe_name, get_recipe_root_path
  from mlflow.recipes.utils.execution import clean_execution_state, get_or_create_base_execution_directory, get_step_output_path, run_recipe_step
  from mlflow.recipes.utils.step import display_html
  from mlflow.utils.class_utils import _get_class_from_string
label_desc: Use image node_id 1 for calling the Recipe obj's underlying member method code with example usage: obj.__new__(cls, profile) and returns: recipe_class_module