code: def construct_facets_html(
      proto: facet_feature_statistics_pb2.DatasetFeatureStatisticsList,
      compare: bool = False,
  ) -> str:
      """
      Constructs the facets HTML to visualize the serialized FeatureStatisticsList proto.
      :param proto: A DatasetFeatureStatisticsList proto which contains the statistics for a DataFrame
      :param compare: If True, then the returned visualization switches on the comparison
          mode for several stats.
      :return: the HTML for Facets visualization
      """
      # facets_html_bundle = _get_facets_html_bundle()
      protostr = base64.b64encode(proto.SerializeToString()).decode(
          "utf-8"
      )
      polyfills_code = get_facets_polyfills()
  
      html_template = """
          <div style="background-color: white">
          <script>{polyfills_code}</script>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.3.3/webcomponents-lite.js"></script>
          <link rel="import" href="https://raw.githubusercontent.com/PAIR-code/facets/1.0.0/facets-dist/facets-jupyter.html" >
          <facets-overview id="facets" proto-input="{protostr}" compare-mode="{compare}"></facets-overview>
          </div>
      """
      return html_template.format(
          protostr=protostr,
          compare=compare,
          polyfills_code=polyfills_code,
      )
  
file_path: mlflow/mlflow/recipes/cards/pandas_renderer.py
imports: import base64
  import sys
  from typing import Iterable, Tuple, Union
  import numpy
  import pandas
  from packaging.version import Version
  from mlflow.exceptions import MlflowException
  from mlflow.protos import facet_feature_statistics_pb2
  from mlflow.recipes.cards import histogram_generator
label_desc: Use image node_id 8 for calling a global function with example usage: construct_facets_html(proto, compare) and returns: html_template