<commit_before>from cumulusci.tasks.github import BaseGithubTask
from cumulusci.tasks.release_notes.generator import GithubReleaseNotesGenerator
from cumulusci.tasks.release_notes.generator import PublishingGithubReleaseNotesGenerator

class GithubReleaseNotes(BaseGithubTask):

    task_options = {
        'tag': {
            'description': "The tag to generate release notes for.  Ex: release/1.2",
            'required': True,
        },
        'publish': {
            'description': "If True, publishes to the release matching the tag release notes were generated for.",
        },
        'last_tag': {
            'description': "Override the last release tag.  This is useful to generate release notes if you skipped one or more release",
        },
        'link_pr': {
            'description': 'If True, insert link to source pull request at end of each line.',
        }
    }
    
    def _run_task(self):
        github_info = {
            'github_owner': self.project_config.repo_owner,
            'github_repo': self.project_config.repo_name,
            'github_username': self.github_config.username,
            'github_password': <PASSWORD>,
            'master_branch': self.project_config.project__git__default_branch,
            'prefix_beta': self.project_config.project__git__prefix_beta,
            'prefix_prod': self.project_config.project__git__prefix_release,
        }
        
        publish = self.options.get('publish', False) in (True, 'True', 'true')
        link_pr = self.options.get('link_pr', False) in (True, 'True', 'true')
        last_tag = self.options.get('last_tag', None)

        generator_class = GithubReleaseNotesGenerator

        if publish:
            generator_class = PublishingGithubReleaseNotesGenerator

        generator = generator_class(
            github_info,
            self.options['tag'],
            last_tag,
            link_pr,
        ) 
  
        release_notes = generator()
        self.logger.info('\n' + release_notes)<commit_msg>formatting<commit_after>from cumulusci.tasks.github import BaseGithubTask
from generator import GithubReleaseNotesGenerator
from generator import PublishingGithubReleaseNotesGenerator


class GithubReleaseNotes(BaseGithubTask):

    task_options = {
        'tag': {
            'description': ('The tag to generate release notes for.' +
                ' Ex: release/1.2'),
            'required': True,
        },
        'publish': {
            'description': ('If True, publishes to the release matching the' +
                ' tag release notes were generated for.'),
        },
        'last_tag': {
            'description': ('Override the last release tag. This is useful' +
                ' to generate release notes if you skipped one or more' +
                ' releases.'),
        },
        'link_pr': {
            'description': ('If True, insert link to source pull request at' +
                ' end of each line.'),
        }
    }

    def _run_task(self):
        github_info = {
            'github_owner': self.project_config.repo_owner,
            'github_repo': self.project_config.repo_name,
            'github_username': self.github_config.username,
            'github_password': <PASSWORD>_config.password,
            'master_branch': self.project_config.project__git__default_branch,
            'prefix_beta': self.project_config.project__git__prefix_beta,
            'prefix_prod': self.project_config.project__git__prefix_release,
        }

        publish = self.options.get('publish', False) in (True, 'True', 'true')
        link_pr = self.options.get('link_pr', False) in (True, 'True', 'true')
        last_tag = self.options.get('last_tag', None)

        if publish:
            generator_class = PublishingGithubReleaseNotesGenerator
        else:
            generator_class = GithubReleaseNotesGenerator

        generator = generator_class(
            github_info,
            self.options['tag'],
            last_tag,
            link_pr,
        )

        release_notes = generator()
        self.logger.info('\n' + release_notes)
{'fraction_non_alphanumeric': 0.09778642666018, 'fraction_numerical': 0.0009729992702505473, 'mean_word_length': 2.3028112449799196, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5379396', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1082, 'n_words': 260}