code: def generate_doc(name, specs):
      tab = " " * 4
      doc = [f"- :py:func:`~scipy.special.{name}`::\n"]
      for spec in specs:
          incodes, outcodes = spec.split("->")
          incodes = incodes.split("*")
          intypes = [CY_TYPES[x] for x in incodes[0]]
          if len(incodes) > 1:
              types = [f"{CY_TYPES[x]} *" for x in incodes[1]]
              intypes.extend(types)
          outtype = CY_TYPES[outcodes]
          line = "{} {}({})".format(outtype, name, ", ".join(intypes))
          doc.append(2 * tab + line)
      doc[-1] = f"{doc[-1]}\n"
      doc = "\n".join(doc)
      return doc
  
imports: import itertools
  import json
  import os
  from stat import ST_MTIME
  import argparse
  import re
  import textwrap
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: generate_doc(name, specs) and returns: doc