code: def test_erfi():
      assert erfi(nan) is nan
  
      assert erfi(oo) is S.Infinity
      assert erfi(-oo) is S.NegativeInfinity
  
      assert erfi(0) is S.Zero
  
      assert erfi(I * oo) == I
      assert erfi(-I * oo) == -I
  
      assert erfi(-x) == -erfi(x)
  
      assert erfi(I * erfinv(x)) == I * x
      assert erfi(I * erfcinv(x)) == I * (1 - x)
      assert erfi(I * erf2inv(0, x)) == I * x
      assert (
          erfi(I * erf2inv(0, x, evaluate=False)) == I * x
      )  # To cover code in erfi
  
      assert erfi(I).is_real is False
      assert erfi(0, evaluate=False).is_real
      assert erfi(0, evaluate=False).is_zero
  
      assert conjugate(erfi(z)) == erfi(conjugate(z))
  
      assert erfi(x).as_leading_term(x) == 2 * x / sqrt(pi)
      assert erfi(x * y).as_leading_term(y) == 2 * x * y / sqrt(pi)
      assert (erfi(x * y) / erfi(y)).as_leading_term(y) == x
      assert erfi(1 / x).as_leading_term(x) == erfi(1 / x)
  
      assert erfi(z).rewrite("erf") == -I * erf(I * z)
      assert erfi(z).rewrite("erfc") == I * erfc(I * z) - I
      assert erfi(z).rewrite("fresnels") == (1 - I) * (
          fresnelc(z * (1 + I) / sqrt(pi))
          - I * fresnels(z * (1 + I) / sqrt(pi))
      )
      assert erfi(z).rewrite("fresnelc") == (1 - I) * (
          fresnelc(z * (1 + I) / sqrt(pi))
          - I * fresnels(z * (1 + I) / sqrt(pi))
      )
      assert erfi(z).rewrite("hyper") == 2 * z * hyper(
          [S.Half], [3 * S.Half], z**2
      ) / sqrt(pi)
      assert erfi(z).rewrite("meijerg") == z * meijerg(
          [S.Half], [], [0], [Rational(-1, 2)], -(z**2)
      ) / sqrt(pi)
      assert erfi(z).rewrite("uppergamma") == (
          sqrt(-(z**2))
          / z
          * (uppergamma(S.Half, -(z**2)) / sqrt(S.Pi) - S.One)
      )
      assert erfi(z).rewrite("expint") == sqrt(
          -(z**2)
      ) / z - z * expint(S.Half, -(z**2)) / sqrt(S.Pi)
      assert erfi(z).rewrite("tractable") == -I * (
          -_erfs(I * z) * exp(z**2) + 1
      )
      assert expand_func(erfi(I * z)) == I * erf(z)
  
      assert erfi(x).as_real_imag() == (
          erfi(re(x) - I * im(x)) / 2 + erfi(re(x) + I * im(x)) / 2,
          -I * (-erfi(re(x) - I * im(x)) + erfi(re(x) + I * im(x))) / 2,
      )
      assert erfi(x).as_real_imag(deep=False) == (
          erfi(re(x) - I * im(x)) / 2 + erfi(re(x) + I * im(x)) / 2,
          -I * (-erfi(re(x) - I * im(x)) + erfi(re(x) + I * im(x))) / 2,
      )
  
      assert erfi(w).as_real_imag() == (erfi(w), 0)
      assert erfi(w).as_real_imag(deep=False) == (erfi(w), 0)
  
      raises(ArgumentIndexError, lambda: erfi(x).fdiff(2))
  
imports: from sympy.core.function import diff, expand, expand_func
  from sympy.core import EulerGamma
  from sympy.core.numbers import E, Float, I, Rational, nan, oo, pi
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.complexes import conjugate, im, polar_lift, re
  from sympy.functions.elementary.exponential import exp, exp_polar, log
  from sympy.functions.elementary.hyperbolic import cosh, sinh
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos, sin, sinc
  from sympy.functions.special.error_functions import Chi, Ci, E1, Ei, Li, Shi, Si, erf, erf2, erf2inv, erfc, erfcinv, erfi, erfinv, expint, fresnelc, fresnels, li
  from sympy.functions.special.gamma_functions import gamma, uppergamma
  from sympy.functions.special.hyper import hyper, meijerg
  from sympy.integrals.integrals import Integral, integrate
  from sympy.series.gruntz import gruntz
  from sympy.series.limits import limit
  from sympy.series.order import O
  from sympy.core.expr import unchanged
  from sympy.core.function import ArgumentIndexError
  from sympy.functions.special.error_functions import _erfs, _eis
  from sympy.testing.pytest import raises
label_desc: Use image node_id 8 for calling a global function with example usage: test_erfi() without return types