code: def test_random_dense():
      np.random.seed(42)
      for _ in range(3):
          cov = np.random.rand(5, 5)
          cov += cov.T
          cov += 10 * np.eye(5)
          inv = np.linalg.inv(cov)
          assert np.allclose(inv.dot(cov), np.eye(5))
  
          pots = [
              quadpotential.QuadPotentialFull(cov),
              quadpotential.QuadPotentialFullInv(inv),
          ]
          if quadpotential.chol_available:
              pot = quadpotential.QuadPotential_Sparse(
                  scipy.sparse.csc_matrix(cov)
              )
              pots.append(pot)
          for pot in pots:
              cov_ = np.cov(
                  np.array([pot.random() for _ in range(1000)]).T
              )
              assert np.allclose(cov_, inv, atol=0.1)
  
imports: import warnings
  import numpy
  import numpy.testing
  import pytest
  import scipy.sparse
  import pymc
  from pymc.pytensorf import floatX
  from pymc.step_methods.hmc import quadpotential
label_desc: Use image node_id 7 for calling a global function with example usage: test_random_dense() without return types