code: def _check_X(X, n_components=None, n_features=None):
      """Check the input data X.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
  
      n_components : int
  
      Returns
      -------
      X : array, shape (n_samples, n_features)
      """
      X = check_array(X, dtype=[np.float64, np.float32])
      if n_components is not None and X.shape[0] < n_components:
          raise ValueError(
              "Expected n_samples >= n_components "
              "but got n_components = %d, n_samples = %d"
              % (n_components, X.shape[0])
          )
      if n_features is not None and X.shape[1] != n_features:
          raise ValueError(
              "Expected the input data X have %d features, "
              "but got %d features" % (n_features, X.shape[1])
          )
      return X
  
imports: from __future__ import print_function
  import warnings
  from abc import ABCMeta, abstractmethod
  from time import time
  import numpy
  from ..None import cluster
  from ..base import BaseEstimator
  from ..base import DensityMixin
  from ..externals import six
  from ..exceptions import ConvergenceWarning
  from ..utils import check_array, check_random_state
  from ..utils.extmath import logsumexp
label_desc: Use image node_id 2 for calling a global function with example usage: _check_X(X, n_components, n_features) and returns: X