code: def _histogram_bins(num_bins):
      """
      Helper function to generate the histogram bins used to calculate the error
      histogram of the information gain.
  
      Parameters
      ----------
      num_bins : int
          Number of histogram bins.
      Returns
      -------
      numpy array
          Histogram bin edges.
  
      Notes
      -----
      This functions returns the bin edges for a histogram with one more bin than
      the requested number of bins, because the fist and last bins are added
      together (to make the histogram circular) later on. Because of the same
      reason, the first and the last bin are only half as wide as the others.
  
      """
      # allow only even numbers and require at least 2 bins
      if num_bins % 2 != 0 or num_bins < 2:
          # Note: because of the implementation details of the histogram, the
          #       easiest way to make sure the an error of 0 is always mapped
          #       to the centre bin is to enforce an even number of bins
          raise ValueError(
              "Number of error histogram bins must be even and "
              "greater than 0"
          )
      # since np.histogram accepts a sequence of bin edges we just increase the
      # number of bins by 1, but we need to apply offset
      offset = 0.5 / num_bins
      # because the histogram is made circular by adding the last bin to the
      # first one before being removed, increase the number of bins by 2
      return np.linspace(-0.5 - offset, 0.5 + offset, num_bins + 2)
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  from functools import wraps
  import numpy
  from .None import MeanEvaluation, calc_absolute_errors, calc_errors, evaluation_io, find_closest_matches
  from .onsets import OnsetEvaluation
label_desc: Use image node_id 13 for calling a global function with example usage: _histogram_bins(num_bins) and returns: np