code: def _configure_connected_script(verbose: bool) -> str:
      url = get_js_cdn_url()
      output_id = JupyterNotebookContext._rand_string()
      success_message = (
          """
              var div = document.createElement("div");
              div.style.color = 'darkblue';
              div.textContent = 'Lets-Plot JS successfully loaded.';
              document.getElementById("{id}").appendChild(div);
          """.format(
              id=output_id
          )
          if verbose
          else ""
      )
  
      return """
              <div id="{id}"></div>
              <script type="text/javascript" {data_attr}="{script_kind}">
                  if(!window.letsPlotCallQueue) {{
                      window.letsPlotCallQueue = [];
                  }}; 
                  window.letsPlotCall = function(f) {{
                      window.letsPlotCallQueue.push(f);
                  }};
                  (function() {{
                      var script = document.createElement("script");
                      script.type = "text/javascript";
                      script.src = "{url}";
                      script.onload = function() {{
                          window.letsPlotCall = function(f) {{f();}};
                          window.letsPlotCallQueue.forEach(function(f) {{f();}});
                          window.letsPlotCallQueue = [];
                          {success_message}
                      }};
                      script.onerror = function(event) {{
                          window.letsPlotCall = function(f) {{}};    // noop
                          window.letsPlotCallQueue = [];
                          var div = document.createElement("div");
                          div.style.color = 'darkred';
                          div.textContent = 'Error loading Lets-Plot JS';
                          document.getElementById("{id}").appendChild(div);
                      }};
                      var e = document.getElementById("{id}");
                      e.appendChild(script);
                  }})()
              </script>
              """.format(
          data_attr=_ATT_SCRIPT_KIND,
          script_kind=_SCRIPT_KIND_LIB_LOADING,
          id=output_id,
          url=url,
          success_message=success_message,
      )
  
file_path: lets-plot/python-package/lets_plot/frontend_context/_jupyter_notebook_ctx.py
imports: import os
  import pkgutil
  import random
  import string
  from typing import Dict
  from ._frontend_ctx import FrontendContext
  from ..None import _kbridge
  from .._global_settings import get_js_cdn_url
  from .._global_settings import JS_BASE_URL, JS_NAME
  from .._version import __version__
label_desc: Use image node_id 4 for calling the JupyterNotebookContext obj's underlying member method code with example usage: obj._configure_connected_script(verbose) and returns: str