Sample

pyint-7593502a3634-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines162

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8920–1; higher is more readable
Mi0.5610–1; higher is more readable
LLOC60Logical lines; fewer is more readable
DeepSeek V4 Pro5.330–20; mean of three runs
GPT-6.1 Sol11.670–20; mean of three runs
BTTF0.3650–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 Request(RequestHooksMixin): """A user-created :class:`Request <Request>` object. Used to prepare a :class:`PreparedRequest <PreparedRequest>`, which is sent to the server. :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. :param data: the body to attach to the request. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param json: json for the body to attach to the request (if files or data is not specified). :param params: URL parameters to append to the URL. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() <PreparedRequest [GET]> """ hooks: dict[str, list[_t.HookType]] method: str | None url: _t.UriType | None headers: Mapping[str, str | bytes] files: _t.FilesType data: _t.DataType json: _t.JsonType params: _t.ParamsType auth: _t.AuthType cookies: RequestsCookieJar | CookieJar | dict[str, str] | None def __init__( self, b: str | None = None, c: _t.UriType | None = None, d: _t.HeadersType = None, e: _t.FilesType = None, f: _t.DataType = None, g: _t.ParamsType = None, h: _t.AuthType = None, i: RequestsCookieJar | CookieJar | dict[str, str] | None = None, j: _t.HooksInputType | None = None, l: _t.JsonType = None, ) -> None: # Default empty dicts for dict params. f = [] if f is None else f e = [] if e is None else e d = {} if d is None else d g = {} if g is None else g j = {} if j is None else j self.hooks = default_hooks() for m, n in list(j.items()): self.register_hook(event=m, hook=n) self.method = b self.url = c self.headers = d self.files = e self.data = f self.json = l self.params = g self.auth = h self.cookies = i def __repr__(self) -> str: return f"<Request [{self.method}]>" def a(self) -> PreparedRequest: """Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it.""" o = PreparedRequest() o.prepare( method=self.method, url=self.url, headers=self.headers, files=self.files, data=self.data, json=self.json, params=self.params, auth=self.auth, cookies=self.cookies, hooks=self.hooks, ) return o

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.4502.379−148.578
Source linesThe number of non-empty source lines.162+64.8
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.615−6.922

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.163−4.735
Indentation frequencyHow rapidly indentation changes from line to line.135+3.932
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.161.942+1.854
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.101.939+0.84
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.101.92−0.652
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.056+0.399
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = 2.107 (log-odds).
Score = sigmoid(2.107) = 0.892.

Score0.561
Score60
Run 1

The code structure is severely degraded by nonsensical variable naming (a, b, c, d, e, f, g, h, i, j, l, m, n, o), which obscures intent and meaning throughout. Type hints and imports are well-organized, but parameter names make the class impossible to understand without external documentation. Nesting is minimal, and reading flow is generally linear, but action granularity is reasonable. However, the complete failure to use meaningful identifiers overwhelms otherwise competent structure. The original requests library code with proper names (method, url, headers, files, data, params, auth, cookies, hooks, json) would score much higher. As presented, the code reads like obfuscated code, making maintenance and comprehension unnecessarily difficult. The docstring provides some context, but does not compensate for the cryptic variable names used in the constructor and prepare method.

Run 2

The code has a clear class structure with type hints, but readability is severely damaged by the use of meaningless, single-letter variable names (e.g., 'a', 'b', 'c', 'd') for critical parameters like URL, headers, and data. This obscures intent and forces the reader to rely on the docstring or mentally map letters to concepts. The constructor's default-empty-dict logic uses these letters, making it confusing. The method 'a' is completely opaque. Otherwise, the code is relatively flat, imports are organized, and the docstring is helpful, but the naming problem alone makes the core logic nearly unreadable despite the surrounding good practices.

Run 3

This code is severely unreadable due to deliberate obfuscation. The import block is excessively long and disorganized, although that is partially acceptable for a real library. However, the critical failure is the replacement of all meaningful parameter names in `__init__` with meaningless single letters (`b`-`l`), completely obscuring intent. Variable assignments like `f = [] if f is None else f` and `o.prepare(...)` destroy clarity. Type hints and docstrings are present but useless because identifiers have no semantic meaning. The class-level annotations contradict the constructor’s shadowed variable names (`method: str` vs `b: str`). Nesting is flat, and line granularity is okay, but reading flow is unnatural and confusing. While the underlying structure mirrors the real `requests` library, the renaming makes it impossible to quickly understand parameter roles, default values, or side effects. Readability is effectively zero despite indentation and line breaks.

Run 1

Code Structure: The class is logically divided into initialization, representation, and request preparation, but extensive unrelated imports distract from its organization. Nesting: Minimal nesting makes control flow easy to follow. Clarity of intent: Descriptive attributes, type annotations, and documentation help, but single-letter parameters, local variables, and method name 'a' obscure meaning. The documentation references named parameters and prepare(), which do not match the actual interface, further confusing readers. Code length: Method bodies are reasonably concise, but the import block and documentation are disproportionately long relative to the implementation shown. Action granularity: Statements generally perform one action per line, making assignments and preparation arguments easy to inspect. Reading flow: Initialization followed by representation and preparation is natural, but readers must repeatedly map cryptic parameter names to meaningful attributes. Referenced classes not defined or imported in the snippet also require external context.

Run 2

Code Structure: The class is logically organized into annotations, initialization, representation, and request preparation, although the extensive imports distract from the small implementation. Nesting: Minimal nesting makes control flow easy to follow. Clarity of intent: Descriptive attributes, type hints, and documentation help, but single-letter parameters, variables, and method name obscure meaning. The documentation advertises prepare(), while the implemented method is a(), creating confusion. Code length: The implementation is concise, but the import list and lengthy documentation are disproportionate to the shown functionality. Action granularity: Statements generally perform one action per line, with clear attribute assignments. Reading flow: Initialization and preparation follow a natural sequence, but readers must repeatedly map single-letter inputs to meaningful attributes, and several referenced classes are not defined or imported in the snippet.

Run 3

Code Structure: The class is logically organized into documentation, attributes, initialization, representation, and request preparation, though the extensive imports distract from the small implementation. Nesting: Control flow is flat, with only a simple loop. Clarity of intent: Descriptive attributes, type hints, and documentation help, but single-letter parameters and variables obscure meaning. Naming the preparation method 'a' also contradicts the documented prepare() usage. Code length: Methods are concise, but the import block and lengthy documentation outweigh the operational code. Action granularity: Statements generally perform one action per line, and keyword arguments make the preparation call easy to inspect. Reading flow: Initialization and preparation follow natural sequences, but readers must repeatedly map opaque parameter names to meaningful attributes; documentation that does not match the actual interface further interrupts comprehension.