def _require_sender_id_is_valid(intent, sender_id):
 if (intent not in SENDER_VALIDATORS):
  raise Exception(('Invalid email intent string: %s' % intent))
 elif (not SENDER_VALIDATORS[intent](sender_id)):
  logging.error(("Invalid sender_id %s for email with intent '%s'" % (sender_id, intent)))
  raise Exception(("Invalid sender_id for email with intent '%s'" % intent))

def _require_sender_id_is_valid ( intent , sender_id ) : if ( intent not in SENDER_VALIDATORS ) : raise Exception ( ( 'Invalid email intent string: %s' % intent ) ) elif ( not SENDER_VALIDATORS [ intent ] ( sender_id ) ) : logging . error ( ( "Invalid sender_id %s for email with intent '%s'" % ( sender_id , intent ) ) ) raise Exception ( ( "Invalid sender_id for email with intent '%s'" % intent ) )
ensure that the sender id is valid .