code: def _custom_default_config(
      tmp_path: Union[Path, Text],
      epochs: int,
      max_history: Optional[int] = -1,
  ) -> Text:
      # Override default config to use custom amount of epochs
      default_config = Path(
          "rasa", "shared", "importers", "default_config.yml"
      )
      config = rasa.shared.utils.io.read_yaml_file(default_config)
  
      for model_part, items in config.items():
          for item in items:
              if "epochs" in item:
                  item["epochs"] = epochs
              if "max_history" in item and max_history != -1:
                  item["max_history"] = None
  
      config_for_test = Path(tmp_path) / "test_config.yml"
      rasa.shared.utils.io.write_yaml(config, config_for_test)
  
      return str(config_for_test)
  
imports: import abc
  import json
  import subprocess
  import sys
  import time
  from pathlib import Path
  from typing import Text, List, Tuple, Optional, Union
  import memory_profiler
  import psutil
  import pytest
  import rasa
  import rasa.shared.utils.io
  from rasa.utils.common import TempDirectoryPath, get_temp_dir_name
label_desc: Use image node_id 1 for calling a global function with example usage: _custom_default_config(tmp_path, epochs, max_history) and returns: str