code: def visualize(
      e,
      plot_cmap="RdBu",
      matplotlib=False,
      figsize=(20, 3),
      show=True,
      ordering_keys=None,
      ordering_keys_time_format=None,
      text_rotation=0,
      min_perc=0.05,
  ):
      """Main interface for switching between matplotlib / javascript force plots.
  
      Parameters
      ----------
      e : AdditiveExplanation
          Contains the data necessary for additive force plots.
      """
      plot_cmap = verify_valid_cmap(plot_cmap)
  
      if isinstance(e, AdditiveExplanation):
          if matplotlib:
              return AdditiveForceVisualizer(
                  e, plot_cmap=plot_cmap
              ).matplotlib(
                  figsize=figsize,
                  show=show,
                  text_rotation=text_rotation,
                  min_perc=min_perc,
              )
          else:
              return AdditiveForceVisualizer(e, plot_cmap=plot_cmap)
      elif isinstance(e, Explanation):
          if matplotlib:
              raise ValueError(
                  "Matplotlib plot is only supported for additive explanations"
              )
          return SimpleListVisualizer(e)
      elif (
          isinstance(e, Sequence)
          and len(e) > 0
          and isinstance(e[0], AdditiveExplanation)
      ):
          if matplotlib:
              raise ValueError(
                  "Matplotlib plot is only supported for additive explanations"
              )
          return AdditiveForceArrayVisualizer(
              e,
              plot_cmap=plot_cmap,
              ordering_keys=ordering_keys,
              ordering_keys_time_format=ordering_keys_time_format,
          )
      else:
          raise ValueError(
              "visualize() can only display Explanation objects (or arrays of them)!"
          )
  
imports: import base64
  import json
  import os
  import random
  import re
  import string
  import warnings
  from collections.abc import Sequence
  import numpy
  import pandas
  import scipy.sparse
  from ..plots._force_matplotlib import draw_additive_plot
  from ..utils import hclust_ordering
  from ..utils._exceptions import DimensionError
  from ..utils._legacy import Data, DenseData, Instance, Link, Model, convert_to_link
  from ._labels import labels
label_desc: Use image node_id 8 for calling a global function with example usage: visualize(e, plot_cmap, matplotlib, figsize, show, ordering_keys, ordering_keys_time_format, text_rotation, min_perc) and returns: AdditiveForceVisualizer, AdditiveForceVisualizer, SimpleListVisualizer, AdditiveForceArrayVisualizer