code: def _check_n_iter(n_iter, param_distributions):
      """
      Check if n_iter is greater than the total number
      of possible param sets from the given distribution.
      """
      all_lists = np.all(
          [not hasattr(v, "rvs") for v in param_distributions.values()]
      )
      if all_lists:
          param_grid = ParameterGrid(param_distributions)
          grid_size = len(param_grid)
      else:
          grid_size = n_iter
      return min(grid_size, n_iter)
  
imports: import numbers
  import numpy
  from itertools import compress
  from scipy.sparse import issparse
  from sklearn.model_selection import ParameterGrid
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 8 for calling a global function with example usage: _check_n_iter(n_iter, param_distributions) and returns: min