def evaluate(self, repo, spec, args):
status = []<EOL>with cd(repo.rootdir):<EOL><INDENT>files = spec.get('<STR_LIT>', ['<STR_LIT:*>'])<EOL>resource_files = repo.find_matching_files(files)<EOL>files = glob2.glob("<STR_LIT>")<EOL>disk_files = [f for f in files if os.path.isfile(f) and f != "<STR_LIT>"]<EOL>allfiles = list(set(resource_files + disk_files))<EOL>allfiles.sort()<EOL>for f in allfiles:<EOL><INDENT>if f in resource_files and f in disk_files:<EOL><INDENT>r = repo.get_resource(f)<EOL>coded_sha256 = r['<STR_LIT>']<EOL>computed_sha256 = compute_sha256(f)<EOL>if computed_sha256 != coded_sha256:<EOL><INDENT>status.append({<EOL>'<STR_LIT:target>': f,<EOL>'<STR_LIT>': "<STR_LIT>",<EOL>'<STR_LIT>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT:status>': '<STR_LIT>',<EOL>'<STR_LIT:message>': "<STR_LIT>"<EOL>})<EOL><DEDENT>else:<EOL><INDENT>status.append({<EOL>'<STR_LIT:target>': f,<EOL>'<STR_LIT>': "<STR_LIT>",<EOL>'<STR_LIT>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT:status>': '<STR_LIT:OK>',<EOL>'<STR_LIT:message>': "<STR_LIT>"<EOL>})<EOL><DEDENT><DEDENT>elif f in resource_files:<EOL><INDENT>status.append({<EOL>'<STR_LIT:target>': f,<EOL>'<STR_LIT>': "<STR_LIT>",<EOL>'<STR_LIT>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT:status>': '<STR_LIT>',<EOL>'<STR_LIT:message>': "<STR_LIT>"<EOL>})<EOL><DEDENT>else:<EOL><INDENT>status.append({<EOL>'<STR_LIT:target>': f,<EOL>'<STR_LIT>': "<STR_LIT>",<EOL>'<STR_LIT>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT:status>': '<STR_LIT>',<EOL>'<STR_LIT:message>': "<STR_LIT>"<EOL>})<EOL><DEDENT><DEDENT><DEDENT>return status<EOL>
Check the integrity of the datapackage.json