<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def post(self, request, *args, **kwargs):
 # pylint: disable=unused-argument """ Inserts a batch of completions. REST Endpoint Format: { "username": "username", "course_key": "course-key", "blocks": { "block_key1": 0.0, "block_key2": 1.0, "block_key3": 1.0, } } **Returns** A Response object, with an appropriate status code. If successful, status code is 200. { "detail" : _("ok") } Otherwise, a 400 or 404 may be returned, and the "detail" content will explain the error. """

        batch_object = request.data or {}
        try:
            user, course_key, blocks = self._validate_and_parse(batch_object)
            BlockCompletion.objects.submit_batch_completion(user, course_key, blocks)
        except ValidationError as exc:
            return Response({
                "detail": _(' ').join(text_type(msg) for msg in exc.messages),
            }, status=status.HTTP_400_BAD_REQUEST)
        except ValueError as exc:
            return Response({
                "detail": text_type(exc),
            }, status=status.HTTP_400_BAD_REQUEST)
        except ObjectDoesNotExist as exc:
            return Response({
                "detail": text_type(exc),
            }, status=status.HTTP_404_NOT_FOUND)
        except DatabaseError as exc:
            return Response({
                "detail": text_type(exc),
            }, status=status.HTTP_500_INTERNAL_SERVER_ERROR)

        return Response({"detail": _("ok")}, status=status.HTTP_200_OK)