def retrieve_token(userid, secret):
 dtnow = datetime.datetime.now()
 dtutcnow = datetime.datetime.utcnow()
 delta = (dtnow - dtutcnow)
 (newhour, newmin) = divmod(((((((delta.days * 24) * 60) * 60) + delta.seconds) + 30) // 60), 60)
 newtime = ('%s%+02d:%02d' % (dtnow.isoformat(), newhour, newmin))
 custom_data = {'issuedAt': newtime, 'consumerKey': secret, 'userId': userid, 'ttl': 86400}
 newtoken = create_token(secret, custom_data)
 return newtoken

def retrieve_token ( userid , secret ) : dtnow = datetime . datetime . now ( ) dtutcnow = datetime . datetime . utcnow ( ) delta = ( dtnow - dtutcnow ) ( newhour , newmin ) = divmod ( ( ( ( ( ( ( delta . days * 24 ) * 60 ) * 60 ) + delta . seconds ) + 30 ) // 60 ) , 60 ) newtime = ( '%s%+02d:%02d' % ( dtnow . isoformat ( ) , newhour , newmin ) ) custom_data = { 'issuedAt' : newtime , 'consumerKey' : secret , 'userId' : userid , 'ttl' : 86400 } newtoken = create_token ( secret , custom_data ) return newtoken
return a token for the backend of annotations .