code: def kmeans_inducing_points(n_inducing, X, **kmeans_kwargs):
      R"""
      Use the K-means algorithm to initialize the locations `X` for the inducing
      points `fu`.
  
      Parameters
      ----------
      n_inducing: int
          The number of inducing points (or k, the number of clusters)
      X: array-like
          Gaussian process input matrix.
      **kmeans_kwargs:
          Extra keyword arguments that are passed to `scipy.cluster.vq.kmeans`
      """
      # first whiten X
      if isinstance(X, TensorConstant):
          X = X.value
      elif isinstance(X, (np.ndarray, tuple, list)):
          X = np.asarray(X)
      else:
          raise TypeError(
              "To use K-means initialization, "
              "please provide X as a type that "
              "can be cast to np.ndarray, instead "
              f"of {type(X)}"
          )
      scaling = np.std(X, 0)
      # if std of a column is very small (zero), don't normalize that column
      scaling[scaling <= 1e-6] = 1.0
      Xw = X / scaling
  
      if "k_or_guess" in kmeans_kwargs:
          warnings.warn(
              "Use `n_inducing` to set the `k_or_guess` parameter instead."
          )
  
      Xu, distortion = kmeans(
          Xw, k_or_guess=n_inducing, **kmeans_kwargs
      )
      return Xu * scaling
  
file_path: pymc/pymc/gp/util.py
imports: import warnings
  import numpy
  import pytensor.tensor
  from pytensor.compile import SharedVariable
  from pytensor.graph import ancestors
  from pytensor.tensor.variable import TensorConstant
  from scipy.cluster.vq import kmeans
  from pymc.distributions.distribution import Distribution
  from pymc.model import modelcontext
  from pymc.pytensorf import compile_pymc
label_desc: Use image node_id 3 for calling a global function with example usage: kmeans_inducing_points(n_inducing, X) and returns: unknown