code: def test_primepi():
      assert primepi(-1) == 0
      assert primepi(1) == 0
      assert primepi(2) == 1
      assert primepi(Rational(7, 2)) == 2
      assert primepi(3.5) == 2
      assert primepi(5) == 3
      assert primepi(11) == 5
      assert primepi(57) == 16
      assert primepi(296) == 62
      assert primepi(559) == 102
      assert primepi(3000) == 430
      assert primepi(4096) == 564
      assert primepi(9096) == 1128
      assert primepi(25023) == 2763
      assert primepi(10**8) == 5761455
      assert primepi(253425253) == 13856396
      assert primepi(8769575643) == 401464322
      sieve.extend(3000)
      assert primepi(2000) == 303
  
      n = Symbol("n")
      assert primepi(n).subs(n, 2) == 1
  
      r = Symbol("r", real=True)
      assert primepi(r).subs(r, 2) == 1
  
      assert primepi(S.Infinity) is S.Infinity
      assert primepi(S.NegativeInfinity) == 0
  
      assert limit(primepi(n), n, 100) == 25
  
      raises(ValueError, lambda: primepi(I))
      raises(ValueError, lambda: primepi(1 + I))
      raises(ValueError, lambda: primepi(zoo))
      raises(ValueError, lambda: primepi(nan))
  
imports: from bisect import bisect, bisect_left
  from sympy.core.numbers import I, Rational, nan, zoo
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.functions.combinatorial.numbers import mobius
  from sympy.ntheory.generate import sieve, Sieve
  from sympy.series.limits import limit
  from sympy.ntheory import isprime, totient, randprime, nextprime, prevprime, primerange, primepi, prime, primorial, composite, compositepi, reduced_totient
  from sympy.ntheory.generate import cycle_length
  from sympy.ntheory.primetest import mr
  from sympy.testing.pytest import raises
label_desc: Use image node_id 2 for calling a global function with example usage: test_primepi() without return types