def create(self, request):
        # serializer = UserSerializer(data=request.data)
        # if serializer.is_valid():
        #     serializer.save()
        # return send_response(request.method, serializer)
        try:
            username = request.data.get('username')
            email = request.data.get('email')
            password = request.data.get('password')
            if not User.validate(username, email, password):
                return Response({'status': 'failure'})
            token = User.generate_token()
            user = User(username=username, email=email,
                        password=password, token=token)
            user.save()
            return Response({
                'id': user.id, 'username': user.username,
                'token': user.token, 'email': user.email,
                'status': 'success'})
        except Exception as e:
            return Response({'status': 'failure', 'message': str(e[0])}, status=400)
Create and delete security groups.
dataset/ETHPy150Open CiscoSystems/cognitive/cognitive/app/api/users.py/UserViewSet.create--crossover with--dataset/ETHPy150Open openstack/rally/rally/plugins/openstack/scenarios/nova/security_group.py/NovaSecGroup.create_and_delete_secgroups