def from_sympy(self, expr):
        number = expr.evalf(n=self.dps)
        real, imag = number.as_real_imag()

        if real.is_Number and imag.is_Number:
            return self.dtype(real, imag)
        else:
            raise CoercionFailed("expected complex number, got %s" % expr)
Convert SymPy's number to ``dtype``.
dataset/ETHPy150Open sympy/sympy/sympy/polys/domains/complexfield.py/ComplexField.from_sympy