Sample

pyint-12fdcf57320c-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines19

Scores

MethodScoreScale
Posnett0.010–1; higher is more readable
Dorn0.8730–1; higher is more readable
Mi0.4970–1; higher is more readable
LLOC17Logical lines; fewer is more readable
DeepSeek V4 Pro170–20; mean of three runs
GPT-6.1 Sol17.670–20; mean of three runs
BTTF0.6920–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 AuthBase: """Base class that all auth implementations derive from""" def __call__(self, a: PreparedRequest) -> PreparedRequest: raise NotImplementedError("Auth hooks must be callable.")

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.422.873−13.955
Source linesThe number of non-empty source lines.19+7.6
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.709−7.063

Intercept 8.87 + feature contributions = -4.548 (log-odds).
Score = sigmoid(-4.548) = 0.01.

Feature contributions

FeatureValueContribution
(log-odds)
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.64.7+0.925
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.035+0.6
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.20+0.328
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.65+0.244
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.18.894−0.146
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.19−0.015

Intercept 0.07 + feature contributions = 1.927 (log-odds).
Score = sigmoid(1.927) = 0.873.

Score0.497
Score17
Run 1

The code is well-structured and readable. It begins with clean imports organized by type (standard library, then local modules), which sets a clear foundation. The AuthBase class has a single, clearly defined purpose with a docstring explaining its role. The __call__ method is concise and follows the single action principle, raising a NotImplementedError to signal the abstract nature of the class. The type hint `a: PreparedRequest -> PreparedRequest` clearly communicates the expected interface. While the many imports could suggest potential unused dependencies, the code itself maintains strong clarity and intent.

Run 2

The code is highly readable due to its clean, logical structure. It begins with standard imports, grouped by type (stdlib, typing, and internal modules), followed by a single, well-documented class. Nesting is flat—there are no complex conditional or loop structures. The intent is unambiguous: AuthBase clearly defines a base contract requiring subclasses to be callable. Action granularity is excellent, with each import and method definition on its own line. The reading flow is natural, moving from dependencies to the base abstraction. The only minor deductions are for a few unused imports (e.g., cast, overload, warnings) that could affect cognitive overhead, but these do not significantly hinder clarity.

Run 3

The code is clear and logically organized, with a straightforward import structure and a single, well-documented class. Nesting is non-existent, which is good. The intent of the AuthBase class is explicit and the __call__ method's purpose is clear, raising a NotImplementedError with a helpful message. Code length is concise and appropriate for the functionality. Action granularity is good, with one action per line in the method. Reading flow is natural: imports, class definition, docstring, method. Minor deductions for the many unused imports (would require checking TYPE_CHECKING usage elsewhere) and the somewhat broad import style, but overall readability is high.

Run 1

1. Code Structure: Imports followed by a small base class provide logical organization, although many imports are unused in the snippet. 2. Nesting: Minimal nesting makes the code easy to scan. 3. Clarity of intent: The class name, docstring, and explicit NotImplementedError clearly establish an authentication interface; the parameter name 'a' is vague, and PreparedRequest is not defined or imported here. 4. Code length: The class is concise, but the extensive import list adds clutter relative to the implementation shown. 5. Action granularity: Each statement performs one action, with no compressed multi-action lines. 6. Reading flow: The progression from dependencies to interface is natural, though clearer import grouping and an additional blank line before the class would improve readability.

Run 2

Code Structure: Imports precede a small, logically organized base class, although many imports are unused in this snippet. Nesting: Minimal, with only a class and method. Clarity of intent: The class name, docstring, type annotations, and explicit NotImplementedError clearly establish an authentication interface; the parameter name 'a' is less descriptive than 'request'. Code length: The implementation is concise, but the extensive import list adds unnecessary length to the shown code. Action granularity: Each statement performs one action. Reading flow: Straightforward top-to-bottom flow, though separating import groups and adding another blank line before the class would improve formatting.

Run 3

Code Structure: Imports followed by a single base class provide clear, logical organization, though many imports are unused in this snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class docstring, typed callable interface, and explicit NotImplementedError clearly communicate an authentication-hook contract; the parameter name 'a' is less descriptive, and PreparedRequest is not defined or imported in the excerpt. Code length: The implementation is concise, but the extensive import list adds unnecessary visual weight for the code shown. Action granularity: Each statement occupies its own line. Reading flow: The progression from imports to class documentation to method is natural, although additional blank lines between import groups and before the class would improve visual separation.