code: def remove_common_groups(A, B):
      Ag = make_grouped(A)
      Bg = make_grouped(B)
  
      # convert to sets to take set difference
      As = set(tuple(Ag[g]) for g in range(len(Ag)))
      Bs = set(tuple(Bg[g]) for g in range(len(Bg)))
      Ad = As - Bs
      Bd = Bs - As
  
      # turn the differences back into flat arrays
      A = []
      for s in Ad:
          for v in s:
              A.append(v)
      B = []
      for s in Bd:
          for v in s:
              B.append(v)
  
      # group to put into canonical order, re-flatten
      A = make_grouped(A)
      B = make_grouped(B)
      A = [item for sublist in A for item in sublist]
      B = [item for sublist in B for item in sublist]
  
      return A, B
  
imports: import numpy
  import time
  import subprocess
  import math
label_desc: Use image node_id 12 for calling a global function with example usage: remove_common_groups(A, B) and returns: A,  B