def chance(self, message, max_tries=<NUM_LIT>):
responses = set()<EOL>attempts = <NUM_LIT:0><EOL>expected = {'<STR_LIT>', None}<EOL>while responses != expected:<EOL><INDENT>responses.add(self.aml.get_reply(self.username, message))<EOL>attempts += <NUM_LIT:1><EOL>if attempts >= max_tries:<EOL><INDENT>break<EOL><DEDENT><DEDENT>self.assertEqual(responses, expected)<EOL>
Test a chance statement using brute force
:param message: The message triggering a chance statement
:type  message: str

:param max_tries: The maximum number of attempts to make before giving up
:type  max_tries: int