<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_context_override(self, request):
 """ Override the request object with an emulated user. """

        context_override = super(EmulateUserModelMixin, self).get_context_override(request)
        try:
            if request.user.is_staff:
                user = self.UserModel.objects.get(pk=request.session['emulate_user_id'])
                context_override.update(user=user)
        except (self.UserModel.DoesNotExist, KeyError):
            pass
        return context_override