code: def get_parameter_infos(
      config_hpp: Path,
  ) -> Tuple[List[Tuple[str, int]], List[List[Dict[str, List]]]]:
      """Parse config header file.
  
      Parameters
      ----------
      config_hpp : pathlib.Path
          Path to the config header file.
  
      Returns
      -------
      infos : tuple
          Tuple with names and content of sections.
      """
      is_inparameter = False
      cur_key = None
      key_lvl = 0
      cur_info: Dict[str, List] = {}
      keys = []
      member_infos: List[List[Dict[str, List]]] = []
      with open(config_hpp) as config_hpp_file:
          for line in config_hpp_file:
              if line.strip() in {
                  "#ifndef __NVCC__",
                  "#endif  // __NVCC__",
              }:
                  continue
              if "#pragma region Parameters" in line:
                  is_inparameter = True
              elif "#pragma region" in line and "Parameters" in line:
                  key_lvl += 1
                  cur_key = line.split("region")[1].strip()
                  keys.append((cur_key, key_lvl))
                  member_infos.append([])
              elif "#pragma endregion" in line:
                  key_lvl -= 1
                  if cur_key is not None:
                      cur_key = None
                  elif is_inparameter:
                      is_inparameter = False
              elif cur_key is not None:
                  line = line.strip()
                  if line.startswith("//"):
                      key, _, val = line[2:].partition("=")
                      key = key.strip()
                      val = val.strip()
                      if key not in cur_info:
                          if key == "descl2" and "desc" not in cur_info:
                              cur_info["desc"] = []
                          elif key != "descl2":
                              cur_info[key] = []
                      if key == "desc":
                          cur_info["desc"].append(("l1", val))
                      elif key == "descl2":
                          cur_info["desc"].append(("l2", val))
                      else:
                          cur_info[key].append(val)
                  elif line:
                      has_eqsgn = False
                      tokens = line.split("=")
                      if len(tokens) == 2:
                          if "default" not in cur_info:
                              cur_info["default"] = [
                                  tokens[1][:-1].strip()
                              ]
                          has_eqsgn = True
                      tokens = line.split()
                      cur_info["inner_type"] = [tokens[0].strip()]
                      if "name" not in cur_info:
                          if has_eqsgn:
                              cur_info["name"] = [tokens[1].strip()]
                          else:
                              cur_info["name"] = [
                                  tokens[1][:-1].strip()
                              ]
                      member_infos[-1].append(cur_info)
                      cur_info = {}
  
      return keys, member_infos
  
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 1 for calling a global function with example usage: get_parameter_infos(config_hpp) and returns: keys,  member_infos