code: def resume(self, obj):
          
          if isinstance(obj, str):
              savefile = open(obj, 'rb')
          else:
              savefile = obj
          game = pickle.loads(zlib.decompress(savefile.read()))
          if savefile is not obj:
              savefile.close()
          # Reinstate the random number generator.
          game.random_generator = random.Random()
          game.random_generator.setstate(game.random_state)
          del game.random_state
          return game
docs: Returns an Adventure game saved to the given file.