code: def horizontal(values, labels=None, sort=True, error=None, ax=None):
      """Plots a horizontal bar given a list of values
  
      Examples
      --------
      >>> import matplotlib.pyplot as plt
      >>> import numpy as np
      >>> from sklearn_evaluation.plot.matplotlib import bar
      >>> values = np.arange(10)
      >>> ax = bar.horizontal(values)
  
      Notes
      -----
      https://matplotlib.org/gallery/lines_bars_and_markers/barh.html
  
      """
      if sort:
          idx_sorted = np.argsort(values)
          values = values[idx_sorted]
  
          if labels is not None:
              labels = labels[idx_sorted]
  
      if ax is None:
          ax = plt.gca()
  
      y_pos = np.arange(len(values))
  
      if error is None:
          ax.barh(y_pos, values)
      else:
          ax.barh(y_pos, values, xerr=error)
  
      ax.set_yticks(y_pos)
      ax.set_yticklabels(y_pos if labels is None else labels)
      ax.invert_yaxis()
      ax.set_ylim([-1, len(values)])
      ax.grid(axis="x")
      # ax.figure.tight_layout()
  
      return ax
  
file_path: sklearn-evaluation/src/sklearn_evaluation/plot/matplotlib/bar.py
imports: import numpy
  import matplotlib.pyplot
  from sklearn_evaluation.plot.matplotlib.data_grid import DataGrid
  from sklearn_evaluation.plot.util import set_default_ax
label_desc: Use image node_id 2 for calling a global function with example usage: horizontal(values, labels, sort, error, ax) and returns: ax