code: def test_factorial():
      x = Symbol("x")
      n = Symbol("n", integer=True)
      k = Symbol("k", integer=True, nonnegative=True)
      r = Symbol("r", integer=False)
      s = Symbol("s", integer=False, negative=True)
      t = Symbol("t", nonnegative=True)
      u = Symbol("u", noninteger=True)
  
      assert factorial(-2) is zoo
      assert factorial(0) == 1
      assert factorial(7) == 5040
      assert factorial(19) == 121645100408832000
      assert factorial(31) == 8222838654177922817725562880000000
      assert factorial(n).func == factorial
      assert factorial(2 * n).func == factorial
  
      assert factorial(x).is_integer is None
      assert factorial(n).is_integer is None
      assert factorial(k).is_integer
      assert factorial(r).is_integer is None
  
      assert factorial(n).is_positive is None
      assert factorial(k).is_positive
  
      assert factorial(x).is_real is None
      assert factorial(n).is_real is None
      assert factorial(k).is_real is True
      assert factorial(r).is_real is None
      assert factorial(s).is_real is True
      assert factorial(t).is_real is True
      assert factorial(u).is_real is True
  
      assert factorial(x).is_composite is None
      assert factorial(n).is_composite is None
      assert factorial(k).is_composite is None
      assert factorial(k + 3).is_composite is True
      assert factorial(r).is_composite is None
      assert factorial(s).is_composite is None
      assert factorial(t).is_composite is None
      assert factorial(u).is_composite is None
  
      assert factorial(oo) is oo
  
imports: from sympy.concrete.products import Product
  from sympy.core.function import expand_func
  from sympy.core.mod import Mod
  from sympy.core.mul import Mul
  from sympy.core import EulerGamma
  from sympy.core.numbers import Float, I, Rational, nan, oo, pi, zoo
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy, Symbol, symbols
  from sympy.functions.combinatorial.factorials import ff, rf, binomial, factorial, factorial2
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.piecewise import Piecewise
  from sympy.functions.special.gamma_functions import gamma, polygamma
  from sympy.polys.polytools import Poly
  from sympy.series.order import O
  from sympy.simplify.simplify import simplify
  from sympy.core.expr import unchanged
  from sympy.core.function import ArgumentIndexError
  from sympy.functions.combinatorial.factorials import subfactorial
  from sympy.functions.special.gamma_functions import uppergamma
  from sympy.testing.pytest import XFAIL, raises, slow
label_desc: Use image node_id 5 for calling a global function with example usage: test_factorial() without return types