code: def get_last_nonce(app, key, nonce):
      
      if not hasattr(app, 'example_nonce_db'):
          # store nonces as a pair {key: lastnonce}
          app.example_nonce_db = {}
      if not key in app.example_nonce_db:
          app.example_nonce_db[key] = nonce
          return 0
      else:
          oldnonce = copy.copy(app.example_nonce_db[key])
          app.example_nonce_db[key] = nonce
          return oldnonce
docs: This method is only an example! Replace it with a real nonce database.
  
      :param str key: the public key the nonce belongs to
      :param int nonce: the latest nonce