code: def is_canonical(perm, col):
      # if it's a new group
      if len(perm) % 4 == 0:
          # every column ID < col needs to be in the permutation already
          for val in range(col):
              if val not in perm:
                  return False
          # this new group needs to be sorted w.r.t. the previous group
          return col > perm[-4]
  
      # not a new group, just check to see if it will still be sorted
      return col > perm[-1]
  
file_path: apex/apex/contrib/sparsity/permutation_search_kernels/exhaustive_search.py
imports: from .permutation_utilities import *
  import pickle
  import os.path
  from os import path
  import math
label_desc: Use image node_id 1 for calling a global function with example usage: is_canonical(perm, col) and returns: unknown, unknown, False