code: def __init__(ctx, prec=53, dps=None, tol=None, real=False):
      ctx._prec_rounding = [prec, round_nearest]
  
      if dps is None:
          ctx._set_prec(prec)
      else:
          ctx._set_dps(dps)
  
      ctx.mpf = RealElement
      ctx.mpc = ComplexElement
      ctx.mpf._ctxdata = [ctx.mpf, new, ctx._prec_rounding]
      ctx.mpc._ctxdata = [ctx.mpc, new, ctx._prec_rounding]
  
      if real:
          ctx.mpf.context = ctx
      else:
          ctx.mpc.context = ctx
  
      ctx.constant = _constant
      ctx.constant._ctxdata = [ctx.mpf, new, ctx._prec_rounding]
      ctx.constant.context = ctx
  
      ctx.types = [ctx.mpf, ctx.mpc, ctx.constant]
      ctx.trap_complex = True
      ctx.pretty = True
  
      if tol is None:
          ctx.tol = ctx._make_tol()
      elif tol is False:
          ctx.tol = fzero
      else:
          ctx.tol = ctx._convert_tol(tol)
  
      ctx.tolerance = ctx.make_mpf(ctx.tol)
  
      if not ctx.tolerance:
          ctx.max_denom = 1000000
      else:
          ctx.max_denom = int(1 / ctx.tolerance)
  
      ctx.zero = ctx.make_mpf(fzero)
      ctx.one = ctx.make_mpf(fone)
      ctx.j = ctx.make_mpc((fzero, fone))
      ctx.inf = ctx.make_mpf(finf)
      ctx.ninf = ctx.make_mpf(fninf)
      ctx.nan = ctx.make_mpf(fnan)
  
imports: from sympy.external.gmpy import MPQ
  from sympy.polys.domains.domainelement import DomainElement
  from sympy.utilities import public
  from mpmath.ctx_mp_python import PythonMPContext, _mpf, _mpc, _constant
  from mpmath.libmp import MPZ_ONE, fzero, fone, finf, fninf, fnan, round_nearest, mpf_mul, repr_dps, int_types, from_int, from_float, from_str, to_rational
label_desc: Use image node_id 1 to create a new MPContext object from inherited base classes: PythonMPContext with example: obj = MPContext(ctx, prec, dps, tol, real)