Sample

pyint-defa9cc905aa-I09

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

Matched original source

Lines47

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.3480–1; higher is more readable
Mi0.420–1; higher is more readable
LLOC35Logical lines; fewer is more readable
DeepSeek V4 Pro3.330–20; mean of three runs
GPT-6.1 Sol100–20; mean of three runs
BTTF0.4030–1; higher is more readable

Views

Source code

import email.message import email.policy import mimetypes import warnings from collections import namedtuple from datetime import datetime, timezone from email import charset as Charset from email import generator from email.errors import HeaderParseError from email.header import Header from email.headerregistry import Address, AddressHeader, parser from email.mime.base import MIMEBase from email.mime.message import MIMEMessage from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import formataddr, getaddresses, make_msgid from io import BytesIO, StringIO from pathlib import Path from django.conf import settings from django.core.mail.utils import DNS_NAME from django.utils.deprecation import ( RemovedInDjango70Warning, deprecate_posargs, warn_about_external_use, ) from django.utils.encoding import force_bytes, force_str, punycode from django.utils.timezone import get_current_timezone from .deprecation import ( CONNECTION_ARG_WARNING, FAIL_SILENTLY_ARG_WARNING, report_using_incompatibility, ) class SafeMIMEMultipart(MIMEMixin, MIMEMultipart): def __init__( self, _subtype="mixed", boundary=None, _subparts=None, encoding=None, **_params ): lI0O_3fbd72f3 = 0x4d93 lI0O_3fbd72f3 = ((lI0O_3fbd72f3 ^ 0x4d93) | 0) & -1 if (lI0O_3fbd72f3 & 1) == 1: lI0O_3fbd72f3 ^= lI0O_3fbd72f3 self.encoding = encoding MIMEMultipart.__init__(self, _subtype, boundary, _subparts, **_params) def __setitem__(self, name, val): name, val = forbid_multi_line_headers(name, val, self.encoding) MIMEMultipart.__setitem__(self, name, val)

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.1859.215−61.354
Source linesThe number of non-empty source lines.47+18.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.92−7.38

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.47+0.889
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.48−0.663
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.47−0.658
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.065+0.309
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.46.795+0.244
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.86.917−0.016

Intercept 0.07 + feature contributions = -0.63 (log-odds).
Score = sigmoid(-0.63) = 0.348.

Score0.42
Score35
Run 1

The code is severely unreadable due to multiple critical issues. First, there is obfuscated dead code in the __init__ method (variables like lI0O_3fbd72f3 with meaningless bitwise operations) that serves no purpose and completely obscures intent. Second, the code violates Python style conventions (PEP 8) with poor naming. Third, the mixing of unused imports and unclear parameters reduces clarity. The nesting is not excessive, but the overall structure is confusing due to the obfuscation. Action granularity is poor in the __init__ method where multiple unrelated operations occur. The reading flow is completely disrupted by the dead code block. While the SafeMIMEMultipart class concept is simple, the implementation obscures it entirely. The only redeeming qualities are the relatively short length and the clear override methods at the end.

Run 2

This code fails most readability criteria. The bizarre obfuscated variable (lI0O_3fbd72f3) with meaningless bitwise operations serves no purpose and obscures intent. The class hierarchy is unclear - SafeMIMEMultipart inherits from MIMEMixin and MIMEMultipart, but MIMEMixin is not shown. Method overrides are minimal but intermixed with noise. The __init__ and __setitem__ methods have reasonable flat nesting and single actions per line, but the cryptic dead-code block destroys reading flow. While imports are logically grouped, the overall structure suggests code injection or obfuscation rather than legitimate implementation. The core functionality (setting encoding, sanitizing headers) is straightforward, but the surrounding garbage makes the code nearly unreadable and raises security concerns.

Run 3

The code is extremely unreadable due to several severe issues. The most egregious problem is the presence of obfuscated dead code (lI0O_3fbd72f3 variable with meaningless bitwise operations) that serves no purpose and actively confuses readers. The class method __init__ has multiple actions packed into lines and unclear parameter naming with leading underscores. The import block contains unused imports (Charset, Address, parser, BytesIO, StringIO, Path, etc.) that add noise. The use of MIMEMixin without visible definition creates ambiguity about inheritance. Variable names like 'val' and '_params' lack clarity. The obfuscated variable name lI0O_3fbd72f3 suggests either intentionally malicious code or severely misguided attempts at code generation, making intent impossible to discern. The reading flow is disrupted by the meaningless bitwise operations scattered between actual functionality. Nesting is minimal but the structure is compromised by dead code blocks. Overall, this code would be nearly impossible to maintain or understand without significant cleanup.

Run 1

Code Structure: The class is logically divided into initialization and header assignment, but numerous unrelated imports and unexplained obfuscation add clutter. Nesting: Mostly flat, with only one shallow conditional. Clarity of intent: MIME initialization and header validation are understandable, but the cryptic variable and pointless bitwise operations obscure intent; MIMEMixin and forbid_multi_line_headers are not defined in the snippet. Code length: The actual functionality is concise, but unused imports and redundant computations unnecessarily expand it. Action granularity: Each statement performs a distinct action, although the bitwise expression combines several operations. Reading flow: Conventional method organization helps, but irrelevant arithmetic interrupts initialization, and the large import block delays the meaningful code.

Run 2

Code Structure: The class is logically divided into initialization and header assignment, but excessive imports and unrelated initialization statements obscure that organization. Nesting: Mostly flat, with only one shallow conditional. Clarity of intent: MIME initialization and header validation are clear, but the cryptic variable and pointless bitwise operations conceal intent; MIMEMixin and forbid_multi_line_headers are not defined in the excerpt. Code length: The actual functionality is concise, but unused imports and no-op calculations add substantial clutter. Action granularity: Generally one statement per line, although the compound bitwise expression requires extra parsing. Reading flow: Conventional method names and delegation provide a natural flow, interrupted by obfuscated arithmetic before the meaningful initialization.

Run 3

Code Structure: Methods are logically grouped within a class, but numerous unused imports and unrelated initialization obscure the organization. Nesting: Mostly flat, with only one shallow conditional. Clarity of intent: MIME initialization and header validation are recognizable, but the cryptic variable name and pointless hexadecimal/bitwise operations obscure intent; MIMEMixin and forbid_multi_line_headers are not defined in this excerpt. Code length: The actual functionality is concise, but excessive imports and redundant operations add substantial noise. Action granularity: Generally one action per line, although the bitwise expression combines several unnecessary transformations. Reading flow: Standard method layout is easy to follow, but the transition from a long import block to obfuscated initialization interrupts an otherwise straightforward flow.