code: def gen_stub_method_def(method):
      """Return python def as it should be written in stub files"""
      param = ""
      method_name = method["def_name"]
      for p in method["params"]:
          p_type = join([": ", str(p["type"])]) if "type" in p else ""
          default = (
              join([" = ", str(p["default"])]) if "default" in p else ""
          )
          param = join([param, p["param_name"], p_type, default, ", "])
      param = param[:-2]  # delete the last ', '
      return_type = (
          join([" -> ", method["return"]]) if "return" in method else ""
      )
      return join([method_name, parentheses(param), return_type])
  
imports: import os
  import yaml
  import re
  import doc_gen_snipets
label_desc: Use image node_id 18 for calling a global function with example usage: gen_stub_method_def(method) and returns: join