code: def train_fixture(
      config_prefix: str, config_filename: str = "experiment.json"
  ) -> None:
      config_file = config_prefix + config_filename
      serialization_dir = config_prefix + "serialization"
      # Train model doesn't like it if we have incomplete serialization
      # directories, so remove them if they exist.
      if os.path.exists(serialization_dir):
          shutil.rmtree(serialization_dir)
  
      # train the model
      train_model_from_file(config_file, serialization_dir)
  
      # remove unnecessary files
      shutil.rmtree(os.path.join(serialization_dir, "log"))
  
      for filename in glob.glob(os.path.join(serialization_dir, "*")):
          if (
              filename.endswith(".log")
              or filename.endswith(".json")
              or re.search(r"epoch_[0-9]+\.th$", filename)
          ):
              os.remove(filename)
  
file_path: allennlp/scripts/train_fixtures.py
imports: import glob
  import logging
  import os
  import re
  import shutil
  import sys
  import tempfile
  from allennlp.commands.test_install import _get_module_root
  from allennlp.commands.train import train_model_from_file, train_model
  from allennlp.common import Params
  from allennlp.common.util import pushd
label_desc: Use image node_id 1 for calling a global function with example usage: train_fixture(config_prefix, config_filename) without return types