code: def test_sparse_and_verbose(csc_container):
      # Make sure RBM works with sparse input when verbose=True
      old_stdout = sys.stdout
      sys.stdout = StringIO()
  
      X = csc_container([[0.0], [1.0]])
      rbm = BernoulliRBM(
          n_components=2,
          batch_size=2,
          n_iter=1,
          random_state=42,
          verbose=True,
      )
      try:
          rbm.fit(X)
          s = sys.stdout.getvalue()
          # make sure output is sound
          assert re.match(
              r"\[BernoulliRBM\] Iteration 1,"
              r" pseudo-likelihood = -?(\d)+(\.\d+)?,"
              r" time = (\d|\.)+s",
              s,
          )
      finally:
          sys.stdout = old_stdout
  
imports: import re
  import sys
  from io import StringIO
  import numpy
  import pytest
  from sklearn.datasets import load_digits
  from sklearn.neural_network import BernoulliRBM
  from sklearn.utils._testing import assert_allclose, assert_almost_equal, assert_array_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS, LIL_CONTAINERS
  from sklearn.utils.validation import assert_all_finite
label_desc: Use image node_id 11 for calling a global function with example usage: test_sparse_and_verbose(csc_container) without return types