def annotate_metadata_validation(repo):

    print("Adding validation information")
    # Collect the validation results by relativepath
    results = validate(repo)
    fileresults = {}
    for r in results:
        filename = r['target']
        if filename not in fileresults:
            fileresults[filename] = []
        fileresults[filename].append(r)

    for r in repo.package['resources']:
        path = r['relativepath']
        if path in fileresults:
            r['validation'] = fileresults[path]
dataset/ETHPy150Open pingali/dgit/dgitcore/datasets/common.py/annotate_metadata_validation/original