def _profile_view(profile, is_profile=False):
    # TODO: Fix circular import
    from website.addons.badges.util import get_sorted_user_badges

    if profile and profile.is_disabled:
        raise HTTPError(http.GONE)

    if settings.ADDONS_REQUESTED in 'badges':
        badge_assertions = get_sorted_user_badges(profile),
        badges = _get_user_created_badges(profile)
    else:
        # NOTE: While badges, are unused, 'assertions' and 'badges' can be
        # empty lists.
        badge_assertions = []
        badges = []

    if profile:
        profile_user_data = profile_utils.serialize_user(profile, full=True, is_profile=is_profile)
        return {
            'profile': profile_user_data,
            'assertions': badge_assertions,
            'badges': badges,
            'user': {
                'is_profile': is_profile,
                'can_edit': None,  # necessary for rendering nodes
                'permissions': [],  # necessary for rendering nodes
            },
        }

    raise HTTPError(http.NOT_FOUND)
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/profile/views.py/_profile_view/swapped operands of `in`