class_docstr: Context for multiprecision arithmetic with a global precision.
class_docstr_tok: ["Context","for","multiprecision","arithmetic","with","a","global","precision","."]
code: def init_builtins(ctx):
      mpf = ctx.mpf
      mpc = ctx.mpc
  
      # Exact constants
      ctx.one = ctx.make_mpf(fone)
      ctx.zero = ctx.make_mpf(fzero)
      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)
  
      eps = ctx.constant(
          lambda prec, rnd: (0, MPZ_ONE, 1 - prec, 1),
          "epsilon of working precision",
          "eps",
      )
      ctx.eps = eps
  
      # Approximate constants
      ctx.pi = ctx.constant(mpf_pi, "pi", "pi")
      ctx.ln2 = ctx.constant(mpf_ln2, "ln(2)", "ln2")
      ctx.ln10 = ctx.constant(mpf_ln10, "ln(10)", "ln10")
      ctx.phi = ctx.constant(mpf_phi, "Golden ratio phi", "phi")
      ctx.e = ctx.constant(mpf_e, "e = exp(1)", "e")
      ctx.euler = ctx.constant(mpf_euler, "Euler's constant", "euler")
      ctx.catalan = ctx.constant(
          mpf_catalan, "Catalan's constant", "catalan"
      )
      ctx.khinchin = ctx.constant(
          mpf_khinchin, "Khinchin's constant", "khinchin"
      )
      ctx.glaisher = ctx.constant(
          mpf_glaisher, "Glaisher's constant", "glaisher"
      )
      ctx.apery = ctx.constant(mpf_apery, "Apery's constant", "apery")
      ctx.degree = ctx.constant(
          mpf_degree, "1 deg = pi / 180", "degree"
      )
      ctx.twinprime = ctx.constant(
          mpf_twinprime, "Twin prime constant", "twinprime"
      )
      ctx.mertens = ctx.constant(
          mpf_mertens, "Mertens' constant", "mertens"
      )
  
      # Standard functions
      ctx.sqrt = ctx._wrap_libmp_function(
          libmp.mpf_sqrt, libmp.mpc_sqrt
      )
      ctx.cbrt = ctx._wrap_libmp_function(
          libmp.mpf_cbrt, libmp.mpc_cbrt
      )
      ctx.ln = ctx._wrap_libmp_function(libmp.mpf_log, libmp.mpc_log)
      ctx.atan = ctx._wrap_libmp_function(
          libmp.mpf_atan, libmp.mpc_atan
      )
      ctx.exp = ctx._wrap_libmp_function(libmp.mpf_exp, libmp.mpc_exp)
      ctx.expj = ctx._wrap_libmp_function(
          libmp.mpf_expj, libmp.mpc_expj
      )
      ctx.expjpi = ctx._wrap_libmp_function(
          libmp.mpf_expjpi, libmp.mpc_expjpi
      )
      ctx.sin = ctx._wrap_libmp_function(libmp.mpf_sin, libmp.mpc_sin)
      ctx.cos = ctx._wrap_libmp_function(libmp.mpf_cos, libmp.mpc_cos)
      ctx.tan = ctx._wrap_libmp_function(libmp.mpf_tan, libmp.mpc_tan)
      ctx.sinh = ctx._wrap_libmp_function(
          libmp.mpf_sinh, libmp.mpc_sinh
      )
      ctx.cosh = ctx._wrap_libmp_function(
          libmp.mpf_cosh, libmp.mpc_cosh
      )
      ctx.tanh = ctx._wrap_libmp_function(
          libmp.mpf_tanh, libmp.mpc_tanh
      )
      ctx.asin = ctx._wrap_libmp_function(
          libmp.mpf_asin, libmp.mpc_asin
      )
      ctx.acos = ctx._wrap_libmp_function(
          libmp.mpf_acos, libmp.mpc_acos
      )
      ctx.atan = ctx._wrap_libmp_function(
          libmp.mpf_atan, libmp.mpc_atan
      )
      ctx.asinh = ctx._wrap_libmp_function(
          libmp.mpf_asinh, libmp.mpc_asinh
      )
      ctx.acosh = ctx._wrap_libmp_function(
          libmp.mpf_acosh, libmp.mpc_acosh
      )
      ctx.atanh = ctx._wrap_libmp_function(
          libmp.mpf_atanh, libmp.mpc_atanh
      )
      ctx.sinpi = ctx._wrap_libmp_function(
          libmp.mpf_sin_pi, libmp.mpc_sin_pi
      )
      ctx.cospi = ctx._wrap_libmp_function(
          libmp.mpf_cos_pi, libmp.mpc_cos_pi
      )
      ctx.floor = ctx._wrap_libmp_function(
          libmp.mpf_floor, libmp.mpc_floor
      )
      ctx.ceil = ctx._wrap_libmp_function(
          libmp.mpf_ceil, libmp.mpc_ceil
      )
      ctx.nint = ctx._wrap_libmp_function(
          libmp.mpf_nint, libmp.mpc_nint
      )
      ctx.frac = ctx._wrap_libmp_function(
          libmp.mpf_frac, libmp.mpc_frac
      )
      ctx.fib = ctx.fibonacci = ctx._wrap_libmp_function(
          libmp.mpf_fibonacci, libmp.mpc_fibonacci
      )
  
      ctx.gamma = ctx._wrap_libmp_function(
          libmp.mpf_gamma, libmp.mpc_gamma
      )
      ctx.rgamma = ctx._wrap_libmp_function(
          libmp.mpf_rgamma, libmp.mpc_rgamma
      )
      ctx.loggamma = ctx._wrap_libmp_function(
          libmp.mpf_loggamma, libmp.mpc_loggamma
      )
      ctx.fac = ctx.factorial = ctx._wrap_libmp_function(
          libmp.mpf_factorial, libmp.mpc_factorial
      )
  
      ctx.digamma = ctx._wrap_libmp_function(
          libmp.mpf_psi0, libmp.mpc_psi0
      )
      ctx.harmonic = ctx._wrap_libmp_function(
          libmp.mpf_harmonic, libmp.mpc_harmonic
      )
      ctx.ei = ctx._wrap_libmp_function(libmp.mpf_ei, libmp.mpc_ei)
      ctx.e1 = ctx._wrap_libmp_function(libmp.mpf_e1, libmp.mpc_e1)
      ctx._ci = ctx._wrap_libmp_function(libmp.mpf_ci, libmp.mpc_ci)
      ctx._si = ctx._wrap_libmp_function(libmp.mpf_si, libmp.mpc_si)
      ctx.ellipk = ctx._wrap_libmp_function(
          libmp.mpf_ellipk, libmp.mpc_ellipk
      )
      ctx._ellipe = ctx._wrap_libmp_function(
          libmp.mpf_ellipe, libmp.mpc_ellipe
      )
      ctx.agm1 = ctx._wrap_libmp_function(
          libmp.mpf_agm1, libmp.mpc_agm1
      )
      ctx._erf = ctx._wrap_libmp_function(libmp.mpf_erf, None)
      ctx._erfc = ctx._wrap_libmp_function(libmp.mpf_erfc, None)
      ctx._zeta = ctx._wrap_libmp_function(
          libmp.mpf_zeta, libmp.mpc_zeta
      )
      ctx._altzeta = ctx._wrap_libmp_function(
          libmp.mpf_altzeta, libmp.mpc_altzeta
      )
  
      # Faster versions
      ctx.sqrt = getattr(ctx, "_sage_sqrt", ctx.sqrt)
      ctx.exp = getattr(ctx, "_sage_exp", ctx.exp)
      ctx.ln = getattr(ctx, "_sage_ln", ctx.ln)
      ctx.cos = getattr(ctx, "_sage_cos", ctx.cos)
      ctx.sin = getattr(ctx, "_sage_sin", ctx.sin)
  
imports: import functools
  import re
  from .ctx_base import StandardBaseContext
  from .libmp.backend import basestring, BACKEND
  from .None import libmp
  from .libmp import MPZ, MPZ_ZERO, MPZ_ONE, int_types, repr_dps, round_floor, round_ceiling, dps_to_prec, round_nearest, prec_to_dps, ComplexResult, to_pickable, from_pickable, normalize, from_int, from_float, from_str, to_int, to_float, to_str, from_rational, from_man_exp, fone, fzero, finf, fninf, fnan, mpf_abs, mpf_pos, mpf_neg, mpf_add, mpf_sub, mpf_mul, mpf_mul_int, mpf_div, mpf_rdiv_int, mpf_pow_int, mpf_mod, mpf_eq, mpf_cmp, mpf_lt, mpf_gt, mpf_le, mpf_ge, mpf_hash, mpf_rand, mpf_sum, bitcount, to_fixed, mpc_to_str, mpc_to_complex, mpc_hash, mpc_pos, mpc_is_nonzero, mpc_neg, mpc_conjugate, mpc_abs, mpc_add, mpc_add_mpf, mpc_sub, mpc_sub_mpf, mpc_mul, mpc_mul_mpf, mpc_mul_int, mpc_div, mpc_div_mpf, mpc_pow, mpc_pow_mpf, mpc_pow_int, mpc_mpf_div, mpf_pow, mpf_pi, mpf_degree, mpf_e, mpf_phi, mpf_ln2, mpf_ln10, mpf_euler, mpf_catalan, mpf_apery, mpf_khinchin, mpf_glaisher, mpf_twinprime, mpf_mertens, int_types
  from .None import function_docs
  from .None import rational
  from .ctx_mp_python import _mpf, _mpc, mpnumeric
label_desc: Use image node_id 2 for calling the MPContext obj's underlying member method code with example usage: obj.init_builtins(ctx) without return types