code: def _plot_histograms(
      feature, date, hc_list, hist_names, top_n, max_nbins: int = 1000
  ):
      """Split off plot histogram generation to allow for parallel processing
  
      :param str feature: feature
      :param str date: date of time slot
      :param list hc_list: histogram list
      :param list hist_names: names of histograms to show as labels
      :param int max_nbins: maximum number of histogram bins allowed for plot (default 1000)
      :return: dict with histograms for each timestamp
      """
      # basic checks
      if len(hc_list) != len(hist_names):
          raise ValueError(
              "histogram list and histograms names should have equal length."
          )
      # filter out Nones (e.g. can happen with empty rolling hist)
      none_hists = [i for i, hc in enumerate(hc_list) if hc is None]
      hc_list = [
          hc for i, hc in enumerate(hc_list) if i not in none_hists
      ]
      hist_names = [
          hn for i, hn in enumerate(hist_names) if i not in none_hists
      ]
      # more basic checks
      if len(hc_list) == 0:
          return {}
      assert_similar_hists(hc_list)
  
      # make plot. note: slow!
      if hc_list[0].n_dim == 1:
          if all(h.entries == 0 for h in hc_list):
              # triviality checks, skip all histograms empty
              return {}
  
          props = get_hist_props(hc_list[0])
          is_num = props["is_num"]
          is_ts = props["is_ts"]
          y_label = (
              "Bin count" if len(hc_list) == 1 else "Bin probability"
          )
  
          if is_num:
              numpy_1dhists = get_consistent_numpy_1dhists(
                  hc_list, crop_range=True
              )
              entries_list = [nphist[0] for nphist in numpy_1dhists]
              bins = numpy_1dhists[0][1]  # bins = bin-edges
          else:
              # categorical
              entries_list, bins = get_consistent_numpy_entries(
                  hc_list, get_bin_labels=True
              )  # bins = bin-labels
  
          # skip histograms with too many bins to plot (default more than 1000)
          if len(bins) > max_nbins:
              return {}
  
          # normalize histograms for plotting (comparison!) in case there is more than one.
          if len(hc_list) >= 2:
              entries_list = [
                  el / hc.entries if hc.entries > 0 else el
                  for el, hc in zip(entries_list, hc_list)
              ]
          # if categorical
          # get top_n categories for histogram
          if not is_num:
              if len(bins) > top_n:
                  entries_list = np.stack(entries_list, axis=1)
                  entries_list, bins = get_top_categories(
                      entries_list, bins, top_n
                  )
                  entries_list = np.stack(entries_list, axis=1)
                  entries_list = np.reshape(
                      entries_list.ravel(), (-1, len(bins))
                  )
  
          hists = [(el, bins) for el in entries_list]
  
      elif hc_list[0].n_dim == 2:
          return {}
      else:
          return {}
  
      return {
          "date": date,
          "hists": hists,
          "feature": feature,
          "hist_names": hist_names,
          "y_label": y_label,
          "is_num": is_num,
          "is_ts": is_ts,
      }
  
file_path: popmon/popmon/visualization/histogram_section.py
imports: from __future__ import annotations
  import numpy
  import pandas
  from histogrammar.util import get_hist_props
  from tqdm import tqdm
  from popmon.analysis.hist_numpy import assert_similar_hists, get_consistent_numpy_1dhists, get_consistent_numpy_entries
  from popmon.base import Module
  from popmon.config import HistogramSectionModel
  from popmon.utils import parallel, short_date
  from popmon.visualization.utils import histogram_basic_checks, plot_heatmap, plot_histogram_overlay
label_desc: Use image node_id 1 for calling a global function with example usage: _plot_histograms(feature, date, hc_list, hist_names, top_n, max_nbins) and returns: dict, dict, dict, dict, dict, dict