def get_user_from_uid(uid):
    if uid is None:
        raise ValidationError(_("uid is required!"))
    try:
        uid = urlsafe_base64_decode(uid)
        user = User.objects.get(pk=uid)
    except (TypeError, __HOLE__, OverflowError, User.DoesNotExist):
        raise ValidationError(_(u"Invalid uid %s") % uid)

    return user
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/serializers/password_reset_serializer.py/get_user_from_uid