code: def test_equal_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)
          npt.assert_allclose(inv.dot(cov), np.eye(5), atol=1e-10)
          x = floatX(np.random.randn(5))
          pots = [
              quadpotential.quad_potential(cov, False),
              quadpotential.quad_potential(inv, True),
          ]
          if quadpotential.chol_available:
              pots.append(quadpotential.quad_potential(cov, False))
  
          v = np.linalg.solve(cov, x)
          e = 0.5 * x.dot(v)
          for pot in pots:
              v_ = pot.velocity(x)
              e_ = pot.energy(x)
              npt.assert_allclose(v_, v, rtol=1e-4)
              npt.assert_allclose(e_, e, rtol=1e-4)
  
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 5 for calling a global function with example usage: test_equal_dense() without return types