@classmethod
    @jsonify
    def badges_user_list(cls, slug=None):
        try:
            game = get_game_by_slug(slug)
            if game is None:
                raise ApiException('No game with that slug')
            # get the user from the environment
            # get a user model (simulation)
            user = get_current_user()
            # try to get a user_id from the context

            badges_obj = Badges.get_singleton(game)
            badges = badges_obj.badges
            badges_total_dict = dict((b['key'], b.get('total')) for b in badges)

            userbadges = badges_obj.find_userbadges_by_user(user.username)

            for key, userbadge in userbadges.iteritems():
                del userbadge['username']
                try:
                    total = badges_total_dict[key]
                except __HOLE__:
                    # the badge has been deleted or its key renamed so we just skip it
                    continue

                userbadge['total'] = total
                userbadge['achieved'] = (userbadge['current'] >= total)

            response.status_int = 200
            return {'ok': True, 'data': userbadges.values()}

        except BadgesUnsupportedException:
            return {'ok': False, 'data': []}
        except ApiException as message:
            response.status_int = 404
            return {'ok': False, 'msg': str(message)}
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/controllers/apiv1/badges.py/BadgesController.badges_user_list