code: def display_exp(
      xp: exp.Experiment,
      force_full_width: bool = False,
      store_state_url: t.Optional[str] = None,
      embed_js_with_html: t.Optional[bool] = None,
      **kwargs: t.Any,
  ) -> IPythonExperimentDisplayed:
      if embed_js_with_html is None:
          embed_js_with_html = _should_embed_js_with_html()
  
      comm_id = f"comm_{uuid.uuid4().hex[:6]}"
      displayed_xp = IPythonExperimentDisplayed(xp, comm_id)
      options: t.Dict[str, t.Any] = {
          **kwargs,
          "experiment": xp._asdict(),
      }
      if store_state_url is not None:
          options.update({"persistentStateUrlPrefix": store_state_url})
      else:
          options.update({"persistentState": None})
      index_html = make_experiment_standalone_page(options=options)
      # Remove line that references the script bundle - prevents an HTTP error in the notebook
      index_html = index_html.replace(
          'src="static/built/hiplot.bundle.js"', ""
      )
      index_html = index_html.replace(
          "/*ON_LOAD_SCRIPT_INJECT*/",
          f"""/*ON_LOAD_SCRIPT_INJECT*/
  const comm_id = {escapejs(comm_id)};
  try {{
      console.log("Setting up communication channel with Jupyter: ", comm_id);
      const comm = Jupyter.notebook.kernel.comm_manager.new_comm(comm_id, {{'type': 'hello'}});
      var comm_message_id = 0;
      function send_data_change(type, data) {{
          comm.send({{
              'type': type,
              'message_id': comm_message_id,
              'data': data,
          }});
          comm_message_id += 1;
      }};
      Object.assign(options, {{"onChange": {{
          "selected_uids": send_data_change,
          "brush_extents": send_data_change,
      }}}});
  }}
  catch(err) {{
      console.warn('Unable to create Javascript <-> Python communication channel' +
          ' (are you in a Jupyter notebook? Jupyter labs is *not* supported!)');
  }}
          """,
      )
  
      if force_full_width:
          index_html = jupyter_make_full_width(index_html)
  
      if embed_js_with_html:
          bundle = (
              Path(__file__).parent
              / "static"
              / "built"
              / "hiplot.bundle.js"
          )
          index_html = index_html.replace(
              "/*BUNDLE_FILE*/", bundle.read_text("utf-8")
          )
      else:
          NotebookJSBundleInjector.ensure_injected()
  
      IPython.display.display(IPython.display.HTML(index_html))
      return displayed_xp
  
imports: import uuid
  import html
  import typing
  import json
  from pathlib import Path
  import IPython.display
  from ipykernel.comm import Comm
  from .None import experiment
  from .render import escapejs, make_experiment_standalone_page
label_desc: Use image node_id 3 for calling a global function with example usage: display_exp(xp, force_full_width, store_state_url, embed_js_with_html) and returns: displayed_xp