code: def _kronecker_dims_key(expr):
      if isinstance(expr, KroneckerProduct):
          return tuple(a.shape for a in expr.args)
      else:
          return (0,)
  
imports: from functools import reduce
  from math import prod
  from sympy.core import Mul, sympify
  from sympy.functions import adjoint
  from sympy.matrices.exceptions import ShapeError
  from sympy.matrices.expressions.matexpr import MatrixExpr
  from sympy.matrices.expressions.transpose import transpose
  from sympy.matrices.expressions.special import Identity
  from sympy.matrices.matrixbase import MatrixBase
  from sympy.strategies import canon, condition, distribute, do_one, exhaust, flatten, typed, unpack
  from sympy.strategies.traverse import bottom_up
  from sympy.utilities import sift
  from .matadd import MatAdd
  from .matmul import MatMul
  from .matpow import MatPow
label_desc: Use image node_id 6 for calling a global function with example usage: _kronecker_dims_key(expr) and returns: tuple, int