code: def compare_kf(kf1, kf2, log=True, **kwargs):
      """Compare two Kalman filters.
  
      For each variable each object has in common (x, P, S, K, etc) compare
      them using np.allclose().
  
      Prints a report if `log` is true, and returns a list of names if any
      are different, otherwise prints nothing and returns None.
      """
  
      # get variables common to both objects
      v1, v2 = vars(kf1), vars(kf2)
      k1, k2 = set(v1.keys()), set(v2.keys())
      attrs = k2.intersection(k1)
  
      different_keys = []
      for attr in attrs:
          if attr[0] == "_":
              continue
  
          if not np.allclose(v1[attr], v2[attr], **kwargs):
              if log:
                  print(attr, "is different")
                  print(pretty_str(attr, v1[attr]))
                  print(pretty_str(attr, v2[attr]))
                  print()
              different_keys.append(attr)
  
      if len(different_keys) > 0:
          return different
      else:
          return None
  
imports: from __future__ import print_function
  from collections import defaultdict, deque
  import copy
  import inspect
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: compare_kf(kf1, kf2, log) and returns: different, None