code: def get_docstring_args(fd, file_name, func_name, class_name=None):
      """
      Extract docstring parameters from function definition
      """
      docstring = ast.get_docstring(fd)
      if len(re.findall(r"Parameters", docstring)) != 1:
          msg = (
              "Missing required 'Parameters' section in docstring in \n"
          )
          msg += f"file: {file_name}\n"
          if class_name is not None:
              msg += f"class: {class_name}\n"
          msg += f"function/method: {func_name}\n"
          raise RuntimeError(msg)
      if (
          class_name is None
          and len(re.findall(r"Returns", docstring)) != 1
      ):
          msg = "Missing required 'Returns' section in docstring in \n"
          msg += f"file: {file_name}\n"
          msg += f"function/method: {func_name}\n"
          raise RuntimeError(msg)
  
      if class_name is None:
          params_section = re.findall(
              r"(?<=Parameters)(.*)(?=Returns)", docstring, re.DOTALL
          )[0]
      else:
          params_section = re.findall(
              r"(?<=Parameters)(.*)", docstring, re.DOTALL
          )[0]
  
      args = re.findall(r"(\w+)\s+\:", params_section)
      args = set(
          [a for a in args if a != "i"]
      )  # `i` should never be a parameter
  
      return args
  
imports: import ast
  import pathlib
  import re
label_desc: Use image node_id 1 for calling a global function with example usage: get_docstring_args(fd, file_name, func_name, class_name) and returns: args