code: def render_categorical_length(
      config: Settings, summary: dict, varid: str
  ) -> Tuple[Renderable, Renderable]:
      length_table = Table(
          [
              {
                  "name": "Max length",
                  "value": fmt_number(summary["max_length"]),
                  "alert": False,
              },
              {
                  "name": "Median length",
                  "value": fmt_number(summary["median_length"]),
                  "alert": False,
              },
              {
                  "name": "Mean length",
                  "value": fmt_numeric(
                      summary["mean_length"],
                      precision=config.report.precision,
                  ),
                  "alert": False,
              },
              {
                  "name": "Min length",
                  "value": fmt_number(summary["min_length"]),
                  "alert": False,
              },
          ],
          name="Length",
          anchor_id=f"{varid}lengthstats",
          style=config.html.style,
      )
  
      if isinstance(summary["histogram_length"], list):
          hist_data = histogram(
              config,
              [x[0] for x in summary["histogram_length"]],
              [x[1] for x in summary["histogram_length"]],
          )
      else:
          hist_data = histogram(config, *summary["histogram_length"])
  
      length_histo = Image(
          hist_data,
          image_format=config.plot.image_format,
          alt="length histogram",
          name="Length",
          caption="Histogram of lengths of the category",
          anchor_id=f"{varid}length",
      )
  
      return length_table, length_histo
  
file_path: ydata-profiling/src/ydata_profiling/report/structure/variables/render_categorical.py
imports: from typing import List, Tuple, Union
  import pandas
  from ydata_profiling.config import Settings
  from ydata_profiling.report.formatters import fmt, fmt_bytesize, fmt_number, fmt_numeric, fmt_percent, help
  from ydata_profiling.report.presentation.core import HTML, Container, FrequencyTable, FrequencyTableSmall, Image, Table, VariableInfo
  from ydata_profiling.report.presentation.core.renderable import Renderable
  from ydata_profiling.report.presentation.frequency_table_utils import freq_table
  from ydata_profiling.report.structure.variables.render_common import render_common
  from ydata_profiling.visualisation.plot import cat_frequency_plot, histogram
label_desc: Use image node_id 2 for calling a global function with example usage: render_categorical_length(config, summary, varid) and returns: length_table,  length_histo