code: def generate_html(node):
      document = ["<h1><tt>%s</tt></h1>" % html_escape(node.target)]
  
      if node.inputs:
          document.append(
              "<h2>target is built using rule <tt>%s</tt> of</h2>"
              % html_escape(node.rule)
          )
          if len(node.inputs) > 0:
              document.append("<div class=filelist>")
              for input, type in sorted(node.inputs):
                  extra = ""
                  if type:
                      extra = " (%s)" % html_escape(type)
                  document.append(
                      '<tt><a href="?%s">%s</a>%s</tt><br>'
                      % (html_escape(input), html_escape(input), extra)
                  )
              document.append("</div>")
  
      if node.outputs:
          document.append("<h2>dependent edges build:</h2>")
          document.append("<div class=filelist>")
          for output in sorted(node.outputs):
              document.append(
                  '<tt><a href="?%s">%s</a></tt><br>'
                  % (html_escape(output), html_escape(output))
              )
          document.append("</div>")
  
      return "\n".join(document)
  
imports: import argparse
  import os
  import socket
  import subprocess
  import sys
  import webbrowser
  from collections import namedtuple
label_desc: Use image node_id 5 for calling a global function with example usage: generate_html(node) and returns: str