def _raise_exc(self, times, retval=None):
<EOL>self.raised = <NUM_LIT:0><EOL>def raiser(*args, **kwargs):<EOL><INDENT>if self.raised < times:<EOL><INDENT>self.raised += <NUM_LIT:1><EOL>raise ConnectionError()<EOL><DEDENT>return retval<EOL><DEDENT>return raiser<EOL>
Function which raises ConnectionError `times` times.