(cls, item, spec)
return comments if comments != () else ""
Return the comments for the question specified in the spec.
        If the spec does not contain a `comment` field, then the `question`
        field is used to build the path to the comment question.
Return the comments for the question specified in the spec.
        If the spec does not contain a `comment` field, then the `question`
        field is used to build the path to the comment question.
Return the comments for the question specified in the spec . If the spec does not contain a comment field then the question field is used to build the path to the comment question .
def _get_comments(cls, item, spec):
        """
        Return the comments for the question specified in the spec.
        If the spec does not contain a `comment` field, then the `question`
        field is used to build the path to the comment question.
        """
        comments_question = spec.get('comment', False)
        question_path = spec["question"]

        if not comments_question:
            parts = question_path[-1].split("_")
            parts.insert(1, "comments")
            comments_question = question_path[:-1] + ["_".join(parts)]

        if cls.comment_from_root:
            comments_question = spec.get("base_path")[:-1] + comments_question

        comments = cls._get_val(item, comments_question)
        return comments if comments != () else ""
def _get_comments ( cls , item , spec ) : comments_question = spec . get ( 'comment' , False ) question_path = spec [ "question" ] if not comments_question : parts = question_path [ - 1 ] . split ( "_" ) parts . insert ( 1 , "comments" ) comments_question = question_path [ : - 1 ] + [ "_" . join ( parts ) ] if cls . comment_from_root : comments_question = spec . get ( "base_path" ) [ : - 1 ] + comments_question comments = cls . _get_val ( item , comments_question ) return comments if comments != ( ) else ""