✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python37/lib64/python3.7/site-packages/coverage//results.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt

"""Results of coverage measurement."""

import collections

from coverage.backward import iitems
from coverage.misc import format_lines, SimpleRepr


class Analysis(object):
    """The results of analyzing a FileReporter."""

    def __init__(self, data, file_reporter):
        self.data = data
        self.file_reporter = file_reporter
        self.filename = self.file_reporter.filename
        self.statements = self.file_reporter.lines()
        self.excluded = self.file_reporter.excluded_lines()

        # Identify missing statements.
        executed = self.data.lines(self.filename) or []
        executed = self.file_reporter.translate_lines(executed)
        self.missing = self.statements - executed

        if self.data.has_arcs():
            self._arc_possibilities = sorted(self.file_reporter.arcs())
            self.exit_counts = self.file_reporter.exit_counts()
            self.no_branch = self.file_reporter.no_branch_lines()
            n_branches = self.total_branches()
            mba = self.missing_branch_arcs()
            n_partial_branches = sum(len(v) for k,v in iitems(mba) if k not in self.missing)
            n_missing_branches = sum(len(v) for k,v in iitems(mba))
        else:
            self._arc_possibilities = []
            self.exit_counts = {}
            self.no_branch = set()
            n_branches = n_partial_branches = n_missing_branches = 0

        self.numbers = Numbers(
            n_files=1,
            n_statements=len(self.statements),
            n_excluded=len(self.excluded),
            n_missing=len(self.missing),
            n_branches=n_branches,
            n_partial_branches=n_partial_branches,
            n_missing_branches=n_missing_branches,
        )

    def missing_formatted(self):
        """The missing line numbers, formatted nicely.

        Returns a string like "1-2, 5-11, 13-14".

        """
        return format_lines(self.statements, self.missing)

    def has_arcs(self):
        """Were arcs measured in this result?"""
        return self.data.has_arcs()

    def arc_possibilities(self):
        """Returns a sorted list of the arcs in the code."""
        return self._arc_possibilities

    def arcs_executed(self):
        """Returns a sorted list of the arcs actually executed in the code."""
        executed = self.data.arcs(self.filename) or []
        executed = self.file_reporter.translate_arcs(executed)
        return sorted(executed)

    def arcs_missing(self):
        """Returns a sorted list of the arcs in the code not executed."""
        possible = self.arc_possibilities()
        executed = self.arcs_executed()
        missing = (
            p for p in possible
                if p not in executed
                    and p[0] not in self.no_branch
        )
        return sorted(missing)

    def arcs_missing_formatted(self):
        """The missing branch arcs, formatted nicely.

        Returns a string like "1->2, 1->3, 16->20". Omits any mention of
        branches from missing lines, so if line 17 is missing, then 17->18
        won't be included.

        """
        arcs = self.missing_branch_arcs()
        missing = self.missing
        line_exits = sorted(iitems(arcs))
        pairs = []
        for line, exits in line_exits:
            for ex in sorted(exits):
                if line not in missing:
                    pairs.append("%d->%s" % (line, (ex if ex > 0 else "exit")))
        return ', '.join(pairs)

    def arcs_unpredicted(self):
        """Returns a sorted list of the executed arcs missing from the code."""
        possible = self.arc_possibilities()
        executed = self.arcs_executed()
        # Exclude arcs here which connect a line to itself.  They can occur
        # in executed data in some cases.  This is where they can cause
        # trouble, and here is where it's the least burden to remove them.
        # Also, generators can somehow cause arcs from "enter" to "exit", so
        # make sure we have at least one positive value.
        unpredicted = (
            e for e in executed
                if e not in possible
                    and e[0] != e[1]
                    and (e[0] > 0 or e[1] > 0)
        )
        return sorted(unpredicted)

    def branch_lines(self):
        """Returns a list of line numbers that have more than one exit."""
        return [l1 for l1,count in iitems(self.exit_counts) if count > 1]

    def total_branches(self):
        """How many total branches are there?"""
        return sum(count for count in self.exit_counts.values() if count > 1)

    def missing_branch_arcs(self):
        """Return arcs that weren't executed from branch lines.

        Returns {l1:[l2a,l2b,...], ...}

        """
        missing = self.arcs_missing()
        branch_lines = set(self.branch_lines())
        mba = collections.defaultdict(list)
        for l1, l2 in missing:
            if l1 in branch_lines:
                mba[l1].append(l2)
        return mba

    def branch_stats(self):
        """Get stats about branches.

        Returns a dict mapping line numbers to a tuple:
        (total_exits, taken_exits).
        """

        missing_arcs = self.missing_branch_arcs()
        stats = {}
        for lnum in self.branch_lines():
            exits = self.exit_counts[lnum]
            try:
                missing = len(missing_arcs[lnum])
            except KeyError:
                missing = 0
            stats[lnum] = (exits, exits - missing)
        return stats


class Numbers(SimpleRepr):
    """The numerical results of measuring coverage.

    This holds the basic statistics from `Analysis`, and is used to roll
    up statistics across files.

    """
    # A global to determine the precision on coverage percentages, the number
    # of decimal places.
    _precision = 0
    _near0 = 1.0              # These will change when _precision is changed.
    _near100 = 99.0

    def __init__(self, n_files=0, n_statements=0, n_excluded=0, n_missing=0,
                    n_branches=0, n_partial_branches=0, n_missing_branches=0
                    ):
        self.n_files = n_files
        self.n_statements = n_statements
        self.n_excluded = n_excluded
        self.n_missing = n_missing
        self.n_branches = n_branches
        self.n_partial_branches = n_partial_branches
        self.n_missing_branches = n_missing_branches

    def init_args(self):
        """Return a list for __init__(*args) to recreate this object."""
        return [
            self.n_files, self.n_statements, self.n_excluded, self.n_missing,
            self.n_branches, self.n_partial_branches, self.n_missing_branches,
        ]

    @classmethod
    def set_precision(cls, precision):
        """Set the number of decimal places used to report percentages."""
        assert 0 <= precision < 10
        cls._precision = precision
        cls._near0 = 1.0 / 10**precision
        cls._near100 = 100.0 - cls._near0

    @property
    def n_executed(self):
        """Returns the number of executed statements."""
        return self.n_statements - self.n_missing

    @property
    def n_executed_branches(self):
        """Returns the number of executed branches."""
        return self.n_branches - self.n_missing_branches

    @property
    def pc_covered(self):
        """Returns a single percentage value for coverage."""
        if self.n_statements > 0:
            numerator, denominator = self.ratio_covered
            pc_cov = (100.0 * numerator) / denominator
        else:
            pc_cov = 100.0
        return pc_cov

    @property
    def pc_covered_str(self):
        """Returns the percent covered, as a string, without a percent sign.

        Note that "0" is only returned when the value is truly zero, and "100"
        is only returned when the value is truly 100.  Rounding can never
        result in either "0" or "100".

        """
        pc = self.pc_covered
        if 0 < pc < self._near0:
            pc = self._near0
        elif self._near100 < pc < 100:
            pc = self._near100
        else:
            pc = round(pc, self._precision)
        return "%.*f" % (self._precision, pc)

    @classmethod
    def pc_str_width(cls):
        """How many characters wide can pc_covered_str be?"""
        width = 3   # "100"
        if cls._precision > 0:
            width += 1 + cls._precision
        return width

    @property
    def ratio_covered(self):
        """Return a numerator and denominator for the coverage ratio."""
        numerator = self.n_executed + self.n_executed_branches
        denominator = self.n_statements + self.n_branches
        return numerator, denominator

    def __add__(self, other):
        nums = Numbers()
        nums.n_files = self.n_files + other.n_files
        nums.n_statements = self.n_statements + other.n_statements
        nums.n_excluded = self.n_excluded + other.n_excluded
        nums.n_missing = self.n_missing + other.n_missing
        nums.n_branches = self.n_branches + other.n_branches
        nums.n_partial_branches = (
            self.n_partial_branches + other.n_partial_branches
            )
        nums.n_missing_branches = (
            self.n_missing_branches + other.n_missing_branches
            )
        return nums

    def __radd__(self, other):
        # Implementing 0+Numbers allows us to sum() a list of Numbers.
        if other == 0:
            return self
        return NotImplemented


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Feb 2025 8.05 AM
root / linksafe
0755
__pycache__
--
25 Jul 2024 8.44 AM
root / linksafe
0755
htmlfiles
--
25 Jul 2024 8.44 AM
root / linksafe
0755
__init__.py
1.188 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
__main__.py
0.251 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
annotate.py
3.289 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
backunittest.py
1.479 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
backward.py
4.6 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
bytecode.py
0.706 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
cmdline.py
25.118 KB
11 Jul 2016 11.04 AM
root / linksafe
0644
collector.py
14.471 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
config.py
12.464 KB
24 Jul 2016 1.07 PM
root / linksafe
0644
control.py
44.984 KB
24 Jul 2016 1.07 PM
root / linksafe
0644
data.py
26.952 KB
10 Jul 2016 2.40 PM
root / linksafe
0644
debug.py
3.646 KB
10 Jul 2016 7.56 PM
root / linksafe
0644
env.py
0.89 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
execfile.py
8.305 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
files.py
12.397 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
html.py
14.379 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
misc.py
7.636 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
multiproc.py
3.191 KB
24 Jul 2016 1.33 PM
root / linksafe
0644
parser.py
38.61 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
phystokens.py
9.645 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
pickle2json.py
1.454 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
plugin.py
13.749 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
plugin_support.py
7.707 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
python.py
6.203 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
pytracer.py
5.946 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
report.py
3.523 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
results.py
9.372 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
summary.py
5.568 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
templite.py
9.748 KB
10 Jul 2016 12.52 PM
root / linksafe
0644
tracer.cpython-37m-x86_64-linux-gnu.so
25.539 KB
20 Feb 2023 11.15 AM
root / linksafe
0755
version.py
1.23 KB
26 Jul 2016 8.04 PM
root / linksafe
0644
xmlreport.py
7.747 KB
10 Jul 2016 12.52 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF