code: def _set_bar_labels(
      info: _ImportancesInfo, fig: "Figure", ax: "Axes", offset: float
  ) -> None:
      renderer = fig.canvas.get_renderer()
      for idx, (val, label) in enumerate(
          zip(info.importance_values, info.importance_labels)
      ):
          text = ax.text(val, idx + offset, label, va="center")
  
          # Sometimes horizontal axis needs to be re-scaled
          # to avoid text going over plot area.
          bbox = text.get_window_extent(renderer)
          bbox = bbox.transformed(ax.transData.inverted())
          _, plot_xmax = ax.get_xlim()
          bbox_xmax = bbox.xmax
  
          if bbox_xmax > plot_xmax:
              ax.set_xlim(xmax=AXES_PADDING_RATIO * bbox_xmax)
  
file_path: optuna/optuna/visualization/matplotlib/_param_importances.py
imports: from __future__ import annotations
  from typing import Callable
  import numpy
  from optuna._experimental import experimental_func
  from optuna.importance._base import BaseImportanceEvaluator
  from optuna.logging import get_logger
  from optuna.study import Study
  from optuna.trial import FrozenTrial
  from optuna.visualization._param_importances import _get_importances_infos
  from optuna.visualization._param_importances import _ImportancesInfo
  from optuna.visualization.matplotlib._matplotlib_imports import _imports
label_desc: Use image node_id 3 for calling a global function with example usage: _set_bar_labels(info, fig, ax, offset) without return types