code: def generate_html_summary_text(
      feature_dict: dict, compare_dict: dict
  ):
      template = jinja2_env.get_template("feature_summary_text.html")
  
      # Set some parameters for breakdown columns
      # ------------------------------------
      cols = dict()
      # Cols: Move text if there is a comparison pair display
      cur_x = config["Layout"].getint("pair_spacing")
      padding = config["Layout"].getint("col_spacing")
      if compare_dict is not None:
          cols["compare"] = cur_x
          cur_x = cur_x + config["Layout"].getint("pair_spacing")
      cur_x = cur_x + padding
      cols["text"] = cur_x
      cols["text_width"] = (
          config["Layout"].getint("summary_text_max_width") - cur_x
      )
      cols["full_text_width"] = config["Layout"].getint(
          "summary_text_max_width"
      )
  
      max_text_rows = config["Summary_Stats"].getint(
          "summary_max_text_rows"
      )
  
      # Filter final row list to display, add "other"
      # ------------------------------------
      full_list = feature_dict["detail"]["full_count"]
      feature_dict["detail"]["summary_count"] = full_list[
          :max_text_rows
      ]
      summary_list = feature_dict["detail"]["summary_count"]
  
      # Clipping text only for memory purposes (display will be handled by the browser)
      max_text_display_length = config["Summary_Stats"].getint(
          "text_max_string_len"
      )
      for elem in summary_list:
          elem["name"] = elem["name"][:max_text_display_length]
  
      if len(summary_list) == max_text_rows:
          total = feature_dict["base_stats"]["num_values"].number
          cur_count = sum(
              row_data["count"].number for row_data in summary_list
          )
          other = total - cur_count
          row = dict()
          row["name"] = OTHERS_GROUPED.strip()
          row["count"] = NumWithPercent(other, total)
          row["target_stats"] = None
          row["target_stats_compare"] = None
          if compare_dict is not None:
              total = compare_dict["base_stats"]["num_values"].number
              cur_count = sum(
                  (
                      row_data["count_compare"].number
                      if row_data.get("count_compare")
                      else 0
                  )
                  for row_data in summary_list
              )
              other = total - cur_count
              row["count_compare"] = NumWithPercent(other, total)
          else:
              row["count_compare"] = None
          if row["count"].number > 0 or (
              row.get("count_compare")
              and row.get("count_compare").number > 0
          ):
              summary_list.append(row)
  
      output = template.render(
          feature_dict=feature_dict,
          compare_dict=compare_dict,
          cols=cols,
      )
      return output
  
imports: import numpy
  import html
  from operator import itemgetter
  from jinja2 import Environment, PackageLoader
  import sweetviz.sv_html_formatters
  from sweetviz.config import config
  from sweetviz.sv_types import NumWithPercent, FeatureType, OTHERS_GROUPED
  from sweetviz.graph_associations import CORRELATION_ERROR
  from sweetviz.graph_associations import CORRELATION_IDENTICAL
  from functools import cmp_to_key
label_desc: Use image node_id 10 for calling a global function with example usage: generate_html_summary_text(feature_dict, compare_dict) and returns: output