code: def as_series(alist, trim=True):
      """
      Return argument as a list of 1-d arrays.
  
      The returned list contains array(s) of dtype double, complex double, or
      object.  A 1-d argument of shape ``(N,)`` is parsed into ``N`` arrays of
      size one; a 2-d argument of shape ``(M,N)`` is parsed into ``M`` arrays
      of size ``N`` (i.e., is "parsed by row"); and a higher dimensional array
      raises a Value Error if it is not first reshaped into either a 1-d or 2-d
      array.
  
      Parameters
      ----------
      alist : array_like
          A 1- or 2-d array_like
      trim : boolean, optional
          When True, trailing zeros are removed from the inputs.
          When False, the inputs are passed through intact.
  
      Returns
      -------
      [a1, a2,...] : list of 1-D arrays
          A copy of the input data as a list of 1-d arrays.
  
      Raises
      ------
      ValueError
          Raised when `as_series` cannot convert its input to 1-d arrays, or at
          least one of the resulting arrays is empty.
  
      Examples
      --------
      >>> from numpy.polynomial import polyutils as pu
      >>> a = np.arange(4)
      >>> pu.as_series(a)
      [array([0.]), array([1.]), array([2.]), array([3.])]
      >>> b = np.arange(6).reshape((2,3))
      >>> pu.as_series(b)
      [array([0., 1., 2.]), array([3., 4., 5.])]
  
      >>> pu.as_series((1, np.arange(3), np.arange(2, dtype=np.float16)))
      [array([1.]), array([0., 1., 2.]), array([0., 1.])]
  
      >>> pu.as_series([2, [1.1, 0.]])
      [array([2.]), array([1.1])]
  
      >>> pu.as_series([2, [1.1, 0.]], trim=False)
      [array([2.]), array([1.1, 0. ])]
  
      """
      arrays = [np.array(a, ndmin=1, copy=False) for a in alist]
      if min([a.size for a in arrays]) == 0:
          raise ValueError("Coefficient array is empty")
      if any(a.ndim != 1 for a in arrays):
          raise ValueError("Coefficient array is not 1-d")
      if trim:
          arrays = [trimseq(a) for a in arrays]
  
      if any(a.dtype == np.dtype(object) for a in arrays):
          ret = []
          for a in arrays:
              if a.dtype != np.dtype(object):
                  tmp = np.empty(len(a), dtype=np.dtype(object))
                  tmp[:] = a[:]
                  ret.append(tmp)
              else:
                  ret.append(a.copy())
      else:
          try:
              dtype = np.common_type(*arrays)
          except Exception as e:
              raise ValueError(
                  "Coefficient arrays have no common type"
              ) from e
          ret = [np.array(a, copy=True, dtype=dtype) for a in arrays]
      return ret
  
imports: import operator
  import functools
  import warnings
  import numpy
  from numpy.core.multiarray import dragon4_positional, dragon4_scientific
  from numpy.core.umath import absolute
label_desc: Use image node_id 2 for calling a global function with example usage: as_series(alist, trim) and returns: ret