Validation of Python dictionaries