def _len_guards(M):
 if ((int(M) != M) or (M < 0)):
  raise ValueError('Window length M must be a non-negative integer')
 return (M <= 1)

def _len_guards ( M ) : if ( ( int ( M ) != M ) or ( M < 0 ) ) : raise ValueError ( 'Window length M must be a non-negative integer' ) return ( M <= 1 )
handle small or incorrect window lengths .