<commit_before>"""Command-line support for Coverage."""

import optparse, re, sys

from coverage.backward import sorted                # pylint: disable-msg=W0622
from coverage.execfile import run_python_file
from coverage.misc import CoverageException


class Opts(object):
    """A namespace class for individual options we'll build parsers from."""

    append = optparse.Option(
        '-a', '--append', action='store_false', dest="erase_first",
        help="Append coverage data to .coverage, otherwise it is started "
                "clean with each run."
        )
    branch = optparse.Option(
        '', '--branch', action='store_true',
        help="Measure branch coverage in addition to statement coverage."
        )
    directory = optparse.Option(
        '-d', '--directory', action='store',
        metavar="DIR",
        help="Write the output files to DIR."
        )
    help = optparse.Option(
        '-h', '--help', action='store_true',
        help="Get help on this command."
        )
    ignore_errors = optparse.Option(
        '-i', '--ignore-errors', action='store_true',
        help="Ignore errors while reading source files."
        )
    pylib = optparse.Option(
        '-L', '--pylib', action='store_true',
        help="Measure coverage even inside the Python installed library, "
                "which isn't done by default."
        )
    show_missing = optparse.Option(
        '-m', '--show-missing', action='store_true',
        help="Show line numbers of statements in each module that weren't "
                "executed."
        )
    old_omit = optparse.Option(
        '-o', '--omit', action='store',
        metavar="PRE1,PRE2,...",
        help="Omit files when their filename path starts with one of these "
                "prefixes."
        )
    omit = optparse.Option(
        '', '--omit', action='store',
        metavar="PRE1,PRE2,...",
        help="Omit files when their filename path starts with one of these "
                "prefixes."
        )
    output_xml = optparse.Option(
        '-o', '', action='store', dest="outfile",
        metavar="OUTFILE",
        help="Write the XML report to this file. Defaults to 'coverage.xml'"
        )
    parallel_mode = optparse.Option(
        '-p', '--parallel-mode', action='store_true',
        help="Include the machine name and process id in the .coverage "
                "data file name."
        )
    rcfile = optparse.Option(
        '', '--rcfile', action='store',
        help="Specify configuration file.  Defaults to '.coveragerc'"
        )
    timid = optparse.Option(
        '', '--timid', action='store_true',
        help="Use a simpler but slower trace method.  Try this if you get "
                "seemingly impossible results!"
        )
    version = optparse.Option(
        '', '--version', action='store_true',
        help="Display version information and exit."
        )


class CoverageOptionParser(optparse.OptionParser, object):
    """Base OptionParser for coverage.

    Problems don't exit the program.
    Defaults are initialized for all options.

    """

    def __init__(self, *args, **kwargs):
        super(CoverageOptionParser, self).__init__(
            add_help_option=False, *args, **kwargs
            )
        self.set_defaults(
            actions=[],
            branch=None,
            directory=None,
            help=None,
            ignore_errors=None,
            omit=None,
            parallel_mode=None,
            pylib=None,
            rcfile=True,
            show_missing=None,
            timid=None,
            erase_first=None,
            version=None,
            )

        self.disable_interspersed_args()
        self.help_fn = lambda: None

    class OptionParserError(Exception):
        """Used to stop the optparse error handler ending the process."""
        pass<commit_msg>Lint-friendly help noop function.<commit_after>"""Command-line support for Coverage."""

import optparse, re, sys

from coverage.backward import sorted                # pylint: disable-msg=W0622
from coverage.execfile import run_python_file
from coverage.misc import CoverageException


class Opts(object):
    """A namespace class for individual options we'll build parsers from."""

    append = optparse.Option(
        '-a', '--append', action='store_false', dest="erase_first",
        help="Append coverage data to .coverage, otherwise it is started "
                "clean with each run."
        )
    branch = optparse.Option(
        '', '--branch', action='store_true',
        help="Measure branch coverage in addition to statement coverage."
        )
    directory = optparse.Option(
        '-d', '--directory', action='store',
        metavar="DIR",
        help="Write the output files to DIR."
        )
    help = optparse.Option(
        '-h', '--help', action='store_true',
        help="Get help on this command."
        )
    ignore_errors = optparse.Option(
        '-i', '--ignore-errors', action='store_true',
        help="Ignore errors while reading source files."
        )
    pylib = optparse.Option(
        '-L', '--pylib', action='store_true',
        help="Measure coverage even inside the Python installed library, "
                "which isn't done by default."
        )
    show_missing = optparse.Option(
        '-m', '--show-missing', action='store_true',
        help="Show line numbers of statements in each module that weren't "
                "executed."
        )
    old_omit = optparse.Option(
        '-o', '--omit', action='store',
        metavar="PRE1,PRE2,...",
        help="Omit files when their filename path starts with one of these "
                "prefixes."
        )
    omit = optparse.Option(
        '', '--omit', action='store',
        metavar="PRE1,PRE2,...",
        help="Omit files when their filename path starts with one of these "
                "prefixes."
        )
    output_xml = optparse.Option(
        '-o', '', action='store', dest="outfile",
        metavar="OUTFILE",
        help="Write the XML report to this file. Defaults to 'coverage.xml'"
        )
    parallel_mode = optparse.Option(
        '-p', '--parallel-mode', action='store_true',
        help="Include the machine name and process id in the .coverage "
                "data file name."
        )
    rcfile = optparse.Option(
        '', '--rcfile', action='store',
        help="Specify configuration file.  Defaults to '.coveragerc'"
        )
    timid = optparse.Option(
        '', '--timid', action='store_true',
        help="Use a simpler but slower trace method.  Try this if you get "
                "seemingly impossible results!"
        )
    version = optparse.Option(
        '', '--version', action='store_true',
        help="Display version information and exit."
        )


class CoverageOptionParser(optparse.OptionParser, object):
    """Base OptionParser for coverage.

    Problems don't exit the program.
    Defaults are initialized for all options.

    """

    def __init__(self, *args, **kwargs):
        super(CoverageOptionParser, self).__init__(
            add_help_option=False, *args, **kwargs
            )
        self.set_defaults(
            actions=[],
            branch=None,
            directory=None,
            help=None,
            ignore_errors=None,
            omit=None,
            parallel_mode=None,
            pylib=None,
            rcfile=True,
            show_missing=None,
            timid=None,
            erase_first=None,
            version=None,
            )

        self.disable_interspersed_args()
        self.help_fn = self.help_noop

    def help_noop(self, error=None, topic=None, parser=None):
        """No-op help function."""
        pass

    class OptionParserError(Exception):
        """Used to stop the optparse error handler ending the process."""
        pass
{'fraction_non_alphanumeric': 0.1200710029161912, 'fraction_numerical': 0.0020286547483200205, 'mean_word_length': 2.066874027993779, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5480934', 'n_tokens_mistral': 2182, 'n_tokens_neox': 2124, 'n_words': 604}