def run_pep8_for_package(package_name, extra_ignore=None):
    import pep8

    class Checker(pep8.Checker):
        """
        Subclass pep8's Checker to hook into error reporting.
        """
        def __init__(self, *args, **kwargs):
            super(Checker, self).__init__(*args, **kwargs)
            self.report_error = self._report_error

        def _report_error(self, line_number, offset, text, check):
            """
            Store pairs of line numbers and errors.
            """
            self.errors.append((line_number, text.split(" ", 1)[1]))

        def check_all(self, *args, **kwargs):
            """
            Assign the errors attribute and return it after running.
            """
            self.errors = []
            super(Checker, self).check_all(*args, **kwargs)
            return self.errors

    def pep8_checker(path):
        for line_number, text in Checker(path).check_all():
            yield "%s:%s: %s" % (path, line_number, text)

    args = (pep8_checker, package_name, extra_ignore)
    return _run_checker_for_package(*args)
Test the _write_sheet_views() method with freeze panes
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/utils/tests.py/run_pep8_for_package--crossover with--dataset/ETHPy150Open jmcnamara/XlsxWriter/xlsxwriter/test/worksheet/test_write_sheet_views7.py/TestWriteSheetViews.test_write_sheet_views1