def _apply_each_methods(self, i, r,<EOL>summarize=False,<EOL>report_unexpected_exceptions=True,<EOL>context=None):
for a in dir(self):<EOL><INDENT>if a.startswith('<STR_LIT>'):<EOL><INDENT>rdict = self._as_dict(r)<EOL>f = getattr(self, a)<EOL>try:<EOL><INDENT>f(rdict)<EOL><DEDENT>except Exception as e:<EOL><INDENT>if report_unexpected_exceptions:<EOL><INDENT>p = {'<STR_LIT:code>': UNEXPECTED_EXCEPTION}<EOL>if not summarize:<EOL><INDENT>p['<STR_LIT:message>'] = MESSAGES[UNEXPECTED_EXCEPTION] % (e.__class__.__name__, e)<EOL>p['<STR_LIT>'] = i + <NUM_LIT:1><EOL>p['<STR_LIT>'] = r<EOL>p['<STR_LIT>'] = e<EOL>p['<STR_LIT>'] = '<STR_LIT>' % (f.__name__,<EOL>f.__doc__)<EOL>if context is not None: p['<STR_LIT>'] = context<EOL><DEDENT>yield p<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Invoke 'each' methods on `r`.