def load_auth_tokens(user=None):
 if (user is None):
  user = users.get_current_user()
 if (user is None):
  return {}
 pickled_tokens = memcache.get(('gdata_pickled_tokens:%s' % user))
 if pickled_tokens:
  return pickle.loads(pickled_tokens)
 user_tokens = TokenCollection.all().filter('user =', user).get()
 if user_tokens:
  memcache.set(('gdata_pickled_tokens:%s' % user), user_tokens.pickled_tokens)
  return pickle.loads(user_tokens.pickled_tokens)
 return {}

def load_auth_tokens ( user = None ) : if ( user is None ) : user = users . get_current_user ( ) if ( user is None ) : return { } pickled_tokens = memcache . get ( ( 'gdata_pickled_tokens:%s' % user ) ) if pickled_tokens : return pickle . loads ( pickled_tokens ) user_tokens = TokenCollection . all ( ) . filter ( 'user =' , user ) . get ( ) if user_tokens : memcache . set ( ( 'gdata_pickled_tokens:%s' % user ) , user_tokens . pickled_tokens ) return pickle . loads ( user_tokens . pickled_tokens ) return { }
reads a dictionary of the current users tokens from the datastore .