Validator written in python