python
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
SECRET_KEY = 'your_secret_key'
data = {'user_id': 1, 'email': 'example@example.com'}
token = s.dumps(data)
try:
decoded_data = s.loads(token)
except:
print('Invalid token')