code: def test_saver_ekf():
      def HJ(x):
          return np.array([[1, 1]])
  
      def hx(x):
          return np.array([x[0]])
  
      kf = ExtendedKalmanFilter(2, 1)
      s = Saver(kf)
  
      for i in range(3):
          kf.predict()
          kf.update([[i]], HJ, hx)
          s.save()
  
      # this will assert if the KalmanFilter did not properly assert
      s.to_array()
      assert len(s.x) == 3
      assert len(s.y) == 3
      assert len(s.K) == 3
  
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 4 for calling a global function with example usage: test_saver_ekf() and returns: np, np