code: def mpc_psi(m, z, prec, rnd=round_fast):
      """
      Computation of the polygamma function of arbitrary integer order
      m >= 0, for a complex argument z.
      """
      if m == 0:
          return mpc_psi0(z, prec, rnd)
      re, im = z
      wp = prec + 20
      sign, man, exp, bc = re
      if not im[1]:
          if im in (finf, fninf, fnan):
              return (fnan, fnan)
      if not man:
          if re == finf and im == fzero:
              return (fzero, fzero)
          if re == fnan:
              return (fnan, fnan)
      # Recurrence
      w = to_int(re)
      n = int(0.4 * wp + 4 * m)
      s = mpc_zero
      if w < n:
          for k in xrange(w, n):
              t = mpc_pow_int(z, -m - 1, wp)
              s = mpc_add(s, t, wp)
              z = mpc_add_mpf(z, fone, wp)
      zm = mpc_pow_int(z, -m, wp)
      z2 = mpc_pow_int(z, -2, wp)
      # 1/m*(z+N)^m
      integral_term = mpc_div_mpf(zm, from_int(m), wp)
      s = mpc_add(s, integral_term, wp)
      # 1/2*(z+N)^(-(m+1))
      s = mpc_add(s, mpc_mul_mpf(mpc_div(zm, z, wp), fhalf, wp), wp)
      a = m + 1
      b = 2
      k = 1
      # Important: we want to sum up to the *relative* error,
      # not the absolute error, because psi^(m)(z) might be tiny
      magn = mpc_abs(s, 10)
      magn = magn[2] + magn[3]
      eps = mpf_shift(fone, magn - wp + 2)
      while 1:
          zm = mpc_mul(zm, z2, wp)
          bern = mpf_bernoulli(2 * k, wp)
          scal = mpf_mul_int(bern, a, wp)
          scal = mpf_div(scal, from_int(b), wp)
          term = mpc_mul_mpf(zm, scal, wp)
          s = mpc_add(s, term, wp)
          szterm = mpc_abs(term, 10)
          if k > 2 and mpf_le(szterm, eps):
              break
          # print k, to_str(szterm, 10), to_str(eps, 10)
          a *= (m + 2 * k) * (m + 2 * k + 1)
          b *= (2 * k + 1) * (2 * k + 2)
          k += 1
      # Scale and sign factor
      v = mpc_mul_mpf(s, mpf_gamma(from_int(m + 1), wp), prec, rnd)
      if not (m & 1):
          v = mpf_neg(v[0]), mpf_neg(v[1])
      return v
  
imports: import math
  import sys
  from .backend import xrange
  from .backend import MPZ, MPZ_ZERO, MPZ_ONE, MPZ_THREE, gmpy
  from .libintmath import list_primes, ifac, ifac2, moebius
  from .libmpf import round_floor, round_ceiling, round_down, round_up, round_nearest, round_fast, lshift, sqrt_fixed, isqrt_fast, fzero, fone, fnone, fhalf, ftwo, finf, fninf, fnan, from_int, to_int, to_fixed, from_man_exp, from_rational, mpf_pos, mpf_neg, mpf_abs, mpf_add, mpf_sub, mpf_mul, mpf_mul_int, mpf_div, mpf_sqrt, mpf_pow_int, mpf_rdiv_int, mpf_perturb, mpf_le, mpf_lt, mpf_gt, mpf_shift, negative_rnd, reciprocal_rnd, bitcount, to_float, mpf_floor, mpf_sign, ComplexResult
  from .libelefun import constant_memo, def_mpf_constant, mpf_pi, pi_fixed, ln2_fixed, log_int_fixed, mpf_ln2, mpf_exp, mpf_log, mpf_pow, mpf_cosh, mpf_cos_sin, mpf_cosh_sinh, mpf_cos_sin_pi, mpf_cos_pi, mpf_sin_pi, ln_sqrt2pi_fixed, mpf_ln_sqrt2pi, sqrtpi_fixed, mpf_sqrtpi, cos_sin_fixed, exp_fixed
  from .libmpc import mpc_zero, mpc_one, mpc_half, mpc_two, mpc_abs, mpc_shift, mpc_pos, mpc_neg, mpc_add, mpc_sub, mpc_mul, mpc_div, mpc_add_mpf, mpc_mul_mpf, mpc_div_mpf, mpc_mpf_div, mpc_mul_int, mpc_pow_int, mpc_log, mpc_exp, mpc_pow, mpc_cos_pi, mpc_sin_pi, mpc_reciprocal, mpc_square, mpc_sub_mpf
label_desc: Use image node_id 17 for calling a global function with example usage: mpc_psi(m, z, prec, rnd) and returns: v, mpc_psi0, fnan,  fnan, fzero,  fzero, fnan,  fnan