code: def test_inv_diagonal():
      for i in range(10000):
          n = np.random.randint(1, 50)
          if i == 0:
              n = 1  # test 1x1 matrix as special case
  
          S = np.diag(np.random.randn(n))
  
          assert np.allclose(inv_diagonal(S), np.linalg.inv(S))
  
file_path: filterpy/filterpy/common/tests/test_helpers.py
imports: from filterpy.common import kinematic_kf, Saver, inv_diagonal, outer_product_sum
  import numpy
  from filterpy.kalman import MerweScaledSigmaPoints, UnscentedKalmanFilter, ExtendedKalmanFilter
label_desc: Use image node_id 5 for calling a global function with example usage: test_inv_diagonal() without return types