code: def kinematic_state_transition(order, dt):
      """
      create a state transition matrix of a given order for a given time
      step `dt`.
      """
  
      if not (order >= 0 and int(order) == order):
          raise ValueError("order must be an int >= 0")
  
      # hard code common cases for computational efficiency
      if order == 0:
          return np.array([[1.0]])
      if order == 1:
          return np.array([[1.0, dt], [0.0, 1.0]])
      if order == 2:
          return np.array(
              [
                  [1.0, dt, 0.5 * dt * dt],
                  [0.0, 1.0, dt],
                  [0.0, 0.0, 1.0],
              ]
          )
  
      # grind it out computationally....
      N = order + 1
  
      F = np.zeros((N, N))
      # compute highest order row
      for n in range(N):
          F[0, n] = float(dt**n) / math.factorial(n)
  
      # copy with a shift to get lower order rows
      for j in range(1, N):
          F[j, j:] = F[0, 0:-j]
  
      return F
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import math
  import numpy
  from scipy.linalg import block_diag
label_desc: Use image node_id 1 for calling a global function with example usage: kinematic_state_transition(order, dt) and returns: F, np, np, np