def set_token(unique_key, token_str):
 result = memcache.set(unique_key, token_str)
 if (not result):
  result = memcache.delete(unique_key)
  if (result == 0):
   return False
 if Token(key_name=unique_key, t=token_str).put():
  return True
 return None

def set_token ( unique_key , token_str ) : result = memcache . set ( unique_key , token_str ) if ( not result ) : result = memcache . delete ( unique_key ) if ( result == 0 ) : return False if Token ( key_name = unique_key , t = token_str ) . put ( ) : return True return None
saves the serialized auth token in the datastore .