code: def common_groups(A, B):
      Ag = make_grouped(A)
      Bg = make_grouped(B)
  
      # convert to sets to take the intersection
      As = set(tuple(Ag[g]) for g in range(len(Ag)))
      Bs = set(tuple(Bg[g]) for g in range(len(Bg)))
      common = As.intersection(Bs)
  
      # flatten
      C = []
      for s in common:
          for v in s:
              C.append(v)
  
      # group
      return make_grouped(C)
  
imports: import numpy
  import time
  import subprocess
  import math
label_desc: Use image node_id 11 for calling a global function with example usage: common_groups(A, B) and returns: make_grouped