code: def set_one_var_from_string(
      name: str, param_type: str, checks: List[str]
  ) -> str:
      """Construct code for auto config file for one param value.
  
      Parameters
      ----------
      name : str
          Name of the parameter.
      param_type : str
          Type of the parameter.
      checks : list
          Constraints of the parameter.
  
      Returns
      -------
      ret : str
          Lines of auto config file with getting and checks of one parameter value.
      """
      ret = ""
      univar_mapper = {
          "int": "GetInt",
          "double": "GetDouble",
          "bool": "GetBool",
          "std::string": "GetString",
      }
      if "vector" not in param_type:
          ret += f'  {univar_mapper[param_type]}(params, "{name}", &{name});\n'
          if len(checks) > 0:
              check_mapper = {
                  "<": "LT",
                  ">": "GT",
                  "<=": "LE",
                  ">=": "GE",
              }
              for check in checks:
                  value, sign = parse_check(check)
                  ret += f"  CHECK_{check_mapper[sign]}({name}, {value});\n"
          ret += "\n"
      else:
          ret += f'  if (GetString(params, "{name}", &tmp_str)) {{\n'
          type2 = param_type.split("<")[1][:-1]
          if type2 == "std::string":
              ret += (
                  f"    {name} = Common::Split(tmp_str.c_str(), ',');\n"
              )
          else:
              ret += f"    {name} = Common::StringToArray<{type2}>(tmp_str, ',');\n"
          ret += "  }\n\n"
      return ret
  
file_path: LightGBM/helpers/parameter_generator.py
imports: import re
  from collections import defaultdict
  from pathlib import Path
  from typing import Dict, List, Tuple
label_desc: Use image node_id 5 for calling a global function with example usage: set_one_var_from_string(name, param_type, checks) and returns: ret