<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def revoke_member(context, request):
 """Revoke member roles in the group."""


    mapping = request.json['mapping']
    for entry in mapping:
        user = entry['user']
        roles = entry['roles']
        username = user.get('username', None)
        userid = user.get('userid', None)
        if userid:
            u = context.get_user_by_userid(userid)
        elif username:
            u = context.get_user_by_username(username)
        else:
            u = None
        if u is None:
            raise UnprocessableError(
                'User %s does not exists' % (userid or username))
        for rolename in roles:
            context.revoke_member_role(u.userid, rolename)
    return {'status': 'success'}