code: def evalf_pow(v: "Pow", prec: int, options) -> TMP_RES:
      target_prec = prec
      base, exp = v.args
  
      # We handle x**n separately. This has two purposes: 1) it is much
      # faster, because we avoid calling evalf on the exponent, and 2) it
      # allows better handling of real/imaginary parts that are exactly zero
      if exp.is_Integer:
          p: int = exp.p  # type: ignore
          # Exact
          if not p:
              return fone, None, prec, None
          # Exponentiation by p magnifies relative error by |p|, so the
          # base must be evaluated with increased precision if p is large
          prec += int(math.log(abs(p), 2))
          result = evalf(base, prec + 5, options)
          if result is S.ComplexInfinity:
              if p < 0:
                  return None, None, None, None
              return result
          re, im, re_acc, im_acc = result
          # Real to integer power
          if re and not im:
              return (
                  mpf_pow_int(re, p, target_prec),
                  None,
                  target_prec,
                  None,
              )
          # (x*I)**n = I**n * x**n
          if im and not re:
              z = mpf_pow_int(im, p, target_prec)
              case = p % 4
              if case == 0:
                  return z, None, target_prec, None
              if case == 1:
                  return None, z, None, target_prec
              if case == 2:
                  return mpf_neg(z), None, target_prec, None
              if case == 3:
                  return None, mpf_neg(z), None, target_prec
          # Zero raised to an integer power
          if not re:
              if p < 0:
                  return S.ComplexInfinity
              return None, None, None, None
          # General complex number to arbitrary integer power
          re, im = libmp.mpc_pow_int((re, im), p, prec)
          # Assumes full accuracy in input
          return finalize_complex(re, im, target_prec)
  
      result = evalf(base, prec + 5, options)
      if result is S.ComplexInfinity:
          if exp.is_Rational:
              if exp < 0:
                  return None, None, None, None
              return result
          raise NotImplementedError
  
      # Pure square root
      if exp is S.Half:
          xre, xim, _, _ = result
          # General complex square root
          if xim:
              re, im = libmp.mpc_sqrt((xre or fzero, xim), prec)
              return finalize_complex(re, im, prec)
          if not xre:
              return None, None, None, None
          # Square root of a negative real number
          if mpf_lt(xre, fzero):
              return None, mpf_sqrt(mpf_neg(xre), prec), None, prec
          # Positive square root
          return mpf_sqrt(xre, prec), None, prec, None
  
      # We first evaluate the exponent to find its magnitude
      # This determines the working precision that must be used
      prec += 10
      result = evalf(exp, prec, options)
      if result is S.ComplexInfinity:
          return fnan, None, prec, None
      yre, yim, _, _ = result
      # Special cases: x**0
      if not (yre or yim):
          return fone, None, prec, None
  
      ysize = fastlog(yre)
      # Restart if too big
      # XXX: prec + ysize might exceed maxprec
      if ysize > 5:
          prec += ysize
          yre, yim, _, _ = evalf(exp, prec, options)
  
      # Pure exponential function; no need to evalf the base
      if base is S.Exp1:
          if yim:
              re, im = libmp.mpc_exp((yre or fzero, yim), prec)
              return finalize_complex(re, im, target_prec)
          return mpf_exp(yre, target_prec), None, target_prec, None
  
      xre, xim, _, _ = evalf(base, prec + 5, options)
      # 0**y
      if not (xre or xim):
          if yim:
              return fnan, None, prec, None
          if yre[0] == 1:  # y < 0
              return S.ComplexInfinity
          return None, None, None, None
  
      # (real ** complex) or (complex ** complex)
      if yim:
          re, im = libmp.mpc_pow(
              (xre or fzero, xim or fzero),
              (yre or fzero, yim),
              target_prec,
          )
          return finalize_complex(re, im, target_prec)
      # complex ** real
      if xim:
          re, im = libmp.mpc_pow_mpf(
              (xre or fzero, xim), yre, target_prec
          )
          return finalize_complex(re, im, target_prec)
      # negative ** real
      elif mpf_lt(xre, fzero):
          re, im = libmp.mpc_pow_mpf((xre, fzero), yre, target_prec)
          return finalize_complex(re, im, target_prec)
      # positive ** real
      else:
          return mpf_pow(xre, yre, target_prec), None, target_prec, None
  
imports: from __future__ import annotations
  from typing import Tuple, Optional, Union, Callable, List, Dict, Type, TYPE_CHECKING, Any, overload
  import math
  import mpmath.libmp
  from mpmath import make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc, workprec
  from mpmath import inf
  from mpmath.libmp import from_int, from_man_exp, from_rational, fhalf, fnan, finf, fninf, fnone, fone, fzero, mpf_abs, mpf_add, mpf_atan, mpf_atan2, mpf_cmp, mpf_cos, mpf_e, mpf_exp, mpf_log, mpf_lt, mpf_mul, mpf_neg, mpf_pi, mpf_pow, mpf_pow_int, mpf_shift, mpf_sin, mpf_sqrt, normalize, round_nearest, to_int, to_str
  from mpmath.libmp import bitcount
  from mpmath.libmp.backend import MPZ
  from mpmath.libmp.libmpc import _infs_nan
  from mpmath.libmp.libmpf import dps_to_prec, prec_to_dps
  from .sympify import sympify
  from .singleton import S
  from sympy.external.gmpy import SYMPY_INTS
  from sympy.utilities.iterables import is_sequence
  from sympy.utilities.lambdify import lambdify
  from sympy.utilities.misc import as_int
label_desc: Use image node_id 26 for calling a global function with example usage: evalf_pow(v, prec, options) and returns: finalize_complex, mpf_sqrt,  None,  prec,  None, fnan,  None,  prec,  None, fone,  None,  prec,  None, mpf_exp,  None,  target_prec,  None, None,  None,  None,  None, finalize_complex, finalize_complex, fone,  None,  prec,  None, result, mpf_pow_int,  None,  target_prec,  None, None,  None,  None,  None, result, finalize_complex, None,  None,  None,  None, None,  mpf_sqrt,  None,  prec, finalize_complex, fnan,  None,  prec,  None, S, finalize_complex, mpf_pow,  None,  target_prec,  None, None,  None,  None,  None, z,  None,  target_prec,  None, None,  z,  None,  target_prec, mpf_neg,  None,  target_prec,  None, None,  mpf_neg,  None,  target_prec, S, None,  None,  None,  None