def user_id_exists(user_id, context):
 model = context['model']
 session = context['session']
 result = session.query(model.User).get(user_id)
 if (not result):
  raise Invalid(('%s: %s' % (_('Not found'), _('User'))))
 return user_id

def user_id_exists ( user_id , context ) : model = context [ 'model' ] session = context [ 'session' ] result = session . query ( model . User ) . get ( user_id ) if ( not result ) : raise Invalid ( ( '%s: %s' % ( _ ( 'Not found' ) , _ ( 'User' ) ) ) ) return user_id
raises invalid if the given user_id does not exist in the model given in the context .