code: def _get_ylim_diagonal(ax):
      """Get the min / max of the ylim for all diagonal plots.
      This is used in _adjust_fig() so the ylim is the same
      for all diagonal plots.
  
      Parameters
      ----------
      ax : `Matplotlib.Axes`
          2-dimensional matrix with Matplotlib Axes objects.
  
      Returns
      -------
      ylim_diagonal : tuple(int)
          The common min and max ylim for the diagonal plots.
  
      """
  
      # Number of search-space dimensions used in this plot.
      if isinstance(ax, (list, np.ndarray)):
          n_dims = len(ax)
          # Get ylim for all diagonal plots.
          ylim = [ax[row, row].get_ylim() for row in range(n_dims)]
      else:
          n_dim = 1
          ylim = [ax.get_ylim()]
  
      # Separate into two lists with low and high ylim.
      ylim_lo, ylim_hi = zip(*ylim)
  
      # Min and max ylim for all diagonal plots.
      ylim_min = np.min(ylim_lo)
      ylim_max = np.max(ylim_hi)
  
      return ylim_min, ylim_max
  
imports: import sys
  import numpy
  from itertools import count
  from functools import partial
  from scipy.optimize import OptimizeResult
  from .acquisition import _gaussian_acquisition
  from skopt import expected_minimum, expected_minimum_random_sampling
  from .space import Categorical
  from collections import Counter
  import matplotlib.pyplot
  from matplotlib.pyplot import cm
  from matplotlib.ticker import LogLocator
  from matplotlib.ticker import MaxNLocator, FuncFormatter
label_desc: Use image node_id 8 for calling a global function with example usage: _get_ylim_diagonal(ax) and returns: ylim_min,  ylim_max