def _match(self, check):
matches = []<EOL>tests = {}<EOL>for k,v in check.iteritems():<EOL><INDENT>if isinstance(v, dict):<EOL><INDENT>tests[k] = CompositeFilter(v)<EOL><DEDENT>else:<EOL><INDENT>tests[k] = lambda o: o==v<EOL><DEDENT><DEDENT>for rec in self._records.itervalues():<EOL><INDENT>if self._match_one(rec, tests):<EOL><INDENT>matches.append(copy(rec))<EOL><DEDENT><DEDENT>return matches<EOL>
Find all the matches for a check dict.