def pick_env_and_run_and_report(
        self, env: env_tools.PreparedEnv, verbose: bool, previous_failures: set[Check]
    ) -> CheckResult:
        """Evaluates this check in python 3 or 2.7, and reports to github.

        If the prepared environments are not linked to a github repository,
        with a known access token, reporting to github is skipped.

        Args:
            env: A prepared python 3 environment.
            verbose: When set, more progress output is produced.
            previous_failures: Checks that have already run and failed.

        Returns:
            A CheckResult instance.
        """
        env.report_status_to_github('pending', 'Running...', self.context())
        os.chdir(cast(str, env.destination_directory))

        result = self.run(env, verbose, previous_failures)

        if result.unexpected_error is not None:
            env.report_status_to_github('error', 'Unexpected error.', self.context())
        else:
            env.report_status_to_github(
                'success' if result.success else 'failure', result.message, self.context()
            )

        return result
Evaluates this check in python 3 or 2.7, and reports to github.

        If the prepared environments are not linked to a github repository,
        with a known access token, reporting to github is skipped.

        Args:
            env: A prepared python 3 environment.
            verbose: When set, more progress output is produced.
            previous_failures: Checks that have already run and failed.

        Returns:
            A CheckResult instance.
        
dev_tools/check.py