code: def lqn(n, z):
      """Legendre function of the second kind.
  
      Compute sequence of Legendre functions of the second kind, Qn(z) and
      derivatives for all degrees from 0 to n (inclusive).
  
      References
      ----------
      .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special
             Functions", John Wiley and Sons, 1996.
             https://people.sc.fsu.edu/~jburkardt/f_src/special_functions/special_functions.html
  
      """
      if not (isscalar(n) and isscalar(z)):
          raise ValueError("arguments must be scalars.")
      n = _nonneg_int_or_fail(n, "n", strict=False)
      if n < 1:
          n1 = 1
      else:
          n1 = n
      if iscomplex(z):
          qn, qd = specfun.clqn(n1, z)
      else:
          qn, qd = specfun.lqnb(n1, z)
      return qn[: (n + 1)], qd[: (n + 1)]
  
imports: import operator
  import numpy
  import math
  from numpy import pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, where, mgrid, sin, place, issubdtype, extract, inexact, nan, zeros, sinc
  from .None import _ufuncs
  from ._ufuncs import mathieu_a, mathieu_b, iv, jv, gamma, psi, hankel1, hankel2, yv, kv, ndtri, poch, binom, hyp0f1
  from .None import specfun
  from .None import orthogonal
  from ._comb import _comb_int
label_desc: Use image node_id 35 for calling a global function with example usage: lqn(n, z) and returns: qn,  qd