@rowstile/cli-linux-x64 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +5 -0
- package/package.json +26 -0
- package/python/bin/python3.13 +0 -0
- package/python/bin/python3.13-config +122 -0
- package/python/lib/libpython3.13.so.1.0 +0 -0
- package/python/lib/libpython3.so +0 -0
- package/python/lib/python3.13/LICENSE.txt +277 -0
- package/python/lib/python3.13/__future__.py +147 -0
- package/python/lib/python3.13/__hello__.py +16 -0
- package/python/lib/python3.13/_aix_support.py +108 -0
- package/python/lib/python3.13/_android_support.py +192 -0
- package/python/lib/python3.13/_apple_support.py +66 -0
- package/python/lib/python3.13/_collections_abc.py +1187 -0
- package/python/lib/python3.13/_colorize.py +119 -0
- package/python/lib/python3.13/_compat_pickle.py +251 -0
- package/python/lib/python3.13/_compression.py +162 -0
- package/python/lib/python3.13/_ios_support.py +71 -0
- package/python/lib/python3.13/_markupbase.py +396 -0
- package/python/lib/python3.13/_opcode_metadata.py +343 -0
- package/python/lib/python3.13/_osx_support.py +579 -0
- package/python/lib/python3.13/_py_abc.py +147 -0
- package/python/lib/python3.13/_pydatetime.py +2640 -0
- package/python/lib/python3.13/_pydecimal.py +6356 -0
- package/python/lib/python3.13/_pyio.py +2714 -0
- package/python/lib/python3.13/_pylong.py +363 -0
- package/python/lib/python3.13/_pyrepl/__init__.py +19 -0
- package/python/lib/python3.13/_pyrepl/__main__.py +10 -0
- package/python/lib/python3.13/_pyrepl/_minimal_curses.py +68 -0
- package/python/lib/python3.13/_pyrepl/_threading_handler.py +74 -0
- package/python/lib/python3.13/_pyrepl/base_eventqueue.py +110 -0
- package/python/lib/python3.13/_pyrepl/commands.py +492 -0
- package/python/lib/python3.13/_pyrepl/completing_reader.py +295 -0
- package/python/lib/python3.13/_pyrepl/console.py +229 -0
- package/python/lib/python3.13/_pyrepl/curses.py +33 -0
- package/python/lib/python3.13/_pyrepl/fancy_termios.py +82 -0
- package/python/lib/python3.13/_pyrepl/historical_reader.py +419 -0
- package/python/lib/python3.13/_pyrepl/input.py +114 -0
- package/python/lib/python3.13/_pyrepl/keymap.py +213 -0
- package/python/lib/python3.13/_pyrepl/main.py +59 -0
- package/python/lib/python3.13/_pyrepl/mypy.ini +29 -0
- package/python/lib/python3.13/_pyrepl/pager.py +175 -0
- package/python/lib/python3.13/_pyrepl/reader.py +764 -0
- package/python/lib/python3.13/_pyrepl/readline.py +599 -0
- package/python/lib/python3.13/_pyrepl/simple_interact.py +180 -0
- package/python/lib/python3.13/_pyrepl/trace.py +21 -0
- package/python/lib/python3.13/_pyrepl/types.py +10 -0
- package/python/lib/python3.13/_pyrepl/unix_console.py +852 -0
- package/python/lib/python3.13/_pyrepl/unix_eventqueue.py +76 -0
- package/python/lib/python3.13/_pyrepl/utils.py +83 -0
- package/python/lib/python3.13/_pyrepl/windows_console.py +687 -0
- package/python/lib/python3.13/_pyrepl/windows_eventqueue.py +42 -0
- package/python/lib/python3.13/_sitebuiltins.py +91 -0
- package/python/lib/python3.13/_strptime.py +800 -0
- package/python/lib/python3.13/_sysconfigdata__linux_x86_64-linux-gnu.py +1079 -0
- package/python/lib/python3.13/_threading_local.py +120 -0
- package/python/lib/python3.13/_weakrefset.py +205 -0
- package/python/lib/python3.13/abc.py +188 -0
- package/python/lib/python3.13/antigravity.py +17 -0
- package/python/lib/python3.13/argparse.py +2690 -0
- package/python/lib/python3.13/ast.py +1865 -0
- package/python/lib/python3.13/asyncio/__init__.py +47 -0
- package/python/lib/python3.13/asyncio/__main__.py +211 -0
- package/python/lib/python3.13/asyncio/base_events.py +2086 -0
- package/python/lib/python3.13/asyncio/base_futures.py +67 -0
- package/python/lib/python3.13/asyncio/base_subprocess.py +312 -0
- package/python/lib/python3.13/asyncio/base_tasks.py +94 -0
- package/python/lib/python3.13/asyncio/constants.py +41 -0
- package/python/lib/python3.13/asyncio/coroutines.py +109 -0
- package/python/lib/python3.13/asyncio/events.py +885 -0
- package/python/lib/python3.13/asyncio/exceptions.py +62 -0
- package/python/lib/python3.13/asyncio/format_helpers.py +84 -0
- package/python/lib/python3.13/asyncio/futures.py +425 -0
- package/python/lib/python3.13/asyncio/locks.py +617 -0
- package/python/lib/python3.13/asyncio/log.py +7 -0
- package/python/lib/python3.13/asyncio/mixins.py +21 -0
- package/python/lib/python3.13/asyncio/proactor_events.py +891 -0
- package/python/lib/python3.13/asyncio/protocols.py +216 -0
- package/python/lib/python3.13/asyncio/queues.py +309 -0
- package/python/lib/python3.13/asyncio/runners.py +217 -0
- package/python/lib/python3.13/asyncio/selector_events.py +1328 -0
- package/python/lib/python3.13/asyncio/sslproto.py +929 -0
- package/python/lib/python3.13/asyncio/staggered.py +174 -0
- package/python/lib/python3.13/asyncio/streams.py +787 -0
- package/python/lib/python3.13/asyncio/subprocess.py +229 -0
- package/python/lib/python3.13/asyncio/taskgroups.py +278 -0
- package/python/lib/python3.13/asyncio/tasks.py +1121 -0
- package/python/lib/python3.13/asyncio/threads.py +26 -0
- package/python/lib/python3.13/asyncio/timeouts.py +185 -0
- package/python/lib/python3.13/asyncio/transports.py +337 -0
- package/python/lib/python3.13/asyncio/trsock.py +98 -0
- package/python/lib/python3.13/asyncio/unix_events.py +1550 -0
- package/python/lib/python3.13/asyncio/windows_events.py +906 -0
- package/python/lib/python3.13/asyncio/windows_utils.py +181 -0
- package/python/lib/python3.13/base64.py +628 -0
- package/python/lib/python3.13/bdb.py +973 -0
- package/python/lib/python3.13/bisect.py +118 -0
- package/python/lib/python3.13/bz2.py +352 -0
- package/python/lib/python3.13/cProfile.py +197 -0
- package/python/lib/python3.13/calendar.py +813 -0
- package/python/lib/python3.13/cmd.py +409 -0
- package/python/lib/python3.13/code.py +386 -0
- package/python/lib/python3.13/codecs.py +1132 -0
- package/python/lib/python3.13/codeop.py +155 -0
- package/python/lib/python3.13/collections/__init__.py +1603 -0
- package/python/lib/python3.13/colorsys.py +166 -0
- package/python/lib/python3.13/compileall.py +470 -0
- package/python/lib/python3.13/concurrent/__init__.py +1 -0
- package/python/lib/python3.13/concurrent/futures/__init__.py +54 -0
- package/python/lib/python3.13/concurrent/futures/_base.py +660 -0
- package/python/lib/python3.13/concurrent/futures/process.py +892 -0
- package/python/lib/python3.13/concurrent/futures/thread.py +240 -0
- package/python/lib/python3.13/configparser.py +1396 -0
- package/python/lib/python3.13/contextlib.py +814 -0
- package/python/lib/python3.13/contextvars.py +4 -0
- package/python/lib/python3.13/copy.py +306 -0
- package/python/lib/python3.13/copyreg.py +217 -0
- package/python/lib/python3.13/csv.py +527 -0
- package/python/lib/python3.13/ctypes/__init__.py +605 -0
- package/python/lib/python3.13/ctypes/_aix.py +327 -0
- package/python/lib/python3.13/ctypes/_endian.py +78 -0
- package/python/lib/python3.13/ctypes/macholib/README.ctypes +7 -0
- package/python/lib/python3.13/ctypes/macholib/__init__.py +9 -0
- package/python/lib/python3.13/ctypes/macholib/dyld.py +165 -0
- package/python/lib/python3.13/ctypes/macholib/dylib.py +42 -0
- package/python/lib/python3.13/ctypes/macholib/fetch_macholib +2 -0
- package/python/lib/python3.13/ctypes/macholib/fetch_macholib.bat +1 -0
- package/python/lib/python3.13/ctypes/macholib/framework.py +42 -0
- package/python/lib/python3.13/ctypes/util.py +387 -0
- package/python/lib/python3.13/ctypes/wintypes.py +202 -0
- package/python/lib/python3.13/curses/__init__.py +101 -0
- package/python/lib/python3.13/curses/ascii.py +99 -0
- package/python/lib/python3.13/curses/has_key.py +192 -0
- package/python/lib/python3.13/curses/panel.py +6 -0
- package/python/lib/python3.13/curses/textpad.py +236 -0
- package/python/lib/python3.13/dataclasses.py +1679 -0
- package/python/lib/python3.13/datetime.py +9 -0
- package/python/lib/python3.13/dbm/__init__.py +194 -0
- package/python/lib/python3.13/dbm/dumb.py +319 -0
- package/python/lib/python3.13/dbm/gnu.py +3 -0
- package/python/lib/python3.13/dbm/ndbm.py +3 -0
- package/python/lib/python3.13/dbm/sqlite3.py +144 -0
- package/python/lib/python3.13/decimal.py +109 -0
- package/python/lib/python3.13/difflib.py +2058 -0
- package/python/lib/python3.13/dis.py +1075 -0
- package/python/lib/python3.13/doctest.py +2919 -0
- package/python/lib/python3.13/email/__init__.py +61 -0
- package/python/lib/python3.13/email/_encoded_words.py +233 -0
- package/python/lib/python3.13/email/_header_value_parser.py +3153 -0
- package/python/lib/python3.13/email/_parseaddr.py +563 -0
- package/python/lib/python3.13/email/_policybase.py +382 -0
- package/python/lib/python3.13/email/architecture.rst +216 -0
- package/python/lib/python3.13/email/base64mime.py +115 -0
- package/python/lib/python3.13/email/charset.py +396 -0
- package/python/lib/python3.13/email/contentmanager.py +254 -0
- package/python/lib/python3.13/email/encoders.py +65 -0
- package/python/lib/python3.13/email/errors.py +117 -0
- package/python/lib/python3.13/email/feedparser.py +536 -0
- package/python/lib/python3.13/email/generator.py +530 -0
- package/python/lib/python3.13/email/header.py +582 -0
- package/python/lib/python3.13/email/headerregistry.py +618 -0
- package/python/lib/python3.13/email/iterators.py +68 -0
- package/python/lib/python3.13/email/message.py +1217 -0
- package/python/lib/python3.13/email/mime/__init__.py +0 -0
- package/python/lib/python3.13/email/mime/application.py +37 -0
- package/python/lib/python3.13/email/mime/audio.py +97 -0
- package/python/lib/python3.13/email/mime/base.py +29 -0
- package/python/lib/python3.13/email/mime/image.py +152 -0
- package/python/lib/python3.13/email/mime/message.py +33 -0
- package/python/lib/python3.13/email/mime/multipart.py +47 -0
- package/python/lib/python3.13/email/mime/nonmultipart.py +21 -0
- package/python/lib/python3.13/email/mime/text.py +40 -0
- package/python/lib/python3.13/email/parser.py +127 -0
- package/python/lib/python3.13/email/policy.py +232 -0
- package/python/lib/python3.13/email/quoprimime.py +300 -0
- package/python/lib/python3.13/email/utils.py +497 -0
- package/python/lib/python3.13/encodings/__init__.py +179 -0
- package/python/lib/python3.13/encodings/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/lib/python3.13/encodings/__pycache__/aliases.cpython-313.pyc +0 -0
- package/python/lib/python3.13/encodings/__pycache__/utf_8.cpython-313.pyc +0 -0
- package/python/lib/python3.13/encodings/aliases.py +560 -0
- package/python/lib/python3.13/encodings/ascii.py +50 -0
- package/python/lib/python3.13/encodings/base64_codec.py +55 -0
- package/python/lib/python3.13/encodings/big5.py +39 -0
- package/python/lib/python3.13/encodings/big5hkscs.py +39 -0
- package/python/lib/python3.13/encodings/bz2_codec.py +78 -0
- package/python/lib/python3.13/encodings/charmap.py +69 -0
- package/python/lib/python3.13/encodings/cp037.py +307 -0
- package/python/lib/python3.13/encodings/cp1006.py +307 -0
- package/python/lib/python3.13/encodings/cp1026.py +307 -0
- package/python/lib/python3.13/encodings/cp1125.py +698 -0
- package/python/lib/python3.13/encodings/cp1140.py +307 -0
- package/python/lib/python3.13/encodings/cp1250.py +307 -0
- package/python/lib/python3.13/encodings/cp1251.py +307 -0
- package/python/lib/python3.13/encodings/cp1252.py +307 -0
- package/python/lib/python3.13/encodings/cp1253.py +307 -0
- package/python/lib/python3.13/encodings/cp1254.py +307 -0
- package/python/lib/python3.13/encodings/cp1255.py +307 -0
- package/python/lib/python3.13/encodings/cp1256.py +307 -0
- package/python/lib/python3.13/encodings/cp1257.py +307 -0
- package/python/lib/python3.13/encodings/cp1258.py +307 -0
- package/python/lib/python3.13/encodings/cp273.py +307 -0
- package/python/lib/python3.13/encodings/cp424.py +307 -0
- package/python/lib/python3.13/encodings/cp437.py +698 -0
- package/python/lib/python3.13/encodings/cp500.py +307 -0
- package/python/lib/python3.13/encodings/cp720.py +309 -0
- package/python/lib/python3.13/encodings/cp737.py +698 -0
- package/python/lib/python3.13/encodings/cp775.py +697 -0
- package/python/lib/python3.13/encodings/cp850.py +698 -0
- package/python/lib/python3.13/encodings/cp852.py +698 -0
- package/python/lib/python3.13/encodings/cp855.py +698 -0
- package/python/lib/python3.13/encodings/cp856.py +307 -0
- package/python/lib/python3.13/encodings/cp857.py +694 -0
- package/python/lib/python3.13/encodings/cp858.py +698 -0
- package/python/lib/python3.13/encodings/cp860.py +698 -0
- package/python/lib/python3.13/encodings/cp861.py +698 -0
- package/python/lib/python3.13/encodings/cp862.py +698 -0
- package/python/lib/python3.13/encodings/cp863.py +698 -0
- package/python/lib/python3.13/encodings/cp864.py +690 -0
- package/python/lib/python3.13/encodings/cp865.py +698 -0
- package/python/lib/python3.13/encodings/cp866.py +698 -0
- package/python/lib/python3.13/encodings/cp869.py +689 -0
- package/python/lib/python3.13/encodings/cp874.py +307 -0
- package/python/lib/python3.13/encodings/cp875.py +307 -0
- package/python/lib/python3.13/encodings/cp932.py +39 -0
- package/python/lib/python3.13/encodings/cp949.py +39 -0
- package/python/lib/python3.13/encodings/cp950.py +39 -0
- package/python/lib/python3.13/encodings/euc_jis_2004.py +39 -0
- package/python/lib/python3.13/encodings/euc_jisx0213.py +39 -0
- package/python/lib/python3.13/encodings/euc_jp.py +39 -0
- package/python/lib/python3.13/encodings/euc_kr.py +39 -0
- package/python/lib/python3.13/encodings/gb18030.py +39 -0
- package/python/lib/python3.13/encodings/gb2312.py +39 -0
- package/python/lib/python3.13/encodings/gbk.py +39 -0
- package/python/lib/python3.13/encodings/hex_codec.py +55 -0
- package/python/lib/python3.13/encodings/hp_roman8.py +314 -0
- package/python/lib/python3.13/encodings/hz.py +39 -0
- package/python/lib/python3.13/encodings/idna.py +387 -0
- package/python/lib/python3.13/encodings/iso2022_jp.py +39 -0
- package/python/lib/python3.13/encodings/iso2022_jp_1.py +39 -0
- package/python/lib/python3.13/encodings/iso2022_jp_2.py +39 -0
- package/python/lib/python3.13/encodings/iso2022_jp_2004.py +39 -0
- package/python/lib/python3.13/encodings/iso2022_jp_3.py +39 -0
- package/python/lib/python3.13/encodings/iso2022_jp_ext.py +39 -0
- package/python/lib/python3.13/encodings/iso2022_kr.py +39 -0
- package/python/lib/python3.13/encodings/iso8859_1.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_10.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_11.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_13.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_14.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_15.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_16.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_2.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_3.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_4.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_5.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_6.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_7.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_8.py +307 -0
- package/python/lib/python3.13/encodings/iso8859_9.py +307 -0
- package/python/lib/python3.13/encodings/johab.py +39 -0
- package/python/lib/python3.13/encodings/koi8_r.py +307 -0
- package/python/lib/python3.13/encodings/koi8_t.py +308 -0
- package/python/lib/python3.13/encodings/koi8_u.py +307 -0
- package/python/lib/python3.13/encodings/kz1048.py +307 -0
- package/python/lib/python3.13/encodings/latin_1.py +50 -0
- package/python/lib/python3.13/encodings/mac_arabic.py +698 -0
- package/python/lib/python3.13/encodings/mac_croatian.py +307 -0
- package/python/lib/python3.13/encodings/mac_cyrillic.py +307 -0
- package/python/lib/python3.13/encodings/mac_farsi.py +307 -0
- package/python/lib/python3.13/encodings/mac_greek.py +307 -0
- package/python/lib/python3.13/encodings/mac_iceland.py +307 -0
- package/python/lib/python3.13/encodings/mac_latin2.py +312 -0
- package/python/lib/python3.13/encodings/mac_roman.py +307 -0
- package/python/lib/python3.13/encodings/mac_romanian.py +307 -0
- package/python/lib/python3.13/encodings/mac_turkish.py +307 -0
- package/python/lib/python3.13/encodings/mbcs.py +47 -0
- package/python/lib/python3.13/encodings/oem.py +41 -0
- package/python/lib/python3.13/encodings/palmos.py +308 -0
- package/python/lib/python3.13/encodings/ptcp154.py +312 -0
- package/python/lib/python3.13/encodings/punycode.py +253 -0
- package/python/lib/python3.13/encodings/quopri_codec.py +56 -0
- package/python/lib/python3.13/encodings/raw_unicode_escape.py +46 -0
- package/python/lib/python3.13/encodings/rot_13.py +113 -0
- package/python/lib/python3.13/encodings/shift_jis.py +39 -0
- package/python/lib/python3.13/encodings/shift_jis_2004.py +39 -0
- package/python/lib/python3.13/encodings/shift_jisx0213.py +39 -0
- package/python/lib/python3.13/encodings/tis_620.py +307 -0
- package/python/lib/python3.13/encodings/undefined.py +49 -0
- package/python/lib/python3.13/encodings/unicode_escape.py +46 -0
- package/python/lib/python3.13/encodings/utf_16.py +155 -0
- package/python/lib/python3.13/encodings/utf_16_be.py +42 -0
- package/python/lib/python3.13/encodings/utf_16_le.py +42 -0
- package/python/lib/python3.13/encodings/utf_32.py +150 -0
- package/python/lib/python3.13/encodings/utf_32_be.py +37 -0
- package/python/lib/python3.13/encodings/utf_32_le.py +37 -0
- package/python/lib/python3.13/encodings/utf_7.py +38 -0
- package/python/lib/python3.13/encodings/utf_8.py +42 -0
- package/python/lib/python3.13/encodings/utf_8_sig.py +130 -0
- package/python/lib/python3.13/encodings/uu_codec.py +103 -0
- package/python/lib/python3.13/encodings/zlib_codec.py +77 -0
- package/python/lib/python3.13/enum.py +2183 -0
- package/python/lib/python3.13/filecmp.py +320 -0
- package/python/lib/python3.13/fileinput.py +442 -0
- package/python/lib/python3.13/fnmatch.py +192 -0
- package/python/lib/python3.13/fractions.py +1043 -0
- package/python/lib/python3.13/ftplib.py +975 -0
- package/python/lib/python3.13/functools.py +1036 -0
- package/python/lib/python3.13/genericpath.py +200 -0
- package/python/lib/python3.13/getopt.py +215 -0
- package/python/lib/python3.13/getpass.py +192 -0
- package/python/lib/python3.13/gettext.py +657 -0
- package/python/lib/python3.13/glob.py +572 -0
- package/python/lib/python3.13/graphlib.py +250 -0
- package/python/lib/python3.13/gzip.py +693 -0
- package/python/lib/python3.13/hashlib.py +255 -0
- package/python/lib/python3.13/heapq.py +603 -0
- package/python/lib/python3.13/hmac.py +220 -0
- package/python/lib/python3.13/html/__init__.py +132 -0
- package/python/lib/python3.13/html/entities.py +2513 -0
- package/python/lib/python3.13/html/parser.py +583 -0
- package/python/lib/python3.13/http/__init__.py +202 -0
- package/python/lib/python3.13/http/client.py +1598 -0
- package/python/lib/python3.13/http/cookiejar.py +2122 -0
- package/python/lib/python3.13/http/cookies.py +635 -0
- package/python/lib/python3.13/http/server.py +1355 -0
- package/python/lib/python3.13/imaplib.py +1769 -0
- package/python/lib/python3.13/importlib/__init__.py +136 -0
- package/python/lib/python3.13/importlib/_abc.py +39 -0
- package/python/lib/python3.13/importlib/_bootstrap.py +1559 -0
- package/python/lib/python3.13/importlib/_bootstrap_external.py +1826 -0
- package/python/lib/python3.13/importlib/abc.py +243 -0
- package/python/lib/python3.13/importlib/machinery.py +21 -0
- package/python/lib/python3.13/importlib/metadata/__init__.py +1093 -0
- package/python/lib/python3.13/importlib/metadata/_adapters.py +89 -0
- package/python/lib/python3.13/importlib/metadata/_collections.py +30 -0
- package/python/lib/python3.13/importlib/metadata/_functools.py +104 -0
- package/python/lib/python3.13/importlib/metadata/_itertools.py +73 -0
- package/python/lib/python3.13/importlib/metadata/_meta.py +67 -0
- package/python/lib/python3.13/importlib/metadata/_text.py +99 -0
- package/python/lib/python3.13/importlib/metadata/diagnose.py +21 -0
- package/python/lib/python3.13/importlib/readers.py +12 -0
- package/python/lib/python3.13/importlib/resources/__init__.py +43 -0
- package/python/lib/python3.13/importlib/resources/_adapters.py +168 -0
- package/python/lib/python3.13/importlib/resources/_common.py +211 -0
- package/python/lib/python3.13/importlib/resources/_functional.py +81 -0
- package/python/lib/python3.13/importlib/resources/_itertools.py +38 -0
- package/python/lib/python3.13/importlib/resources/abc.py +173 -0
- package/python/lib/python3.13/importlib/resources/readers.py +203 -0
- package/python/lib/python3.13/importlib/resources/simple.py +106 -0
- package/python/lib/python3.13/importlib/simple.py +14 -0
- package/python/lib/python3.13/importlib/util.py +274 -0
- package/python/lib/python3.13/inspect.py +3479 -0
- package/python/lib/python3.13/io.py +99 -0
- package/python/lib/python3.13/ipaddress.py +2440 -0
- package/python/lib/python3.13/json/__init__.py +365 -0
- package/python/lib/python3.13/json/decoder.py +364 -0
- package/python/lib/python3.13/json/encoder.py +446 -0
- package/python/lib/python3.13/json/scanner.py +73 -0
- package/python/lib/python3.13/json/tool.py +90 -0
- package/python/lib/python3.13/keyword.py +64 -0
- package/python/lib/python3.13/lib-dynload/.empty +0 -0
- package/python/lib/python3.13/lib-dynload/_dbm.cpython-313-x86_64-linux-gnu.so +0 -0
- package/python/lib/python3.13/linecache.py +236 -0
- package/python/lib/python3.13/locale.py +1987 -0
- package/python/lib/python3.13/logging/__init__.py +2330 -0
- package/python/lib/python3.13/logging/config.py +1080 -0
- package/python/lib/python3.13/logging/handlers.py +1629 -0
- package/python/lib/python3.13/lzma.py +364 -0
- package/python/lib/python3.13/mailbox.py +2219 -0
- package/python/lib/python3.13/mimetypes.py +679 -0
- package/python/lib/python3.13/modulefinder.py +671 -0
- package/python/lib/python3.13/multiprocessing/__init__.py +37 -0
- package/python/lib/python3.13/multiprocessing/connection.py +1216 -0
- package/python/lib/python3.13/multiprocessing/context.py +383 -0
- package/python/lib/python3.13/multiprocessing/dummy/__init__.py +126 -0
- package/python/lib/python3.13/multiprocessing/dummy/connection.py +75 -0
- package/python/lib/python3.13/multiprocessing/forkserver.py +373 -0
- package/python/lib/python3.13/multiprocessing/heap.py +337 -0
- package/python/lib/python3.13/multiprocessing/managers.py +1397 -0
- package/python/lib/python3.13/multiprocessing/pool.py +957 -0
- package/python/lib/python3.13/multiprocessing/popen_fork.py +97 -0
- package/python/lib/python3.13/multiprocessing/popen_forkserver.py +74 -0
- package/python/lib/python3.13/multiprocessing/popen_spawn_posix.py +76 -0
- package/python/lib/python3.13/multiprocessing/popen_spawn_win32.py +147 -0
- package/python/lib/python3.13/multiprocessing/process.py +436 -0
- package/python/lib/python3.13/multiprocessing/queues.py +399 -0
- package/python/lib/python3.13/multiprocessing/reduction.py +281 -0
- package/python/lib/python3.13/multiprocessing/resource_sharer.py +154 -0
- package/python/lib/python3.13/multiprocessing/resource_tracker.py +499 -0
- package/python/lib/python3.13/multiprocessing/shared_memory.py +544 -0
- package/python/lib/python3.13/multiprocessing/sharedctypes.py +240 -0
- package/python/lib/python3.13/multiprocessing/spawn.py +307 -0
- package/python/lib/python3.13/multiprocessing/synchronize.py +404 -0
- package/python/lib/python3.13/multiprocessing/util.py +562 -0
- package/python/lib/python3.13/netrc.py +199 -0
- package/python/lib/python3.13/ntpath.py +872 -0
- package/python/lib/python3.13/nturl2path.py +69 -0
- package/python/lib/python3.13/numbers.py +427 -0
- package/python/lib/python3.13/opcode.py +115 -0
- package/python/lib/python3.13/operator.py +467 -0
- package/python/lib/python3.13/optparse.py +1681 -0
- package/python/lib/python3.13/os.py +1184 -0
- package/python/lib/python3.13/pathlib/__init__.py +12 -0
- package/python/lib/python3.13/pathlib/_abc.py +930 -0
- package/python/lib/python3.13/pathlib/_local.py +861 -0
- package/python/lib/python3.13/pdb.py +2550 -0
- package/python/lib/python3.13/pickle.py +1860 -0
- package/python/lib/python3.13/pickletools.py +2904 -0
- package/python/lib/python3.13/pkgutil.py +529 -0
- package/python/lib/python3.13/platform.py +1454 -0
- package/python/lib/python3.13/plistlib.py +948 -0
- package/python/lib/python3.13/poplib.py +477 -0
- package/python/lib/python3.13/posixpath.py +578 -0
- package/python/lib/python3.13/pprint.py +658 -0
- package/python/lib/python3.13/profile.py +616 -0
- package/python/lib/python3.13/pstats.py +778 -0
- package/python/lib/python3.13/pty.py +211 -0
- package/python/lib/python3.13/py_compile.py +212 -0
- package/python/lib/python3.13/pyclbr.py +314 -0
- package/python/lib/python3.13/pydoc.py +2861 -0
- package/python/lib/python3.13/queue.py +383 -0
- package/python/lib/python3.13/quopri.py +237 -0
- package/python/lib/python3.13/random.py +1078 -0
- package/python/lib/python3.13/re/__init__.py +428 -0
- package/python/lib/python3.13/re/_casefix.py +106 -0
- package/python/lib/python3.13/re/_compiler.py +768 -0
- package/python/lib/python3.13/re/_constants.py +222 -0
- package/python/lib/python3.13/re/_parser.py +1081 -0
- package/python/lib/python3.13/reprlib.py +230 -0
- package/python/lib/python3.13/rlcompleter.py +222 -0
- package/python/lib/python3.13/runpy.py +326 -0
- package/python/lib/python3.13/sched.py +167 -0
- package/python/lib/python3.13/secrets.py +71 -0
- package/python/lib/python3.13/selectors.py +603 -0
- package/python/lib/python3.13/shelve.py +250 -0
- package/python/lib/python3.13/shlex.py +345 -0
- package/python/lib/python3.13/shutil.py +1569 -0
- package/python/lib/python3.13/signal.py +94 -0
- package/python/lib/python3.13/site.py +773 -0
- package/python/lib/python3.13/smtplib.py +1123 -0
- package/python/lib/python3.13/socket.py +988 -0
- package/python/lib/python3.13/socketserver.py +863 -0
- package/python/lib/python3.13/sqlite3/__init__.py +70 -0
- package/python/lib/python3.13/sqlite3/__main__.py +139 -0
- package/python/lib/python3.13/sqlite3/dbapi2.py +108 -0
- package/python/lib/python3.13/sqlite3/dump.py +118 -0
- package/python/lib/python3.13/sre_compile.py +7 -0
- package/python/lib/python3.13/sre_constants.py +7 -0
- package/python/lib/python3.13/sre_parse.py +7 -0
- package/python/lib/python3.13/ssl.py +1541 -0
- package/python/lib/python3.13/stat.py +212 -0
- package/python/lib/python3.13/statistics.py +1817 -0
- package/python/lib/python3.13/string.py +314 -0
- package/python/lib/python3.13/stringprep.py +272 -0
- package/python/lib/python3.13/struct.py +15 -0
- package/python/lib/python3.13/subprocess.py +2258 -0
- package/python/lib/python3.13/symtable.py +414 -0
- package/python/lib/python3.13/sysconfig/__init__.py +734 -0
- package/python/lib/python3.13/sysconfig/__main__.py +248 -0
- package/python/lib/python3.13/tabnanny.py +340 -0
- package/python/lib/python3.13/tarfile.py +3136 -0
- package/python/lib/python3.13/tempfile.py +958 -0
- package/python/lib/python3.13/textwrap.py +497 -0
- package/python/lib/python3.13/this.py +28 -0
- package/python/lib/python3.13/threading.py +1602 -0
- package/python/lib/python3.13/timeit.py +381 -0
- package/python/lib/python3.13/token.py +141 -0
- package/python/lib/python3.13/tokenize.py +592 -0
- package/python/lib/python3.13/tomllib/__init__.py +10 -0
- package/python/lib/python3.13/tomllib/_parser.py +703 -0
- package/python/lib/python3.13/tomllib/_re.py +107 -0
- package/python/lib/python3.13/tomllib/_types.py +10 -0
- package/python/lib/python3.13/tomllib/mypy.ini +15 -0
- package/python/lib/python3.13/trace.py +754 -0
- package/python/lib/python3.13/traceback.py +1639 -0
- package/python/lib/python3.13/tracemalloc.py +560 -0
- package/python/lib/python3.13/tty.py +73 -0
- package/python/lib/python3.13/types.py +346 -0
- package/python/lib/python3.13/typing.py +3846 -0
- package/python/lib/python3.13/unittest/__init__.py +80 -0
- package/python/lib/python3.13/unittest/__main__.py +18 -0
- package/python/lib/python3.13/unittest/_log.py +86 -0
- package/python/lib/python3.13/unittest/async_case.py +146 -0
- package/python/lib/python3.13/unittest/case.py +1478 -0
- package/python/lib/python3.13/unittest/loader.py +460 -0
- package/python/lib/python3.13/unittest/main.py +280 -0
- package/python/lib/python3.13/unittest/mock.py +3189 -0
- package/python/lib/python3.13/unittest/result.py +256 -0
- package/python/lib/python3.13/unittest/runner.py +292 -0
- package/python/lib/python3.13/unittest/signals.py +71 -0
- package/python/lib/python3.13/unittest/suite.py +379 -0
- package/python/lib/python3.13/unittest/util.py +170 -0
- package/python/lib/python3.13/urllib/__init__.py +0 -0
- package/python/lib/python3.13/urllib/error.py +74 -0
- package/python/lib/python3.13/urllib/parse.py +1264 -0
- package/python/lib/python3.13/urllib/request.py +2796 -0
- package/python/lib/python3.13/urllib/response.py +84 -0
- package/python/lib/python3.13/urllib/robotparser.py +363 -0
- package/python/lib/python3.13/uuid.py +784 -0
- package/python/lib/python3.13/warnings.py +735 -0
- package/python/lib/python3.13/wave.py +665 -0
- package/python/lib/python3.13/weakref.py +674 -0
- package/python/lib/python3.13/webbrowser.py +724 -0
- package/python/lib/python3.13/wsgiref/__init__.py +25 -0
- package/python/lib/python3.13/wsgiref/handlers.py +575 -0
- package/python/lib/python3.13/wsgiref/headers.py +192 -0
- package/python/lib/python3.13/wsgiref/simple_server.py +161 -0
- package/python/lib/python3.13/wsgiref/types.py +54 -0
- package/python/lib/python3.13/wsgiref/util.py +159 -0
- package/python/lib/python3.13/wsgiref/validate.py +438 -0
- package/python/lib/python3.13/xml/__init__.py +20 -0
- package/python/lib/python3.13/xml/dom/NodeFilter.py +27 -0
- package/python/lib/python3.13/xml/dom/__init__.py +140 -0
- package/python/lib/python3.13/xml/dom/domreg.py +99 -0
- package/python/lib/python3.13/xml/dom/expatbuilder.py +962 -0
- package/python/lib/python3.13/xml/dom/minicompat.py +109 -0
- package/python/lib/python3.13/xml/dom/minidom.py +2024 -0
- package/python/lib/python3.13/xml/dom/pulldom.py +336 -0
- package/python/lib/python3.13/xml/dom/xmlbuilder.py +389 -0
- package/python/lib/python3.13/xml/etree/ElementInclude.py +186 -0
- package/python/lib/python3.13/xml/etree/ElementPath.py +430 -0
- package/python/lib/python3.13/xml/etree/ElementTree.py +2116 -0
- package/python/lib/python3.13/xml/etree/__init__.py +33 -0
- package/python/lib/python3.13/xml/etree/cElementTree.py +3 -0
- package/python/lib/python3.13/xml/parsers/__init__.py +8 -0
- package/python/lib/python3.13/xml/parsers/expat.py +8 -0
- package/python/lib/python3.13/xml/sax/__init__.py +94 -0
- package/python/lib/python3.13/xml/sax/_exceptions.py +127 -0
- package/python/lib/python3.13/xml/sax/expatreader.py +454 -0
- package/python/lib/python3.13/xml/sax/handler.py +387 -0
- package/python/lib/python3.13/xml/sax/saxutils.py +369 -0
- package/python/lib/python3.13/xml/sax/xmlreader.py +378 -0
- package/python/lib/python3.13/xmlrpc/__init__.py +1 -0
- package/python/lib/python3.13/xmlrpc/client.py +1503 -0
- package/python/lib/python3.13/xmlrpc/server.py +1002 -0
- package/python/lib/python3.13/zipapp.py +229 -0
- package/python/lib/python3.13/zipfile/__init__.py +2391 -0
- package/python/lib/python3.13/zipfile/__main__.py +4 -0
- package/python/lib/python3.13/zipfile/_path/__init__.py +452 -0
- package/python/lib/python3.13/zipfile/_path/glob.py +113 -0
- package/python/lib/python3.13/zipimport.py +803 -0
- package/python/lib/python3.13/zoneinfo/__init__.py +34 -0
- package/python/lib/python3.13/zoneinfo/_common.py +172 -0
- package/python/lib/python3.13/zoneinfo/_tzpath.py +189 -0
- package/python/lib/python3.13/zoneinfo/_zoneinfo.py +779 -0
- package/python/licenses/LICENSE.bdb.txt +126 -0
- package/python/licenses/LICENSE.bzip2.txt +37 -0
- package/python/licenses/LICENSE.cpython.txt +771 -0
- package/python/licenses/LICENSE.expat.txt +21 -0
- package/python/licenses/LICENSE.libX11.txt +942 -0
- package/python/licenses/LICENSE.libXau.txt +21 -0
- package/python/licenses/LICENSE.libedit.txt +29 -0
- package/python/licenses/LICENSE.libffi.txt +21 -0
- package/python/licenses/LICENSE.liblzma.txt +13 -0
- package/python/licenses/LICENSE.libuuid.txt +27 -0
- package/python/licenses/LICENSE.libxcb.txt +30 -0
- package/python/licenses/LICENSE.mpdecimal.txt +24 -0
- package/python/licenses/LICENSE.ncurses.txt +29 -0
- package/python/licenses/LICENSE.openssl-1.1.txt +124 -0
- package/python/licenses/LICENSE.openssl-3.txt +177 -0
- package/python/licenses/LICENSE.sqlite.txt +23 -0
- package/python/licenses/LICENSE.tcl.txt +40 -0
- package/python/licenses/LICENSE.tix.txt +54 -0
- package/python/licenses/LICENSE.zlib.txt +21 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""Thread-local objects.
|
|
2
|
+
|
|
3
|
+
(Note that this module provides a Python version of the threading.local
|
|
4
|
+
class. Depending on the version of Python you're using, there may be a
|
|
5
|
+
faster one available. You should always import the `local` class from
|
|
6
|
+
`threading`.)
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from weakref import ref
|
|
10
|
+
from contextlib import contextmanager
|
|
11
|
+
|
|
12
|
+
__all__ = ["local"]
|
|
13
|
+
|
|
14
|
+
# We need to use objects from the threading module, but the threading
|
|
15
|
+
# module may also want to use our `local` class, if support for locals
|
|
16
|
+
# isn't compiled in to the `thread` module. This creates potential problems
|
|
17
|
+
# with circular imports. For that reason, we don't import `threading`
|
|
18
|
+
# until the bottom of this file (a hack sufficient to worm around the
|
|
19
|
+
# potential problems). Note that all platforms on CPython do have support
|
|
20
|
+
# for locals in the `thread` module, and there is no circular import problem
|
|
21
|
+
# then, so problems introduced by fiddling the order of imports here won't
|
|
22
|
+
# manifest.
|
|
23
|
+
|
|
24
|
+
class _localimpl:
|
|
25
|
+
"""A class managing thread-local dicts"""
|
|
26
|
+
__slots__ = 'key', 'dicts', 'localargs', 'locallock', '__weakref__'
|
|
27
|
+
|
|
28
|
+
def __init__(self):
|
|
29
|
+
# The key used in the Thread objects' attribute dicts.
|
|
30
|
+
# We keep it a string for speed but make it unlikely to clash with
|
|
31
|
+
# a "real" attribute.
|
|
32
|
+
self.key = '_threading_local._localimpl.' + str(id(self))
|
|
33
|
+
# { id(Thread) -> (ref(Thread), thread-local dict) }
|
|
34
|
+
self.dicts = {}
|
|
35
|
+
|
|
36
|
+
def get_dict(self):
|
|
37
|
+
"""Return the dict for the current thread. Raises KeyError if none
|
|
38
|
+
defined."""
|
|
39
|
+
thread = current_thread()
|
|
40
|
+
return self.dicts[id(thread)][1]
|
|
41
|
+
|
|
42
|
+
def create_dict(self):
|
|
43
|
+
"""Create a new dict for the current thread, and return it."""
|
|
44
|
+
localdict = {}
|
|
45
|
+
key = self.key
|
|
46
|
+
thread = current_thread()
|
|
47
|
+
idt = id(thread)
|
|
48
|
+
def local_deleted(_, key=key):
|
|
49
|
+
# When the localimpl is deleted, remove the thread attribute.
|
|
50
|
+
thread = wrthread()
|
|
51
|
+
if thread is not None:
|
|
52
|
+
del thread.__dict__[key]
|
|
53
|
+
def thread_deleted(_, idt=idt):
|
|
54
|
+
# When the thread is deleted, remove the local dict.
|
|
55
|
+
# Note that this is suboptimal if the thread object gets
|
|
56
|
+
# caught in a reference loop. We would like to be called
|
|
57
|
+
# as soon as the OS-level thread ends instead.
|
|
58
|
+
local = wrlocal()
|
|
59
|
+
if local is not None:
|
|
60
|
+
dct = local.dicts.pop(idt)
|
|
61
|
+
wrlocal = ref(self, local_deleted)
|
|
62
|
+
wrthread = ref(thread, thread_deleted)
|
|
63
|
+
thread.__dict__[key] = wrlocal
|
|
64
|
+
self.dicts[idt] = wrthread, localdict
|
|
65
|
+
return localdict
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@contextmanager
|
|
69
|
+
def _patch(self):
|
|
70
|
+
impl = object.__getattribute__(self, '_local__impl')
|
|
71
|
+
try:
|
|
72
|
+
dct = impl.get_dict()
|
|
73
|
+
except KeyError:
|
|
74
|
+
dct = impl.create_dict()
|
|
75
|
+
args, kw = impl.localargs
|
|
76
|
+
self.__init__(*args, **kw)
|
|
77
|
+
with impl.locallock:
|
|
78
|
+
object.__setattr__(self, '__dict__', dct)
|
|
79
|
+
yield
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class local:
|
|
83
|
+
__slots__ = '_local__impl', '__dict__'
|
|
84
|
+
|
|
85
|
+
def __new__(cls, /, *args, **kw):
|
|
86
|
+
if (args or kw) and (cls.__init__ is object.__init__):
|
|
87
|
+
raise TypeError("Initialization arguments are not supported")
|
|
88
|
+
self = object.__new__(cls)
|
|
89
|
+
impl = _localimpl()
|
|
90
|
+
impl.localargs = (args, kw)
|
|
91
|
+
impl.locallock = RLock()
|
|
92
|
+
object.__setattr__(self, '_local__impl', impl)
|
|
93
|
+
# We need to create the thread dict in anticipation of
|
|
94
|
+
# __init__ being called, to make sure we don't call it
|
|
95
|
+
# again ourselves.
|
|
96
|
+
impl.create_dict()
|
|
97
|
+
return self
|
|
98
|
+
|
|
99
|
+
def __getattribute__(self, name):
|
|
100
|
+
with _patch(self):
|
|
101
|
+
return object.__getattribute__(self, name)
|
|
102
|
+
|
|
103
|
+
def __setattr__(self, name, value):
|
|
104
|
+
if name == '__dict__':
|
|
105
|
+
raise AttributeError(
|
|
106
|
+
"%r object attribute '__dict__' is read-only"
|
|
107
|
+
% self.__class__.__name__)
|
|
108
|
+
with _patch(self):
|
|
109
|
+
return object.__setattr__(self, name, value)
|
|
110
|
+
|
|
111
|
+
def __delattr__(self, name):
|
|
112
|
+
if name == '__dict__':
|
|
113
|
+
raise AttributeError(
|
|
114
|
+
"%r object attribute '__dict__' is read-only"
|
|
115
|
+
% self.__class__.__name__)
|
|
116
|
+
with _patch(self):
|
|
117
|
+
return object.__delattr__(self, name)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
from threading import current_thread, RLock
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Access WeakSet through the weakref module.
|
|
2
|
+
# This code is separated-out because it is needed
|
|
3
|
+
# by abc.py to load everything else at startup.
|
|
4
|
+
|
|
5
|
+
from _weakref import ref
|
|
6
|
+
from types import GenericAlias
|
|
7
|
+
|
|
8
|
+
__all__ = ['WeakSet']
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class _IterationGuard:
|
|
12
|
+
# This context manager registers itself in the current iterators of the
|
|
13
|
+
# weak container, such as to delay all removals until the context manager
|
|
14
|
+
# exits.
|
|
15
|
+
# This technique should be relatively thread-safe (since sets are).
|
|
16
|
+
|
|
17
|
+
def __init__(self, weakcontainer):
|
|
18
|
+
# Don't create cycles
|
|
19
|
+
self.weakcontainer = ref(weakcontainer)
|
|
20
|
+
|
|
21
|
+
def __enter__(self):
|
|
22
|
+
w = self.weakcontainer()
|
|
23
|
+
if w is not None:
|
|
24
|
+
w._iterating.add(self)
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def __exit__(self, e, t, b):
|
|
28
|
+
w = self.weakcontainer()
|
|
29
|
+
if w is not None:
|
|
30
|
+
s = w._iterating
|
|
31
|
+
s.remove(self)
|
|
32
|
+
if not s:
|
|
33
|
+
w._commit_removals()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class WeakSet:
|
|
37
|
+
def __init__(self, data=None):
|
|
38
|
+
self.data = set()
|
|
39
|
+
def _remove(item, selfref=ref(self)):
|
|
40
|
+
self = selfref()
|
|
41
|
+
if self is not None:
|
|
42
|
+
if self._iterating:
|
|
43
|
+
self._pending_removals.append(item)
|
|
44
|
+
else:
|
|
45
|
+
self.data.discard(item)
|
|
46
|
+
self._remove = _remove
|
|
47
|
+
# A list of keys to be removed
|
|
48
|
+
self._pending_removals = []
|
|
49
|
+
self._iterating = set()
|
|
50
|
+
if data is not None:
|
|
51
|
+
self.update(data)
|
|
52
|
+
|
|
53
|
+
def _commit_removals(self):
|
|
54
|
+
pop = self._pending_removals.pop
|
|
55
|
+
discard = self.data.discard
|
|
56
|
+
while True:
|
|
57
|
+
try:
|
|
58
|
+
item = pop()
|
|
59
|
+
except IndexError:
|
|
60
|
+
return
|
|
61
|
+
discard(item)
|
|
62
|
+
|
|
63
|
+
def __iter__(self):
|
|
64
|
+
with _IterationGuard(self):
|
|
65
|
+
for itemref in self.data:
|
|
66
|
+
item = itemref()
|
|
67
|
+
if item is not None:
|
|
68
|
+
# Caveat: the iterator will keep a strong reference to
|
|
69
|
+
# `item` until it is resumed or closed.
|
|
70
|
+
yield item
|
|
71
|
+
|
|
72
|
+
def __len__(self):
|
|
73
|
+
return len(self.data) - len(self._pending_removals)
|
|
74
|
+
|
|
75
|
+
def __contains__(self, item):
|
|
76
|
+
try:
|
|
77
|
+
wr = ref(item)
|
|
78
|
+
except TypeError:
|
|
79
|
+
return False
|
|
80
|
+
return wr in self.data
|
|
81
|
+
|
|
82
|
+
def __reduce__(self):
|
|
83
|
+
return self.__class__, (list(self),), self.__getstate__()
|
|
84
|
+
|
|
85
|
+
def add(self, item):
|
|
86
|
+
if self._pending_removals:
|
|
87
|
+
self._commit_removals()
|
|
88
|
+
self.data.add(ref(item, self._remove))
|
|
89
|
+
|
|
90
|
+
def clear(self):
|
|
91
|
+
if self._pending_removals:
|
|
92
|
+
self._commit_removals()
|
|
93
|
+
self.data.clear()
|
|
94
|
+
|
|
95
|
+
def copy(self):
|
|
96
|
+
return self.__class__(self)
|
|
97
|
+
|
|
98
|
+
def pop(self):
|
|
99
|
+
if self._pending_removals:
|
|
100
|
+
self._commit_removals()
|
|
101
|
+
while True:
|
|
102
|
+
try:
|
|
103
|
+
itemref = self.data.pop()
|
|
104
|
+
except KeyError:
|
|
105
|
+
raise KeyError('pop from empty WeakSet') from None
|
|
106
|
+
item = itemref()
|
|
107
|
+
if item is not None:
|
|
108
|
+
return item
|
|
109
|
+
|
|
110
|
+
def remove(self, item):
|
|
111
|
+
if self._pending_removals:
|
|
112
|
+
self._commit_removals()
|
|
113
|
+
self.data.remove(ref(item))
|
|
114
|
+
|
|
115
|
+
def discard(self, item):
|
|
116
|
+
if self._pending_removals:
|
|
117
|
+
self._commit_removals()
|
|
118
|
+
self.data.discard(ref(item))
|
|
119
|
+
|
|
120
|
+
def update(self, other):
|
|
121
|
+
if self._pending_removals:
|
|
122
|
+
self._commit_removals()
|
|
123
|
+
for element in other:
|
|
124
|
+
self.add(element)
|
|
125
|
+
|
|
126
|
+
def __ior__(self, other):
|
|
127
|
+
self.update(other)
|
|
128
|
+
return self
|
|
129
|
+
|
|
130
|
+
def difference(self, other):
|
|
131
|
+
newset = self.copy()
|
|
132
|
+
newset.difference_update(other)
|
|
133
|
+
return newset
|
|
134
|
+
__sub__ = difference
|
|
135
|
+
|
|
136
|
+
def difference_update(self, other):
|
|
137
|
+
self.__isub__(other)
|
|
138
|
+
def __isub__(self, other):
|
|
139
|
+
if self._pending_removals:
|
|
140
|
+
self._commit_removals()
|
|
141
|
+
if self is other:
|
|
142
|
+
self.data.clear()
|
|
143
|
+
else:
|
|
144
|
+
self.data.difference_update(ref(item) for item in other)
|
|
145
|
+
return self
|
|
146
|
+
|
|
147
|
+
def intersection(self, other):
|
|
148
|
+
return self.__class__(item for item in other if item in self)
|
|
149
|
+
__and__ = intersection
|
|
150
|
+
|
|
151
|
+
def intersection_update(self, other):
|
|
152
|
+
self.__iand__(other)
|
|
153
|
+
def __iand__(self, other):
|
|
154
|
+
if self._pending_removals:
|
|
155
|
+
self._commit_removals()
|
|
156
|
+
self.data.intersection_update(ref(item) for item in other)
|
|
157
|
+
return self
|
|
158
|
+
|
|
159
|
+
def issubset(self, other):
|
|
160
|
+
return self.data.issubset(ref(item) for item in other)
|
|
161
|
+
__le__ = issubset
|
|
162
|
+
|
|
163
|
+
def __lt__(self, other):
|
|
164
|
+
return self.data < set(map(ref, other))
|
|
165
|
+
|
|
166
|
+
def issuperset(self, other):
|
|
167
|
+
return self.data.issuperset(ref(item) for item in other)
|
|
168
|
+
__ge__ = issuperset
|
|
169
|
+
|
|
170
|
+
def __gt__(self, other):
|
|
171
|
+
return self.data > set(map(ref, other))
|
|
172
|
+
|
|
173
|
+
def __eq__(self, other):
|
|
174
|
+
if not isinstance(other, self.__class__):
|
|
175
|
+
return NotImplemented
|
|
176
|
+
return self.data == set(map(ref, other))
|
|
177
|
+
|
|
178
|
+
def symmetric_difference(self, other):
|
|
179
|
+
newset = self.copy()
|
|
180
|
+
newset.symmetric_difference_update(other)
|
|
181
|
+
return newset
|
|
182
|
+
__xor__ = symmetric_difference
|
|
183
|
+
|
|
184
|
+
def symmetric_difference_update(self, other):
|
|
185
|
+
self.__ixor__(other)
|
|
186
|
+
def __ixor__(self, other):
|
|
187
|
+
if self._pending_removals:
|
|
188
|
+
self._commit_removals()
|
|
189
|
+
if self is other:
|
|
190
|
+
self.data.clear()
|
|
191
|
+
else:
|
|
192
|
+
self.data.symmetric_difference_update(ref(item, self._remove) for item in other)
|
|
193
|
+
return self
|
|
194
|
+
|
|
195
|
+
def union(self, other):
|
|
196
|
+
return self.__class__(e for s in (self, other) for e in s)
|
|
197
|
+
__or__ = union
|
|
198
|
+
|
|
199
|
+
def isdisjoint(self, other):
|
|
200
|
+
return len(self.intersection(other)) == 0
|
|
201
|
+
|
|
202
|
+
def __repr__(self):
|
|
203
|
+
return repr(self.data)
|
|
204
|
+
|
|
205
|
+
__class_getitem__ = classmethod(GenericAlias)
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Copyright 2007 Google, Inc. All Rights Reserved.
|
|
2
|
+
# Licensed to PSF under a Contributor Agreement.
|
|
3
|
+
|
|
4
|
+
"""Abstract Base Classes (ABCs) according to PEP 3119."""
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def abstractmethod(funcobj):
|
|
8
|
+
"""A decorator indicating abstract methods.
|
|
9
|
+
|
|
10
|
+
Requires that the metaclass is ABCMeta or derived from it. A
|
|
11
|
+
class that has a metaclass derived from ABCMeta cannot be
|
|
12
|
+
instantiated unless all of its abstract methods are overridden.
|
|
13
|
+
The abstract methods can be called using any of the normal
|
|
14
|
+
'super' call mechanisms. abstractmethod() may be used to declare
|
|
15
|
+
abstract methods for properties and descriptors.
|
|
16
|
+
|
|
17
|
+
Usage:
|
|
18
|
+
|
|
19
|
+
class C(metaclass=ABCMeta):
|
|
20
|
+
@abstractmethod
|
|
21
|
+
def my_abstract_method(self, arg1, arg2, argN):
|
|
22
|
+
...
|
|
23
|
+
"""
|
|
24
|
+
funcobj.__isabstractmethod__ = True
|
|
25
|
+
return funcobj
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class abstractclassmethod(classmethod):
|
|
29
|
+
"""A decorator indicating abstract classmethods.
|
|
30
|
+
|
|
31
|
+
Deprecated, use 'classmethod' with 'abstractmethod' instead:
|
|
32
|
+
|
|
33
|
+
class C(ABC):
|
|
34
|
+
@classmethod
|
|
35
|
+
@abstractmethod
|
|
36
|
+
def my_abstract_classmethod(cls, ...):
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
__isabstractmethod__ = True
|
|
42
|
+
|
|
43
|
+
def __init__(self, callable):
|
|
44
|
+
callable.__isabstractmethod__ = True
|
|
45
|
+
super().__init__(callable)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class abstractstaticmethod(staticmethod):
|
|
49
|
+
"""A decorator indicating abstract staticmethods.
|
|
50
|
+
|
|
51
|
+
Deprecated, use 'staticmethod' with 'abstractmethod' instead:
|
|
52
|
+
|
|
53
|
+
class C(ABC):
|
|
54
|
+
@staticmethod
|
|
55
|
+
@abstractmethod
|
|
56
|
+
def my_abstract_staticmethod(...):
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
__isabstractmethod__ = True
|
|
62
|
+
|
|
63
|
+
def __init__(self, callable):
|
|
64
|
+
callable.__isabstractmethod__ = True
|
|
65
|
+
super().__init__(callable)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class abstractproperty(property):
|
|
69
|
+
"""A decorator indicating abstract properties.
|
|
70
|
+
|
|
71
|
+
Deprecated, use 'property' with 'abstractmethod' instead:
|
|
72
|
+
|
|
73
|
+
class C(ABC):
|
|
74
|
+
@property
|
|
75
|
+
@abstractmethod
|
|
76
|
+
def my_abstract_property(self):
|
|
77
|
+
...
|
|
78
|
+
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
__isabstractmethod__ = True
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
try:
|
|
85
|
+
from _abc import (get_cache_token, _abc_init, _abc_register,
|
|
86
|
+
_abc_instancecheck, _abc_subclasscheck, _get_dump,
|
|
87
|
+
_reset_registry, _reset_caches)
|
|
88
|
+
except ImportError:
|
|
89
|
+
from _py_abc import ABCMeta, get_cache_token
|
|
90
|
+
ABCMeta.__module__ = 'abc'
|
|
91
|
+
else:
|
|
92
|
+
class ABCMeta(type):
|
|
93
|
+
"""Metaclass for defining Abstract Base Classes (ABCs).
|
|
94
|
+
|
|
95
|
+
Use this metaclass to create an ABC. An ABC can be subclassed
|
|
96
|
+
directly, and then acts as a mix-in class. You can also register
|
|
97
|
+
unrelated concrete classes (even built-in classes) and unrelated
|
|
98
|
+
ABCs as 'virtual subclasses' -- these and their descendants will
|
|
99
|
+
be considered subclasses of the registering ABC by the built-in
|
|
100
|
+
issubclass() function, but the registering ABC won't show up in
|
|
101
|
+
their MRO (Method Resolution Order) nor will method
|
|
102
|
+
implementations defined by the registering ABC be callable (not
|
|
103
|
+
even via super()).
|
|
104
|
+
"""
|
|
105
|
+
def __new__(mcls, name, bases, namespace, /, **kwargs):
|
|
106
|
+
cls = super().__new__(mcls, name, bases, namespace, **kwargs)
|
|
107
|
+
_abc_init(cls)
|
|
108
|
+
return cls
|
|
109
|
+
|
|
110
|
+
def register(cls, subclass):
|
|
111
|
+
"""Register a virtual subclass of an ABC.
|
|
112
|
+
|
|
113
|
+
Returns the subclass, to allow usage as a class decorator.
|
|
114
|
+
"""
|
|
115
|
+
return _abc_register(cls, subclass)
|
|
116
|
+
|
|
117
|
+
def __instancecheck__(cls, instance):
|
|
118
|
+
"""Override for isinstance(instance, cls)."""
|
|
119
|
+
return _abc_instancecheck(cls, instance)
|
|
120
|
+
|
|
121
|
+
def __subclasscheck__(cls, subclass):
|
|
122
|
+
"""Override for issubclass(subclass, cls)."""
|
|
123
|
+
return _abc_subclasscheck(cls, subclass)
|
|
124
|
+
|
|
125
|
+
def _dump_registry(cls, file=None):
|
|
126
|
+
"""Debug helper to print the ABC registry."""
|
|
127
|
+
print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)
|
|
128
|
+
print(f"Inv. counter: {get_cache_token()}", file=file)
|
|
129
|
+
(_abc_registry, _abc_cache, _abc_negative_cache,
|
|
130
|
+
_abc_negative_cache_version) = _get_dump(cls)
|
|
131
|
+
print(f"_abc_registry: {_abc_registry!r}", file=file)
|
|
132
|
+
print(f"_abc_cache: {_abc_cache!r}", file=file)
|
|
133
|
+
print(f"_abc_negative_cache: {_abc_negative_cache!r}", file=file)
|
|
134
|
+
print(f"_abc_negative_cache_version: {_abc_negative_cache_version!r}",
|
|
135
|
+
file=file)
|
|
136
|
+
|
|
137
|
+
def _abc_registry_clear(cls):
|
|
138
|
+
"""Clear the registry (for debugging or testing)."""
|
|
139
|
+
_reset_registry(cls)
|
|
140
|
+
|
|
141
|
+
def _abc_caches_clear(cls):
|
|
142
|
+
"""Clear the caches (for debugging or testing)."""
|
|
143
|
+
_reset_caches(cls)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def update_abstractmethods(cls):
|
|
147
|
+
"""Recalculate the set of abstract methods of an abstract class.
|
|
148
|
+
|
|
149
|
+
If a class has had one of its abstract methods implemented after the
|
|
150
|
+
class was created, the method will not be considered implemented until
|
|
151
|
+
this function is called. Alternatively, if a new abstract method has been
|
|
152
|
+
added to the class, it will only be considered an abstract method of the
|
|
153
|
+
class after this function is called.
|
|
154
|
+
|
|
155
|
+
This function should be called before any use is made of the class,
|
|
156
|
+
usually in class decorators that add methods to the subject class.
|
|
157
|
+
|
|
158
|
+
Returns cls, to allow usage as a class decorator.
|
|
159
|
+
|
|
160
|
+
If cls is not an instance of ABCMeta, does nothing.
|
|
161
|
+
"""
|
|
162
|
+
if not hasattr(cls, '__abstractmethods__'):
|
|
163
|
+
# We check for __abstractmethods__ here because cls might by a C
|
|
164
|
+
# implementation or a python implementation (especially during
|
|
165
|
+
# testing), and we want to handle both cases.
|
|
166
|
+
return cls
|
|
167
|
+
|
|
168
|
+
abstracts = set()
|
|
169
|
+
# Check the existing abstract methods of the parents, keep only the ones
|
|
170
|
+
# that are not implemented.
|
|
171
|
+
for scls in cls.__bases__:
|
|
172
|
+
for name in getattr(scls, '__abstractmethods__', ()):
|
|
173
|
+
value = getattr(cls, name, None)
|
|
174
|
+
if getattr(value, "__isabstractmethod__", False):
|
|
175
|
+
abstracts.add(name)
|
|
176
|
+
# Also add any other newly added abstract methods.
|
|
177
|
+
for name, value in cls.__dict__.items():
|
|
178
|
+
if getattr(value, "__isabstractmethod__", False):
|
|
179
|
+
abstracts.add(name)
|
|
180
|
+
cls.__abstractmethods__ = frozenset(abstracts)
|
|
181
|
+
return cls
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class ABC(metaclass=ABCMeta):
|
|
185
|
+
"""Helper class that provides a standard way to create an ABC using
|
|
186
|
+
inheritance.
|
|
187
|
+
"""
|
|
188
|
+
__slots__ = ()
|
|
@@ -0,0 +1,17 @@
|
|
|
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:]))
|