code: def test_lda_dense_input(csr_container):
      # Test LDA with dense input.
      rng = np.random.RandomState(0)
      n_components, X = _build_sparse_array(csr_container)
      lda = LatentDirichletAllocation(
          n_components=n_components,
          learning_method="batch",
          random_state=rng,
      )
      lda.fit(X.toarray())
  
      correct_idx_grps = [(0, 1, 2), (3, 4, 5), (6, 7, 8)]
      for component in lda.components_:
          # Find top 3 words in each LDA component
          top_idx = set(component.argsort()[-3:][::-1])
          assert tuple(sorted(top_idx)) in correct_idx_grps
  
imports: import sys
  from io import StringIO
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from scipy.linalg import block_diag
  from scipy.special import psi
  from sklearn.decomposition import LatentDirichletAllocation
  from sklearn.decomposition._online_lda_fast import _dirichlet_expectation_1d, _dirichlet_expectation_2d
  from sklearn.exceptions import NotFittedError
  from sklearn.utils._testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, if_safe_multiprocessing_with_blas
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 6 for calling a global function with example usage: test_lda_dense_input(csr_container) without return types