code: def sdm_ecart(f):
      """
      Compute the ecart of ``f``.
  
      This is defined to be the difference of the total degree of `f` and the
      total degree of the leading monomial of `f` [SCA, defn 2.3.7].
  
      Invalid if f is zero.
  
      Examples
      ========
  
      >>> from sympy.polys.distributedmodules import sdm_ecart
      >>> sdm_ecart([((1, 2, 3), 1), ((1, 0, 1), 1)])
      0
      >>> sdm_ecart([((2, 2, 1), 1), ((1, 5, 1), 1)])
      3
      """
      return sdm_deg(f) - sdm_monomial_deg(sdm_LM(f))
  
imports: from itertools import permutations
  from sympy.polys.monomials import monomial_mul, monomial_lcm, monomial_div, monomial_deg
  from sympy.polys.polytools import Poly
  from sympy.polys.polyutils import parallel_dict_from_expr
  from sympy.core.singleton import S
  from sympy.core.sympify import sympify
label_desc: Use image node_id 19 for calling a global function with example usage: sdm_ecart(f) and returns: unknown