def check_headers_valid(headers):
 reason = invalid_headers_reason(headers)
 if (reason is not None):
  raise InvalidEmailError(reason)

def check_headers_valid ( headers ) : reason = invalid_headers_reason ( headers ) if ( reason is not None ) : raise InvalidEmailError ( reason )
check that headers is a valid dictionary for headers .