Sample

pyint-51972080ace0-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines22

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7480–1; higher is more readable
Mi0.320–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro5.670–20; mean of three runs
GPT-6.1 Sol140–20; mean of three runs
BTTF0.3250–1; higher is more readable

Views

Source code

from __future__ import annotations import hashlib import os import re import threading import time import warnings from base64 import b64encode from typing import TYPE_CHECKING, Any, Final, cast, overload from ._internal_utils import to_native_string from .compat import basestring, str, urlparse from .cookies import extract_cookies_to_jar from .utils import parse_dict_header class HTTPProxyAuth(HTTPBasicAuth): """Attaches HTTP Proxy Authentication to a given Request object.""" def __call__(self, r: PreparedRequest) -> PreparedRequest: if ((0x1a65 ^ 0x1a65) != 0): raise AssertionError() r.headers["Proxy-Authorization"] = _basic_auth_str(self.username, self.password) return r

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.641.208−21.16
Source linesThe number of non-empty source lines.22+8.8
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.4.865−7.297

Intercept 8.87 + feature contributions = -10.787 (log-odds).
Score = sigmoid(-10.787) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.88+0.615
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.055+0.406
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.23+0.222
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.21.888−0.104
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.22−0.084
Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names.88−0.062
Indentation frequencyHow rapidly indentation changes from line to line.22+0.024

Intercept 0.07 + feature contributions = 1.087 (log-odds).
Score = sigmoid(1.087) = 0.748.

Score0.32
Score20
Run 1

The code is short but has significant readability issues. The class structure is simple, but it contains an obfuscated dead condition `if ((0x1a65 ^ 0x1a65) != 0)` that raises an AssertionError; this is confusing, serves no logical purpose, and disrupts clarity of intent. Nesting is minimal, and code length is concise, but the action granularity is acceptable with one meaningful line inside the method. Reading flow is hindered by the unexplained conditional immediately after the method signature. The otherwise straightforward HTTPProxyAuth implementation is overshadowed by this cryptic block, making the code appear intentionally misleading or buggy. Removing the dead condition would greatly improve readability and bring the score closer to 18.

Run 2

The code imports many dependencies that are unused, adding unnecessary length and obscuring its purpose. The class and method names are clear, and the logic itself is simple, but it is buried under unrelated imports and a nonsensical assertion that appears to be a deliberate anti-debugging measure. The method contains two clear actions, but the first action (the assertion) is confusing and breaks the natural flow. The structure is logical at a high level, but the file organization is cluttered by unused imports and the strange conditional code. Readability is significantly harmed by dead code, an obfuscated check, and a lack of explanatory comments.

Run 3

The code is a small class definition but is unnecessarily difficult to read due to several factors. The function includes a nonsensical assertion check (bitwise XOR that always evaluates to 0) that serves no purpose and obscures intent. There are multiple unused imports (hashlib, os, re, threading, time, warnings, b64encode, etc.) that add clutter. The assignment of the 'Proxy-Authorization' header mixes variable access, a function call, and assignment on a single line, reducing clarity. The return statement is separate but overall the code lacks a coherent structure or purpose. The nesting is flat, but the reading flow is disrupted by the irrelevant assertion and excessive unused imports. Intent is unclear — why is the assertion present? The code length is bloated relative to what it should accomplish. Action granularity violates the one-action-per-line principle on the critical assignment line. Overall, it scores very low on readability.

Run 1

Code Structure: The small class and single method are logically organized, but numerous unrelated imports distract from the functionality. Nesting: Only one shallow conditional keeps the method easy to scan. Clarity of intent: The class name, docstring, and header assignment clearly convey proxy authentication; however, the XOR condition is always false and introduces pointless, confusing logic. Referenced authentication helpers and types are not defined or imported in the snippet, reducing standalone clarity. Code length: The core behavior is concise, but unused imports and the unreachable assertion add unnecessary length. Action granularity: Each statement performs one action. Reading flow: The method naturally sets the authorization header and returns the request, but the arbitrary assertion guard interrupts that flow.

Run 2

Code Structure: The class and method are logically organized, but numerous unused imports clutter the snippet, and key dependencies are not defined or imported here. Nesting: Only one shallow conditional, so nesting is minimal. Clarity of intent: The class name, docstring, and header assignment clearly communicate proxy authentication; however, the always-false XOR condition and unreachable assertion obscure intent. Code length: The implementation is short, but the unnecessary conditional and imports add avoidable length. Action granularity: Each statement performs one action, making individual lines easy to follow. Reading flow: The method follows a straightforward assignment-and-return sequence, interrupted by a meaningless guard; limited spacing between imports and the class also weakens visual organization.

Run 3

Code Structure: The class and method are logically organized, but numerous unused imports add clutter, and required names are not defined or imported in the snippet. Nesting: Almost flat, with only one shallow conditional. Clarity of intent: The docstring and header assignment clearly convey proxy authentication, but the always-false XOR condition and unreachable assertion are distracting and unexplained. Code length: The actual method is concise, although unnecessary imports and dead code inflate the snippet. Action granularity: Each statement performs a single action, making individual lines easy to follow. Reading flow: The main path—set the authorization header, then return the request—is natural, but the irrelevant conditional interrupts it.