code: def test_digamma():
      assert digamma(nan) == nan
  
      assert digamma(oo) == oo
      assert digamma(-oo) == oo
      assert digamma(I * oo) == oo
      assert digamma(-I * oo) == oo
  
      assert digamma(-9) == zoo
  
      assert digamma(-9) == zoo
      assert digamma(-1) == zoo
  
      assert digamma(0) == zoo
  
      assert digamma(1) == -EulerGamma
      assert digamma(7) == Rational(49, 20) - EulerGamma
  
      def t(m, n):
          x = S(m) / n
          r = digamma(x)
          if r.has(digamma):
              return False
          return abs(digamma(x.n()).n() - r.n()).n() < 1e-10
  
      assert t(1, 2)
      assert t(3, 2)
      assert t(-1, 2)
      assert t(1, 4)
      assert t(-3, 4)
      assert t(1, 3)
      assert t(4, 3)
      assert t(3, 4)
      assert t(2, 3)
      assert t(123, 5)
  
      assert digamma(x).rewrite(zeta) == polygamma(0, x)
  
      assert (
          digamma(x).rewrite(harmonic) == harmonic(x - 1) - EulerGamma
      )
  
      assert digamma(I).is_real is None
  
      assert digamma(x, evaluate=False).fdiff() == polygamma(1, x)
  
      assert digamma(x, evaluate=False).is_real is None
  
      assert digamma(x, evaluate=False).is_positive is None
  
      assert digamma(x, evaluate=False).is_negative is None
  
      assert digamma(x, evaluate=False).rewrite(polygamma) == polygamma(
          0, x
      )
  
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 9 for calling a global function with example usage: test_digamma() and returns: unknown, False