Sample

pyint-c80cf78fc48a-I10

Deterministically remove some optional blank lines and bracketed line breaks

Matched original source

Lines12

Scores

MethodScoreScale
Posnett0.8240–1; higher is more readable
Dorn0.9160–1; higher is more readable
Mi0.4720–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro16.670–20; mean of three runs
GPT-6.1 Sol17.330–20; mean of three runs
BTTF0.850–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): """The request timed out. Catching this error will catch both :exc:`~requests.exceptions.ConnectTimeout` and :exc:`~requests.exceptions.ReadTimeout` errors. """

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.855−7.282
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.12+4.8

Intercept 8.87 + feature contributions = 1.546 (log-odds).
Score = sigmoid(1.546) = 0.824.

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.60+1.124
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.015+0.797
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.13+0.576
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.11.639−0.247
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.59.923+0.162

Intercept 0.07 + feature contributions = 2.385 (log-odds).
Score = sigmoid(2.385) = 0.916.

Score0.472
Score6
Run 1

The code is highly readable with a clear, logical structure. It imports only necessary components, groups them logically (standard typing, third-party, local), and defines a single, well-named exception class. Nesting is non-existent, and the class purpose is explicit through a descriptive name and a succinct docstring that explains what the error represents and how to catch it. Code length is minimal and appropriate, with one action per line where applicable. Reading flow is natural: imports, then class definition, then documentation. Minor points deducted only because the class body is entirely documentation with no custom logic, which might initially confuse some readers about its necessity, though this is common for exception classes. Overall, it adheres well to clean-code principles.

Run 2

The code is a clean, well-organized import block and a single class definition. Structure is logical: imports first, then a focused exception subclass with a clear docstring. There is no nesting, and the intent is unambiguous—defining a timeout exception that groups connect/read timeouts. Code length is minimal and appropriate; no redundancy or bloat. Each logical action (import, class declaration, docstring) occupies its own line, preserving action granularity. Reading flow is natural: module setup at top, then the class with its documentation. Minor deductions: the unused TYPE_CHECKING, Any, BaseHTTPError, and CompatJSONDecodeError imports suggest leftover or planned code, slightly obscuring purpose. The class body contains only a docstring and no `pass`, which is stylistically fine but some linters expect an explicit statement. Overall, the snippet is highly readable but not perfect due to unused imports and the incomplete class implementation.

Run 3

The code is highly readable due to its clear structure and concise nature. It uses a single import block with logical grouping and appropriate `__future__` import for forward compatibility. The class definition is flat with no nesting, and the docstring clearly explains the purpose of the exception, including related exceptions it covers. The code length is minimal and appropriate for its task. Action granularity is excellent—each line performs one logical operation. Reading flow is natural: imports first, then class definition, then documentation. The only minor deduction is that the import of `RequestException` is missing from the visible snippet, which could cause confusion if the reviewer is unfamiliar with the module. Overall, this is a clean, well-documented exception class that follows Python best practices.

Run 1

Code Structure: Imports followed by a single exception class provide straightforward organization, though several imports are unused in this snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The Timeout name and docstring clearly explain the exception and its relationship to connection and read timeouts; RequestException is not defined or imported here, so understanding the inheritance requires external context. Code length: Concise, with no unnecessary implementation. Action granularity: Each import and declaration occupies its own line. Reading flow: Natural top-to-bottom progression, although an additional blank line before the class would improve visual separation.

Run 2

Code Structure: Imports followed by a single exception class provide logical organization, although RequestException is not defined or imported in the snippet. Nesting: Minimal, with only a class-level docstring. Clarity of intent: The class name and documentation clearly describe timeout behavior and related exceptions. Code length: Very concise, though several imports appear unused in this excerpt. Action granularity: Each import and declaration occupies its own line, making individual elements easy to distinguish. Reading flow: Natural top-to-bottom flow; an additional blank line before the class would improve conventional formatting.

Run 3

Code Structure: Imports followed by a focused exception class provide logical organization, though RequestException is not defined or imported in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The Timeout name and docstring clearly explain its purpose and which errors it covers. Code length: The snippet is concise, but several imports appear unused. Action granularity: Each import occupies its own line, and no statements combine multiple actions. Reading flow: The progression from imports to class to documentation is natural; an additional blank line before the top-level class would improve standard formatting.