def get_comment_offset_intervals(line_text, comment_start):
    """Return intervals for comment syntax with offset.

    Such syntax separates normal comment text from special
    "todo" words (TODO, XXX and FIXME). The offset is
    need because the comment doesn't always start from
    the first index of the line text.

    Parameters
    ==========
    line_text (string)
        line which contains the comment (comment may
        be entire line or part of it).
    comment_start (integer)
        represent index from which comment starts in
        the line.
    """
    ### get slice of line where lies the comment
    comment = line_text[comment_start:]

    ### retrieve intervals from the comment mapped to
    ### names of categories according to an specific
    ### comment syntax (one which separates normal
    ### comment text from "todo" words)
    data = get_comment_syntax_map(comment)

    ### the data we just grab is a dict; it has another
    ### dict in its 0 (zero) key; we'll use the items
    ### from that dict in the 0 key as our source of data;
    ###
    ### such items consists of pairs in which the first
    ### element are intervals and the second elements
    ### are the name of the category of content that
    ### interval contains which is either 'normal' for
    ### normal comment text or 'todo_word' for special
    ### todo words (todo, xxx and fixme, when all letters
    ### are in uppercase)
    interval_category_pairs = data[0].items()

    ### finally return a list of pairs where the first
    ### element is an offset interval and the second pair
    ### is the name of the category to which the content
    ### in that interval belogs

    return [
        ## 2-tuple (pair)
        (
            ## 1st item:
            ## the interval, but offset by the comment start
            (including_start + comment_start, excluding_end + comment_start),
            ## 2nd item:
            ## custom category name based on the original value
            ## of the category name from the data source
            ("comment" if category_name == "normal" else "todo_word"),
        )
        ## note that the key from the data source is further
        ## decomposed into the interval boundaries called
        ## "including_start" and "excluding_end" and the
        ## value, called category_name, is used as-is
        for (including_start, excluding_end), category_name in interval_category_pairs
    ]
Return intervals for comment syntax with offset.

    Such syntax separates normal comment text from special
    "todo" words (TODO, XXX and FIXME). The offset is
    need because the comment doesn't always start from
    the first index of the line text.

    Parameters
    ==========
    line_text (string)
        line which contains the comment (comment may
        be entire line or part of it).
    comment_start (integer)
        represent index from which comment starts in
        the line.
    
nodezator/syntaxman/syntaxes/python/utils.py