code: def _display_ipython(port, height, display_handle):
      import IPython.display
  
      frame_id = "tensorboard-frame-{:08x}".format(
          random.getrandbits(64)
      )
      shell = """
        <iframe id="%HTML_ID%" width="100%" height="%HEIGHT%" frameborder="0">
        </iframe>
        <script>
          (function() {
            const frame = document.getElementById(%JSON_ID%);
            const url = new URL(%URL%, window.location);
            const port = %PORT%;
            if (port) {
              url.port = port;
            }
            frame.src = url;
          })();
        </script>
      """
      proxy_url = os.environ.get("TENSORBOARD_PROXY_URL")
      if proxy_url is not None:
          # Allow %PORT% in $TENSORBOARD_PROXY_URL
          proxy_url = proxy_url.replace("%PORT%", "%d" % port)
          replacements = [
              ("%HTML_ID%", html.escape(frame_id, quote=True)),
              ("%JSON_ID%", json.dumps(frame_id)),
              ("%HEIGHT%", "%d" % height),
              ("%PORT%", "0"),
              ("%URL%", json.dumps(proxy_url)),
          ]
      else:
          replacements = [
              ("%HTML_ID%", html.escape(frame_id, quote=True)),
              ("%JSON_ID%", json.dumps(frame_id)),
              ("%HEIGHT%", "%d" % height),
              ("%PORT%", "%d" % port),
              ("%URL%", json.dumps("/")),
          ]
  
      for k, v in replacements:
          shell = shell.replace(k, v)
      iframe = IPython.display.HTML(shell)
      if display_handle:
          display_handle.update(iframe)
      else:
          IPython.display.display(iframe)
  
imports: import datetime
  import errno
  import html
  import json
  import os
  import random
  import shlex
  import textwrap
  import time
  from tensorboard import manager
label_desc: Use image node_id 11 for calling a global function with example usage: _display_ipython(port, height, display_handle) without return types