code: def init_config(
      *,
      lang: str = InitValues.lang,
      pipeline: List[str] = InitValues.pipeline,
      optimize: str = InitValues.optimize,
      gpu: bool = InitValues.gpu,
      pretraining: bool = InitValues.pretraining,
      silent: bool = True,
  ) -> Config:
      msg = Printer(no_print=silent)
      with TEMPLATE_PATH.open("r") as f:
          template = Template(f.read())
      # Filter out duplicates since tok2vec and transformer are added by template
      pipeline = [
          pipe
          for pipe in pipeline
          if pipe not in ("tok2vec", "transformer")
      ]
      defaults = RECOMMENDATIONS["__default__"]
      reco = RecommendationSchema(
          **RECOMMENDATIONS.get(lang, defaults)
      ).dict()
      variables = {
          "lang": lang,
          "components": pipeline,
          "optimize": optimize,
          "hardware": "gpu" if gpu else "cpu",
          "transformer_data": reco["transformer"],
          "word_vectors": reco["word_vectors"],
          "has_letters": reco["has_letters"],
      }
      if variables["transformer_data"] and not has_spacy_transformers():
          msg.warn(
              "To generate a more effective transformer-based config (GPU-only), "
              "install the spacy-transformers package and re-run this command. "
              "The config generated now does not use transformers."
          )
          variables["transformer_data"] = None
      base_template = template.render(variables).strip()
      # Giving up on getting the newlines right in jinja for now
      base_template = re.sub(r"\n\n\n+", "\n\n", base_template)
      # Access variables declared in templates
      template_vars = template.make_module(variables)
      use_case = {
          "Language": lang,
          "Pipeline": ", ".join(pipeline),
          "Optimize for": optimize,
          "Hardware": variables["hardware"].upper(),
          "Transformer": template_vars.transformer.get("name")  # type: ignore[attr-defined]
          if template_vars.use_transformer  # type: ignore[attr-defined]
          else None,
      }
      msg.info("Generated config template specific for your use case")
      for label, value in use_case.items():
          msg.text(f"- {label}: {value}")
      with show_validation_error(hint_fill=False):
          config = util.load_config_from_str(base_template)
          nlp = util.load_model_from_config(config, auto_fill=True)
          config = nlp.config
          if pretraining:
              validate_config_for_pretrain(config, msg)
              pretrain_config = util.load_config(
                  DEFAULT_CONFIG_PRETRAIN_PATH
              )
              config = pretrain_config.merge(config)
      msg.good("Auto-filled config with all values")
      return config
  
imports: import re
  from enum import Enum
  from pathlib import Path
  from typing import List, Optional, Tuple
  import srsly
  from jinja2 import Template
  from thinc.api import Config
  from wasabi import Printer, diff_strings
  from ..None import util
  from ..language import DEFAULT_CONFIG_PRETRAIN_PATH
  from ..schemas import RecommendationSchema
  from ..util import SimpleFrozenList
  from ._util import COMMAND, Arg, Opt, import_code, init_cli, show_validation_error, string_to_list
label_desc: Use image node_id 4 for calling a global function with example usage: init_config() and returns: config