Sample

pyint-ec4bbddaab12-I01

Remove comments and docstrings

Matched original source

Lines24

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7590–1; higher is more readable
Mi0.6820–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.1790–1; higher is more readable

Views

Source code

from __future__ import annotations import typing as t from base64 import b64decode from base64 import b64encode from datetime import datetime from uuid import UUID from markupsafe import Markup from werkzeug.http import http_date from werkzeug.http import parse_date from ..json import dumps from ..json import loads class TagBytes(JSONTag): __slots__ = () key = " b" def check(self, value: t.Any) -> bool: return isinstance(value, bytes) def to_json(self, value: t.Any) -> t.Any: return b64encode(value).decode("ascii") def to_python(self, value: t.Any) -> t.Any: return b64decode(value)

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.742.8−24.512
Source linesThe number of non-empty source lines.24+9.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.762−7.142

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

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.46.92+1.678
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.08+0.165
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.25+0.151
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.24−0.13
Indentation frequencyHow rapidly indentation changes from line to line.24+0.093
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.23.708−0.078

Intercept 0.07 + feature contributions = 1.145 (log-odds).
Score = sigmoid(1.145) = 0.759.

Score0.682
Score20
Run 1

The code demonstrates strong readability with a clear logical organization: imports are grouped systematically, and the class structure follows a logical pattern. The nesting is minimal—only a single class level with flat method definitions. Each method has a clear, singular purpose, evident from their names (check, to_json, to_python) and their focused implementations. The code is concise without unnecessary verbosity, with each method containing only essential logic. Action granularity is appropriate—each method contains one conceptual operation, maintaining clarity. The reading flow follows a natural progression from type checking to conversion methods. Minor deductions include the slightly cryptic class name 'TagBytes' and the unconventional key value ' b' with a leading space, which could benefit from additional context or documentation. Overall, the code is highly maintainable and follows clean coding principles.

Run 2

The code is highly readable with a clear, logical structure. Imports are well-organized, and the class uses a clean single-responsibility design. Nesting is minimal and the reading flow is natural: type checking, encoding, then decoding. Action granularity is one action per line, making each method's intent immediately obvious. The __slots__ optimization, key attribute, and type hints contribute to clarity without clutter. The only minor deductions are the slightly cryptic key value ' b' and the lack of a module docstring, but overall this is concise, explicit, and maintainable.

Run 3

The code has clear structure with grouped imports, a well-named class, and methods with explicit type hints. Nesting is minimal and each method has a single, obvious responsibility. The action granularity is appropriate—one operation per line except for concise one-liner returns. Reading flow follows a natural order: class definition, type check, serialization, then deserialization. Minor deductions include the cryptic key ' b' and redundant 'to_json' name where 'to_primitive' might be clearer. Overall highly readable and maintainable.

Run 1

Code Structure: The class logically groups type checking, serialization, and deserialization into small methods. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: TagBytes and the method names clearly communicate byte conversion, though the tag key " b" and the undefined-in-snippet JSONTag base class require external context. Code length: The implementation is concise, but several imports are unused in this snippet and add noise. Action granularity: Each statement occupies its own line; the short encode-and-decode chain remains readable. Reading flow: Methods follow a natural check, serialize, deserialize sequence. Additional spacing between imports and the class would improve visual separation.

Run 2

Code Structure: A small, logically organized class separates type checking, serialization, and deserialization. Nesting: There is no nested control flow, making each method easy to follow. Clarity of intent: The class name, method names, and Base64 operations clearly communicate bytes-to-JSON conversion, though the undefined-in-snippet JSONTag base class and cryptic key require external context. Code length: Methods are concise, but several imports are unused in this snippet and add clutter. Action granularity: Each statement occupies its own line; the encode-and-decode chain is simple and readable. Reading flow: Methods follow a natural check, serialize, deserialize sequence, although additional spacing between imports and the class would improve visual organization.

Run 3

Code Structure: A compact class cleanly separates type checking, serialization, and deserialization. Nesting: Methods are flat, with no nested control flow. Clarity of intent: TagBytes and the method names make the bytes-to-Base64 conversion clear, though the opaque key " b", unexplained __slots__, and absent JSONTag definition require context. Code length: The implementation is concise, but numerous unused imports distract from this snippet. Action granularity: Each statement performs one focused operation; the encoding-and-decoding chain is straightforward. Reading flow: Methods follow a natural check, serialize, deserialize sequence. More separation around the imports and class would improve presentation slightly.