code: def gen_doc_dunder_def(dunder, is_indx=False, with_self=True):
      """Return python def as it should be written in docs"""
      param = ""
      dunder_name = dunder["def_name"]
      if valid_dic_val(dunder, "static"):
          with_self = False
  
      # to correctly render methods like __init__ in md
      if dunder_name[0] == "_":
          dunder_name = "\\" + dunder_name
      if is_indx:
          dunder_name = bold(dunder_name)
      else:
          dunder_name = bold(color(COLOR_METHOD, dunder_name))
  
      if with_self:
          if not "params" in dunder or dunder["params"] is None:
              dunder["params"] = []
          dunder["params"].insert(0, {"param_name": "self"})
  
      if valid_dic_val(dunder, "params"):
          for p in dunder["params"]:
              default = (
                  join(["=", str(p["type"])]) if "type" in p else ""
              )
              if is_indx:
                  param = join(
                      [param, bold(p["param_name"]), default, ", "]
                  )
              else:
                  param = join(
                      [
                          param,
                          color(
                              COLOR_PARAM,
                              bold(p["param_name"])
                              + create_hyperlinks(default),
                          ),
                          ", ",
                      ]
                  )
  
      if with_self:
          dunder["params"] = dunder["params"][1:]
          if not dunder["params"]:  # if is empty delete it
              del dunder["params"]
  
      param = param[:-2]  # delete the last ', '
      return join([dunder_name, parentheses(param)])
  
imports: import os
  import yaml
  import re
  import doc_gen_snipets
label_desc: Use image node_id 20 for calling a global function with example usage: gen_doc_dunder_def(dunder, is_indx, with_) and returns: join