def create_task_comment(user_id, task_id, relation_id, comment):
        """Creates a new task comment.

        Creates a new task comment with provided data.

        Arguments:
            user_id: The id of the user.
            task_id: The id of the task.
            relation_id: The id of the relation.
            comment: A string containing the comment.

        Returns:
            A tuple with two elements.
            The first element is a dictionary containing a key 'message'
            containing a string which indicates whether or not the task comment
            was created successfully.
            The second is the HTTP response code.
        """

        is_valid = validate_data_for_task_comment(user_id, task_id,
                                                  relation_id)
        if is_valid != {}:
            return is_valid

        task_comment = TaskCommentModel(user_id, task_id, relation_id, comment)
        task_comment.save_to_db()

        return messages.TASK_COMMENT_WAS_CREATED_SUCCESSFULLY, HTTPStatus.CREATED
    def get_all_task_comments_by_user_id(user_id):
        """Returns all the task comments using specified user id.

        Arguments:
            user_id: The id of the user.

        Returns:
            A tuple with two elements.
            The list of task comments that have given user id
            and the HTTP response code.
        """

        return TaskCommentModel.find_all_by_user_id(user_id), HTTPStatus.OK
    def get_task_comment(user_id, _id):
        """Returns the task comment suing specified id.

        Arguments:
            user_id: The id of the user.
            _id: The id of the task comment.

        Returns:
            A tuple with two elements.
            The task comment that has given id and the HTTP response code.
        """

        task_comment = TaskCommentModel.find_by_id(_id)

        if task_comment:
            return task_comment, HTTPStatus.OK

        return messages.TASK_COMMENT_DOES_NOT_EXIST, HTTPStatus.NOT_FOUND
    def get_all_task_comments_by_task_id(user_id, task_id, relation_id):
        """Returns all the task comments using specified task id.

        Arguments:
            user_id: The id of the user.
            task_id: The id of the task.
            relation_id: The id of the relation.

        Returns:
            A tuple with two elements.
            The list of task comments that have given task id
            and the HTTP response code.
        """

        is_valid = validate_data_for_task_comment(user_id, task_id,
                                                  relation_id)
        if is_valid != {}:
            return is_valid

        comments_list = TaskCommentModel.find_all_by_task_id(
            task_id, relation_id)
        return [comment.json() for comment in comments_list]
    def delete_comment(user_id, _id, task_id, relation_id):
        """Deletes comment specified by id.

        Arguments:
            user_id: The id of the user.
            _id: The id of the task comment.
            task_id: The id of the task.
            relation_id: The id of the relation.

        Returns:
            A tuple with two elements.
            The first element is a dictionary containing a key 'message'
            containing a string which indicates whether or not the task comment
            was deleted successfully.
            The second is the HTTP response code.
        """

        is_valid = validate_data_for_task_comment(user_id, task_id,
                                                  relation_id)
        if is_valid != {}:
            return is_valid

        task_comment = TaskCommentModel.find_by_id(_id)

        if task_comment is None:
            return messages.TASK_COMMENT_DOES_NOT_EXIST, HTTPStatus.NOT_FOUND

        if task_comment.user_id != user_id:
            return messages.TASK_COMMENT_WAS_NOT_CREATED_BY_YOU_DELETE, HTTPStatus.FORBIDDEN

        if task_comment.task_id != task_id:
            return messages.TASK_COMMENT_WITH_GIVEN_TASK_ID_DOES_NOT_EXIST, HTTPStatus.NOT_FOUND

        if task_comment:
            task_comment.delete_from_db()
            return messages.TASK_COMMENT_WAS_DELETED_SUCCESSFULLY, HTTPStatus.OK

        return messages.TASK_COMMENT_DOES_NOT_EXIST, HTTPStatus.NOT_FOUND
    def modify_comment(user_id, _id, task_id, relation_id, comment):
        """Modifies comment to a new one.

        Arguments:
            user_id: The id of the user.
            _id: The id of the task comment.
            task_id: The id of the task.
            relation_id: The id of the relation.
            comment: New comment.

        Returns:
            A tuple with two elements.
            The first element is a dictionary containing a key 'message'
            containing a string which indicates whether or not the task comment
            was updated successfully.
            The second is the HTTP response code.
        """

        is_valid = validate_data_for_task_comment(user_id, task_id,
                                                  relation_id)
        if is_valid != {}:
            return is_valid

        task_comment = TaskCommentModel.find_by_id(_id)

        if task_comment is None:
            return messages.TASK_COMMENT_DOES_NOT_EXIST, HTTPStatus.NOT_FOUND

        if task_comment.user_id != user_id:
            return messages.TASK_COMMENT_WAS_NOT_CREATED_BY_YOU, HTTPStatus.BAD_REQUEST

        if task_comment.task_id != task_id:
            return messages.TASK_COMMENT_WITH_GIVEN_TASK_ID_DOES_NOT_EXIST, HTTPStatus.NOT_FOUND

        task_comment.modify_comment(comment)
        task_comment.save_to_db()

        return messages.TASK_COMMENT_WAS_UPDATED_SUCCESSFULLY, HTTPStatus.OK