code: def is_decomposed(P):
      
      if P.shape:
          return min([is_decomposed(poly) for poly in P])
      return len(P.keys) <= 1
docs: Check if a polynomial (array) is on component form.
  
      Args:
          P (Poly):
              Input data.
  
      Returns:
          (bool):
              True if all polynomials in ``P`` are on component form.
  
      Examples:
          >>> x,y = cp.variable(2)
          >>> print(cp.is_decomposed(cp.Poly([1,x,x*y])))
          True
          >>> print(cp.is_decomposed(cp.Poly([x+1,x*y])))
          False