<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def put(self, request):
 """ Update a single profile for a given video. Example request data: { 'edx_video_id': '1234' 'profile': 'hls', 'encode_data': { 'url': 'foo.com/qwe.m3u8' 'file_size': 34 'bitrate': 12 } } """

        edx_video_id = request.data['edx_video_id']
        profile = request.data['profile']
        encode_data = request.data['encode_data']

        video = Video.objects.get(edx_video_id=edx_video_id)
        profile = Profile.objects.get(profile_name=profile)

        # Delete existing similar profile if its present and
        # create new one with updated data.
        EncodedVideo.objects.filter(video=video, profile=profile).delete()
        EncodedVideo.objects.create(video=video, profile=profile, **encode_data)

        return Response(status=status.HTTP_200_OK)