Third-party notices
===================

Pystachy is distributed under the MIT License (LICENSE), except for the parts below.

MicroPython arbitrary-precision integer core (mpz/mpz.c)
------------------------------------------------------

The multiply-add adapts
MicroPython v1.26.1 py/mpz.c, Copyright (c) 2013, 2014 Damien P. George,
under the MIT license reproduced in mpz/mpz.c. Pystachy supplies immutable
single-allocation values, collector integration, parsing, Python sign/bitwise
semantics, hashing and conversion adapters. mpz/README.md records upstream
source identity and changes.

MicroPython's integer tests (tests/programs/upstream/upstream_micropython_*.py)
-------------------------------------------------------------------------------

These are 35 of MicroPython's tests/basics/ integer tests at commit
a39e77f08d1daf13658ccae99b763003a8218bdf, each unchanged after a header that opts
it in to promoting ints, Copyright (c) 2013-2026 Damien P. George, under the MIT
license reproduced in tests/upstream/MICROPYTHON-LICENSE.txt.
tests/upstream/micropython.md records each file's SHA-256.

Its text conversion and arithmetic follow CPython 3.13.16's Objects/longobject.c
at commit cbc944f4bc59639a444dd971c737788ba2283a91 (long_from_binary_base,
long_from_non_binary_base, long_to_decimal_string_internal, x_add, x_sub, v_iadd,
v_isub, x_mul, kmul_split, k_mul, k_lopsided_mul, x_divrem and divrem1), as does
runtime.c's true division of promoting ints (long_true_divide); those parts are
derived from Python and are used under the Python Software Foundation License
Version 2 and copyright notice below.

Karpathy microGPT benchmark (bench/microgpt/, bench/smoke/ml.py)
--------------------------------------------

The pinned upstream microgpt.py and its annotated adaptation derive from Andrej
Karpathy's gist 8627fe009c40f57531cb18360106ce95, revision
14fb038816c7aae0bb9342c2dbf1a51dd134a5ff. The author explicitly licensed it under
MIT on 2026-02-24:
https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95?permalink_comment_id=5999841
The MIT license and attribution are retained in bench/microgpt/LICENSE; this
license text records the author's grant (the gist has no separate license file).
The benchmark README documents the source hash and adaptations. The names dataset
is supplied separately by the benchmark user and is not included here.
The smoke kernel retains only scalar add/multiply and reverse-mode traversal;
its deterministic DAG and dense/softmax drivers are original project code.

CPython's arbitrary-precision integer regression cases
------------------------------------------------------

tests/programs/numbers/mpz_cpython_long.py, mpz_cpython_long_division.py,
mpz_cpython_long_bitops.py, mpz_cpython_int.py and mpz_cpython_text.py adapt selected
methods of Lib/test/test_long.py and Lib/test/test_int.py from CPython 3.13.16,
commit cbc944f4bc59639a444dd971c737788ba2283a91. They use the Python Software
Foundation License Version 2; the complete license and copyright notices are
retained in tests/upstream/CPYTHON-LICENSE.txt. tests/upstream/mpz.md records the
original source hashes, preserved cases, adaptations and exclusions.

The adaptations replace unittest scaffolding with standalone assertions, use
explicit mpz values and decimal strings for oversized literals, replace divmod,
abs and pow with supported operations, and bound deterministic or seeded loops.
These selected cases do not claim unchanged execution of CPython's complete int
tests.

CPython's port acceptance fixtures (tests/upstream/ports/)
---------------------------------------------------------

The fnmatch and textwrap sources and their unedited test modules in
tests/upstream/ports/cpython/ are copied from CPython 3.13.16, commit
cbc944f4bc59639a444dd971c737788ba2283a91. The manifest pins their SHA-256 values.
They use the Python Software Foundation License Version 2; the exact upstream
license is included at tests/upstream/ports/cpython/LICENSE. The recorded adaptation
diffs are derived from the same sources and use the same license.

tests/programs/upstream/upstream_fnmatch.py and tests/upstream/regex_large.py adapt selected test
methods from that commit's Lib/test/test_fnmatch.py and Lib/test/test_re.py.
They replace unittest scaffolding with standalone assertions; their headers name
the methods and any exclusions. They use the same license and copyright notices.

tests/programs/upstream/upstream_textwrap_wrap.py, tests/programs/upstream/upstream_textwrap_layout.py,
tests/programs/upstream/upstream_textwrap_indent.py and tests/programs/upstream/upstream_textwrap_unicode.py
adapt that commit's Lib/test/test_textwrap.py. tests/programs/upstream/upstream_functools_cache.py
adapts selected methods from Lib/test/test_functools.py, whose source SHA-256 is
recorded in its header. tests/programs/upstream/upstream_contextlib.py and tests/programs/upstream/upstream_generators_protocol.py
adapt selected cases of that commit's Lib/test/test_contextlib.py and
Lib/test/test_generators.py. They preserve the upstream assertions for the supported
cases and disclose adaptations and exclusions; the same PSF license applies.

CPython's dynamic core regression cases
--------------------------------------

The tests/programs/upstream/upstream_json_decode_core.py,
upstream_json_encode_dynamic.py, upstream_json_recursion_dynamic.py,
upstream_dict_dynamic_values.py, upstream_deque_dynamic.py and
upstream_difflib_context.py programs adapt
selected methods from CPython 3.13.16's Lib/test/test_json/test_decode.py,
Lib/test/test_json/test_dump.py, Lib/test/test_json/test_recursion.py,
Lib/test/test_dict.py, Lib/test/test_deque.py and Lib/test/test_difflib.py at commit
cbc944f4bc59639a444dd971c737788ba2283a91. They use the Python Software Foundation
License Version 2, included at tests/upstream/CPYTHON-LICENSE.txt. Their headers
and tests/upstream/core-sweep.md identify exact sources, hashes, adaptations and
exclusions; these are selected differential cases, not the full upstream suite.

CPython's sequence regression (tests/programs/upstream/upstream_slice_none.py)
------------------------------------------------------------

The two list assertions with explicit None bounds are adapted from CPython 3.13.16's
Lib/test/seq_tests.py, CommonTest.test_getslice, at commit
cbc944f4bc59639a444dd971c737788ba2283a91. They use the Python Software Foundation
License Version 2; the complete upstream license is in tests/upstream/CPYTHON-LICENSE.txt.
The adaptation removes the unittest and type2test wrappers. The remaining assertions
extend that scenario to strings, computed None bounds,
evaluation order, optional bounds, bool bounds, and the signed-64-bit minimum.

CPython's HTML parser probe
--------------------------

lib/html/__init__.py, lib/html/entities.py, lib/html/parser.py and
lib/_markupbase.py derive from CPython 3.13.16 at commit
cbc944f4bc59639a444dd971c737788ba2283a91. Their upstream hashes are recorded in
lib/provenance.md. tests/programs/upstream/upstream_html_parser.py adapts 45 complete assertion sets
from Lib/test/test_htmlparser.py at that commit; its header records the source
hash, adaptations and exclusions. These sources and test assertions use the
Python Software Foundation License Version 2 and copyright notice below.

CPython's standard library modules (lib/)
-----------------------------------------

lib/bisect.py, lib/colorsys.py, lib/genericpath.py,
lib/posixpath.py, lib/stat.py, lib/struct.py, lib/this.py and lib/curses/ascii.py are unmodified copies of the files of the same names in CPython 3.13.16's
Lib/ directory (lib/README.md lists their SHA-256 sums). They are part of Python and are used
under the Python Software Foundation License Version 2, reproduced below, with the copyright
notice below. lib/curses/__init__.py is Pystachy's own.

lib/difflib.py is CPython 3.13.16's Lib/difflib.py with the edits lib/README.md lists, each
marked in the source; it is derived from Python and is used under the same license and copyright
notice.

lib/operator.py is CPython 3.13.16's Lib/operator.py with its classes attrgetter, itemgetter and
methodcaller edited as lib/compatibility.md describes, each edit marked in the source; it is
derived from Python and is used under the same license and copyright notice.

lib/getopt.py is CPython 3.13.16's Lib/getopt.py with the edits lib/README.md lists, each
marked in the source; it is derived from Python and is used under the same license and copyright
notice.

lib/tomllib/ is CPython 3.13.16's Lib/tomllib with the edits lib/compatibility.md lists, each
marked "Pystachy port:" in the source; it is derived from Python and is used under the same license
and copyright notice. Its files are Taneli Hukkinen's code ("SPDX-FileCopyrightText: 2021 Taneli
Hukkinen"), licensed to the PSF under a Contributor Agreement and also available under the MIT
License, whose text and copyright notice are in ports/tomli_w/LICENSE.
tests/programs/upstream/upstream_tomllib_data.py holds the TOML documents of CPython 3.13.16's
Lib/test/test_tomllib/data, and tests/programs/upstream/upstream_tomllib_misc.py adapts the
assertions of its Lib/test/test_tomllib/test_error.py and test_misc.py, under the same licenses.

lib/_pystachy_mappingproxy.py is Pystachy's own mappingproxy (types.MappingProxyType), written
after CPython 3.13.16's Objects/descrobject.c, whose behaviour, messages and docstrings it follows;
it is derived from Python and is used under the same license and copyright notice.

lib/io.py is Pystachy's own StringIO, written after CPython 3.13.16's Modules/_io/stringio.c,
whose behaviour and messages it follows and whose docstrings it keeps; it is derived from Python
and is used under the same license and copyright notice.

lib/_pystachy_iterators.py is Pystachy's own, written after the iterator types of CPython
3.13.16's Objects/listobject.c, tupleobject.c, unicodeobject.c, rangeobject.c, dictobject.c and
setobject.c, whose behaviour and messages it follows; it is derived from Python and is used under
the same license and copyright notice.

lib/codecs.py is CPython 3.13.16's Lib/codecs.py with the edits lib/compatibility.md lists,
each marked in the source; it is derived from Python and is used under the same license and
copyright notice. lib/_pystachy_codecs.py ports the codec functions of CPython 3.13.16's
Modules/_codecsmodule.c, Objects/unicodeobject.c and Objects/stringlib/codecs.h to Pystachy's
subset, following their behaviour and messages and keeping the C module's docstrings; it is
derived from Python and is used under the same license and copyright notice.

lib/_pystachy_atexit.py ports CPython 3.13.16's Modules/atexitmodule.c to Pystachy's subset,
following its order of callbacks and keeping the C module's docstrings; it is derived from Python
and is used under the same license and copyright notice.

lib/_pystachy_abc.py keeps the docstrings of CPython 3.13.16's Lib/abc.py and Modules/_abc.c,
whose abstract methods the compiler applies with the message of Objects/typeobject.c; it is
derived from Python and is used under the same license and copyright notice.

lib/_pystachy_binascii.py ports CPython 3.13.16's Modules/binascii.c and the hex separators of
Python/pystrhex.c to Pystachy's subset, following their behaviour and messages and keeping the C
module's docstrings; it is derived from Python and is used under the same license and copyright
notice.

lib/_pystachy_struct.py ports CPython 3.13.16's Modules/_struct.c and the float packing of
Objects/floatobject.c to Pystachy's subset, following their behaviour and messages and keeping
the C module's docstrings; it is derived from Python and is used under the same license and
copyright notice.

lib/_pystachy_thread.py ports CPython 3.13.16's Modules/_threadmodule.c, and the conversion of
timeouts of Python/pytime.c, to Pystachy's subset for one thread, following their behaviour and
messages and keeping the C module's docstrings; it is derived from Python and is used under the
same license and copyright notice.

lib/_pystachy_unicodedata.py ports CPython 3.13.16's Modules/unicodedata.c to Pystachy's subset,
following its behaviour and messages and keeping its docstrings. Its tables,
lib/_pystachy_unicodedata_db.py and lib/_pystachy_unicodedata_names.py, are generated by
tools/unicodedata_tables.py from CPython's unicodedata module and from the Unicode Character
Database (see "Unicode Character Database" below). They are derived from Python and are used
under the same license and copyright notice.

lib/_pystachy_itertools.py ports CPython 3.13.16's Modules/itertoolsmodule.c to Pystachy's
subset as generators that follow the pure-Python equivalents in its Doc/library/itertools.rst,
with the C module's behaviour, messages and docstrings; it is derived from Python and is used
under the same license and copyright notice (the documentation's code examples are also
offered under the Zero-Clause BSD license). tests/programs/upstream/upstream_itertools.py adapts selected tests
of that release's Lib/test/test_itertools.py; its header names them, the adaptations and the
exclusions, and the same license applies.

lib/re/__init__.py, lib/re/_constants.py and lib/re/_sre.py port CPython 3.13.16's
Lib/re/__init__.py, _parser.py, _compiler.py and _constants.py, and the matching engine of its
Modules/_sre/sre.c and sre_lib.h, to Pystachy's subset (lib/README.md). lib/re/_unicode.py is
generated by tools/re_tables.py from CPython's Unicode functions and holds the table of
Lib/re/_casefix.py. They are derived from Python and are used under the same license and
copyright notice.

runtime.c's unicode_classification table is generated by
tools/unicode_classification_tables.py from CPython 3.13.16's Unicode character
predicates (Unicode 15.1.0), encoded as property-flag transitions. It is derived
from Python and is used under the same license and copyright notice. The
underlying Unicode data is covered by "Unicode Character Database" below.

lib/fnmatch.py is CPython 3.13.16's Lib/fnmatch.py with the edits lib/README.md lists, each
marked in the source; it is derived from Python and is used under the same license and
copyright notice.

lib/functools.py is Pystachy's own code for cache() and lru_cache(), which follows the C
wrapper of CPython 3.13.16's Modules/_functoolsmodule.c (_lru_cache_wrapper) and keeps
docstrings of Lib/functools.py (lib/README.md). Its reduce(), cmp_to_key() and partial adapt
the Python fallbacks in Lib/functools.py, and its update_wrapper(), wraps() and their
constants are that file's, unchanged. It is derived from Python and is used under the same
license and copyright notice.

lib/textwrap.py is CPython 3.13.16's Lib/textwrap.py with the edits lib/README.md lists, each
marked in the source; it is derived from Python and is used under the same license and
copyright notice.

lib/contextlib.py is CPython 3.13.16's Lib/contextlib.py with the edits lib/compatibility.md
lists, each marked "Pystachy port" in the source; it is derived from Python and is used under
the same license and copyright notice.

lib/heapq.py is CPython 3.13.16's Lib/heapq.py with its functions nsmallest() and nlargest()
edited as lib/README.md lists, each edit marked in the source; it is derived from Python and is
used under the same license and copyright notice.

lib/string.py is CPython 3.13.16's Lib/string.py with the edits lib/README.md lists, each marked
in the source; it is derived from Python and is used under the same license and copyright notice.
lib/_pystachy_string.py is Pystachy's own code for the parsers of CPython 3.13.16's C module
_string, written after Objects/stringlib/unicode_format.h (MarkupIterator_next(), parse_field(),
field_name_split() and FieldNameIterator_next()), whose behaviour and messages it follows; it is
derived from Python and is used under the same license and copyright notice.

lib/csv.py is Pystachy's own code, written after CPython 3.13.16's Modules/_csv.c and Lib/csv.py
(lib/README.md); it keeps the docstrings and comments it copies from them (the module's docstring,
those of reader(), writer(), the registry functions and field_size_limit(), and the comments of the
reader's states). It is derived from Python and is used under the same license and copyright
notice.

lib/statistics.py is CPython 3.13.16's Lib/statistics.py with the edits lib/README.md lists, each
marked in the source; it is derived from Python and is used under the same license and copyright
notice.

lib/random.py is CPython 3.13.16's Lib/random.py with the edits lib/README.md lists, each
marked in the source. lib/_pyrandom.py
is Pystachy's own _random.Random for it, written after Modules/_randommodule.c and the float hash
of Python/pyhash.c, whose docstrings and comments it keeps. They are derived from Python and are
used under the same license and copyright notice; the Mersenne Twister in lib/_pyrandom.py is
also under the notice below.

lib/urllib/parse.py is CPython 3.13.16's Lib/urllib/parse.py with the edits lib/README.md lists,
each marked in the source; it is derived from Python and is used under the same license and
copyright notice. lib/urllib/__init__.py is CPython's, which is empty.

lib/html/__init__.py, lib/html/entities.py and lib/keyword.py adapt CPython 3.13.16's
files of the same paths under Lib/, at commit cbc944f4bc59639a444dd971c737788ba2283a91.
tests/programs/library/lib_html.py and tests/programs/library/lib_keyword.py adapt selected methods of Lib/test/test_html.py
and Lib/test/test_keyword.py from the same commit; their headers pin the source hashes
and identify exclusions. These sources and tests use the same PSF license and copyright
notice. Every source adaptation is marked # Pystachy port:.

lib/datetime.py is CPython 3.13.16's Lib/_pydatetime.py (which Lib/datetime.py re-exports) with
the edits lib/README.md lists, each marked # Pystachy port:. Where CPython's C module differs, the
edits follow Modules/_datetimemodule.c and the strftime() of Modules/timemodule.c at commit
cbc944f4bc59639a444dd971c737788ba2283a91. It is derived from Python and is used under the same
license and copyright notice.

lib/shlex.py adapts CPython 3.13.16's Lib/shlex.py at the same commit. Its upstream
table assertions in tests/programs/library/lib_shlex_upstream.py derive from Lib/test/test_shlex.py.
lib/collections/__init__.py implements a typed deque and defaultdict after
Modules/_collectionsmodule.c, including the deque's comparison mutation checks and their
messages, and an OrderedDict and a Counter after Lib/collections/__init__.py, whose
docstrings, comments and Counter method bodies it keeps, with the messages of
Objects/odictobject.c. These sources, their retained docstrings and upstream-derived tests
use the same PSF license and copyright notice.

Mersenne Twister (lib/_pyrandom.py)
-----------------------------------

lib/_pyrandom.py's init_genrand(), init_by_array() and genrand_uint32() follow CPython's
Modules/_randommodule.c, which is based on the MT19937 reference code. Its notice, as CPython's
documentation reproduces it from the original code:

     A C-program for MT19937, with initialization improved 2002/1/26.
     Coded by Takuji Nishimura and Makoto Matsumoto.

     Before using, initialize the state by using init_genrand(seed)
     or init_by_array(init_key, key_length).

     Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
     All rights reserved.

     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code must retain the above copyright
         notice, this list of conditions and the following disclaimer.

      2. Redistributions in binary form must reproduce the above copyright
         notice, this list of conditions and the following disclaimer in the
         documentation and/or other materials provided with the distribution.

      3. The names of its contributors may not be used to endorse or promote
         products derived from this software without specific prior written
         permission.

     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
     TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Unicode Character Database (generated tables)
---------------------------------------------

The tables of lib/_pystachy_unicodedata_db.py and lib/_pystachy_unicodedata_names.py hold data of
the Unicode Character Database 15.1.0 (https://www.unicode.org/ucd/), which
tools/unicodedata_tables.py takes from CPython's unicodedata module and from the database's
NameAliases.txt, NamedSequences.txt and NormalizationCorrections.txt.
runtime.c's unicode_classification table also holds Unicode Character Database
15.1.0 properties, generated by tools/unicode_classification_tables.py from
CPython 3.13.16's Unicode character predicates.

The data is used under the Unicode License V3:

UNICODE LICENSE V3

COPYRIGHT AND PERMISSION NOTICE

Copyright (c) 1991-2023 Unicode, Inc.

NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.

Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.

IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.

CPython's math tests (tests/)
----------------------------

tests/programs/upstream/upstream_math_fmod.py and tests/errors/upstream/upstream_math_fmod_arity.py adapt
MathTests.testFmod from CPython 3.13.16's Lib/test/test_math.py, commit
cbc944f4bc59639a444dd971c737788ba2283a91, under the Python Software Foundation
License Version 2 reproduced below; tests/upstream/CPYTHON-LICENSE.txt retains CPython's
full license. unittest and test.support scaffolding is removed;
the supported calls keep their expected values and exception classes as plain assertions.
The no-argument TypeError becomes an expected compile-time rejection, as Pystachy's
language contract specifies for static type errors. tests/programs/numbers/math_fmod_ieee.py is Pystachy's
own extension covering the IEEE nonfinite and signed-zero cross-product.

convertdate (ports/convertdate/)
--------------------------------

ports/convertdate/ holds convertdate 2.5.1's modules (its package src/convertdate without bahai.py,
french_republican.py, persian.py and data/french_republican_days.py), edited where
ports/convertdate/PORT.md lists (each edit is marked "Pystachy port:"). convertdate is used under
the MIT License, whose text and copyright notice ("Copyright (c) 2014-2022 Neil Freeman") are in
ports/convertdate/LICENSE. ports/convertdate/_calendar.py, which stands in for CPython's calendar
module, copies functions and constants of CPython 3.13.16's Lib/calendar.py and Lib/_pydatetime.py,
which are part of Python and are used under the Python Software Foundation License Version 2,
reproduced below. Summary of the changes made to them (clause 3 of the license): IllegalMonthError
derives from IndexError alone and its methods are annotated, FEBRUARY is the int 2, and weekday()
checks its arguments as datetime.date() does, counts the days with _pydatetime's _ymd2ord instead
of building a datetime.date, and returns an int.

iniconfig (ports/iniconfig/)
----------------------------

ports/iniconfig/__init__.py, _parse.py and exceptions.py are iniconfig 2.3.1's modules, edited
where ports/iniconfig/PORT.md lists (each edit is marked "Pystachy port:"). iniconfig is used
under the MIT License, whose text and copyright notice ("Copyright (c) 2010 - 2023 Holger Krekel
and others") are in ports/iniconfig/LICENSE.

jdcal (ports/jdcal/)
--------------------

ports/jdcal/__init__.py is jdcal 1.4.1's module jdcal.py, edited where ports/jdcal/PORT.md lists
(each edit is marked "Pystachy port:"). jdcal is used under the 2-clause BSD License, whose text
and copyright notice ("Copyright (c) 2011, Prasanth Nair") are in ports/jdcal/LICENSE.

ordered-set (ports/ordered_set/)
--------------------------------

ports/ordered_set/__init__.py is ordered-set 4.1.0's module, edited where
ports/ordered_set/PORT.md lists (each edit is marked "Pystachy port:"). ordered-set is used under
the MIT License, whose text and copyright notice ("Copyright (c) 2012-2022 Elia Robyn Lake") are
in ports/ordered_set/LICENSE.

pylev (ports/pylev/)
--------------------

ports/pylev/__init__.py, classic.py, damerau.py, recursive.py and wf.py are pylev 1.4.0's
modules, edited where ports/pylev/PORT.md lists (each edit is marked "Pystachy port:"). pylev
is used under the 3-clause BSD License, whose text and copyright notice ("Copyright (c) 2012,
Daniel Lindsley") are in ports/pylev/LICENSE.

qrcode (ports/qrcode/)
----------------------

ports/qrcode/__init__.py, base.py, constants.py, exceptions.py, LUT.py, main.py and util.py are
qrcode 8.2's modules, edited where ports/qrcode/PORT.md lists (each edit is marked "Pystachy
port:"). qrcode is used under the BSD 3-Clause License, whose text and copyright notice
("Copyright (c) 2011, Lincoln Loop") are in ports/qrcode/LICENSE, the sdist's LICENSE file; it
also holds the MIT License notice of pyqrnative, the code qrcode was forked from ("Copyright (c)
2009 Kazuhiko Arase").

roman (ports/roman/)
--------------------

ports/roman/__init__.py is roman 5.2's module, edited where ports/roman/PORT.md lists (each edit
is marked "Pystachy port:", and the file states that it was changed and when). roman is used
under the Zope Public License (ZPL) Version 2.1, whose text is in ports/roman/LICENSE; its
copyright notice ("Copyright (c) 2001 Mark Pilgrim and Contributors. All Rights Reserved.") is
kept in the header of ports/roman/__init__.py.

sgp4 (ports/sgp4/)
------------------

ports/sgp4/__init__.py, alpha5.py, api.py, earth_gravity.py, ext.py, functions.py, io.py,
model.py and propagation.py are sgp4 2.27's modules, edited where ports/sgp4/PORT.md lists (each
edit is marked "Pystachy port:"). sgp4 is used under the MIT License, whose text and copyright
notice ("Copyright © 2012–2016 Brandon Rhodes") are in ports/sgp4/LICENSE.

snowballstemmer (ports/snowballstemmer/)
----------------------------------------

ports/snowballstemmer/__init__.py, among.py, basestemmer.py, english_stemmer.py and
porter_stemmer.py are snowballstemmer 3.1.1's modules, edited where
ports/snowballstemmer/PORT.md lists (each edit is marked "Pystachy port:"). snowballstemmer is
used under the BSD 3-Clause License, whose text and copyright notices ("Copyright (c) 2001, Dr
Martin Porter", "Copyright (c) 2004,2005, Richard Boulton", "Copyright (c) 2013, Yoshiki
Shibukawa" and "Copyright (c) 2006-2025, Olly Betts") are in ports/snowballstemmer/LICENSE.

sortedcontainers (ports/sortedcontainers/)
------------------------------------------

ports/sortedcontainers/__init__.py and sortedlist.py are sortedcontainers 2.4.0's modules,
modified where ports/sortedcontainers/PORT.md lists (each file says at its top that it is
changed, and each edit is marked "Pystachy port:"). sortedcontainers is used under the Apache
License, Version 2.0, whose notice ("Copyright 2014-2019 Grant Jenks") is in
ports/sortedcontainers/LICENSE; the text of the License is reproduced at the end of this file.

sqids (ports/sqids/)
--------------------

ports/sqids/__init__.py, constants.py and sqids.py are sqids 0.5.2's modules, edited where
ports/sqids/PORT.md lists (each edit is marked "Pystachy port:"). sqids is used under the MIT
License, whose text and copyright notice ("Copyright (c) 2023-present Sqids maintainers.") are in
ports/sqids/LICENSE.

tomli-w (ports/tomli_w/)
------------------------

ports/tomli_w/__init__.py and _writer.py are tomli-w 1.2.0's modules, edited where
ports/tomli_w/PORT.md lists (each edit is marked "Pystachy port:"). tomli-w is used under the MIT
License, whose text and copyright notice ("Copyright (c) 2021 Taneli Hukkinen") are in
ports/tomli_w/LICENSE. tests/programs/apps/port_tomli_w_values.py and tests/programs/apps/port_tomli_w_tables.py adapt cases
of tomli-w's own tests (tests/test_style.py and tests/test_types.py of its repository at tag
1.2.0), under the same license.

wcwidth (ports/wcwidth/)
------------------------

ports/wcwidth/__init__.py, _constants.py, _wcswidth.py, _wcwidth.py, bisearch.py,
unicode_versions.py and table_ambiguous.py, table_grapheme.py, table_mc.py, table_vs15.py,
table_vs16.py, table_wide.py and table_zero.py are wcwidth 0.9.2's modules, edited where
ports/wcwidth/PORT.md lists (each edit is marked "Pystachy port:"). wcwidth is used under the MIT
License, whose text and copyright notice ("Copyright (c) 2014 Jeff Quast
<contact@jeffquast.com>") are in ports/wcwidth/LICENSE, with the permission notice of Markus
Kuhn's code that wcwidth derives from.

pyperformance (bench/pyperformance/)
------------------------------------

The Python files in bench/pyperformance/ are the run_benchmark.py files of 25 benchmarks from
pyperformance 1.14.0 (https://github.com/python/pyperformance), edited where
bench/pyperformance/README.md lists (each edit is marked "Pystachy port:"); that README records
the sdist's and each file's SHA-256. pyperformance is used under the MIT License, whose text is in
bench/pyperformance/LICENSE, with its list of authors in bench/pyperformance/AUTHORS. Each file
keeps its upstream header: regex_v8.py's holds the V8 project's BSD license ("Copyright 2009 the
V8 project authors"), and raytrace.py's says it may be redistributed under the MIT License
("Copyright Callum and Tony Garnock-Jones, 2008"). deltablue is excluded from the delivered suite
pending a separate provenance decision. fannkuch.py, meteor_contest.py,
nbody.py, pidigits.py, regex_dna.py and spectral_norm.py say they come from The Computer Language Benchmarks
Game, whose programs are published under the 3-clause BSD License; richards.py and
richards_super.py credit a Java version "Copyright (C) 1995 Sun Microsystems, Inc."; chaos.py says
"Copyright (C) 2005 Carl Friedrich Bolz". pyperformance distributes all of these files under its
MIT License; their origins are listed here so that a license review can confirm that this
suffices.

Byte BPE (bench/pyperformance/bpe_tokeniser.py and examples/byte_bpe/upstream/bpe_tokeniser.py)
-------------------------------------------------------------------------------------------

The pyperformance byte-BPE benchmark credits its author Shantanu Jain and says it is based
on tiktoken (https://github.com/openai/tiktoken). The pristine benchmark and its unmodified
Mary Shelley Frankenstein excerpt, bench/pyperformance/data/frankenstein_intro.txt, come from
pyperformance 1.14.0 at commit 2ab96f98f98274d07ebfdfd66e4f021723179706; source paths and SHA-256
hashes are recorded in examples/byte_bpe/upstream/provenance.json. The excerpt is the fixture
bundled by pyperformance; it has no separate license header. The pyperformance MIT license
and author list are retained in bench/pyperformance/LICENSE and AUTHORS.

The benchmark does not identify its original tiktoken revision. The tiktoken MIT notice below
is reproduced from LICENSE at commit 4e71bbe0c078468e00fefbf94b39849389f346e5
(https://github.com/openai/tiktoken/blob/4e71bbe0c078468e00fefbf94b39849389f346e5/LICENSE):

MIT License

Copyright (c) 2022 OpenAI, Shantanu Jain

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Ryu (ryu/)
----------

ryu/d2s.c, common.h, d2s_intrinsics.h, d2s_small_table.h, digit_table.h and ryu.h are the files of
those names in the ryu/ directory of Ryu (https://github.com/ulfjack/ryu), at commit
4c0618b0e44f7ef027ebae05d2cc7812048f7c8f, with their #include "ryu/NAME" lines changed to
#include "NAME" (ryu/README.md); runtime.c includes ryu/d2s.c for the digits of a float's repr.
Upstream offers these files under the Apache License, Version 2.0 or, alternatively, the Boost
Software License, Version 1.0. Pystachy uses them under the Boost Software License, Version 1.0,
whose text is in ryu/LICENSE-Boost; their copyright notice ("Copyright 2018 Ulf Adams") is kept in
each file's header.

CPython's list sort (runtime.c)
-------------------------------

The list sort in runtime.c (the section that starts with "list.sort is CPython 3.13's
timsort") is a port of the sort in CPython 3.13's Objects/listobject.c, designed in
Objects/listsort.txt. It is a derivative work of Python and is used under the Python
Software Foundation License Version 2, reproduced below.

Copyright (c) 2001-2024 Python Software Foundation; All Rights Reserved

Summary of the changes made to Python (clause 3 of the license): the lib/ modules are not
changed, except the ports and Pystachy's own modules that lib/README.md describes, whose edits it
lists. The functions of the sort
(binarysort, count_run, gallop_left/gallop_right, merge_lo/merge_hi, merge_at, the
powersort run stack) are translated from C over PyObject pointers to C over Pystachy's
8-byte list slots. Comparisons go through Pystachy's type descriptors (or call back into the
compiled program's __lt__ methods) instead of PyObject_RichCompare, in the same order as
CPython makes them; key= and the type-specialized compare functions are left out; ints and
floats are merged with branch-free selects; and the merge buffer is memory that Pystachy's
garbage collector scans.

CPython's gamma functions and isclose() (runtime.c)
---------------------------------------------------

math.gamma() and math.lgamma() in runtime.c (the section that starts with "math.gamma and
math.lgamma are CPython 3.13.16's m_tgamma and m_lgamma") are CPython 3.13.16's m_sinpi,
lanczos_sum, m_tgamma and m_lgamma from Modules/mathmodule.c (SHA-256
e9370d6380c154d620ab7d5b54727aedb6c19e786156974445b965d1dd9a233a), with their constants and
comments; pys_m_isclose, just before them, is that file's math_isclose_impl.
They are a derivative work of Python and are used under the Python Software Foundation License
Version 2, reproduced below. The changes: Python's Py_IS_FINITE, Py_IS_NAN, Py_IS_INFINITY,
Py_NAN, Py_HUGE_VAL and Py_INFINITY are C99's, the asserts are dropped, Py_UNREACHABLE() is
__builtin_unreachable(), errno is a parameter that pys_m_gamma and pys_m_lgamma test as
math_1a() and is_error() test errno, and each function forbids fused multiply-adds.

PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------

1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.

2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001-2024 Python Software Foundation; All Rights Reserved"
are retained in Python alone or in any derivative version prepared by Licensee.

3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.

4. PSF is making Python available to Licensee on an "AS IS"
basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.

5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.

7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee.  This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.

8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.

CPython's str.format() parser (src/pystachy_compiler/expressions.py)
--------------------------------------------------------------------

The compile-time reading of a literal str.format() format string (gen_str_fields, gen_str_field
and gen_format_arg in src/pystachy_compiler/expressions.py, and fmt_index in
src/pystachy_compiler/utils.py) is written after CPython 3.13.16's
Objects/stringlib/unicode_format.h (MarkupIterator_next, parse_field, field_name_split,
FieldNameIterator_next, get_integer, output_markup), whose order of steps and error messages it
follows. It is derived from Python and is used under the Python Software Foundation License
Version 2 above.

Summary of changes: the compiler reads the format, over the literal's UTF-8 bytes, and emits for
each field the lookups, conversion and format() call that CPython makes when the call runs, or
the exception CPython raises where it reaches an error.

CPython's sum regression tests (tests/programs/upstream/upstream_sum_start.py)
-----------------------------------------------------------

The range/start assertion in tests/programs/upstream/upstream_sum_start.py is adapted from
Lib/test/test_builtin.py, BuiltinTest.test_sum, at CPython commit
cbc944f4bc59639a444dd971c737788ba2283a91. The bool-start rejection fixture in
tests/errors/containers/sum_bool_start.py records the supported-language disposition of that
method's empty-list/bool-start assertion. These adaptations are used under the
Python Software Foundation License Version 2; the complete CPython license and
copyright notices are retained in tests/upstream/CPYTHON-LICENSE.txt.

Summary of changes: remove unittest scaffolding, annotate typed containers,
replace the dynamic bool result expectation with an explicit compiler rejection,
and add Pystachy regressions for iterator construction, argument evaluation and
traversal order. Differential output is recorded with CPython 3.13.16.

CPython's language and builtin regression tests (tests/programs/upstream/upstream_*.py)
---------------------------------------------------------------------

These differential tests and rejection fixtures adapt test methods of CPython 3.13.16's
Lib/test/ at commit cbc944f4bc59639a444dd971c737788ba2283a91:

- tests/programs/upstream/upstream_argparse_options.py: Lib/test/test_argparse.py
- tests/programs/upstream/upstream_scope_*.py and tests/errors/upstream/upstream_scope_*.py: Lib/test/test_scope.py
- tests/programs/upstream/upstream_decorators_*.py and tests/errors/upstream/upstream_decorators_*.py:
  Lib/test/test_decorators.py
- tests/programs/upstream/upstream_extcall_*.py and tests/errors/upstream/upstream_extcall_*.py: Lib/test/test_extcall.py
  (with test.support.sortdict() of Lib/test/support/__init__.py)
- tests/programs/upstream/upstream_call_*.py and tests/errors/upstream/upstream_call_*.py: Lib/test/test_call.py
- tests/programs/upstream/upstream_iter_*.py: Lib/test/test_iter.py
- tests/programs/upstream/upstream_builtin_*.py and tests/errors/upstream/upstream_builtin_*.py: Lib/test/test_builtin.py
- tests/programs/upstream/upstream_enumerate_*.py: Lib/test/test_enumerate.py
- tests/programs/upstream/upstream_dict_*.py: Lib/test/test_dict.py

They are used under the Python Software Foundation License Version 2 reproduced above;
tests/upstream/CPYTHON-LICENSE.txt retains CPython's full license. Each file's header names the
upstream test methods it adapts and lists, with the reason, those it leaves out.

Summary of changes: remove unittest, doctest and test.support scaffolding (each test method
becomes a function, assertEqual a printed value and an assert, assertRaises a try statement,
and each doctest example a statement commented with its expected output), add type annotations
where Pystachy's subset needs them, rename names that a module would bind twice, run as module
code what upstream runs with exec(), turn the syntax errors that upstream checks with compile()
and the TypeErrors of calls whose arguments do not fit into expected compile-time rejections,
draw random data from a fixed linear congruential sequence, reopen a file where upstream seeks
back, and leave out the cases that use what the subset does not support; where an adaptation
changes more (an attribute set on a function becomes a field of an object that holds it), the
file's header says so. Differential output is recorded with CPython 3.13.16.

CPython's import tests (tests/programs/upstream/upstream_import_failing.py)
---------------------------------------------------------

tests/programs/upstream/upstream_import_failing.py adapts ImportTests.test_failing_import_sticks and
ImportTracebackTests.test_exec_failure, test_exec_failure_nested, test_broken_submodule,
test_broken_from, test_broken_parent and test_broken_parent_from from CPython 3.13.16's
Lib/test/test_import/__init__.py, at commit cbc944f4bc59639a444dd971c737788ba2283a91;
the modules in tests/upimport/ hold the source those tests write. They are used under the
Python Software Foundation License Version 2; the complete CPython license and copyright
notices are retained in tests/upstream/CPYTHON-LICENSE.txt.

Summary of changes: each test becomes a function, and the modules it writes are files under
names of their own; the sys.modules and traceback assertions are left out, as Pystachy has
neither; each test also checks that the name its failed import would bind stays unbound.
Differential output is recorded with CPython 3.13.16.

CPython's re tests (tests/programs/upstream/upstream_re_*.py, tools/re_fuzz.py)
-------------------------------------------------------------

tests/programs/upstream/upstream_re_tests.py and tests/programs/upstream/upstream_re_tests_perl.py hold the benchmarks and tests
tables of CPython 3.13.16's Lib/test/re_tests.py, with their comments, and adapt
ExternalTests.test_re_tests and test_re_benchmarks of Lib/test/test_re.py, which run them;
tests/programs/upstream/upstream_re_errors.py, tests/programs/upstream/upstream_re_match.py, tests/programs/upstream/upstream_re_sub.py and
tests/programs/upstream/upstream_re_flags.py adapt cases of Lib/test/test_re.py's ReTests and PatternReprTests, and
tools/re_fuzz.py runs some of them at their full size; all at commit
cbc944f4bc59639a444dd971c737788ba2283a91. They are used under the Python Software Foundation
License Version 2; the complete CPython license and copyright notices are retained in
tests/upstream/CPYTHON-LICENSE.txt.

Summary of changes: the unittest scaffolding becomes tables of the upstream arguments and
expected values, and each case prints its result (the recorded output is CPython's re's); the
cases each file's header lists are left out, and some run on smaller inputs.

CPython's set tests (tests/programs/upstream/upstream_set_*.py)
---------------------------------------------

tests/programs/upstream/upstream_set_joint_ops.py adapts TestJointOps (run for set and frozenset, as TestSet and
TestFrozenSet run it) and TestSet's and TestFrozenSet's own tests, and
tests/programs/upstream/upstream_set_basic_ops.py adapts TestBasicOps (its Empty, Singleton, Tuple and String
cases), TestExceptionPropagation.test_changingSizeWhileIterating, TestBinaryOps, TestUpdateOps,
TestMutate, TestSubsets, TestOnlySetsInBinaryOps and TestIdentities, all from CPython 3.13.16's
Lib/test/test_set.py at commit cbc944f4bc59639a444dd971c737788ba2283a91. They are used under the
Python Software Foundation License Version 2; the complete CPython license and copyright notices
are retained in tests/upstream/CPYTHON-LICENSE.txt.

Summary of changes: unittest scaffolding becomes assertions, with prints of the values compared;
self.thetype and the loops over set, frozenset, dict.fromkeys, str, list and tuple become calls of
templates; generator functions become generator expressions; the cases each file's header lists
are left out, with the reason. Differential output is recorded with CPython 3.13.16.

CPython's numeric, tuple and exception tests (tests/programs/upstream/upstream_*.py)
------------------------------------------------------------------

These differential tests and rejection fixtures adapt test methods of CPython 3.13.16's
Lib/test/ at commit cbc944f4bc59639a444dd971c737788ba2283a91:

- tests/programs/upstream/upstream_int_*.py and tests/errors/upstream/upstream_int_*.py: Lib/test/test_int.py and
  Lib/test/test_long.py (with the underscore literals of Lib/test/support/numbers.py)
- tests/programs/upstream/upstream_float_*.py: Lib/test/test_float.py (with Lib/test/mathdata/
  formatfloat_testcases.txt and floating_points.txt, and Lib/test/support/numbers.py's
  underscore literals)
- tests/programs/upstream/upstream_math_*.py (but upstream_math_fmod.py, under CPython's math tests above) and
  tests/errors/upstream/upstream_math_prod_*.py: Lib/test/test_math.py (with
  Lib/test/mathdata/math_testcases.txt, the real cases of cmath_testcases.txt, and the doctest
  ieee754.txt)
- tests/programs/upstream/upstream_bool.py and tests/errors/upstream/upstream_bool_*.py: Lib/test/test_bool.py
- tests/programs/upstream/upstream_tuple_seq.py and tests/errors/upstream/upstream_tuple_*.py: Lib/test/test_tuple.py and
  the methods of Lib/test/seq_tests.py that its TupleTest runs
- tests/programs/upstream/upstream_exceptions_*.py and tests/errors/upstream/upstream_exceptions_*.py:
  Lib/test/test_exceptions.py
- tests/programs/upstream/upstream_baseexception.py and tests/errors/upstream/upstream_baseexception_*.py:
  Lib/test/test_baseexception.py (with Lib/test/exception_hierarchy.txt)

They are used under the Python Software Foundation License Version 2 reproduced above;
tests/upstream/CPYTHON-LICENSE.txt retains CPython's full license. Each file's header names the
upstream test methods it adapts and lists, with the reason, those it leaves out.

Summary of changes: remove unittest and test.support scaffolding (each test method becomes a
function, assertEqual a printed value and an assert, assertRaises a try statement, and each
doctest example a printed value and an assert), embed the data files the tests read, add type
annotations where Pystachy's subset needs them, write out the loops over builtin exception
classes and over values of several types, replace float.fromhex(), math.isclose() and
itertools.product() with small equivalents in the files that use them, draw random data from a
fixed linear congruential sequence, run the loops over large integers only as far as their
values fit in 64 bits, write testHypotAccuracy's expected values (upstream computes them with
decimal) as the floats CPython 3.13.16 computes, turn into expected compile-time rejections the
errors that Pystachy reports at compile time with CPython's message (among them the syntax
errors that upstream checks with compile()), and leave out the cases that use what the subset
does not support. Differential output is recorded with CPython 3.13.16.

NumPy's array tests (tests/programs/apps/example_ndarray_upstream.py)
-------------------------------------------------------

tests/programs/apps/example_ndarray_upstream.py adapts test functions and methods of NumPy 2.5.3, from the
files of the numpy 2.5.3 wheel: numpy/lib/tests/test_stride_tricks.py and
numpy/_core/tests/test_multiarray.py, test_ufunc.py, test_umath.py, test_indexerrors.py,
test_indexing.py and test_regression.py. Its header records each file's SHA-256 and names the
tests it adapts and what it leaves out. They are used under NumPy's BSD 3-Clause license,
Copyright (c) 2005-2025, NumPy Developers, reproduced in full in tests/upstream/NUMPY-LICENSE.txt.

Summary of changes: pytest and numpy.testing become standalone assertions
(assert_almost_equal keeps its rule); the arrays are examples/ndarray's float64 NDArrays,
so the other dtypes reduce to float64; shapes are lists; broadcast_arrays and
broadcast_shapes become sums with zero arrays; views that NumPy makes by slicing, and order='F'
arrays, are built from strides and an offset; the random inputs are written out as the values
NumPy 2.5.3 draws for them. examples/ndarray/check_upstream.py runs the adapted file against
NumPy itself. Differential output is recorded with CPython 3.13.16.

APACHE LICENSE VERSION 2.0
--------------------------

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


===============================================================================
nanoGPT (examples/nanogpt and native reference checks)
===============================================================================

Architecture, parameter names and numerical reference cases are adapted from
https://github.com/karpathy/nanoGPT at commit
3adf61e154c3fe3fca428ad6bc3818b27a3b8291. The upstream model.py SHA-256 is
7c01703240dbec5d554527dc666e35b3df8391d0b117fddc07afcf325a21d11c.
The native example replaces PyTorch operations with typed Python and ndarray;
PyTorch is used only by the optional offline exporter and validation oracle.

MIT License

Copyright (c) 2022 Andrej Karpathy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

json_repair port and parity inputs (ports/json_repair/, tests/upstream/json_repair/)
---------------------------------------------------------------------------------

Adapted from json_repair v0.64.1, commit ace9b23cb7fc6757775d5fafbfaaa9a88363a573:
https://github.com/mangiucugna/json_repair
Copyright (c) 2023 Stefano Baccianella. MIT licensed; the full license is retained
in ports/json_repair/LICENSE and tests/upstream/json_repair/LICENSE. The port guide
records scope and adaptations; the parity manifest pins original source/test hashes.
