code: def _do_transposes_cancel(perm1, perm2):
      if len(perm1) != len(perm2):
          return False
      x = list(range(len(perm1)))
      x1 = [x[i] for i in perm1]
      x2 = [x1[i] for i in perm2]
      if x == x2:
          return True
      return False
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.var import Var
  import logging
  import numpy
  import copy
  from collections import defaultdict
label_desc: Use image node_id 1 for calling a global function with example usage: _do_transposes_cancel(perm1, perm2) and returns: False, False, True