code: def gen_parameter_description(
      sections: List[Tuple[str, int]],
      descriptions: List[List[Dict[str, List]]],
      params_rst: Path,
  ) -> None:
      """Write descriptions of parameters to the documentation file.
  
      Parameters
      ----------
      sections : list
          Names of parameters sections.
      descriptions : list
          Structured descriptions of parameters.
      params_rst : pathlib.Path
          Path to the file with parameters documentation.
      """
      params_to_write = []
      lvl_mapper = {1: "-", 2: "~"}
      for (section_name, section_lvl), section_params in zip(
          sections, descriptions
      ):
          heading_sign = lvl_mapper[section_lvl]
          params_to_write.append(
              f"{section_name}\n{heading_sign * len(section_name)}"
          )
          for param_desc in section_params:
              name = param_desc["name"][0]
              default_raw = param_desc["default"][0]
              default = (
                  default_raw.strip('"')
                  if len(default_raw.strip('"')) > 0
                  else default_raw
              )
              param_type = (
                  param_desc.get("type", param_desc["inner_type"])[0]
                  .split(":")[-1]
                  .split("<")[-1]
                  .strip(">")
              )
              options = param_desc.get("options", [])
              if len(options) > 0:
                  opts = "``, ``".join(
                      [x.strip() for x in options[0].split(",")]
                  )
                  options_str = f", options: ``{opts}``"
              else:
                  options_str = ""
              aliases = param_desc.get("alias", [])
              if len(aliases) > 0:
                  aliases_joined = "``, ``".join(
                      [x.strip() for x in aliases[0].split(",")]
                  )
                  aliases_str = f", aliases: ``{aliases_joined}``"
              else:
                  aliases_str = ""
              checks = sorted(param_desc.get("check", []))
              checks_len = len(checks)
              if checks_len > 1:
                  number1, sign1 = parse_check(checks[0])
                  number2, sign2 = parse_check(checks[1], reverse=True)
                  checks_str = f", constraints: ``{number2} {sign2} {name} {sign1} {number1}``"
              elif checks_len == 1:
                  number, sign = parse_check(checks[0])
                  checks_str = (
                      f", constraints: ``{name} {sign} {number}``"
                  )
              else:
                  checks_str = ""
              main_desc = f'-  ``{name}`` :raw-html:`<a id="{name}" title="Permalink to this parameter" href="#{name}">&#x1F517;&#xFE0E;</a>`, default = ``{default}``, type = {param_type}{options_str}{aliases_str}{checks_str}'
              params_to_write.append(main_desc)
              params_to_write.extend(
                  [
                      f"{' ' * 3 * int(desc[0][-1])}-  {desc[1]}"
                      for desc in param_desc["desc"]
                  ]
              )
  
      with open(params_rst) as original_params_file:
          all_lines = original_params_file.read()
          before, start_sep, _ = all_lines.partition(
              ".. start params list\n\n"
          )
          _, end_sep, after = all_lines.partition(
              "\n\n.. end params list"
          )
  
      with open(params_rst, "w") as new_params_file:
          new_params_file.write(before)
          new_params_file.write(start_sep)
          new_params_file.write("\n\n".join(params_to_write))
          new_params_file.write(end_sep)
          new_params_file.write(after)
  
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 6 for calling a global function with example usage: gen_parameter_description(sections, descriptions, params_rst) without return types