def METHOD_NAME(self, lines: list[str]) -> dict[str, str, list[str]]:
    name = 'Header'
    sections = {}
    comment = ''
    data = []
    for line in lines:
        line_strip = line.strip()
        if not line_strip:
            continue
        if line_strip.startswith('#'):
            comment += line.rstrip() + '\n'
        elif line_strip.startswith('$__'):
            sections[name] = [name, comment, data]
            #print(line_strip)
            if '#' in line_strip:
                linei, commenti = line_strip.split('#', 1)
                linei = linei.strip()
            else:
                linei = line_strip
                commenti = ''
            name = linei[3:-1]
            data = []
            comment = ''
            if commenti:
                comment = commenti + '\n'
        elif '#' in line_strip:
            #print(line_strip)
            linei, commenti = line_strip.split('#', 1)
            if commenti:
                comment += commenti + '\n'
            if linei:
                data.append((linei, comment))
                comment = ''
        else:
            data.append((line_strip, comment))
            comment = ''
    sections[name] = [name, comment, data]
    for name, section in sections.items():
        name, comment, data = section
        self.log.debug('name = %r' % name)
        if comment.strip() and 1:
            self.log.debug('comment = ')
            self.log.debug(comment)
            self.log.debug('*****')
        for (datai, commenti) in data:
            self.log.debug(datai)
        self.log.debug('#' * 80)
    return sections