Sample

pyint-12fbb5bd34b1-I01

Remove comments and docstrings

Matched original source

Scores

MethodScoreScale
Posnett0.3970–1; higher is more readable
Dorn0.8060–1; higher is more readable
Mi0.530–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro15.670–20; mean of three runs
GPT-6.1 Sol160–20; mean of three runs
BTTF0.8310–1; higher is more readable

Views

Source code

from __future__ import annotations from typing import TYPE_CHECKING, Any from urllib3.exceptions import HTTPError as BaseHTTPError from .compat import JSONDecodeError as CompatJSONDecodeError class Timeout(RequestException): pass

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
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.831−7.247
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.146.719−4.842
Source linesThe number of non-empty source lines.7+2.8

Intercept 8.87 + feature contributions = -0.419 (log-odds).
Score = sigmoid(-0.419) = 0.397.

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.59.875+1.129
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.8+0.753
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.026+0.686
Indentation frequencyHow rapidly indentation changes from line to line.7−0.495
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.6.754−0.315

Intercept 0.07 + feature contributions = 1.422 (log-odds).
Score = sigmoid(1.422) = 0.806.

Score0.53
Score6
Run 1

The code is highly readable. It has a clear, logical structure with imports grouped by standard library, third-party, and local modules. Nesting is minimal—just a single class definition. Intent is clear: define a custom exception for timeouts. Code length is concise, with no unnecessary lines. Action granularity is appropriate; each import and class definition occupies its own line. Reading flow is natural, starting with imports and ending with the class. Minor deductions: the unused import 'Any' and 'TYPE_CHECKING' could be removed, and 'CompatJSONDecodeError' is unused, slightly reducing clarity. Overall, the code follows common Python style guidelines and is easy to understand.

Run 2

The code is short and superficially clean, but lacks clarity and completeness. It imports items that are never used (TYPE_CHECKING, Any, BaseHTTPError, CompatJSONDecodeError), suggesting dead code or omitted functionality. The only concrete definition — class Timeout(RequestException) — has no docstring, no methods, and its relationship to RequestException is unexplained. The flat structure and one-action-per-line style are fine, but the intent is ambiguous: is this a placeholder, a mixin, or a stub? The unused imports reduce readability by implying dependencies that don't exist in the snippet. Overall, it is easy to scan but hard to understand.

Run 3

The code is short, clear, and well-structured. It uses modern Python features like `from __future__ import annotations` for forward references and `TYPE_CHECKING` to avoid circular imports, indicating good practice. Imports are logically grouped and aliased to avoid conflicts. The class definition is minimal and inherits from an exception, making its purpose obvious. There is virtually no nesting, and each line performs a single action. The only minor deduction is the lack of a docstring or comment explaining the `Timeout` class or the reasoning behind the `CompatJSONDecodeError` alias, but the code remains highly readable.

Run 1

Code Structure: Imports precede a simple exception class, giving clear organization. Nesting: No nested control flow; the class body is minimal. Clarity of intent: Timeout clearly represents a timeout exception, but RequestException is neither defined nor imported in the snippet, leaving its origin unclear. Code length: Very concise, although several imports appear unused and add clutter. Action granularity: Each import and declaration occupies its own line. Reading flow: Natural top-to-bottom progression, though an additional blank line before the top-level class would improve visual separation.

Run 2

Code Structure: Imports precede a clearly separated exception class, providing logical organization. Nesting: Only the minimal class-body indentation is used. Clarity of intent: Timeout clearly represents an exception type, but RequestException is neither defined nor imported in the snippet, obscuring its origin. Code length: The class is concise, though several imports appear unused and introduce unnecessary clutter. Action granularity: Each import and statement occupies its own line. Reading flow: The top-to-bottom flow is straightforward; an additional blank line before the top-level class would improve conventional formatting.

Run 3

Code Structure: Imports precede a simply organized exception class, but RequestException is not defined or imported, and several imports appear unused. Nesting: Minimal, with only a class body. Clarity of intent: Timeout clearly represents an exception, although its inheritance depends on missing context. Code length: Very concise, but unused imports add clutter. Action granularity: Each statement occupies its own line. Reading flow: Straightforward top-to-bottom flow, though grouping imports and adding another blank line before the class would improve formatting.