├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── examples ├── agent │ ├── .python-version │ ├── README.md │ ├── main.py │ ├── pyproject.toml │ └── uv.lock ├── bubble.py ├── bubble.sh ├── fail_case.py ├── fail_case.sh ├── fib.py ├── fib.sh ├── hello.sh ├── list_files.py ├── list_files.sh ├── load_test.sh └── sys.sh ├── python-wasm ├── lib │ └── python3.12 │ │ ├── __future__.py │ │ ├── __hello__.py │ │ ├── __phello__ │ │ ├── __init__.py │ │ ├── ham │ │ │ ├── __init__.py │ │ │ └── eggs.py │ │ └── spam.py │ │ ├── __pycache__ │ │ ├── ast.cpython-312.pyc │ │ ├── contextlib.cpython-312.pyc │ │ ├── copyreg.cpython-312.pyc │ │ ├── dis.cpython-312.pyc │ │ ├── enum.cpython-312.pyc │ │ ├── functools.cpython-312.pyc │ │ ├── inspect.cpython-312.pyc │ │ ├── keyword.cpython-312.pyc │ │ ├── linecache.cpython-312.pyc │ │ ├── opcode.cpython-312.pyc │ │ ├── operator.cpython-312.pyc │ │ ├── reprlib.cpython-312.pyc │ │ ├── rlcompleter.cpython-312.pyc │ │ ├── token.cpython-312.pyc │ │ ├── tokenize.cpython-312.pyc │ │ ├── types.cpython-312.pyc │ │ └── warnings.cpython-312.pyc │ │ ├── _aix_support.py │ │ ├── _collections_abc.py │ │ ├── _compat_pickle.py │ │ ├── _compression.py │ │ ├── _markupbase.py │ │ ├── _osx_support.py │ │ ├── _py_abc.py │ │ ├── _pydatetime.py │ │ ├── _pydecimal.py │ │ ├── _pyio.py │ │ ├── _pylong.py │ │ ├── _sitebuiltins.py │ │ ├── _strptime.py │ │ ├── _sysconfigdata__wasi_wasm32-wasi.py │ │ ├── _threading_local.py │ │ ├── _weakrefset.py │ │ ├── abc.py │ │ ├── aifc.py │ │ ├── antigravity.py │ │ ├── argparse.py │ │ ├── ast.py │ │ ├── asyncio │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── base_events.py │ │ ├── base_futures.py │ │ ├── base_subprocess.py │ │ ├── base_tasks.py │ │ ├── constants.py │ │ ├── coroutines.py │ │ ├── events.py │ │ ├── exceptions.py │ │ ├── format_helpers.py │ │ ├── futures.py │ │ ├── locks.py │ │ ├── log.py │ │ ├── mixins.py │ │ ├── proactor_events.py │ │ ├── protocols.py │ │ ├── queues.py │ │ ├── runners.py │ │ ├── selector_events.py │ │ ├── sslproto.py │ │ ├── staggered.py │ │ ├── streams.py │ │ ├── subprocess.py │ │ ├── taskgroups.py │ │ ├── tasks.py │ │ ├── threads.py │ │ ├── timeouts.py │ │ ├── transports.py │ │ ├── trsock.py │ │ ├── unix_events.py │ │ ├── windows_events.py │ │ └── windows_utils.py │ │ ├── base64.py │ │ ├── bdb.py │ │ ├── bin │ │ └── normalizer │ │ ├── bisect.py │ │ ├── bz2.py │ │ ├── cProfile.py │ │ ├── calendar.py │ │ ├── certifi-2024.7.4.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ └── top_level.txt │ │ ├── certifi │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── __main__.cpython-312.pyc │ │ │ └── core.cpython-312.pyc │ │ ├── cacert.pem │ │ ├── core.py │ │ └── py.typed │ │ ├── cgi.py │ │ ├── cgitb.py │ │ ├── charset_normalizer-3.3.2.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ ├── entry_points.txt │ │ └── top_level.txt │ │ ├── charset_normalizer │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── __main__.cpython-312.pyc │ │ │ ├── api.cpython-312.pyc │ │ │ ├── cd.cpython-312.pyc │ │ │ ├── constant.cpython-312.pyc │ │ │ ├── legacy.cpython-312.pyc │ │ │ ├── md.cpython-312.pyc │ │ │ ├── models.cpython-312.pyc │ │ │ ├── utils.cpython-312.pyc │ │ │ └── version.cpython-312.pyc │ │ ├── api.py │ │ ├── cd.py │ │ ├── cli │ │ │ ├── __init__.py │ │ │ ├── __main__.py │ │ │ └── __pycache__ │ │ │ │ ├── __init__.cpython-312.pyc │ │ │ │ └── __main__.cpython-312.pyc │ │ ├── constant.py │ │ ├── legacy.py │ │ ├── md.cpython-312-darwin.so │ │ ├── md.py │ │ ├── md__mypyc.cpython-312-darwin.so │ │ ├── models.py │ │ ├── py.typed │ │ ├── utils.py │ │ └── version.py │ │ ├── chunk.py │ │ ├── cmd.py │ │ ├── code.py │ │ ├── codecs.py │ │ ├── codeop.py │ │ ├── collections │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ └── abc.cpython-312.pyc │ │ └── abc.py │ │ ├── colorsys.py │ │ ├── compileall.py │ │ ├── concurrent │ │ ├── __init__.py │ │ └── futures │ │ │ ├── __init__.py │ │ │ ├── _base.py │ │ │ ├── process.py │ │ │ └── thread.py │ │ ├── configparser.py │ │ ├── contextlib.py │ │ ├── contextvars.py │ │ ├── copy.py │ │ ├── copyreg.py │ │ ├── crypt.py │ │ ├── csv.py │ │ ├── ctypes │ │ ├── __init__.py │ │ ├── _aix.py │ │ ├── _endian.py │ │ ├── macholib │ │ │ ├── README.ctypes │ │ │ ├── __init__.py │ │ │ ├── dyld.py │ │ │ ├── dylib.py │ │ │ ├── fetch_macholib │ │ │ ├── fetch_macholib.bat │ │ │ └── framework.py │ │ ├── util.py │ │ └── wintypes.py │ │ ├── dataclasses.py │ │ ├── datetime.py │ │ ├── dbm │ │ ├── __init__.py │ │ ├── dumb.py │ │ ├── gnu.py │ │ └── ndbm.py │ │ ├── decimal.py │ │ ├── difflib.py │ │ ├── dis.py │ │ ├── doctest.py │ │ ├── email │ │ ├── __init__.py │ │ ├── _encoded_words.py │ │ ├── _header_value_parser.py │ │ ├── _parseaddr.py │ │ ├── _policybase.py │ │ ├── architecture.rst │ │ ├── base64mime.py │ │ ├── charset.py │ │ ├── contentmanager.py │ │ ├── encoders.py │ │ ├── errors.py │ │ ├── feedparser.py │ │ ├── generator.py │ │ ├── header.py │ │ ├── headerregistry.py │ │ ├── iterators.py │ │ ├── message.py │ │ ├── mime │ │ │ ├── __init__.py │ │ │ ├── application.py │ │ │ ├── audio.py │ │ │ ├── base.py │ │ │ ├── image.py │ │ │ ├── message.py │ │ │ ├── multipart.py │ │ │ ├── nonmultipart.py │ │ │ └── text.py │ │ ├── parser.py │ │ ├── policy.py │ │ ├── quoprimime.py │ │ └── utils.py │ │ ├── encodings │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── aliases.cpython-312.pyc │ │ │ └── utf_8.cpython-312.pyc │ │ ├── aliases.py │ │ ├── ascii.py │ │ ├── base64_codec.py │ │ ├── big5.py │ │ ├── big5hkscs.py │ │ ├── bz2_codec.py │ │ ├── charmap.py │ │ ├── cp037.py │ │ ├── cp1006.py │ │ ├── cp1026.py │ │ ├── cp1125.py │ │ ├── cp1140.py │ │ ├── cp1250.py │ │ ├── cp1251.py │ │ ├── cp1252.py │ │ ├── cp1253.py │ │ ├── cp1254.py │ │ ├── cp1255.py │ │ ├── cp1256.py │ │ ├── cp1257.py │ │ ├── cp1258.py │ │ ├── cp273.py │ │ ├── cp424.py │ │ ├── cp437.py │ │ ├── cp500.py │ │ ├── cp720.py │ │ ├── cp737.py │ │ ├── cp775.py │ │ ├── cp850.py │ │ ├── cp852.py │ │ ├── cp855.py │ │ ├── cp856.py │ │ ├── cp857.py │ │ ├── cp858.py │ │ ├── cp860.py │ │ ├── cp861.py │ │ ├── cp862.py │ │ ├── cp863.py │ │ ├── cp864.py │ │ ├── cp865.py │ │ ├── cp866.py │ │ ├── cp869.py │ │ ├── cp874.py │ │ ├── cp875.py │ │ ├── cp932.py │ │ ├── cp949.py │ │ ├── cp950.py │ │ ├── euc_jis_2004.py │ │ ├── euc_jisx0213.py │ │ ├── euc_jp.py │ │ ├── euc_kr.py │ │ ├── gb18030.py │ │ ├── gb2312.py │ │ ├── gbk.py │ │ ├── hex_codec.py │ │ ├── hp_roman8.py │ │ ├── hz.py │ │ ├── idna.py │ │ ├── iso2022_jp.py │ │ ├── iso2022_jp_1.py │ │ ├── iso2022_jp_2.py │ │ ├── iso2022_jp_2004.py │ │ ├── iso2022_jp_3.py │ │ ├── iso2022_jp_ext.py │ │ ├── iso2022_kr.py │ │ ├── iso8859_1.py │ │ ├── iso8859_10.py │ │ ├── iso8859_11.py │ │ ├── iso8859_13.py │ │ ├── iso8859_14.py │ │ ├── iso8859_15.py │ │ ├── iso8859_16.py │ │ ├── iso8859_2.py │ │ ├── iso8859_3.py │ │ ├── iso8859_4.py │ │ ├── iso8859_5.py │ │ ├── iso8859_6.py │ │ ├── iso8859_7.py │ │ ├── iso8859_8.py │ │ ├── iso8859_9.py │ │ ├── johab.py │ │ ├── koi8_r.py │ │ ├── koi8_t.py │ │ ├── koi8_u.py │ │ ├── kz1048.py │ │ ├── latin_1.py │ │ ├── mac_arabic.py │ │ ├── mac_croatian.py │ │ ├── mac_cyrillic.py │ │ ├── mac_farsi.py │ │ ├── mac_greek.py │ │ ├── mac_iceland.py │ │ ├── mac_latin2.py │ │ ├── mac_roman.py │ │ ├── mac_romanian.py │ │ ├── mac_turkish.py │ │ ├── mbcs.py │ │ ├── oem.py │ │ ├── palmos.py │ │ ├── ptcp154.py │ │ ├── punycode.py │ │ ├── quopri_codec.py │ │ ├── raw_unicode_escape.py │ │ ├── rot_13.py │ │ ├── shift_jis.py │ │ ├── shift_jis_2004.py │ │ ├── shift_jisx0213.py │ │ ├── tis_620.py │ │ ├── undefined.py │ │ ├── unicode_escape.py │ │ ├── utf_16.py │ │ ├── utf_16_be.py │ │ ├── utf_16_le.py │ │ ├── utf_32.py │ │ ├── utf_32_be.py │ │ ├── utf_32_le.py │ │ ├── utf_7.py │ │ ├── utf_8.py │ │ ├── utf_8_sig.py │ │ ├── uu_codec.py │ │ └── zlib_codec.py │ │ ├── enum.py │ │ ├── filecmp.py │ │ ├── fileinput.py │ │ ├── fnmatch.py │ │ ├── fractions.py │ │ ├── ftplib.py │ │ ├── functools.py │ │ ├── genericpath.py │ │ ├── getopt.py │ │ ├── getpass.py │ │ ├── gettext.py │ │ ├── glob.py │ │ ├── graphlib.py │ │ ├── gzip.py │ │ ├── hashlib.py │ │ ├── heapq.py │ │ ├── hmac.py │ │ ├── html │ │ ├── __init__.py │ │ ├── entities.py │ │ └── parser.py │ │ ├── http │ │ ├── __init__.py │ │ ├── client.py │ │ ├── cookiejar.py │ │ ├── cookies.py │ │ └── server.py │ │ ├── idna-3.7.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE.md │ │ ├── METADATA │ │ ├── RECORD │ │ └── WHEEL │ │ ├── idna │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── codec.cpython-312.pyc │ │ │ ├── compat.cpython-312.pyc │ │ │ ├── core.cpython-312.pyc │ │ │ ├── idnadata.cpython-312.pyc │ │ │ ├── intranges.cpython-312.pyc │ │ │ ├── package_data.cpython-312.pyc │ │ │ └── uts46data.cpython-312.pyc │ │ ├── codec.py │ │ ├── compat.py │ │ ├── core.py │ │ ├── idnadata.py │ │ ├── intranges.py │ │ ├── package_data.py │ │ ├── py.typed │ │ └── uts46data.py │ │ ├── imaplib.py │ │ ├── imghdr.py │ │ ├── importlib │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ └── __init__.cpython-312.pyc │ │ ├── _abc.py │ │ ├── _bootstrap.py │ │ ├── _bootstrap_external.py │ │ ├── abc.py │ │ ├── machinery.py │ │ ├── metadata │ │ │ ├── __init__.py │ │ │ ├── _adapters.py │ │ │ ├── _collections.py │ │ │ ├── _functools.py │ │ │ ├── _itertools.py │ │ │ ├── _meta.py │ │ │ └── _text.py │ │ ├── readers.py │ │ ├── resources │ │ │ ├── __init__.py │ │ │ ├── _adapters.py │ │ │ ├── _common.py │ │ │ ├── _itertools.py │ │ │ ├── _legacy.py │ │ │ ├── abc.py │ │ │ ├── readers.py │ │ │ └── simple.py │ │ ├── simple.py │ │ └── util.py │ │ ├── inspect.py │ │ ├── io.py │ │ ├── ipaddress.py │ │ ├── json │ │ ├── __init__.py │ │ ├── decoder.py │ │ ├── encoder.py │ │ ├── scanner.py │ │ └── tool.py │ │ ├── keyword.py │ │ ├── linecache.py │ │ ├── locale.py │ │ ├── logging │ │ ├── __init__.py │ │ ├── config.py │ │ └── handlers.py │ │ ├── lzma.py │ │ ├── mailbox.py │ │ ├── mailcap.py │ │ ├── mimetypes.py │ │ ├── modulefinder.py │ │ ├── msilib │ │ ├── __init__.py │ │ ├── schema.py │ │ ├── sequence.py │ │ └── text.py │ │ ├── netrc.py │ │ ├── nntplib.py │ │ ├── ntpath.py │ │ ├── nturl2path.py │ │ ├── numbers.py │ │ ├── opcode.py │ │ ├── operator.py │ │ ├── optparse.py │ │ ├── os.py │ │ ├── pathlib.py │ │ ├── pdb.py │ │ ├── pickle.py │ │ ├── pickletools.py │ │ ├── pipes.py │ │ ├── pkgutil.py │ │ ├── platform.py │ │ ├── plistlib.py │ │ ├── poplib.py │ │ ├── posixpath.py │ │ ├── pprint.py │ │ ├── profile.py │ │ ├── pstats.py │ │ ├── pty.py │ │ ├── py_compile.py │ │ ├── pyclbr.py │ │ ├── pydoc.py │ │ ├── pydoc_data │ │ ├── __init__.py │ │ ├── _pydoc.css │ │ └── topics.py │ │ ├── queue.py │ │ ├── quopri.py │ │ ├── random.py │ │ ├── re │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── _casefix.cpython-312.pyc │ │ │ ├── _compiler.cpython-312.pyc │ │ │ ├── _constants.cpython-312.pyc │ │ │ └── _parser.cpython-312.pyc │ │ ├── _casefix.py │ │ ├── _compiler.py │ │ ├── _constants.py │ │ └── _parser.py │ │ ├── reprlib.py │ │ ├── requests-2.32.3.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE │ │ ├── METADATA │ │ ├── RECORD │ │ ├── REQUESTED │ │ ├── WHEEL │ │ └── top_level.txt │ │ ├── requests │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── __version__.cpython-312.pyc │ │ │ ├── _internal_utils.cpython-312.pyc │ │ │ ├── adapters.cpython-312.pyc │ │ │ ├── api.cpython-312.pyc │ │ │ ├── auth.cpython-312.pyc │ │ │ ├── certs.cpython-312.pyc │ │ │ ├── compat.cpython-312.pyc │ │ │ ├── cookies.cpython-312.pyc │ │ │ ├── exceptions.cpython-312.pyc │ │ │ ├── help.cpython-312.pyc │ │ │ ├── hooks.cpython-312.pyc │ │ │ ├── models.cpython-312.pyc │ │ │ ├── packages.cpython-312.pyc │ │ │ ├── sessions.cpython-312.pyc │ │ │ ├── status_codes.cpython-312.pyc │ │ │ ├── structures.cpython-312.pyc │ │ │ └── utils.cpython-312.pyc │ │ ├── __version__.py │ │ ├── _internal_utils.py │ │ ├── adapters.py │ │ ├── api.py │ │ ├── auth.py │ │ ├── certs.py │ │ ├── compat.py │ │ ├── cookies.py │ │ ├── exceptions.py │ │ ├── help.py │ │ ├── hooks.py │ │ ├── models.py │ │ ├── packages.py │ │ ├── sessions.py │ │ ├── status_codes.py │ │ ├── structures.py │ │ └── utils.py │ │ ├── rlcompleter.py │ │ ├── runpy.py │ │ ├── sched.py │ │ ├── secrets.py │ │ ├── selectors.py │ │ ├── shelve.py │ │ ├── shlex.py │ │ ├── shutil.py │ │ ├── signal.py │ │ ├── site-packages │ │ └── README.txt │ │ ├── site.py │ │ ├── smtplib.py │ │ ├── sndhdr.py │ │ ├── socket.py │ │ ├── socketserver.py │ │ ├── sqlite3 │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── dbapi2.py │ │ └── dump.py │ │ ├── sre_compile.py │ │ ├── sre_constants.py │ │ ├── sre_parse.py │ │ ├── ssl.py │ │ ├── stat.py │ │ ├── statistics.py │ │ ├── string.py │ │ ├── stringprep.py │ │ ├── struct.py │ │ ├── subprocess.py │ │ ├── sunau.py │ │ ├── symtable.py │ │ ├── sysconfig.py │ │ ├── tabnanny.py │ │ ├── tarfile.py │ │ ├── telnetlib.py │ │ ├── tempfile.py │ │ ├── textwrap.py │ │ ├── this.py │ │ ├── threading.py │ │ ├── timeit.py │ │ ├── token.py │ │ ├── tokenize.py │ │ ├── tomllib │ │ ├── __init__.py │ │ ├── _parser.py │ │ ├── _re.py │ │ └── _types.py │ │ ├── trace.py │ │ ├── traceback.py │ │ ├── tracemalloc.py │ │ ├── tty.py │ │ ├── turtle.py │ │ ├── types.py │ │ ├── typing.py │ │ ├── unittest │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── _log.py │ │ ├── async_case.py │ │ ├── case.py │ │ ├── loader.py │ │ ├── main.py │ │ ├── mock.py │ │ ├── result.py │ │ ├── runner.py │ │ ├── signals.py │ │ ├── suite.py │ │ └── util.py │ │ ├── urllib │ │ ├── __init__.py │ │ ├── error.py │ │ ├── parse.py │ │ ├── request.py │ │ ├── response.py │ │ └── robotparser.py │ │ ├── urllib3-2.2.2.dist-info │ │ ├── INSTALLER │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ └── licenses │ │ │ └── LICENSE.txt │ │ ├── urllib3 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── _base_connection.cpython-312.pyc │ │ │ ├── _collections.cpython-312.pyc │ │ │ ├── _request_methods.cpython-312.pyc │ │ │ ├── _version.cpython-312.pyc │ │ │ ├── connection.cpython-312.pyc │ │ │ ├── connectionpool.cpython-312.pyc │ │ │ ├── exceptions.cpython-312.pyc │ │ │ ├── fields.cpython-312.pyc │ │ │ ├── filepost.cpython-312.pyc │ │ │ ├── http2.cpython-312.pyc │ │ │ ├── poolmanager.cpython-312.pyc │ │ │ └── response.cpython-312.pyc │ │ ├── _base_connection.py │ │ ├── _collections.py │ │ ├── _request_methods.py │ │ ├── _version.py │ │ ├── connection.py │ │ ├── connectionpool.py │ │ ├── contrib │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-312.pyc │ │ │ │ ├── pyopenssl.cpython-312.pyc │ │ │ │ └── socks.cpython-312.pyc │ │ │ ├── emscripten │ │ │ │ ├── __init__.py │ │ │ │ ├── __pycache__ │ │ │ │ │ ├── __init__.cpython-312.pyc │ │ │ │ │ ├── connection.cpython-312.pyc │ │ │ │ │ ├── fetch.cpython-312.pyc │ │ │ │ │ ├── request.cpython-312.pyc │ │ │ │ │ └── response.cpython-312.pyc │ │ │ │ ├── connection.py │ │ │ │ ├── emscripten_fetch_worker.js │ │ │ │ ├── fetch.py │ │ │ │ ├── request.py │ │ │ │ └── response.py │ │ │ ├── pyopenssl.py │ │ │ └── socks.py │ │ ├── exceptions.py │ │ ├── fields.py │ │ ├── filepost.py │ │ ├── http2.py │ │ ├── poolmanager.py │ │ ├── py.typed │ │ ├── response.py │ │ └── util │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── connection.cpython-312.pyc │ │ │ ├── proxy.cpython-312.pyc │ │ │ ├── request.cpython-312.pyc │ │ │ ├── response.cpython-312.pyc │ │ │ ├── retry.cpython-312.pyc │ │ │ ├── ssl_.cpython-312.pyc │ │ │ ├── ssl_match_hostname.cpython-312.pyc │ │ │ ├── ssltransport.cpython-312.pyc │ │ │ ├── timeout.cpython-312.pyc │ │ │ ├── url.cpython-312.pyc │ │ │ ├── util.cpython-312.pyc │ │ │ └── wait.cpython-312.pyc │ │ │ ├── connection.py │ │ │ ├── proxy.py │ │ │ ├── request.py │ │ │ ├── response.py │ │ │ ├── retry.py │ │ │ ├── ssl_.py │ │ │ ├── ssl_match_hostname.py │ │ │ ├── ssltransport.py │ │ │ ├── timeout.py │ │ │ ├── url.py │ │ │ ├── util.py │ │ │ └── wait.py │ │ ├── uu.py │ │ ├── uuid.py │ │ ├── warnings.py │ │ ├── wave.py │ │ ├── weakref.py │ │ ├── webbrowser.py │ │ ├── wsgiref │ │ ├── __init__.py │ │ ├── handlers.py │ │ ├── headers.py │ │ ├── simple_server.py │ │ ├── types.py │ │ ├── util.py │ │ └── validate.py │ │ ├── xdrlib.py │ │ ├── xml │ │ ├── __init__.py │ │ ├── dom │ │ │ ├── NodeFilter.py │ │ │ ├── __init__.py │ │ │ ├── domreg.py │ │ │ ├── expatbuilder.py │ │ │ ├── minicompat.py │ │ │ ├── minidom.py │ │ │ ├── pulldom.py │ │ │ └── xmlbuilder.py │ │ ├── etree │ │ │ ├── ElementInclude.py │ │ │ ├── ElementPath.py │ │ │ ├── ElementTree.py │ │ │ ├── __init__.py │ │ │ └── cElementTree.py │ │ ├── parsers │ │ │ ├── __init__.py │ │ │ └── expat.py │ │ └── sax │ │ │ ├── __init__.py │ │ │ ├── _exceptions.py │ │ │ ├── expatreader.py │ │ │ ├── handler.py │ │ │ ├── saxutils.py │ │ │ └── xmlreader.py │ │ ├── xmlrpc │ │ ├── __init__.py │ │ ├── client.py │ │ └── server.py │ │ ├── zipapp.py │ │ ├── zipfile │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── _path │ │ │ ├── __init__.py │ │ │ └── glob.py │ │ ├── zipimport.py │ │ └── zoneinfo │ │ ├── __init__.py │ │ ├── _common.py │ │ ├── _tzpath.py │ │ └── _zoneinfo.py └── python.wasm └── src ├── main.rs ├── memory_pipe.rs └── runner.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .venv/ 3 | venv/ 4 | env/ 5 | .env/ 6 | .DS_Store 7 | *.egg-info/ 8 | build/ -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runner" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1.0.86" 8 | async-trait = "0.1.81" 9 | axum = "0.7.5" 10 | bytes = "1.6.1" 11 | serde = "1.0.204" 12 | serde_json = "1.0.120" 13 | tokio = { version = "1.38.1", features = ["macros"] } 14 | tracing = "0.1.40" 15 | tracing-subscriber = "0.3.18" 16 | uuid = { version = "1.10.0", features = ["v4", "fast-rng"] } 17 | wasmtime = "22.0.0" 18 | wasmtime-wasi = "22.0.0" 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Erik Kaunismäki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/agent/.python-version: -------------------------------------------------------------------------------- 1 | 3.12 -------------------------------------------------------------------------------- /examples/agent/README.md: -------------------------------------------------------------------------------- 1 | # Example with simple LLM Agent 2 | 3 | A showcase of how to use the wasm sandbox with an LLM to generate and execute Python code. The wordflow is: 4 | 1. Take task descriptions 5 | 2. Generate corresponding Python code. I'm using the HuggingFace inference API, but anything that follows the OpenAI spec will work. 6 | 3. Execute the generated code on a local server 7 | 4. Return the stdout/stderr from the sandbox 8 | 9 | ## Requirements 10 | 11 | - Python 3.x 12 | - HuggingFace API token 13 | - Running code execution server (on port 3000) 14 | - (Optional but nice) uv 15 | 16 | ## Usage 17 | 18 | 1. Replace the placeholder API key in `main.py` with your HuggingFace token: 19 | ```python 20 | llm_api_key = "your_huggingface_api_token" 21 | ``` 22 | 23 | 2. Ensure the code execution server is running on `http://localhost:3000` 24 | 25 | 3. Run the agent (check below if you don't use uv): 26 | ```bash 27 | uv run main.py 28 | ``` 29 | 30 | Your output should be something like this: 31 | ``` 32 | 📝 Task: Write a Python function that calculates the factorial of a number and return the result for input 5 33 | 34 | 💻 Generated Code: 35 | def factorial(n): 36 | if n == 0 or n == 1: 37 | return 1 38 | else: 39 | return n * factorial(n - 1) 40 | 41 | result = factorial(5) 42 | print(result) 43 | 44 | 🚀 Executing code: 45 | Execution Result: {'res': {'status': 'Ok', 'output': '120\n'}} 46 | ``` 47 | 48 | And the server logs should be something like this: 49 | ``` 50 | 2024-11-17T13:46:25.199232Z INFO wasm_wasi_runner::runner: sandbox 4cfe60a2-fc96-4c14-827b-89a280eeef51 exited successfully after: 51.635167ms 51 | python e784b236-85d6-497b-8405-65b2ccdf829f: 120 52 | ``` 53 | 54 | The agent can be configured with different LLM models from HuggingFace Inference API. The default model is `Qwen/Qwen2.5-Coder-32B-Instruct`, but you can use any other supported model from the [HuggingFace Model List](https://huggingface.co/docs/api-inference/en/supported-models#supported-models). 55 | 56 | 57 | ## Installing deps with pip 58 | 59 | ```bash 60 | python3 -m venv venv 61 | source venv/bin/activate 62 | pip install . 63 | python3 run main.py 64 | ``` 65 | -------------------------------------------------------------------------------- /examples/agent/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "agent" 3 | version = "0.1.0" 4 | description = "Add your description here" 5 | readme = "README.md" 6 | requires-python = ">=3.12" 7 | dependencies = [ 8 | "huggingface-hub>=0.26.2", 9 | "requests>=2.32.3", 10 | ] 11 | -------------------------------------------------------------------------------- /examples/bubble.py: -------------------------------------------------------------------------------- 1 | def bubble_sort(arr): 2 | n = len(arr) 3 | for i in range(n): 4 | for j in range(0, n - i - 1): 5 | if arr[j] > arr[j + 1]: 6 | arr[j], arr[j + 1] = arr[j + 1], arr[j] 7 | return arr 8 | 9 | to_sort = [64, 34, 25, 12, 22, 11, 90] 10 | 11 | print(f"unsorted: {to_sort}") 12 | print(f"sorted: {bubble_sort(to_sort)}") 13 | -------------------------------------------------------------------------------- /examples/bubble.sh: -------------------------------------------------------------------------------- 1 | python_file="bubble.py" 2 | json_payload=$(jq -Rs . < "$python_file") 3 | 4 | curl -X POST http://localhost:3000/run \ 5 | -H "Content-Type: application/json" \ 6 | -d "{\"code\": $(jq -Rs . < "$python_file")}" -------------------------------------------------------------------------------- /examples/fail_case.py: -------------------------------------------------------------------------------- 1 | import urllib.request 2 | 3 | def main(): 4 | with urllib.request.urlopen('http://jsonplaceholder.typicode.com/todos/1') as response: 5 | data = response.read() 6 | print(data) 7 | 8 | if __name__ == "__main__": 9 | main() -------------------------------------------------------------------------------- /examples/fail_case.sh: -------------------------------------------------------------------------------- 1 | python_file="fail_case.py" 2 | json_payload=$(jq -Rs . < "$python_file") 3 | 4 | curl -X POST http://localhost:3000/run \ 5 | -H "Content-Type: application/json" \ 6 | -d "{\"code\": $(jq -Rs . < "$python_file")}" -------------------------------------------------------------------------------- /examples/fib.py: -------------------------------------------------------------------------------- 1 | def fibonacci(n): 2 | sequence = [0, 1] 3 | for _ in range(n - 2): 4 | sequence.append(sequence[-1] + sequence[-2]) 5 | return sequence 6 | 7 | print(fibonacci(10)) 8 | -------------------------------------------------------------------------------- /examples/fib.sh: -------------------------------------------------------------------------------- 1 | python_file="fib.py" 2 | json_payload=$(jq -Rs . < "$python_file") 3 | 4 | curl -X POST http://localhost:3000/run \ 5 | -H "Content-Type: application/json" \ 6 | -d "{\"code\": $(jq -Rs . < "$python_file")}" -------------------------------------------------------------------------------- /examples/hello.sh: -------------------------------------------------------------------------------- 1 | curl -X POST http://localhost:3000/run \ 2 | -H "Content-Type: application/json" \ 3 | -d "{\"code\": \"print('hello world')\"}" -------------------------------------------------------------------------------- /examples/list_files.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | def list_files(path='.'): 4 | """List all files in the given directory and its subdirectories.""" 5 | file_list = [] 6 | for root, dirs, files in os.walk(path): 7 | for file in files: 8 | file_list.append(os.path.join(root, file)) 9 | return file_list 10 | 11 | files = list_files() 12 | print("Files found:") 13 | for file in sorted(files): 14 | print(f"- {file}") 15 | -------------------------------------------------------------------------------- /examples/list_files.sh: -------------------------------------------------------------------------------- 1 | python_file="list_files.py" 2 | json_payload=$(jq -Rs . < "$python_file") 3 | 4 | curl -X POST http://localhost:3000/run \ 5 | -H "Content-Type: application/json" \ 6 | -d "{\"code\": $(jq -Rs . < "$python_file")}" -------------------------------------------------------------------------------- /examples/load_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -ne 1 ]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | parallel ./hello.sh ::: $(seq 1 $1) 9 | 10 | -------------------------------------------------------------------------------- /examples/sys.sh: -------------------------------------------------------------------------------- 1 | curl -X POST http://localhost:3000/run \ 2 | -H "Content-Type: application/json" \ 3 | -d "{\"code\": \"import sys; print(sys.platform); import os; print(os.uname().machine)\"}" -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__hello__.py: -------------------------------------------------------------------------------- 1 | initialized = True 2 | 3 | class TestFrozenUtf8_1: 4 | """\u00b6""" 5 | 6 | class TestFrozenUtf8_2: 7 | """\u03c0""" 8 | 9 | class TestFrozenUtf8_4: 10 | """\U0001f600""" 11 | 12 | def main(): 13 | print("Hello world!") 14 | 15 | if __name__ == '__main__': 16 | main() 17 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__phello__/__init__.py: -------------------------------------------------------------------------------- 1 | initialized = True 2 | 3 | def main(): 4 | print("Hello world!") 5 | 6 | if __name__ == '__main__': 7 | main() 8 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__phello__/ham/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__phello__/ham/__init__.py -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__phello__/ham/eggs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__phello__/ham/eggs.py -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__phello__/spam.py: -------------------------------------------------------------------------------- 1 | initialized = True 2 | 3 | def main(): 4 | print("Hello world!") 5 | 6 | if __name__ == '__main__': 7 | main() 8 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/ast.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/ast.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/contextlib.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/contextlib.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/copyreg.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/copyreg.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/dis.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/dis.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/enum.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/enum.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/functools.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/functools.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/inspect.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/inspect.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/keyword.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/keyword.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/linecache.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/linecache.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/opcode.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/opcode.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/operator.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/operator.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/reprlib.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/reprlib.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/rlcompleter.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/rlcompleter.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/token.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/token.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/tokenize.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/tokenize.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/types.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/types.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/__pycache__/warnings.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/__pycache__/warnings.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/antigravity.py: -------------------------------------------------------------------------------- 1 | 2 | import webbrowser 3 | import hashlib 4 | 5 | webbrowser.open("https://xkcd.com/353/") 6 | 7 | def geohash(latitude, longitude, datedow): 8 | '''Compute geohash() using the Munroe algorithm. 9 | 10 | >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 11 | 37.857713 -122.544543 12 | 13 | ''' 14 | # https://xkcd.com/426/ 15 | h = hashlib.md5(datedow, usedforsecurity=False).hexdigest() 16 | p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])] 17 | print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:])) 18 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/asyncio/__init__.py: -------------------------------------------------------------------------------- 1 | """The asyncio package, tracking PEP 3156.""" 2 | 3 | # flake8: noqa 4 | 5 | import sys 6 | 7 | # This relies on each of the submodules having an __all__ variable. 8 | from .base_events import * 9 | from .coroutines import * 10 | from .events import * 11 | from .exceptions import * 12 | from .futures import * 13 | from .locks import * 14 | from .protocols import * 15 | from .runners import * 16 | from .queues import * 17 | from .streams import * 18 | from .subprocess import * 19 | from .tasks import * 20 | from .taskgroups import * 21 | from .timeouts import * 22 | from .threads import * 23 | from .transports import * 24 | 25 | __all__ = (base_events.__all__ + 26 | coroutines.__all__ + 27 | events.__all__ + 28 | exceptions.__all__ + 29 | futures.__all__ + 30 | locks.__all__ + 31 | protocols.__all__ + 32 | runners.__all__ + 33 | queues.__all__ + 34 | streams.__all__ + 35 | subprocess.__all__ + 36 | tasks.__all__ + 37 | taskgroups.__all__ + 38 | threads.__all__ + 39 | timeouts.__all__ + 40 | transports.__all__) 41 | 42 | if sys.platform == 'win32': # pragma: no cover 43 | from .windows_events import * 44 | __all__ += windows_events.__all__ 45 | else: 46 | from .unix_events import * # pragma: no cover 47 | __all__ += unix_events.__all__ 48 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/asyncio/base_futures.py: -------------------------------------------------------------------------------- 1 | __all__ = () 2 | 3 | import reprlib 4 | 5 | from . import format_helpers 6 | 7 | # States for Future. 8 | _PENDING = 'PENDING' 9 | _CANCELLED = 'CANCELLED' 10 | _FINISHED = 'FINISHED' 11 | 12 | 13 | def isfuture(obj): 14 | """Check for a Future. 15 | 16 | This returns True when obj is a Future instance or is advertising 17 | itself as duck-type compatible by setting _asyncio_future_blocking. 18 | See comment in Future for more details. 19 | """ 20 | return (hasattr(obj.__class__, '_asyncio_future_blocking') and 21 | obj._asyncio_future_blocking is not None) 22 | 23 | 24 | def _format_callbacks(cb): 25 | """helper function for Future.__repr__""" 26 | size = len(cb) 27 | if not size: 28 | cb = '' 29 | 30 | def format_cb(callback): 31 | return format_helpers._format_callback_source(callback, ()) 32 | 33 | if size == 1: 34 | cb = format_cb(cb[0][0]) 35 | elif size == 2: 36 | cb = '{}, {}'.format(format_cb(cb[0][0]), format_cb(cb[1][0])) 37 | elif size > 2: 38 | cb = '{}, <{} more>, {}'.format(format_cb(cb[0][0]), 39 | size - 2, 40 | format_cb(cb[-1][0])) 41 | return f'cb=[{cb}]' 42 | 43 | 44 | def _future_repr_info(future): 45 | # (Future) -> str 46 | """helper function for Future.__repr__""" 47 | info = [future._state.lower()] 48 | if future._state == _FINISHED: 49 | if future._exception is not None: 50 | info.append(f'exception={future._exception!r}') 51 | else: 52 | # use reprlib to limit the length of the output, especially 53 | # for very long strings 54 | result = reprlib.repr(future._result) 55 | info.append(f'result={result}') 56 | if future._callbacks: 57 | info.append(_format_callbacks(future._callbacks)) 58 | if future._source_traceback: 59 | frame = future._source_traceback[-1] 60 | info.append(f'created at {frame[0]}:{frame[1]}') 61 | return info 62 | 63 | 64 | @reprlib.recursive_repr() 65 | def _future_repr(future): 66 | info = ' '.join(_future_repr_info(future)) 67 | return f'<{future.__class__.__name__} {info}>' 68 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/asyncio/constants.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/MagicStack/uvloop/tree/v0.16.0 2 | # SPDX-License-Identifier: PSF-2.0 AND (MIT OR Apache-2.0) 3 | # SPDX-FileCopyrightText: Copyright (c) 2015-2021 MagicStack Inc. http://magic.io 4 | 5 | import enum 6 | 7 | # After the connection is lost, log warnings after this many write()s. 8 | LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5 9 | 10 | # Seconds to wait before retrying accept(). 11 | ACCEPT_RETRY_DELAY = 1 12 | 13 | # Number of stack entries to capture in debug mode. 14 | # The larger the number, the slower the operation in debug mode 15 | # (see extract_stack() in format_helpers.py). 16 | DEBUG_STACK_DEPTH = 10 17 | 18 | # Number of seconds to wait for SSL handshake to complete 19 | # The default timeout matches that of Nginx. 20 | SSL_HANDSHAKE_TIMEOUT = 60.0 21 | 22 | # Number of seconds to wait for SSL shutdown to complete 23 | # The default timeout mimics lingering_time 24 | SSL_SHUTDOWN_TIMEOUT = 30.0 25 | 26 | # Used in sendfile fallback code. We use fallback for platforms 27 | # that don't support sendfile, or for TLS connections. 28 | SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 256 29 | 30 | FLOW_CONTROL_HIGH_WATER_SSL_READ = 256 # KiB 31 | FLOW_CONTROL_HIGH_WATER_SSL_WRITE = 512 # KiB 32 | 33 | # Default timeout for joining the threads in the threadpool 34 | THREAD_JOIN_TIMEOUT = 300 35 | 36 | # The enum should be here to break circular dependencies between 37 | # base_events and sslproto 38 | class _SendfileMode(enum.Enum): 39 | UNSUPPORTED = enum.auto() 40 | TRY_NATIVE = enum.auto() 41 | FALLBACK = enum.auto() 42 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/asyncio/exceptions.py: -------------------------------------------------------------------------------- 1 | """asyncio exceptions.""" 2 | 3 | 4 | __all__ = ('BrokenBarrierError', 5 | 'CancelledError', 'InvalidStateError', 'TimeoutError', 6 | 'IncompleteReadError', 'LimitOverrunError', 7 | 'SendfileNotAvailableError') 8 | 9 | 10 | class CancelledError(BaseException): 11 | """The Future or Task was cancelled.""" 12 | 13 | 14 | TimeoutError = TimeoutError # make local alias for the standard exception 15 | 16 | 17 | class InvalidStateError(Exception): 18 | """The operation is not allowed in this state.""" 19 | 20 | 21 | class SendfileNotAvailableError(RuntimeError): 22 | """Sendfile syscall is not available. 23 | 24 | Raised if OS does not support sendfile syscall for given socket or 25 | file type. 26 | """ 27 | 28 | 29 | class IncompleteReadError(EOFError): 30 | """ 31 | Incomplete read error. Attributes: 32 | 33 | - partial: read bytes string before the end of stream was reached 34 | - expected: total number of expected bytes (or None if unknown) 35 | """ 36 | def __init__(self, partial, expected): 37 | r_expected = 'undefined' if expected is None else repr(expected) 38 | super().__init__(f'{len(partial)} bytes read on a total of ' 39 | f'{r_expected} expected bytes') 40 | self.partial = partial 41 | self.expected = expected 42 | 43 | def __reduce__(self): 44 | return type(self), (self.partial, self.expected) 45 | 46 | 47 | class LimitOverrunError(Exception): 48 | """Reached the buffer limit while looking for a separator. 49 | 50 | Attributes: 51 | - consumed: total number of to be consumed bytes. 52 | """ 53 | def __init__(self, message, consumed): 54 | super().__init__(message) 55 | self.consumed = consumed 56 | 57 | def __reduce__(self): 58 | return type(self), (self.args[0], self.consumed) 59 | 60 | 61 | class BrokenBarrierError(RuntimeError): 62 | """Barrier is broken by barrier.abort() call.""" 63 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/asyncio/log.py: -------------------------------------------------------------------------------- 1 | """Logging configuration.""" 2 | 3 | import logging 4 | 5 | 6 | # Name the logger after the package. 7 | logger = logging.getLogger(__package__) 8 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/asyncio/mixins.py: -------------------------------------------------------------------------------- 1 | """Event loop mixins.""" 2 | 3 | import threading 4 | from . import events 5 | 6 | _global_lock = threading.Lock() 7 | 8 | 9 | class _LoopBoundMixin: 10 | _loop = None 11 | 12 | def _get_loop(self): 13 | loop = events._get_running_loop() 14 | 15 | if self._loop is None: 16 | with _global_lock: 17 | if self._loop is None: 18 | self._loop = loop 19 | if loop is not self._loop: 20 | raise RuntimeError(f'{self!r} is bound to a different event loop') 21 | return loop 22 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/asyncio/threads.py: -------------------------------------------------------------------------------- 1 | """High-level support for working with threads in asyncio""" 2 | 3 | import functools 4 | import contextvars 5 | 6 | from . import events 7 | 8 | 9 | __all__ = "to_thread", 10 | 11 | 12 | async def to_thread(func, /, *args, **kwargs): 13 | """Asynchronously run function *func* in a separate thread. 14 | 15 | Any *args and **kwargs supplied for this function are directly passed 16 | to *func*. Also, the current :class:`contextvars.Context` is propagated, 17 | allowing context variables from the main thread to be accessed in the 18 | separate thread. 19 | 20 | Return a coroutine that can be awaited to get the eventual result of *func*. 21 | """ 22 | loop = events.get_running_loop() 23 | ctx = contextvars.copy_context() 24 | func_call = functools.partial(ctx.run, func, *args, **kwargs) 25 | return await loop.run_in_executor(None, func_call) 26 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/bin/normalizer: -------------------------------------------------------------------------------- 1 | #!/opt/homebrew/opt/python@3.12/bin/python3.12 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from charset_normalizer.cli import cli_detect 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(cli_detect()) 9 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi-2024.7.4.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi-2024.7.4.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | This package contains a modified version of ca-bundle.crt: 2 | 3 | ca-bundle.crt -- Bundle of CA Root Certificates 4 | 5 | This is a bundle of X.509 certificates of public Certificate Authorities 6 | (CA). These were automatically extracted from Mozilla's root certificates 7 | file (certdata.txt). This file can be found in the mozilla source tree: 8 | https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt 9 | It contains the certificates in PEM format and therefore 10 | can be directly used with curl / libcurl / php_curl, or with 11 | an Apache+mod_ssl webserver for SSL client authentication. 12 | Just configure this file as the SSLCACertificateFile.# 13 | 14 | ***** BEGIN LICENSE BLOCK ***** 15 | This Source Code Form is subject to the terms of the Mozilla Public License, 16 | v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain 17 | one at http://mozilla.org/MPL/2.0/. 18 | 19 | ***** END LICENSE BLOCK ***** 20 | @(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $ 21 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi-2024.7.4.dist-info/METADATA: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.1 2 | Name: certifi 3 | Version: 2024.7.4 4 | Summary: Python package for providing Mozilla's CA Bundle. 5 | Home-page: https://github.com/certifi/python-certifi 6 | Author: Kenneth Reitz 7 | Author-email: me@kennethreitz.com 8 | License: MPL-2.0 9 | Project-URL: Source, https://github.com/certifi/python-certifi 10 | Classifier: Development Status :: 5 - Production/Stable 11 | Classifier: Intended Audience :: Developers 12 | Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) 13 | Classifier: Natural Language :: English 14 | Classifier: Programming Language :: Python 15 | Classifier: Programming Language :: Python :: 3 16 | Classifier: Programming Language :: Python :: 3 :: Only 17 | Classifier: Programming Language :: Python :: 3.6 18 | Classifier: Programming Language :: Python :: 3.7 19 | Classifier: Programming Language :: Python :: 3.8 20 | Classifier: Programming Language :: Python :: 3.9 21 | Classifier: Programming Language :: Python :: 3.10 22 | Classifier: Programming Language :: Python :: 3.11 23 | Classifier: Programming Language :: Python :: 3.12 24 | Requires-Python: >=3.6 25 | License-File: LICENSE 26 | 27 | Certifi: Python SSL Certificates 28 | ================================ 29 | 30 | Certifi provides Mozilla's carefully curated collection of Root Certificates for 31 | validating the trustworthiness of SSL certificates while verifying the identity 32 | of TLS hosts. It has been extracted from the `Requests`_ project. 33 | 34 | Installation 35 | ------------ 36 | 37 | ``certifi`` is available on PyPI. Simply install it with ``pip``:: 38 | 39 | $ pip install certifi 40 | 41 | Usage 42 | ----- 43 | 44 | To reference the installed certificate authority (CA) bundle, you can use the 45 | built-in function:: 46 | 47 | >>> import certifi 48 | 49 | >>> certifi.where() 50 | '/usr/local/lib/python3.7/site-packages/certifi/cacert.pem' 51 | 52 | Or from the command line:: 53 | 54 | $ python -m certifi 55 | /usr/local/lib/python3.7/site-packages/certifi/cacert.pem 56 | 57 | Enjoy! 58 | 59 | .. _`Requests`: https://requests.readthedocs.io/en/master/ 60 | 61 | Addition/Removal of Certificates 62 | -------------------------------- 63 | 64 | Certifi does not support any addition/removal or other modification of the 65 | CA trust store content. This project is intended to provide a reliable and 66 | highly portable root of trust to python deployments. Look to upstream projects 67 | for methods to use alternate trust. 68 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi-2024.7.4.dist-info/RECORD: -------------------------------------------------------------------------------- 1 | certifi-2024.7.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 2 | certifi-2024.7.4.dist-info/LICENSE,sha256=6TcW2mucDVpKHfYP5pWzcPBpVgPSH2-D8FPkLPwQyvc,989 3 | certifi-2024.7.4.dist-info/METADATA,sha256=L9_EuPoQQvHFzxu03_ctaEZxhEty7inz569jGWjlLGo,2221 4 | certifi-2024.7.4.dist-info/RECORD,, 5 | certifi-2024.7.4.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91 6 | certifi-2024.7.4.dist-info/top_level.txt,sha256=KMu4vUCfsjLrkPbSNdgdekS-pVJzBAJFO__nI8NF6-U,8 7 | certifi/__init__.py,sha256=LHXz7E80YJYBzCBv6ZyidQ5-ciYSkSebpY2E5OM0l7o,94 8 | certifi/__main__.py,sha256=xBBoj905TUWBLRGANOcf7oi6e-3dMP4cEoG9OyMs11g,243 9 | certifi/__pycache__/__init__.cpython-312.pyc,, 10 | certifi/__pycache__/__main__.cpython-312.pyc,, 11 | certifi/__pycache__/core.cpython-312.pyc,, 12 | certifi/cacert.pem,sha256=SIupYGAr8HzGP073rsEIaS_sQYIPwzKKjj894DgUmu4,291528 13 | certifi/core.py,sha256=qRDDFyXVJwTB_EmoGppaXU_R9qCZvhl-EzxPMuV3nTA,4426 14 | certifi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 15 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi-2024.7.4.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: setuptools (70.2.0) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi-2024.7.4.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | certifi 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import contents, where 2 | 3 | __all__ = ["contents", "where"] 4 | __version__ = "2024.07.04" 5 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi/__main__.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | from certifi import contents, where 4 | 5 | parser = argparse.ArgumentParser() 6 | parser.add_argument("-c", "--contents", action="store_true") 7 | args = parser.parse_args() 8 | 9 | if args.contents: 10 | print(contents()) 11 | else: 12 | print(where()) 13 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/certifi/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi/__pycache__/__main__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/certifi/__pycache__/__main__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi/__pycache__/core.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/certifi/__pycache__/core.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/certifi/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/certifi/py.typed -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer-3.3.2.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer-3.3.2.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 TAHRI Ahmed R. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer-3.3.2.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.41.2) 3 | Root-Is-Purelib: false 4 | Tag: cp312-cp312-macosx_11_0_arm64 5 | 6 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer-3.3.2.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | normalizer = charset_normalizer.cli:cli_detect 3 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer-3.3.2.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | charset_normalizer 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Charset-Normalizer 4 | ~~~~~~~~~~~~~~ 5 | The Real First Universal Charset Detector. 6 | A library that helps you read text from an unknown charset encoding. 7 | Motivated by chardet, This package is trying to resolve the issue by taking a new approach. 8 | All IANA character set names for which the Python core library provides codecs are supported. 9 | 10 | Basic usage: 11 | >>> from charset_normalizer import from_bytes 12 | >>> results = from_bytes('Bсеки човек има право на образование. Oбразованието!'.encode('utf_8')) 13 | >>> best_guess = results.best() 14 | >>> str(best_guess) 15 | 'Bсеки човек има право на образование. Oбразованието!' 16 | 17 | Others methods and usages are available - see the full documentation 18 | at . 19 | :copyright: (c) 2021 by Ahmed TAHRI 20 | :license: MIT, see LICENSE for more details. 21 | """ 22 | import logging 23 | 24 | from .api import from_bytes, from_fp, from_path, is_binary 25 | from .legacy import detect 26 | from .models import CharsetMatch, CharsetMatches 27 | from .utils import set_logging_handler 28 | from .version import VERSION, __version__ 29 | 30 | __all__ = ( 31 | "from_fp", 32 | "from_path", 33 | "from_bytes", 34 | "is_binary", 35 | "detect", 36 | "CharsetMatch", 37 | "CharsetMatches", 38 | "__version__", 39 | "VERSION", 40 | "set_logging_handler", 41 | ) 42 | 43 | # Attach a NullHandler to the top level logger by default 44 | # https://docs.python.org/3.3/howto/logging.html#configuring-logging-for-a-library 45 | 46 | logging.getLogger("charset_normalizer").addHandler(logging.NullHandler()) 47 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__main__.py: -------------------------------------------------------------------------------- 1 | from .cli import cli_detect 2 | 3 | if __name__ == "__main__": 4 | cli_detect() 5 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/__main__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/__main__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/api.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/api.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/cd.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/cd.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/constant.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/constant.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/legacy.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/legacy.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/md.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/md.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/models.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/models.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/utils.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/utils.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/__pycache__/version.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/__pycache__/version.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/cli/__init__.py: -------------------------------------------------------------------------------- 1 | from .__main__ import cli_detect, query_yes_no 2 | 3 | __all__ = ( 4 | "cli_detect", 5 | "query_yes_no", 6 | ) 7 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/cli/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/cli/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/cli/__pycache__/__main__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/cli/__pycache__/__main__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/legacy.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Optional, Union 2 | from warnings import warn 3 | 4 | from .api import from_bytes 5 | from .constant import CHARDET_CORRESPONDENCE 6 | 7 | 8 | def detect( 9 | byte_str: bytes, should_rename_legacy: bool = False, **kwargs: Any 10 | ) -> Dict[str, Optional[Union[str, float]]]: 11 | """ 12 | chardet legacy method 13 | Detect the encoding of the given byte string. It should be mostly backward-compatible. 14 | Encoding name will match Chardet own writing whenever possible. (Not on encoding name unsupported by it) 15 | This function is deprecated and should be used to migrate your project easily, consult the documentation for 16 | further information. Not planned for removal. 17 | 18 | :param byte_str: The byte sequence to examine. 19 | :param should_rename_legacy: Should we rename legacy encodings 20 | to their more modern equivalents? 21 | """ 22 | if len(kwargs): 23 | warn( 24 | f"charset-normalizer disregard arguments '{','.join(list(kwargs.keys()))}' in legacy function detect()" 25 | ) 26 | 27 | if not isinstance(byte_str, (bytearray, bytes)): 28 | raise TypeError( # pragma: nocover 29 | "Expected object of type bytes or bytearray, got: " 30 | "{0}".format(type(byte_str)) 31 | ) 32 | 33 | if isinstance(byte_str, bytearray): 34 | byte_str = bytes(byte_str) 35 | 36 | r = from_bytes(byte_str).best() 37 | 38 | encoding = r.encoding if r is not None else None 39 | language = r.language if r is not None and r.language != "Unknown" else "" 40 | confidence = 1.0 - r.chaos if r is not None else None 41 | 42 | # Note: CharsetNormalizer does not return 'UTF-8-SIG' as the sig get stripped in the detection/normalization process 43 | # but chardet does return 'utf-8-sig' and it is a valid codec name. 44 | if r is not None and encoding == "utf_8" and r.bom: 45 | encoding += "_sig" 46 | 47 | if should_rename_legacy is False and encoding in CHARDET_CORRESPONDENCE: 48 | encoding = CHARDET_CORRESPONDENCE[encoding] 49 | 50 | return { 51 | "encoding": encoding, 52 | "language": language, 53 | "confidence": confidence, 54 | } 55 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/md.cpython-312-darwin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/md.cpython-312-darwin.so -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/md__mypyc.cpython-312-darwin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/md__mypyc.cpython-312-darwin.so -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/charset_normalizer/py.typed -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/charset_normalizer/version.py: -------------------------------------------------------------------------------- 1 | """ 2 | Expose version 3 | """ 4 | 5 | __version__ = "3.3.2" 6 | VERSION = __version__.split(".") 7 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/collections/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/collections/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/collections/__pycache__/abc.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/collections/__pycache__/abc.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/collections/abc.py: -------------------------------------------------------------------------------- 1 | from _collections_abc import * 2 | from _collections_abc import __all__ 3 | from _collections_abc import _CallableGenericAlias 4 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/concurrent/__init__.py: -------------------------------------------------------------------------------- 1 | # This directory is a Python package. 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/concurrent/futures/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Brian Quinlan. All Rights Reserved. 2 | # Licensed to PSF under a Contributor Agreement. 3 | 4 | """Execute computations asynchronously using threads or processes.""" 5 | 6 | __author__ = 'Brian Quinlan (brian@sweetapp.com)' 7 | 8 | from concurrent.futures._base import (FIRST_COMPLETED, 9 | FIRST_EXCEPTION, 10 | ALL_COMPLETED, 11 | CancelledError, 12 | TimeoutError, 13 | InvalidStateError, 14 | BrokenExecutor, 15 | Future, 16 | Executor, 17 | wait, 18 | as_completed) 19 | 20 | __all__ = ( 21 | 'FIRST_COMPLETED', 22 | 'FIRST_EXCEPTION', 23 | 'ALL_COMPLETED', 24 | 'CancelledError', 25 | 'TimeoutError', 26 | 'BrokenExecutor', 27 | 'Future', 28 | 'Executor', 29 | 'wait', 30 | 'as_completed', 31 | 'ProcessPoolExecutor', 32 | 'ThreadPoolExecutor', 33 | ) 34 | 35 | 36 | def __dir__(): 37 | return __all__ + ('__author__', '__doc__') 38 | 39 | 40 | def __getattr__(name): 41 | global ProcessPoolExecutor, ThreadPoolExecutor 42 | 43 | if name == 'ProcessPoolExecutor': 44 | from .process import ProcessPoolExecutor as pe 45 | ProcessPoolExecutor = pe 46 | return pe 47 | 48 | if name == 'ThreadPoolExecutor': 49 | from .thread import ThreadPoolExecutor as te 50 | ThreadPoolExecutor = te 51 | return te 52 | 53 | raise AttributeError(f"module {__name__!r} has no attribute {name!r}") 54 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/contextvars.py: -------------------------------------------------------------------------------- 1 | from _contextvars import Context, ContextVar, Token, copy_context 2 | 3 | 4 | __all__ = ('Context', 'ContextVar', 'Token', 'copy_context') 5 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/ctypes/macholib/README.ctypes: -------------------------------------------------------------------------------- 1 | Files in this directory come from Bob Ippolito's py2app. 2 | 3 | License: Any components of the py2app suite may be distributed under 4 | the MIT or PSF open source licenses. 5 | 6 | This is version 1.0, SVN revision 789, from 2006/01/25. 7 | The main repository is http://svn.red-bean.com/bob/macholib/trunk/macholib/ -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/ctypes/macholib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Enough Mach-O to make your head spin. 3 | 4 | See the relevant header files in /usr/include/mach-o 5 | 6 | And also Apple's documentation. 7 | """ 8 | 9 | __version__ = '1.0' 10 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/ctypes/macholib/dylib.py: -------------------------------------------------------------------------------- 1 | """ 2 | Generic dylib path manipulation 3 | """ 4 | 5 | import re 6 | 7 | __all__ = ['dylib_info'] 8 | 9 | DYLIB_RE = re.compile(r"""(?x) 10 | (?P^.*)(?:^|/) 11 | (?P 12 | (?P\w+?) 13 | (?:\.(?P[^._]+))? 14 | (?:_(?P[^._]+))? 15 | \.dylib$ 16 | ) 17 | """) 18 | 19 | def dylib_info(filename): 20 | """ 21 | A dylib name can take one of the following four forms: 22 | Location/Name.SomeVersion_Suffix.dylib 23 | Location/Name.SomeVersion.dylib 24 | Location/Name_Suffix.dylib 25 | Location/Name.dylib 26 | 27 | returns None if not found or a mapping equivalent to: 28 | dict( 29 | location='Location', 30 | name='Name.SomeVersion_Suffix.dylib', 31 | shortname='Name', 32 | version='SomeVersion', 33 | suffix='Suffix', 34 | ) 35 | 36 | Note that SomeVersion and Suffix are optional and may be None 37 | if not present. 38 | """ 39 | is_dylib = DYLIB_RE.match(filename) 40 | if not is_dylib: 41 | return None 42 | return is_dylib.groupdict() 43 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/ctypes/macholib/fetch_macholib: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . 3 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/ctypes/macholib/fetch_macholib.bat: -------------------------------------------------------------------------------- 1 | svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/ctypes/macholib/framework.py: -------------------------------------------------------------------------------- 1 | """ 2 | Generic framework path manipulation 3 | """ 4 | 5 | import re 6 | 7 | __all__ = ['framework_info'] 8 | 9 | STRICT_FRAMEWORK_RE = re.compile(r"""(?x) 10 | (?P^.*)(?:^|/) 11 | (?P 12 | (?P\w+).framework/ 13 | (?:Versions/(?P[^/]+)/)? 14 | (?P=shortname) 15 | (?:_(?P[^_]+))? 16 | )$ 17 | """) 18 | 19 | def framework_info(filename): 20 | """ 21 | A framework name can take one of the following four forms: 22 | Location/Name.framework/Versions/SomeVersion/Name_Suffix 23 | Location/Name.framework/Versions/SomeVersion/Name 24 | Location/Name.framework/Name_Suffix 25 | Location/Name.framework/Name 26 | 27 | returns None if not found, or a mapping equivalent to: 28 | dict( 29 | location='Location', 30 | name='Name.framework/Versions/SomeVersion/Name_Suffix', 31 | shortname='Name', 32 | version='SomeVersion', 33 | suffix='Suffix', 34 | ) 35 | 36 | Note that SomeVersion and Suffix are optional and may be None 37 | if not present 38 | """ 39 | is_framework = STRICT_FRAMEWORK_RE.match(filename) 40 | if not is_framework: 41 | return None 42 | return is_framework.groupdict() 43 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/datetime.py: -------------------------------------------------------------------------------- 1 | try: 2 | from _datetime import * 3 | from _datetime import __doc__ 4 | except ImportError: 5 | from _pydatetime import * 6 | from _pydatetime import __doc__ 7 | 8 | __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", 9 | "MINYEAR", "MAXYEAR", "UTC") 10 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/dbm/gnu.py: -------------------------------------------------------------------------------- 1 | """Provide the _gdbm module as a dbm submodule.""" 2 | 3 | from _gdbm import * 4 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/dbm/ndbm.py: -------------------------------------------------------------------------------- 1 | """Provide the _dbm module as a dbm submodule.""" 2 | 3 | from _dbm import * 4 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/decimal.py: -------------------------------------------------------------------------------- 1 | 2 | try: 3 | from _decimal import * 4 | from _decimal import __doc__ 5 | from _decimal import __version__ 6 | from _decimal import __libmpdec_version__ 7 | except ImportError: 8 | from _pydecimal import * 9 | from _pydecimal import __doc__ 10 | from _pydecimal import __version__ 11 | from _pydecimal import __libmpdec_version__ 12 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2007 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """A package for parsing, handling, and generating email messages.""" 6 | 7 | __all__ = [ 8 | 'base64mime', 9 | 'charset', 10 | 'encoders', 11 | 'errors', 12 | 'feedparser', 13 | 'generator', 14 | 'header', 15 | 'iterators', 16 | 'message', 17 | 'message_from_file', 18 | 'message_from_binary_file', 19 | 'message_from_string', 20 | 'message_from_bytes', 21 | 'mime', 22 | 'parser', 23 | 'quoprimime', 24 | 'utils', 25 | ] 26 | 27 | 28 | # Some convenience routines. Don't import Parser and Message as side-effects 29 | # of importing email since those cascadingly import most of the rest of the 30 | # email package. 31 | def message_from_string(s, *args, **kws): 32 | """Parse a string into a Message object model. 33 | 34 | Optional _class and strict are passed to the Parser constructor. 35 | """ 36 | from email.parser import Parser 37 | return Parser(*args, **kws).parsestr(s) 38 | 39 | def message_from_bytes(s, *args, **kws): 40 | """Parse a bytes string into a Message object model. 41 | 42 | Optional _class and strict are passed to the Parser constructor. 43 | """ 44 | from email.parser import BytesParser 45 | return BytesParser(*args, **kws).parsebytes(s) 46 | 47 | def message_from_file(fp, *args, **kws): 48 | """Read a file and parse its contents into a Message object model. 49 | 50 | Optional _class and strict are passed to the Parser constructor. 51 | """ 52 | from email.parser import Parser 53 | return Parser(*args, **kws).parse(fp) 54 | 55 | def message_from_binary_file(fp, *args, **kws): 56 | """Read a binary file and parse its contents into a Message object model. 57 | 58 | Optional _class and strict are passed to the Parser constructor. 59 | """ 60 | from email.parser import BytesParser 61 | return BytesParser(*args, **kws).parse(fp) 62 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/encoders.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Encodings and related functions.""" 6 | 7 | __all__ = [ 8 | 'encode_7or8bit', 9 | 'encode_base64', 10 | 'encode_noop', 11 | 'encode_quopri', 12 | ] 13 | 14 | 15 | from base64 import encodebytes as _bencode 16 | from quopri import encodestring as _encodestring 17 | 18 | 19 | def _qencode(s): 20 | enc = _encodestring(s, quotetabs=True) 21 | # Must encode spaces, which quopri.encodestring() doesn't do 22 | return enc.replace(b' ', b'=20') 23 | 24 | 25 | def encode_base64(msg): 26 | """Encode the message's payload in Base64. 27 | 28 | Also, add an appropriate Content-Transfer-Encoding header. 29 | """ 30 | orig = msg.get_payload(decode=True) 31 | encdata = str(_bencode(orig), 'ascii') 32 | msg.set_payload(encdata) 33 | msg['Content-Transfer-Encoding'] = 'base64' 34 | 35 | 36 | def encode_quopri(msg): 37 | """Encode the message's payload in quoted-printable. 38 | 39 | Also, add an appropriate Content-Transfer-Encoding header. 40 | """ 41 | orig = msg.get_payload(decode=True) 42 | encdata = _qencode(orig) 43 | msg.set_payload(encdata) 44 | msg['Content-Transfer-Encoding'] = 'quoted-printable' 45 | 46 | 47 | def encode_7or8bit(msg): 48 | """Set the Content-Transfer-Encoding header to 7bit or 8bit.""" 49 | orig = msg.get_payload(decode=True) 50 | if orig is None: 51 | # There's no payload. For backwards compatibility we use 7bit 52 | msg['Content-Transfer-Encoding'] = '7bit' 53 | return 54 | # We play a trick to make this go fast. If decoding from ASCII succeeds, 55 | # we know the data must be 7bit, otherwise treat it as 8bit. 56 | try: 57 | orig.decode('ascii') 58 | except UnicodeError: 59 | msg['Content-Transfer-Encoding'] = '8bit' 60 | else: 61 | msg['Content-Transfer-Encoding'] = '7bit' 62 | 63 | 64 | def encode_noop(msg): 65 | """Do nothing.""" 66 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/iterators.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Various types of useful iterators and generators.""" 6 | 7 | __all__ = [ 8 | 'body_line_iterator', 9 | 'typed_subpart_iterator', 10 | 'walk', 11 | # Do not include _structure() since it's part of the debugging API. 12 | ] 13 | 14 | import sys 15 | from io import StringIO 16 | 17 | 18 | # This function will become a method of the Message class 19 | def walk(self): 20 | """Walk over the message tree, yielding each subpart. 21 | 22 | The walk is performed in depth-first order. This method is a 23 | generator. 24 | """ 25 | yield self 26 | if self.is_multipart(): 27 | for subpart in self.get_payload(): 28 | yield from subpart.walk() 29 | 30 | 31 | # These two functions are imported into the Iterators.py interface module. 32 | def body_line_iterator(msg, decode=False): 33 | """Iterate over the parts, returning string payloads line-by-line. 34 | 35 | Optional decode (default False) is passed through to .get_payload(). 36 | """ 37 | for subpart in msg.walk(): 38 | payload = subpart.get_payload(decode=decode) 39 | if isinstance(payload, str): 40 | yield from StringIO(payload) 41 | 42 | 43 | def typed_subpart_iterator(msg, maintype='text', subtype=None): 44 | """Iterate over the subparts with a given MIME type. 45 | 46 | Use `maintype' as the main MIME type to match against; this defaults to 47 | "text". Optional `subtype' is the MIME subtype to match against; if 48 | omitted, only the main type is matched. 49 | """ 50 | for subpart in msg.walk(): 51 | if subpart.get_content_maintype() == maintype: 52 | if subtype is None or subpart.get_content_subtype() == subtype: 53 | yield subpart 54 | 55 | 56 | def _structure(msg, fp=None, level=0, include_default=False): 57 | """A handy debugging aid""" 58 | if fp is None: 59 | fp = sys.stdout 60 | tab = ' ' * (level * 4) 61 | print(tab + msg.get_content_type(), end='', file=fp) 62 | if include_default: 63 | print(' [%s]' % msg.get_default_type(), file=fp) 64 | else: 65 | print(file=fp) 66 | if msg.is_multipart(): 67 | for subpart in msg.get_payload(): 68 | _structure(subpart, fp, level+1, include_default) 69 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/mime/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/email/mime/__init__.py -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/mime/application.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Keith Dart 3 | # Contact: email-sig@python.org 4 | 5 | """Class representing application/* type MIME documents.""" 6 | 7 | __all__ = ["MIMEApplication"] 8 | 9 | from email import encoders 10 | from email.mime.nonmultipart import MIMENonMultipart 11 | 12 | 13 | class MIMEApplication(MIMENonMultipart): 14 | """Class for generating application/* MIME documents.""" 15 | 16 | def __init__(self, _data, _subtype='octet-stream', 17 | _encoder=encoders.encode_base64, *, policy=None, **_params): 18 | """Create an application/* type MIME document. 19 | 20 | _data contains the bytes for the raw application data. 21 | 22 | _subtype is the MIME content type subtype, defaulting to 23 | 'octet-stream'. 24 | 25 | _encoder is a function which will perform the actual encoding for 26 | transport of the application data, defaulting to base64 encoding. 27 | 28 | Any additional keyword arguments are passed to the base class 29 | constructor, which turns them into parameters on the Content-Type 30 | header. 31 | """ 32 | if _subtype is None: 33 | raise TypeError('Invalid application MIME subtype') 34 | MIMENonMultipart.__init__(self, 'application', _subtype, policy=policy, 35 | **_params) 36 | self.set_payload(_data) 37 | _encoder(self) 38 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/mime/base.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Base class for MIME specializations.""" 6 | 7 | __all__ = ['MIMEBase'] 8 | 9 | import email.policy 10 | 11 | from email import message 12 | 13 | 14 | class MIMEBase(message.Message): 15 | """Base class for MIME specializations.""" 16 | 17 | def __init__(self, _maintype, _subtype, *, policy=None, **_params): 18 | """This constructor adds a Content-Type: and a MIME-Version: header. 19 | 20 | The Content-Type: header is taken from the _maintype and _subtype 21 | arguments. Additional parameters for this header are taken from the 22 | keyword arguments. 23 | """ 24 | if policy is None: 25 | policy = email.policy.compat32 26 | message.Message.__init__(self, policy=policy) 27 | ctype = '%s/%s' % (_maintype, _subtype) 28 | self.add_header('Content-Type', ctype, **_params) 29 | self['MIME-Version'] = '1.0' 30 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/mime/message.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Class representing message/* MIME documents.""" 6 | 7 | __all__ = ['MIMEMessage'] 8 | 9 | from email import message 10 | from email.mime.nonmultipart import MIMENonMultipart 11 | 12 | 13 | class MIMEMessage(MIMENonMultipart): 14 | """Class representing message/* MIME documents.""" 15 | 16 | def __init__(self, _msg, _subtype='rfc822', *, policy=None): 17 | """Create a message/* type MIME document. 18 | 19 | _msg is a message object and must be an instance of Message, or a 20 | derived class of Message, otherwise a TypeError is raised. 21 | 22 | Optional _subtype defines the subtype of the contained message. The 23 | default is "rfc822" (this is defined by the MIME standard, even though 24 | the term "rfc822" is technically outdated by RFC 2822). 25 | """ 26 | MIMENonMultipart.__init__(self, 'message', _subtype, policy=policy) 27 | if not isinstance(_msg, message.Message): 28 | raise TypeError('Argument is not an instance of Message') 29 | # It's convenient to use this base class method. We need to do it 30 | # this way or we'll get an exception 31 | message.Message.attach(self, _msg) 32 | # And be sure our default type is set correctly 33 | self.set_default_type('message/rfc822') 34 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/mime/multipart.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2002-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Base class for MIME multipart/* type messages.""" 6 | 7 | __all__ = ['MIMEMultipart'] 8 | 9 | from email.mime.base import MIMEBase 10 | 11 | 12 | class MIMEMultipart(MIMEBase): 13 | """Base class for MIME multipart/* type messages.""" 14 | 15 | def __init__(self, _subtype='mixed', boundary=None, _subparts=None, 16 | *, policy=None, 17 | **_params): 18 | """Creates a multipart/* type message. 19 | 20 | By default, creates a multipart/mixed message, with proper 21 | Content-Type and MIME-Version headers. 22 | 23 | _subtype is the subtype of the multipart content type, defaulting to 24 | `mixed'. 25 | 26 | boundary is the multipart boundary string. By default it is 27 | calculated as needed. 28 | 29 | _subparts is a sequence of initial subparts for the payload. It 30 | must be an iterable object, such as a list. You can always 31 | attach new subparts to the message by using the attach() method. 32 | 33 | Additional parameters for the Content-Type header are taken from the 34 | keyword arguments (or passed into the _params argument). 35 | """ 36 | MIMEBase.__init__(self, 'multipart', _subtype, policy=policy, **_params) 37 | 38 | # Initialise _payload to an empty list as the Message superclass's 39 | # implementation of is_multipart assumes that _payload is a list for 40 | # multipart messages. 41 | self._payload = [] 42 | 43 | if _subparts: 44 | for p in _subparts: 45 | self.attach(p) 46 | if boundary: 47 | self.set_boundary(boundary) 48 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/mime/nonmultipart.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2002-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Base class for MIME type messages that are not multipart.""" 6 | 7 | __all__ = ['MIMENonMultipart'] 8 | 9 | from email import errors 10 | from email.mime.base import MIMEBase 11 | 12 | 13 | class MIMENonMultipart(MIMEBase): 14 | """Base class for MIME non-multipart type messages.""" 15 | 16 | def attach(self, payload): 17 | # The public API prohibits attaching multiple subparts to MIMEBase 18 | # derived subtypes since none of them are, by definition, of content 19 | # type multipart/* 20 | raise errors.MultipartConversionError( 21 | 'Cannot attach additional subparts to non-multipart/*') 22 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/email/mime/text.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Class representing text/* type MIME documents.""" 6 | 7 | __all__ = ['MIMEText'] 8 | 9 | from email.mime.nonmultipart import MIMENonMultipart 10 | 11 | 12 | class MIMEText(MIMENonMultipart): 13 | """Class for generating text/* type MIME documents.""" 14 | 15 | def __init__(self, _text, _subtype='plain', _charset=None, *, policy=None): 16 | """Create a text/* type MIME document. 17 | 18 | _text is the string for this message object. 19 | 20 | _subtype is the MIME sub content type, defaulting to "plain". 21 | 22 | _charset is the character set parameter added to the Content-Type 23 | header. This defaults to "us-ascii". Note that as a side-effect, the 24 | Content-Transfer-Encoding header will also be set. 25 | """ 26 | 27 | # If no _charset was specified, check to see if there are non-ascii 28 | # characters present. If not, use 'us-ascii', otherwise use utf-8. 29 | # XXX: This can be removed once #7304 is fixed. 30 | if _charset is None: 31 | try: 32 | _text.encode('us-ascii') 33 | _charset = 'us-ascii' 34 | except UnicodeEncodeError: 35 | _charset = 'utf-8' 36 | 37 | MIMENonMultipart.__init__(self, 'text', _subtype, policy=policy, 38 | charset=str(_charset)) 39 | 40 | self.set_payload(_text, _charset) 41 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/encodings/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/__pycache__/aliases.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/encodings/__pycache__/aliases.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/__pycache__/utf_8.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/encodings/__pycache__/utf_8.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/ascii.py: -------------------------------------------------------------------------------- 1 | """ Python 'ascii' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.ascii_encode 18 | decode = codecs.ascii_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.ascii_encode(input, self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.IncrementalDecoder): 25 | def decode(self, input, final=False): 26 | return codecs.ascii_decode(input, self.errors)[0] 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | pass 33 | 34 | class StreamConverter(StreamWriter,StreamReader): 35 | 36 | encode = codecs.ascii_decode 37 | decode = codecs.ascii_encode 38 | 39 | ### encodings module API 40 | 41 | def getregentry(): 42 | return codecs.CodecInfo( 43 | name='ascii', 44 | encode=Codec.encode, 45 | decode=Codec.decode, 46 | incrementalencoder=IncrementalEncoder, 47 | incrementaldecoder=IncrementalDecoder, 48 | streamwriter=StreamWriter, 49 | streamreader=StreamReader, 50 | ) 51 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/base64_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'base64_codec' Codec - base64 content transfer encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | 5 | Written by Marc-Andre Lemburg (mal@lemburg.com). 6 | """ 7 | 8 | import codecs 9 | import base64 10 | 11 | ### Codec APIs 12 | 13 | def base64_encode(input, errors='strict'): 14 | assert errors == 'strict' 15 | return (base64.encodebytes(input), len(input)) 16 | 17 | def base64_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | return (base64.decodebytes(input), len(input)) 20 | 21 | class Codec(codecs.Codec): 22 | def encode(self, input, errors='strict'): 23 | return base64_encode(input, errors) 24 | def decode(self, input, errors='strict'): 25 | return base64_decode(input, errors) 26 | 27 | class IncrementalEncoder(codecs.IncrementalEncoder): 28 | def encode(self, input, final=False): 29 | assert self.errors == 'strict' 30 | return base64.encodebytes(input) 31 | 32 | class IncrementalDecoder(codecs.IncrementalDecoder): 33 | def decode(self, input, final=False): 34 | assert self.errors == 'strict' 35 | return base64.decodebytes(input) 36 | 37 | class StreamWriter(Codec, codecs.StreamWriter): 38 | charbuffertype = bytes 39 | 40 | class StreamReader(Codec, codecs.StreamReader): 41 | charbuffertype = bytes 42 | 43 | ### encodings module API 44 | 45 | def getregentry(): 46 | return codecs.CodecInfo( 47 | name='base64', 48 | encode=base64_encode, 49 | decode=base64_decode, 50 | incrementalencoder=IncrementalEncoder, 51 | incrementaldecoder=IncrementalDecoder, 52 | streamwriter=StreamWriter, 53 | streamreader=StreamReader, 54 | _is_text_encoding=False, 55 | ) 56 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/big5.py: -------------------------------------------------------------------------------- 1 | # 2 | # big5.py: Python Unicode Codec for BIG5 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_tw, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_tw.getcodec('big5') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='big5', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/big5hkscs.py: -------------------------------------------------------------------------------- 1 | # 2 | # big5hkscs.py: Python Unicode Codec for BIG5HKSCS 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_hk, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_hk.getcodec('big5hkscs') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='big5hkscs', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/bz2_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'bz2_codec' Codec - bz2 compression encoding. 2 | 3 | This codec de/encodes from bytes to bytes and is therefore usable with 4 | bytes.transform() and bytes.untransform(). 5 | 6 | Adapted by Raymond Hettinger from zlib_codec.py which was written 7 | by Marc-Andre Lemburg (mal@lemburg.com). 8 | """ 9 | 10 | import codecs 11 | import bz2 # this codec needs the optional bz2 module ! 12 | 13 | ### Codec APIs 14 | 15 | def bz2_encode(input, errors='strict'): 16 | assert errors == 'strict' 17 | return (bz2.compress(input), len(input)) 18 | 19 | def bz2_decode(input, errors='strict'): 20 | assert errors == 'strict' 21 | return (bz2.decompress(input), len(input)) 22 | 23 | class Codec(codecs.Codec): 24 | def encode(self, input, errors='strict'): 25 | return bz2_encode(input, errors) 26 | def decode(self, input, errors='strict'): 27 | return bz2_decode(input, errors) 28 | 29 | class IncrementalEncoder(codecs.IncrementalEncoder): 30 | def __init__(self, errors='strict'): 31 | assert errors == 'strict' 32 | self.errors = errors 33 | self.compressobj = bz2.BZ2Compressor() 34 | 35 | def encode(self, input, final=False): 36 | if final: 37 | c = self.compressobj.compress(input) 38 | return c + self.compressobj.flush() 39 | else: 40 | return self.compressobj.compress(input) 41 | 42 | def reset(self): 43 | self.compressobj = bz2.BZ2Compressor() 44 | 45 | class IncrementalDecoder(codecs.IncrementalDecoder): 46 | def __init__(self, errors='strict'): 47 | assert errors == 'strict' 48 | self.errors = errors 49 | self.decompressobj = bz2.BZ2Decompressor() 50 | 51 | def decode(self, input, final=False): 52 | try: 53 | return self.decompressobj.decompress(input) 54 | except EOFError: 55 | return '' 56 | 57 | def reset(self): 58 | self.decompressobj = bz2.BZ2Decompressor() 59 | 60 | class StreamWriter(Codec, codecs.StreamWriter): 61 | charbuffertype = bytes 62 | 63 | class StreamReader(Codec, codecs.StreamReader): 64 | charbuffertype = bytes 65 | 66 | ### encodings module API 67 | 68 | def getregentry(): 69 | return codecs.CodecInfo( 70 | name="bz2", 71 | encode=bz2_encode, 72 | decode=bz2_decode, 73 | incrementalencoder=IncrementalEncoder, 74 | incrementaldecoder=IncrementalDecoder, 75 | streamwriter=StreamWriter, 76 | streamreader=StreamReader, 77 | _is_text_encoding=False, 78 | ) 79 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/charmap.py: -------------------------------------------------------------------------------- 1 | """ Generic Python Character Mapping Codec. 2 | 3 | Use this codec directly rather than through the automatic 4 | conversion mechanisms supplied by unicode() and .encode(). 5 | 6 | 7 | Written by Marc-Andre Lemburg (mal@lemburg.com). 8 | 9 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 10 | 11 | """#" 12 | 13 | import codecs 14 | 15 | ### Codec APIs 16 | 17 | class Codec(codecs.Codec): 18 | 19 | # Note: Binding these as C functions will result in the class not 20 | # converting them to methods. This is intended. 21 | encode = codecs.charmap_encode 22 | decode = codecs.charmap_decode 23 | 24 | class IncrementalEncoder(codecs.IncrementalEncoder): 25 | def __init__(self, errors='strict', mapping=None): 26 | codecs.IncrementalEncoder.__init__(self, errors) 27 | self.mapping = mapping 28 | 29 | def encode(self, input, final=False): 30 | return codecs.charmap_encode(input, self.errors, self.mapping)[0] 31 | 32 | class IncrementalDecoder(codecs.IncrementalDecoder): 33 | def __init__(self, errors='strict', mapping=None): 34 | codecs.IncrementalDecoder.__init__(self, errors) 35 | self.mapping = mapping 36 | 37 | def decode(self, input, final=False): 38 | return codecs.charmap_decode(input, self.errors, self.mapping)[0] 39 | 40 | class StreamWriter(Codec,codecs.StreamWriter): 41 | 42 | def __init__(self,stream,errors='strict',mapping=None): 43 | codecs.StreamWriter.__init__(self,stream,errors) 44 | self.mapping = mapping 45 | 46 | def encode(self,input,errors='strict'): 47 | return Codec.encode(input,errors,self.mapping) 48 | 49 | class StreamReader(Codec,codecs.StreamReader): 50 | 51 | def __init__(self,stream,errors='strict',mapping=None): 52 | codecs.StreamReader.__init__(self,stream,errors) 53 | self.mapping = mapping 54 | 55 | def decode(self,input,errors='strict'): 56 | return Codec.decode(input,errors,self.mapping) 57 | 58 | ### encodings module API 59 | 60 | def getregentry(): 61 | return codecs.CodecInfo( 62 | name='charmap', 63 | encode=Codec.encode, 64 | decode=Codec.decode, 65 | incrementalencoder=IncrementalEncoder, 66 | incrementaldecoder=IncrementalDecoder, 67 | streamwriter=StreamWriter, 68 | streamreader=StreamReader, 69 | ) 70 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/cp932.py: -------------------------------------------------------------------------------- 1 | # 2 | # cp932.py: Python Unicode Codec for CP932 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('cp932') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='cp932', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/cp949.py: -------------------------------------------------------------------------------- 1 | # 2 | # cp949.py: Python Unicode Codec for CP949 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_kr, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_kr.getcodec('cp949') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='cp949', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/cp950.py: -------------------------------------------------------------------------------- 1 | # 2 | # cp950.py: Python Unicode Codec for CP950 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_tw, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_tw.getcodec('cp950') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='cp950', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/euc_jis_2004.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('euc_jis_2004') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_jis_2004', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/euc_jisx0213.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('euc_jisx0213') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_jisx0213', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/euc_jp.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_jp.py: Python Unicode Codec for EUC_JP 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('euc_jp') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_jp', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/euc_kr.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_kr.py: Python Unicode Codec for EUC_KR 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_kr, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_kr.getcodec('euc_kr') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_kr', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/gb18030.py: -------------------------------------------------------------------------------- 1 | # 2 | # gb18030.py: Python Unicode Codec for GB18030 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('gb18030') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='gb18030', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/gb2312.py: -------------------------------------------------------------------------------- 1 | # 2 | # gb2312.py: Python Unicode Codec for GB2312 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('gb2312') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='gb2312', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/gbk.py: -------------------------------------------------------------------------------- 1 | # 2 | # gbk.py: Python Unicode Codec for GBK 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('gbk') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='gbk', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/hex_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'hex_codec' Codec - 2-digit hex content transfer encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | 5 | Written by Marc-Andre Lemburg (mal@lemburg.com). 6 | """ 7 | 8 | import codecs 9 | import binascii 10 | 11 | ### Codec APIs 12 | 13 | def hex_encode(input, errors='strict'): 14 | assert errors == 'strict' 15 | return (binascii.b2a_hex(input), len(input)) 16 | 17 | def hex_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | return (binascii.a2b_hex(input), len(input)) 20 | 21 | class Codec(codecs.Codec): 22 | def encode(self, input, errors='strict'): 23 | return hex_encode(input, errors) 24 | def decode(self, input, errors='strict'): 25 | return hex_decode(input, errors) 26 | 27 | class IncrementalEncoder(codecs.IncrementalEncoder): 28 | def encode(self, input, final=False): 29 | assert self.errors == 'strict' 30 | return binascii.b2a_hex(input) 31 | 32 | class IncrementalDecoder(codecs.IncrementalDecoder): 33 | def decode(self, input, final=False): 34 | assert self.errors == 'strict' 35 | return binascii.a2b_hex(input) 36 | 37 | class StreamWriter(Codec, codecs.StreamWriter): 38 | charbuffertype = bytes 39 | 40 | class StreamReader(Codec, codecs.StreamReader): 41 | charbuffertype = bytes 42 | 43 | ### encodings module API 44 | 45 | def getregentry(): 46 | return codecs.CodecInfo( 47 | name='hex', 48 | encode=hex_encode, 49 | decode=hex_decode, 50 | incrementalencoder=IncrementalEncoder, 51 | incrementaldecoder=IncrementalDecoder, 52 | streamwriter=StreamWriter, 53 | streamreader=StreamReader, 54 | _is_text_encoding=False, 55 | ) 56 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/hz.py: -------------------------------------------------------------------------------- 1 | # 2 | # hz.py: Python Unicode Codec for HZ 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('hz') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='hz', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/iso2022_jp.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp.py: Python Unicode Codec for ISO2022_JP 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/iso2022_jp_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_1') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_1', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/iso2022_jp_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_2') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_2', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/iso2022_jp_2004.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_2004') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_2004', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/iso2022_jp_3.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_3') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_3', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/iso2022_jp_ext.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_ext') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_ext', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/iso2022_kr.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_kr.py: Python Unicode Codec for ISO2022_KR 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_kr') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_kr', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/johab.py: -------------------------------------------------------------------------------- 1 | # 2 | # johab.py: Python Unicode Codec for JOHAB 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_kr, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_kr.getcodec('johab') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='johab', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/latin_1.py: -------------------------------------------------------------------------------- 1 | """ Python 'latin-1' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.latin_1_encode 18 | decode = codecs.latin_1_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.latin_1_encode(input,self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.IncrementalDecoder): 25 | def decode(self, input, final=False): 26 | return codecs.latin_1_decode(input,self.errors)[0] 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | pass 33 | 34 | class StreamConverter(StreamWriter,StreamReader): 35 | 36 | encode = codecs.latin_1_decode 37 | decode = codecs.latin_1_encode 38 | 39 | ### encodings module API 40 | 41 | def getregentry(): 42 | return codecs.CodecInfo( 43 | name='iso8859-1', 44 | encode=Codec.encode, 45 | decode=Codec.decode, 46 | incrementalencoder=IncrementalEncoder, 47 | incrementaldecoder=IncrementalDecoder, 48 | streamreader=StreamReader, 49 | streamwriter=StreamWriter, 50 | ) 51 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/mbcs.py: -------------------------------------------------------------------------------- 1 | """ Python 'mbcs' Codec for Windows 2 | 3 | 4 | Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py, 5 | which was written by Marc-Andre Lemburg (mal@lemburg.com). 6 | 7 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 8 | 9 | """ 10 | # Import them explicitly to cause an ImportError 11 | # on non-Windows systems 12 | from codecs import mbcs_encode, mbcs_decode 13 | # for IncrementalDecoder, IncrementalEncoder, ... 14 | import codecs 15 | 16 | ### Codec APIs 17 | 18 | encode = mbcs_encode 19 | 20 | def decode(input, errors='strict'): 21 | return mbcs_decode(input, errors, True) 22 | 23 | class IncrementalEncoder(codecs.IncrementalEncoder): 24 | def encode(self, input, final=False): 25 | return mbcs_encode(input, self.errors)[0] 26 | 27 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 28 | _buffer_decode = mbcs_decode 29 | 30 | class StreamWriter(codecs.StreamWriter): 31 | encode = mbcs_encode 32 | 33 | class StreamReader(codecs.StreamReader): 34 | decode = mbcs_decode 35 | 36 | ### encodings module API 37 | 38 | def getregentry(): 39 | return codecs.CodecInfo( 40 | name='mbcs', 41 | encode=encode, 42 | decode=decode, 43 | incrementalencoder=IncrementalEncoder, 44 | incrementaldecoder=IncrementalDecoder, 45 | streamreader=StreamReader, 46 | streamwriter=StreamWriter, 47 | ) 48 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/oem.py: -------------------------------------------------------------------------------- 1 | """ Python 'oem' Codec for Windows 2 | 3 | """ 4 | # Import them explicitly to cause an ImportError 5 | # on non-Windows systems 6 | from codecs import oem_encode, oem_decode 7 | # for IncrementalDecoder, IncrementalEncoder, ... 8 | import codecs 9 | 10 | ### Codec APIs 11 | 12 | encode = oem_encode 13 | 14 | def decode(input, errors='strict'): 15 | return oem_decode(input, errors, True) 16 | 17 | class IncrementalEncoder(codecs.IncrementalEncoder): 18 | def encode(self, input, final=False): 19 | return oem_encode(input, self.errors)[0] 20 | 21 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 22 | _buffer_decode = oem_decode 23 | 24 | class StreamWriter(codecs.StreamWriter): 25 | encode = oem_encode 26 | 27 | class StreamReader(codecs.StreamReader): 28 | decode = oem_decode 29 | 30 | ### encodings module API 31 | 32 | def getregentry(): 33 | return codecs.CodecInfo( 34 | name='oem', 35 | encode=encode, 36 | decode=decode, 37 | incrementalencoder=IncrementalEncoder, 38 | incrementaldecoder=IncrementalDecoder, 39 | streamreader=StreamReader, 40 | streamwriter=StreamWriter, 41 | ) 42 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/quopri_codec.py: -------------------------------------------------------------------------------- 1 | """Codec for quoted-printable encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | """ 5 | 6 | import codecs 7 | import quopri 8 | from io import BytesIO 9 | 10 | def quopri_encode(input, errors='strict'): 11 | assert errors == 'strict' 12 | f = BytesIO(input) 13 | g = BytesIO() 14 | quopri.encode(f, g, quotetabs=True) 15 | return (g.getvalue(), len(input)) 16 | 17 | def quopri_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | f = BytesIO(input) 20 | g = BytesIO() 21 | quopri.decode(f, g) 22 | return (g.getvalue(), len(input)) 23 | 24 | class Codec(codecs.Codec): 25 | def encode(self, input, errors='strict'): 26 | return quopri_encode(input, errors) 27 | def decode(self, input, errors='strict'): 28 | return quopri_decode(input, errors) 29 | 30 | class IncrementalEncoder(codecs.IncrementalEncoder): 31 | def encode(self, input, final=False): 32 | return quopri_encode(input, self.errors)[0] 33 | 34 | class IncrementalDecoder(codecs.IncrementalDecoder): 35 | def decode(self, input, final=False): 36 | return quopri_decode(input, self.errors)[0] 37 | 38 | class StreamWriter(Codec, codecs.StreamWriter): 39 | charbuffertype = bytes 40 | 41 | class StreamReader(Codec, codecs.StreamReader): 42 | charbuffertype = bytes 43 | 44 | # encodings module API 45 | 46 | def getregentry(): 47 | return codecs.CodecInfo( 48 | name='quopri', 49 | encode=quopri_encode, 50 | decode=quopri_decode, 51 | incrementalencoder=IncrementalEncoder, 52 | incrementaldecoder=IncrementalDecoder, 53 | streamwriter=StreamWriter, 54 | streamreader=StreamReader, 55 | _is_text_encoding=False, 56 | ) 57 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/raw_unicode_escape.py: -------------------------------------------------------------------------------- 1 | """ Python 'raw-unicode-escape' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.raw_unicode_escape_encode 18 | decode = codecs.raw_unicode_escape_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.raw_unicode_escape_encode(input, self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 25 | def _buffer_decode(self, input, errors, final): 26 | return codecs.raw_unicode_escape_decode(input, errors, final) 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | def decode(self, input, errors='strict'): 33 | return codecs.raw_unicode_escape_decode(input, errors, False) 34 | 35 | ### encodings module API 36 | 37 | def getregentry(): 38 | return codecs.CodecInfo( 39 | name='raw-unicode-escape', 40 | encode=Codec.encode, 41 | decode=Codec.decode, 42 | incrementalencoder=IncrementalEncoder, 43 | incrementaldecoder=IncrementalDecoder, 44 | streamwriter=StreamWriter, 45 | streamreader=StreamReader, 46 | ) 47 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/shift_jis.py: -------------------------------------------------------------------------------- 1 | # 2 | # shift_jis.py: Python Unicode Codec for SHIFT_JIS 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('shift_jis') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='shift_jis', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/shift_jis_2004.py: -------------------------------------------------------------------------------- 1 | # 2 | # shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('shift_jis_2004') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='shift_jis_2004', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/shift_jisx0213.py: -------------------------------------------------------------------------------- 1 | # 2 | # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('shift_jisx0213') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='shift_jisx0213', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/undefined.py: -------------------------------------------------------------------------------- 1 | """ Python 'undefined' Codec 2 | 3 | This codec will always raise a ValueError exception when being 4 | used. It is intended for use by the site.py file to switch off 5 | automatic string to Unicode coercion. 6 | 7 | Written by Marc-Andre Lemburg (mal@lemburg.com). 8 | 9 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 10 | 11 | """ 12 | import codecs 13 | 14 | ### Codec APIs 15 | 16 | class Codec(codecs.Codec): 17 | 18 | def encode(self,input,errors='strict'): 19 | raise UnicodeError("undefined encoding") 20 | 21 | def decode(self,input,errors='strict'): 22 | raise UnicodeError("undefined encoding") 23 | 24 | class IncrementalEncoder(codecs.IncrementalEncoder): 25 | def encode(self, input, final=False): 26 | raise UnicodeError("undefined encoding") 27 | 28 | class IncrementalDecoder(codecs.IncrementalDecoder): 29 | def decode(self, input, final=False): 30 | raise UnicodeError("undefined encoding") 31 | 32 | class StreamWriter(Codec,codecs.StreamWriter): 33 | pass 34 | 35 | class StreamReader(Codec,codecs.StreamReader): 36 | pass 37 | 38 | ### encodings module API 39 | 40 | def getregentry(): 41 | return codecs.CodecInfo( 42 | name='undefined', 43 | encode=Codec().encode, 44 | decode=Codec().decode, 45 | incrementalencoder=IncrementalEncoder, 46 | incrementaldecoder=IncrementalDecoder, 47 | streamwriter=StreamWriter, 48 | streamreader=StreamReader, 49 | ) 50 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/unicode_escape.py: -------------------------------------------------------------------------------- 1 | """ Python 'unicode-escape' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.unicode_escape_encode 18 | decode = codecs.unicode_escape_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.unicode_escape_encode(input, self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 25 | def _buffer_decode(self, input, errors, final): 26 | return codecs.unicode_escape_decode(input, errors, final) 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | def decode(self, input, errors='strict'): 33 | return codecs.unicode_escape_decode(input, errors, False) 34 | 35 | ### encodings module API 36 | 37 | def getregentry(): 38 | return codecs.CodecInfo( 39 | name='unicode-escape', 40 | encode=Codec.encode, 41 | decode=Codec.decode, 42 | incrementalencoder=IncrementalEncoder, 43 | incrementaldecoder=IncrementalDecoder, 44 | streamwriter=StreamWriter, 45 | streamreader=StreamReader, 46 | ) 47 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/utf_16_be.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-16-be' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | encode = codecs.utf_16_be_encode 14 | 15 | def decode(input, errors='strict'): 16 | return codecs.utf_16_be_decode(input, errors, True) 17 | 18 | class IncrementalEncoder(codecs.IncrementalEncoder): 19 | def encode(self, input, final=False): 20 | return codecs.utf_16_be_encode(input, self.errors)[0] 21 | 22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 23 | _buffer_decode = codecs.utf_16_be_decode 24 | 25 | class StreamWriter(codecs.StreamWriter): 26 | encode = codecs.utf_16_be_encode 27 | 28 | class StreamReader(codecs.StreamReader): 29 | decode = codecs.utf_16_be_decode 30 | 31 | ### encodings module API 32 | 33 | def getregentry(): 34 | return codecs.CodecInfo( 35 | name='utf-16-be', 36 | encode=encode, 37 | decode=decode, 38 | incrementalencoder=IncrementalEncoder, 39 | incrementaldecoder=IncrementalDecoder, 40 | streamreader=StreamReader, 41 | streamwriter=StreamWriter, 42 | ) 43 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/utf_16_le.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-16-le' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | encode = codecs.utf_16_le_encode 14 | 15 | def decode(input, errors='strict'): 16 | return codecs.utf_16_le_decode(input, errors, True) 17 | 18 | class IncrementalEncoder(codecs.IncrementalEncoder): 19 | def encode(self, input, final=False): 20 | return codecs.utf_16_le_encode(input, self.errors)[0] 21 | 22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 23 | _buffer_decode = codecs.utf_16_le_decode 24 | 25 | class StreamWriter(codecs.StreamWriter): 26 | encode = codecs.utf_16_le_encode 27 | 28 | class StreamReader(codecs.StreamReader): 29 | decode = codecs.utf_16_le_decode 30 | 31 | ### encodings module API 32 | 33 | def getregentry(): 34 | return codecs.CodecInfo( 35 | name='utf-16-le', 36 | encode=encode, 37 | decode=decode, 38 | incrementalencoder=IncrementalEncoder, 39 | incrementaldecoder=IncrementalDecoder, 40 | streamreader=StreamReader, 41 | streamwriter=StreamWriter, 42 | ) 43 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/utf_32_be.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python 'utf-32-be' Codec 3 | """ 4 | import codecs 5 | 6 | ### Codec APIs 7 | 8 | encode = codecs.utf_32_be_encode 9 | 10 | def decode(input, errors='strict'): 11 | return codecs.utf_32_be_decode(input, errors, True) 12 | 13 | class IncrementalEncoder(codecs.IncrementalEncoder): 14 | def encode(self, input, final=False): 15 | return codecs.utf_32_be_encode(input, self.errors)[0] 16 | 17 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 18 | _buffer_decode = codecs.utf_32_be_decode 19 | 20 | class StreamWriter(codecs.StreamWriter): 21 | encode = codecs.utf_32_be_encode 22 | 23 | class StreamReader(codecs.StreamReader): 24 | decode = codecs.utf_32_be_decode 25 | 26 | ### encodings module API 27 | 28 | def getregentry(): 29 | return codecs.CodecInfo( 30 | name='utf-32-be', 31 | encode=encode, 32 | decode=decode, 33 | incrementalencoder=IncrementalEncoder, 34 | incrementaldecoder=IncrementalDecoder, 35 | streamreader=StreamReader, 36 | streamwriter=StreamWriter, 37 | ) 38 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/utf_32_le.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python 'utf-32-le' Codec 3 | """ 4 | import codecs 5 | 6 | ### Codec APIs 7 | 8 | encode = codecs.utf_32_le_encode 9 | 10 | def decode(input, errors='strict'): 11 | return codecs.utf_32_le_decode(input, errors, True) 12 | 13 | class IncrementalEncoder(codecs.IncrementalEncoder): 14 | def encode(self, input, final=False): 15 | return codecs.utf_32_le_encode(input, self.errors)[0] 16 | 17 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 18 | _buffer_decode = codecs.utf_32_le_decode 19 | 20 | class StreamWriter(codecs.StreamWriter): 21 | encode = codecs.utf_32_le_encode 22 | 23 | class StreamReader(codecs.StreamReader): 24 | decode = codecs.utf_32_le_decode 25 | 26 | ### encodings module API 27 | 28 | def getregentry(): 29 | return codecs.CodecInfo( 30 | name='utf-32-le', 31 | encode=encode, 32 | decode=decode, 33 | incrementalencoder=IncrementalEncoder, 34 | incrementaldecoder=IncrementalDecoder, 35 | streamreader=StreamReader, 36 | streamwriter=StreamWriter, 37 | ) 38 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/utf_7.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-7' Codec 2 | 3 | Written by Brian Quinlan (brian@sweetapp.com). 4 | """ 5 | import codecs 6 | 7 | ### Codec APIs 8 | 9 | encode = codecs.utf_7_encode 10 | 11 | def decode(input, errors='strict'): 12 | return codecs.utf_7_decode(input, errors, True) 13 | 14 | class IncrementalEncoder(codecs.IncrementalEncoder): 15 | def encode(self, input, final=False): 16 | return codecs.utf_7_encode(input, self.errors)[0] 17 | 18 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 19 | _buffer_decode = codecs.utf_7_decode 20 | 21 | class StreamWriter(codecs.StreamWriter): 22 | encode = codecs.utf_7_encode 23 | 24 | class StreamReader(codecs.StreamReader): 25 | decode = codecs.utf_7_decode 26 | 27 | ### encodings module API 28 | 29 | def getregentry(): 30 | return codecs.CodecInfo( 31 | name='utf-7', 32 | encode=encode, 33 | decode=decode, 34 | incrementalencoder=IncrementalEncoder, 35 | incrementaldecoder=IncrementalDecoder, 36 | streamreader=StreamReader, 37 | streamwriter=StreamWriter, 38 | ) 39 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/utf_8.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-8' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | encode = codecs.utf_8_encode 14 | 15 | def decode(input, errors='strict'): 16 | return codecs.utf_8_decode(input, errors, True) 17 | 18 | class IncrementalEncoder(codecs.IncrementalEncoder): 19 | def encode(self, input, final=False): 20 | return codecs.utf_8_encode(input, self.errors)[0] 21 | 22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 23 | _buffer_decode = codecs.utf_8_decode 24 | 25 | class StreamWriter(codecs.StreamWriter): 26 | encode = codecs.utf_8_encode 27 | 28 | class StreamReader(codecs.StreamReader): 29 | decode = codecs.utf_8_decode 30 | 31 | ### encodings module API 32 | 33 | def getregentry(): 34 | return codecs.CodecInfo( 35 | name='utf-8', 36 | encode=encode, 37 | decode=decode, 38 | incrementalencoder=IncrementalEncoder, 39 | incrementaldecoder=IncrementalDecoder, 40 | streamreader=StreamReader, 41 | streamwriter=StreamWriter, 42 | ) 43 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/encodings/zlib_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'zlib_codec' Codec - zlib compression encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | 5 | Written by Marc-Andre Lemburg (mal@lemburg.com). 6 | """ 7 | 8 | import codecs 9 | import zlib # this codec needs the optional zlib module ! 10 | 11 | ### Codec APIs 12 | 13 | def zlib_encode(input, errors='strict'): 14 | assert errors == 'strict' 15 | return (zlib.compress(input), len(input)) 16 | 17 | def zlib_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | return (zlib.decompress(input), len(input)) 20 | 21 | class Codec(codecs.Codec): 22 | def encode(self, input, errors='strict'): 23 | return zlib_encode(input, errors) 24 | def decode(self, input, errors='strict'): 25 | return zlib_decode(input, errors) 26 | 27 | class IncrementalEncoder(codecs.IncrementalEncoder): 28 | def __init__(self, errors='strict'): 29 | assert errors == 'strict' 30 | self.errors = errors 31 | self.compressobj = zlib.compressobj() 32 | 33 | def encode(self, input, final=False): 34 | if final: 35 | c = self.compressobj.compress(input) 36 | return c + self.compressobj.flush() 37 | else: 38 | return self.compressobj.compress(input) 39 | 40 | def reset(self): 41 | self.compressobj = zlib.compressobj() 42 | 43 | class IncrementalDecoder(codecs.IncrementalDecoder): 44 | def __init__(self, errors='strict'): 45 | assert errors == 'strict' 46 | self.errors = errors 47 | self.decompressobj = zlib.decompressobj() 48 | 49 | def decode(self, input, final=False): 50 | if final: 51 | c = self.decompressobj.decompress(input) 52 | return c + self.decompressobj.flush() 53 | else: 54 | return self.decompressobj.decompress(input) 55 | 56 | def reset(self): 57 | self.decompressobj = zlib.decompressobj() 58 | 59 | class StreamWriter(Codec, codecs.StreamWriter): 60 | charbuffertype = bytes 61 | 62 | class StreamReader(Codec, codecs.StreamReader): 63 | charbuffertype = bytes 64 | 65 | ### encodings module API 66 | 67 | def getregentry(): 68 | return codecs.CodecInfo( 69 | name='zlib', 70 | encode=zlib_encode, 71 | decode=zlib_decode, 72 | incrementalencoder=IncrementalEncoder, 73 | incrementaldecoder=IncrementalDecoder, 74 | streamreader=StreamReader, 75 | streamwriter=StreamWriter, 76 | _is_text_encoding=False, 77 | ) 78 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna-3.7.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna-3.7.dist-info/LICENSE.md: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2013-2024, Kim Davies and contributors. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its 18 | contributors may be used to endorse or promote products derived from 19 | this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 27 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 28 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna-3.7.dist-info/RECORD: -------------------------------------------------------------------------------- 1 | idna-3.7.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 2 | idna-3.7.dist-info/LICENSE.md,sha256=pZ8LDvNjWHQQmkRhykT_enDVBpboFHZ7-vch1Mmw2w8,1541 3 | idna-3.7.dist-info/METADATA,sha256=OixCk-dKLZkPy-MfviOmiPvwJ1O2K_8rqCrFjC_uxy4,9888 4 | idna-3.7.dist-info/RECORD,, 5 | idna-3.7.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81 6 | idna/__init__.py,sha256=KJQN1eQBr8iIK5SKrJ47lXvxG0BJ7Lm38W4zT0v_8lk,849 7 | idna/__pycache__/__init__.cpython-312.pyc,, 8 | idna/__pycache__/codec.cpython-312.pyc,, 9 | idna/__pycache__/compat.cpython-312.pyc,, 10 | idna/__pycache__/core.cpython-312.pyc,, 11 | idna/__pycache__/idnadata.cpython-312.pyc,, 12 | idna/__pycache__/intranges.cpython-312.pyc,, 13 | idna/__pycache__/package_data.cpython-312.pyc,, 14 | idna/__pycache__/uts46data.cpython-312.pyc,, 15 | idna/codec.py,sha256=PS6m-XmdST7Wj7J7ulRMakPDt5EBJyYrT3CPtjh-7t4,3426 16 | idna/compat.py,sha256=0_sOEUMT4CVw9doD3vyRhX80X19PwqFoUBs7gWsFME4,321 17 | idna/core.py,sha256=lyhpoe2vulEaB_65xhXmoKgO-xUqFDvcwxu5hpNNO4E,12663 18 | idna/idnadata.py,sha256=dqRwytzkjIHMBa2R1lYvHDwACenZPt8eGVu1Y8UBE-E,78320 19 | idna/intranges.py,sha256=YBr4fRYuWH7kTKS2tXlFjM24ZF1Pdvcir-aywniInqg,1881 20 | idna/package_data.py,sha256=Tkt0KnIeyIlnHddOaz9WSkkislNgokJAuE-p5GorMqo,21 21 | idna/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 22 | idna/uts46data.py,sha256=1KuksWqLuccPXm2uyRVkhfiFLNIhM_H2m4azCcnOqEU,206503 23 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna-3.7.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: flit 3.9.0 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__init__.py: -------------------------------------------------------------------------------- 1 | from .package_data import __version__ 2 | from .core import ( 3 | IDNABidiError, 4 | IDNAError, 5 | InvalidCodepoint, 6 | InvalidCodepointContext, 7 | alabel, 8 | check_bidi, 9 | check_hyphen_ok, 10 | check_initial_combiner, 11 | check_label, 12 | check_nfc, 13 | decode, 14 | encode, 15 | ulabel, 16 | uts46_remap, 17 | valid_contextj, 18 | valid_contexto, 19 | valid_label_length, 20 | valid_string_length, 21 | ) 22 | from .intranges import intranges_contain 23 | 24 | __all__ = [ 25 | "IDNABidiError", 26 | "IDNAError", 27 | "InvalidCodepoint", 28 | "InvalidCodepointContext", 29 | "alabel", 30 | "check_bidi", 31 | "check_hyphen_ok", 32 | "check_initial_combiner", 33 | "check_label", 34 | "check_nfc", 35 | "decode", 36 | "encode", 37 | "intranges_contain", 38 | "ulabel", 39 | "uts46_remap", 40 | "valid_contextj", 41 | "valid_contexto", 42 | "valid_label_length", 43 | "valid_string_length", 44 | ] 45 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/codec.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/codec.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/compat.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/compat.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/core.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/core.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/idnadata.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/idnadata.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/intranges.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/intranges.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/package_data.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/package_data.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/__pycache__/uts46data.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/__pycache__/uts46data.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/compat.py: -------------------------------------------------------------------------------- 1 | from .core import * 2 | from .codec import * 3 | from typing import Any, Union 4 | 5 | def ToASCII(label: str) -> bytes: 6 | return encode(label) 7 | 8 | def ToUnicode(label: Union[bytes, bytearray]) -> str: 9 | return decode(label) 10 | 11 | def nameprep(s: Any) -> None: 12 | raise NotImplementedError('IDNA 2008 does not utilise nameprep protocol') 13 | 14 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/intranges.py: -------------------------------------------------------------------------------- 1 | """ 2 | Given a list of integers, made up of (hopefully) a small number of long runs 3 | of consecutive integers, compute a representation of the form 4 | ((start1, end1), (start2, end2) ...). Then answer the question "was x present 5 | in the original list?" in time O(log(# runs)). 6 | """ 7 | 8 | import bisect 9 | from typing import List, Tuple 10 | 11 | def intranges_from_list(list_: List[int]) -> Tuple[int, ...]: 12 | """Represent a list of integers as a sequence of ranges: 13 | ((start_0, end_0), (start_1, end_1), ...), such that the original 14 | integers are exactly those x such that start_i <= x < end_i for some i. 15 | 16 | Ranges are encoded as single integers (start << 32 | end), not as tuples. 17 | """ 18 | 19 | sorted_list = sorted(list_) 20 | ranges = [] 21 | last_write = -1 22 | for i in range(len(sorted_list)): 23 | if i+1 < len(sorted_list): 24 | if sorted_list[i] == sorted_list[i+1]-1: 25 | continue 26 | current_range = sorted_list[last_write+1:i+1] 27 | ranges.append(_encode_range(current_range[0], current_range[-1] + 1)) 28 | last_write = i 29 | 30 | return tuple(ranges) 31 | 32 | def _encode_range(start: int, end: int) -> int: 33 | return (start << 32) | end 34 | 35 | def _decode_range(r: int) -> Tuple[int, int]: 36 | return (r >> 32), (r & ((1 << 32) - 1)) 37 | 38 | 39 | def intranges_contain(int_: int, ranges: Tuple[int, ...]) -> bool: 40 | """Determine if `int_` falls into one of the ranges in `ranges`.""" 41 | tuple_ = _encode_range(int_, 0) 42 | pos = bisect.bisect_left(ranges, tuple_) 43 | # we could be immediately ahead of a tuple (start, end) 44 | # with start < int_ <= end 45 | if pos > 0: 46 | left, right = _decode_range(ranges[pos-1]) 47 | if left <= int_ < right: 48 | return True 49 | # or we could be immediately behind a tuple (int_, end) 50 | if pos < len(ranges): 51 | left, _ = _decode_range(ranges[pos]) 52 | if left == int_: 53 | return True 54 | return False 55 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/package_data.py: -------------------------------------------------------------------------------- 1 | __version__ = '3.7' 2 | 3 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/idna/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/idna/py.typed -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/importlib/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/_abc.py: -------------------------------------------------------------------------------- 1 | """Subset of importlib.abc used to reduce importlib.util imports.""" 2 | from . import _bootstrap 3 | import abc 4 | 5 | 6 | class Loader(metaclass=abc.ABCMeta): 7 | 8 | """Abstract base class for import loaders.""" 9 | 10 | def create_module(self, spec): 11 | """Return a module to initialize and into which to load. 12 | 13 | This method should raise ImportError if anything prevents it 14 | from creating a new module. It may return None to indicate 15 | that the spec should create the new module. 16 | """ 17 | # By default, defer to default semantics for the new module. 18 | return None 19 | 20 | # We don't define exec_module() here since that would break 21 | # hasattr checks we do to support backward compatibility. 22 | 23 | def load_module(self, fullname): 24 | """Return the loaded module. 25 | 26 | The module must be added to sys.modules and have import-related 27 | attributes set properly. The fullname is a str. 28 | 29 | ImportError is raised on failure. 30 | 31 | This method is deprecated in favor of loader.exec_module(). If 32 | exec_module() exists then it is used to provide a backwards-compatible 33 | functionality for this method. 34 | 35 | """ 36 | if not hasattr(self, 'exec_module'): 37 | raise ImportError 38 | # Warning implemented in _load_module_shim(). 39 | return _bootstrap._load_module_shim(self, fullname) 40 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/machinery.py: -------------------------------------------------------------------------------- 1 | """The machinery of importlib: finders, loaders, hooks, etc.""" 2 | 3 | from ._bootstrap import ModuleSpec 4 | from ._bootstrap import BuiltinImporter 5 | from ._bootstrap import FrozenImporter 6 | from ._bootstrap_external import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES, 7 | OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES, 8 | EXTENSION_SUFFIXES) 9 | from ._bootstrap_external import WindowsRegistryFinder 10 | from ._bootstrap_external import PathFinder 11 | from ._bootstrap_external import FileFinder 12 | from ._bootstrap_external import SourceFileLoader 13 | from ._bootstrap_external import SourcelessFileLoader 14 | from ._bootstrap_external import ExtensionFileLoader 15 | from ._bootstrap_external import NamespaceLoader 16 | 17 | 18 | def all_suffixes(): 19 | """Returns a list of all recognized module suffixes for this process""" 20 | return SOURCE_SUFFIXES + BYTECODE_SUFFIXES + EXTENSION_SUFFIXES 21 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/metadata/_collections.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | 4 | # from jaraco.collections 3.3 5 | class FreezableDefaultDict(collections.defaultdict): 6 | """ 7 | Often it is desirable to prevent the mutation of 8 | a default dict after its initial construction, such 9 | as to prevent mutation during iteration. 10 | 11 | >>> dd = FreezableDefaultDict(list) 12 | >>> dd[0].append('1') 13 | >>> dd.freeze() 14 | >>> dd[1] 15 | [] 16 | >>> len(dd) 17 | 1 18 | """ 19 | 20 | def __missing__(self, key): 21 | return getattr(self, '_frozen', super().__missing__)(key) 22 | 23 | def freeze(self): 24 | self._frozen = lambda key: self.default_factory() 25 | 26 | 27 | class Pair(collections.namedtuple('Pair', 'name value')): 28 | @classmethod 29 | def parse(cls, text): 30 | return cls(*map(str.strip, text.split("=", 1))) 31 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/metadata/_itertools.py: -------------------------------------------------------------------------------- 1 | from itertools import filterfalse 2 | 3 | 4 | def unique_everseen(iterable, key=None): 5 | "List unique elements, preserving order. Remember all elements ever seen." 6 | # unique_everseen('AAAABBBCCDAABBB') --> A B C D 7 | # unique_everseen('ABBCcAD', str.lower) --> A B C D 8 | seen = set() 9 | seen_add = seen.add 10 | if key is None: 11 | for element in filterfalse(seen.__contains__, iterable): 12 | seen_add(element) 13 | yield element 14 | else: 15 | for element in iterable: 16 | k = key(element) 17 | if k not in seen: 18 | seen_add(k) 19 | yield element 20 | 21 | 22 | # copied from more_itertools 8.8 23 | def always_iterable(obj, base_type=(str, bytes)): 24 | """If *obj* is iterable, return an iterator over its items:: 25 | 26 | >>> obj = (1, 2, 3) 27 | >>> list(always_iterable(obj)) 28 | [1, 2, 3] 29 | 30 | If *obj* is not iterable, return a one-item iterable containing *obj*:: 31 | 32 | >>> obj = 1 33 | >>> list(always_iterable(obj)) 34 | [1] 35 | 36 | If *obj* is ``None``, return an empty iterable: 37 | 38 | >>> obj = None 39 | >>> list(always_iterable(None)) 40 | [] 41 | 42 | By default, binary and text strings are not considered iterable:: 43 | 44 | >>> obj = 'foo' 45 | >>> list(always_iterable(obj)) 46 | ['foo'] 47 | 48 | If *base_type* is set, objects for which ``isinstance(obj, base_type)`` 49 | returns ``True`` won't be considered iterable. 50 | 51 | >>> obj = {'a': 1} 52 | >>> list(always_iterable(obj)) # Iterate over the dict's keys 53 | ['a'] 54 | >>> list(always_iterable(obj, base_type=dict)) # Treat dicts as a unit 55 | [{'a': 1}] 56 | 57 | Set *base_type* to ``None`` to avoid any special handling and treat objects 58 | Python considers iterable as iterable: 59 | 60 | >>> obj = 'foo' 61 | >>> list(always_iterable(obj, base_type=None)) 62 | ['f', 'o', 'o'] 63 | """ 64 | if obj is None: 65 | return iter(()) 66 | 67 | if (base_type is not None) and isinstance(obj, base_type): 68 | return iter((obj,)) 69 | 70 | try: 71 | return iter(obj) 72 | except TypeError: 73 | return iter((obj,)) 74 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/metadata/_meta.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | from typing import Any, Dict, Iterator, List, Optional, TypeVar, Union, overload 3 | 4 | 5 | _T = TypeVar("_T") 6 | 7 | 8 | class PackageMetadata(Protocol): 9 | def __len__(self) -> int: 10 | ... # pragma: no cover 11 | 12 | def __contains__(self, item: str) -> bool: 13 | ... # pragma: no cover 14 | 15 | def __getitem__(self, key: str) -> str: 16 | ... # pragma: no cover 17 | 18 | def __iter__(self) -> Iterator[str]: 19 | ... # pragma: no cover 20 | 21 | @overload 22 | def get(self, name: str, failobj: None = None) -> Optional[str]: 23 | ... # pragma: no cover 24 | 25 | @overload 26 | def get(self, name: str, failobj: _T) -> Union[str, _T]: 27 | ... # pragma: no cover 28 | 29 | # overload per python/importlib_metadata#435 30 | @overload 31 | def get_all(self, name: str, failobj: None = None) -> Optional[List[Any]]: 32 | ... # pragma: no cover 33 | 34 | @overload 35 | def get_all(self, name: str, failobj: _T) -> Union[List[Any], _T]: 36 | """ 37 | Return all values associated with a possibly multi-valued key. 38 | """ 39 | 40 | @property 41 | def json(self) -> Dict[str, Union[str, List[str]]]: 42 | """ 43 | A JSON-compatible form of the metadata. 44 | """ 45 | 46 | 47 | class SimplePath(Protocol[_T]): 48 | """ 49 | A minimal subset of pathlib.Path required by PathDistribution. 50 | """ 51 | 52 | def joinpath(self) -> _T: 53 | ... # pragma: no cover 54 | 55 | def __truediv__(self, other: Union[str, _T]) -> _T: 56 | ... # pragma: no cover 57 | 58 | @property 59 | def parent(self) -> _T: 60 | ... # pragma: no cover 61 | 62 | def read_text(self) -> str: 63 | ... # pragma: no cover 64 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/readers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Compatibility shim for .resources.readers as found on Python 3.10. 3 | 4 | Consumers that can rely on Python 3.11 should use the other 5 | module directly. 6 | """ 7 | 8 | from .resources.readers import ( 9 | FileReader, ZipReader, MultiplexedPath, NamespaceReader, 10 | ) 11 | 12 | __all__ = ['FileReader', 'ZipReader', 'MultiplexedPath', 'NamespaceReader'] 13 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/resources/__init__.py: -------------------------------------------------------------------------------- 1 | """Read resources contained within a package.""" 2 | 3 | from ._common import ( 4 | as_file, 5 | files, 6 | Package, 7 | ) 8 | 9 | from ._legacy import ( 10 | contents, 11 | open_binary, 12 | read_binary, 13 | open_text, 14 | read_text, 15 | is_resource, 16 | path, 17 | Resource, 18 | ) 19 | 20 | from .abc import ResourceReader 21 | 22 | 23 | __all__ = [ 24 | 'Package', 25 | 'Resource', 26 | 'ResourceReader', 27 | 'as_file', 28 | 'contents', 29 | 'files', 30 | 'is_resource', 31 | 'open_binary', 32 | 'open_text', 33 | 'path', 34 | 'read_binary', 35 | 'read_text', 36 | ] 37 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/resources/_itertools.py: -------------------------------------------------------------------------------- 1 | # from more_itertools 9.0 2 | def only(iterable, default=None, too_long=None): 3 | """If *iterable* has only one item, return it. 4 | If it has zero items, return *default*. 5 | If it has more than one item, raise the exception given by *too_long*, 6 | which is ``ValueError`` by default. 7 | >>> only([], default='missing') 8 | 'missing' 9 | >>> only([1]) 10 | 1 11 | >>> only([1, 2]) # doctest: +IGNORE_EXCEPTION_DETAIL 12 | Traceback (most recent call last): 13 | ... 14 | ValueError: Expected exactly one item in iterable, but got 1, 2, 15 | and perhaps more.' 16 | >>> only([1, 2], too_long=TypeError) # doctest: +IGNORE_EXCEPTION_DETAIL 17 | Traceback (most recent call last): 18 | ... 19 | TypeError 20 | Note that :func:`only` attempts to advance *iterable* twice to ensure there 21 | is only one item. See :func:`spy` or :func:`peekable` to check 22 | iterable contents less destructively. 23 | """ 24 | it = iter(iterable) 25 | first_value = next(it, default) 26 | 27 | try: 28 | second_value = next(it) 29 | except StopIteration: 30 | pass 31 | else: 32 | msg = ( 33 | 'Expected exactly one item in iterable, but got {!r}, {!r}, ' 34 | 'and perhaps more.'.format(first_value, second_value) 35 | ) 36 | raise too_long or ValueError(msg) 37 | 38 | return first_value 39 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/importlib/simple.py: -------------------------------------------------------------------------------- 1 | """ 2 | Compatibility shim for .resources.simple as found on Python 3.10. 3 | 4 | Consumers that can rely on Python 3.11 should use the other 5 | module directly. 6 | """ 7 | 8 | from .resources.simple import ( 9 | SimpleReader, ResourceHandle, ResourceContainer, TraversableReader, 10 | ) 11 | 12 | __all__ = [ 13 | 'SimpleReader', 'ResourceHandle', 'ResourceContainer', 'TraversableReader', 14 | ] 15 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/keyword.py: -------------------------------------------------------------------------------- 1 | """Keywords (from "Grammar/python.gram") 2 | 3 | This file is automatically generated; please don't muck it up! 4 | 5 | To update the symbols in this file, 'cd' to the top directory of 6 | the python source tree and run: 7 | 8 | PYTHONPATH=Tools/peg_generator python3 -m pegen.keywordgen \ 9 | Grammar/python.gram \ 10 | Grammar/Tokens \ 11 | Lib/keyword.py 12 | 13 | Alternatively, you can run 'make regen-keyword'. 14 | """ 15 | 16 | __all__ = ["iskeyword", "issoftkeyword", "kwlist", "softkwlist"] 17 | 18 | kwlist = [ 19 | 'False', 20 | 'None', 21 | 'True', 22 | 'and', 23 | 'as', 24 | 'assert', 25 | 'async', 26 | 'await', 27 | 'break', 28 | 'class', 29 | 'continue', 30 | 'def', 31 | 'del', 32 | 'elif', 33 | 'else', 34 | 'except', 35 | 'finally', 36 | 'for', 37 | 'from', 38 | 'global', 39 | 'if', 40 | 'import', 41 | 'in', 42 | 'is', 43 | 'lambda', 44 | 'nonlocal', 45 | 'not', 46 | 'or', 47 | 'pass', 48 | 'raise', 49 | 'return', 50 | 'try', 51 | 'while', 52 | 'with', 53 | 'yield' 54 | ] 55 | 56 | softkwlist = [ 57 | '_', 58 | 'case', 59 | 'match', 60 | 'type' 61 | ] 62 | 63 | iskeyword = frozenset(kwlist).__contains__ 64 | issoftkeyword = frozenset(softkwlist).__contains__ 65 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/pydoc_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/pydoc_data/__init__.py -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/pydoc_data/_pydoc.css: -------------------------------------------------------------------------------- 1 | /* 2 | CSS file for pydoc. 3 | 4 | Contents of this file are subject to change without notice. 5 | 6 | */ 7 | 8 | body { 9 | background-color: #f0f0f8; 10 | } 11 | 12 | table.heading tr { 13 | background-color: #7799ee; 14 | } 15 | 16 | .decor { 17 | color: #ffffff; 18 | } 19 | 20 | .title-decor { 21 | background-color: #ffc8d8; 22 | color: #000000; 23 | } 24 | 25 | .pkg-content-decor { 26 | background-color: #aa55cc; 27 | } 28 | 29 | .index-decor { 30 | background-color: #ee77aa; 31 | } 32 | 33 | .functions-decor { 34 | background-color: #eeaa77; 35 | } 36 | 37 | .data-decor { 38 | background-color: #55aa55; 39 | } 40 | 41 | .author-decor { 42 | background-color: #7799ee; 43 | } 44 | 45 | .credits-decor { 46 | background-color: #7799ee; 47 | } 48 | 49 | .error-decor { 50 | background-color: #bb0000; 51 | } 52 | 53 | .grey { 54 | color: #909090; 55 | } 56 | 57 | .white { 58 | color: #ffffff; 59 | } 60 | 61 | .repr { 62 | color: #c040c0; 63 | } 64 | 65 | table.heading tr td.title { 66 | vertical-align: bottom; 67 | } 68 | 69 | table.heading tr td.extra { 70 | vertical-align: bottom; 71 | text-align: right; 72 | } 73 | 74 | .heading-text { 75 | font-family: helvetica, arial; 76 | } 77 | 78 | .bigsection { 79 | font-size: larger; 80 | } 81 | 82 | .title { 83 | font-size: x-large; 84 | } 85 | 86 | .code { 87 | font-family: monospace; 88 | } 89 | 90 | table { 91 | width: 100%; 92 | border-spacing : 0; 93 | border-collapse : collapse; 94 | border: 0; 95 | } 96 | 97 | td { 98 | padding: 2; 99 | } 100 | 101 | td.section-title { 102 | vertical-align: bottom; 103 | } 104 | 105 | td.multicolumn { 106 | width: 25%; 107 | vertical-align: bottom; 108 | } 109 | 110 | td.singlecolumn { 111 | width: 100%; 112 | } 113 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/re/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/re/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/re/__pycache__/_casefix.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/re/__pycache__/_casefix.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/re/__pycache__/_compiler.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/re/__pycache__/_compiler.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/re/__pycache__/_constants.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/re/__pycache__/_constants.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/re/__pycache__/_parser.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/re/__pycache__/_parser.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests-2.32.3.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests-2.32.3.dist-info/REQUESTED: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests-2.32.3.dist-info/REQUESTED -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests-2.32.3.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.43.0) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests-2.32.3.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/__version__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/__version__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/_internal_utils.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/_internal_utils.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/adapters.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/adapters.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/api.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/api.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/auth.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/auth.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/certs.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/certs.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/compat.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/compat.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/cookies.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/cookies.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/exceptions.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/exceptions.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/help.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/help.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/hooks.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/hooks.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/models.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/models.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/packages.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/packages.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/sessions.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/sessions.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/status_codes.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/status_codes.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/structures.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/structures.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__pycache__/utils.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/requests/__pycache__/utils.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/__version__.py: -------------------------------------------------------------------------------- 1 | # .-. .-. .-. . . .-. .-. .-. .-. 2 | # |( |- |.| | | |- `-. | `-. 3 | # ' ' `-' `-`.`-' `-' `-' ' `-' 4 | 5 | __title__ = "requests" 6 | __description__ = "Python HTTP for Humans." 7 | __url__ = "https://requests.readthedocs.io" 8 | __version__ = "2.32.3" 9 | __build__ = 0x023203 10 | __author__ = "Kenneth Reitz" 11 | __author_email__ = "me@kennethreitz.org" 12 | __license__ = "Apache-2.0" 13 | __copyright__ = "Copyright Kenneth Reitz" 14 | __cake__ = "\u2728 \U0001f370 \u2728" 15 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/_internal_utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | requests._internal_utils 3 | ~~~~~~~~~~~~~~ 4 | 5 | Provides utility functions that are consumed internally by Requests 6 | which depend on extremely few external helpers (such as compat) 7 | """ 8 | import re 9 | 10 | from .compat import builtin_str 11 | 12 | _VALID_HEADER_NAME_RE_BYTE = re.compile(rb"^[^:\s][^:\r\n]*$") 13 | _VALID_HEADER_NAME_RE_STR = re.compile(r"^[^:\s][^:\r\n]*$") 14 | _VALID_HEADER_VALUE_RE_BYTE = re.compile(rb"^\S[^\r\n]*$|^$") 15 | _VALID_HEADER_VALUE_RE_STR = re.compile(r"^\S[^\r\n]*$|^$") 16 | 17 | _HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR) 18 | _HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE) 19 | HEADER_VALIDATORS = { 20 | bytes: _HEADER_VALIDATORS_BYTE, 21 | str: _HEADER_VALIDATORS_STR, 22 | } 23 | 24 | 25 | def to_native_string(string, encoding="ascii"): 26 | """Given a string object, regardless of type, returns a representation of 27 | that string in the native string type, encoding and decoding where 28 | necessary. This assumes ASCII unless told otherwise. 29 | """ 30 | if isinstance(string, builtin_str): 31 | out = string 32 | else: 33 | out = string.decode(encoding) 34 | 35 | return out 36 | 37 | 38 | def unicode_is_ascii(u_string): 39 | """Determine if unicode string only contains ASCII characters. 40 | 41 | :param str u_string: unicode string to check. Must be unicode 42 | and not Python 2 `str`. 43 | :rtype: bool 44 | """ 45 | assert isinstance(u_string, str) 46 | try: 47 | u_string.encode("ascii") 48 | return True 49 | except UnicodeEncodeError: 50 | return False 51 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | requests.certs 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module returns the preferred default CA certificate bundle. There is 8 | only one — the one from the certifi package. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | from certifi import where 15 | 16 | if __name__ == "__main__": 17 | print(where()) 18 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/compat.py: -------------------------------------------------------------------------------- 1 | """ 2 | requests.compat 3 | ~~~~~~~~~~~~~~~ 4 | 5 | This module previously handled import compatibility issues 6 | between Python 2 and Python 3. It remains for backwards 7 | compatibility until the next major version. 8 | """ 9 | 10 | import importlib 11 | import sys 12 | 13 | # ------------------- 14 | # Character Detection 15 | # ------------------- 16 | 17 | 18 | def _resolve_char_detection(): 19 | """Find supported character detection libraries.""" 20 | chardet = None 21 | for lib in ("chardet", "charset_normalizer"): 22 | if chardet is None: 23 | try: 24 | chardet = importlib.import_module(lib) 25 | except ImportError: 26 | pass 27 | return chardet 28 | 29 | 30 | chardet = _resolve_char_detection() 31 | 32 | # ------- 33 | # Pythons 34 | # ------- 35 | 36 | # Syntax sugar. 37 | _ver = sys.version_info 38 | 39 | #: Python 2.x? 40 | is_py2 = _ver[0] == 2 41 | 42 | #: Python 3.x? 43 | is_py3 = _ver[0] == 3 44 | 45 | # json/simplejson module import resolution 46 | has_simplejson = False 47 | try: 48 | import simplejson as json 49 | 50 | has_simplejson = True 51 | except ImportError: 52 | import json 53 | 54 | if has_simplejson: 55 | from simplejson import JSONDecodeError 56 | else: 57 | from json import JSONDecodeError 58 | 59 | # Keep OrderedDict for backwards compatibility. 60 | from collections import OrderedDict 61 | from collections.abc import Callable, Mapping, MutableMapping 62 | from http import cookiejar as cookielib 63 | from http.cookies import Morsel 64 | from io import StringIO 65 | 66 | # -------------- 67 | # Legacy Imports 68 | # -------------- 69 | from urllib.parse import ( 70 | quote, 71 | quote_plus, 72 | unquote, 73 | unquote_plus, 74 | urldefrag, 75 | urlencode, 76 | urljoin, 77 | urlparse, 78 | urlsplit, 79 | urlunparse, 80 | ) 81 | from urllib.request import ( 82 | getproxies, 83 | getproxies_environment, 84 | parse_http_list, 85 | proxy_bypass, 86 | proxy_bypass_environment, 87 | ) 88 | 89 | builtin_str = str 90 | str = str 91 | bytes = bytes 92 | basestring = (str, bytes) 93 | numeric_types = (int, float) 94 | integer_types = (int,) 95 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/hooks.py: -------------------------------------------------------------------------------- 1 | """ 2 | requests.hooks 3 | ~~~~~~~~~~~~~~ 4 | 5 | This module provides the capabilities for the Requests hooks system. 6 | 7 | Available hooks: 8 | 9 | ``response``: 10 | The response generated from a Request. 11 | """ 12 | HOOKS = ["response"] 13 | 14 | 15 | def default_hooks(): 16 | return {event: [] for event in HOOKS} 17 | 18 | 19 | # TODO: response is the only one 20 | 21 | 22 | def dispatch_hook(key, hooks, hook_data, **kwargs): 23 | """Dispatches a hook dictionary on a given piece of data.""" 24 | hooks = hooks or {} 25 | hooks = hooks.get(key) 26 | if hooks: 27 | if hasattr(hooks, "__call__"): 28 | hooks = [hooks] 29 | for hook in hooks: 30 | _hook_data = hook(hook_data, **kwargs) 31 | if _hook_data is not None: 32 | hook_data = _hook_data 33 | return hook_data 34 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/requests/packages.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from .compat import chardet 4 | 5 | # This code exists for backwards compatibility reasons. 6 | # I don't like it either. Just look the other way. :) 7 | 8 | for package in ("urllib3", "idna"): 9 | locals()[package] = __import__(package) 10 | # This traversal is apparently necessary such that the identities are 11 | # preserved (requests.packages.urllib3.* is urllib3.*) 12 | for mod in list(sys.modules): 13 | if mod == package or mod.startswith(f"{package}."): 14 | sys.modules[f"requests.packages.{mod}"] = sys.modules[mod] 15 | 16 | if chardet is not None: 17 | target = chardet.__name__ 18 | for mod in list(sys.modules): 19 | if mod == target or mod.startswith(f"{target}."): 20 | imported_mod = sys.modules[mod] 21 | sys.modules[f"requests.packages.{mod}"] = imported_mod 22 | mod = mod.replace(target, "chardet") 23 | sys.modules[f"requests.packages.{mod}"] = imported_mod 24 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/secrets.py: -------------------------------------------------------------------------------- 1 | """Generate cryptographically strong pseudo-random numbers suitable for 2 | managing secrets such as account authentication, tokens, and similar. 3 | 4 | See PEP 506 for more information. 5 | https://peps.python.org/pep-0506/ 6 | 7 | """ 8 | 9 | __all__ = ['choice', 'randbelow', 'randbits', 'SystemRandom', 10 | 'token_bytes', 'token_hex', 'token_urlsafe', 11 | 'compare_digest', 12 | ] 13 | 14 | 15 | import base64 16 | 17 | from hmac import compare_digest 18 | from random import SystemRandom 19 | 20 | _sysrand = SystemRandom() 21 | 22 | randbits = _sysrand.getrandbits 23 | choice = _sysrand.choice 24 | 25 | def randbelow(exclusive_upper_bound): 26 | """Return a random int in the range [0, n).""" 27 | if exclusive_upper_bound <= 0: 28 | raise ValueError("Upper bound must be positive.") 29 | return _sysrand._randbelow(exclusive_upper_bound) 30 | 31 | DEFAULT_ENTROPY = 32 # number of bytes to return by default 32 | 33 | def token_bytes(nbytes=None): 34 | """Return a random byte string containing *nbytes* bytes. 35 | 36 | If *nbytes* is ``None`` or not supplied, a reasonable 37 | default is used. 38 | 39 | >>> token_bytes(16) #doctest:+SKIP 40 | b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b' 41 | 42 | """ 43 | if nbytes is None: 44 | nbytes = DEFAULT_ENTROPY 45 | return _sysrand.randbytes(nbytes) 46 | 47 | def token_hex(nbytes=None): 48 | """Return a random text string, in hexadecimal. 49 | 50 | The string has *nbytes* random bytes, each byte converted to two 51 | hex digits. If *nbytes* is ``None`` or not supplied, a reasonable 52 | default is used. 53 | 54 | >>> token_hex(16) #doctest:+SKIP 55 | 'f9bf78b9a18ce6d46a0cd2b0b86df9da' 56 | 57 | """ 58 | return token_bytes(nbytes).hex() 59 | 60 | def token_urlsafe(nbytes=None): 61 | """Return a random URL-safe text string, in Base64 encoding. 62 | 63 | The string has *nbytes* random bytes. If *nbytes* is ``None`` 64 | or not supplied, a reasonable default is used. 65 | 66 | >>> token_urlsafe(16) #doctest:+SKIP 67 | 'Drmhze6EPcv0fN_81Bj-nA' 68 | 69 | """ 70 | tok = token_bytes(nbytes) 71 | return base64.urlsafe_b64encode(tok).rstrip(b'=').decode('ascii') 72 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/site-packages/README.txt: -------------------------------------------------------------------------------- 1 | This directory exists so that 3rd party packages can be installed 2 | here. Read the source for site.py for more details. 3 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/sre_compile.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | warnings.warn(f"module {__name__!r} is deprecated", 3 | DeprecationWarning, 4 | stacklevel=2) 5 | 6 | from re import _compiler as _ 7 | globals().update({k: v for k, v in vars(_).items() if k[:2] != '__'}) 8 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/sre_constants.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | warnings.warn(f"module {__name__!r} is deprecated", 3 | DeprecationWarning, 4 | stacklevel=2) 5 | 6 | from re import _constants as _ 7 | globals().update({k: v for k, v in vars(_).items() if k[:2] != '__'}) 8 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/sre_parse.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | warnings.warn(f"module {__name__!r} is deprecated", 3 | DeprecationWarning, 4 | stacklevel=2) 5 | 6 | from re import _parser as _ 7 | globals().update({k: v for k, v in vars(_).items() if k[:2] != '__'}) 8 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/struct.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | # Functions 3 | 'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from', 4 | 'iter_unpack', 5 | 6 | # Classes 7 | 'Struct', 8 | 9 | # Exceptions 10 | 'error' 11 | ] 12 | 13 | from _struct import * 14 | from _struct import _clearcache 15 | from _struct import __doc__ 16 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/this.py: -------------------------------------------------------------------------------- 1 | s = """Gur Mra bs Clguba, ol Gvz Crgref 2 | 3 | Ornhgvshy vf orggre guna htyl. 4 | Rkcyvpvg vf orggre guna vzcyvpvg. 5 | Fvzcyr vf orggre guna pbzcyrk. 6 | Pbzcyrk vf orggre guna pbzcyvpngrq. 7 | Syng vf orggre guna arfgrq. 8 | Fcnefr vf orggre guna qrafr. 9 | Ernqnovyvgl pbhagf. 10 | Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. 11 | Nygubhtu cenpgvpnyvgl orngf chevgl. 12 | Reebef fubhyq arire cnff fvyragyl. 13 | Hayrff rkcyvpvgyl fvyraprq. 14 | Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff. 15 | Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg. 16 | Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. 17 | Abj vf orggre guna arire. 18 | Nygubhtu arire vf bsgra orggre guna *evtug* abj. 19 | Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. 20 | Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. 21 | Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" 22 | 23 | d = {} 24 | for c in (65, 97): 25 | for i in range(26): 26 | d[chr(i+c)] = chr((i+13) % 26 + c) 27 | 28 | print("".join([d.get(c, c) for c in s])) 29 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/tomllib/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # SPDX-FileCopyrightText: 2021 Taneli Hukkinen 3 | # Licensed to PSF under a Contributor Agreement. 4 | 5 | __all__ = ("loads", "load", "TOMLDecodeError") 6 | 7 | from ._parser import TOMLDecodeError, load, loads 8 | 9 | # Pretend this exception was created here. 10 | TOMLDecodeError.__module__ = __name__ 11 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/tomllib/_types.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # SPDX-FileCopyrightText: 2021 Taneli Hukkinen 3 | # Licensed to PSF under a Contributor Agreement. 4 | 5 | from typing import Any, Callable, Tuple 6 | 7 | # Type annotations 8 | ParseFloat = Callable[[str], Any] 9 | Key = Tuple[str, ...] 10 | Pos = int 11 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/tty.py: -------------------------------------------------------------------------------- 1 | """Terminal utilities.""" 2 | 3 | # Author: Steen Lumholt. 4 | 5 | from termios import * 6 | 7 | __all__ = ["cfmakeraw", "cfmakecbreak", "setraw", "setcbreak"] 8 | 9 | # Indices for termios list. 10 | IFLAG = 0 11 | OFLAG = 1 12 | CFLAG = 2 13 | LFLAG = 3 14 | ISPEED = 4 15 | OSPEED = 5 16 | CC = 6 17 | 18 | def cfmakeraw(mode): 19 | """Make termios mode raw.""" 20 | # Clear all POSIX.1-2017 input mode flags. 21 | # See chapter 11 "General Terminal Interface" 22 | # of POSIX.1-2017 Base Definitions. 23 | mode[IFLAG] &= ~(IGNBRK | BRKINT | IGNPAR | PARMRK | INPCK | ISTRIP | 24 | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF) 25 | 26 | # Do not post-process output. 27 | mode[OFLAG] &= ~OPOST 28 | 29 | # Disable parity generation and detection; clear character size mask; 30 | # let character size be 8 bits. 31 | mode[CFLAG] &= ~(PARENB | CSIZE) 32 | mode[CFLAG] |= CS8 33 | 34 | # Clear all POSIX.1-2017 local mode flags. 35 | mode[LFLAG] &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON | 36 | IEXTEN | ISIG | NOFLSH | TOSTOP) 37 | 38 | # POSIX.1-2017, 11.1.7 Non-Canonical Mode Input Processing, 39 | # Case B: MIN>0, TIME=0 40 | # A pending read shall block until MIN (here 1) bytes are received, 41 | # or a signal is received. 42 | mode[CC] = list(mode[CC]) 43 | mode[CC][VMIN] = 1 44 | mode[CC][VTIME] = 0 45 | 46 | def cfmakecbreak(mode): 47 | """Make termios mode cbreak.""" 48 | # Do not echo characters; disable canonical input. 49 | mode[LFLAG] &= ~(ECHO | ICANON) 50 | 51 | # POSIX.1-2017, 11.1.7 Non-Canonical Mode Input Processing, 52 | # Case B: MIN>0, TIME=0 53 | # A pending read shall block until MIN (here 1) bytes are received, 54 | # or a signal is received. 55 | mode[CC] = list(mode[CC]) 56 | mode[CC][VMIN] = 1 57 | mode[CC][VTIME] = 0 58 | 59 | def setraw(fd, when=TCSAFLUSH): 60 | """Put terminal into raw mode.""" 61 | mode = tcgetattr(fd) 62 | new = list(mode) 63 | cfmakeraw(new) 64 | tcsetattr(fd, when, new) 65 | return mode 66 | 67 | def setcbreak(fd, when=TCSAFLUSH): 68 | """Put terminal into cbreak mode.""" 69 | mode = tcgetattr(fd) 70 | new = list(mode) 71 | cfmakecbreak(new) 72 | tcsetattr(fd, when, new) 73 | return mode 74 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/unittest/__main__.py: -------------------------------------------------------------------------------- 1 | """Main entry point""" 2 | 3 | import sys 4 | if sys.argv[0].endswith("__main__.py"): 5 | import os.path 6 | # We change sys.argv[0] to make help message more useful 7 | # use executable without path, unquoted 8 | # (it's just a hint anyway) 9 | # (if you have spaces in your executable you get what you deserve!) 10 | executable = os.path.basename(sys.executable) 11 | sys.argv[0] = executable + " -m unittest" 12 | del os 13 | 14 | __unittest = True 15 | 16 | from .main import main 17 | 18 | main(module=None) 19 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib/__init__.py -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3-2.2.2.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3-2.2.2.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: hatchling 1.24.2 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3-2.2.2.dist-info/licenses/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2008-2020 Andrey Petrov and contributors. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/_base_connection.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/_base_connection.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/_collections.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/_collections.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/_request_methods.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/_request_methods.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/_version.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/_version.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/connection.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/connection.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/connectionpool.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/connectionpool.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/exceptions.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/exceptions.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/fields.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/fields.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/filepost.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/filepost.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/http2.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/http2.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/poolmanager.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/poolmanager.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/__pycache__/response.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/__pycache__/response.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/_version.py: -------------------------------------------------------------------------------- 1 | # This file is protected via CODEOWNERS 2 | from __future__ import annotations 3 | 4 | __version__ = "2.2.2" 5 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/__pycache__/pyopenssl.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/__pycache__/pyopenssl.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/__pycache__/socks.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/__pycache__/socks.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/emscripten/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import urllib3.connection 4 | 5 | from ...connectionpool import HTTPConnectionPool, HTTPSConnectionPool 6 | from .connection import EmscriptenHTTPConnection, EmscriptenHTTPSConnection 7 | 8 | 9 | def inject_into_urllib3() -> None: 10 | # override connection classes to use emscripten specific classes 11 | # n.b. mypy complains about the overriding of classes below 12 | # if it isn't ignored 13 | HTTPConnectionPool.ConnectionCls = EmscriptenHTTPConnection 14 | HTTPSConnectionPool.ConnectionCls = EmscriptenHTTPSConnection 15 | urllib3.connection.HTTPConnection = EmscriptenHTTPConnection # type: ignore[misc,assignment] 16 | urllib3.connection.HTTPSConnection = EmscriptenHTTPSConnection # type: ignore[misc,assignment] 17 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/connection.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/connection.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/fetch.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/fetch.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/request.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/request.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/response.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/contrib/emscripten/__pycache__/response.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/contrib/emscripten/request.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from dataclasses import dataclass, field 4 | 5 | from ..._base_connection import _TYPE_BODY 6 | 7 | 8 | @dataclass 9 | class EmscriptenRequest: 10 | method: str 11 | url: str 12 | params: dict[str, str] | None = None 13 | body: _TYPE_BODY | None = None 14 | headers: dict[str, str] = field(default_factory=dict) 15 | timeout: float = 0 16 | decode_content: bool = True 17 | 18 | def set_header(self, name: str, value: str) -> None: 19 | self.headers[name.capitalize()] = value 20 | 21 | def set_body(self, body: _TYPE_BODY | None) -> None: 22 | self.body = body 23 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/py.typed: -------------------------------------------------------------------------------- 1 | # Instruct type checkers to look for inline type annotations in this package. 2 | # See PEP 561. 3 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__init__.py: -------------------------------------------------------------------------------- 1 | # For backwards compatibility, provide imports that used to be here. 2 | from __future__ import annotations 3 | 4 | from .connection import is_connection_dropped 5 | from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers 6 | from .response import is_fp_closed 7 | from .retry import Retry 8 | from .ssl_ import ( 9 | ALPN_PROTOCOLS, 10 | IS_PYOPENSSL, 11 | SSLContext, 12 | assert_fingerprint, 13 | create_urllib3_context, 14 | resolve_cert_reqs, 15 | resolve_ssl_version, 16 | ssl_wrap_socket, 17 | ) 18 | from .timeout import Timeout 19 | from .url import Url, parse_url 20 | from .wait import wait_for_read, wait_for_write 21 | 22 | __all__ = ( 23 | "IS_PYOPENSSL", 24 | "SSLContext", 25 | "ALPN_PROTOCOLS", 26 | "Retry", 27 | "Timeout", 28 | "Url", 29 | "assert_fingerprint", 30 | "create_urllib3_context", 31 | "is_connection_dropped", 32 | "is_fp_closed", 33 | "parse_url", 34 | "make_headers", 35 | "resolve_cert_reqs", 36 | "resolve_ssl_version", 37 | "ssl_wrap_socket", 38 | "wait_for_read", 39 | "wait_for_write", 40 | "SKIP_HEADER", 41 | "SKIPPABLE_HEADERS", 42 | ) 43 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/connection.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/connection.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/proxy.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/proxy.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/request.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/request.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/response.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/response.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/retry.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/retry.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/ssl_.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/ssl_.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/ssl_match_hostname.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/ssl_match_hostname.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/ssltransport.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/ssltransport.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/timeout.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/timeout.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/url.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/url.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/util.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/util.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/__pycache__/wait.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/lib/python3.12/urllib3/util/__pycache__/wait.cpython-312.pyc -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/proxy.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from .url import Url 6 | 7 | if typing.TYPE_CHECKING: 8 | from ..connection import ProxyConfig 9 | 10 | 11 | def connection_requires_http_tunnel( 12 | proxy_url: Url | None = None, 13 | proxy_config: ProxyConfig | None = None, 14 | destination_scheme: str | None = None, 15 | ) -> bool: 16 | """ 17 | Returns True if the connection requires an HTTP CONNECT through the proxy. 18 | 19 | :param URL proxy_url: 20 | URL of the proxy. 21 | :param ProxyConfig proxy_config: 22 | Proxy configuration from poolmanager.py 23 | :param str destination_scheme: 24 | The scheme of the destination. (i.e https, http, etc) 25 | """ 26 | # If we're not using a proxy, no way to use a tunnel. 27 | if proxy_url is None: 28 | return False 29 | 30 | # HTTP destinations never require tunneling, we always forward. 31 | if destination_scheme == "http": 32 | return False 33 | 34 | # Support for forwarding with HTTPS proxies and HTTPS destinations. 35 | if ( 36 | proxy_url.scheme == "https" 37 | and proxy_config 38 | and proxy_config.use_forwarding_for_https 39 | ): 40 | return False 41 | 42 | # Otherwise always use a tunnel. 43 | return True 44 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/urllib3/util/util.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | from types import TracebackType 5 | 6 | 7 | def to_bytes( 8 | x: str | bytes, encoding: str | None = None, errors: str | None = None 9 | ) -> bytes: 10 | if isinstance(x, bytes): 11 | return x 12 | elif not isinstance(x, str): 13 | raise TypeError(f"not expecting type {type(x).__name__}") 14 | if encoding or errors: 15 | return x.encode(encoding or "utf-8", errors=errors or "strict") 16 | return x.encode() 17 | 18 | 19 | def to_str( 20 | x: str | bytes, encoding: str | None = None, errors: str | None = None 21 | ) -> str: 22 | if isinstance(x, str): 23 | return x 24 | elif not isinstance(x, bytes): 25 | raise TypeError(f"not expecting type {type(x).__name__}") 26 | if encoding or errors: 27 | return x.decode(encoding or "utf-8", errors=errors or "strict") 28 | return x.decode() 29 | 30 | 31 | def reraise( 32 | tp: type[BaseException] | None, 33 | value: BaseException, 34 | tb: TracebackType | None = None, 35 | ) -> typing.NoReturn: 36 | try: 37 | if value.__traceback__ is not tb: 38 | raise value.with_traceback(tb) 39 | raise value 40 | finally: 41 | value = None # type: ignore[assignment] 42 | tb = None 43 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/wsgiref/__init__.py: -------------------------------------------------------------------------------- 1 | """wsgiref -- a WSGI (PEP 3333) Reference Library 2 | 3 | Current Contents: 4 | 5 | * util -- Miscellaneous useful functions and wrappers 6 | 7 | * headers -- Manage response headers 8 | 9 | * handlers -- base classes for server/gateway implementations 10 | 11 | * simple_server -- a simple BaseHTTPServer that supports WSGI 12 | 13 | * validate -- validation wrapper that sits between an app and a server 14 | to detect errors in either 15 | 16 | * types -- collection of WSGI-related types for static type checking 17 | 18 | To-Do: 19 | 20 | * cgi_gateway -- Run WSGI apps under CGI (pending a deployment standard) 21 | 22 | * cgi_wrapper -- Run CGI apps under WSGI 23 | 24 | * router -- a simple middleware component that handles URL traversal 25 | """ 26 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/wsgiref/types.py: -------------------------------------------------------------------------------- 1 | """WSGI-related types for static type checking""" 2 | 3 | from collections.abc import Callable, Iterable, Iterator 4 | from types import TracebackType 5 | from typing import Any, Protocol, TypeAlias 6 | 7 | __all__ = [ 8 | "StartResponse", 9 | "WSGIEnvironment", 10 | "WSGIApplication", 11 | "InputStream", 12 | "ErrorStream", 13 | "FileWrapper", 14 | ] 15 | 16 | _ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType] 17 | _OptExcInfo: TypeAlias = _ExcInfo | tuple[None, None, None] 18 | 19 | class StartResponse(Protocol): 20 | """start_response() callable as defined in PEP 3333""" 21 | def __call__( 22 | self, 23 | status: str, 24 | headers: list[tuple[str, str]], 25 | exc_info: _OptExcInfo | None = ..., 26 | /, 27 | ) -> Callable[[bytes], object]: ... 28 | 29 | WSGIEnvironment: TypeAlias = dict[str, Any] 30 | WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], 31 | Iterable[bytes]] 32 | 33 | class InputStream(Protocol): 34 | """WSGI input stream as defined in PEP 3333""" 35 | def read(self, size: int = ..., /) -> bytes: ... 36 | def readline(self, size: int = ..., /) -> bytes: ... 37 | def readlines(self, hint: int = ..., /) -> list[bytes]: ... 38 | def __iter__(self) -> Iterator[bytes]: ... 39 | 40 | class ErrorStream(Protocol): 41 | """WSGI error stream as defined in PEP 3333""" 42 | def flush(self) -> object: ... 43 | def write(self, s: str, /) -> object: ... 44 | def writelines(self, seq: list[str], /) -> object: ... 45 | 46 | class _Readable(Protocol): 47 | def read(self, size: int = ..., /) -> bytes: ... 48 | # Optional: def close(self) -> object: ... 49 | 50 | class FileWrapper(Protocol): 51 | """WSGI file wrapper as defined in PEP 3333""" 52 | def __call__( 53 | self, file: _Readable, block_size: int = ..., /, 54 | ) -> Iterable[bytes]: ... 55 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/xml/__init__.py: -------------------------------------------------------------------------------- 1 | """Core XML support for Python. 2 | 3 | This package contains four sub-packages: 4 | 5 | dom -- The W3C Document Object Model. This supports DOM Level 1 + 6 | Namespaces. 7 | 8 | parsers -- Python wrappers for XML parsers (currently only supports Expat). 9 | 10 | sax -- The Simple API for XML, developed by XML-Dev, led by David 11 | Megginson and ported to Python by Lars Marius Garshol. This 12 | supports the SAX 2 API. 13 | 14 | etree -- The ElementTree XML library. This is a subset of the full 15 | ElementTree XML release. 16 | 17 | """ 18 | 19 | 20 | __all__ = ["dom", "parsers", "sax", "etree"] 21 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/xml/dom/NodeFilter.py: -------------------------------------------------------------------------------- 1 | # This is the Python mapping for interface NodeFilter from 2 | # DOM2-Traversal-Range. It contains only constants. 3 | 4 | class NodeFilter: 5 | """ 6 | This is the DOM2 NodeFilter interface. It contains only constants. 7 | """ 8 | FILTER_ACCEPT = 1 9 | FILTER_REJECT = 2 10 | FILTER_SKIP = 3 11 | 12 | SHOW_ALL = 0xFFFFFFFF 13 | SHOW_ELEMENT = 0x00000001 14 | SHOW_ATTRIBUTE = 0x00000002 15 | SHOW_TEXT = 0x00000004 16 | SHOW_CDATA_SECTION = 0x00000008 17 | SHOW_ENTITY_REFERENCE = 0x00000010 18 | SHOW_ENTITY = 0x00000020 19 | SHOW_PROCESSING_INSTRUCTION = 0x00000040 20 | SHOW_COMMENT = 0x00000080 21 | SHOW_DOCUMENT = 0x00000100 22 | SHOW_DOCUMENT_TYPE = 0x00000200 23 | SHOW_DOCUMENT_FRAGMENT = 0x00000400 24 | SHOW_NOTATION = 0x00000800 25 | 26 | def acceptNode(self, node): 27 | raise NotImplementedError 28 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/xml/etree/__init__.py: -------------------------------------------------------------------------------- 1 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ 2 | # elementtree package 3 | 4 | # -------------------------------------------------------------------- 5 | # The ElementTree toolkit is 6 | # 7 | # Copyright (c) 1999-2008 by Fredrik Lundh 8 | # 9 | # By obtaining, using, and/or copying this software and/or its 10 | # associated documentation, you agree that you have read, understood, 11 | # and will comply with the following terms and conditions: 12 | # 13 | # Permission to use, copy, modify, and distribute this software and 14 | # its associated documentation for any purpose and without fee is 15 | # hereby granted, provided that the above copyright notice appears in 16 | # all copies, and that both that copyright notice and this permission 17 | # notice appear in supporting documentation, and that the name of 18 | # Secret Labs AB or the author not be used in advertising or publicity 19 | # pertaining to distribution of the software without specific, written 20 | # prior permission. 21 | # 22 | # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD 23 | # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- 24 | # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR 25 | # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 26 | # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 27 | # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 28 | # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 29 | # OF THIS SOFTWARE. 30 | # -------------------------------------------------------------------- 31 | 32 | # Licensed to PSF under a Contributor Agreement. 33 | # See https://www.python.org/psf/license for licensing details. 34 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/xml/etree/cElementTree.py: -------------------------------------------------------------------------------- 1 | # Deprecated alias for xml.etree.ElementTree 2 | 3 | from xml.etree.ElementTree import * 4 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/xml/parsers/__init__.py: -------------------------------------------------------------------------------- 1 | """Python interfaces to XML parsers. 2 | 3 | This package contains one module: 4 | 5 | expat -- Python wrapper for James Clark's Expat parser, with namespace 6 | support. 7 | 8 | """ 9 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/xml/parsers/expat.py: -------------------------------------------------------------------------------- 1 | """Interface to the Expat non-validating XML parser.""" 2 | import sys 3 | 4 | from pyexpat import * 5 | 6 | # provide pyexpat submodules as xml.parsers.expat submodules 7 | sys.modules['xml.parsers.expat.model'] = model 8 | sys.modules['xml.parsers.expat.errors'] = errors 9 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/xmlrpc/__init__.py: -------------------------------------------------------------------------------- 1 | # This directory is a Python package. 2 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/zipfile/__main__.py: -------------------------------------------------------------------------------- 1 | from . import main 2 | 3 | if __name__ == "__main__": 4 | main() 5 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/zipfile/_path/glob.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | 4 | def translate(pattern): 5 | r""" 6 | Given a glob pattern, produce a regex that matches it. 7 | 8 | >>> translate('*.txt') 9 | '[^/]*\\.txt' 10 | >>> translate('a?txt') 11 | 'a.txt' 12 | >>> translate('**/*') 13 | '.*/[^/]*' 14 | """ 15 | return ''.join(map(replace, separate(pattern))) 16 | 17 | 18 | def separate(pattern): 19 | """ 20 | Separate out character sets to avoid translating their contents. 21 | 22 | >>> [m.group(0) for m in separate('*.txt')] 23 | ['*.txt'] 24 | >>> [m.group(0) for m in separate('a[?]txt')] 25 | ['a', '[?]', 'txt'] 26 | """ 27 | return re.finditer(r'([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$)', pattern) 28 | 29 | 30 | def replace(match): 31 | """ 32 | Perform the replacements for a match from :func:`separate`. 33 | """ 34 | 35 | return match.group('set') or ( 36 | re.escape(match.group(0)) 37 | .replace('\\*\\*', r'.*') 38 | .replace('\\*', r'[^/]*') 39 | .replace('\\?', r'.') 40 | ) 41 | -------------------------------------------------------------------------------- /python-wasm/lib/python3.12/zoneinfo/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | "ZoneInfo", 3 | "reset_tzpath", 4 | "available_timezones", 5 | "TZPATH", 6 | "ZoneInfoNotFoundError", 7 | "InvalidTZPathWarning", 8 | ] 9 | 10 | from . import _tzpath 11 | from ._common import ZoneInfoNotFoundError 12 | 13 | try: 14 | from _zoneinfo import ZoneInfo 15 | except ImportError: # pragma: nocover 16 | from ._zoneinfo import ZoneInfo 17 | 18 | reset_tzpath = _tzpath.reset_tzpath 19 | available_timezones = _tzpath.available_timezones 20 | InvalidTZPathWarning = _tzpath.InvalidTZPathWarning 21 | 22 | 23 | def __getattr__(name): 24 | if name == "TZPATH": 25 | return _tzpath.TZPATH 26 | else: 27 | raise AttributeError(f"module {__name__!r} has no attribute {name!r}") 28 | 29 | 30 | def __dir__(): 31 | return sorted(list(globals()) + ["TZPATH"]) 32 | -------------------------------------------------------------------------------- /python-wasm/python.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ErikKaum/runner/fb37411ba7793c2fb1cd12b4fc4cc5d57f22f766/python-wasm/python.wasm -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | use tokio; 3 | 4 | pub mod memory_pipe; 5 | pub mod runner; 6 | 7 | use axum::{ 8 | extract::State, 9 | http::StatusCode, 10 | routing::{get, post}, 11 | Json, Router, 12 | }; 13 | use serde::{Deserialize, Serialize}; 14 | use tracing::info; 15 | use uuid::Uuid; 16 | 17 | static PORT: &str = "3000"; 18 | 19 | struct AppState { 20 | runner: runner::PythonRunner, 21 | } 22 | 23 | #[tokio::main] 24 | async fn main() { 25 | tracing_subscriber::fmt::init(); 26 | 27 | info!("starting server"); 28 | 29 | let runner = runner::PythonRunner::new().await.unwrap(); 30 | let shared_state = Arc::new(AppState { runner }); 31 | 32 | let app = Router::new() 33 | .route("/", get(health)) 34 | .route("/health", get(health)) 35 | .route("/run", post(run)) 36 | .with_state(shared_state); 37 | 38 | let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", PORT)) 39 | .await 40 | .unwrap(); 41 | info!("server running on port {} 🚀", PORT); 42 | axum::serve(listener, app).await.unwrap(); 43 | } 44 | 45 | async fn health() -> &'static str { 46 | "ok" 47 | } 48 | 49 | #[derive(Deserialize)] 50 | struct RunPayload { 51 | code: String, 52 | } 53 | 54 | #[derive(Serialize, Debug)] 55 | struct Response { 56 | res: runner::PythonResponse, 57 | } 58 | 59 | async fn run( 60 | State(state): State>, 61 | Json(payload): Json, 62 | ) -> (StatusCode, Json) { 63 | 64 | let id = Uuid::new_v4(); 65 | let res = state.runner.run_code(&payload.code, true, id).await; 66 | let msg = Response { res: res.unwrap() }; 67 | 68 | (StatusCode::OK, Json(msg)) 69 | } 70 | --------------------------------------------------------------------------------