code: def stemplot_importances(
      df_importances,
      yrot=0,
      label_fontsize=10,
      width=4,
      minheight=1.5,
      vscale=1.0,
      imp_range=(-0.002, 0.15),
      color="#375FA5",
      bgcolor=None,  # seaborn uses '#F1F8FE'
      xtick_precision=2,
      title=None,
  ):
      GREY = "#444443"
      I = df_importances
      unit = 1
  
      imp = I.Importance.values
      mindrop = np.min(imp)
      maxdrop = np.max(imp)
      imp_padding = 0.002
      imp_range = (
          min(imp_range[0], mindrop - imp_padding),
          max(imp_range[1], maxdrop),
      )
  
      barcounts = np.array([f.count("\n") + 1 for f in I.index])
      N = np.sum(barcounts)
      ymax = N * unit
      # print(f"barcounts {barcounts}, N={N}, ymax={ymax}")
      height = max(minheight, ymax * 0.27 * vscale)
  
      plt.close()
      fig = plt.figure(figsize=(width, height))
      ax = plt.gca()
      ax.set_xlim(*imp_range)
      ax.set_ylim(0, ymax)
      ax.spines["top"].set_linewidth(0.3)
      ax.spines["right"].set_linewidth(0.3)
      ax.spines["left"].set_linewidth(0.3)
      ax.spines["bottom"].set_linewidth(0.3)
      if bgcolor:
          ax.set_facecolor(bgcolor)
  
      yloc = []
      y = barcounts[0] * unit / 2
      yloc.append(y)
      for i in range(1, len(barcounts)):
          wprev = barcounts[i - 1]
          w = barcounts[i]
          y += (wprev + w) / 2 * unit
          yloc.append(y)
      yloc = np.array(yloc)
      ax.xaxis.set_major_formatter(
          FormatStrFormatter(f"%.{xtick_precision}f")
      )
      ax.set_xticks([maxdrop, imp_range[1]])
      ax.tick_params(labelsize=label_fontsize, labelcolor=GREY)
      ax.invert_yaxis()  # labels read top-to-bottom
      if title:
          ax.set_title(
              title,
              fontsize=label_fontsize + 1,
              fontname="Arial",
              color=GREY,
          )
  
      plt.hlines(
          y=yloc,
          xmin=imp_range[0],
          xmax=imp,
          lw=barcounts * 1.2,
          color=color,
      )
      for i in range(len(I.index)):
          plt.plot(
              imp[i],
              yloc[i],
              "o",
              color=color,
              markersize=barcounts[i] + 2,
          )
      ax.set_yticks(yloc)
      ax.set_yticklabels(
          I.index, fontdict={"verticalalignment": "center"}
      )
      plt.tick_params(pad=0, axis="y", which="both", left=False)
  
      # rotate y-ticks
      if yrot is not None:
          plt.yticks(rotation=yrot)
  
      plt.tight_layout()
  
      return PimpViz()
  
imports: import pandas
  import numpy
  import matplotlib.pyplot
  import sklearn
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.ensemble import RandomForestRegressor
  from distutils.version import LooseVersion
  from sklearn.model_selection import cross_val_score
  from sklearn.base import clone
  from sklearn.metrics import r2_score
  from sklearn.metrics import f1_score
  from sklearn.preprocessing import LabelEncoder
  from scipy import stats
  from pandas.api.types import is_numeric_dtype
  from matplotlib.colors import ListedColormap
  from matplotlib.ticker import FormatStrFormatter
  from copy import copy
  import warnings
  import tempfile
  from os import getpid, makedirs
label_desc: Use image node_id 15 for calling a global function with example usage: stemplot_importances(df_importances, yrot, label_fontsize, width, minheight, vscale, imp_range, color, bgcolor, xtick_precision, title) and returns: PimpViz