code: def pure_complex(
      v: "Expr", or_real=False
  ) -> tuple["Number", "Number"] | None:
      """Return a and b if v matches a + I*b where b is not zero and
      a and b are Numbers, else None. If `or_real` is True then 0 will
      be returned for `b` if `v` is a real number.
  
      Examples
      ========
  
      >>> from sympy.core.evalf import pure_complex
      >>> from sympy import sqrt, I, S
      >>> a, b, surd = S(2), S(3), sqrt(2)
      >>> pure_complex(a)
      >>> pure_complex(a, or_real=True)
      (2, 0)
      >>> pure_complex(surd)
      >>> pure_complex(a + b*I)
      (2, 3)
      >>> pure_complex(I)
      (0, 1)
      """
      h, t = v.as_coeff_Add()
      if t:
          c, i = t.as_coeff_Mul()
          if i is S.ImaginaryUnit:
              return h, c
      elif or_real:
          return h, S.Zero
      return 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 3 for calling a global function with example usage: pure_complex(v, or_real) and returns: None, h,  c, h,  S