def removeUser(self, group, user):
        # Remove group membership for this user.
        if 'groups' in user and group['_id'] in user['groups']:
            user['groups'].remove(group['_id'])

        # Remove outstanding requests from this user
        self._deleteRequest(group, user)

        # Remove any outstanding invitations for this group
        user['groupInvites'] = list(filter(
            lambda inv: not inv['groupId'] == group['_id'],
            user.get('groupInvites', [])))
        self.model('user').save(user, validate=False)

        # Remove all group access for this user on this group.
        self.setUserAccess(group, user, level=None, save=True)

        return group
Remove the user from the group. If the user is not in the group but
dataset/ETHPy150Open girder/girder/girder/models/group.py/Group.removeUser