code: def test_subfactorial():
      assert all(
          subfactorial(i) == ans
          for i, ans in enumerate(
              [1, 0, 1, 2, 9, 44, 265, 1854, 14833, 133496]
          )
      )
      assert subfactorial(oo) is oo
      assert subfactorial(nan) is nan
      assert subfactorial(23) == 9510425471055777937262
      assert unchanged(subfactorial, 2.2)
  
      x = Symbol("x")
      assert (
          subfactorial(x).rewrite(uppergamma)
          == uppergamma(x + 1, -1) / S.Exp1
      )
  
      tt = Symbol("tt", integer=True, nonnegative=True)
      tf = Symbol("tf", integer=True, nonnegative=False)
      tn = Symbol("tf", integer=True)
      ft = Symbol("ft", integer=False, nonnegative=True)
      ff = Symbol("ff", integer=False, nonnegative=False)
      fn = Symbol("ff", integer=False)
      nt = Symbol("nt", nonnegative=True)
      nf = Symbol("nf", nonnegative=False)
      nn = Symbol("nf")
      te = Symbol("te", even=True, nonnegative=True)
      to = Symbol("to", odd=True, nonnegative=True)
      assert subfactorial(tt).is_integer
      assert subfactorial(tf).is_integer is None
      assert subfactorial(tn).is_integer is None
      assert subfactorial(ft).is_integer is None
      assert subfactorial(ff).is_integer is None
      assert subfactorial(fn).is_integer is None
      assert subfactorial(nt).is_integer is None
      assert subfactorial(nf).is_integer is None
      assert subfactorial(nn).is_integer is None
      assert subfactorial(tt).is_nonnegative
      assert subfactorial(tf).is_nonnegative is None
      assert subfactorial(tn).is_nonnegative is None
      assert subfactorial(ft).is_nonnegative is None
      assert subfactorial(ff).is_nonnegative is None
      assert subfactorial(fn).is_nonnegative is None
      assert subfactorial(nt).is_nonnegative is None
      assert subfactorial(nf).is_nonnegative is None
      assert subfactorial(nn).is_nonnegative is None
      assert subfactorial(tt).is_even is None
      assert subfactorial(tt).is_odd is None
      assert subfactorial(te).is_odd is True
      assert subfactorial(to).is_even is True
  
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 18 for calling a global function with example usage: test_subfactorial() without return types