@serviced
    def post(self, request, service, address=None):
        '''
        Authorizes one address to shape another address,
        based on the provided auth token.
        '''
        if address is None:
            return Response(
                {'details': 'no address provided'},
                status=status.HTTP_400_BAD_REQUEST
                )
        controlled_ip = address

        controlling_ip = get_client_ip(request)

        if request.data not in 'token':
            token = None
        else:
            token = AccessToken(token=request.data['token'])

        dev = TrafficControlledDevice(
            controlledIP=controlled_ip,
            controllingIP=controlling_ip
            )

        worked = service.requestRemoteControl(dev, token)

        if not worked:
            return Response(
                {'details': 'invalid token provided'},
                status=status.HTTP_401_UNAUTHORIZED,
                )

        print 'Worked:', worked

        data = {
            'controlling_ip': controlling_ip,
            'controlled_ip': controlled_ip,
        }

        return Response(data, status=status.HTTP_200_OK)
dataset/ETHPy150Open facebook/augmented-traffic-control/atc/django-atc-api/atc_api/views.py/AuthApi.post/swapped operands of `not in`