Sample

pyint-43ce15ee5b8d-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines98

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.9260–1; higher is more readable
Mi0.5610–1; higher is more readable
LLOC38Logical lines; fewer is more readable
DeepSeek V4 Pro4.330–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.5220–1; higher is more readable

Views

Source code

from __future__ import annotations import datetime import encodings.idna # noqa: F401 from collections.abc import Callable, Generator, Iterable, Iterator, Mapping from io import UnsupportedOperation from typing import ( TYPE_CHECKING, Any, Final, Literal, cast, overload, ) from urllib3.exceptions import ( DecodeError, LocationParseError, ProtocolError, ReadTimeoutError, SSLError, ) from urllib3.fields import RequestField from urllib3.filepost import encode_multipart_formdata from urllib3.util import parse_url from . import _types as _t from ._internal_utils import to_native_string, unicode_is_ascii from .auth import HTTPBasicAuth from .compat import ( JSONDecodeError, basestring, builtin_str, chardet, cookielib, urlencode, urlsplit, urlunparse, ) from .compat import json as complexjson from .cookies import ( _copy_cookie_jar, cookiejar_from_dict, get_cookie_header, ) from .exceptions import ( ChunkedEncodingError, ConnectionError, ContentDecodingError, HTTPError, InvalidJSONError, InvalidURL, MissingSchema, StreamConsumedError, ) from .exceptions import JSONDecodeError as RequestsJSONDecodeError from .exceptions import SSLError as RequestsSSLError from .hooks import default_hooks from .status_codes import codes from .structures import CaseInsensitiveDict from .utils import ( check_header_validity, get_auth_from_url, guess_filename, guess_json_utf, iter_slices, parse_header_links, requote_uri, stream_decode_response_unicode, super_len, to_key_val_list, ) class RequestHooksMixin: hooks: dict[str, list[_t.HookType]] def a( self, c: str, d: Iterable[_t.HookType] | _t.HookType ) -> None: """Properly register a hook.""" if c not in self.hooks: raise ValueError(f'Unsupported event specified, with event name "{c}"') if isinstance(d, Callable): self.hooks[c].append(d) elif hasattr(d, "__iter__"): self.hooks[c].extend( e for e in d if isinstance(e, Callable) ) # defensive runtime filter def b(self, f: str, g: _t.HookType) -> bool: """Deregister a previously registered hook. Returns True if the hook existed, False if not. """ try: self.hooks[f].remove(g) return True except ValueError: return False

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.2532.846−83.584
Source linesThe number of non-empty source lines.98+39.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.653−6.98

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.94+2.514
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.99−2.469
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.97.94+0.959
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.82.98+0.534
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.06+0.361
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.82.909+0.154

Intercept 0.07 + feature contributions = 2.522 (log-odds).
Score = sigmoid(2.522) = 0.926.

Score0.561
Score38
Run 1

The code is heavily obfuscated despite its logical structure being fundamentally sound. Imports are organized but the actual method and parameter names are meaningless (a, b, c, d, e, f, g), destroying clarity of intent. The docstrings describe functionality, but the identifiers contradict them, making the code impossible to understand without reverse-engineering. Nesting and action granularity are acceptable, and the defensive type filtering shows intent, but the single-letter naming throughout the core logic makes this unreadable to any maintainer. The code reads as deliberately obfuscated rather than naturally written Python.

Run 2

The code is nearly unreadable due to cryptic one-letter method and parameter names (a, b, c, d, e, f, g), which obscure intent and make the logic hard to follow. While it has a clear class structure, sensible imports, and manageable nesting, these positives are undermined by the naming choices. The code is concise and has one action per line, but the meaningless identifiers break reading flow and require constant mental mapping. Docstrings exist but do not clarify the vague names. Overall, this appears deliberately obfuscated rather than maintainable.

Run 3

The code is difficult to read primarily due to extremely poor naming: methods 'a' and 'b' with parameters 'c', 'd', 'e', 'f', 'g' obscure all intent, despite docstrings existing. While the overall structure is logical and imports are organized, the action granularity is mixed—some parts are clean (one action per line), but the conditional extension logic in method 'a' has defensive filtering crammed into a single line. Nesting is relatively flat, and reading flow is disrupted by cryptic variable names and a non-descriptive class method name. The code is not excessively long for what it does, but clarity suffers significantly from opaque naming choices. The use of type hints and consistent quoting style is a positive, but the core readability issue—single-letter identifiers for public APIs—dominates the evaluation.

Run 1

Code Structure: The mixin cleanly separates hook registration and deregistration, but the extensive unrelated imports obscure this small implementation. Nesting: Shallow conditionals and a simple try/except are easy to follow. Clarity of intent: Docstrings and type annotations explain the operations, but single-letter method and parameter names severely weaken discoverability and require readers to infer meaning. Code length: The methods are concise, although the import block dominates the snippet and some line wrapping is unnecessary. Action granularity: Statements generally perform one action per line; the generator expression compactly combines filtering and iteration without excessive complexity. Reading flow: Each method follows a natural validation-and-update or attempt-and-handle sequence, but opaque identifiers and the disproportionate import section interrupt overall readability.

Run 2

Code Structure: Imports are grouped and hook operations are cleanly separated into two methods, but most imports are unused in this excerpt. Nesting: Shallow conditionals and a simple try/except keep control flow easy to follow. Clarity of intent: Docstrings, type annotations, and self.hooks clarify the purpose, but method names a/b and parameter names c/d/f/g obscure meaning substantially. Code length: The methods are concise, while the extensive import block overwhelms the small implementation shown. Action granularity: Statements generally perform one action per line; the generator expression remains reasonably understandable. Reading flow: Registration and deregistration form a logical sequence, but cryptic identifiers and excessive imports interrupt otherwise straightforward reading.

Run 3

Code Structure: Imports are grouped and hook operations are separated into small methods, but the extensive import block obscures the small class. Nesting: Shallow conditionals and a simple try/except keep complexity low. Clarity of intent: Docstrings, type annotations, and recognizable collection operations explain the behavior, but single-letter method and parameter names significantly reduce clarity. Code length: Methods are concise, although the many imports unused in the shown snippet make it disproportionately long. Action granularity: Each statement generally performs one action; the generator expression combines filtering and iteration reasonably. Reading flow: Method bodies follow a natural validation-then-update sequence, but cryptic identifiers and the lengthy import preamble impede scanning.