<gh_stars>1-10
import yaml


def validate(contents):
    try:
        return (yaml.safe_load(contents), None)
    except Exception as err:
        return (None, '{}'.format(err.problem))

import yaml


def validate(contents):
    try:
        return (yaml.safe_load(contents), None)
    except Exception as err:
        return (None, '{}'.format(err.problem))