code: def doit(self, **hints):
      if hints.get("deep", True):
          base, exp = (arg.doit(**hints) for arg in self.args)
      else:
          base, exp = self.args
  
      # combine all powers, e.g. (A ** 2) ** 3 -> A ** 6
      while isinstance(base, MatPow):
          exp *= base.args[1]
          base = base.args[0]
  
      if isinstance(base, MatrixBase):
          # Delegate
          return base**exp
  
      # Handle simple cases so that _eval_power() in MatrixExpr sub-classes can ignore them
      if exp == S.One:
          return base
      if exp == S.Zero:
          return Identity(base.rows)
      if exp == S.NegativeOne:
          from sympy.matrices.expressions import Inverse
  
          return Inverse(base).doit(**hints)
  
      eval_power = getattr(base, "_eval_power", None)
      if eval_power is not None:
          return eval_power(exp)
  
      return MatPow(base, exp)
  
imports: from .matexpr import MatrixExpr
  from .special import Identity
  from sympy.core import S
  from sympy.core.expr import ExprBuilder
  from sympy.core.cache import cacheit
  from sympy.core.power import Pow
  from sympy.core.sympify import _sympify
  from sympy.matrices import MatrixBase
  from sympy.matrices.exceptions import NonSquareMatrixError
label_desc: Use image node_id 7 for calling the MatPow obj's underlying member method code with example usage: obj.doit() and returns: MatPow, unknown, base, Identity, Inverse, eval_power