code: def test_functions():
      x, P = predict(x=10.0, P=3.0, u=1.0, Q=2.0**2)
      x, P = update(x=x, P=P, z=12.0, R=3.5**2)
  
      x, P = predict(
          x=np.array([10.0]), P=np.array([[3.0]]), Q=2.0**2
      )
      x, P = update(
          x=x,
          P=P,
          z=12.0,
          H=np.array([[1.0]]),
          R=np.array([[3.5**2]]),
      )
  
      x = np.array([1.0, 0])
      P = np.diag([1.0, 1])
      Q = np.diag([0.0, 0])
      H = np.array([[1.0, 0]])
  
      x, P = predict(x=x, P=P, Q=Q)
  
      assert x.shape == (2,)
      assert P.shape == (2, 2)
  
      x, P = update(x, P, z=[1], R=np.array([[1.0]]), H=H)
  
      assert x[0] == 1 and x[1] == 0
  
      # test velocity predictions
      x, P = predict(x=x, P=P, Q=Q)
      assert x[0] == 1 and x[1] == 0
  
      x[1] = 1.0
      F = np.array([[1.0, 1], [0, 1]])
  
      x, P = predict(x=x, F=F, P=P, Q=Q)
      assert x[0] == 2 and x[1] == 1
  
      x, P = predict(x=x, F=F, P=P, Q=Q)
      assert x[0] == 3 and x[1] == 1
  
imports: from __future__ import absolute_import, division, print_function
  import numpy.random
  from numpy.random import randn
  import numpy
  import matplotlib.pyplot
  from pytest import approx
  from filterpy.kalman import KalmanFilter, update, predict, batch_filter
  from filterpy.common import Q_discrete_white_noise, kinematic_kf, Saver
  from filterpy.stats import mahalanobis
  from scipy.linalg import block_diag, norm
label_desc: Use image node_id 16 for calling a global function with example usage: test_functions() without return types