def get_user_id_from_email(email):
 class _FakeUser(ndb.Model, ):
  _use_memcache = False
  _use_cache = False
  user = ndb.UserProperty(required=True)
 try:
  fake_user = users.User(email)
 except users.UserNotFoundError:
  logging.error(('The email address %s does not correspond to a valid user_id' % email))
  return None
 key = _FakeUser(id=email, user=fake_user).put()
 obj = _FakeUser.get_by_id(key.id())
 user_id = obj.user.user_id()
 if user_id:
  return unicode(user_id)
 else:
  return None

def get_user_id_from_email ( email ) : class _FakeUser ( ndb . Model , ) : _use_memcache = False _use_cache = False user = ndb . UserProperty ( required = True ) try : fake_user = users . User ( email ) except users . UserNotFoundError : logging . error ( ( 'The email address %s does not correspond to a valid user_id' % email ) ) return None key = _FakeUser ( id = email , user = fake_user ) . put ( ) obj = _FakeUser . get_by_id ( key . id ( ) ) user_id = obj . user . user_id ( ) if user_id : return unicode ( user_id ) else : return None
given an email address .