How do you validate the Yaml file before Ansible it?

I pass it to stdin to the following script:

-- valyml.py
#!/usr/bin/env python
import yaml
import sys
print yaml.load(sys.stdin)