code: def polydiv(u, v):
      """
      Returns the quotient and remainder of polynomial division.
  
      The input arrays are the coefficients (including any coefficients
      equal to zero) of the "numerator" (dividend) and "denominator"
      (divisor) polynomials, respectively.
  
      Parameters
      ----------
      u : array_like or poly1d
          Dividend polynomial's coefficients.
  
      v : array_like or poly1d
          Divisor polynomial's coefficients.
  
      Returns
      -------
      q : ndarray
          Coefficients, including those equal to zero, of the quotient.
      r : ndarray
          Coefficients, including those equal to zero, of the remainder.
  
      See Also
      --------
      poly, polyadd, polyder, polydiv, polyfit, polyint, polymul, polysub,
      polyval
  
      Notes
      -----
      Both `u` and `v` must be 0-d or 1-d (ndim = 0 or 1), but `u.ndim` need
      not equal `v.ndim`. In other words, all four possible combinations -
      ``u.ndim = v.ndim = 0``, ``u.ndim = v.ndim = 1``,
      ``u.ndim = 1, v.ndim = 0``, and ``u.ndim = 0, v.ndim = 1`` - work.
  
      Examples
      --------
      .. math:: \\frac{3x^2 + 5x + 2}{2x + 1} = 1.5x + 1.75, remainder 0.25
  
      >>> x = np.array([3.0, 5.0, 2.0])
      >>> y = np.array([2.0, 1.0])
      >>> np.polydiv(x, y)
      (array([ 1.5 ,  1.75]), array([ 0.25]))
  
      """
      truepoly = isinstance(u, poly1d) or isinstance(u, poly1d)
      u = atleast_1d(u) + 0.0
      v = atleast_1d(v) + 0.0
      # w has the common type
      w = u[0] + v[0]
      m = len(u) - 1
      n = len(v) - 1
      scale = 1.0 / v[0]
      q = NX.zeros((max(m - n + 1, 1),), w.dtype)
      r = u.astype(w.dtype)
      for k in range(0, m - n + 1):
          d = scale * r[k]
          q[k] = d
          r[k : k + n + 1] -= d * v
      while NX.allclose(r[0], 0, rtol=1e-14) and (r.shape[-1] > 1):
          r = r[1:]
      if truepoly:
          return poly1d(q), poly1d(r)
      return q, r
  
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 18 for calling a global function with example usage: polydiv(u, v) and returns: q,  r, poly1d,  poly1d