Sample

pyint-c8b1c76a1e1b-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines20

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7690–1; higher is more readable
Mi0.2480–1; higher is more readable
LLOC18Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.7160–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, a: PreparedRequest) -> PreparedRequest: a.headers["Proxy-Authorization"] = _basic_auth_str(self.username, self.password) return a

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.535.841−17.683
Source linesThe number of non-empty source lines.20+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.838−7.257

Intercept 8.87 + feature contributions = -8.07 (log-odds).
Score = sigmoid(-8.07) = 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.046+0.5
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.21+0.293
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.19.876−0.132
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.87.952−0.06
Indentation frequencyHow rapidly indentation changes from line to line.20−0.045
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.20−0.038

Intercept 0.07 + feature contributions = 1.202 (log-odds).
Score = sigmoid(1.202) = 0.769.

Score0.248
Score18
Run 1

The code is generally well-structured with clear imports and a single class definition. The class HTTPProxyAuth extends HTTPBasicAuth, and its intent is straightforward—attaching proxy authentication headers. The __call__ method is concise, performing a single action per line (assigning the header and returning the request). However, readability is slightly reduced because some imported names (e.g., _basic_auth_str, PreparedRequest) are not defined in the snippet, which could confuse readers without surrounding context. Additionally, the import block includes unused or potentially unrelated modules (hashlib, os, re, threading, time, warnings), which adds noise. Nesting is minimal, and the flow is natural. Overall, it is readable but could be improved by removing unused imports and clarifying external dependencies.

Run 2

The code is well-structured with clear separation of concerns: imports are organized logically, the class has a focused responsibility, and the method is concise. Nesting is minimal, with only a single class and method level. Intent is evident from the class name, docstring, and type hints, which use modern Python features like `__future__` annotations and `Final`. Code length is appropriate—no unnecessary lines or bloat. Action granularity is good: the method performs one logical action per line (setting a header and returning the request). Reading flow follows a natural top-down order. Minor deductors: the heavy import block includes many unused names (TYPE_CHECKING, Any, Final, cast, overload, parse_dict_header, etc.), which slightly muddies clarity and suggests copy-paste imports. Also, the method body could benefit from a brief comment explaining the auth string generation, though the helper function name is self-documenting. Overall, readable and maintainable.

Run 3

The code is highly readable with a clear, logical structure. It imports only necessary modules and uses explicit typing for clarity. The single class `HTTPProxyAuth` is concise, with a focused purpose documented by a clear docstring. The method `__call__` is flat, contains no nesting, and performs one primary action—setting a header—followed by returning the request. Each line expresses a single action, aiding in comprehension. The flow is natural: import, class definition, docstring, method implementation. The use of `PreparedRequest` and helper `_basic_auth_str` shows clear intent without ambiguity. Overall, the code is succinct, well-organized, and easy to understand, with minimal cognitive overhead.

Run 1

Code Structure: The class and its single method are logically organized, but the many unused imports distract from the small implementation. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The class name, docstring, type annotations, and explicit Proxy-Authorization header clearly communicate the purpose; the parameter name 'a' is less descriptive, and HTTPBasicAuth, PreparedRequest, and _basic_auth_str are not defined or imported in the snippet. Code length: The implementation is concise, although the import section is disproportionately long. Action granularity: Each line performs one clear action. Reading flow: Header assignment followed by returning the request is natural, but import clutter and limited spacing between top-level sections slightly reduce readability.

Run 2

Code Structure: The class and its single method are logically organized, though many unrelated or unused imports clutter this excerpt. Nesting: Minimal nesting makes the implementation easy to follow. Clarity of intent: The class name, docstring, method signature, and header assignment clearly convey proxy authentication; the parameter name 'a' is less descriptive, and several referenced symbols are not defined or imported in the excerpt. Code length: The implementation is concise, but the import block is disproportionately long for the functionality shown. Action granularity: Each line performs one clear action. Reading flow: The method naturally progresses from setting the authentication header to returning the request, although import clutter and limited spacing between top-level sections slightly reduce readability.

Run 3

Code Structure: The class and method are logically organized, but numerous unrelated imports clutter this short snippet, and referenced authentication helpers and request types are not defined or imported here. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class name, docstring, and Proxy-Authorization assignment clearly communicate the purpose, although the parameter name 'a' is less descriptive than 'request'. Code length: The implementation is concise, but the import section is disproportionately long. Action granularity: Each statement performs one clear action. Reading flow: The method flows naturally from setting the authentication header to returning the request; import clutter and limited spacing between top-level sections slightly weaken readability.