code: def test_gamma():
      assert gamma(nan) is nan
      assert gamma(oo) is oo
  
      assert gamma(-100) is zoo
      assert gamma(0) is zoo
      assert gamma(-100.0) is zoo
  
      assert gamma(1) == 1
      assert gamma(2) == 1
      assert gamma(3) == 2
  
      assert gamma(102) == factorial(101)
  
      assert gamma(S.Half) == sqrt(pi)
  
      assert gamma(Rational(3, 2)) == sqrt(pi) * S.Half
      assert gamma(Rational(5, 2)) == sqrt(pi) * Rational(3, 4)
      assert gamma(Rational(7, 2)) == sqrt(pi) * Rational(15, 8)
  
      assert gamma(Rational(-1, 2)) == -2 * sqrt(pi)
      assert gamma(Rational(-3, 2)) == sqrt(pi) * Rational(4, 3)
      assert gamma(Rational(-5, 2)) == sqrt(pi) * Rational(-8, 15)
  
      assert gamma(Rational(-15, 2)) == sqrt(pi) * Rational(
          256, 2027025
      )
  
      assert gamma(Rational(-11, 8)).expand(func=True) == Rational(
          64, 33
      ) * gamma(Rational(5, 8))
      assert gamma(Rational(-10, 3)).expand(func=True) == Rational(
          81, 280
      ) * gamma(Rational(2, 3))
      assert gamma(Rational(14, 3)).expand(func=True) == Rational(
          880, 81
      ) * gamma(Rational(2, 3))
      assert gamma(Rational(17, 7)).expand(func=True) == Rational(
          30, 49
      ) * gamma(Rational(3, 7))
      assert gamma(Rational(19, 8)).expand(func=True) == Rational(
          33, 64
      ) * gamma(Rational(3, 8))
  
      assert gamma(x).diff(x) == gamma(x) * polygamma(0, x)
  
      assert gamma(x - 1).expand(func=True) == gamma(x) / (x - 1)
      assert gamma(x + 2).expand(func=True, mul=False) == x * (
          x + 1
      ) * gamma(x)
  
      assert conjugate(gamma(x)) == gamma(conjugate(x))
  
      assert expand_func(gamma(x + Rational(3, 2))) == (
          x + S.Half
      ) * gamma(x + S.Half)
  
      assert expand_func(gamma(x - S.Half)) == gamma(S.Half + x) / (
          x - S.Half
      )
  
      # Test a bug:
      assert expand_func(gamma(x + Rational(3, 4))) == gamma(
          x + Rational(3, 4)
      )
  
      # XXX: Not sure about these tests. I can fix them by defining e.g.
      # exp_polar.is_integer but I'm not sure if that makes sense.
      assert gamma(3 * exp_polar(I * pi) / 4).is_nonnegative is False
      assert (
          gamma(3 * exp_polar(I * pi) / 4).is_extended_nonpositive
          is True
      )
  
      y = Symbol("y", nonpositive=True, integer=True)
      assert gamma(y).is_real == False
      y = Symbol("y", positive=True, noninteger=True)
      assert gamma(y).is_real == True
  
      assert gamma(-1.0, evaluate=False).is_real == False
      assert gamma(0, evaluate=False).is_real == False
      assert gamma(-2, evaluate=False).is_real == False
  
imports: from sympy.core.function import expand_func, Subs
  from sympy.core import EulerGamma
  from sympy.core.numbers import I, Rational, nan, oo, pi, zoo
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy, Symbol
  from sympy.functions.combinatorial.factorials import factorial
  from sympy.functions.combinatorial.numbers import harmonic
  from sympy.functions.elementary.complexes import Abs, conjugate, im, re
  from sympy.functions.elementary.exponential import exp, exp_polar, log
  from sympy.functions.elementary.hyperbolic import tanh
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos, sin, atan
  from sympy.functions.special.error_functions import Ei, erf, erfc
  from sympy.functions.special.gamma_functions import digamma, gamma, loggamma, lowergamma, multigamma, polygamma, trigamma, uppergamma
  from sympy.functions.special.zeta_functions import zeta
  from sympy.series.order import O
  from sympy.core.expr import unchanged
  from sympy.core.function import ArgumentIndexError
  from sympy.testing.pytest import raises
  from sympy.core.random import test_derivative_numerically, random_complex_number, verify_numerically
label_desc: Use image node_id 1 for calling a global function with example usage: test_gamma() without return types