code: def _run_ablation_experiments(
      directories: Sequence[
          Tuple[Union[str, pathlib.Path], Union[str, pathlib.Path]]
      ],
      best_replicates: Optional[int] = None,
      dry_run: bool = False,
      move_to_cpu: bool = True,
      discard_replicates: bool = False,
  ) -> None:
      """Run ablation experiments."""
      if dry_run:
          return
  
      from pykeen.hpo import hpo_pipeline_from_path
  
      for output_directory, rv_config_path in directories:
          if isinstance(output_directory, str):
              output_directory = pathlib.Path(
                  output_directory
              ).resolve()
          hpo_pipeline_result = hpo_pipeline_from_path(rv_config_path)
          hpo_pipeline_result.save_to_directory(output_directory)
  
          if not best_replicates:
              continue
  
          best_pipeline_dir = output_directory.joinpath("best_pipeline")
          best_pipeline_dir.mkdir(exist_ok=True, parents=True)
          logger.info(
              "Re-training best pipeline and saving artifacts in %s",
              best_pipeline_dir,
          )
          hpo_pipeline_result.replicate_best_pipeline(
              replicates=best_replicates,
              move_to_cpu=move_to_cpu,
              save_replicates=not discard_replicates,
              directory=best_pipeline_dir,
          )
  
file_path: pykeen/src/pykeen/ablation/ablation.py
imports: import itertools
  import json
  import logging
  import pathlib
  import time
  from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union
  from uuid import uuid4
  from ..training import SLCWATrainingLoop, training_loop_resolver
  from ..utils import normalize_path, normalize_string
label_desc: Use image node_id 2 for calling a global function with example usage: _run_ablation_experiments(directories, best_replicates, dry_run, move_to_cpu, discard_replicates) without return types