code: def h5_hist_data(filename, epoch_axis=True):
      """
      Read histogram data from hdf5 file. Generate x axis data for each hist line.
  
      Arguments:
          filename (str): Filename with hdf5 cost data
          epoch_axis (bool): whether to render epoch or minibatch as the integer step in the x axis
  
      Returns:
          list of tuples of (name, data, dh, dw, bins, offset)
      """
      ret = list()
      with h5py.File(filename, "r") as f:
          if "hist" in f:
              hists, config = [f[x] for x in ["hist", "config"]]
              bins, offset, time_markers = [
                  hists.attrs[x]
                  for x in ["bins", "offset", "time_markers"]
              ]
              total_epochs = config.attrs["total_epochs"]
              total_minibatches = config.attrs["total_minibatches"]
  
              for hname, hdata in hists.items():
                  dw = (
                      total_epochs
                      if (time_markers == "epoch_freq")
                      else total_minibatches
                  )
                  dh = bins
                  ret.append((hname, hdata[...], dh, dw, bins, offset))
  
      return ret
  
file_path: neon/neon/visualizations/data.py
imports: from __future__ import division
  from builtins import str
  import h5py
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: h5_hist_data(filename, epoch_axis) and returns: ret