Sample

pyint-c1ff4947375e-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines33

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7170–1; higher is more readable
Mi0.4810–1; higher is more readable
LLOC22Logical lines; fewer is more readable
DeepSeek V4 Pro50–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.480–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, headers: Any) -> None: """Make a MockResponse for `cookiejar` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers """ lI0O_fc020606 = 0xd6cb - 0xd6cb lI0O_fc020606 = (lI0O_fc020606 | 0) if lI0O_fc020606 == 0 else (lI0O_fc020606 & 0) self._headers = headers def info(self) -> Any: return self._headers def getheaders(self, name: str) -> Any: self._headers.getheaders(name)

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.834−27.522
Source linesThe number of non-empty source lines.33+13.2
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.842−7.263

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.89.971+0.647
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.047+0.49
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.26−0.176
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.34−0.167
Indentation frequencyHow rapidly indentation changes from line to line.26+0.162
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.90−0.147
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.32.824+0.049

Intercept 0.07 + feature contributions = 0.928 (log-odds).
Score = sigmoid(0.928) = 0.717.

Score0.481
Score22
Run 1

The code starts with a reasonable structure and a clear docstring explaining the MockResponse class purpose. However, it falters significantly in clarity and readability. The `__init__` method contains obfuscated, meaningless variable names (e.g., `lI0O_fc020606`) and an unnecessary arithmetic operation that appears to be injected junk code. This severely damages intent and action granularity. Additionally, the `getheaders` method lacks a `return` statement, making the code ambiguous and likely faulty. The imports include unused modules (`calendar`, `time`, `threading`, etc.) and appear disorganized. While nesting is flat and the code is concise, the presence of obfuscation, missing return, and irrelevant imports reduce readability drastically. A maintainer would struggle to understand the purpose or verify correctness without significant effort.

Run 2

The code is poorly structured and hard to follow. The obfuscated variable name `lI0O_fc020606` with meaningless bitwise operations obscures intent and adds unnecessary complexity. The MockResponse class appears to implement an interface, but the getheaders method is missing a return statement, making it ineffective. The module imports many unused dependencies, increasing noise without contributing to functionality. While the class docstring and comments offer some clarity, the overall action granularity is poor—multiple concerns are packed into a few lines with confusing logic. The reading flow is disrupted by the cryptic variable assignment and dead code. Nesting is shallow, which is a minor positive, but it does not compensate for the ambiguity and lack of purposeful structure. The code length is not excessive, but the presence of irrelevant imports and cryptic operations makes it unnecessarily cluttered. Overall, the code lacks clear intent and fails readability standards.

Run 3

The code contains a meaningless variable `lI0O_fc020606` with confusing hexadecimal arithmetic that adds no functionality, severely harming clarity of intent and action granularity. The `getheaders` method is missing a return statement, adding ambiguity. There is poor organization: multiple unused imports (`calendar`, `time`, `Cookie`, `MutableMapping`, etc.), and module-level import of `threading` is unused. The class structure is simple, but the docstring is somewhat informal ('...what?') and lacks precision. Nesting is minimal, which is a plus, and the reading flow is mostly natural aside from the bizarre variable block. Code length is short but not concise because of unused imports and dead code. Overall, the code is readable in some structure but fails badly on clarity and intent due to confusing and nonfunctional elements.

Run 1

Code Structure: The small class has logically separated methods, but numerous unused imports, inconsistent import ordering, and irrelevant initialization statements add clutter. Nesting: The code is shallow and easy to navigate, although the conditional expression is unnecessarily convoluted. Clarity of intent: Class and method names, type annotations, and docstrings explain the wrapper's purpose, but the opaque variable name and meaningless bitwise operations obscure initialization. The lack of a return in getheaders also makes its intended behavior less clear. Code length: The functional wrapper is concise, but imports and redundant arithmetic unnecessarily inflate it. Action granularity: Each statement generally occupies its own line, though the conditional assignment combines several operations. Reading flow: Methods follow a natural order, but unrelated initialization logic interrupts the straightforward progression from receiving headers to exposing them.

Run 2

Code Structure: The small wrapper class is logically organized, but numerous unused imports and irrelevant initialization statements add clutter. Nesting: Methods are flat, with only a simple conditional expression. Clarity of intent: Class and constructor docstrings explain the adapter's purpose, and method names are familiar; however, the opaque variable name and meaningless hexadecimal/bitwise operations obscure initialization. The missing return in getheaders also makes its intended behavior less clear. Code length: The useful implementation is concise, but boilerplate imports and dead calculations unnecessarily lengthen this snippet. Action granularity: Statements generally perform one action per line, although the conditional bitwise assignment is needlessly complex. Reading flow: The class progresses naturally from initialization to accessors, but inconsistent import placement and distracting calculations interrupt an otherwise straightforward flow.

Run 3

Code Structure: The small wrapper class is logically organized, but numerous unused imports and unrelated computations clutter it. Nesting: Methods are flat, with only a simple conditional expression. Clarity of intent: Class and method names, type annotations, and explanatory docstrings establish the wrapper's purpose; however, the obfuscated variable and pointless arithmetic obscure the constructor. Code length: The useful implementation is concise, but imports and dead assignments add unnecessary length. Action granularity: Each statement occupies its own line, though the redundant conditional assignment packs several operations together. Reading flow: The class progresses naturally from initialization to accessors, but inconsistent import grouping and dead code interrupt that flow. The missing return in getheaders also makes its intended behavior less clear.