code: def polyint(p, m=1, k=None):
      """
      Return an antiderivative (indefinite integral) of a polynomial.
  
      The returned order `m` antiderivative `P` of polynomial `p` satisfies
      :math:`\\frac{d^m}{dx^m}P(x) = p(x)` and is defined up to `m - 1`
      integration constants `k`. The constants determine the low-order
      polynomial part
  
      .. math:: \\frac{k_{m-1}}{0!} x^0 + \\ldots + \\frac{k_0}{(m-1)!}x^{m-1}
  
      of `P` so that :math:`P^{(j)}(0) = k_{m-j-1}`.
  
      Parameters
      ----------
      p : array_like or poly1d
          Polynomial to integrate.
          A sequence is interpreted as polynomial coefficients, see `poly1d`.
      m : int, optional
          Order of the antiderivative. (Default: 1)
      k : list of `m` scalars or scalar, optional
          Integration constants. They are given in the order of integration:
          those corresponding to highest-order terms come first.
  
          If ``None`` (default), all constants are assumed to be zero.
          If `m = 1`, a single scalar can be given instead of a list.
  
      See Also
      --------
      polyder : derivative of a polynomial
      poly1d.integ : equivalent method
  
      Examples
      --------
      The defining property of the antiderivative:
  
      >>> p = np.poly1d([1,1,1])
      >>> P = np.polyint(p)
      >>> P
      poly1d([ 0.33333333,  0.5       ,  1.        ,  0.        ])
      >>> np.polyder(P) == p
      True
  
      The integration constants default to zero, but can be specified:
  
      >>> P = np.polyint(p, 3)
      >>> P(0)
      0.0
      >>> np.polyder(P)(0)
      0.0
      >>> np.polyder(P, 2)(0)
      0.0
      >>> P = np.polyint(p, 3, k=[6,5,3])
      >>> P
      poly1d([ 0.01666667,  0.04166667,  0.16666667,  3. ,  5. ,  3. ])
  
      Note that 3 = 6 / 2!, and that the constants are given in the order of
      integrations. Constant of the highest-order polynomial term comes first:
  
      >>> np.polyder(P, 2)(0)
      6.0
      >>> np.polyder(P, 1)(0)
      5.0
      >>> P(0)
      3.0
  
      """
      m = int(m)
      if m < 0:
          raise ValueError(
              "Order of integral must be positive (see polyder)"
          )
      if k is None:
          k = NX.zeros(m, float)
      k = atleast_1d(k)
      if len(k) == 1 and m > 1:
          k = k[0] * NX.ones(m, float)
      if len(k) < m:
          raise ValueError(
              "k must be a scalar or a rank-1 array of length 1 or >m."
          )
  
      truepoly = isinstance(p, poly1d)
      p = NX.asarray(p)
      if m == 0:
          if truepoly:
              return poly1d(p)
          return p
      else:
          # Note: this must work also with object and integer arrays
          y = NX.concatenate(
              (p.__truediv__(NX.arange(len(p), 0, -1)), [k[0]])
          )
          val = polyint(y, m - 1, k=k[1:])
          if truepoly:
              return poly1d(val)
          return val
  
imports: from __future__ import division, absolute_import, print_function
  import functools
  import re
  import warnings
  import numpy.core.numeric
  from numpy.core import isscalar, abs, finfo, atleast_1d, hstack, dot, array, ones
  from numpy.core import overrides
  from numpy.core.overrides import set_module
  from numpy.lib.twodim_base import diag, vander
  from numpy.lib.function_base import trim_zeros
  from numpy.lib.type_check import iscomplex, real, imag, mintypecode
  from numpy.linalg import eigvals, lstsq, inv
label_desc: Use image node_id 6 for calling a global function with example usage: polyint(p, m, k) and returns: p, val, poly1d, poly1d