<commit_before>#!/usr/bin/env python
from __future__ import print_function

import os
import re
import sys

CERTBOT_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))

NEW_SECTION_PATTERN = re.compile(r'^##\s*[\d.]+\s*-\s*[\d-]+$')


def main():
    version = sys.argv[1]

    section_pattern = re.compile(r'^##\s*{0}\s*-\s*[\d-]+$'
                                 .format(version.replace('.', '\\.')))

    with open(os.path.join(CERTBOT_ROOT, 'certbot', 'CHANGELOG.md')) as file_h:
        lines = file_h.read().splitlines()

    changelog = []

    i = 0
    while i < len(lines):
        if section_pattern.match(lines[i]):
            i = i + 1
            while i < len(lines):
                if NEW_SECTION_PATTERN.match(lines[i]):
                    break
                changelog.append(lines[i])
                i = i + 1
        i = i + 1

    changelog = [entry for entry in changelog if entry]

    print('\n'.join(changelog))


if __name__ == '__main__':
    main()<commit_msg>Insert new line before "More details about these changes can be found on our GitHub repo." (#8645)<commit_after>#!/usr/bin/env python
from __future__ import print_function

import os
import re
import sys

CERTBOT_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))

NEW_SECTION_PATTERN = re.compile(r'^##\s*[\d.]+\s*-\s*[\d-]+$')


def main():
    version = sys.argv[1]

    section_pattern = re.compile(r'^##\s*{0}\s*-\s*[\d-]+$'
                                 .format(version.replace('.', '\\.')))

    with open(os.path.join(CERTBOT_ROOT, 'certbot', 'CHANGELOG.md')) as file_h:
        lines = file_h.read().splitlines()

    changelog = []

    i = 0
    while i < len(lines):
        if section_pattern.match(lines[i]):
            i = i + 2
            while i < len(lines):
                if NEW_SECTION_PATTERN.match(lines[i]):
                    break
                changelog.append(lines[i])
                i = i + 1
        i = i + 1

    print('\n'.join(changelog))


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.1652046783625731, 'fraction_numerical': 0.007797270955165692, 'mean_word_length': 2.129573170731707, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4091563', 'n_tokens_mistral': 748, 'n_tokens_neox': 703, 'n_words': 143}