def _state(self, variable, num):
value = getattr(self, variable)<EOL>if value is None:<EOL><INDENT>return False<EOL><DEDENT>if value is True:<EOL><INDENT>return True<EOL><DEDENT>if random.randint(<NUM_LIT:1>, num) == num:<EOL><INDENT>setattr(self, variable, True)<EOL>return True<EOL><DEDENT>return False<EOL>
Generic method to randomly determine if state is reached