code: def main_plot_histogram(trials, bandit=None, algo=None, do_show=True):
      # -- import here because file-level import is too early
      import matplotlib.pyplot as plt
  
      status_colors = default_status_colors
      Xs, Ys, Ss, Cs = zip(
          *[
              (x, y, s, status_colors[s])
              for (x, y, s) in zip(
                  trials.specs,
                  trials.losses(bandit),
                  trials.statuses(bandit),
              )
              if y is not None
          ]
      )
  
      # XXX: deal with ok vs. un-finished vs. error trials
      print("Showing Histogram of %i jobs" % len(Ys))
      plt.hist(Ys)
      plt.xlabel("loss")
      plt.ylabel("frequency")
  
      plt.title(
          "bandit: %s algo: %s"
          % (bandit.short_str() if bandit else "-", algo_as_str(algo))
      )
      if do_show:
          plt.show()
  
file_path: auptimizer/src/aup/Proposer/hyperopt/plotting.py
imports: from __future__ import print_function
  import math
  import sys
  from past.builtins import xrange
  from hyperopt.mongoexp import MongoJobs
  import numpy
  from .None import base
  from .base import miscs_to_idxs_vals
label_desc: Use image node_id 3 for calling a global function with example usage: main_plot_histogram(trials, bandit, algo, do_show) without return types