def METHOD_NAME(request, user_slug):
    if user_slug == "me":
        return redirect("profile", request.me.slug, permanent=False)
    user = get_object_or_404(User, slug=user_slug)
    if request.me and user.id == request.me.id:
        # handle auth redirect
        goto = request.GET.get("goto")
        if goto and goto.startswith(settings.APP_HOST):
            return redirect(goto)
        # moderation status check for new-joiners
        access_denied = check_user_permissions(request)
        if access_denied:
            return access_denied
    if not user.can_view(request.me):
        return render(request, "auth/private_profile.html")
    if user.moderation_status != User.MODERATION_STATUS_APPROVED and not request.me.is_moderator:
        # hide unverified users
        raise Http404()
    # select user tags and calculate similarity with me
    tags = Tag.objects.filter(is_visible=True).exclude(group=Tag.GROUP_COLLECTIBLE).all()
    user_tags = UserTag.objects.filter(user=user).select_related("tag").all()
    active_tags = {t.tag_id for t in user_tags if t.tag.group != Tag.GROUP_COLLECTIBLE}
    collectible_tags = [t.tag for t in user_tags if t.tag.group == Tag.GROUP_COLLECTIBLE]
    similarity = {}
    if request.me and user.id != request.me.id:
        my_tags = {t.tag_id for t in UserTag.objects.filter(user=request.me).all()}
        similarity = calculate_similarity(my_tags, active_tags, tags)
    # select other stuff from this user
    intro = Post.get_user_intro(user)
    projects = Post.objects.filter(author=user, type=Post.TYPE_PROJECT, is_visible=True).all()
    badges = UserBadge.user_badges_grouped(user=user)
    achievements = UserAchievement.objects.filter(user=user).select_related("achievement")
    expertises = UserExpertise.objects.filter(user=user).all()
    posts = Post.objects_for_user(request.me).filter(is_visible=True)\
        .filter(Q(author=user) | Q(coauthors__contains=[user.slug]))\
        .exclude(type__in=[Post.TYPE_INTRO, Post.TYPE_PROJECT, Post.TYPE_WEEKLY_DIGEST])\
        .order_by("-published_at")
    if request.me:
        comments = Comment.visible_objects()\
            .filter(author=user, post__is_visible=True)\
            .order_by("-created_at")\
            .select_related("post")
        friend = Friend.objects.filter(user_from=request.me, user_to=user).first()
        muted = Muted.objects.filter(user_from=request.me, user_to=user).first()
        note = UserNote.objects.filter(user_from=request.me, user_to=user).first()
    else:
        comments = None
        friend = None
        muted = None
        note = None
    moderator_notes = []
    if request.me and request.me.is_moderator:
        moderator_notes = UserNote.objects.filter(user_to=user)\
            .exclude(user_from=request.me)\
            .select_related("user_from")\
            .all()
    return render(request, "users/profile.html", {
        "user": user,
        "intro": intro,
        "projects": projects,
        "badges": badges,
        "tags": tags,
        "active_tags": active_tags,
        "collectible_tags": collectible_tags,
        "achievements": [ua.achievement for ua in achievements],
        "expertises": expertises,
        "comments": comments[:3] if comments else [],
        "comments_total": comments.count() if comments else 0,
        "posts": posts[:15],
        "posts_total": posts.count() if posts else 0,
        "similarity": similarity,
        "friend": friend,
        "muted": muted,
        "note": note,
        "moderator_notes": moderator_notes,
    })