code: def as_html(
      module: Module,
      min_flop: int = 1000,
      outvars: str = "",
      last: bool = False,
  ) -> str:
      """Formats a `Module` as a tree of interactive HTML elements.
  
      When embedding this in a page, the outputs of `css` and `js` must be embedded
      too for the visualization to work.
      To only visualize a single module directly, see `as_html_page`.
  
      Args:
        module: The module to visualize, as an interactive HTML tree.
        min_flop: Minimum number of flops for an operation to be shown.
        outvars: For internal use, the outputs of this module.
        last: For internal use, whether this module is the last of its siblings.
  
      Returns:
        HTML representation of `module`.
      """
      s = "<span>"
  
      if last:
          s += """ <span class = "expander"
                      onclick = "javascript:expand(this)"
                      style = "padding-right: 6px" >
                      &#9492;&#9472;
                  </span>"""
      else:
          s += """<span class="expander"
                      onclick="javascript:expand(this)">
                      &#9472;&#9472;
                  </span>"""
  
      s += f"""<span class="tooltip-container"> {outvars} = <b>{module.name}</b>"""
      if module.flops is not None:
          s += f"<span class='flops'>{_decimal_prefix(module.flops, 'flop')}</span>"
  
      if module.total_param_size > 0:
          s += f"<span class='flops'>{_decimal_prefix(module.total_param_size, 'param')}</span>"
      if module.total_state_size > 0:
          s += f"<span class='flops'>{_decimal_prefix(module.total_state_size, 'state')}</span>"
  
      # Tooltip with detailed param and state information.
      s += """<span class="tooltip">
        <table>
          <tr><th colspan=2>Param</th></tr>"""
      for key, val in module.param_info.items():
          s += f"<tr><td>{key}</td><td>{val}</td></tr>"
      s += "<tr><th colspan=2>State</th></tr>"
      for key, val in module.state_info.items():
          s += f"<tr><td>{key}</td><td>{val}</td></tr>"
      s += """
        </table>
      </span>
      </span>"""
  
      expressions = [
          e
          for e in module.expressions
          if e.flops is None or e.flops >= min_flop
      ]
      if expressions:
          s += """
          <span class="expander" onclick="javascript:expand(this)">
              [expand]
          </span>
          <ol style="display:none">
          """
  
          for i, exp in enumerate(expressions):
              last = i + 1 == len(expressions)
              s += "<li class='node'>"
              if exp.submodule:
                  s += as_html(
                      exp.submodule,
                      min_flop=min_flop,
                      outvars=exp.outvars,
                      last=last,
                  )
              else:
                  s += f"""<div class='expression tooltip-container'>
                              <span class='tooltip'>{exp.details}"""
                  for key, val in exp.params.items():
                      s += f"<div>{key}: {val}</div>"
                  s += f"""</span>
                          {exp.outvars} = <span class='primitive'>{exp.primitive}</span>
                          {exp.invars}
                          <span class='flops'>{_decimal_prefix((exp.flops or 0), 'flops')}</span>
                      </div>"""
              s += "</li>"
  
          s += "</ol>"
  
      return s + "</span>"
  
imports: from collections.abc import Mapping, Sequence
  import dataclasses
  import itertools
  import logging
  import os
  import sys
  from typing import Any, Callable, NamedTuple, Optional
  from haiku._src import summarise
  import jax
  import jax.core
label_desc: Use image node_id 16 for calling a global function with example usage: as_html(module, min_flop, outvars, last) and returns: unknown