code: def test_get_subgraph_for_target_step(create_recipe):
      r = create_recipe
      train_subgraph = r._get_subgraph_for_target_step(
          r._get_step("ingest")
      )
      for step, expected_step_name in zip(
          train_subgraph,
          [
              "ingest",
              "split",
              "transform",
              "train",
              "evaluate",
              "register",
          ],
      ):
          assert step.name == expected_step_name
      for step in [
          "split",
          "transform",
          "train",
          "evaluate",
          "register",
      ]:
          target_step = r._get_step(step)
          assert (
              r._get_subgraph_for_target_step(target_step)
              == train_subgraph
          )
  
      scoring_subgraph = r._get_subgraph_for_target_step(
          r._get_step("ingest_scoring")
      )
      for step, expected_step_name in zip(
          scoring_subgraph, ["ingest_scoring", "predict"]
      ):
          assert step.name == expected_step_name
      for step in ["predict"]:
          target_step = r._get_step(step)
          assert (
              r._get_subgraph_for_target_step(target_step)
              == scoring_subgraph
          )
  
file_path: mlflow/tests/recipes/regression/v1/test_regression_pipeline.py
imports: import os
  import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.recipes.regression.v1.recipe import RegressionRecipe
label_desc: Use image node_id 6 for calling a global function with example usage: test_get_subgraph_for_target_step(create_recipe) without return types