(v)
Return a and b if v matches a + I*b where b is not zero and
    a and b are Numbers, else None.

    >>> from sympy.core.evalf import pure_complex
    >>> from sympy import Tuple, I
    >>> a, b = Tuple(2, 3)
    >>> pure_complex(a)
    >>> pure_complex(a + b*I)
    (2, 3)
    >>> pure_complex(I)
    (0, 1)
Return a and b if v matches a + I*b where b is not zero and
    a and b are Numbers, else None.
Return a and b if v matches a + I * b where b is not zero and a and b are Numbers else None .
def pure_complex(v):
    """Return a and b if v matches a + I*b where b is not zero and
    a and b are Numbers, else None.

    >>> from sympy.core.evalf import pure_complex
    >>> from sympy import Tuple, I
    >>> a, b = Tuple(2, 3)
    >>> pure_complex(a)
    >>> pure_complex(a + b*I)
    (2, 3)
    >>> pure_complex(I)
    (0, 1)
    """
    h, t = v.as_coeff_Add()
    c, i = t.as_coeff_Mul()
    if i is S.ImaginaryUnit:
        return h, c
def pure_complex ( v ) : h , t = v . as_coeff_Add ( ) c , i = t . as_coeff_Mul ( ) if i is S . ImaginaryUnit : return h , c