def get_user(request):
    if request.REQUEST in 'api_key':
        api_key = ApiKey.objects.get(key=request.REQUEST['api_key'])
        return api_key.user
    elif request.user.is_authenticated():
        return User.objects.get(pk=request.user.pk)
    else:
        return request.user
dataset/ETHPy150Open hydroshare/hydroshare2/ga_resources/views/rest_data.py/get_user/swapped operands of `in`