code: def test_random_sparse_matrix_returns_correct_number_of_non_zero_elements(
      self,
  ):
      # A 10 x 10 matrix, with density of 12.65%, should have 13 nonzero elements.
      # 10 x 10 x 0.1265 = 12.65, which should be rounded up to 13, not 12.
      sparse_matrix = construct.random(10, 10, density=0.1265)
      assert_equal(sparse_matrix.count_nonzero(), 13)
  
imports: import numpy
  from numpy import array
  from numpy.testing import assert_equal, assert_, assert_array_equal, assert_array_almost_equal_nulp
  import pytest
  from pytest import raises
  from scipy._lib._testutils import check_free_memory
  from scipy._lib._util import check_random_state
  from scipy.sparse import csr_matrix, coo_matrix, construct
  from scipy.sparse.construct import rand
  from scipy.sparse.sputils import matrix
label_desc: Use image node_id 28 for calling the TestConstructUtils obj's underlying member method code with example usage: obj.test_random_sparse_matrix_returns_correct_number_of_non_zero_elements() without return types