code: def fill_in_config_paths_for_fancy_output(
      config_template_path: PathOrStr,
  ) -> Path:
      """
      Fill in the template for more comprehensive ("fancier") output.
  
      Add paths to train, test, and output directories in the given
      config template file.
  
      Parameters
      ----------
      config_template_path : :class:`skll.types.PathOrStr`
          Path to the template configuration file.
  
      Returns
      -------
      Path
          The path to the filled configuration file.
      """
      # convert template path to a Path object if string
      config_template_path = Path(config_template_path)
  
      config = _setup_config_parser(
          config_template_path, validate=False
      )
  
      config.set(
          "Input",
          "train_file",
          str(train_dir / "fancy_train.jsonlines"),
      )
      config.set(
          "Input", "test_file", str(test_dir / "fancy_test.jsonlines")
      )
      config.set("Output", "results", str(output_dir))
      config.set("Output", "logs", str(output_dir))
      config.set("Output", "predictions", str(output_dir))
  
      config_prefix_match = re.search(
          r"^(.*)\.template\.cfg", str(config_template_path)
      )
      assert config_prefix_match is not None
      config_prefix = config_prefix_match.groups()[0]
      new_config_path = Path(f"{config_prefix}.cfg")
  
      with open(new_config_path, "w") as new_config_file:
          config.write(new_config_file)
  
      return new_config_path
  
imports: import os
  import re
  from collections import OrderedDict
  from math import floor, log10
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  from numpy.random import RandomState
  from sklearn.datasets import fetch_california_housing, load_digits, make_classification, make_regression
  from sklearn.feature_extraction import FeatureHasher
  from sklearn.model_selection import KFold, ShuffleSplit, StratifiedKFold
  from sklearn.utils import shuffle
  from skll.config import _setup_config_parser, fix_json
  from skll.data import FeatureSet, NDJWriter
  from skll.types import PathOrStr
label_desc: Use image node_id 5 for calling a global function with example usage: fill_in_config_paths_for_fancy_output(config_template_path) and returns: new_config_path