code: def prepare_mutants(mutation_dir: str, dataset: str):
      pwd = os.getcwd()
      task_ids = get_task_ids(dataset)
      problems = get_problems(dataset)
      os.makedirs(mutation_dir, exist_ok=True)
      for task_id in track(task_ids, "Generating mutants"):
          task_dir = os.path.join(mutation_dir, to_path(task_id))
          os.makedirs(task_dir, exist_ok=True)
          if any(
              map(
                  lambda filename: filename.startswith("m"),
                  os.listdir(task_dir),
              )
          ):
              # already have mutants
              continue
          # Make groundtruth
          groundtruth_code = (
              problems[task_id]["prompt"]
              + problems[task_id]["canonical_solution"]
          )
          with open(os.path.join(task_dir, "gt.py"), "w") as f:
              f.write(groundtruth_code)
          # Make dummy pytest
          with open(os.path.join(task_dir, "test_dummy.py"), "w") as f:
              f.write("def test_dummy():\n    pass")
          # Use mutmut to generate mutants
          os.chdir(task_dir)
          clean(".mutmut-cache")
          execute_cmd(
              ["mutmut run", "--paths-to-mutate=gt.py", "1>/dev/null"]
          )
          try:
              # Collect metainfo
              total_mutants = int(
                  get_cmd_output(["mutmut", "results"])
                  .split("\n")[-2]
                  .split("-")[-1]
              )
          except:
              total_mutants = 0
          # Dump mutants
          for i in range(1, total_mutants + 1):
              execute_cmd(["cp", "gt.py", "gt_copy.py"])
              execute_cmd(["mutmut", "apply", str(i)])
              execute_cmd(["mv", "gt.py", f"m{i}.py"])
              execute_cmd(["mv", "gt_copy.py", "gt.py"])
          # Remove gt and dummy pytest
          execute_cmd(["rm", "gt.py"])
          execute_cmd(["rm", "test_dummy.py"])
          clean(".mutmut-cache")
          os.chdir(pwd)
  
file_path: evalplus/tools/tsr/mutation_init.py
imports: import argparse
  import json
  import os
  from typing import Any, Dict, List
  from rich.progress import track
  from evalplus.eval.utils import swallow_io
  from evalplus.evaluate import evaluate
  from tools.tsr.utils import clean, execute_cmd, get_cmd_output, get_problems, get_task_ids, to_path
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_mutants(mutation_dir, dataset) without return types