def _apply_header_checks(self, i, r, summarize=False, context=None):
for code, message in self._header_checks:<EOL><INDENT>if tuple(r) != self._field_names:<EOL><INDENT>p = {'<STR_LIT:code>': code}<EOL>if not summarize:<EOL><INDENT>p['<STR_LIT:message>'] = message<EOL>p['<STR_LIT>'] = i + <NUM_LIT:1><EOL>p['<STR_LIT>'] = tuple(r)<EOL>p['<STR_LIT>'] = set(self._field_names) - set(r)<EOL>p['<STR_LIT>'] = set(r) - set(self._field_names)<EOL>if context is not None: p['<STR_LIT>'] = context<EOL><DEDENT>yield p<EOL><DEDENT><DEDENT>
Apply header checks on the given record `r`.