code: def _evenly_sample(dim, n_points):
      """Return `n_points` evenly spaced points from a Dimension.
  
      Parameters
      ----------
      dim : `Dimension`
          The Dimension to sample from.  Can be categorical; evenly-spaced
          category indices are chosen in order without replacement (result
          may be smaller than `n_points`).
  
      n_points : int
          The number of points to sample from `dim`.
  
      Returns
      -------
      xi : np.array
          The sampled points in the Dimension.  For Categorical
          dimensions, returns the index of the value in
          `dim.categories`.
  
      xi_transformed : np.array
          The transformed values of `xi`, for feeding to a model.
      """
      cats = np.array(getattr(dim, "categories", []), dtype=object)
      if len(cats):  # Sample categoricals while maintaining order
          xi = np.linspace(
              0, len(cats) - 1, min(len(cats), n_points), dtype=int
          )
          xi_transformed = dim.transform(cats[xi])
      else:
          bounds = dim.bounds
          # XXX use linspace(*bounds, n_points) after python2 support ends
          xi = np.linspace(bounds[0], bounds[1], n_points)
          xi_transformed = dim.transform(xi)
      return xi, xi_transformed
  
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 14 for calling a global function with example usage: _evenly_sample(dim, n_points) and returns: xi,  xi_transformed