code: def render_report_elements(
      experiment_name: str,
      html_elements: List[str],
      header: bool = True,
      offline: bool = False,
      notebook_env: bool = False,
  ) -> str:
      """Generate Ax HTML report for a given experiment from HTML elements.
  
      Uses Jinja2 for template. Injects Plotly JS for graph rendering.
  
      Example:
  
      ::
  
          html_elements = [
              h2_html("Subsection with plot"),
              p_html("This is an example paragraph."),
              plot_html(plot_fitted(gp_model, 'perf_metric')),
              h2_html("Subsection with table"),
              pandas_html(data.df),
          ]
          html = render_report_elements('My experiment', html_elements)
  
      Args:
          experiment_name: the name of the experiment to use for title.
          html_elements: list of HTML strings to render in report
              body.
          header: if True, render experiment title as a header.
              Meant to be used for standalone reports (e.g. via email), as opposed
              to served on the front-end.
          offline: if True, entire Plotly library is bundled
              with report.
          notebook_env: if True, caps the report width to 700px for viewing in a
              notebook environment.
  
      Returns:
          str: HTML string.
  
      """
      # combine CSS for report and plots
      css = _load_css_resource() + _load_plot_css_resource()
      return (
          _get_jinja_environment()
          .get_template(REPORT_ELEMENT_TEMPLATE)
          .render(
              experiment_name=experiment_name,
              css=css,
              js_requires=_js_requires(),
              html_elements=html_elements,
              headfoot=header,
              notebook_env=notebook_env,
          )
      )
  
file_path: Ax/ax/utils/report/render.py
imports: import os
  import pkgutil
  from typing import List, Optional
  from ax.plot.render import _js_requires, _load_css_resource
  from jinja2 import Environment, FunctionLoader
label_desc: Use image node_id 12 for calling a global function with example usage: render_report_elements(experiment_name, html_elements, header, offline, notebook_env) and returns: _get_jinja_environment