Sample

pyint-7efc4c14544e-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines31

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8490–1; higher is more readable
Mi0.6460–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro6.330–20; mean of three runs
GPT-6.1 Sol110–20; mean of three runs
BTTF0.7330–1; higher is more readable

Views

Source code

from __future__ import annotations import calendar import copy import time from collections.abc import Iterator, MutableMapping from http.cookiejar import Cookie, CookieJar, CookiePolicy from typing import TYPE_CHECKING, Any, TypeVar, overload from ._internal_utils import to_native_string from ._types import is_prepared as _is_prepared from .compat import Morsel, cookielib, urlparse, urlunparse import threading class MockResponse: """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. ...what? Basically, expose the parsed HTTP headers from the server response the way `http.cookiejar` expects to see them. """ def __init__(self, c: Any) -> None: """Make a MockResponse for `cookiejar` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers """ self._headers = c def a(self) -> Any: return self._headers def b(self, d: str) -> Any: self._headers.getheaders(d)

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.679.461−22.422
Source linesThe number of non-empty source lines.31+12.4
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.711−7.067

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

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.043+0.526
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.74.219+0.393
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.78.969+0.32
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.32−0.097
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.30.812+0.021

Intercept 0.07 + feature contributions = 1.725 (log-odds).
Score = sigmoid(1.725) = 0.849.

Score0.646
Score20
Run 1

The code has a clear structure with imports and a single class, but it is misleading and unfinished. The docstrings reference 'headers' but the parameter is named 'c', and method names 'a' and 'b' are meaningless, obscuring intent. The 'b' method calls getheaders without returning the result, which is likely a bug or incomplete implementation. There are also unused imports (calendar, time, threading, etc.) that clutter the code. While nesting is low and line length is concise, action granularity fails because the getheaders call lacks a return. The reading flow is natural at the top, but the class body is confusing and incomplete. Overall, the code lacks clarity and appears to be a stub, making it hard to read despite its simple structure.

Run 2

The code exhibits several readability issues. Structure is logical but incomplete - the class is named MockResponse but methods are cryptically named a() and b(), which severely obscures intent. Nesting is acceptable (flat), but this is undermined by unclear purpose. The b() method doesn't return anything despite being called like a getter, which is confusing. Action granularity is mostly fine with one action per line. Reading flow is hindered by the placeholder-like method names and missing return statement. The docstrings partially help but don't compensate for the poor naming. Code length is reasonable - not overly long. Overall, while imports and basic structure follow Python conventions, the ambiguous method names (a, b) and likely bug (missing return in b) make this code difficult to understand and maintain without additional context.

Run 3

The code shows several significant readability issues. The class name and method names (a, b, c) are completely opaque, revealing nothing about their purpose. The docstring mentions 'headers' but the parameter is named 'c', creating confusion. Method 'b' performs an operation but doesn't return the result, making it dead code. Multiple imports (calendar, time, threading, copy) appear unused. The nested import structure mixes standard library and third-party imports without clear organization. While there is minimal nesting and reasonable line length, the lack of meaningful names, unclear intent, and dead code drastically reduce readability. The docstring itself acknowledges confusion ('...what?'), indicating the author was aware of the obscurity. Action granularity is acceptable but cannot compensate for the fundamental lack of clarity in naming and purpose.

Run 1

Code Structure: A small, logically organized wrapper class, but numerous unused imports and the misplaced threading import add clutter. Nesting: Flat methods with no deeply nested control flow are easy to follow. Clarity of intent: Class documentation explains the purpose, but names such as a, b, c, and d obscure method roles and parameter meanings. The constructor docstring describes a parameter named headers rather than c, and b discards the getheaders result, leaving its intended behavior unclear. Code length: The class is concise, though the import block is disproportionately large for the functionality shown. Action granularity: Each statement performs a single action. Reading flow: Simple method bodies support straightforward reading, but cryptic naming, inconsistent documentation, and limited spacing around the class weaken the overall flow.

Run 2

Code Structure: The small class is logically organized, but numerous unused imports clutter the module and threading is separated from other standard-library imports. Nesting: Methods are flat and easy to scan. Clarity of intent: The class docstring explains its cookiejar compatibility role, but names a, b, c, and d obscure method and parameter purposes. The constructor documentation refers to headers rather than its actual parameter c. Method b calls getheaders without returning its result, leaving its intended behavior unclear. Code length: The implementation is concise, though imports outweigh the functional code. Action granularity: Each statement performs one action, with no compressed multi-action lines. Reading flow: The simple class layout helps, but vague naming, inconsistent import grouping, and documentation mismatches interrupt understanding.

Run 3

Code Structure: A small class groups related header-wrapper behavior logically, but numerous unused imports and misplaced threading import clutter the module. Nesting: Methods are flat and easy to scan. Clarity of intent: The class docstring explains the adapter's purpose, but names a, b, c, and d obscure method roles and parameter meanings. The constructor docstring refers to headers rather than its actual parameter c, and b calls getheaders without returning its result, making its intended behavior unclear. Code length: The class is concise, although imports substantially outweigh the implementation. Action granularity: Each executable line performs a single action. Reading flow: Straightforward method sequencing helps, but inconsistent import grouping, cryptic identifiers, and mismatched documentation interrupt comprehension.