code: def polyadd(a1, a2):
      """Computes the sum of two polynomials.
  
      Args:
          a1 (scalar, cupy.ndarray or cupy.poly1d): first input polynomial.
          a2 (scalar, cupy.ndarray or cupy.poly1d): second input polynomial.
  
      Returns:
          cupy.ndarray or cupy.poly1d: The sum of the inputs.
  
      .. seealso:: :func:`numpy.polyadd`
  
      """
      if a1.size < a2.size:
          a1, a2 = a2, a1
      out = cupy.pad(a2, (a1.size - a2.size, 0))
      out = out.astype(cupy.result_type(a1, a2), copy=False)
      out += a1
      return out
  
file_path: cupy/cupy/lib/_routines_poly.py
imports: import functools
  import warnings
  import numpy
  import cupy
  import cupyx.scipy.fft
label_desc: Use image node_id 3 for calling a global function with example usage: polyadd(a1, a2) and returns: out