code: def test_n_components_none():
      # Ensures that n_components == None is handled correctly
      rng = np.random.RandomState(1999)
      for n_samples, n_features in [(50, 10), (10, 50)]:
          X = rng.rand(n_samples, n_features)
          ipca = IncrementalPCA(n_components=None)
  
          # First partial_fit call, ipca.n_components_ is inferred from
          # min(X.shape)
          ipca.partial_fit(X)
          assert ipca.n_components_ == min(X.shape)
  
          # Second partial_fit call, ipca.n_components_ is inferred from
          # ipca.components_ computed from the first partial_fit call
          ipca.partial_fit(X)
          assert ipca.n_components_ == ipca.components_.shape[0]
  
imports: import warnings
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn import datasets
  from sklearn.decomposition import PCA, IncrementalPCA
  from sklearn.utils._testing import assert_allclose_dense_sparse, assert_almost_equal, assert_array_almost_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS, LIL_CONTAINERS
label_desc: Use image node_id 7 for calling a global function with example usage: test_n_components_none() without return types