code: def _build_javascript(
      viz_obj, id_str=None, default_key=-1, js_url=None
  ):
      if js_url is None:
          interpret_path = os.path.join(
              os.path.dirname(os.path.abspath(__file__)), ".."
          )
          root_path = os.path.join(interpret_path, "root")
          if not os.path.isdir(root_path):
              # if no root directory then fallback to the git source location
              root_path = os.path.join(interpret_path, "..", "..", "..")
          js_path = os.path.join(
              root_path, "bld", "lib", "interpret-inline.js"
          )
          js_last_modified = time.ctime(os.path.getmtime(js_path))
  
          with open(js_path, "r", encoding="utf-8") as f:
              show_js = f.read()
          init_js = """
          <script type="text/javascript">
          console.log("Initializing interpret-inline (last modified: {1})");
          {0}
          </script>
          """.format(
              show_js, js_last_modified
          )
      else:
          init_js = """
          <script type="text/javascript" src="{0}"></script>
          """.format(
              js_url
          )
  
      if id_str is None:
          div_id = "_interpret-viz-{0}".format(uuid.uuid4())
      else:
          div_id = id_str
  
      body_js = """
      <div id="{0}"></div>
      <script defer type="text/javascript">
  
      (function universalLoad(root, callback) {{
        if(typeof exports === 'object' && typeof module === 'object') {{
          // CommonJS2
          console.log("CommonJS2");
          var interpretInline = require('interpret-inline');
          callback(interpretInline);
        }} else if(typeof define === 'function' && define.amd) {{
          // AMD
          console.log("AMD");
          require(['interpret-inline'], function(interpretInline) {{
            callback(interpretInline);
          }});
        }} else if(typeof exports === 'object') {{
          // CommonJS
          console.log("CommonJS");
          var interpretInline = require('interpret-inline');
          callback(interpretInline);
        }} else {{
          // Browser
          console.log("Browser");
          callback(root['interpret-inline']);
        }}
      }})(this, function(interpretInline) {{
          interpretInline.RenderApp("{0}", {1}, {2});
      }});
  
      </script>
      """.format(
          div_id, json.dumps(viz_obj), default_key
      )
  
      return init_js, body_js
  
file_path: interpret/python/interpret-core/interpret/visual/_inline.py
imports: import os
  import time
  import uuid
  from plotly.io import to_json
  from plotly import graph_objs
  import sys
  import json
  import base64
  import logging
label_desc: Use image node_id 7 for calling a global function with example usage: _build_javascript(viz_obj, id_str, default_key, js_url) and returns: init_js,  body_js