def evaluate(self, repo, spec, args):
status = []<EOL>if len(spec['<STR_LIT>']) == <NUM_LIT:0>: <EOL><INDENT>return status <EOL><DEDENT>with cd(repo.rootdir):<EOL><INDENT>rules = None <EOL>if '<STR_LIT>' in spec and len(spec['<STR_LIT>']) > <NUM_LIT:0>: <EOL><INDENT>rulesfiles = spec['<STR_LIT>']<EOL>rules = {} <EOL>for f in rulesfiles: <EOL><INDENT>d = json.loads(open(f).read())<EOL>rules.update(d)<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in spec: <EOL><INDENT>rules = {<EOL>'<STR_LIT>': spec['<STR_LIT>'] <EOL>}<EOL><DEDENT>if rules is None or len(rules) == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>raise InvalidParameters("<STR_LIT>")<EOL><DEDENT>files = dict([(f, open(f).read()) for f in spec['<STR_LIT>']])<EOL>for r in rules:<EOL><INDENT>if '<STR_LIT>' not in rules[r]:<EOL><INDENT>continue<EOL><DEDENT>minr2 = float(rules[r]['<STR_LIT>'])<EOL>for f in files:<EOL><INDENT>match = re.search(r"<STR_LIT>", files[f])<EOL>if match is None:<EOL><INDENT>status.append({<EOL>'<STR_LIT:target>': f,<EOL>'<STR_LIT>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT>': r,<EOL>'<STR_LIT:status>': "<STR_LIT>",<EOL>'<STR_LIT:message>': "<STR_LIT>"<EOL>})<EOL><DEDENT>else:<EOL><INDENT>r2 = match.group(<NUM_LIT:1>)<EOL>r2 = float(r2)<EOL>if r2 > minr2:<EOL><INDENT>status.append({<EOL>'<STR_LIT:target>': f,<EOL>'<STR_LIT>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT>': r,<EOL>'<STR_LIT:status>': "<STR_LIT:OK>",<EOL>'<STR_LIT:message>': "<STR_LIT>"<EOL>})<EOL><DEDENT>else:<EOL><INDENT>status.append({<EOL>'<STR_LIT:target>': f,<EOL>'<STR_LIT>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT>': r,<EOL>'<STR_LIT:status>': "<STR_LIT>",<EOL>'<STR_LIT:message>': "<STR_LIT>"<EOL>})<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return status<EOL>
Evaluate the files identified for checksum.