code: def generate_info():  # pragma: no cover
      from urllib.request import urlopen
      import PIL
      from PIL import Image
  
      Image.init()
  
      ids = []
      formats = []
      docs = {}
  
      # Collect formats and their summary from plugin modules
      for mod_name in dir(PIL):
          if "ImagePlugin" in mod_name:
              mod = getattr(PIL, mod_name)
              for ob_name in dir(mod):
                  ob = getattr(mod, ob_name)
                  if isinstance(ob, type) and issubclass(
                      ob, Image.Image
                  ):
                      if ob.format in ids:
                          print("Found duplicate for", ob.format)
                      else:
                          ids.append(ob.format)
                          formats.append(
                              (ob.format, ob.format_description)
                          )
  
      # Add extension info
      for i in range(len(formats)):
          id, summary = formats[i]
          ext = " ".join(
              [e for e in Image.EXTENSION if Image.EXTENSION[e] == id]
          )
          formats[i] = id, summary, ext
  
      # Get documentation of formats
      url = "https://raw.githubusercontent.com/python-pillow/Pillow/master/docs/handbook/image-file-formats.rst"  # noqa
      lines = urlopen(url).read().decode().splitlines()
      lines.append("End")
      lines.append("---")  # for the end
  
      # Parse documentation
      cur_name = ""
      cur_part = []
      for i in range(len(lines)):
          line = lines[i]
          if line.startswith(("^^^", "---", "===")):
              if cur_name and cur_name in ids:
                  text = "\n".join(cur_part[:-1])
                  text = text.replace(
                      "versionadded::", "versionadded:: Pillow "
                  )
                  text = text.replace("Image.open`", "Image.write`")
                  docs[cur_name] = text
              cur_part = []
              cur_name = lines[i - 1].strip().replace(" ", "").upper()
          else:
              cur_part.append("    " + line)
  
      # Fill in the blancs
      for id in ids:
          if id in docs:
              docs[id] = "*From the Pillow docs:*\n\n" + docs[id]
          else:
              docs[id] = "No docs for %s." % id
              print("no docs for", id)
  
      # Sort before writing
      formats.sort(key=lambda x: x[0])
      ids.sort()
  
      # Read file ...
      code = open(__file__, "rb").read().decode()
      code, divider, _ = code.partition(
          "## BELOW IS " + "AUTOGENERATED"
      )
      code += divider + "\n\n"
  
      # Write formats
      code += "pillow_formats = [\n"
      for i in range(len(formats)):
          print(formats[i])
          code += "    (%r, %r, %r),\n" % formats[i]
      code += "    ]\n\n\n"
  
      # Write docs
      code += "pillow_docs = {\n"
      for id in ids:
          code += '%r:\nu"""%s""",\n' % (id, docs[id])
      code += "}\n"
  
      # Write back
      with open(__file__, "wb") as f:
          f.write(code.encode())
  
label_desc: Use image node_id 1 for calling a global function with example usage: generate_info() without return types