code: def test_statistics_two_components():
      """
      Assert that online lda extracts waited statistics on current document.
      """
      n_components = 2
  
      lda = preprocessing.LDA(
          n_components, number_of_documents=60, seed=42
      )
  
      statistics_list = []
  
      for doc in DOC_SET:
          word_list = doc.split(" ")
  
          lda._update_indexes(word_list=word_list)
  
          word_indexes = [lda.word_to_index[word] for word in word_list]
  
          statistics, _ = lda._compute_statistics_components(
              words_indexes_list=word_indexes
          )
  
          statistics_list.append(statistics)
  
          lda._update_weights(statistics=statistics)
  
      for index, statistics in enumerate(statistics_list):
          for component in range(n_components):
              assert np.array_equal(
                  a1=statistics[component],
                  a2=REFERENCE_STATISTICS_TWO_COMPONENTS[index][
                      component
                  ],
              )
  
file_path: river/river/preprocessing/test_lda.py
imports: from __future__ import annotations
  import numpy
  from river import preprocessing
label_desc: Use image node_id 2 for calling a global function with example usage: test_statistics_two_components() without return types