def new_game(self, mode=None):
<EOL>self._g = GameObject()<EOL>_mode = mode or "<STR_LIT>"<EOL>logging.debug("<STR_LIT>".format(_mode))<EOL>mode_info = self._g.get_game_type(gametype=_mode)<EOL>logging.debug("<STR_LIT>".format(mode_info, type(mode_info)))<EOL>if not mode_info:<EOL><INDENT>self._g = None<EOL>raise ValueError('<STR_LIT>'.format(_mode))<EOL><DEDENT>logging.debug("<STR_LIT>".format(mode_info.digitType))<EOL>dw = DigitWord(wordtype=mode_info.digitType)<EOL>dw.random(mode_info.digits)<EOL>logging.debug("<STR_LIT>".format(dw.word))<EOL>_game = {<EOL>"<STR_LIT:key>": str(uuid.uuid4()),<EOL>"<STR_LIT:status>": "<STR_LIT>",<EOL>"<STR_LIT>": int(time()) + <NUM_LIT>,<EOL>"<STR_LIT>": dw.word,<EOL>"<STR_LIT>": _mode,<EOL>"<STR_LIT>": mode_info.guesses_allowed,<EOL>"<STR_LIT>": <NUM_LIT:0><EOL>}<EOL>logging.debug("<STR_LIT>".format(_game))<EOL>self._g.from_json(jsonstr=json.dumps(_game))<EOL>return self._g.to_json()<EOL>
new_game() creates a new game. Docs TBC.

:return: JSON String containing the game object.