code: def row2poly(row, deg, x):
      """
      Converts the row of a matrix to a poly of degree deg and variable x.
      Some entries at the beginning and/or at the end of the row may be zero.
  
      """
      k = 0
      poly = []
      leng = len(row)
  
      # find the beginning of the poly ; i.e. the first
      # non-zero element of the row
      while row[k] == 0:
          k = k + 1
  
      # append the next deg + 1 elements to poly
      for j in range(deg + 1):
          if k + j <= leng:
              poly.append(row[k + j])
  
      return Poly(poly, x)
  
imports: from sympy.concrete.summations import summation
  from sympy.core.function import expand
  from sympy.core.numbers import nan
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy
  from sympy.functions.elementary.complexes import Abs, sign
  from sympy.functions.elementary.integers import floor
  from sympy.matrices.dense import eye, Matrix, zeros
  from sympy.printing.pretty.pretty import pretty_print
  from sympy.simplify.simplify import simplify
  from sympy.polys.domains import QQ
  from sympy.polys.polytools import degree, LC, Poly, pquo, quo, prem, rem
  from sympy.polys.polyerrors import PolynomialError
label_desc: Use image node_id 32 for calling a global function with example usage: row2poly(row, deg, x) and returns: Poly