code: def dmp_sqf_list(f, u, K, all=False):
      """
      Return square-free decomposition of a polynomial in ``K[X]``.
  
      Examples
      ========
  
      >>> from sympy.polys import ring, ZZ
      >>> R, x,y = ring("x,y", ZZ)
  
      >>> f = x**5 + 2*x**4*y + x**3*y**2
  
      >>> R.dmp_sqf_list(f)
      (1, [(x + y, 2), (x, 3)])
      >>> R.dmp_sqf_list(f, all=True)
      (1, [(1, 1), (x + y, 2), (x, 3)])
  
      """
      if not u:
          return dup_sqf_list(f, K, all=all)
  
      if K.is_FiniteField:
          return dmp_gf_sqf_list(f, u, K, all=all)
  
      if K.is_Field:
          coeff = dmp_ground_LC(f, u, K)
          f = dmp_ground_monic(f, u, K)
      else:
          coeff, f = dmp_ground_primitive(f, u, K)
  
          if K.is_negative(dmp_ground_LC(f, u, K)):
              f = dmp_neg(f, u, K)
              coeff = -coeff
  
      if dmp_degree(f, u) <= 0:
          return coeff, []
  
      result, i = [], 1
  
      h = dmp_diff(f, 1, u, K)
      g, p, q = dmp_inner_gcd(f, h, u, K)
  
      while True:
          d = dmp_diff(p, 1, u, K)
          h = dmp_sub(q, d, u, K)
  
          if dmp_zero_p(h, u):
              result.append((p, i))
              break
  
          g, p, q = dmp_inner_gcd(p, h, u, K)
  
          if all or dmp_degree(g, u) > 0:
              result.append((g, i))
  
          i += 1
  
      return coeff, result
  
imports: from sympy.polys.densearith import dup_neg, dmp_neg, dup_sub, dmp_sub, dup_mul, dup_quo, dmp_quo, dup_mul_ground, dmp_mul_ground
  from sympy.polys.densebasic import dup_strip, dup_LC, dmp_ground_LC, dmp_zero_p, dmp_ground, dup_degree, dmp_degree, dmp_raise, dmp_inject, dup_convert
  from sympy.polys.densetools import dup_diff, dmp_diff, dmp_diff_in, dup_shift, dmp_compose, dup_monic, dmp_ground_monic, dup_primitive, dmp_ground_primitive
  from sympy.polys.euclidtools import dup_inner_gcd, dmp_inner_gcd, dup_gcd, dmp_gcd, dmp_resultant
  from sympy.polys.galoistools import gf_sqf_list, gf_sqf_part
  from sympy.polys.polyerrors import MultivariatePolynomialError, DomainError
label_desc: Use image node_id 14 for calling a global function with example usage: dmp_sqf_list(f, u, K, all) and returns: coeff,  result, dup_sqf_list, dmp_gf_sqf_list, coeff,  list