def _coeff_isneg(a):
 if a.is_Mul:
  a = a.args[0]
 return (a.is_Number and a.is_negative)

def _coeff_isneg ( a ) : if a . is_Mul : a = a . args [ 0 ] return ( a . is_Number and a . is_negative )
return true if the leading number is negative .